Efficiency-of-Neural-Archit.../config_bayesian.py

42 lines
951 B
Python
Raw Normal View History

2022-04-16 12:20:44 +00:00
############### Configuration file for Bayesian ###############
2022-04-17 16:18:21 +00:00
import os
2022-04-16 12:20:44 +00:00
layer_type = 'lrt' # 'bbb' or 'lrt'
activation_type = 'softplus' # 'softplus' or 'relu'
priors={
'prior_mu': 0,
'prior_sigma': 0.1,
'posterior_mu_initial': (0, 0.1), # (mean, std) normal_
'posterior_rho_initial': (-5, 0.1), # (mean, std) normal_
}
n_epochs = 200
lr_start = 0.001
num_workers = 4
valid_size = 0.2
batch_size = 256
train_ens = 1
valid_ens = 1
beta_type = 0.1 # 'Blundell', 'Standard', etc. Use float for const value
2022-04-17 16:18:21 +00:00
with open("bay", "r") as file:
bay = int(file.read())
if bay == 1:
with open("tmp", "r") as file:
wide = int(file.read())
if os.path.exists("tmp"):
os.remove("tmp")
else:
raise Exception("Tmp file not found")
print("Bayesian configured to run with width: {}".format(wide))
if os.path.exists("bay"):
os.remove("bay")
else:
raise Exception("Bay file not found")