-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathhyper_learn.py
More file actions
48 lines (40 loc) · 1.57 KB
/
hyper_learn.py
File metadata and controls
48 lines (40 loc) · 1.57 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
# from plasma.models import runner
# from plasma.models.loader import Loader
# import numpy as np
# from hyperopt import Trials, tpe
# from plasma.conf import conf
# from pprint import pprint
# pprint(conf)
# #from plasma.primitives.shots import Shot, ShotList
# #from plasma.models.runner import train, make_predictions
# ,make_predictions_gpu
# if conf['data']['normalizer'] == 'minmax':
# from plasma.preprocessor.normalize import MinMaxNormalizer as Normalizer
# elif conf['data']['normalizer'] == 'meanvar':
# from plasma.preprocessor.normalize import MeanVarNormalizer as Normalizer
# elif conf['data']['normalizer'] == 'var':
# # performs !much better than minmaxnormalizer
# from plasma.preprocessor.normalize import VarNormalizer as Normalizer
# elif conf['data']['normalizer'] == 'averagevar':
# # performs !much better than minmaxnormalizer
# from plasma.preprocessor.normalize import (
# AveragingVarNormalizer as Normalizer
# )
# else:
# print('unkown normalizer. exiting')
# exit(1)
# np.random.seed(1)
# print("normalization", end='')
# nn = Normalizer(conf)
# nn.train()
# loader = Loader(conf, nn)
# shot_list_train, shot_list_validate, shot_list_test = loader.load_shotlists(
# conf)
# print("...done")
# print('Training on {} shots, testing on {} shots'.format(
# len(shot_list_train), len(shot_list_test)))
# specific_runner = runner.HyperRunner(conf, loader, shot_list_train)
# best_run, best_model = specific_runner.frnn_minimize(
# algo=tpe.suggest, max_evals=2, trials=Trials())
# print(best_run)
# print(best_model)