code
stringlengths
3
6.57k
dcc.Location(id='url', refresh=False)
html.Section(id='page-content')
app.callback(Output('page-content', 'children')
Input('url', 'pathname')
display_page(pathname)
pathname.startswith('/examples/')
callback_example(pathname)
app.run_server(debug=True, port=5555, threaded=True)
app.run_server(app, debug=True, port=5555, threaded=True)
asyncio.run(run)
strategy (ES)
__init__(self, tuneclass, inputfile, tuneblock, logo)
int(self.tuneblock["n_last_episodes"])
int(self.tuneblock["ncores"])
int(self.tuneblock["ncases"])
int(self.ncases/self.popsize)
print("Performing semi-GA Tune")
print("Performing ES Tune")
print("Performing ES Tune")
dict()
dict()
os.path.exists('./tunecases/')
shutil.rmtree('./tunecases/')
os.makedirs('./tunecases/', exist_ok=True)
os.makedirs('./tunecases/', exist_ok=True)
open (self.inputfile, 'r')
input_file_text.readlines()
range(len(self.template)
if ('READ TUNE' in self.template[i])
if ('END TUNE' in self.template[i])
raise ('TUNE card cannot be found')
join(self.template)
tune_count(self)
ValueError('parameter {} in TUNE block cannot be found in any other block, e.g. DQN, GA, PPO, etc.'.format(item)
split(",")
item.strip()
float(item_lst[0])
float(item_lst[1])
self.datatypes.append("float")
print ('-- debug: parameter {} has uniform distribution of type --float-- between {} and {}'.format(item,item_lst[0],item_lst[1])
float(item_lst[0])
float(item_lst[1])
self.datatypes.append("float")
print ('-- debug: parameter {} has uniform distribution of type --float-- between {} and {}'.format(item,item_lst[0],item_lst[1])
Exception ('--error: TUNE cannot construct the user-given uniform distribution of --floats-- for {} according to (low, high, u)
format(item)
int(item_lst[0])
int(item_lst[1])
self.datatypes.append("int")
print ('-- debug: parameter {} has uniform distribution of type --int-- between {} and {}'.format(item,item_lst[0],item_lst[1])
int(item_lst[0])
int(item_lst[1])
self.datatypes.append("int")
print ('-- debug: parameter {} has uniform distribution of type --int-- between {} and {}'.format(item,item_lst[0],item_lst[1])
Exception ('--error: TUNE cannot construct the user-given uniform distribution of --int-- for {} according to (low, high, u)
format(item)
element_lst.append(int(element.strip()
element_lst.append(float(element.strip()
element_lst.append(str(element.strip()
self.datatypes.append("grid")
print ('-- debug: parameter {} has grid type with values {}'.format(item,item_lst)
Exception ('--error: TUNE cannot construct the user-given grid for {} according to the comma-seperated syntax'.format(item)
len(self.param_dict.keys()
len(self.param_dict.keys()
gen_cases(self, x=0)
self.tune_count()
list(self.param_dict.keys()
os.path.dirname(os.path.abspath(__file__)
self.here.replace('src/tune','neorl.py')
self.here.replace('neorl/src/tune','anaconda3/bin/python3')
print('--debug: NEORLPATH=', self.neorl_path)
print('--debug: PYTHONPATH=', self.python_path)
GenES(self)
ind (list)
strategy (list)
len(self.param_dict.keys()
list(self.param_dict.keys()
content.append(random.randint(self.param_dict[key][0], self.param_dict[key][1])
content.append(random.randint(self.param_dict[key][0], self.param_dict[key][1])
content.append(random.uniform(self.param_dict[key][0], self.param_dict[key][1])
content.append(random.uniform(self.param_dict[key][0], self.param_dict[key][1])
list(self.param_dict[key])
self.real_grid.remove('grid')
content.append(random.sample(self.real_grid, 1)
len(content)
Exception('unknown data type is given, either int/randint, float/u, or grid are allowed for parameter distribution types')
self.LOW.append(self.param_dict[key][0])
self.UP.append(self.param_dict[key][1])
list(content)
len(list(self.param_dict.keys()
random.uniform(self.SMIN, self.SMAX)
range(size)
init_pop(self)
pop (dict)
parallel (these samples will be used to initialize the memory)
defaultdict(list)
range(self.popsize)
format(0,i+1)
self.GenES()
append(data[0])