-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathemdiffuse_conifg.py
More file actions
30 lines (26 loc) · 966 Bytes
/
emdiffuse_conifg.py
File metadata and controls
30 lines (26 loc) · 966 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
class EMDiffuseConfig():
def __init__(self, config, path, phase, batch_size, lr=5e-5, resume=None, gpu='0', subsample=None, port='21012', mean=2, step=None):
self.path = path
self.config = config
self.phase = phase
self.batch = batch_size
self.gpu = gpu
self.debug = False
self.z_times = subsample
self.port = port
self.resume = resume
self.mean = mean
self.lr = lr
self.step=step
def __getattr__(self, item):
# This method is called when an attribute access is attempted.
try:
return self.__dict__[item]
except KeyError:
return None
def __setattr__(self, key, value):
# This method allows setting attributes directly.
self.__dict__[key] = value
def __contains__(self, item):
# This enables the use of 'in' to check for attribute existence.
return item in self.__dict__