Beispiel #1
0
Datei: main.py Projekt: jahuth/ni
		model.name = "Model " +str(cell)+ "/adaptive/" + str(knot_rate)
		models[cell][model.name] = model

E1 = 'trial_reshuffle_'
E1b = 'time_reshuffle_'
E2 = 'simple_model_'
E3 = 'complex_model_'

Es = [E1, E1b, E2, E3]



job "E1.1. Evaluate Models for Trial Reshuffling" for cell in model_cells for model in range(len(models[0])):
	m = models[cell][sorted(models[cell].keys())[model]]
	with View(job_path + '_results.html') as view:
		b = bootstrap.bootstrap_trials(50,m,data,test_data=[test_data],shuffle=True)
		stats.addNode(m.name,b)
		for (dim, name) in [('EIC','EIC')]:
			with view.figure("Cells/tabs/Cell "+str(cell)+"/tabs/"+str(name)):
				plot(stats.get(dim))
		for k in stats.keys():
			with view.figure("Cells/tabs/Cell "+str(cell)+"/tabs/Betas/tabs/"+str(k)):
				for b in stats.filter(k).get('beta'): 
					plot(b)
				for b in stats.filter(k).get('boot_betas'): 
					for bb in b:
						plot(bb,'--')
		view.render(job_path + '_results.html')
		stats.save(path + identifier  + E1 + '_' + str(cell) + "_" + str(m.name).replace("/","_") + '_stats.stat')
job "E1.2. Saving Data":
	require previous
					crosshistory = sorted([cell,c1,c2])
					model = ni.model.ip.Model(ni.model.ip.Configuration({'cell':cell, 'crosshistory':crosshistory}))
					model.name = "Model " +str(cell)+ "/" +str("/".join([str(c) for c in crosshistory]))
					models[cell][model.name] = model


E1 = 'reshuffle_trials_'
E1b = 'reshuffle_time_'
E2 = 'simple_model_'
E3 = 'complex_model_'
Es = [E1,E1b,E2,E3]

job "E1.1. Evaluate Models for Trial Reshuffling" for cell in model_cells for model in range(len(models[0])):
	m = models[cell][sorted(models[cell].keys())[model]]
	with View(job_path + '_results.html') as view:
		b = bootstrap.bootstrap_trials(50,m,data,test_data=[test_data])
		stats.addNode(m.name,b)
		for (dim, name) in [('EIC','EIC')]:
			with view.figure("Cells/tabs/Cell "+str(cell)+"/tabs/"+str(name)):
				plot(stats.get(dim))
		for k in stats.keys():
			with view.figure("Cells/tabs/Cell "+str(cell)+"/tabs/Betas/tabs/"+str(k)):
				for b in stats.filter(k).get('beta'): 
					plot(b)
				for b in stats.filter(k).get('boot_betas'): 
					for bb in b:
						plot(bb,'--')
		view.render(job_path + '_results.html')
		stats.save(path + identifier  + E1 + '_' + str(cell) + "_" + str(m.name).replace("/","_") + '_stats.stat')
job "E1.2. Saving Data":
	require previous