nrv.optim
Description
OPTIMIZATION methods - optim: automated optimization of any simulation parameter
optim has been designed to enable optimization or automated space search of parameters. Any simulation can be considered as a context for optimization. NRV has to simple descriptors for optimization of geometrical quantities as well as stimulation waveforms. However, there is no formal restriction and specific search space can be described by the used (even electrophysiological quantities or morphology).
The The optimization problem, defined in a Problem
-class, couples a
Cost_Function
-object, which evaluates the cost of the problem based on
user-specified outcomes, to an optimization method or algorithm embedded in
a Optimizer
-object (see below for access to class description).
The Cost_Function-class is constructed around 389 four main objects:
a filter: which is an optional Python
callable
-object, for vector formatting or space restriction of the optimization space,a static context: it defines the starting point of the simulation model to be optimized. It can be any of the
nmod
-objects or more genenerally a NRVsimulable
-object,a
ContextModifier
-object: it updates the static context according to the output of the optimization algorithm and the optimization space. TheContextModifier
-object is an abstract class, and two daughter classes for specific optimization problems are currently predefined: for stimulus waveform or geometry optimization (see below in the class list). Novel form of user-defined optimization should be described in a custom class that inherits fromContextModifier
,a CostEvaluation-class, which is a generic Python callable-class, and that can also be user-defined.
Optimization methods and algorithms implemented in NRV rely on third-party optimization libraries:
SciPy optimize, that should be prefered for continuous problems,
Pyswarms for Particle Swarms Optimization metaheuristic in high-dimensional or discontinuous cases.
Subpackages
NeuRon Virtualizer, large scale modeling of Peripheral Nervous System with random stimulation waveforms optim utils submodule |
Classes
|
Problem Class |
|
|
|
|
|
Perform a Particle swarm optimization (PSO) on with a defined cost function using pyswarms library[1] |
|
A class to define cost from position input vector |
Functions
Generate a cost function for a swarm from a cost function for a particle |