if __name__ == '__main__': showPlots = not (len(sys.argv) == 2 and sys.argv[1] == '-nogui') sim_vars = {'amp': 65, 'period': 250, 'offset': -10} min_constraints = [60, 150, -20] max_constraints = [100, 300, 20] swc = SineWaveController(1000, 0.1) times, volts = swc.run_individual(sim_vars, showPlots, False) weights={'value_200': 1.0, 'value_400': 1.0, 'value_812': 1.0} data_analysis = evaluators.PointBasedAnalysis(volts, times) targets = data_analysis.analyse(weights.keys()) print("Target data: %s"%targets) #make an evaluator my_evaluator=evaluators.PointValueEvaluator(controller=swc, parameters=sim_vars.keys(),
# Implementation of SineWaveController # moved to: https://github.com/pgleeson/neurotune/blob/master/neurotune/controllers.py from neurotune.controllers import SineWaveController if __name__ == '__main__': sim_vars = {'amp': 65, 'period': 250, 'offset': -10} swc = SineWaveController(1000, 0.1) swc.run_individual(sim_vars, True, True)
from neurotune.controllers import SineWaveController if __name__ == '__main__': sim_vars = {'amp': 65, 'period': 250, 'offset': -10} min_constraints = [60, 150, -50] max_constraints = [100, 300, 50] swc = SineWaveController(1000, 0.1) swc.run_individual(sim_vars, True, False) times, volts = swc.run_individual(sim_vars, False) analysis_var={'peak_delta':0,'baseline':0,'dvdt_threshold':0, 'peak_threshold':0} surrogate_analysis=analysis.IClampAnalysis(volts, times, analysis_var, start_analysis=0, end_analysis=1000, smooth_data=False, show_smoothed_data=False) # The output of the analysis will serve as the basis for model optimization: surrogate_targets = surrogate_analysis.analyse()