-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhyperparameters.py
More file actions
36 lines (27 loc) · 898 Bytes
/
hyperparameters.py
File metadata and controls
36 lines (27 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from datetime import datetime
import torch
import ivimnet
from pathlib import Path
class Config:
def __init__(self):
# Path to data
self.path_data = Path("path/to/data/file.mat")
# Path to save directory
dt_string = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
self.save_dir = self.path_data.parent / f"training_{dt_string}"
self.save_dir.mkdir(parents=True, exist_ok=True)
# Neural net
self.net = ivimnet.IVIMNetSigm
# Optimizer
self.optim = torch.optim.Adam
self.learning_rate = 0.005
#
self.criterion = torch.nn.MSELoss(reduction='mean')
self.batch_size = 128
self.max_it = 1024
self.patience = 4
self.split = True
self.split_ratio = 0.8
self.batch_size_val = 8192
self.max_it_val = 512
self.save_estimates = True