Skip to content

Add mountain car reinforcement learning tutorial #1227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/nestml-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ jobs:
run: |
pytest -s -o log_cli=true -o log_cli_level="DEBUG" tests/nest_tests/nest_integration_test.py

# Install Python dependencies
- name: Python dependencies
run: |
python -m pip install --upgrade pygame

# Run IPython/Jupyter notebooks
- name: Run Jupyter notebooks
if: ${{ matrix.nest_branch == 'master' }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# iaf_psc_exp - Leaky integrate-and-fire neuron model
# ###################################################
#
# Description
# +++++++++++
#
# ...
#
#
# References
# ++++++++++
#
# ...
#
# See also
# ++++++++
#
model iaf_psc_exp_neuron:

state:
V_m mV = E_l # Membrane potential
g_e real = 0.

equations:
g_e' = -g_e / tau_g
V_m' = (g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m

parameters:
tau_m ms = 10 ms # Membrane time constant
tau_g ms = 5 ms
E_e mV = 0 mV
E_l mV = -74 mV # Resting potential
V_th mV = -54 mV # Spike threshold potential
V_reset mV = -60 mV

# constant external input current
I_e real = 0

#scaling factor for incoming spikes
s real = 1000

input:
spikes_in_port <- spike
I_stim real <- continuous

output:
spike

update:
integrate_odes()

onReceive(spikes_in_port):
g_e += spikes_in_port * s

onCondition(V_m >= V_th):
# threshold crossing
V_m = V_reset
emit_spike()
Loading
Loading