Skip to content

Latest commit

 

History

History
73 lines (54 loc) · 2.55 KB

bahl.rst

File metadata and controls

73 lines (54 loc) · 2.55 KB

A layer 5 pyramidal neuron implemented with NEURON

In this example we illustrate how we can subclass a NeuronModel <neuron_model> to customize the methods. We select a set of reduced models of layer 5 pyramidal neurons (Bahl et al., 2012). The code for this example is found in /examples/bahl/uq_bahl.py <../../../examples/bahl/uq_bahl.py>. To be able to run this example you require both the NEURON simulator, as well as the layer 5 pyramidal neuron model saved in the folder /bahl_model/.

Since the model is implemented in NEURON, we use the NeuronModel <neuron_model>. The problem is that this model require us to recalculate certain properties of the model after the parameters have been set. We therefore have to make change to the NeuronModel class so we recalculate these properties. The standard :py~uncertainpy.models.NeuronModel.run method implemented in NeuronModel calls :py~uncertainpy.models.NeuronModel.set_parameters to set the parameters. We therefore only need to change this method in the NeuronModel. First we subclass NeuronModel. For ease of use, we hardcode in the path to the Bahl model.

../../../examples/bahl/uq_bahl.py

We then implement a new set_parameters method, that recalculates the required properties after the parameters have been set.

../../../examples/bahl/uq_bahl.py

Now we can initialize our new model.

../../../examples/bahl/uq_bahl.py

We can then create the uncertain parameters, which we here set to be "e_pas" and "apical Ra". Here we do not create a Parameter <Parameters class> object, but use the parameter list directly, to show that this option exists.

../../../examples/bahl/uq_bahl.py

The we use SpikingFeatures <spiking>.

../../../examples/bahl/uq_bahl.py

Lastly we set up and perform the uncertainty quantification and sensitivity analysis.

../../../examples/bahl/uq_bahl.py

The complete code becomes:

../../../examples/bahl/uq_bahl.py