BrainPy Examples
latest

Neuron Models

  • (Izhikevich, 2003) Izhikevich Model
  • (Brette, Romain. 2004) LIF phase locking
  • (Gerstner, 2005): Adaptive Exponential Integrate-and-Fire model
  • (Niebur, et. al, 2009) Generalized integrate-and-fire model
  • (Jansen & Rit, 1995): Jansen-Rit Model
  • (Teka, et. al, 2018): Fractional-order Izhikevich neuron model
  • (Mondal, et. al, 2019): Fractional-order FitzHugh-Rinzel bursting neuron model

Continuous-attractor Network

  • (Si Wu, 2008): Continuous-attractor Neural Network 1D
  • (Si Wu, 2008): Continuous-attractor Neural Network 2D
  • CANN 1D Oscillatory Tracking

Decision Making Model

  • (Wang, 2002) Decision making spiking model
  • (Wong & Wang, 2006) Decision making rate model

E/I Balanced Network

  • (Vreeswijk & Sompolinsky, 1996) E/I balanced network
  • (Brette, et, al., 2007) COBA
  • (Brette, et, al., 2007) CUBA
  • (Brette, et, al., 2007) COBA-HH
  • (Tian, et al., 2020) E/I Net for fast response

Brain-inspired Computing

  • Classify MNIST dataset by a fully connected LIF layer
  • Convolutional SNN to Classify Fashion-MNIST
  • (2022, NeurIPS): Online Training Through Time for Spiking Neural Networks
  • (2019, Zenke, F.): SNN Surrogate Gradient Learning
  • (2019, Zenke, F.): SNN Surrogate Gradient Learning to Classify Fashion-MNIST
  • (2021, Raminmh): Liquid time-constant Networks

Reservoir Computing

  • Predicting Mackey-Glass timeseries
  • (Gauthier, et. al, 2021): Next generation reservoir computing
  • (Sussillo & Abbott, 2009) FORCE Learning

Gap Junction Network

  • (Sherman & Rinzel, 1992) Gap junction leads to anti-synchronization
  • (Fazli and Richard, 2022): Electrically Coupled Bursting Pituitary Cells

Oscillation and Synchronization

  • (Wang & Buzsáki, 1996) Gamma Oscillation
  • (Brunel & Hakim, 1999) Fast Global Oscillation
  • (Diesmann, et, al., 1999) Synfire Chains
  • (Li, et. al, 2017): Unified Thalamus Oscillation Model
  • (Susin & Destexhe, 2021): Asynchronous Network
  • (Susin & Destexhe, 2021): CHING Network for Generating Gamma Oscillation
  • (Susin & Destexhe, 2021): ING Network for Generating Gamma Oscillation
  • (Susin & Destexhe, 2021): PING Network for Generating Gamma Oscillation

Large-Scale Modeling

  • (Joglekar, et. al, 2018): Inter-areal Balanced Amplification Figure 1
  • (Joglekar, et. al, 2018): Inter-areal Balanced Amplification Figure 2
  • (Joglekar, et. al, 2018): Inter-areal Balanced Amplification Figure 5

Recurrent Neural Network

  • (Sussillo & Abbott, 2009) FORCE Learning
  • Integrator RNN Model
  • Train RNN to Solve Parametric Working Memory
  • (Song, et al., 2016): Training excitatory-inhibitory recurrent network
  • (Masse, et al., 2019): RNN with STP for Working Memory
  • (Yang, 2020): Dynamical system analysis for RNN
  • (Bellec, et. al, 2020): eprop for Evidence Accumulation Task

Working Memory Model

  • (Bouchacourt & Buschman, 2019) Flexible Working Memory Model
  • (Mi, et. al., 2017) STP for Working Memory Capacity
  • (Masse, et al., 2019): RNN with STP for Working Memory

Dynamics Analysis

  • [1D] Simple systems
  • [2D] NaK model analysis
  • [2D] Wilson-Cowan model
  • [2D] Decision Making Model with SlowPointFinder
  • [2D] Decision Making Model with Low-dimensional Analyzer
  • [3D] Hindmarsh Rose Model
  • Continuous-attractor Neural Network
  • Gap junction-coupled FitzHugh-Nagumo Model
  • (Yang, 2020): Dynamical system analysis for RNN

Classical Dynamical Systems

  • Hénon map
  • Logistic map
  • Lorenz system
  • Mackey-Glass equation
  • Multiscroll chaotic attractor (多卷波混沌吸引子)
  • Rabinovich-Fabrikant equations
  • Fractional-order Chaos Gallery
    • Fractional-order Chua system
    • Fractional-order Qi System
    • Fractional-order Lorenz System
    • Fractional-order Liu System
    • Fractional-order Chen System
    • References

Unclassified Models

  • (Brette & Guigon, 2003): Reliability of spike timing
BrainPy Examples
  • <no title>
  • Fractional-order Chaos Gallery
  • Edit on GitHub

Fractional-order Chaos Gallery

[1]:
import brainpy as bp

import matplotlib.pyplot as plt
[2]:
def plot_runner_3d(runner):
  fig = plt.figure(figsize=(8, 6))
  ax = fig.add_subplot(111, projection='3d')
  plt.plot(runner.mon.x.flatten(),
           runner.mon.y.flatten(),
           runner.mon.z.flatten())
  ax.set_xlabel('x')
  ax.set_ylabel('y')
  ax.set_zlabel('z')
  plt.show()
[3]:
def plot_runner_2d(runner):
  plt.figure(figsize=(12, 6))
  plt.subplot(121)
  plt.plot(runner.mon.x.flatten(), runner.mon.y.flatten())
  plt.xlabel('x')
  plt.ylabel('y')
  plt.subplot(122)
  plt.plot(runner.mon.x.flatten(), runner.mon.z.flatten())
  plt.xlabel('x')
  plt.ylabel('z')
  plt.show()

Fractional-order Chua system

The fractional-order Chua’s system is given by [1]

\[\begin{split}\left\{\begin{array}{l} D^{\alpha_{1}} x=a\{y- (1+m_1) x-0.5*(m_0-m_1)*(|x+1|-|x-1|)\} \\ D^{\alpha_{2}} y=x-y+z \\ D^{\alpha_{3}} z=-b y-c z \end{array}\right.\end{split}\]
[4]:
a, b, c = 10.725, 10.593, 0.268
m0, m1 = -1.1726, -0.7872


def chua_system(x, y, z, t):
  f = m1 * x + 0.5 * (m0 - m1) * (abs(x + 1) - abs(x - 1))
  dx = a * (y - x - f)
  dy = x - y + z
  dz = -b * y - c * z
  return dx, dy, dz
[5]:
dt = 0.001
duration = 200
inits = [0.2, -0.1, 0.1]

integrator = bp.fde.GLShortMemory(chua_system,
                                  alpha=[0.93, 0.99, 0.92],
                                  num_memory=1000,
                                  inits=inits)

runner = bp.IntegratorRunner(integrator,
                             monitors=list('xyz'),
                             inits=inits,
                             dt=dt)
runner.run(duration)
WARNING:jax._src.lib.xla_bridge:No GPU/TPU found, falling back to CPU. (Set TF_CPP_MIN_LOG_LEVEL=0 and rerun for more info.)
[6]:
plot_runner_3d(runner)
../_images/classical_dynamical_systems_fractional_order_chaos_7_0.png
[7]:
plot_runner_2d(runner)
../_images/classical_dynamical_systems_fractional_order_chaos_8_0.png

Fractional-order Qi System

The fractional-order Qi chaotic system is given by

\[\begin{split}\left\{\begin{array}{l} D^{\alpha} x_{1}=a\left(x_{1}-x_{2}\right)+x_{2} x_{3} \\ D^{\alpha} x_{2}=c x_{1}-x_{2}-x_{1} x_{3} \\ D^{\alpha} x_{3}=x_{1} x_{2}-b x_{3} \end{array}\right.\end{split}\]
[8]:
a, b, c = 35, 8 / 3, 80


def qi_system(x, y, z, t):
  dx = -a * x + a * y + y * z
  dy = c * x - y - x * z
  dz = -b * z + x * y
  return dx, dy, dz
[9]:
dt = 0.001
duration = 200
inits = [0.1, 0.2, 0.3]

integrator = bp.fde.GLShortMemory(qi_system,
                                  alpha=0.98,
                                  num_memory=1000,
                                  inits=inits)

runner = bp.IntegratorRunner(integrator,
                             monitors=list('xyz'),
                             inits=inits,
                             dt=dt)
runner.run(duration)
[10]:
plot_runner_3d(runner)
../_images/classical_dynamical_systems_fractional_order_chaos_12_0.png
[11]:
plot_runner_2d(runner)
../_images/classical_dynamical_systems_fractional_order_chaos_13_0.png

Fractional-order Lorenz System

The fractional-order Lorenz system is given by [3]

\[\begin{split}\left\{\begin{array}{l} D^{\alpha} x=a\left(y-x\right) \\ D^{\alpha} y= x * (b - z) - y \\ D^{\alpha} z =x * y - c * z \end{array}\right.\end{split}\]
[12]:
a, b, c = 10, 28, 8 / 3


def lorenz_system(x, y, z, t):
  dx = a * (y - x)
  dy = x * (b - z) - y
  dz = x * y - c * z
  return dx, dy, dz
[13]:
dt = 0.001
duration = 50
inits = [1, 2, 3]

integrator = bp.fde.GLShortMemory(lorenz_system,
                                  alpha=0.99,  # fractional order
                                  num_memory=1000,
                                  inits=inits)

runner = bp.IntegratorRunner(integrator,
                             monitors=list('xyz'),
                             inits=inits,
                             dt=dt)
runner.run(duration)
[14]:
plot_runner_3d(runner)
../_images/classical_dynamical_systems_fractional_order_chaos_17_0.png
[15]:
plot_runner_2d(runner)
../_images/classical_dynamical_systems_fractional_order_chaos_18_0.png

Fractional-order Liu System

The fractional order system is given by [4]

\[\begin{split}\begin{aligned} &D^{\alpha_{1}} x=-a x-e y^{2} \\ &D^{\alpha_{2}} y=b y-n x z \\ &D^{\alpha_{3}} z=-c z+m x y \end{aligned}\end{split}\]
[16]:
a, b, c, e, n, m = 1, 2.5, 5, 1, 4, 4


def liu_system(x, y, z, t):
  dx = -a * x - e * y ** 2
  dy = b * y - n * x * z
  dz = -c * z + m * x * y
  return dx, dy, dz
[17]:
dt = 0.001
duration = 100
inits = [0.2, 0, 0.5]

integrator = bp.fde.GLShortMemory(liu_system,
                                  alpha=0.95,  # fractional order
                                  num_memory=1000,
                                  inits=inits)

runner = bp.IntegratorRunner(integrator,
                             monitors=list('xyz'),
                             inits=inits,
                             dt=dt)
runner.run(duration)
[18]:
plot_runner_3d(runner)
../_images/classical_dynamical_systems_fractional_order_chaos_22_0.png
[19]:
plot_runner_2d(runner)
../_images/classical_dynamical_systems_fractional_order_chaos_23_0.png

Fractional-order Chen System

The system is given by [5]

\[\begin{split}\begin{aligned} &\frac{\mathrm{d}^{q} x}{\mathrm{~d} t^{9}}=a(y-x), \\ &\frac{\mathrm{d}^{q} y}{\mathrm{~d} t^{q}}= d x-x z+c y, \\ &\frac{\mathrm{d}^{q} z}{\mathrm{~d} t^{9}}=x y-b z, \end{aligned}\end{split}\]
[20]:
a, b, c, d = 35, 3, 28, -7


def chen_system(x, y, z, t):
  dx = a * (y - x)
  dy = d * x - x * z + c * y
  dz = x * y - b * z
  return dx, dy, dz
[21]:
dt = 0.005
duration = 50
inits = [-9, -5, 14]

integrator = bp.fde.GLShortMemory(chen_system,
                                  alpha=0.9,  # fractional order
                                  num_memory=1000,
                                  inits=inits)

runner = bp.IntegratorRunner(integrator,
                             monitors=list('xyz'),
                             inits=inits,
                             dt=dt)
runner.run(duration)
[22]:
plot_runner_3d(runner)
../_images/classical_dynamical_systems_fractional_order_chaos_27_0.png
[23]:
plot_runner_2d(runner)
../_images/classical_dynamical_systems_fractional_order_chaos_28_0.png

References

  • [1] Petráš, Ivo. “A note on the fractional-order Chua’s system.” Chaos, Solitons & Fractals 38.1 (2008): 140-147.

  • [2] Wu, Xiangjun, and Yang Yang. “Chaos in the fractional-order Qi system and its synchronization using active control.” 2010 International Conference on Intelligent Computing and Cognitive Informatics. IEEE, 2010.

  • [3] Wu, Xiang-Jun, and Shi-Lei Shen. “Chaos in the fractional-order Lorenz system.” International Journal of Computer Mathematics 86.7 (2009): 1274-1282.

  • [4] Daftardar-Gejji, Varsha, and Sachin Bhalekar. “Chaos in fractional ordered Liu system.” Computers & mathematics with applications 59.3 (2010): 1117-1127.

  • [5] Lu, Jun Guo, and Guanrong Chen. “A note on the fractional-order Chen system.” Chaos, Solitons & Fractals 27.3 (2006): 685-688.

Previous Next

© Copyright 2021, BrainExamples. Revision 8ad00cf7.

Built with Sphinx using a theme provided by Read the Docs.
Read the Docs v: latest
Versions
latest
brainpy-2.2.x
brainpy-2.1.x
brainpy-1.1.x
Downloads
html
On Read the Docs
Project Home
Builds