diff --git a/01.RunningPyNNSimulations/RunningPyNNSimulationsOnSpiNNaker.ipynb b/01.RunningPyNNSimulations/RunningPyNNSimulationsOnSpiNNaker.ipynb index 9a58114..f1eca75 100755 --- a/01.RunningPyNNSimulations/RunningPyNNSimulationsOnSpiNNaker.ipynb +++ b/01.RunningPyNNSimulations/RunningPyNNSimulationsOnSpiNNaker.ipynb @@ -116,15 +116,9 @@ "of the current is added over a number of timesteps, with the current decaying exponentially between each.\n", "A longer decay rate will result in more charge being added overall per spike that crosses the synapse.\n", "\n", - "In the above example, the default parameters of the IF_curr_exp are used. These are shown below." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ + "In the above example, the default parameters of the IF_curr_exp are used. These are shown below.\n", + "\n", + "```\n", "lif_curr_exp_params = {\n", " 'cm': 1.0, # The capacitance of the LIF neuron in nano-Farads\n", " 'tau_m': 20.0, # The time-constant of the RC circuit, in milliseconds\n", @@ -135,7 +129,8 @@ " 'tau_syn_E': 5.0, # The excitatory input current decay time-constant\n", " 'tau_syn_I': 5.0, # The inhibitory input current decay time-constant\n", " 'i_offset': 0.0, # A base input current to add each timestep\n", - "}" + "}\n", + "```" ] }, { @@ -147,19 +142,14 @@ "value of the membrane voltage; the higher the membrane voltage, the more input is required to cause a\n", "spike. This is modelled as the reversal potential of the synapse; when the membrane potential equals the\n", "reversal potential, no current will flow across the synapse. A conductance-based version of the LIF model\n", - "is provided, which, in addition to the above parameters, also supports the following." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ + "is provided, which, in addition to the above parameters, also supports the following.", + "\n", + "```\n", "lif_cond_exp_extra_params = {\n", " 'e_rev_E': 0., # The reversal potential of the excitatory synapse\n", " 'e_rev_I': -80.0 # The reversal potential of the inhibitory synapse\n", - "}" + "}\n", + "```" ] }, { @@ -168,16 +158,10 @@ "source": [ "The initial value of the state variables of the neural model can also be set (such as the membrane voltage).\n", "This is done via the initialize function of the population, which takes the name of the state variable (e.g. v\n", - "for the membrane voltage), and the value to be assigned e.g. the initial voltage can be set to -65.0mV as follows." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "pop_1.initialize(v=-65.0)" + "for the membrane voltage), and the value to be assigned e.g. the initial voltage can be set to -65.0mV as follows.\n", + "```\n", + "pop_1.initialize(v=-65.0)\n", + "```" ] }, { @@ -208,15 +192,7 @@ "\n", "As well as a connector the Projection must also have a synapse_type which determines how the synapse\n", "behaves when spikes are received. For example a StaticSynapse which has fixed weights and delays is\n", - "specified as shown below." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ + "specified as shown below.\n", "synapse_type=sim.StaticSynapse(weight=0.75, delay=1.0)" ] }, @@ -326,19 +302,14 @@ "### STDP in PyNN\n", "The steps for creating a network using STDP are much the same as previously described, with the main\n", "difference being that some of the projections use a STDPMechanism to describe the plasticity. Below is an\n", - "example of the creation of a projection with STDP." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ + "example of the creation of a projection with STDP.\n", + "\n", + "```\n", "timing_rule = sim.SpikePairRule(tau_plus=20.0, tau_minus=20.0, A_plus=0.5, A_minus=0.5)\n", "weight_rule = sim.AdditiveWeightDependence(w_max=5.0, w_min=0.0)\n", "stdp_model = sim.STDPMechanism(timing_dependence=timing_rule, weight_dependence=weight_rule, weight=0.0, delay=5.0)\n", - "stdp_projection = sim.Projection(input, pop_1, sim.OneToOneConnector(), synapse_type=stdp_model)" + "stdp_projection = sim.Projection(input, pop_1, sim.OneToOneConnector(), synapse_type=stdp_model)\n", + "```" ] }, { @@ -423,13 +394,6 @@ " - Create an STDP curve graph using a SpikeSourceArray stimulating a LIF population, with varying spike times for the SpikeSourceArray.\n", " - See the notebook for further extensions.\n" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/01.RunningPyNNSimulations/solutions/task4-solutions.ipynb b/01.RunningPyNNSimulations/solutions/task4-solutions.ipynb index 2b8e646..964abc4 100755 --- a/01.RunningPyNNSimulations/solutions/task4-solutions.ipynb +++ b/01.RunningPyNNSimulations/solutions/task4-solutions.ipynb @@ -195,7 +195,7 @@ "source": [ "weights = proj.get([\"weight\"], \"list\")\n", "p.end()\n", - "print weights" + "print(weights)" ] }, {