Skip to content

Commit a7ce813

Browse files
author
Sam Buercklin
committed
updated example.md to new syntax
1 parent 43691c4 commit a7ce813

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/src/example.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ struct LIF{T<:Number}<:AbstractNeuron
3232
end
3333
3434
```
35-
Additionally, we need to define how to evolve our neuron given a time step. This is done by adding a method to `WaspNet.update!`, a function which is global across all `WaspnetElements`. To `update` a neuron, we provide the `neuron` we need to update, the `input_update` to the neuron, the time duration to evolve `dt`, and the current global time `t`. In the LIF case, the `input_update` is a voltage which must be added to the membrane potential of the neuron resulting from spikes in neurons which feed into the current neuron. `reset` simply restores the state of the neuron to its some state.
35+
Additionally, we need to define how to evolve our neuron given a time step. This is done by adding a method to `WaspNet.update!` or `WaspNet.update`, a function which is global across all `WaspnetElements`. To `update` a neuron, we provide the `neuron` we need to update, the `input_update` to the neuron, the time duration to evolve `dt`, and the current global time `t`. In the LIF case, the `input_update` is a voltage which must be added to the membrane potential of the neuron resulting from spikes in neurons which feed into the current neuron. `reset` simply restores the state of the neuron to its some state.
3636

3737
We use an [Euler update](https://en.wikipedia.org/wiki/Euler_method) for the time evolution because of its simplicity of implementation.
3838

3939
Note that both `update` and `reset` are defined *within* `WaspNet`; that is, we actually define the methods `WaspNet.update` and `WaspNet.reset`. If defined externally, these methods are not visible to other methods from within `WaspNet`.
4040
```
41-
function update(neuron::LIF, input_update, dt, t)
41+
function WaspNet.update(neuron::LIF, input_update, dt, t)
4242
output = 0.
4343
4444
state = neuron.state + input_update # If an impulse came in, add it
@@ -65,7 +65,7 @@ update!(neuronLIF, 0., 0.001, 0)
6565
println(neuronLIF.state)
6666
# -49.993125
6767
68-
reset!(neuronLIF)
68+
neuronLIF = reset(neuronLIF)
6969
println(neuronLIF.state)
7070
# -55.0
7171
```

0 commit comments

Comments
 (0)