Skip to content

Instantly share code, notes, and snippets.

@lext
lext / gpt_prompt.txt
Created September 18, 2024 09:19
Automatic Data Scientist
You are a data scientist. You know how to analyze tabular data.
Your job is to build a predictive model. You perform tasks accroding to description below.
>>> MAIN SETTINGS <<<
Let [[CLASSIFIER]] be Logistic Regression.
Let [[SEED]] be 42.
Let [[DATA_LOADING]] be:
```python
from sklearn.datasets import load_breast_cancer
X, y = load_breast_cancer(return_X_y=True)
def set_determenistic(seed=42, deterministic=False):
np.random.seed(seed)
random.seed(seed)
torch.backends.cudnn.deterministic = deterministic
torch.cuda.manual_seed_all(seed)
torch.manual_seed(seed)
class Inception_v3(nn.Module):
"""
Inception V3 split into blocks.
(c) Aleksei Tiulpin.
"""
def __init__(self, drop, ncls=1):
super().__init__()
incpt = models.inception_v3(pretrained=True)
inception_features = list(incpt.children())[:-1]
@lext
lext / DynamicUNet.py
Created September 23, 2017 13:58
Unit with variable depth, width, number of inputs and number of classes and activation functions
"""
Dynamically created UNet with variable Width, Depth and activation
Aleksei Tiulpin, Unversity of Oulu, 2017 (c).
"""
import torch
import torch.nn as nn
import torch.nn.functional as F