-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.py
68 lines (55 loc) · 1.71 KB
/
options.py
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
class Options(object):
def __init__(self):
# Default Options
self.__options = {
# General
"seed": None,
"num_input_features": 250,
"learning_rate": 0.0005,
"num_epochs": 20,
"artifact_dir": "artifacts",
"problem": "coin", # also possible: 'fake' for fake sin data
# Coin Data Set Options
"path_to_coins": "data/all_coins_preprocessed.hdf5",
"hop_length": 125,
"sample_individual_timesteps": False, # If False: Uses data of size num_input_features as embedding
# Fake Data Generator Options
"num_predict_forward_steps": 1,
"num_samples": 100,
"window_size": 100,
"batch_size": 10,
"add_noise": True,
"noise_range": 0.2,
"num_random_frequencies": 5,
"random_frequency_range_low": 0.1,
"random_frequency_range_high": 1.0,
"scaler_min": -1.0,
"scaler_max": 1.0,
# Encoder Layer Options
"encoder_number_of_heads": 10,
"encoder_feedforward_dimension": 2048,
"encoder_dropout": 0.1,
"encoder_activation": "relu",
# Encoder Layer Stacking Options
"num_encoder_layers": 1,
"norm": None,
# Decoder Options
"weight_intialization_range": 0.1,
"classifier_hidden_size": 100
}
def get_option_names(self):
return self.__options.keys()
def __setattr__(self, name, value):
if name == "_Options__options":
object.__setattr__(self, name, value)
option_keys = self.__options.keys()
if name in option_keys:
self.__options[name] = value
object.__setattr__(self, name, value)
def __getattribute__(self, name):
if name == "_Options__options":
return object.__getattribute__(self, name)
option_keys = self.__options.keys()
if name in option_keys:
return self.__options[name]
return object.__getattribute__(self, name)