-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPPGVAE_ModelArgs.py
More file actions
71 lines (57 loc) · 2.17 KB
/
Copy pathPPGVAE_ModelArgs.py
File metadata and controls
71 lines (57 loc) · 2.17 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import torch
from dataclasses import dataclass
from typing import Callable
#from PPG_Gauss_Helperfunctions import mae, unit_0_1
device = (
"cuda"
if torch.cuda.is_available()
else "mps"
if torch.backends.mps.is_available()
else "cpu"
)
@dataclass
class ModelArgs:
γ_discriminator: float = 50.0
λₖₚ: float = 1 # regularization paramater for kp should be ~0.1 as we are using MAE
λᵣₑ: float = 0.1 # regularization paramater for reg
toprint_plots: int = 400
epochs: int = 200 # number of epochs
input_dim: int = None # image size
latent_dim: int = 4 # latent dimension
hidden_dim: int = 32 # hidden dimension
use_dense: bool = True
dy_scale: float = 20 #default was 20 which is about +/-20* angled slope max, changing it to 5* and seeing what happens
shift_left_pad: int = 3
shift_right_pad: int = 3
use_slope:bool = True
use_slope_latdim_in_klloss: bool = False
use_slope_in_discrim: bool = False
use_outscaling: bool = True# nothing
device = device
nn_modeltype = "PPGVAE"
theta = 2/90
def get_config(self):
config = dict() # super(self).get_config().copy()
config.update({
'γ_discriminator': self.γ_discriminator,
'λₖₚ': self.λₖₚ,
'λᵣₑ': self.λᵣₑ,
'λₘ': self.λₘ,
'toprint_plots': self.toprint_plots,
'epochs': self.epochs,
'input_dim': self.input_dim,
'latent_dim': self.latent_dim,
'max_channels': self.max_channels,
'hidden_dim': self.hidden_dim,
'use_dense': self.use_dense,
'shift_left_pad': self.shift_left_pad,
'shift_right_pad': self.shift_right_pad,
'use_slope_latdim_in_klloss': self.use_slope_latdim_in_klloss,
'use_slope_in_discrim': self.use_slope_in_discrim,
'use_outscaling': self.use_outscaling,
'nn_modeltype': self.nn_modeltype,
'theta': self.theta,
})
return config
if __name__ == "__main__":
a = ModelArgs()