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_
|
|
|
|
}
|
|
|
|
|
2023-06-01 08:20:51 +00:00
|
|
|
n_epochs = 100
|
|
|
|
sens = 1e-9
|
|
|
|
energy_thrs = 100000
|
|
|
|
acc_thrs = 0.99
|
2022-04-16 12:20:44 +00:00
|
|
|
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())
|
|
|
|
|
2023-06-01 08:20:51 +00:00
|
|
|
#if os.path.exists("tmp"):
|
|
|
|
# os.remove("tmp")
|
|
|
|
#else:
|
|
|
|
# raise Exception("Tmp file not found")
|
2022-04-17 16:18:21 +00:00
|
|
|
|
|
|
|
print("Bayesian configured to run with width: {}".format(wide))
|
|
|
|
|
|
|
|
|
2023-06-01 08:20:51 +00:00
|
|
|
#if os.path.exists("bay"):
|
|
|
|
# os.remove("bay")
|
|
|
|
#else:
|
|
|
|
# raise Exception("Bay file not found")
|
|
|
|
|