odynn.noptim module

class odynn.noptim.NeuronOpt(neuron)[source]

Bases: odynn.optim.Optimizer

Class for optimization of a neuron

Methods

optimize(dir, train[, test, w, epochs, …]) Optimize the neuron parameters
settings(w, train) Give the settings of the optimization
plot_out  
__init__(neuron)[source]

Initializer, takes a NeuronTf object as argument

Parameters:neuron (NeuronTf) – Neuron to be optimized
optimize(dir, train, test=None, w=(1, 0), epochs=700, l_rate=(0.1, 9, 0.92), suffix='', step=None, reload=False, reload_dir=None, evol_var=True, plot=True)[source]

Optimize the neuron parameters

Parameters:
  • dir (str) – path to the directory for the saved files
  • train (list of ndarray) –

    list containing [time, input, voltage, ion_concentration] that will be used fitted dimensions : - time : [time]

    • input, voltage and concentration : [time, batch]
  • test (list of ndarray) – same as train for the dimensions These arrays will be used fo testing the model (Default value = None)
  • w (list) – list of weights for the loss, the first value is for the voltage and the following ones for the ion concentrations defined in the model. (Default value = [1, 0]:
  • epochs (int) – Number of training steps (Default value = 700)
  • l_rate (tuple) – Parameters for an exponential decreasing learning rate : (start, number of constant steps, exponent) (Default value = [0.1, 9, 0.92]:
  • suffix (str) – suffix for the saved files (Default value = ‘’)
  • step – (Default value = None)
  • reload (bool) – If True, will reload the graph saved in reload_dir (Default value = False)
  • reload_dir (str) – The path to the directory of the experience to reload (Default value = None)
Returns:

neuron attribute after optimization

Return type:

NeuronTf

plot_out(X, results, res_targ, suffix, step, name, i)[source]