code stringlengths 3 6.57k |
|---|
choices.remove(ind[i]) |
random.choice(choices) |
random.gauss(0,1) |
random.random() |
np.exp(tau*norm + tau_prime * random.gauss(0,1) |
random.gauss(0,1) |
Exception('ES mutation strategy works with int, float, or grid distributions, the type provided cannot be interpreted') |
GenOffspring(self, pop) |
pop (dict) |
offspring (dict) |
list(range(0,len(pop) |
defaultdict(list) |
range(self.popsize) |
random.random() |
random.sample(pop_indices,2) |
self.cx(ind1=list(pop[index1][0]) |
list(pop[index2][0]) |
list(pop[index1][1]) |
list(pop[index2][1]) |
append(ind1) |
append(strat1) |
print('crossover is done for sample {} between {} and {}'.format(i,index1,index2) |
random.choice(pop_indices) |
self.mutES(ind=list(pop[index][0]) |
list(pop[index][1]) |
append(ind) |
append(strat) |
print('mutation is done for sample {} based on {}'.format(i,index) |
random.choice(pop_indices) |
append(pop[index][0]) |
append(pop[index][1]) |
print('reproduction is done for sample {} based on {}'.format(i,index) |
run_cases(self) |
open (self.csvlogger, 'w') |
fout.write('caseid, ') |
fout.write(item + ',') |
fout.write('mean_reward,max_reward\n') |
print('PARAM dict', self.param_dict) |
print('PARAM types', self.datatypes) |
self.init_pop() |
range(1, self.ngens) |
format(ind) |
range(self.currentcase, self.currentcase+self.popsize+1) |
self.GenOffspring(pop=self.population) |
core_list.append([offspring[key][0], caseids[case_idx]]) |
Pool(self.ncores) |
p.map(self.gen_object, core_list) |
p.close() |
p.join() |
append(fitness[ind]) |
range(len(offspring) |
range(len(offspring) |
self.fit(offspring[ind][0], caseids[case_idx]) |
append(fitness) |
copy.deepcopy(self.select(pop=offspring) |
pd.read_csv('tune.csv') |
csvdata.sort_values(by=['caseid'],ascending=True) |
csvdata.sort_values(by=['mean_reward'],ascending=False) |
csvdata.sort_values(by=['max_reward'],ascending=False) |
asc_data.to_csv('tune.csv', index=False) |
np.mean(des_data.iloc[:,4:5]) |
mean.tolist() |
len([print ('failed') |
isinstance(item, str) |
print ('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%') |
print('Mean Rewards for all cases=', totalmean) |
print ('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%') |
print ('All TUNE CASES ARE COMPLETED') |
print ('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%') |
print('--debug: Check tunesummary.txt file for best hyperparameters found') |
print('--debug: Check tune.csv file for complete csv logger of all cases results') |
print('--debug: Check tunecases directory for case-by-case detailed results') |
open ('tunesummary.txt', 'w') |
fout.write(self.logo) |
fout.write('*****************************************************\n') |
fout.write('Summary for the TUNE case \n') |
fout.write('*****************************************************\n') |
fout.write('Number of cases evaluated: {} \n'.format(self.ncases) |
fout.write('Number of failed cases: {} \n'.format(failed_cases) |
fout.write('Parameter names: {} \n'.format(self.param_names) |
fout.write('Parameter values: {} \n '.format(self.param_dict) |
fout.write ('--------------------------------------------------------------------------------------\n') |
fout.write ('Top {} hyperparameter configurations ranked according to MEAN reward \n'.format(top) |
fout.write(des_data.iloc[:top].to_string(index=False) |
fout.write ('Top {} hyperparameter configurations ranked according to MEAN reward \n'.format(top) |
fout.write(des_data.iloc[:top].to_string(index=False) |
fout.write ('\n') |
fout.write ('--------------------------------------------------------------------------------------\n') |
fout.write ('Top {} hyperparameter configurations ranked according to MAX reward \n'.format(top) |
fout.write(des_data2.iloc[:top].to_string(index=False) |
fout.write ('Top {} hyperparameter configurations ranked according to MAX reward \n'.format(top) |
fout.write(des_data2.iloc[:top].to_string(index=False) |
parse_args() |
argparse.ArgumentParser(description='Train a Fast R-CNN network') |
parser.parse_args() |
parse_args() |
print('Called with args:') |
print(args) |
torch.cuda.is_available() |
print("WARNING: You have a CUDA device, so you should probably run with --cuda") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.