-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcreate_exp
45 lines (33 loc) · 1.27 KB
/
create_exp
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
import pyDOE
import pandas as pd
import numpy as np
from scipy.stats.distributions import gamma
import matplotlib.pyplot as plt
import random
bound_alpha = [1e-6, 1e-2]
bound_beta = [1e-6, 1e-2]
bound_epochs = [1, 100]
al = pyDOE.lhs(3, criterion="maximin", samples=40)
means = [0.1, 0.0001]
stds = [0.2, 0.1]
# for i in range(2):
# al[:, i] = gamma(a = 1.99, loc = means[i], scale = stds[i]).ppf(al[:, i])
epochs = []
alpha = []
beta = []
lr = []
for exp in al:
alpha += [(bound_alpha[1] - bound_alpha[0])* exp[0] + bound_alpha[0]]
beta += [(bound_beta[1] - bound_beta[0])* exp[1] + bound_beta[0]]
epochs += [int((bound_epochs[1] - bound_epochs[0])*exp[2]+bound_epochs[0])]
for i in range(len(al)):
lr += [random.uniform(5e-6, 1e-1)/1e3]
file = open("call.sh", "w")
file.truncate(0)
for i in range(len(epochs)):
file.write("python3 -u main.py -source '01' -target '08' -intensity_ceil -0.50 -skip_blank 'False' -alpha "+str(alpha[i])+" -beta "+str(beta[i])+" -split_list '(([0,2,1,4], [3]),([0,1,2,4], [3]))' -epochs "+str(int(epochs[i]))+" -load_model 'True' -rev "+str(i)+" > Logs/output_"+str(i)+".log \n")
file.close()
df = pd.DataFrame([alpha, epochs, beta])
df = df.transpose()
df.columns = ["Alpha", "Epochs", "Beta"]
df.to_csv("./Config/exp.csv", header=True)