# neurotune Package¶

## controllers Module¶

The controllers module provides different controller classes, applicable to different simulations.

A controller object’s job is to control simulations- At a high level a controller objects accepts a list of parameters and chromosomes and (usually) returns corresponding simulation data. This is implemented polymporphically in subclasses. Each controller class must therefore provide a run method, which is used by the evaluator to run a simulation.

A controller must be able to accept simulation parameters (chromosomes) from the evaluator.

The evaluator is therefore only concerned with assigining fitness to chromosomes.

On the whole this allows for deep modularization - as long as the user can provide a controller which will (for instance) reutrn sample and time arrays for arbitrary chromosome and parameter lists a range of evaluators would be able to utilise it.

class neurotune.controllers.CLIController(cli_argument)[source]

Bases: neurotune.controllers.__Controller

Control simulations via command line arguments executed through the Python os module.

run(candidates, parameters, fitness_filename='evaluations')[source]
class neurotune.controllers.NrnProject(nrnproject_path, db_path, exp_id=None)[source]

Bases: neurotune.controllers.__Controller

Run an nrnproject simulation based on optimizer parameters.

run(candidates, parameters)[source]
class neurotune.controllers.NrnProjectCondor(host, username, password, port=80, local_analysis=False, candidates_per_job=100)[source]

Run NrnProject-based simulations on a Condor-managed federated system

class neurotune.controllers.SineWaveController(sim_time, dt)[source]

Bases: neurotune.controllers.__Controller

Simple sine wave generator which takes a number of variables (‘amp’, ‘period’, ‘offset’) and produces an output based on these.

run(candidates, parameters)[source]

Run simulation for each candidate

This run method will loop through each candidate and run the simulation corresponding to its parameter values. It will populate an array called traces with the resulting voltage traces for the simulation and return it.

run_individual(sim_var, gen_plot=False, show_plot=False)[source]

Run an individual simulation.

The candidate data has been flattened into the sim_var dict. The sim_var dict contains parameter:value key value pairs, which are applied to the model before it is simulated.

## optimizers Module¶

Optimizer objects live here.

class neurotune.optimizers.CustomOptimizerA(max_constraints, min_constraints, evaluator, mutation_rate=0.2, max_evaluations=100, population_size=10, num_selected=None, tourn_size=2, num_elites=1, maximize=False, num_offspring=None, seeds=[], verbose=False)[source]

Bases: neurotune.optimizers.__Optimizer

optimize(do_plot=True, seed=1502787975, summary_dir=None)[source]