-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconf_dict_new.py
87 lines (68 loc) · 2.65 KB
/
conf_dict_new.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
from trace_lists import low_bandwidth_traces, medium_bandwidth_traces, high_bandwidth_traces, train, test, train_v2, test_v2, train_v3, test_v3
from trace_lists import opennetlab_traces, norway_traces, ghent_traces, ny_traces
import pandas as pd
# Set the list of traces to train on: list_traces_curr
# If curriculum learning, set curr=True and set continue_training=True
# Running in Terminal 1
#-------------------------------------------------
# Training a curriculum
# Base model
conf_name_root = "random_all_data"
conf_name_curr_list = "random_all_data_curr2"
# Episode where to start the current curriculum
from_ep = 80
from_ep_for_curriculum_list = 80 # Will be different from from_ep only if running was stopped mid-20 episodes and has to be rerun
to_ep = 100
curr = True
first_iteration_curr = False
#--------------------------------------------------
# # # Running in Terminal 2
# #-------------------------------------------------
# # Training a curriculum
# # Base model
# conf_name_root = "random_train_80_20_v2"
# conf_name_curr_list = "random_train_80_20_v2_curr2"
# # Episode where to start the current curriculum
# from_ep = 80
# from_ep_for_curriculum_list = 80 # Will be different from from_ep only if running was stopped mid-20 episodes and has to be rerun
# to_ep = 100
# curr = True
# first_iteration_curr = False
# #--------------------------------------------------
# #Running in Terminal 1
# #-------------------------------------------------
# # Training a new model
# conf_name_root = "random_low_bandwidth"
# from_ep = 59
# to_ep = 75
# curr = False
# list_traces_curr = low_bandwidth_traces
# #--------------------------------------------------
num_timesteps = 80000
list_traces_curr_path = f'./curriculum_lists/{conf_name_curr_list}/ep{from_ep_for_curriculum_list}.pkl'
list_traces_curr = pd.read_pickle(list_traces_curr_path)
print(f"Taking list of traces from: {list_traces_curr_path}")
if curr == False:
print("Curr is FALSE, you are training a new model")
take_dir = f"{conf_name_root}"
tensorboard_dir = f"./tensorboard_logs/{conf_name_root}/"
save_subfolder = f"{conf_name_root}/"
else:
if first_iteration_curr:
take_dir = f"{conf_name_root}"
else:
take_dir = f"{conf_name_root}/curr2/"
tensorboard_dir = f"./tensorboard_logs/{conf_name_root}/curr2/"
save_subfolder = f"{conf_name_root}/curr2/"
new_input_conf = dict(
tensorboard_dir = tensorboard_dir,
save_subfolder = save_subfolder,
suffix = conf_name_root,
num_timesteps = num_timesteps,
trace_set = list_traces_curr,
num_episodes = to_ep,
seed = 5,
continue_training = True,
model_num = from_ep * num_timesteps,
take_dir = take_dir
)