Skip to content

Commit 6580073

Browse files
authored
Update core concepts documentation and LIF neuron dynamics (#800)
* Refactor neural network classes and update progress bar parameters for simulations * Refactor documentation and update synapse initialization for clarity and consistency
1 parent c582f1f commit 6580073

File tree

15 files changed

+1088
-3743
lines changed

15 files changed

+1088
-3743
lines changed

brainpy/state/_lif.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ def __init__(
248248
V_reset: ArrayLike = 0. * u.mV,
249249
V_rest: ArrayLike = 0. * u.mV,
250250
V_initializer: Callable = braintools.init.Constant(0. * u.mV),
251+
noise: ArrayLike = None,
251252
spk_fun: Callable = braintools.surrogate.ReluGrad(),
252253
spk_reset: str = 'soft',
253254
name: str = None,
@@ -279,8 +280,8 @@ def update(self, x=0. * u.mA):
279280
V_th = self.V_th if self.spk_reset == 'soft' else jax.lax.stop_gradient(last_v)
280281
V = last_v - (V_th - self.V_reset) * last_spk
281282
# membrane potential
282-
dv = lambda v: (-v + self.V_rest + self.R * self.sum_current_inputs(x, v)) / self.tau
283-
V = brainstate.nn.exp_euler_step(dv, V)
283+
dv = lambda v, t: (-v + self.V_rest + self.R * self.sum_current_inputs(x, v)) / self.tau
284+
V = braintools.quad.ode_expeuler_step(dv, V, None)
284285
V = self.sum_delta_inputs(V)
285286
self.V.value = V
286287
return self.get_spike(V)

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
print(f"Error deleting {item}: {e}")
2929

3030
build_version = os.environ.get('CURRENT_VERSION', 'v2')
31+
build_version = os.environ.get('CURRENT_VERSION', 'v3')
3132
if build_version == 'v2':
3233
shutil.copytree(
3334
os.path.join(os.path.dirname(__file__), '../docs_classic'),

docs_state/README.md

Lines changed: 0 additions & 112 deletions
This file was deleted.

docs_state/api/index.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
API Reference
22
=============
33

4-
Complete API reference for ``brainpy.state``
4+
Complete API reference for ``brainpy.state``.
55

66
.. note::
77
``brainpy.state`` is built on top of `brainstate <https://brainstate.readthedocs.io/>`_,
@@ -49,10 +49,8 @@ The API is organized into the following categories:
4949

5050
Spike and current generators (PoissonSpike, SpikeTime)
5151

52-
Quick Reference
53-
---------------
54-
55-
**Most commonly used classes:**
52+
Example Reference
53+
-----------------
5654

5755
Neurons
5856
~~~~~~~
@@ -184,6 +182,7 @@ Readout Layers
184182
brainpy.state.LeakySpikeReadout(in_size=100, tau=5*u.ms, V_th=1*u.mV)
185183
186184
.. toctree::
185+
:hidden:
187186
:maxdepth: 2
188187

189188
neurons
@@ -192,4 +191,4 @@ Readout Layers
192191
synouts
193192
stp
194193
readouts
195-
inputs
194+
inputs

docs_state/apis.rst

Lines changed: 0 additions & 115 deletions
This file was deleted.

docs_state/examples/gallery.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,6 @@ Series of models exploring different gamma generation mechanisms:
142142
- Excitatory-inhibitory interaction
143143

144144

145-
**Combined**: `Susin_Destexhe_2021_gamma_oscillation.py <https://github.com/brainpy/BrainPy/tree/master/examples_state/Susin_Destexhe_2021_gamma_oscillation.py>`_ - All mechanisms
146-
147-
**Key Concepts**: Gamma mechanisms, network states, oscillation generation
148145

149146
Spiking Neural Network Training
150147
--------------------------------

docs_state/index.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Learn more
112112

113113
.. card:: :material-regular:`data_exploration;2em` ``brainpy`` APIs
114114
:class-card: sd-text-black sd-bg-light
115-
:link: https://brainpy.readthedocs.io/
115+
:link: https://brainpy.readthedocs.io
116116

117117

118118
----
@@ -131,7 +131,6 @@ See also the ecosystem
131131
:caption: Tutorials
132132

133133
quickstart/index.rst
134-
tutorials/index.rst
135134
examples/gallery.rst
136135

137136

0 commit comments

Comments
 (0)