diff --git a/doc/tutorials/cart_pole_reinforcement_learning/brian_neuron.png b/doc/tutorials/cart_pole_reinforcement_learning/brian_neuron.png new file mode 100644 index 000000000..a4be83e50 Binary files /dev/null and b/doc/tutorials/cart_pole_reinforcement_learning/brian_neuron.png differ diff --git a/doc/tutorials/cart_pole_reinforcement_learning/cartpole_illustration.png b/doc/tutorials/cart_pole_reinforcement_learning/cartpole_illustration.png new file mode 100644 index 000000000..68e79b525 Binary files /dev/null and b/doc/tutorials/cart_pole_reinforcement_learning/cartpole_illustration.png differ diff --git a/doc/tutorials/cart_pole_reinforcement_learning/iaf_psc_exp_neuron.nestml b/doc/tutorials/cart_pole_reinforcement_learning/iaf_psc_exp_neuron.nestml new file mode 100644 index 000000000..5c5511640 --- /dev/null +++ b/doc/tutorials/cart_pole_reinforcement_learning/iaf_psc_exp_neuron.nestml @@ -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() diff --git a/doc/tutorials/cart_pole_reinforcement_learning/nest_neuron.png b/doc/tutorials/cart_pole_reinforcement_learning/nest_neuron.png new file mode 100644 index 000000000..222017c4b Binary files /dev/null and b/doc/tutorials/cart_pole_reinforcement_learning/nest_neuron.png differ diff --git a/doc/tutorials/cart_pole_reinforcement_learning/neuromodulated_stdp_synapse.nestml b/doc/tutorials/cart_pole_reinforcement_learning/neuromodulated_stdp_synapse.nestml new file mode 100644 index 000000000..5dff6c94e --- /dev/null +++ b/doc/tutorials/cart_pole_reinforcement_learning/neuromodulated_stdp_synapse.nestml @@ -0,0 +1,53 @@ +# stdp - Synapse model for spike-timing dependent plasticity +# ########################################################## +# +# ... +# +model neuromodulated_stdp_synapse: + state: + w real = 1 # Synaptic weight + wtr real = 0 + pre_trace real = 0. + post_trace real = 0. + + parameters: + n real = 0. # neuromodulator concentration between 0 and 1 + d ms = 1 ms # Synaptic transmission delay + beta real = 0.01 # learning rate + tau_tr_pre ms = 20 ms + tau_tr_post ms = 20 ms + pre_trace_increment real = 1. + post_trace_increment real = 1. + wtr_max real = 0.1 + wtr_min real = 0 + + equations: + pre_trace' = -pre_trace / tau_tr_pre + post_trace' = -post_trace / tau_tr_post + + input: + pre_spikes <- spike + post_spikes <- spike + + output: + spike(weight real, delay ms) + + onReceive(post_spikes): + post_trace += -1.05E-7 # XXX FIXME!!!! should be ``+= post_trace_increment`` + + wtr += pre_trace + wtr = max(wtr_min, wtr) + wtr = min(wtr_max, wtr) + + onReceive(pre_spikes): + pre_trace += pre_trace_increment + + wtr += post_trace + wtr = max(wtr_min, wtr) + wtr = min(wtr_max, wtr) + + # deliver spike to postsynaptic partner + emit_spike(w, d) + + update: + integrate_odes() diff --git a/doc/tutorials/cart_pole_reinforcement_learning/neuron_test.ipynb b/doc/tutorials/cart_pole_reinforcement_learning/neuron_test.ipynb new file mode 100644 index 000000000..f89fb4845 --- /dev/null +++ b/doc/tutorials/cart_pole_reinforcement_learning/neuron_test.ipynb @@ -0,0 +1,2652 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "WARNING:root:PyGSL is not available. The stiffness test will be skipped.\n", + "WARNING:root:Error when importing: No module named 'pygsl'\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " -- N E S T --\n", + " Copyright (C) 2004 The NEST Initiative\n", + "\n", + " Version: 3.8.0\n", + " Built: Aug 27 2024 04:38:39\n", + "\n", + " This program is provided AS IS and comes with\n", + " NO WARRANTY. See the file LICENSE for details.\n", + "\n", + " Problems or suggestions?\n", + " Visit https://www.nest-simulator.org\n", + "\n", + " Type 'nest.help()' to find out more about NEST.\n", + "\n", + "\n", + " -- N E S T --\n", + " Copyright (C) 2004 The NEST Initiative\n", + "\n", + " Version: 3.8.0\n", + " Built: Aug 27 2024 04:38:39\n", + "\n", + " This program is provided AS IS and comes with\n", + " NO WARRANTY. See the file LICENSE for details.\n", + "\n", + " Problems or suggestions?\n", + " Visit https://www.nest-simulator.org\n", + "\n", + " Type 'nest.help()' to find out more about NEST.\n", + "\n", + "[15,ignore_and_fire_neuron_nestml, WARNING, [35:34;35:58]]: Model contains a call to fixed-timestep functions (``resolution()`` and/or ``steps()``). This restricts the model to being compatible only with fixed-timestep simulators. Consider eliminating ``resolution()`` and ``steps()`` from the model, and using ``timestep()`` instead.\n", + "\u001b[33mCMake Warning (dev) at CMakeLists.txt:93 (project):\n", + " cmake_minimum_required() should be called prior to this top-level project()\n", + " call. Please see the cmake-commands(7) manual for usage documentation of\n", + " both commands.\n", + "This warning is for project developers. Use -Wno-dev to suppress it.\n", + "\u001b[0m\n", + "-- The CXX compiler identification is Clang 18.1.8\n", + "-- Detecting CXX compiler ABI info\n", + "-- Detecting CXX compiler ABI info - done\n", + "-- Check for working CXX compiler: /opt/homebrew/anaconda3/envs/cart_pole/bin/arm64-apple-darwin20.0.0-clang++ - skipped\n", + "-- Detecting CXX compile features\n", + "-- Detecting CXX compile features - done\n", + "\u001b[0m\u001b[0m\n", + "\u001b[0m-------------------------------------------------------\u001b[0m\n", + "\u001b[0mnestml_19cb306bee41465a812ff4517f9a3cce_module Configuration Summary\u001b[0m\n", + "\u001b[0m-------------------------------------------------------\u001b[0m\n", + "\u001b[0m\u001b[0m\n", + "\u001b[0mC++ compiler : /opt/homebrew/anaconda3/envs/cart_pole/bin/arm64-apple-darwin20.0.0-clang++\u001b[0m\n", + "\u001b[0mBuild static libs : OFF\u001b[0m\n", + "\u001b[0mC++ compiler flags : -ftree-vectorize -fPIC -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -isystem /opt/homebrew/anaconda3/envs/cart_pole/include\u001b[0m\n", + "\u001b[0mNEST compiler flags : -ftree-vectorize -fPIC -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -isystem /opt/homebrew/anaconda3/envs/cart_pole/include -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/nest-simulator_1724732993440/work=/usr/local/src/conda/nest-simulator-3.8 -fdebug-prefix-map=/opt/homebrew/anaconda3/envs/cart_pole=/usr/local/src/conda-prefix -std=c++17 -Wall -Xclang -fopenmp -O2\u001b[0m\n", + "\u001b[0mNEST include dirs : -I/opt/homebrew/anaconda3/envs/cart_pole/include/nest -I/opt/homebrew/anaconda3/envs/cart_pole/include -I/opt/homebrew/anaconda3/envs/cart_pole/include -I/opt/homebrew/anaconda3/envs/cart_pole/include -I/opt/homebrew/anaconda3/envs/cart_pole/include\u001b[0m\n", + "\u001b[0mNEST libraries flags : -L/opt/homebrew/anaconda3/envs/cart_pole/lib/nest -lnest -lsli /opt/homebrew/anaconda3/envs/cart_pole/lib/libltdl.dylib /opt/homebrew/anaconda3/envs/cart_pole/lib/libreadline.dylib /opt/homebrew/anaconda3/envs/cart_pole/lib/libncurses.dylib /opt/homebrew/anaconda3/envs/cart_pole/lib/libgsl.dylib /opt/homebrew/anaconda3/envs/cart_pole/lib/libgslcblas.dylib /opt/homebrew/anaconda3/envs/cart_pole/lib/libomp.dylib\u001b[0m\n", + "\u001b[0m\u001b[0m\n", + "\u001b[0m-------------------------------------------------------\u001b[0m\n", + "\u001b[0m\u001b[0m\n", + "\u001b[0mYou can now build and install 'nestml_19cb306bee41465a812ff4517f9a3cce_module' using\u001b[0m\n", + "\u001b[0m make\u001b[0m\n", + "\u001b[0m make install\u001b[0m\n", + "\u001b[0m\u001b[0m\n", + "\u001b[0mThe library file libnestml_19cb306bee41465a812ff4517f9a3cce_module.so will be installed to\u001b[0m\n", + "\u001b[0m /var/folders/3h/2lc1zrkd375b1l0m8zcfj6440000gn/T/nestml_target_zsoo6lcr\u001b[0m\n", + "\u001b[0mThe module can be loaded into NEST using\u001b[0m\n", + "\u001b[0m (nestml_19cb306bee41465a812ff4517f9a3cce_module) Install (in SLI)\u001b[0m\n", + "\u001b[0m nest.Install(nestml_19cb306bee41465a812ff4517f9a3cce_module) (in PyNEST)\u001b[0m\n", + "\u001b[0m\u001b[0m\n", + "\u001b[33mCMake Warning (dev) in CMakeLists.txt:\n", + " No cmake_minimum_required command is present. A line of code such as\n", + "\n", + " cmake_minimum_required(VERSION 3.31)\n", + "\n", + " should be added at the top of the file. The version specified may be lower\n", + " if you wish to support older CMake versions for this project. For more\n", + " information run \"cmake --help-policy CMP0000\".\n", + "This warning is for project developers. Use -Wno-dev to suppress it.\n", + "\u001b[0m\n", + "-- Configuring done (0.4s)\n", + "-- Generating done (0.0s)\n", + "-- Build files have been written to: /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target\n", + "[ 33%] \u001b[32mBuilding CXX object CMakeFiles/nestml_19cb306bee41465a812ff4517f9a3cce_module_module.dir/ignore_and_fire_neuron_nestml.o\u001b[0m\n", + "[ 66%] \u001b[32mBuilding CXX object CMakeFiles/nestml_19cb306bee41465a812ff4517f9a3cce_module_module.dir/nestml_19cb306bee41465a812ff4517f9a3cce_module.o\u001b[0m\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/ignore_and_fire_neuron_nestml.cpp:165:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 165 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/ignore_and_fire_neuron_nestml.cpp:195:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 195 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/ignore_and_fire_neuron_nestml.cpp:238:10: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 238 | auto get_t = [origin, lag](){ return nest::Time( nest::Time::step( origin.get_steps() + lag + 1) ).get_ms(); };\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/ignore_and_fire_neuron_nestml.cpp:232:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 232 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "4 warnings generated.\n", + "[100%] \u001b[32m\u001b[1mLinking CXX shared module nestml_19cb306bee41465a812ff4517f9a3cce_module.so\u001b[0m\n", + "[100%] Built target nestml_19cb306bee41465a812ff4517f9a3cce_module_module\n", + "[100%] Built target nestml_19cb306bee41465a812ff4517f9a3cce_module_module\n", + "\u001b[36mInstall the project...\u001b[0m\n", + "-- Install configuration: \"\"\n", + "-- Installing: /var/folders/3h/2lc1zrkd375b1l0m8zcfj6440000gn/T/nestml_target_zsoo6lcr/nestml_19cb306bee41465a812ff4517f9a3cce_module.so\n", + "[1,GLOBAL, INFO]: List of files that will be processed:\n", + "[2,GLOBAL, INFO]: /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/iaf_psc_exp_neuron.nestml\n", + "[3,GLOBAL, INFO]: /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/neuromodulated_stdp_synapse.nestml\n", + "[4,GLOBAL, INFO]: Target platform code will be generated in directory: '/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target'\n", + "[5,GLOBAL, INFO]: Target platform code will be installed in directory: '/var/folders/3h/2lc1zrkd375b1l0m8zcfj6440000gn/T/nestml_target_t1_9slx9'\n", + "\n", + " -- N E S T --\n", + " Copyright (C) 2004 The NEST Initiative\n", + "\n", + " Version: 3.8.0\n", + " Built: Aug 27 2024 04:38:39\n", + "\n", + " This program is provided AS IS and comes with\n", + " NO WARRANTY. See the file LICENSE for details.\n", + "\n", + " Problems or suggestions?\n", + " Visit https://www.nest-simulator.org\n", + "\n", + " Type 'nest.help()' to find out more about NEST.\n", + "\n", + "[6,GLOBAL, INFO]: The NEST Simulator version was automatically detected as: v3.8.0\n", + "[7,GLOBAL, INFO]: Given template root path is not an absolute path. Creating the absolute path with default templates directory '/opt/homebrew/anaconda3/envs/cart_pole/lib/python3.12/site-packages/pynestml/codegeneration/resources_nest/point_neuron'\n", + "[8,GLOBAL, INFO]: Given template root path is not an absolute path. Creating the absolute path with default templates directory '/opt/homebrew/anaconda3/envs/cart_pole/lib/python3.12/site-packages/pynestml/codegeneration/resources_nest/point_neuron'\n", + "[9,GLOBAL, INFO]: Given template root path is not an absolute path. Creating the absolute path with default templates directory '/opt/homebrew/anaconda3/envs/cart_pole/lib/python3.12/site-packages/pynestml/codegeneration/resources_nest/point_neuron'\n", + "[10,GLOBAL, INFO]: The NEST Simulator installation path was automatically detected as: /opt/homebrew/anaconda3/envs/cart_pole\n", + "[11,GLOBAL, INFO]: Start processing '/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/iaf_psc_exp_neuron.nestml'!\n", + "[12,iaf_psc_exp_neuron_nestml, INFO, [39:19;39:19]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[13,iaf_psc_exp_neuron_nestml, INFO, [42:17;42:17]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[14,iaf_psc_exp_neuron_nestml, INFO, [55:15;55:32]]: Implicit casting from (compatible) type '1 / s buffer' to 'real'.\n", + "[15,GLOBAL, INFO]: Start processing '/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/neuromodulated_stdp_synapse.nestml'!\n", + "[16,neuromodulated_stdp_synapse_nestml, INFO, [10:17;10:17]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[17,neuromodulated_stdp_synapse_nestml, INFO, [20:21;20:21]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[18,neuromodulated_stdp_synapse_nestml, INFO, [21:23;21:23]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[19,neuromodulated_stdp_synapse_nestml, INFO, [22:24;22:24]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[20,neuromodulated_stdp_synapse_nestml, INFO, [38:22;38:22]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[21,neuromodulated_stdp_synapse_nestml, INFO, [45:21;45:21]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[22,iaf_psc_exp_neuron_nestml, WARNING, [42:8;42:17]]: Variable 's' has the same name as a physical unit!\n", + "[23,iaf_psc_exp_neuron_nestml, WARNING, [28:16;28:42]]: Implicit casting from (compatible) type 'mV' to 'real'.\n", + "[24,iaf_psc_exp_neuron_nestml, WARNING, [28:16;28:48]]: Implicit casting from (compatible) type 'mV' to 'real buffer'.\n", + "[25,iaf_psc_exp_neuron_nestml, INFO, [39:19;39:19]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[26,iaf_psc_exp_neuron_nestml, INFO, [42:17;42:17]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[27,iaf_psc_exp_neuron_nestml, INFO, [55:15;55:32]]: Implicit casting from (compatible) type '1 / s buffer' to 'real'.\n", + "[28,neuromodulated_stdp_synapse_nestml, WARNING, [16:8;16:17]]: Variable 'd' has the same name as a physical unit!\n", + "[29,neuromodulated_stdp_synapse_nestml, INFO, [10:17;10:17]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[30,neuromodulated_stdp_synapse_nestml, INFO, [20:21;20:21]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[31,neuromodulated_stdp_synapse_nestml, INFO, [21:23;21:23]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[32,neuromodulated_stdp_synapse_nestml, INFO, [22:24;22:24]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[33,neuromodulated_stdp_synapse_nestml, INFO, [38:22;38:22]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[34,neuromodulated_stdp_synapse_nestml, INFO, [45:21;45:21]]: Implicit casting from (compatible) type 'integer' to 'real'.\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "INFO:root:Analysing input:\n", + "INFO:root:{\n", + " \"dynamics\": [\n", + " {\n", + " \"expression\": \"g_e' = (-g_e) / tau_g\",\n", + " \"initial_values\": {\n", + " \"g_e\": \"0.0\"\n", + " }\n", + " },\n", + " {\n", + " \"expression\": \"V_m' = (g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\",\n", + " \"initial_values\": {\n", + " \"V_m\": \"E_l\"\n", + " }\n", + " }\n", + " ],\n", + " \"options\": {\n", + " \"output_timestep_symbol\": \"__h\"\n", + " },\n", + " \"parameters\": {\n", + " \"E_e\": \"0\",\n", + " \"E_l\": \"(-74)\",\n", + " \"I_e\": \"0\",\n", + " \"V_reset\": \"(-60)\",\n", + " \"V_th\": \"(-54)\",\n", + " \"s\": \"1000\",\n", + " \"tau_g\": \"5\",\n", + " \"tau_m\": \"10\"\n", + " }\n", + "}\n", + "INFO:root:Processing global options...\n", + "INFO:root:Processing input shapes...\n", + "INFO:root:\n", + "Processing differential-equation form shape g_e with defining expression = \"(-g_e) / tau_g\"\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol g_e, derivative_factors = [-1/tau_g], inhom_term = 0.0, nonlin_term = 0.0\n", + "INFO:root:\tReturning shape: Shape \"g_e\" of order 1\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "INFO:root:\n", + "Processing differential-equation form shape V_m with defining expression = \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\"\n", + "DEBUG:root:Splitting expression (E_l + I_e + I_stim - V_m + g_e*(E_e - V_m))/tau_m (symbols [V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_m]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m\n", + "DEBUG:root:\tnonlinear term: E_e*g_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m\n", + "DEBUG:root:Created Shape with symbol V_m, derivative_factors = [-1/tau_m], inhom_term = E_l/tau_m + I_e/tau_m, nonlin_term = E_e*g_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m\n", + "INFO:root:\tReturning shape: Shape \"V_m\" of order 1\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "INFO:root:All known variables: [g_e, V_m], all parameters used in ODEs: {tau_m, E_e, tau_g, E_l, I_e, I_stim}\n", + "INFO:root:No numerical value specified for parameter \"I_stim\"\n", + "INFO:root:\n", + "Processing differential-equation form shape g_e with defining expression = \"(-g_e) / tau_g\"\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e, V_m, g_e])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol g_e, derivative_factors = [-1/tau_g], inhom_term = 0.0, nonlin_term = 0\n", + "INFO:root:\tReturning shape: Shape \"g_e\" of order 1\n", + "INFO:root:\n", + "Processing differential-equation form shape V_m with defining expression = \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\"\n", + "DEBUG:root:Splitting expression (E_l + I_e + I_stim - V_m + g_e*(E_e - V_m))/tau_m (symbols [g_e, V_m, g_e, V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "DEBUG:root:Created Shape with symbol V_m, derivative_factors = [-1/tau_m], inhom_term = E_l/tau_m + I_e/tau_m + I_stim/tau_m, nonlin_term = E_e*g_e/tau_m - V_m*g_e/tau_m\n", + "INFO:root:\tReturning shape: Shape \"V_m\" of order 1\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols Matrix([[g_e], [V_m]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "DEBUG:root:Splitting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m (symbols Matrix([[g_e], [V_m]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[g_e], [V_m]]), A = Matrix([[-1/tau_g, 0], [E_e/tau_m, -1/tau_m]]), b = Matrix([[0], [E_l/tau_m + I_e/tau_m + I_stim/tau_m]]), c = Matrix([[0], [-V_m*g_e/tau_m]])\n", + "INFO:root:Finding analytically solvable equations...\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e, V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "DEBUG:root:Splitting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m (symbols [g_e, V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "INFO:root:Generating propagators for the following symbols: g_e\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[g_e]]), A = Matrix([[-1/tau_g]]), b = Matrix([[0]]), c = Matrix([[0]])\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[35,GLOBAL, INFO]: State variables that will be moved from synapse to neuron: ['post_trace']\n", + "[36,GLOBAL, INFO]: Parameters that will be copied from synapse to neuron: ['tau_tr_post']\n", + "[37,GLOBAL, INFO]: Synaptic state variables moved to neuron that will need buffering: []\n", + "[38,GLOBAL, INFO]: Moving state var defining equation(s) post_trace\n", + "[39,GLOBAL, INFO]: Moving state variables for equation(s) post_trace\n", + "[40,GLOBAL, INFO]: Moving definition of post_trace from synapse to neuron\n", + "[41,GLOBAL, INFO]: \tMoving statement post_trace += 1\n", + "[42,GLOBAL, INFO]: In synapse: replacing ``continuous`` type input ports that are connected to postsynaptic neuron with external variable references\n", + "[43,GLOBAL, INFO]: Copying parameters from synapse to neuron...\n", + "[44,GLOBAL, INFO]: Copying definition of tau_tr_post from synapse to neuron\n", + "[45,GLOBAL, INFO]: Adding suffix to variables in spike updates\n", + "[46,GLOBAL, INFO]: In synapse: replacing variables with suffixed external variable references\n", + "[47,GLOBAL, INFO]: \t• Replacing variable post_trace\n", + "[48,GLOBAL, INFO]: Successfully constructed neuron-synapse pair iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml, neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml\n", + "[49,GLOBAL, INFO]: Analysing/transforming model 'iaf_psc_exp_neuron_nestml'\n", + "[50,iaf_psc_exp_neuron_nestml, INFO, [20:0;60:0]]: Starts processing of the model 'iaf_psc_exp_neuron_nestml'\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "DEBUG:root:System of equations:\n", + "DEBUG:root:x = Matrix([[g_e]])\n", + "DEBUG:root:A = Matrix([[-1/tau_g]])\n", + "DEBUG:root:b = Matrix([[0]])\n", + "DEBUG:root:c = Matrix([[0]])\n", + "INFO:root:update_expr[g_e] = __P__g_e__g_e*g_e\n", + "INFO:root:Generating numerical solver for the following symbols: V_m\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[V_m]]), A = Matrix([[-1/tau_m]]), b = Matrix([[E_l/tau_m + I_e/tau_m + I_stim/tau_m]]), c = Matrix([[E_e*g_e/tau_m - V_m*g_e/tau_m]])\n", + "WARNING:root:Not preserving expression for variable \"g_e\" as it is solved by propagator solver\n", + "INFO:root:Preserving expression for variable \"V_m\"\n", + "INFO:root:In ode-toolbox: returning outdict = \n", + "INFO:root:[\n", + " {\n", + " \"initial_values\": {\n", + " \"g_e\": \"0.0\"\n", + " },\n", + " \"parameters\": {\n", + " \"tau_g\": \"5.00000000000000\"\n", + " },\n", + " \"propagators\": {\n", + " \"__P__g_e__g_e\": \"exp(-__h/tau_g)\"\n", + " },\n", + " \"solver\": \"analytical\",\n", + " \"state_variables\": [\n", + " \"g_e\"\n", + " ],\n", + " \"update_expressions\": {\n", + " \"g_e\": \"__P__g_e__g_e*g_e\"\n", + " }\n", + " },\n", + " {\n", + " \"initial_values\": {\n", + " \"V_m\": \"E_l\"\n", + " },\n", + " \"parameters\": {\n", + " \"E_e\": \"0\",\n", + " \"E_l\": \"-74.0000000000000\",\n", + " \"I_e\": \"0\",\n", + " \"tau_m\": \"10.0000000000000\"\n", + " },\n", + " \"solver\": \"numeric\",\n", + " \"state_variables\": [\n", + " \"V_m\"\n", + " ],\n", + " \"update_expressions\": {\n", + " \"V_m\": \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\"\n", + " }\n", + " }\n", + "]\n", + "INFO:root:Analysing input:\n", + "INFO:root:{\n", + " \"dynamics\": [\n", + " {\n", + " \"expression\": \"g_e' = (-g_e) / tau_g\",\n", + " \"initial_values\": {\n", + " \"g_e\": \"0.0\"\n", + " }\n", + " },\n", + " {\n", + " \"expression\": \"V_m' = (g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\",\n", + " \"initial_values\": {\n", + " \"V_m\": \"E_l\"\n", + " }\n", + " }\n", + " ],\n", + " \"options\": {\n", + " \"output_timestep_symbol\": \"__h\"\n", + " },\n", + " \"parameters\": {\n", + " \"E_e\": \"0\",\n", + " \"E_l\": \"(-74)\",\n", + " \"I_e\": \"0\",\n", + " \"V_reset\": \"(-60)\",\n", + " \"V_th\": \"(-54)\",\n", + " \"s\": \"1000\",\n", + " \"tau_g\": \"5\",\n", + " \"tau_m\": \"10\"\n", + " }\n", + "}\n", + "INFO:root:Processing global options...\n", + "INFO:root:Processing input shapes...\n", + "INFO:root:\n", + "Processing differential-equation form shape g_e with defining expression = \"(-g_e) / tau_g\"\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol g_e, derivative_factors = [-1/tau_g], inhom_term = 0.0, nonlin_term = 0.0\n", + "INFO:root:\tReturning shape: Shape \"g_e\" of order 1\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "INFO:root:\n", + "Processing differential-equation form shape V_m with defining expression = \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\"\n", + "DEBUG:root:Splitting expression (E_l + I_e + I_stim - V_m + g_e*(E_e - V_m))/tau_m (symbols [V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_m]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m\n", + "DEBUG:root:\tnonlinear term: E_e*g_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m\n", + "DEBUG:root:Created Shape with symbol V_m, derivative_factors = [-1/tau_m], inhom_term = E_l/tau_m + I_e/tau_m, nonlin_term = E_e*g_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m\n", + "INFO:root:\tReturning shape: Shape \"V_m\" of order 1\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "INFO:root:All known variables: [g_e, V_m], all parameters used in ODEs: {tau_m, E_e, tau_g, E_l, I_e, I_stim}\n", + "INFO:root:No numerical value specified for parameter \"I_stim\"\n", + "INFO:root:\n", + "Processing differential-equation form shape g_e with defining expression = \"(-g_e) / tau_g\"\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e, V_m, g_e])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol g_e, derivative_factors = [-1/tau_g], inhom_term = 0.0, nonlin_term = 0\n", + "INFO:root:\tReturning shape: Shape \"g_e\" of order 1\n", + "INFO:root:\n", + "Processing differential-equation form shape V_m with defining expression = \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\"\n", + "DEBUG:root:Splitting expression (E_l + I_e + I_stim - V_m + g_e*(E_e - V_m))/tau_m (symbols [g_e, V_m, g_e, V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "DEBUG:root:Created Shape with symbol V_m, derivative_factors = [-1/tau_m], inhom_term = E_l/tau_m + I_e/tau_m + I_stim/tau_m, nonlin_term = E_e*g_e/tau_m - V_m*g_e/tau_m\n", + "INFO:root:\tReturning shape: Shape \"V_m\" of order 1\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols Matrix([[g_e], [V_m]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "DEBUG:root:Splitting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m (symbols Matrix([[g_e], [V_m]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[g_e], [V_m]]), A = Matrix([[-1/tau_g, 0], [E_e/tau_m, -1/tau_m]]), b = Matrix([[0], [E_l/tau_m + I_e/tau_m + I_stim/tau_m]]), c = Matrix([[0], [-V_m*g_e/tau_m]])\n", + "INFO:root:Finding analytically solvable equations...\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e, V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "DEBUG:root:Splitting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m (symbols [g_e, V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "INFO:root:Generating numerical solver for the following symbols: g_e, V_m\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[g_e], [V_m]]), A = Matrix([[-1/tau_g, 0], [E_e/tau_m, -1/tau_m]]), b = Matrix([[0], [E_l/tau_m + I_e/tau_m + I_stim/tau_m]]), c = Matrix([[0], [-V_m*g_e/tau_m]])\n", + "INFO:root:Preserving expression for variable \"g_e\"\n", + "INFO:root:Preserving expression for variable \"V_m\"\n", + "INFO:root:In ode-toolbox: returning outdict = \n", + "INFO:root:[\n", + " {\n", + " \"initial_values\": {\n", + " \"V_m\": \"E_l\",\n", + " \"g_e\": \"0.0\"\n", + " },\n", + " \"parameters\": {\n", + " \"E_e\": \"0\",\n", + " \"E_l\": \"-74.0000000000000\",\n", + " \"I_e\": \"0\",\n", + " \"tau_g\": \"5.00000000000000\",\n", + " \"tau_m\": \"10.0000000000000\"\n", + " },\n", + " \"solver\": \"numeric\",\n", + " \"state_variables\": [\n", + " \"g_e\",\n", + " \"V_m\"\n", + " ],\n", + " \"update_expressions\": {\n", + " \"V_m\": \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\",\n", + " \"g_e\": \"(-g_e) / tau_g\"\n", + " }\n", + " }\n", + "]\n", + "INFO:root:Analysing input:\n", + "INFO:root:{\n", + " \"dynamics\": [\n", + " {\n", + " \"expression\": \"g_e' = (-g_e) / tau_g\",\n", + " \"initial_values\": {\n", + " \"g_e\": \"0.0\"\n", + " }\n", + " },\n", + " {\n", + " \"expression\": \"V_m' = (g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\",\n", + " \"initial_values\": {\n", + " \"V_m\": \"E_l\"\n", + " }\n", + " },\n", + " {\n", + " \"expression\": \"post_trace__for_neuromodulated_stdp_synapse_nestml' = (-post_trace__for_neuromodulated_stdp_synapse_nestml) / tau_tr_post__for_neuromodulated_stdp_synapse_nestml\",\n", + " \"initial_values\": {\n", + " \"post_trace__for_neuromodulated_stdp_synapse_nestml\": \"0.0\"\n", + " }\n", + " }\n", + " ],\n", + " \"options\": {\n", + " \"output_timestep_symbol\": \"__h\"\n", + " },\n", + " \"parameters\": {\n", + " \"E_e\": \"0\",\n", + " \"E_l\": \"(-74)\",\n", + " \"I_e\": \"0\",\n", + " \"V_reset\": \"(-60)\",\n", + " \"V_th\": \"(-54)\",\n", + " \"s\": \"1000\",\n", + " \"tau_g\": \"5\",\n", + " \"tau_m\": \"10\",\n", + " \"tau_tr_post__for_neuromodulated_stdp_synapse_nestml\": \"20\"\n", + " }\n", + "}\n", + "INFO:root:Processing global options...\n", + "INFO:root:Processing input shapes...\n", + "INFO:root:\n", + "Processing differential-equation form shape g_e with defining expression = \"(-g_e) / tau_g\"\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol g_e, derivative_factors = [-1/tau_g], inhom_term = 0.0, nonlin_term = 0.0\n", + "INFO:root:\tReturning shape: Shape \"g_e\" of order 1\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "INFO:root:\n", + "Processing differential-equation form shape V_m with defining expression = \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\"\n", + "DEBUG:root:Splitting expression (E_l + I_e + I_stim - V_m + g_e*(E_e - V_m))/tau_m (symbols [V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_m]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m\n", + "DEBUG:root:\tnonlinear term: E_e*g_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m\n", + "DEBUG:root:Created Shape with symbol V_m, derivative_factors = [-1/tau_m], inhom_term = E_l/tau_m + I_e/tau_m, nonlin_term = E_e*g_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m\n", + "INFO:root:\tReturning shape: Shape \"V_m\" of order 1\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "INFO:root:\n", + "Processing differential-equation form shape post_trace__for_neuromodulated_stdp_synapse_nestml with defining expression = \"(-post_trace__for_neuromodulated_stdp_synapse_nestml) / tau_tr_post__for_neuromodulated_stdp_synapse_nestml\"\n", + "DEBUG:root:Splitting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml (symbols [post_trace__for_neuromodulated_stdp_synapse_nestml])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol post_trace__for_neuromodulated_stdp_synapse_nestml, derivative_factors = [-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml], inhom_term = 0.0, nonlin_term = 0.0\n", + "INFO:root:\tReturning shape: Shape \"post_trace__for_neuromodulated_stdp_synapse_nestml\" of order 1\n", + "INFO:root:Shape post_trace__for_neuromodulated_stdp_synapse_nestml: reconstituting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml\n", + "INFO:root:All known variables: [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml], all parameters used in ODEs: {tau_tr_post__for_neuromodulated_stdp_synapse_nestml, tau_m, E_e, tau_g, E_l, I_e, I_stim}\n", + "INFO:root:No numerical value specified for parameter \"I_stim\"\n", + "INFO:root:\n", + "Processing differential-equation form shape g_e with defining expression = \"(-g_e) / tau_g\"\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml, g_e])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol g_e, derivative_factors = [-1/tau_g], inhom_term = 0.0, nonlin_term = 0\n", + "INFO:root:\tReturning shape: Shape \"g_e\" of order 1\n", + "INFO:root:\n", + "Processing differential-equation form shape V_m with defining expression = \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\"\n", + "DEBUG:root:Splitting expression (E_l + I_e + I_stim - V_m + g_e*(E_e - V_m))/tau_m (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml, g_e, V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m], [0], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "DEBUG:root:Created Shape with symbol V_m, derivative_factors = [-1/tau_m], inhom_term = E_l/tau_m + I_e/tau_m + I_stim/tau_m, nonlin_term = E_e*g_e/tau_m - V_m*g_e/tau_m\n", + "INFO:root:\tReturning shape: Shape \"V_m\" of order 1\n", + "INFO:root:\n", + "Processing differential-equation form shape post_trace__for_neuromodulated_stdp_synapse_nestml with defining expression = \"(-post_trace__for_neuromodulated_stdp_synapse_nestml) / tau_tr_post__for_neuromodulated_stdp_synapse_nestml\"\n", + "DEBUG:root:Splitting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml, g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml])\n", + "DEBUG:root:\tlinear factors: Matrix([[0], [0], [-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml], [0], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol post_trace__for_neuromodulated_stdp_synapse_nestml, derivative_factors = [-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml], inhom_term = 0.0, nonlin_term = 0\n", + "INFO:root:\tReturning shape: Shape \"post_trace__for_neuromodulated_stdp_synapse_nestml\" of order 1\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols Matrix([[g_e], [V_m], [post_trace__for_neuromodulated_stdp_synapse_nestml]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "DEBUG:root:Splitting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m (symbols Matrix([[g_e], [V_m], [post_trace__for_neuromodulated_stdp_synapse_nestml]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m], [0]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "INFO:root:Shape post_trace__for_neuromodulated_stdp_synapse_nestml: reconstituting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml\n", + "DEBUG:root:Splitting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml (symbols Matrix([[g_e], [V_m], [post_trace__for_neuromodulated_stdp_synapse_nestml]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[0], [0], [-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[g_e], [V_m], [post_trace__for_neuromodulated_stdp_synapse_nestml]]), A = Matrix([[-1/tau_g, 0, 0], [E_e/tau_m, -1/tau_m, 0], [0, 0, -1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]]), b = Matrix([[0], [E_l/tau_m + I_e/tau_m + I_stim/tau_m], [0]]), c = Matrix([[0], [-V_m*g_e/tau_m], [0]])\n", + "INFO:root:Finding analytically solvable equations...\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "DEBUG:root:Splitting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml])\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m], [0]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "INFO:root:Shape post_trace__for_neuromodulated_stdp_synapse_nestml: reconstituting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml\n", + "DEBUG:root:Splitting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml])\n", + "DEBUG:root:\tlinear factors: Matrix([[0], [0], [-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Generating propagators for the following symbols: g_e, post_trace__for_neuromodulated_stdp_synapse_nestml\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[g_e], [post_trace__for_neuromodulated_stdp_synapse_nestml]]), A = Matrix([[-1/tau_g, 0], [0, -1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]]), b = Matrix([[0], [0]]), c = Matrix([[0], [0]])\n", + "DEBUG:root:System of equations:\n", + "DEBUG:root:x = Matrix([[g_e], [post_trace__for_neuromodulated_stdp_synapse_nestml]])\n", + "DEBUG:root:A = Matrix([\n", + "[-1/tau_g, 0],\n", + "[ 0, -1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]])\n", + "DEBUG:root:b = Matrix([[0], [0]])\n", + "DEBUG:root:c = Matrix([[0], [0]])\n", + "INFO:root:update_expr[g_e] = __P__g_e__g_e*g_e\n", + "INFO:root:update_expr[post_trace__for_neuromodulated_stdp_synapse_nestml] = __P__post_trace__for_neuromodulated_stdp_synapse_nestml__post_trace__for_neuromodulated_stdp_synapse_nestml*post_trace__for_neuromodulated_stdp_synapse_nestml\n", + "INFO:root:Generating numerical solver for the following symbols: V_m\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[V_m]]), A = Matrix([[-1/tau_m]]), b = Matrix([[E_l/tau_m + I_e/tau_m + I_stim/tau_m]]), c = Matrix([[E_e*g_e/tau_m - V_m*g_e/tau_m]])\n", + "WARNING:root:Not preserving expression for variable \"g_e\" as it is solved by propagator solver\n", + "WARNING:root:Not preserving expression for variable \"post_trace__for_neuromodulated_stdp_synapse_nestml\" as it is solved by propagator solver\n", + "INFO:root:Preserving expression for variable \"V_m\"\n", + "INFO:root:In ode-toolbox: returning outdict = \n", + "INFO:root:[\n", + " {\n", + " \"initial_values\": {\n", + " \"g_e\": \"0.0\",\n", + " \"post_trace__for_neuromodulated_stdp_synapse_nestml\": \"0.0\"\n", + " },\n", + " \"parameters\": {\n", + " \"tau_g\": \"5.00000000000000\",\n", + " \"tau_tr_post__for_neuromodulated_stdp_synapse_nestml\": \"20.0000000000000\"\n", + " },\n", + " \"propagators\": {\n", + " \"__P__g_e__g_e\": \"exp(-__h/tau_g)\",\n", + " \"__P__post_trace__for_neuromodulated_stdp_synapse_nestml__post_trace__for_neuromodulated_stdp_synapse_nestml\": \"exp(-__h/tau_tr_post__for_neuromodulated_stdp_synapse_nestml)\"\n", + " },\n", + " \"solver\": \"analytical\",\n", + " \"state_variables\": [\n", + " \"g_e\",\n", + " \"post_trace__for_neuromodulated_stdp_synapse_nestml\"\n", + " ],\n", + " \"update_expressions\": {\n", + " \"g_e\": \"__P__g_e__g_e*g_e\",\n", + " \"post_trace__for_neuromodulated_stdp_synapse_nestml\": \"__P__post_trace__for_neuromodulated_stdp_synapse_nestml__post_trace__for_neuromodulated_stdp_synapse_nestml*post_trace__for_neuromodulated_stdp_synapse_nestml\"\n", + " }\n", + " },\n", + " {\n", + " \"initial_values\": {\n", + " \"V_m\": \"E_l\"\n", + " },\n", + " \"parameters\": {\n", + " \"E_e\": \"0\",\n", + " \"E_l\": \"-74.0000000000000\",\n", + " \"I_e\": \"0\",\n", + " \"tau_m\": \"10.0000000000000\"\n", + " },\n", + " \"solver\": \"numeric\",\n", + " \"state_variables\": [\n", + " \"V_m\"\n", + " ],\n", + " \"update_expressions\": {\n", + " \"V_m\": \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\"\n", + " }\n", + " }\n", + "]\n", + "INFO:root:Analysing input:\n", + "INFO:root:{\n", + " \"dynamics\": [\n", + " {\n", + " \"expression\": \"g_e' = (-g_e) / tau_g\",\n", + " \"initial_values\": {\n", + " \"g_e\": \"0.0\"\n", + " }\n", + " },\n", + " {\n", + " \"expression\": \"V_m' = (g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\",\n", + " \"initial_values\": {\n", + " \"V_m\": \"E_l\"\n", + " }\n", + " },\n", + " {\n", + " \"expression\": \"post_trace__for_neuromodulated_stdp_synapse_nestml' = (-post_trace__for_neuromodulated_stdp_synapse_nestml) / tau_tr_post__for_neuromodulated_stdp_synapse_nestml\",\n", + " \"initial_values\": {\n", + " \"post_trace__for_neuromodulated_stdp_synapse_nestml\": \"0.0\"\n", + " }\n", + " }\n", + " ],\n", + " \"options\": {\n", + " \"output_timestep_symbol\": \"__h\"\n", + " },\n", + " \"parameters\": {\n", + " \"E_e\": \"0\",\n", + " \"E_l\": \"(-74)\",\n", + " \"I_e\": \"0\",\n", + " \"V_reset\": \"(-60)\",\n", + " \"V_th\": \"(-54)\",\n", + " \"s\": \"1000\",\n", + " \"tau_g\": \"5\",\n", + " \"tau_m\": \"10\",\n", + " \"tau_tr_post__for_neuromodulated_stdp_synapse_nestml\": \"20\"\n", + " }\n", + "}\n", + "INFO:root:Processing global options...\n", + "INFO:root:Processing input shapes...\n", + "INFO:root:\n", + "Processing differential-equation form shape g_e with defining expression = \"(-g_e) / tau_g\"\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol g_e, derivative_factors = [-1/tau_g], inhom_term = 0.0, nonlin_term = 0.0\n", + "INFO:root:\tReturning shape: Shape \"g_e\" of order 1\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "INFO:root:\n", + "Processing differential-equation form shape V_m with defining expression = \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\"\n", + "DEBUG:root:Splitting expression (E_l + I_e + I_stim - V_m + g_e*(E_e - V_m))/tau_m (symbols [V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_m]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m\n", + "DEBUG:root:\tnonlinear term: E_e*g_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m\n", + "DEBUG:root:Created Shape with symbol V_m, derivative_factors = [-1/tau_m], inhom_term = E_l/tau_m + I_e/tau_m, nonlin_term = E_e*g_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m\n", + "INFO:root:\tReturning shape: Shape \"V_m\" of order 1\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[51,iaf_psc_exp_neuron_nestml, WARNING, [42:8;42:17]]: Variable 's' has the same name as a physical unit!\n", + "[52,iaf_psc_exp_neuron_nestml, INFO, [39:19;39:19]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[53,iaf_psc_exp_neuron_nestml, INFO, [42:17;42:17]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[54,iaf_psc_exp_neuron_nestml, INFO, [55:15;55:32]]: Implicit casting from (compatible) type '1 / s buffer' to 'real'.\n", + "[55,GLOBAL, INFO]: Analysing/transforming model 'iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml'\n", + "[56,iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml, INFO, [20:0;60:0]]: Starts processing of the model 'iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml'\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "INFO:root:\n", + "Processing differential-equation form shape post_trace__for_neuromodulated_stdp_synapse_nestml with defining expression = \"(-post_trace__for_neuromodulated_stdp_synapse_nestml) / tau_tr_post__for_neuromodulated_stdp_synapse_nestml\"\n", + "DEBUG:root:Splitting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml (symbols [post_trace__for_neuromodulated_stdp_synapse_nestml])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol post_trace__for_neuromodulated_stdp_synapse_nestml, derivative_factors = [-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml], inhom_term = 0.0, nonlin_term = 0.0\n", + "INFO:root:\tReturning shape: Shape \"post_trace__for_neuromodulated_stdp_synapse_nestml\" of order 1\n", + "INFO:root:Shape post_trace__for_neuromodulated_stdp_synapse_nestml: reconstituting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml\n", + "INFO:root:All known variables: [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml], all parameters used in ODEs: {tau_tr_post__for_neuromodulated_stdp_synapse_nestml, tau_m, E_e, tau_g, E_l, I_e, I_stim}\n", + "INFO:root:No numerical value specified for parameter \"I_stim\"\n", + "INFO:root:\n", + "Processing differential-equation form shape g_e with defining expression = \"(-g_e) / tau_g\"\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml, g_e])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol g_e, derivative_factors = [-1/tau_g], inhom_term = 0.0, nonlin_term = 0\n", + "INFO:root:\tReturning shape: Shape \"g_e\" of order 1\n", + "INFO:root:\n", + "Processing differential-equation form shape V_m with defining expression = \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\"\n", + "DEBUG:root:Splitting expression (E_l + I_e + I_stim - V_m + g_e*(E_e - V_m))/tau_m (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml, g_e, V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m], [0], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "DEBUG:root:Created Shape with symbol V_m, derivative_factors = [-1/tau_m], inhom_term = E_l/tau_m + I_e/tau_m + I_stim/tau_m, nonlin_term = E_e*g_e/tau_m - V_m*g_e/tau_m\n", + "INFO:root:\tReturning shape: Shape \"V_m\" of order 1\n", + "INFO:root:\n", + "Processing differential-equation form shape post_trace__for_neuromodulated_stdp_synapse_nestml with defining expression = \"(-post_trace__for_neuromodulated_stdp_synapse_nestml) / tau_tr_post__for_neuromodulated_stdp_synapse_nestml\"\n", + "DEBUG:root:Splitting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml, g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml])\n", + "DEBUG:root:\tlinear factors: Matrix([[0], [0], [-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml], [0], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol post_trace__for_neuromodulated_stdp_synapse_nestml, derivative_factors = [-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml], inhom_term = 0.0, nonlin_term = 0\n", + "INFO:root:\tReturning shape: Shape \"post_trace__for_neuromodulated_stdp_synapse_nestml\" of order 1\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols Matrix([[g_e], [V_m], [post_trace__for_neuromodulated_stdp_synapse_nestml]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "DEBUG:root:Splitting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m (symbols Matrix([[g_e], [V_m], [post_trace__for_neuromodulated_stdp_synapse_nestml]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m], [0]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "INFO:root:Shape post_trace__for_neuromodulated_stdp_synapse_nestml: reconstituting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml\n", + "DEBUG:root:Splitting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml (symbols Matrix([[g_e], [V_m], [post_trace__for_neuromodulated_stdp_synapse_nestml]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[0], [0], [-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[g_e], [V_m], [post_trace__for_neuromodulated_stdp_synapse_nestml]]), A = Matrix([[-1/tau_g, 0, 0], [E_e/tau_m, -1/tau_m, 0], [0, 0, -1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]]), b = Matrix([[0], [E_l/tau_m + I_e/tau_m + I_stim/tau_m], [0]]), c = Matrix([[0], [-V_m*g_e/tau_m], [0]])\n", + "INFO:root:Finding analytically solvable equations...\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "DEBUG:root:Splitting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml])\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m], [0]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "INFO:root:Shape post_trace__for_neuromodulated_stdp_synapse_nestml: reconstituting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml\n", + "DEBUG:root:Splitting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml])\n", + "DEBUG:root:\tlinear factors: Matrix([[0], [0], [-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Generating numerical solver for the following symbols: g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[g_e], [V_m], [post_trace__for_neuromodulated_stdp_synapse_nestml]]), A = Matrix([[-1/tau_g, 0, 0], [E_e/tau_m, -1/tau_m, 0], [0, 0, -1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]]), b = Matrix([[0], [E_l/tau_m + I_e/tau_m + I_stim/tau_m], [0]]), c = Matrix([[0], [-V_m*g_e/tau_m], [0]])\n", + "INFO:root:Preserving expression for variable \"g_e\"\n", + "INFO:root:Preserving expression for variable \"V_m\"\n", + "INFO:root:Preserving expression for variable \"post_trace__for_neuromodulated_stdp_synapse_nestml\"\n", + "INFO:root:In ode-toolbox: returning outdict = \n", + "INFO:root:[\n", + " {\n", + " \"initial_values\": {\n", + " \"V_m\": \"E_l\",\n", + " \"g_e\": \"0.0\",\n", + " \"post_trace__for_neuromodulated_stdp_synapse_nestml\": \"0.0\"\n", + " },\n", + " \"parameters\": {\n", + " \"E_e\": \"0\",\n", + " \"E_l\": \"-74.0000000000000\",\n", + " \"I_e\": \"0\",\n", + " \"tau_g\": \"5.00000000000000\",\n", + " \"tau_m\": \"10.0000000000000\",\n", + " \"tau_tr_post__for_neuromodulated_stdp_synapse_nestml\": \"20.0000000000000\"\n", + " },\n", + " \"solver\": \"numeric\",\n", + " \"state_variables\": [\n", + " \"g_e\",\n", + " \"V_m\",\n", + " \"post_trace__for_neuromodulated_stdp_synapse_nestml\"\n", + " ],\n", + " \"update_expressions\": {\n", + " \"V_m\": \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\",\n", + " \"g_e\": \"(-g_e) / tau_g\",\n", + " \"post_trace__for_neuromodulated_stdp_synapse_nestml\": \"(-post_trace__for_neuromodulated_stdp_synapse_nestml) / tau_tr_post__for_neuromodulated_stdp_synapse_nestml\"\n", + " }\n", + " }\n", + "]\n", + "INFO:root:Analysing input:\n", + "INFO:root:{\n", + " \"dynamics\": [\n", + " {\n", + " \"expression\": \"pre_trace' = (-pre_trace) / tau_tr_pre\",\n", + " \"initial_values\": {\n", + " \"pre_trace\": \"0.0\"\n", + " }\n", + " }\n", + " ],\n", + " \"options\": {\n", + " \"output_timestep_symbol\": \"__h\"\n", + " },\n", + " \"parameters\": {\n", + " \"Wmax\": \"100.0\",\n", + " \"Wmin\": \"0.0\",\n", + " \"alpha\": \"1\",\n", + " \"d\": \"1\",\n", + " \"lambda\": \"0.01\",\n", + " \"mu_minus\": \"1\",\n", + " \"mu_plus\": \"1\",\n", + " \"n\": \"0.0\",\n", + " \"tau_tr_post\": \"20\",\n", + " \"tau_tr_pre\": \"20\"\n", + " }\n", + "}\n", + "INFO:root:Processing global options...\n", + "INFO:root:Processing input shapes...\n", + "INFO:root:\n", + "Processing differential-equation form shape pre_trace with defining expression = \"(-pre_trace) / tau_tr_pre\"\n", + "DEBUG:root:Splitting expression -pre_trace/tau_tr_pre (symbols [pre_trace])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_tr_pre]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol pre_trace, derivative_factors = [-1/tau_tr_pre], inhom_term = 0.0, nonlin_term = 0.0\n", + "INFO:root:\tReturning shape: Shape \"pre_trace\" of order 1\n", + "INFO:root:Shape pre_trace: reconstituting expression -pre_trace/tau_tr_pre\n", + "INFO:root:All known variables: [pre_trace], all parameters used in ODEs: {tau_tr_pre}\n", + "INFO:root:\n", + "Processing differential-equation form shape pre_trace with defining expression = \"(-pre_trace) / tau_tr_pre\"\n", + "DEBUG:root:Splitting expression -pre_trace/tau_tr_pre (symbols [pre_trace, pre_trace])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_tr_pre], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol pre_trace, derivative_factors = [-1/tau_tr_pre], inhom_term = 0.0, nonlin_term = 0\n", + "INFO:root:\tReturning shape: Shape \"pre_trace\" of order 1\n", + "INFO:root:Shape pre_trace: reconstituting expression -pre_trace/tau_tr_pre\n", + "DEBUG:root:Splitting expression -pre_trace/tau_tr_pre (symbols Matrix([[pre_trace]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_tr_pre]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[pre_trace]]), A = Matrix([[-1/tau_tr_pre]]), b = Matrix([[0]]), c = Matrix([[0]])\n", + "INFO:root:Finding analytically solvable equations...\n", + "INFO:root:Shape pre_trace: reconstituting expression -pre_trace/tau_tr_pre\n", + "DEBUG:root:Splitting expression -pre_trace/tau_tr_pre (symbols [pre_trace])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_tr_pre]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Generating propagators for the following symbols: pre_trace\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[pre_trace]]), A = Matrix([[-1/tau_tr_pre]]), b = Matrix([[0]]), c = Matrix([[0]])\n", + "DEBUG:root:System of equations:\n", + "DEBUG:root:x = Matrix([[pre_trace]])\n", + "DEBUG:root:A = Matrix([[-1/tau_tr_pre]])\n", + "DEBUG:root:b = Matrix([[0]])\n", + "DEBUG:root:c = Matrix([[0]])\n", + "INFO:root:update_expr[pre_trace] = __P__pre_trace__pre_trace*pre_trace\n", + "WARNING:root:Not preserving expression for variable \"pre_trace\" as it is solved by propagator solver\n", + "INFO:root:In ode-toolbox: returning outdict = \n", + "INFO:root:[\n", + " {\n", + " \"initial_values\": {\n", + " \"pre_trace\": \"0.0\"\n", + " },\n", + " \"parameters\": {\n", + " \"tau_tr_pre\": \"20.0000000000000\"\n", + " },\n", + " \"propagators\": {\n", + " \"__P__pre_trace__pre_trace\": \"exp(-__h/tau_tr_pre)\"\n", + " },\n", + " \"solver\": \"analytical\",\n", + " \"state_variables\": [\n", + " \"pre_trace\"\n", + " ],\n", + " \"update_expressions\": {\n", + " \"pre_trace\": \"__P__pre_trace__pre_trace*pre_trace\"\n", + " }\n", + " }\n", + "]\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[57,iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml, WARNING, [42:8;42:17]]: Variable 's' has the same name as a physical unit!\n", + "[58,iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml, INFO, [39:19;39:19]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[59,iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml, INFO, [42:17;42:17]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[60,iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml, INFO, [55:15;55:32]]: Implicit casting from (compatible) type '1 / s buffer' to 'real'.\n", + "[61,GLOBAL, INFO]: Analysing/transforming synapse neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.\n", + "[62,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, INFO, [8:0;55:0]]: Starts processing of the model 'neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml'\n", + "[63,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, WARNING, [16:8;16:17]]: Variable 'd' has the same name as a physical unit!\n", + "[64,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, INFO, [10:17;10:17]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[65,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, INFO, [20:21;20:21]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[66,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, INFO, [21:23;21:23]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[67,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, INFO, [22:24;22:24]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[68,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, INFO, [45:21;45:21]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[69,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, WARNING, [16:8;16:17]]: Variable 'd' has the same name as a physical unit!\n", + "[70,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, INFO, [10:17;10:17]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[71,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, INFO, [20:21;20:21]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[72,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, INFO, [21:23;21:23]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[73,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, INFO, [22:24;22:24]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[74,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, INFO, [45:21;45:21]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[75,GLOBAL, INFO]: Rendering template /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml.cpp\n", + "[76,GLOBAL, INFO]: Rendering template /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml.h\n", + "[77,iaf_psc_exp_neuron_nestml, INFO, [20:0;60:0]]: Successfully generated code for the model: 'iaf_psc_exp_neuron_nestml' in: '/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target' !\n", + "[78,GLOBAL, INFO]: Rendering template /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.cpp\n", + "[79,GLOBAL, INFO]: Rendering template /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.h\n", + "[80,iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml, INFO, [20:0;60:0]]: Successfully generated code for the model: 'iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml' in: '/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target' !\n", + "[81,GLOBAL, INFO]: Rendering template /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h\n", + "[82,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, INFO, [8:0;55:0]]: Successfully generated code for the model: 'neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml' in: '/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target' !\n", + "[83,GLOBAL, INFO]: Rendering template /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/CMakeLists.txt\n", + "[84,GLOBAL, INFO]: Rendering template /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/nestml_2ca2dd95a1c84024b30f1543f642de02_module.h\n", + "[85,GLOBAL, INFO]: Rendering template /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/nestml_2ca2dd95a1c84024b30f1543f642de02_module.cpp\n", + "[86,GLOBAL, INFO]: Successfully generated NEST module code in '/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target' !\n", + "\u001b[33mCMake Warning (dev) at CMakeLists.txt:95 (project):\n", + " cmake_minimum_required() should be called prior to this top-level project()\n", + " call. Please see the cmake-commands(7) manual for usage documentation of\n", + " both commands.\n", + "This warning is for project developers. Use -Wno-dev to suppress it.\n", + "\u001b[0m\n", + "-- The CXX compiler identification is Clang 18.1.8\n", + "-- Detecting CXX compiler ABI info\n", + "-- Detecting CXX compiler ABI info - done\n", + "-- Check for working CXX compiler: /opt/homebrew/anaconda3/envs/cart_pole/bin/arm64-apple-darwin20.0.0-clang++ - skipped\n", + "-- Detecting CXX compile features\n", + "-- Detecting CXX compile features - done\n", + "\u001b[0m\u001b[0m\n", + "\u001b[0m-------------------------------------------------------\u001b[0m\n", + "\u001b[0mnestml_2ca2dd95a1c84024b30f1543f642de02_module Configuration Summary\u001b[0m\n", + "\u001b[0m-------------------------------------------------------\u001b[0m\n", + "\u001b[0m\u001b[0m\n", + "\u001b[0mC++ compiler : /opt/homebrew/anaconda3/envs/cart_pole/bin/arm64-apple-darwin20.0.0-clang++\u001b[0m\n", + "\u001b[0mBuild static libs : OFF\u001b[0m\n", + "\u001b[0mC++ compiler flags : -ftree-vectorize -fPIC -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -isystem /opt/homebrew/anaconda3/envs/cart_pole/include\u001b[0m\n", + "\u001b[0mNEST compiler flags : -ftree-vectorize -fPIC -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -isystem /opt/homebrew/anaconda3/envs/cart_pole/include -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/nest-simulator_1724732993440/work=/usr/local/src/conda/nest-simulator-3.8 -fdebug-prefix-map=/opt/homebrew/anaconda3/envs/cart_pole=/usr/local/src/conda-prefix -std=c++17 -Wall -Xclang -fopenmp -O2\u001b[0m\n", + "\u001b[0mNEST include dirs : -I/opt/homebrew/anaconda3/envs/cart_pole/include/nest -I/opt/homebrew/anaconda3/envs/cart_pole/include -I/opt/homebrew/anaconda3/envs/cart_pole/include -I/opt/homebrew/anaconda3/envs/cart_pole/include -I/opt/homebrew/anaconda3/envs/cart_pole/include\u001b[0m\n", + "\u001b[0mNEST libraries flags : -L/opt/homebrew/anaconda3/envs/cart_pole/lib/nest -lnest -lsli /opt/homebrew/anaconda3/envs/cart_pole/lib/libltdl.dylib /opt/homebrew/anaconda3/envs/cart_pole/lib/libreadline.dylib /opt/homebrew/anaconda3/envs/cart_pole/lib/libncurses.dylib /opt/homebrew/anaconda3/envs/cart_pole/lib/libgsl.dylib /opt/homebrew/anaconda3/envs/cart_pole/lib/libgslcblas.dylib /opt/homebrew/anaconda3/envs/cart_pole/lib/libomp.dylib\u001b[0m\n", + "\u001b[0m\u001b[0m\n", + "\u001b[0m-------------------------------------------------------\u001b[0m\n", + "\u001b[0m\u001b[0m\n", + "\u001b[0mYou can now build and install 'nestml_2ca2dd95a1c84024b30f1543f642de02_module' using\u001b[0m\n", + "\u001b[0m make\u001b[0m\n", + "\u001b[0m make install\u001b[0m\n", + "\u001b[0m\u001b[0m\n", + "\u001b[0mThe library file libnestml_2ca2dd95a1c84024b30f1543f642de02_module.so will be installed to\u001b[0m\n", + "\u001b[0m /var/folders/3h/2lc1zrkd375b1l0m8zcfj6440000gn/T/nestml_target_t1_9slx9\u001b[0m\n", + "\u001b[0mThe module can be loaded into NEST using\u001b[0m\n", + "\u001b[0m (nestml_2ca2dd95a1c84024b30f1543f642de02_module) Install (in SLI)\u001b[0m\n", + "\u001b[0m nest.Install(nestml_2ca2dd95a1c84024b30f1543f642de02_module) (in PyNEST)\u001b[0m\n", + "\u001b[0m\u001b[0m\n", + "\u001b[33mCMake Warning (dev) in CMakeLists.txt:\n", + " No cmake_minimum_required command is present. A line of code such as\n", + "\n", + " cmake_minimum_required(VERSION 3.31)\n", + "\n", + " should be added at the top of the file. The version specified may be lower\n", + " if you wish to support older CMake versions for this project. For more\n", + " information run \"cmake --help-policy CMP0000\".\n", + "This warning is for project developers. Use -Wno-dev to suppress it.\n", + "\u001b[0m\n", + "-- Configuring done (0.4s)\n", + "-- Generating done (0.0s)\n", + "-- Build files have been written to: /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target\n", + "[ 25%] \u001b[32mBuilding CXX object CMakeFiles/nestml_2ca2dd95a1c84024b30f1543f642de02_module_module.dir/nestml_2ca2dd95a1c84024b30f1543f642de02_module.o\u001b[0m\n", + "[ 75%] \u001b[32mBuilding CXX object CMakeFiles/nestml_2ca2dd95a1c84024b30f1543f642de02_module_module.dir/iaf_psc_exp_neuron_nestml.o\u001b[0m\n", + "[ 75%] \u001b[32mBuilding CXX object CMakeFiles/nestml_2ca2dd95a1c84024b30f1543f642de02_module_module.dir/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.o\u001b[0m\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml.cpp:191:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 191 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "In file included from /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.cpp:44:\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.h:252:8: warning: 'register_stdp_connection' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]\n", + " 252 | void register_stdp_connection( double t_first_read, double delay );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/node.h:482:16: note: overridden virtual function is here\n", + " 482 | virtual void register_stdp_connection( double, double );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml.cpp:271:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 271 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml.cpp:328:10: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 328 | auto get_t = [origin, lag](){ return nest::Time( nest::Time::step( origin.get_steps() + lag + 1) ).get_ms(); };\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml.cpp:322:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 322 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml.cpp:496:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 496 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function \n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.cpp:201:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 201 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.cpp:290:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 290 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.cpp:347:77: warning: unused variable 'node' [-Wunused-variable]\n", + " 347 | const iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml& node = *( reinterpret_cast< iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml* >( pnode ) );\n", + " | ^~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.cpp:366:10: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 366 | auto get_t = [origin, lag](){ return nest::Time( nest::Time::step( origin.get_steps() + lag + 1) ).get_ms(); };\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.cpp:360:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 360 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.cpp:537:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 537 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function \n", + " | ^~~~~~~~~~\n", + "In file included from /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/nestml_2ca2dd95a1c84024b30f1543f642de02_module.cpp:33:\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.h:252:8: warning: 'register_stdp_connection' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]\n", + " 252 | void register_stdp_connection( double t_first_read, double delay );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/node.h:482:16: note: overridden virtual function is here\n", + " 482 | virtual void register_stdp_connection( double, double );\n", + " | ^\n", + "In file included from /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/nestml_2ca2dd95a1c84024b30f1543f642de02_module.cpp:36:\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:429:18: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 429 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:452:12: warning: variable 'timestep' set but not used [-Wunused-but-set-variable]\n", + " 452 | double timestep = 0;\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:713:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 713 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:725:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 725 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:789:18: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 789 | const double __timestep = timestep; // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:431:10: warning: unused variable 'get_thread' [-Wunused-variable]\n", + " 431 | auto get_thread = [tid]()\n", + " | ^~~~~~~~~~\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_base.h:391:18: note: in instantiation of member function 'nest::neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml::send' requested here\n", + " 391 | C_[ lcid ].send( e, tid, cp );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_base.h:227:12: note: in instantiation of member function 'nest::Connector>::send_to_all' requested here\n", + " 227 | explicit Connector( const synindex syn_id )\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:311:45: note: in instantiation of member function 'nest::Connector>::Connector' requested here\n", + " 311 | thread_local_connectors[ syn_id ] = new Connector< ConnectionT >( syn_id );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:292:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection_' requested here\n", + " 292 | add_connection_( src, tgt, thread_local_connectors, syn_id, connection, actual_receptor_type );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model.h:162:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection' requested here\n", + " 162 | GenericConnectorModel( const std::string name )\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/model_manager_impl.h:62:9: note: in instantiation of member function 'nest::GenericConnectorModel>::GenericConnectorModel' requested here\n", + " 62 | new GenericConnectorModel< ConnectionT< TargetIdentifierPtrRport > >( \"dummy\" );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/nest_impl.h:37:26: note: in instantiation of function template specialization 'nest::ModelManager::register_connection_model' requested here\n", + " 37 | kernel().model_manager.register_connection_model< ConnectorModelT >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:597:9: note: in instantiation of function template specialization 'nest::register_connection_model' requested here\n", + " 597 | nest::register_connection_model< neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:504:14: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 504 | auto get_t = [t_hist_entry_ms](){ return t_hist_entry_ms; }; // do not remove, this is in case the predefined time variable ``t`` is used in the NESTML model\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:532:12: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 532 | auto get_t = [__t_spike](){ return __t_spike; }; // do not remove, this is in case the predefined time variable ``t`` is used in the NESTML model\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:572:12: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 572 | auto get_t = [__t_spike](){ return __t_spike; }; // do not remove, this is in case the predefined time variable ``t`` is used in the NESTML model\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:790:10: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 790 | auto get_t = [t_start](){ return t_start; }; // do not remove, this is in case the predefined time variable ``t`` is used in the NESTML model\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:499:9: note: in instantiation of member function 'nest::neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml::update_internal_state_' requested here\n", + " 499 | update_internal_state_(t_lastspike_, (start->t_ + __dendritic_delay) - t_lastspike_, cp);\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_base.h:391:18: note: in instantiation of member function 'nest::neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml::send' requested here\n", + " 391 | C_[ lcid ].send( e, tid, cp );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_base.h:227:12: note: in instantiation of member function 'nest::Connector>::send_to_all' requested here\n", + " 227 | explicit Connector( const synindex syn_id )\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:311:45: note: in instantiation of member function 'nest::Connector>::Connector' requested here\n", + " 311 | thread_local_connectors[ syn_id ] = new Connector< ConnectionT >( syn_id );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:292:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection_' requested here\n", + " 292 | add_connection_( src, tgt, thread_local_connectors, syn_id, connection, actual_receptor_type );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model.h:162:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection' requested here\n", + " 162 | GenericConnectorModel( const std::string name )\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/model_manager_impl.h:62:9: note: in instantiation of member function 'nest::GenericConnectorModel>::GenericConnectorModel' requested here\n", + " 62 | new GenericConnectorModel< ConnectionT< TargetIdentifierPtrRport > >( \"dummy\" );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/nest_impl.h:37:26: note: in instantiation of function template specialization 'nest::ModelManager::register_connection_model' requested here\n", + " 37 | kernel().model_manager.register_connection_model< ConnectorModelT >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:597:9: note: in instantiation of function template specialization 'nest::register_connection_model' requested here\n", + " 597 | nest::register_connection_model< neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:417:7: warning: expression result unused [-Wunused-value]\n", + " 417 | dynamic_cast< iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml& >(t);\n", + " | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:316:14: note: in instantiation of member function 'nest::neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml::check_connection' requested here\n", + " 316 | connection.check_connection( src, tgt, receptor_type, get_common_properties() );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:292:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection_' requested here\n", + " 292 | add_connection_( src, tgt, thread_local_connectors, syn_id, connection, actual_receptor_type );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model.h:162:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection' requested here\n", + " 162 | GenericConnectorModel( const std::string name )\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/model_manager_impl.h:62:9: note: in instantiation of member function 'nest::GenericConnectorModel>::GenericConnectorModel' requested here\n", + " 62 | new GenericConnectorModel< ConnectionT< TargetIdentifierPtrRport > >( \"dummy\" );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/nest_impl.h:37:26: note: in instantiation of function template specialization 'nest::ModelManager::register_connection_model' requested here\n", + " 37 | kernel().model_manager.register_connection_model< ConnectorModelT >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:597:9: note: in instantiation of function template specialization 'nest::register_connection_model' requested here\n", + " 597 | nest::register_connection_model< neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:431:10: warning: unused variable 'get_thread' [-Wunused-variable]\n", + " 431 | auto get_thread = [tid]()\n", + " | ^~~~~~~~~~\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_base.h:391:18: note: in instantiation of member function 'nest::neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml::send' requested here\n", + " 391 | C_[ lcid ].send( e, tid, cp );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_base.h:227:12: note: in instantiation of member function 'nest::Connector>::send_to_all' requested here\n", + " 227 | explicit Connector( const synindex syn_id )\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:311:45: note: in instantiation of member function 'nest::Connector>::Connector' requested here\n", + " 311 | thread_local_connectors[ syn_id ] = new Connector< ConnectionT >( syn_id );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:292:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection_' requested here\n", + " 292 | add_connection_( src, tgt, thread_local_connectors, syn_id, connection, actual_receptor_type );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model.h:162:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection' requested here\n", + " 162 | GenericConnectorModel( const std::string name )\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/model_manager_impl.h:103:38: note: in instantiation of member function 'nest::GenericConnectorModel>::GenericConnectorModel' requested here\n", + " 103 | ConnectorModel* conn_model = new GenericConnectorModel< CompleteConnectionT >( name );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/model_manager_impl.h:67:5: note: in instantiation of function template specialization 'nest::ModelManager::register_specific_connection_model_>' requested here\n", + " 67 | register_specific_connection_model_< ConnectionT< TargetIdentifierIndex > >( name + \"_hpc\" );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/nest_impl.h:37:26: note: in instantiation of function template specialization 'nest::ModelManager::register_connection_model' requested here\n", + " 37 | kernel().model_manager.register_connection_model< ConnectorModelT >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:597:9: note: in instantiation of function template specialization 'nest::register_connection_model' requested here\n", + " 597 | nest::register_connection_model< neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:504:14: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 504 | auto get_t = [t_hist_entry_ms](){ return t_hist_entry_ms; }; // do not remove, this is in case the predefined time variable ``t`` is used in the NESTML model\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:532:12: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 532 | auto get_t = [__t_spike](){ return __t_spike; }; // do not remove, this is in case the predefined time variable ``t`` is used in the NESTML model\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:572:12: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 572 | auto get_t = [__t_spike](){ return __t_spike; }; // do not remove, this is in case the predefined time variable ``t`` is used in the NESTML model\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:790:10: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 790 | auto get_t = [t_start](){ return t_start; }; // do not remove, this is in case the predefined time variable ``t`` is used in the NESTML model\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:499:9: note: in instantiation of member function 'nest::neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml::update_internal_state_' requested here\n", + " 499 | update_internal_state_(t_lastspike_, (start->t_ + __dendritic_delay) - t_lastspike_, cp);\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_base.h:391:18: note: in instantiation of member function 'nest::neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml::send' requested here\n", + " 391 | C_[ lcid ].send( e, tid, cp );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_base.h:227:12: note: in instantiation of member function 'nest::Connector>::send_to_all' requested here\n", + " 227 | explicit Connector( const synindex syn_id )\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:311:45: note: in instantiation of member function 'nest::Connector>::Connector' requested here\n", + " 311 | thread_local_connectors[ syn_id ] = new Connector< ConnectionT >( syn_id );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:292:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection_' requested here\n", + " 292 | add_connection_( src, tgt, thread_local_connectors, syn_id, connection, actual_receptor_type );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model.h:162:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection' requested here\n", + " 162 | GenericConnectorModel( const std::string name )\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/model_manager_impl.h:103:38: note: in instantiation of member function 'nest::GenericConnectorModel>::GenericConnectorModel' requested here\n", + " 103 | ConnectorModel* conn_model = new GenericConnectorModel< CompleteConnectionT >( name );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/model_manager_impl.h:67:5: note: in instantiation of function template specialization 'nest::ModelManager::register_specific_connection_model_>' requested here\n", + " 67 | register_specific_connection_model_< ConnectionT< TargetIdentifierIndex > >( name + \"_hpc\" );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/nest_impl.h:37:26: note: in instantiation of function template specialization 'nest::ModelManager::register_connection_model' requested here\n", + " 37 | kernel().model_manager.register_connection_model< ConnectorModelT >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:597:9: note: in instantiation of function template specialization 'nest::register_connection_model' requested here\n", + " 597 | nest::register_connection_model< neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:417:7: warning: expression result unused [-Wunused-value]\n", + " 417 | dynamic_cast< iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml& >(t);\n", + " | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:316:14: note: in instantiation of member function 'nest::neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml::check_connection' requested here\n", + " 316 | connection.check_connection( src, tgt, receptor_type, get_common_properties() );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:292:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection_' requested here\n", + " 292 | add_connection_( src, tgt, thread_local_connectors, syn_id, connection, actual_receptor_type );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model.h:162:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection' requested here\n", + " 162 | GenericConnectorModel( const std::string name )\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/model_manager_impl.h:103:38: note: in instantiation of member function 'nest::GenericConnectorModel>::GenericConnectorModel' requested here\n", + " 103 | ConnectorModel* conn_model = new GenericConnectorModel< CompleteConnectionT >( name );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/model_manager_impl.h:67:5: note: in instantiation of function template specialization 'nest::ModelManager::register_specific_connection_model_>' requested here\n", + " 67 | register_specific_connection_model_< ConnectionT< TargetIdentifierIndex > >( name + \"_hpc\" );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/nest_impl.h:37:26: note: in instantiation of function template specialization 'nest::ModelManager::register_connection_model' requested here\n", + " 37 | kernel().model_manager.register_connection_model< ConnectorModelT >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:597:9: note: in instantiation of function template specialization 'nest::register_connection_model' requested here\n", + " 597 | nest::register_connection_model< neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml >( name );\n", + " | ^\n", + "5 warnings generated.\n", + "7 warnings generated.\n", + "18 warnings generated.\n", + "[100%] \u001b[32m\u001b[1mLinking CXX shared module nestml_2ca2dd95a1c84024b30f1543f642de02_module.so\u001b[0m\n", + "[100%] Built target nestml_2ca2dd95a1c84024b30f1543f642de02_module_module\n", + "[100%] Built target nestml_2ca2dd95a1c84024b30f1543f642de02_module_module\n", + "\u001b[36mInstall the project...\u001b[0m\n", + "-- Install configuration: \"\"\n", + "-- Installing: /var/folders/3h/2lc1zrkd375b1l0m8zcfj6440000gn/T/nestml_target_t1_9slx9/nestml_2ca2dd95a1c84024b30f1543f642de02_module.so\n" + ] + } + ], + "source": [ + "from pynestml.codegeneration.nest_code_generator_utils import NESTCodeGeneratorUtils\n", + "\n", + "# generate and build code\n", + "input_layer_module_name, input_layer_neuron_model_name = \\\n", + " NESTCodeGeneratorUtils.generate_code_for(\"../../../models/neurons/ignore_and_fire_neuron.nestml\")\n", + "\n", + "# ignore_and_fire\n", + "output_layer_module_name, output_layer_neuron_model_name, output_layer_synapse_model_name = \\\n", + " NESTCodeGeneratorUtils.generate_code_for(\"iaf_psc_exp_neuron.nestml\",\n", + " \"neuromodulated_stdp_synapse.nestml\",\n", + " post_ports=[\"post_spikes\"],\n", + " logging_level=\"DEBUG\",\n", + " codegen_opts={\"delay_variable\": {\"neuromodulated_stdp_synapse\": \"d\"},\n", + " \"weight_variable\": {\"neuromodulated_stdp_synapse\": \"w\"}})" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "DEBUG:matplotlib:CACHEDIR=/Users/alexiswisniewski/.matplotlib\n", + "DEBUG:matplotlib.font_manager:Using fontManager instance from /Users/alexiswisniewski/.matplotlib/fontlist-v390.json\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "\n", + "class Spiking_PlotRenderer():\n", + " def __init__(self) -> None:\n", + "\n", + " plt.ion()\n", + " \n", + " self.fig, self.ax = plt.subplots(nrows=3)\n", + " \n", + " # Top plot for spikes\n", + " self.ax[0].set_xlabel(\"Time [ms]\")\n", + " self.ax[0].set_title(\"Input Spikes\")\n", + " self.ax[0].set_xlim(0, 40) # Set the x-axis limits\n", + " \n", + " # Middle plot for membrane potential\n", + " self.ax[1].set_ylabel(\"V_m [mV]\")\n", + " self.ax[1].set_xlabel(\"Time [ms]\")\n", + " self.ax[1].set_xlim(0, 40) # Set the x-axis limits\n", + " self.ax[1].invert_yaxis()\n", + "\n", + " self.ax[2].set_ylabel(\"g_e [no unit]\")\n", + " self.ax[2].set_xlabel(\"Time [ms]\")\n", + " self.ax[2].set_xlim(0, 40) # Set the x-axis limits\n", + " self.ax[2].invert_yaxis()\n", + " \n", + " self.fig.show()\n", + " \n", + " def update(self, data) -> None:\n", + " if data is None: return\n", + "\n", + " self.ax[0].cla()\n", + " self.ax[1].cla()\n", + " self.ax[2].cla()\n", + "\n", + " self.ax[0].set_ylabel(\"Input Spike\")\n", + " self.ax[0].plot(data[\"input_spikes\"][\"times\"], data[\"input_spikes\"][\"senders\"], \".k\", markersize=1)\n", + " self.ax[0].set_xlim(np.min(data[\"multimeter_output_events\"][\"times\"])-5, np.max(data[\"multimeter_output_events\"][\"times\"])+5)\n", + " \n", + " self.ax[1].set_ylabel(\"V_m [mV]\")\n", + " self.ax[1].plot(data[\"multimeter_output_events\"][\"times\"], data[\"multimeter_output_events\"][\"V_m\"], 'r')\n", + " self.ax[1].set_xlim(np.min(data[\"multimeter_output_events\"][\"times\"])-5, np.max(data[\"multimeter_output_events\"][\"times\"])+5)\n", + "\n", + " self.ax[2].set_ylabel(\"g_e [no unit]\")\n", + " self.ax[2].set_xlabel(\"Time [ms]\")\n", + " self.ax[2].plot(data[\"multimeter_output_events\"][\"times\"], data[\"multimeter_output_events\"][\"g_e\"], 'b')\n", + " self.ax[2].set_xlim(np.min(data[\"multimeter_output_events\"][\"times\"])-5, np.max(data[\"multimeter_output_events\"][\"times\"])+5)\n", + " \n", + " self.fig.canvas.draw()\n", + " self.fig.canvas.flush_events()\n", + " plt.pause(0.0001)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "DEBUG:matplotlib.pyplot:Loaded backend qtagg version 5.15.10.\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "Feb 20 09:31:05 Install [Info]: \n", + " loaded module nestml_88103c1c059a499ea46b9bb24c4a2044_module\n", + "\n", + "Feb 20 09:31:05 Install [Info]: \n", + " loaded module nestml_6e3c8c536b3e445e9e8757f2b23a1439_module\n", + "\n", + "Feb 20 09:31:05 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:05 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:05 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:05 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:05 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:05 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:05 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:05 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:05 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:05 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:05 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:05 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:05 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:05 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:05 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:05 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:05 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:05 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:05 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:05 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:05 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:05 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:05 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:05 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:05 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:05 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:05 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:05 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:05 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:05 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:05 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:05 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:05 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:05 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:05 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:05 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:05 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:05 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:05 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:05 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:05 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:05 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:05 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:05 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:05 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:06 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:06 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:06 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:06 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:06 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:06 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:06 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:06 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:06 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:06 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:06 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:06 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:06 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:06 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:06 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:06 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:06 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:06 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:06 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:06 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:06 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:06 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:06 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:06 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:06 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:06 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:06 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:06 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:06 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:06 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:06 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:06 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:06 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:06 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:06 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:06 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:06 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:06 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:06 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:06 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:06 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:06 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:06 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:06 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:06 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:06 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:06 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:06 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:06 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:06 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:06 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:06 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:06 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:06 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:06 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:06 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:06 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:07 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:07 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:07 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:07 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:07 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:07 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:07 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:07 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:07 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:07 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:07 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:07 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:07 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:07 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:07 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:07 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:07 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:07 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:07 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:07 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:07 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:07 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:07 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:07 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:07 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:07 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:07 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:07 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:07 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:07 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:07 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:07 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:07 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:07 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:07 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:07 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:07 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:07 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:07 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:07 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:07 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:07 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:07 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:07 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:07 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:07 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:07 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:07 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:08 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:08 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:08 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:08 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:08 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:08 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:08 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:08 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:08 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:08 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:08 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:08 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:08 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:08 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:08 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:08 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:08 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:08 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:08 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:08 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:08 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:08 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:08 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:08 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:08 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:08 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:08 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:08 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:08 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:08 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:08 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:08 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:08 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:08 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:08 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:08 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:08 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:08 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:08 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:08 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:08 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:08 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:08 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:08 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:08 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:08 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:08 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:08 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:08 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:08 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:08 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:08 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:08 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:08 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:09 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:09 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:09 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:09 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:09 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:09 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:09 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:09 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:09 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:09 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:09 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:09 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:09 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:09 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:09 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:09 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:09 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:09 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:09 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:09 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:09 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:09 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:09 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:09 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:09 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:09 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:09 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:09 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:09 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:09 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:09 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:09 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:09 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:09 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:09 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:09 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:09 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:09 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:09 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:09 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:09 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:09 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:09 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:09 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:09 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:09 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:09 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:09 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:09 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:09 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:09 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:09 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:09 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:09 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:10 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:10 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:10 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:10 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:10 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:10 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:10 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:10 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:10 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:10 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:10 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:10 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:10 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:10 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:10 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:10 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:10 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:10 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:10 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:10 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:10 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:10 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:10 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:10 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:10 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:10 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:10 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:10 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:10 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:10 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:10 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:10 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:10 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:10 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:10 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:10 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:10 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:10 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:10 SimulationManager::run [Info]: \n", + " Simulation finished.\n", + "\n", + "Feb 20 09:31:10 NodeManager::prepare_nodes [Info]: \n", + " Preparing 4 nodes for simulation.\n", + "\n", + "Feb 20 09:31:10 SimulationManager::start_updating_ [Info]: \n", + " Number of local nodes: 4\n", + " Simulation time (ms): 10\n", + " Number of OpenMP threads: 1\n", + " Not using MPI\n", + "\n", + "Feb 20 09:31:10 SimulationManager::run [Info]: \n", + " Simulation finished.\n" + ] + }, + { + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[10], line 30\u001b[0m\n\u001b[1;32m 25\u001b[0m \u001b[38;5;66;03m#passed onto Spiking_Plot_Renderer()\u001b[39;00m\n\u001b[1;32m 26\u001b[0m plot_data \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 27\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124minput_spikes\u001b[39m\u001b[38;5;124m\"\u001b[39m: nest\u001b[38;5;241m.\u001b[39mGetStatus(spike_recorder_input, keys\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mevents\u001b[39m\u001b[38;5;124m\"\u001b[39m)[\u001b[38;5;241m0\u001b[39m],\n\u001b[1;32m 28\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmultimeter_output_events\u001b[39m\u001b[38;5;124m\"\u001b[39m: multimeter_output\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mevents\u001b[39m\u001b[38;5;124m\"\u001b[39m),\n\u001b[1;32m 29\u001b[0m }\n\u001b[0;32m---> 30\u001b[0m \u001b[43mplotter\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mupdate\u001b[49m\u001b[43m(\u001b[49m\u001b[43mplot_data\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 31\u001b[0m spike_recorder_input\u001b[38;5;241m.\u001b[39mn_events \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m0\u001b[39m\n\u001b[1;32m 32\u001b[0m multimeter_output\u001b[38;5;241m.\u001b[39mn_events \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m0\u001b[39m\n", + "Cell \u001b[0;32mIn[8], line 49\u001b[0m, in \u001b[0;36mSpiking_PlotRenderer.update\u001b[0;34m(self, data)\u001b[0m\n\u001b[1;32m 46\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39max[\u001b[38;5;241m2\u001b[39m]\u001b[38;5;241m.\u001b[39mplot(data[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmultimeter_output_events\u001b[39m\u001b[38;5;124m\"\u001b[39m][\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtimes\u001b[39m\u001b[38;5;124m\"\u001b[39m], data[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmultimeter_output_events\u001b[39m\u001b[38;5;124m\"\u001b[39m][\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mg_e\u001b[39m\u001b[38;5;124m\"\u001b[39m], \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 47\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39max[\u001b[38;5;241m2\u001b[39m]\u001b[38;5;241m.\u001b[39mset_xlim(np\u001b[38;5;241m.\u001b[39mmin(data[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmultimeter_output_events\u001b[39m\u001b[38;5;124m\"\u001b[39m][\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtimes\u001b[39m\u001b[38;5;124m\"\u001b[39m])\u001b[38;5;241m-\u001b[39m\u001b[38;5;241m5\u001b[39m, np\u001b[38;5;241m.\u001b[39mmax(data[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmultimeter_output_events\u001b[39m\u001b[38;5;124m\"\u001b[39m][\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtimes\u001b[39m\u001b[38;5;124m\"\u001b[39m])\u001b[38;5;241m+\u001b[39m\u001b[38;5;241m5\u001b[39m)\n\u001b[0;32m---> 49\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfig\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcanvas\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdraw\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 50\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfig\u001b[38;5;241m.\u001b[39mcanvas\u001b[38;5;241m.\u001b[39mflush_events()\n\u001b[1;32m 51\u001b[0m plt\u001b[38;5;241m.\u001b[39mpause(\u001b[38;5;241m0.0001\u001b[39m)\n", + "File \u001b[0;32m/opt/homebrew/anaconda3/envs/cart_pole/lib/python3.12/site-packages/matplotlib/backends/backend_agg.py:382\u001b[0m, in \u001b[0;36mFigureCanvasAgg.draw\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 379\u001b[0m \u001b[38;5;66;03m# Acquire a lock on the shared font cache.\u001b[39;00m\n\u001b[1;32m 380\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m (\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtoolbar\u001b[38;5;241m.\u001b[39m_wait_cursor_for_draw_cm() \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtoolbar\n\u001b[1;32m 381\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m nullcontext()):\n\u001b[0;32m--> 382\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfigure\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdraw\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrenderer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 383\u001b[0m \u001b[38;5;66;03m# A GUI class may be need to update a window using this draw, so\u001b[39;00m\n\u001b[1;32m 384\u001b[0m \u001b[38;5;66;03m# don't forget to call the superclass.\u001b[39;00m\n\u001b[1;32m 385\u001b[0m \u001b[38;5;28msuper\u001b[39m()\u001b[38;5;241m.\u001b[39mdraw()\n", + "File \u001b[0;32m/opt/homebrew/anaconda3/envs/cart_pole/lib/python3.12/site-packages/matplotlib/artist.py:94\u001b[0m, in \u001b[0;36m_finalize_rasterization..draw_wrapper\u001b[0;34m(artist, renderer, *args, **kwargs)\u001b[0m\n\u001b[1;32m 92\u001b[0m \u001b[38;5;129m@wraps\u001b[39m(draw)\n\u001b[1;32m 93\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21mdraw_wrapper\u001b[39m(artist, renderer, \u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[0;32m---> 94\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mdraw\u001b[49m\u001b[43m(\u001b[49m\u001b[43martist\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 95\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m renderer\u001b[38;5;241m.\u001b[39m_rasterizing:\n\u001b[1;32m 96\u001b[0m renderer\u001b[38;5;241m.\u001b[39mstop_rasterizing()\n", + "File \u001b[0;32m/opt/homebrew/anaconda3/envs/cart_pole/lib/python3.12/site-packages/matplotlib/artist.py:71\u001b[0m, in \u001b[0;36mallow_rasterization..draw_wrapper\u001b[0;34m(artist, renderer)\u001b[0m\n\u001b[1;32m 68\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m artist\u001b[38;5;241m.\u001b[39mget_agg_filter() \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 69\u001b[0m renderer\u001b[38;5;241m.\u001b[39mstart_filter()\n\u001b[0;32m---> 71\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mdraw\u001b[49m\u001b[43m(\u001b[49m\u001b[43martist\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 72\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[1;32m 73\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m artist\u001b[38;5;241m.\u001b[39mget_agg_filter() \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n", + "File \u001b[0;32m/opt/homebrew/anaconda3/envs/cart_pole/lib/python3.12/site-packages/matplotlib/figure.py:3257\u001b[0m, in \u001b[0;36mFigure.draw\u001b[0;34m(self, renderer)\u001b[0m\n\u001b[1;32m 3254\u001b[0m \u001b[38;5;66;03m# ValueError can occur when resizing a window.\u001b[39;00m\n\u001b[1;32m 3256\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mpatch\u001b[38;5;241m.\u001b[39mdraw(renderer)\n\u001b[0;32m-> 3257\u001b[0m \u001b[43mmimage\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_draw_list_compositing_images\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 3258\u001b[0m \u001b[43m \u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43martists\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msuppressComposite\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 3260\u001b[0m renderer\u001b[38;5;241m.\u001b[39mclose_group(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mfigure\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 3261\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n", + "File \u001b[0;32m/opt/homebrew/anaconda3/envs/cart_pole/lib/python3.12/site-packages/matplotlib/image.py:134\u001b[0m, in \u001b[0;36m_draw_list_compositing_images\u001b[0;34m(renderer, parent, artists, suppress_composite)\u001b[0m\n\u001b[1;32m 132\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m not_composite \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m has_images:\n\u001b[1;32m 133\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m a \u001b[38;5;129;01min\u001b[39;00m artists:\n\u001b[0;32m--> 134\u001b[0m \u001b[43ma\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdraw\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 135\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 136\u001b[0m \u001b[38;5;66;03m# Composite any adjacent images together\u001b[39;00m\n\u001b[1;32m 137\u001b[0m image_group \u001b[38;5;241m=\u001b[39m []\n", + "File \u001b[0;32m/opt/homebrew/anaconda3/envs/cart_pole/lib/python3.12/site-packages/matplotlib/artist.py:71\u001b[0m, in \u001b[0;36mallow_rasterization..draw_wrapper\u001b[0;34m(artist, renderer)\u001b[0m\n\u001b[1;32m 68\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m artist\u001b[38;5;241m.\u001b[39mget_agg_filter() \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 69\u001b[0m renderer\u001b[38;5;241m.\u001b[39mstart_filter()\n\u001b[0;32m---> 71\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mdraw\u001b[49m\u001b[43m(\u001b[49m\u001b[43martist\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 72\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[1;32m 73\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m artist\u001b[38;5;241m.\u001b[39mget_agg_filter() \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n", + "File \u001b[0;32m/opt/homebrew/anaconda3/envs/cart_pole/lib/python3.12/site-packages/matplotlib/axes/_base.py:3181\u001b[0m, in \u001b[0;36m_AxesBase.draw\u001b[0;34m(self, renderer)\u001b[0m\n\u001b[1;32m 3178\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m artists_rasterized:\n\u001b[1;32m 3179\u001b[0m _draw_rasterized(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mget_figure(root\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m), artists_rasterized, renderer)\n\u001b[0;32m-> 3181\u001b[0m \u001b[43mmimage\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_draw_list_compositing_images\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 3182\u001b[0m \u001b[43m \u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43martists\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_figure\u001b[49m\u001b[43m(\u001b[49m\u001b[43mroot\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msuppressComposite\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 3184\u001b[0m renderer\u001b[38;5;241m.\u001b[39mclose_group(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124maxes\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 3185\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstale \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mFalse\u001b[39;00m\n", + "File \u001b[0;32m/opt/homebrew/anaconda3/envs/cart_pole/lib/python3.12/site-packages/matplotlib/image.py:134\u001b[0m, in \u001b[0;36m_draw_list_compositing_images\u001b[0;34m(renderer, parent, artists, suppress_composite)\u001b[0m\n\u001b[1;32m 132\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m not_composite \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m has_images:\n\u001b[1;32m 133\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m a \u001b[38;5;129;01min\u001b[39;00m artists:\n\u001b[0;32m--> 134\u001b[0m \u001b[43ma\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdraw\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 135\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 136\u001b[0m \u001b[38;5;66;03m# Composite any adjacent images together\u001b[39;00m\n\u001b[1;32m 137\u001b[0m image_group \u001b[38;5;241m=\u001b[39m []\n", + "File \u001b[0;32m/opt/homebrew/anaconda3/envs/cart_pole/lib/python3.12/site-packages/matplotlib/artist.py:71\u001b[0m, in \u001b[0;36mallow_rasterization..draw_wrapper\u001b[0;34m(artist, renderer)\u001b[0m\n\u001b[1;32m 68\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m artist\u001b[38;5;241m.\u001b[39mget_agg_filter() \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 69\u001b[0m renderer\u001b[38;5;241m.\u001b[39mstart_filter()\n\u001b[0;32m---> 71\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mdraw\u001b[49m\u001b[43m(\u001b[49m\u001b[43martist\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 72\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[1;32m 73\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m artist\u001b[38;5;241m.\u001b[39mget_agg_filter() \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n", + "File \u001b[0;32m/opt/homebrew/anaconda3/envs/cart_pole/lib/python3.12/site-packages/matplotlib/axis.py:1419\u001b[0m, in \u001b[0;36mAxis.draw\u001b[0;34m(self, renderer)\u001b[0m\n\u001b[1;32m 1416\u001b[0m tlb1, tlb2 \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_get_ticklabel_bboxes(ticks_to_draw, renderer)\n\u001b[1;32m 1418\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m tick \u001b[38;5;129;01min\u001b[39;00m ticks_to_draw:\n\u001b[0;32m-> 1419\u001b[0m \u001b[43mtick\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdraw\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1421\u001b[0m \u001b[38;5;66;03m# Shift label away from axes to avoid overlapping ticklabels.\u001b[39;00m\n\u001b[1;32m 1422\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_update_label_position(renderer)\n", + "File \u001b[0;32m/opt/homebrew/anaconda3/envs/cart_pole/lib/python3.12/site-packages/matplotlib/artist.py:71\u001b[0m, in \u001b[0;36mallow_rasterization..draw_wrapper\u001b[0;34m(artist, renderer)\u001b[0m\n\u001b[1;32m 68\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m artist\u001b[38;5;241m.\u001b[39mget_agg_filter() \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 69\u001b[0m renderer\u001b[38;5;241m.\u001b[39mstart_filter()\n\u001b[0;32m---> 71\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mdraw\u001b[49m\u001b[43m(\u001b[49m\u001b[43martist\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 72\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[1;32m 73\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m artist\u001b[38;5;241m.\u001b[39mget_agg_filter() \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n", + "File \u001b[0;32m/opt/homebrew/anaconda3/envs/cart_pole/lib/python3.12/site-packages/matplotlib/axis.py:276\u001b[0m, in \u001b[0;36mTick.draw\u001b[0;34m(self, renderer)\u001b[0m\n\u001b[1;32m 273\u001b[0m renderer\u001b[38;5;241m.\u001b[39mopen_group(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__name__\u001b[39m, gid\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mget_gid())\n\u001b[1;32m 274\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m artist \u001b[38;5;129;01min\u001b[39;00m [\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mgridline, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtick1line, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtick2line,\n\u001b[1;32m 275\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mlabel1, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mlabel2]:\n\u001b[0;32m--> 276\u001b[0m \u001b[43martist\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdraw\u001b[49m\u001b[43m(\u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 277\u001b[0m renderer\u001b[38;5;241m.\u001b[39mclose_group(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__name__\u001b[39m)\n\u001b[1;32m 278\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstale \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mFalse\u001b[39;00m\n", + "File \u001b[0;32m/opt/homebrew/anaconda3/envs/cart_pole/lib/python3.12/site-packages/matplotlib/artist.py:71\u001b[0m, in \u001b[0;36mallow_rasterization..draw_wrapper\u001b[0;34m(artist, renderer)\u001b[0m\n\u001b[1;32m 68\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m artist\u001b[38;5;241m.\u001b[39mget_agg_filter() \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 69\u001b[0m renderer\u001b[38;5;241m.\u001b[39mstart_filter()\n\u001b[0;32m---> 71\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mdraw\u001b[49m\u001b[43m(\u001b[49m\u001b[43martist\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 72\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[1;32m 73\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m artist\u001b[38;5;241m.\u001b[39mget_agg_filter() \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n", + "File \u001b[0;32m/opt/homebrew/anaconda3/envs/cart_pole/lib/python3.12/site-packages/matplotlib/lines.py:748\u001b[0m, in \u001b[0;36mLine2D.draw\u001b[0;34m(self, renderer)\u001b[0m\n\u001b[1;32m 744\u001b[0m \u001b[38;5;129m@allow_rasterization\u001b[39m\n\u001b[1;32m 745\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21mdraw\u001b[39m(\u001b[38;5;28mself\u001b[39m, renderer):\n\u001b[1;32m 746\u001b[0m \u001b[38;5;66;03m# docstring inherited\u001b[39;00m\n\u001b[0;32m--> 748\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_visible\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m:\n\u001b[1;32m 749\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m\n\u001b[1;32m 751\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_invalidy \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_invalidx:\n", + "File \u001b[0;32m/opt/homebrew/anaconda3/envs/cart_pole/lib/python3.12/site-packages/matplotlib/artist.py:853\u001b[0m, in \u001b[0;36mArtist.get_visible\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 847\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 848\u001b[0m \u001b[38;5;124;03m Return the alpha value used for blending - not supported on all\u001b[39;00m\n\u001b[1;32m 849\u001b[0m \u001b[38;5;124;03m backends.\u001b[39;00m\n\u001b[1;32m 850\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[1;32m 851\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_alpha\n\u001b[0;32m--> 853\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21mget_visible\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[1;32m 854\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"Return the visibility.\"\"\"\u001b[39;00m\n\u001b[1;32m 855\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_visible\n", + "\u001b[0;31mKeyboardInterrupt\u001b[0m: " + ] + } + ], + "source": [ + "import nest\n", + "%matplotlib qt\n", + "nest.ResetKernel()\n", + "nest.Install(input_layer_module_name) # makes the generated NESTML model available\n", + "nest.Install(output_layer_module_name) # makes the generated NESTML model available\n", + "\n", + "input_neuron = nest.Create(input_layer_neuron_model_name)\n", + "output_neuron = nest.Create(output_layer_neuron_model_name)\n", + "\n", + "nest.Connect(input_neuron, output_neuron, syn_spec={\"synapse_model\": output_layer_synapse_model_name,\n", + " \"w\": 0.1 + nest.random.uniform(0., 0.02)})\n", + "\n", + "spike_recorder_input = nest.Create(\"spike_recorder\")\n", + "nest.Connect(input_neuron,spike_recorder_input)\n", + "\n", + "multimeter_output= nest.Create('multimeter', 1, {'record_from': ['V_m', 'g_e'], 'interval': 0.1})\n", + "nest.Connect(multimeter_output ,output_neuron)\n", + "\n", + "input_neuron.firing_rate = 25.\n", + "\n", + "plotter = Spiking_PlotRenderer()\n", + "for _ in range(10000):\n", + " nest.Simulate(10)\n", + " \n", + " #passed onto Spiking_Plot_Renderer()\n", + " plot_data = {\n", + " \"input_spikes\": nest.GetStatus(spike_recorder_input, keys=\"events\")[0],\n", + " \"multimeter_output_events\": multimeter_output.get(\"events\"),\n", + " }\n", + " plotter.update(plot_data)\n", + " spike_recorder_input.n_events = 0\n", + " multimeter_output.n_events = 0" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "cart_pole", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.8" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/doc/tutorials/cart_pole_reinforcement_learning/polebalancing.ipynb b/doc/tutorials/cart_pole_reinforcement_learning/polebalancing.ipynb new file mode 100644 index 000000000..86fc0cb30 --- /dev/null +++ b/doc/tutorials/cart_pole_reinforcement_learning/polebalancing.ipynb @@ -0,0 +1,4527 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "f763ff4e", + "metadata": {}, + "source": [ + "# Polebalancing using NESTML" + ] + }, + { + "cell_type": "markdown", + "id": "27c21179", + "metadata": {}, + "source": [ + "In this tutorial, we are going to build an agent that can successfully solve the classic pole balancing problem using reinforcement learning. We will start with a standard temporal difference learning approach and after that, use NESTML to set up a spiking neural network to perform this task." + ] + }, + { + "cell_type": "markdown", + "id": "0885d90c", + "metadata": {}, + "source": [ + "# Cart Pole Environment" + ] + }, + { + "cell_type": "markdown", + "id": "3e9c0bfe", + "metadata": {}, + "source": [ + "For the cart pole environment, we mostly need three things: \n", + " - A renderer to display the simulation \n", + " - The physics system and \n", + " - An input to be able to nudge the pole in both directions \n", + "\n", + "For that, we will need the following packages:" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "6ded29bc", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "pygame 2.6.1 (SDL 2.28.4, Python 3.12.8)\n", + "Hello from the pygame community. https://www.pygame.org/contribute.html\n" + ] + } + ], + "source": [ + "import pygame as pg\n", + "from typing import Tuple\n", + "import numpy as np" + ] + }, + { + "cell_type": "markdown", + "id": "2283c79f", + "metadata": {}, + "source": [ + "Let's start with the renderer..." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "d1af3680-b849-48bb-a653-642b580a01aa", + "metadata": {}, + "outputs": [], + "source": [ + "#Renders the scene. IMPORTANT: Because ipycanvas uses the html canvas coordinates, the y-axis is inverted.\n", + "class Renderer():\n", + " def __init__(self, width: int, height: int, origin_x: int = 0, origin_y: int = 0, SCALE: int = 1) -> None:\n", + " self.width = width\n", + " self.height = height\n", + " self.origin = (origin_x, origin_y)\n", + " self.SCALE = SCALE #1m = SCALE pixels\n", + "\n", + " pg.display.init()\n", + " pg.display.set_caption(\"Pole Balancing Simulator\")\n", + " pg.font.init()\n", + " self.screen = pg.display.set_mode((width, height))\n", + " \n", + " #Translates global coordinates into screen coordinates\n", + " def translate(self, x: int, y: int) -> Tuple[int, int]:\n", + " return (x+self.origin[0], -y+self.origin[1])\n", + " \n", + " #Draws ground. offset is there to shift the ground below the car\n", + " def draw_ground(self, offset: int, color) -> None:\n", + " ground = pg.Rect(self.translate(-self.width//2, -offset * self.SCALE), (self.width, self.height-self.origin[1]-offset * self.SCALE))\n", + " pg.draw.rect(self.screen, color, ground)\n", + "\n", + " #Draws car. pos_y is omitted because the car's center should be at y = 0\n", + " def draw_car(self, pos_x: float, car_color = \"blue\", wheel_color = \"black\") -> None:\n", + " pos_x *= self.SCALE\n", + " #values, hard-coded for now, in meters\n", + " width = 0.5 * self.SCALE\n", + " height = 0.25 * self.SCALE\n", + " wheel_radius = 0.1 * self.SCALE\n", + "\n", + " car_body = pg.Rect(self.translate(pos_x - width/2, height/2), (width, height))\n", + " pg.draw.rect(self.screen, car_color, car_body)\n", + " pg.draw.circle(self.screen, wheel_color, \n", + " self.translate(pos_x - width/2 + wheel_radius, -height/2), wheel_radius)\n", + " pg.draw.circle(self.screen, wheel_color, \n", + " self.translate(pos_x + width/2 - wheel_radius, -height/2), wheel_radius)\n", + "\n", + " #Draws the pole\n", + " def draw_pole(self, pos_x: float, theta: float, length: float, width: float = 0.1, color = \"red\") -> None:\n", + " pos_x *= self.SCALE\n", + " width = int(width * self.SCALE)\n", + " pole_end_x = length * np.sin(theta) * self.SCALE + pos_x\n", + " pole_end_y = length * np.cos(theta) * self.SCALE\n", + " pg.draw.line(self.screen, color, self.translate(pos_x, 0), self.translate(pole_end_x, pole_end_y), width)\n", + "\n", + " #Clears the entire canvas\n", + " def draw_clear(self) -> None:\n", + " self.screen.fill(\"white\")\n", + "\n", + " #Draws physical values\n", + " def draw_stats(self, theta: float, w: float, v: float, x: float, \n", + " episode: int, \n", + " spikes_left : int, spikes_right : int, \n", + " dopamine_left : float, dopamine_right : float, \n", + " action: int) -> None:\n", + " font = pg.font.Font(None, 24)\n", + " #Physics stats, drawn left\n", + " text = \"angle: \" + str(theta)[:4] + \\\n", + " \"\\nangular velocity: \" + str(w)[:4] + \\\n", + " \"\\nposition: \" + str(x)[:4] + \\\n", + " \"\\nvelocity\" + str(v)[:4] + \\\n", + " \" \\nepisode: \" + str(episode)\n", + " lines = text.split('\\n')\n", + " y_pos = 10\n", + " for line in lines:\n", + " text_surface = font.render(line, True, (0,0,0))\n", + " self.screen.blit(text_surface, (10, y_pos))\n", + " y_pos += 30\n", + "\n", + " #Network stats, drawn right\n", + " text = \"Spikes left: \" + str(spikes_left) + \\\n", + " \"\\nDopamine left: \" + str(dopamine_left)[:4] + \\\n", + " \"\\nSpikes right: \" + str(spikes_right)[:4] + \\\n", + " \"\\nDopamine right: \" + str(dopamine_right) + \\\n", + " \"\\nTaken action: \" + (\"Left\" if action==0 else \"Right\" if action==1 else \"Failure\")\n", + " lines = text.split('\\n')\n", + " y_pos = 10\n", + " for line in lines:\n", + " text_surface = font.render(line, True, (0,0,0))\n", + " self.screen.blit(text_surface, (self.width - 200, y_pos))\n", + " y_pos += 30\n", + "\n", + " def get_relative_mouse_x(self, mouse_x:float) -> float:\n", + " return (mouse_x-self.origin[0])/self.SCALE\n", + " \n", + " def display(self) -> None:\n", + " pg.display.flip()" + ] + }, + { + "cell_type": "markdown", + "id": "d6362d90", + "metadata": {}, + "source": [ + "## Physics Updates" + ] + }, + { + "cell_type": "markdown", + "id": "74907eaf", + "metadata": {}, + "source": [ + "For the physics, we use the corrected version of of the original problem derived from V. Florian (CITATION NEEDED), but omit the friction forces.\n", + "The situation is sketched here: \n", + "\n", + "![alt text](cartpole_illustration.png \"Cartpole\")" + ] + }, + { + "cell_type": "markdown", + "id": "ed9c94e0", + "metadata": {}, + "source": [ + "We apply Newton's second law of motion to the cart: \n", + "$$\n", + "\\begin{aligned}\n", + " \\mathbf{F} + \\mathbf{G}_c - \\mathbf{N} = m_c \\cdot \\mathbf{a}_c\n", + "\\end{aligned}\n", + "$$\n", + "Where: \n", + "\n", + "$\\mathbf{F} = F \\cdot \\mathbf{u_x}$ is the control force acting on the cart, \n", + "$\\mathbf{G}_c = m_c \\cdot g \\cdot \\mathbf{u}_y$ is the gravitational component acting on the cart, \n", + "$\\mathbf{N} = N_x \\cdot \\mathbf{u}_x - N_y \\cdot \\mathbf{u}_y$ is the negative reaction force that the pole is applying on the cart, \n", + "$\\mathbf{a}_c = \\ddot{x} \\cdot \\mathbf{u}_x$ is the accelaration of the cart, \n", + "$m_c$ is the cart's mass and \n", + "$\\mathbf{u}_x$, $\\mathbf{u}_y$, $\\mathbf{u}_z$ are the unit vectors of the frame of reference given in the illustration." + ] + }, + { + "cell_type": "markdown", + "id": "cde2e429", + "metadata": {}, + "source": [ + "We can decompose this equation now into the $x$ and $y$ component:\n", + "$$\n", + "\\begin{aligned}\n", + " F - N_x = m_c \\cdot \\ddot{x}\n", + "\\end{aligned}\n", + "$$\n", + "$$\n", + "\\begin{aligned}\n", + " m_c \\cdot g + N_y = 0\n", + "\\end{aligned}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "id": "d62acf48", + "metadata": {}, + "source": [ + "Newton's second law of motion applied to the pole gives us:\n", + "$$\n", + "\\begin{aligned}\n", + " \\mathbf{N} + \\mathbf{G}_p = m_p \\cdot \\mathbf{a}_p\n", + "\\end{aligned}\n", + "$$\n", + "\n", + "Where $\\mathbf{G}_p = m_p \\cdot g \\cdot \\mathbf{u}_y$." + ] + }, + { + "cell_type": "markdown", + "id": "38770100", + "metadata": {}, + "source": [ + "The accelaration $\\mathbf{a}_p$ of the pole's center of mass consists of three components, where $\\mathbf{r}_p = l \\cdot (\\sin{\\theta}\\cdot \\mathbf{u}_x-\\cos{\\theta}\\cdot \\mathbf{u}_y)$ denotes the vector pointing to the pole's center of mass relative to it's rotation center: \n", + "1. The accelaration of the cart it is attached to $\\mathbf{a}_c$,\n", + "2. The pole's angular accelaration $\\mathbf{\\epsilon} = \\ddot{\\theta} \\cdot \\mathbf{u}_z$, which is translated into accelaration by $\\mathbf{\\epsilon} \\times \\mathbf{r}_p$.\n", + "3. The pole's angular velocity $\\mathbf{\\omega} = \\dot{\\theta} \\cdot \\mathbf{u}_z$, for which the accelaration can be derived by $\\mathbf{\\omega} \\times (\\mathbf{\\omega} \\times \\mathbf{r}_p)$.\n", + "\n", + "Thus we obtain:\n", + "$$\n", + "\\begin{aligned}\n", + " \\mathbf{a}_p = \\mathbf{a}_c + \\mathbf{\\epsilon} \\times \\mathbf{r}_p + \\mathbf{\\omega} \\times (\\mathbf{\\omega} \\times \\mathbf{r}_p)\n", + "\\end{aligned}\n", + "$$\n", + "Substituting $\\mathbf{r}_p = l \\cdot (\\sin{\\theta}\\cdot \\mathbf{u}_x-\\cos{\\theta}\\cdot \\mathbf{u}_y)$ and $\\mathbf{a}_p = \\ddot{x} \\cdot \\mathbf{u}_x$ as well as $\\mathbf{u}_z \\times \\mathbf{u}_x = \\mathbf{u}_y$ and $\\mathbf{u}_z \\times \\mathbf{u}_y = -\\mathbf{u}_x$:\n", + "\\begin{aligned}\n", + " \\mathbf{a}_p = \\ddot{x} \\cdot \\mathbf{u}_x + l \\cdot \\ddot{\\theta} \\cdot (\\sin{\\theta}\\cdot \\mathbf{u}_y + \\cos{\\theta}\\cdot \\mathbf{u}_x) - l \\cdot \\dot{\\theta}^2 \\cdot (\\sin{\\theta}\\cdot \\mathbf{u}_x - \\cos{\\theta}\\cdot \\mathbf{u}_y)\n", + "\\end{aligned}" + ] + }, + { + "cell_type": "markdown", + "id": "895254eb", + "metadata": {}, + "source": [ + "Inserting this quation into our equation for the forces of the pole and decomposing on the $x$ and $y$ axis we obtain:\n", + "$$\n", + "\\begin{aligned}\n", + " N_x = m_p \\cdot (\\ddot{x} + l \\cdot \\ddot{\\theta} \\cdot \\cos{\\theta} - l \\cdot \\dot{\\theta}^2 \\cdot \\sin{\\theta})\n", + "\\end{aligned}\n", + "$$\n", + "$$\n", + "\\begin{aligned}\n", + " m_p \\cdot g - N_y = m_p \\cdot (l \\cdot \\ddot{\\theta} \\cdot \\sin{\\theta} + l \\cdot \\dot{\\theta}^2 \\cdot \\cos{\\theta})\n", + "\\end{aligned}\n", + "$$" + ] + }, + { + "cell_type": "markdown", + "id": "376c6dd1", + "metadata": {}, + "source": [ + "# TODO: FINISH EQUATION DERIVATION (SOLVE EQUATION REFERENCING?)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "6b5f4227", + "metadata": {}, + "outputs": [], + "source": [ + "class Physics():\n", + " \n", + " def __init__(self, x, theta, v = 0, a = 0, w = 0, dw = 0, g = 9.81, m_c = 1, m_p = 0.1, l = 0.5, dt = 0.02) -> None:\n", + " self.__dict__.update(vars())\n", + "\n", + " def dw_step(self, cart_force, nudge_force) -> float:\n", + " numerator = self.g * np.sin(self.theta) + np.cos(self.theta) * (-cart_force - self.m_p * self.l * self.w**2 * np.sin(self.theta))/(self.m_c+self.m_p) + nudge_force * np.cos(self.theta)/(self.m_p*self.l)\n", + " denominator = self.l * (4/3 - (self.m_p*np.cos(self.theta)**2)/(self.m_c+self.m_p))\n", + "\n", + " self.dw = numerator/denominator\n", + " self.w += self.dt * self.dw\n", + " self.theta += self.dt * self.w\n", + "\n", + " return self.theta\n", + " \n", + " def a_step(self, force) -> float:\n", + " numerator = force + self.m_p * self.l * (self.w**2 * np.sin(self.theta) - self.dw * np.cos(self.theta))\n", + " denominator = self.m_c + self.m_p\n", + "\n", + " self.a = numerator/denominator\n", + " self.v += self.dt * self.a\n", + " self.x += self.dt * self.v\n", + "\n", + " return self.x\n", + "\n", + " def update(self, force, mouse_x) -> Tuple[float, float]:\n", + " nudge_force = 0\n", + " if mouse_x is not None:\n", + " nudge_force = -1 if mouse_x > self.x else 1\n", + " return (self.dw_step(force, nudge_force), self.a_step(force))\n", + " \n", + " #get state of the system that agent can see\n", + " def get_state(self) -> Tuple[float,float,float,float]:\n", + " return (self.x, self.theta, self.v, self.w)\n", + " \n", + " def reset(self) -> None:\n", + " self.x = 0\n", + " self.theta = (np.random.rand() - 1) / 10\n", + " self.v = 0\n", + " self.a = 0\n", + " self.w = 0\n", + " self.dw = 0\n" + ] + }, + { + "cell_type": "markdown", + "id": "76793d12", + "metadata": {}, + "source": [ + "# The Agent (BOXES)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "5707ac4a", + "metadata": {}, + "outputs": [], + "source": [ + "\n", + "class Agent:\n", + " def __init__(self, initial_state: Tuple[float,float,float,float]) -> None:\n", + "\n", + " #thresholds for discretizing the state space\n", + " \n", + " # ORIGINAL BOXES THAT WE USED SUCCESSFULLY ON THE NON SPIKING AGENT\n", + "# self.x_thresholds = np.array([-2.4, -0.8, 0.8, 2.4])\n", + "# self.theta_thresholds = np.array([-12, -6, -1, 0, 1, 6, 12])\n", + "# self.theta_thresholds = self.theta_thresholds /180 * np.pi\n", + "# self.v_thresholds = np.array([float(\"-inf\"), -0.5, 0.5, float(\"+inf\")]) #open intervals ignored here\n", + "# self.w_thresholds = np.array([float(\"-inf\"), -50, 50, float(\"+inf\")]) #open intervals ignored here\n", + "# self.w_thresholds = self.w_thresholds / 180 * np.pi\n", + "\n", + " # BOXES FROM LIU&PAN CODE\n", + " self.x_thresholds = np.array([-2.4, 2.4])\n", + " self.v_thresholds = np.array([float(\"-inf\"), float(\"+inf\")])\n", + " \n", + " self.theta_thresholds = np.array([-12, -5.738738738738739, -2.8758758758758756, 0., 2.8758758758758756, 5.738738738738739, 12])\n", + " self.theta_thresholds = self.theta_thresholds / 180 * np.pi\n", + " \n", + " self.w_thresholds = np.array([float(\"-inf\"), -103., -91.7, -80.2, -68.8, -57.3, -45.9, -34.3, -22.9, -11.5, 0.,\n", + " 11.5, 22.9, 34.3, 45.9, 57.3, 68.8, 80.2, 91.7, 103., float(\"+inf\")]) #open intervals ignored here\n", + " self.w_thresholds = self.w_thresholds / 180 * np.pi\n", + " \n", + " self.dimensions = (len(self.x_thresholds) - 1, len(self.theta_thresholds) - 1, len(self.v_thresholds) - 1, len(self.w_thresholds) - 1)\n", + "\n", + " print(\"Dimension of input space: \" + str(self.dimensions))\n", + " \n", + " self.boxes = np.random.rand(self.dimensions[0], \n", + " self.dimensions[1], \n", + " self.dimensions[2], \n", + " self.dimensions[3], \n", + " 2) #one q-value for left and right respectively\n", + " box = self.get_box(initial_state)\n", + " self.current_box = self.boxes[box[0], box[1], box[2], box[3], :]\n", + "\n", + " self.episode = 1\n", + " \n", + " def discretize(self, value, thresholds):\n", + " for i, limit in enumerate(thresholds):\n", + " if value < limit:\n", + " return i - 1\n", + " return -1\n", + "\n", + " def get_box(self, state: Tuple[float,float,float,float]) -> Tuple[int,int,int,int]:\n", + " return (self.discretize(state[0], self.x_thresholds),\n", + " self.discretize(state[1], self.theta_thresholds),\n", + " self.discretize(state[2], self.v_thresholds), \n", + " self.discretize(state[3], self.w_thresholds))\n", + " \n", + " def get_episode(self) -> int:\n", + " return self.episode\n", + " \n", + " \n", + " def failure_reset(self, state: Tuple[float,float,float,float]):\n", + " box = self.get_box(state)\n", + " self.current_box = self.boxes[box[0], box[1], box[2], box[3], :]\n", + " self.episode += 1\n", + "\n", + "\n", + "class NonSpikingAgent(Agent):\n", + " def __init__(self, initial_state: Tuple[float,float,float,float], learning_rate, learning_decay, epsilon, epsilon_decay, discount_factor) -> None:\n", + " super().__init__(initial_state)\n", + "\n", + " #learning paramters\n", + " self.learning_rate = learning_rate\n", + " self. learning_decay = learning_decay\n", + " self.epsilon = epsilon\n", + " self.epsilon_decay = epsilon_decay\n", + " self.discount_factor = discount_factor\n", + "\n", + " #returns 0 if the action is \"left\", else \"1\"\n", + " def choose_action(self) -> int:\n", + " self.action = np.random.choice([np.argmax(self.current_box), np.argmin(self.current_box)], p=[1-self.epsilon, self.epsilon])\n", + " return self.action\n", + " \n", + " #returns 0 if no failure occured, else 1\n", + " #reward is -1 on failure and 0 else\n", + " def update(self, next_state: Tuple[float,float,float,float]) -> int:\n", + " box = self.get_box(next_state)\n", + " if -1 in box:\n", + " self.current_box[self.action] += self.learning_rate * -1\n", + " return 1\n", + " \n", + " next_box = self.boxes[box[0], box[1], box[2], box[3], :]\n", + " next_q = np.max(next_box)\n", + " self.current_box[self.action] += self.learning_rate * (self.discount_factor * (next_q - self.current_box[self.action]))\n", + "\n", + " self.current_box = next_box\n", + " self.epsilon *= self.epsilon_decay\n", + " self.learning_rate *= self.learning_decay\n", + "\n", + " return 0\n", + " " + ] + }, + { + "cell_type": "markdown", + "id": "ba2e6cd3", + "metadata": {}, + "source": [ + "# Plot Renderer" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "3f9b07a1", + "metadata": {}, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + "%matplotlib qt\n", + "class Non_Spiking_PlotRenderer():\n", + " def __init__(self, init_x = [0], init_y = [0]) -> None:\n", + " plt.ion()\n", + " #Construct lifetime plot\n", + " self.lifetime_fig, self.lifetime_ax = plt.subplots()\n", + " self.x = init_x\n", + " self.y = init_y\n", + " self.max_lifetime = 0\n", + " self.line, = self.lifetime_ax.plot(self.x, self.y)\n", + " self.lifetime_ax.set_xlabel(\"Episode\")\n", + " self.lifetime_ax.set_ylabel(\"Simulation Steps\")\n", + " self.lifetime_ax.set_title(\"Lifetime Plot\")\n", + "\n", + " #Construct Heatmap for two parameters\n", + " self.q_value_fig, self.q_value_ax = plt.subplots()\n", + " self.q_value_ax.set_title(\"Q-Values for a state of (param1/param2)\")\n", + " self.cmap = plt.cm.coolwarm\n", + " \n", + " def update(self, x, y, boxes) -> None:\n", + " print(x)\n", + " self.x.append(x)\n", + " self.y.append(y)\n", + " self.max_lifetime = max(self.max_lifetime, y)\n", + " self.line.set_data(self.x, self.y)\n", + " self.lifetime_ax.set_xlim(self.x[0], self.x[-1])\n", + " self.lifetime_ax.set_ylim(0, self.max_lifetime)\n", + "\n", + " if(x % 10 == 0):\n", + " q_values = boxes[:,:,:,:,0] - boxes[:,:,:,:,1]\n", + " self.q_value_ax.imshow(np.mean(q_values, axis = (1,3)), cmap=self.cmap, interpolation='none')\n", + "\n", + " plt.draw()\n", + " plt.pause(0.0001)\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "id": "2cd7786b", + "metadata": {}, + "source": [ + "# Executing Non-Spiking-Agent" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "717eda26-e385-494f-bdca-9847eefe01ca", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Dimension of input space: (1, 6, 1, 20)\n", + "2\n", + "3\n", + "4\n", + "5\n", + "6\n", + "7\n", + "8\n", + "9\n", + "10\n", + "11\n", + "12\n", + "13\n", + "14\n", + "15\n", + "16\n", + "17\n", + "18\n", + "19\n", + "20\n", + "21\n", + "22\n", + "23\n", + "24\n", + "25\n", + "26\n", + "27\n", + "28\n", + "29\n", + "30\n", + "31\n", + "32\n", + "33\n", + "34\n", + "35\n", + "36\n", + "37\n", + "38\n", + "39\n", + "40\n", + "41\n", + "42\n", + "43\n", + "44\n", + "45\n", + "46\n", + "47\n", + "48\n", + "49\n", + "50\n", + "51\n", + "52\n", + "53\n", + "54\n", + "55\n", + "56\n", + "57\n", + "58\n", + "59\n", + "60\n", + "61\n", + "62\n", + "63\n", + "64\n", + "65\n", + "66\n", + "67\n", + "68\n", + "69\n", + "70\n", + "71\n", + "72\n", + "73\n", + "74\n", + "75\n", + "76\n", + "77\n", + "78\n", + "79\n", + "80\n", + "81\n", + "82\n", + "83\n", + "84\n", + "85\n", + "86\n", + "87\n", + "88\n", + "89\n", + "90\n", + "91\n", + "92\n", + "93\n", + "94\n", + "95\n", + "96\n", + "97\n", + "98\n", + "99\n", + "100\n", + "101\n", + "102\n", + "103\n", + "104\n", + "105\n", + "106\n", + "107\n", + "108\n", + "109\n", + "110\n", + "111\n", + "112\n", + "113\n", + "114\n", + "115\n", + "116\n", + "117\n", + "118\n", + "119\n", + "120\n", + "121\n", + "122\n", + "123\n", + "124\n", + "125\n", + "126\n", + "127\n", + "128\n", + "129\n", + "130\n", + "131\n", + "132\n", + "133\n", + "134\n", + "135\n", + "136\n", + "137\n", + "138\n", + "139\n", + "140\n", + "141\n", + "142\n", + "143\n", + "144\n", + "145\n", + "146\n", + "147\n", + "148\n", + "149\n", + "150\n", + "151\n", + "152\n", + "153\n", + "154\n", + "155\n", + "156\n", + "157\n", + "158\n", + "159\n", + "160\n", + "161\n", + "162\n", + "163\n", + "164\n", + "165\n", + "166\n", + "167\n", + "168\n", + "169\n", + "170\n", + "171\n", + "172\n", + "173\n", + "174\n", + "175\n", + "176\n", + "177\n", + "178\n", + "179\n", + "180\n", + "181\n", + "182\n", + "183\n", + "184\n", + "185\n", + "186\n", + "187\n", + "188\n", + "189\n", + "190\n", + "191\n", + "192\n", + "193\n", + "194\n", + "195\n", + "196\n", + "197\n", + "198\n", + "199\n", + "200\n", + "201\n", + "202\n", + "203\n", + "204\n", + "205\n", + "206\n", + "207\n", + "208\n", + "209\n", + "210\n", + "211\n", + "212\n", + "213\n", + "214\n", + "215\n", + "216\n", + "217\n", + "218\n", + "219\n", + "220\n", + "221\n", + "222\n", + "223\n", + "224\n", + "225\n", + "226\n", + "227\n", + "228\n", + "229\n", + "230\n", + "231\n", + "232\n", + "233\n", + "234\n", + "235\n", + "236\n", + "237\n", + "238\n", + "239\n", + "240\n", + "241\n", + "242\n", + "243\n", + "244\n", + "245\n", + "246\n", + "247\n", + "248\n", + "249\n", + "250\n", + "251\n", + "252\n", + "253\n", + "254\n", + "255\n", + "256\n", + "257\n", + "258\n", + "259\n", + "260\n", + "261\n", + "262\n", + "263\n", + "264\n", + "265\n", + "266\n", + "267\n", + "268\n", + "269\n", + "270\n", + "271\n", + "272\n", + "273\n", + "274\n", + "275\n", + "276\n", + "277\n", + "278\n", + "279\n", + "280\n", + "281\n", + "282\n", + "283\n", + "284\n", + "285\n", + "286\n", + "287\n", + "288\n", + "289\n", + "290\n", + "291\n", + "292\n", + "293\n", + "294\n", + "295\n", + "296\n", + "297\n", + "298\n", + "299\n", + "300\n", + "301\n", + "302\n", + "303\n", + "304\n", + "305\n", + "306\n", + "307\n", + "308\n", + "309\n", + "310\n", + "311\n", + "312\n", + "313\n", + "314\n", + "315\n", + "316\n", + "317\n", + "318\n", + "319\n", + "320\n", + "321\n", + "322\n", + "323\n", + "324\n", + "325\n", + "326\n", + "327\n", + "328\n", + "329\n", + "330\n", + "331\n", + "332\n", + "333\n", + "334\n", + "335\n", + "336\n", + "337\n", + "338\n", + "339\n", + "340\n", + "341\n", + "342\n", + "343\n", + "344\n", + "345\n", + "346\n", + "347\n", + "348\n", + "349\n", + "350\n", + "351\n", + "352\n", + "353\n", + "354\n", + "355\n", + "356\n", + "357\n", + "358\n", + "359\n", + "360\n", + "361\n", + "362\n", + "363\n", + "364\n", + "365\n", + "366\n", + "367\n", + "368\n", + "369\n", + "370\n", + "371\n", + "372\n", + "373\n", + "374\n", + "375\n", + "376\n", + "377\n", + "378\n", + "379\n", + "380\n", + "381\n", + "382\n", + "383\n", + "384\n", + "385\n", + "386\n", + "387\n", + "388\n", + "389\n", + "390\n", + "391\n", + "392\n", + "393\n", + "394\n", + "395\n", + "396\n", + "397\n", + "398\n", + "399\n", + "400\n", + "401\n", + "402\n", + "403\n", + "404\n", + "405\n", + "406\n", + "407\n", + "408\n", + "409\n", + "410\n", + "411\n", + "412\n", + "413\n", + "414\n", + "415\n", + "416\n", + "417\n", + "418\n", + "419\n", + "420\n", + "421\n", + "422\n", + "423\n", + "424\n", + "425\n", + "426\n", + "427\n", + "428\n", + "429\n", + "430\n", + "431\n", + "432\n", + "433\n", + "434\n", + "435\n", + "436\n", + "437\n", + "438\n", + "439\n", + "440\n", + "441\n", + "442\n", + "443\n", + "444\n", + "445\n", + "446\n", + "447\n", + "448\n", + "449\n", + "450\n", + "451\n", + "452\n", + "453\n", + "454\n", + "455\n", + "456\n", + "457\n", + "458\n", + "459\n", + "460\n", + "461\n", + "462\n", + "463\n", + "464\n", + "465\n", + "466\n", + "467\n", + "468\n", + "469\n", + "470\n", + "471\n", + "472\n", + "473\n", + "474\n", + "475\n", + "476\n", + "477\n", + "478\n", + "479\n", + "480\n" + ] + }, + { + "ename": "SystemExit", + "evalue": "", + "output_type": "error", + "traceback": [ + "An exception has occurred, use %tb to see the full traceback.\n", + "\u001b[0;31mSystemExit\u001b[0m\n" + ] + } + ], + "source": [ + "\n", + "\n", + "# import sys\n", + "\n", + "# r = Renderer(1200, 800, 600, 500, 400)\n", + "# clock = pg.time.Clock()\n", + "# running = True\n", + "\n", + "# p = Physics(0, (np.random.rand() - 1) / 10)\n", + "\n", + "# a = NonSpikingAgent(p.get_state(), 0.5, 0.9999999999999, 1, 0.995, 0.99)\n", + "\n", + "# plot = Non_Spiking_PlotRenderer()\n", + "\n", + "# steps_per_episode = 0\n", + "# max_steps = 0\n", + "\n", + "# window_size = 30\n", + "# window = np.zeros(30)\n", + "# avg_lifetime = 20000\n", + "\n", + "# toggle_sim = False\n", + "\n", + "# while running:\n", + "# steps_per_episode += 1\n", + "\n", + "# force = 0\n", + "# mouse_x = None\n", + "\n", + "# # poll for events\n", + "# for event in pg.event.get():\n", + "# if event.type == pg.QUIT:\n", + "# running = False\n", + "# pg.quit()\n", + "# sys.exit()\n", + "# quit()\n", + "# elif event.type == pg.MOUSEBUTTONDOWN:\n", + "# mouse_x = r.get_relative_mouse_x(pg.mouse.get_pos()[0])\n", + "# elif event.type == pg.KEYDOWN:\n", + "# toggle_sim ^= pg.key.get_pressed()[pg.K_SPACE]\n", + "\n", + "# # agent chooses action, simulation is updated and reward is calculated\n", + "# force = 10 if a.choose_action() else -10\n", + "# theta, x = p.update(force, mouse_x)\n", + "# failure = a.update(p.get_state())\n", + "\n", + "# if failure:\n", + "# p.reset()\n", + "# a.failure_reset(p.get_state())\n", + "# plot.update(a.get_episode(), steps_per_episode, a.boxes)\n", + "# window = np.roll(window, 1)\n", + "# window[0] = steps_per_episode\n", + "# steps_per_episode = 0\n", + " \n", + " \n", + "# if np.mean(window) >= avg_lifetime or toggle_sim:\n", + "# r.draw_clear()\n", + "# r.draw_ground(0.2, \"grey\")\n", + "# r.draw_car(x)\n", + "# r.draw_pole(x, theta, 2*p.l, 0.02)\n", + "# #r.draw_stats(theta*180/np.pi, p.w*180/np.pi, x, p.a, a.get_episode())\n", + "# r.display()\n", + "\n", + "# clock.tick(50) # limits FPS to 50\n" + ] + }, + { + "cell_type": "markdown", + "id": "b2876351", + "metadata": {}, + "source": [ + "# TODO: clean up code, derive equations and explain renderer briefly" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "83e05060", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "id": "43c70dff", + "metadata": {}, + "source": [ + "# Spiking version" + ] + }, + { + "cell_type": "markdown", + "id": "d4705cf6", + "metadata": {}, + "source": [ + "## Idea" + ] + }, + { + "cell_type": "markdown", + "id": "6df6e192", + "metadata": {}, + "source": [ + "The core principle of our SNN is to simulate the physics and neuron model in sequence, where the state at the end of a physics step is the input for the SNN and the resulting action at the end of a period of SNN simulation is the input to the next physics simulation. Both cycles are set to 40ms to provide the effect that they run simultaneously.\n", + "The model's structure consists of two layers of neurons. For each discrete state of the system, the input layer contains a single neuron corresponding to it. Neuromodulated synapses connect these to the output layer, which itself consists of two neuron groups interpreted as actions \"move left\" and \"move right\" respectively.\n", + "\n", + "One simulation step of the SNN works as follows:\n", + "1. Get the current state of the cart pole and find the designated neuron that only fires when that state is reached.\n", + "2. Set a continuous firing rate for the simulation period on that neuron.\n", + "3. Determine which of the neuron groups in the output layer has fired more spikes at the end of the step." + ] + }, + { + "cell_type": "markdown", + "id": "5831c9d7", + "metadata": {}, + "source": [ + "# SNN Visualization" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e9bdcc5a", + "metadata": {}, + "outputs": [], + "source": [ + "class Spiking_PlotRenderer():\n", + " def __init__(self) -> None:\n", + " plt.ion()\n", + " self.fig, self.ax = plt.subplots(nrows=2, figsize=(12, 4))\n", + " \n", + " self.spike_line, = self.ax[0].plot([], [], '.k', markersize=5)\n", + " self.vm_right_line, = self.ax[1].plot([], [], 'r')\n", + " self.vm_left_line, = self.ax[1].plot([], [], 'b')\n", + "\n", + " self.ax[0].set_xlabel(\"Time [ms]\")\n", + " self.ax[0].set_ylabel(\"Input Neuron\")\n", + " self.ax[0].set_ylim(0, 160)\n", + " \n", + " self.ax[1].set_ylabel(\"V_m [mV]\")\n", + " self.ax[1].set_xlabel(\"Time [ms]\")\n", + " self.ax[1].set_ylim(-75, -50)\n", + "\n", + " self.fig.show()\n", + " \n", + " def update(self, data) -> None:\n", + " if data is None:\n", + " return\n", + "\n", + " input_spikes_times = data[\"input_spikes\"][\"times\"]\n", + " input_spikes_senders = data[\"input_spikes\"][\"senders\"]\n", + " right_vm_times = data[\"multimeter_right_events\"][\"times\"]\n", + " right_vm = data[\"multimeter_right_events\"][\"V_m\"]\n", + " left_vm_times = data[\"multimeter_left_events\"][\"times\"]\n", + " left_vm = data[\"multimeter_left_events\"][\"V_m\"]\n", + "\n", + " # Update spike plot\n", + " self.spike_line.set_data(input_spikes_times, input_spikes_senders)\n", + " self.ax[0].set_xlim(np.min(input_spikes_times), np.max(input_spikes_times))\n", + "\n", + " # Update membrane potential plot\n", + " self.vm_right_line.set_data(right_vm_times, right_vm)\n", + " self.vm_left_line.set_data(left_vm_times, left_vm)\n", + " self.ax[1].set_xlim(np.min(right_vm_times), np.max(right_vm_times))\n", + "\n", + " self.fig.canvas.draw()\n", + " self.fig.canvas.flush_events()\n", + "\n", + " self.fig.savefig(\"/tmp/cartpole.png\", dpi=300)\n", + "\n", + " plt.pause(0.0001)\n" + ] + }, + { + "cell_type": "markdown", + "id": "f3519392", + "metadata": {}, + "source": [ + "## Neuron Models" + ] + }, + { + "cell_type": "markdown", + "id": "8dc47382", + "metadata": {}, + "source": [ + "### Ignore and Fire Neuron" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "8e16ea83", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "WARNING:root:PyGSL is not available. The stiffness test will be skipped.\n", + "WARNING:root:Error when importing: No module named 'pygsl'\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " -- N E S T --\n", + " Copyright (C) 2004 The NEST Initiative\n", + "\n", + " Version: 3.8.0\n", + " Built: Aug 27 2024 04:38:39\n", + "\n", + " This program is provided AS IS and comes with\n", + " NO WARRANTY. See the file LICENSE for details.\n", + "\n", + " Problems or suggestions?\n", + " Visit https://www.nest-simulator.org\n", + "\n", + " Type 'nest.help()' to find out more about NEST.\n", + "\n", + "\n", + " -- N E S T --\n", + " Copyright (C) 2004 The NEST Initiative\n", + "\n", + " Version: 3.8.0\n", + " Built: Aug 27 2024 04:38:39\n", + "\n", + " This program is provided AS IS and comes with\n", + " NO WARRANTY. See the file LICENSE for details.\n", + "\n", + " Problems or suggestions?\n", + " Visit https://www.nest-simulator.org\n", + "\n", + " Type 'nest.help()' to find out more about NEST.\n", + "\n", + "[15,ignore_and_fire_neuron_nestml, WARNING, [35:34;35:58]]: Model contains a call to fixed-timestep functions (``resolution()`` and/or ``steps()``). This restricts the model to being compatible only with fixed-timestep simulators. Consider eliminating ``resolution()`` and ``steps()`` from the model, and using ``timestep()`` instead.\n", + "\u001b[33mCMake Warning (dev) at CMakeLists.txt:93 (project):\n", + " cmake_minimum_required() should be called prior to this top-level project()\n", + " call. Please see the cmake-commands(7) manual for usage documentation of\n", + " both commands.\n", + "This warning is for project developers. Use -Wno-dev to suppress it.\n", + "\u001b[0m\n", + "-- The CXX compiler identification is Clang 18.1.8\n", + "-- Detecting CXX compiler ABI info\n", + "-- Detecting CXX compiler ABI info - done\n", + "-- Check for working CXX compiler: /opt/homebrew/anaconda3/envs/cart_pole/bin/arm64-apple-darwin20.0.0-clang++ - skipped\n", + "-- Detecting CXX compile features\n", + "-- Detecting CXX compile features - done\n", + "\u001b[0m\u001b[0m\n", + "\u001b[0m-------------------------------------------------------\u001b[0m\n", + "\u001b[0mnestml_dacbcdc51e4a444f8d6a2af1e0c8e1ce_module Configuration Summary\u001b[0m\n", + "\u001b[0m-------------------------------------------------------\u001b[0m\n", + "\u001b[0m\u001b[0m\n", + "\u001b[0mC++ compiler : /opt/homebrew/anaconda3/envs/cart_pole/bin/arm64-apple-darwin20.0.0-clang++\u001b[0m\n", + "\u001b[0mBuild static libs : OFF\u001b[0m\n", + "\u001b[0mC++ compiler flags : -ftree-vectorize -fPIC -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -isystem /opt/homebrew/anaconda3/envs/cart_pole/include\u001b[0m\n", + "\u001b[0mNEST compiler flags : -ftree-vectorize -fPIC -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -isystem /opt/homebrew/anaconda3/envs/cart_pole/include -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/nest-simulator_1724732993440/work=/usr/local/src/conda/nest-simulator-3.8 -fdebug-prefix-map=/opt/homebrew/anaconda3/envs/cart_pole=/usr/local/src/conda-prefix -std=c++17 -Wall -Xclang -fopenmp -O2\u001b[0m\n", + "\u001b[0mNEST include dirs : -I/opt/homebrew/anaconda3/envs/cart_pole/include/nest -I/opt/homebrew/anaconda3/envs/cart_pole/include -I/opt/homebrew/anaconda3/envs/cart_pole/include -I/opt/homebrew/anaconda3/envs/cart_pole/include -I/opt/homebrew/anaconda3/envs/cart_pole/include\u001b[0m\n", + "\u001b[0mNEST libraries flags : -L/opt/homebrew/anaconda3/envs/cart_pole/lib/nest -lnest -lsli /opt/homebrew/anaconda3/envs/cart_pole/lib/libltdl.dylib /opt/homebrew/anaconda3/envs/cart_pole/lib/libreadline.dylib /opt/homebrew/anaconda3/envs/cart_pole/lib/libncurses.dylib /opt/homebrew/anaconda3/envs/cart_pole/lib/libgsl.dylib /opt/homebrew/anaconda3/envs/cart_pole/lib/libgslcblas.dylib /opt/homebrew/anaconda3/envs/cart_pole/lib/libomp.dylib\u001b[0m\n", + "\u001b[0m\u001b[0m\n", + "\u001b[0m-------------------------------------------------------\u001b[0m\n", + "\u001b[0m\u001b[0m\n", + "\u001b[0mYou can now build and install 'nestml_dacbcdc51e4a444f8d6a2af1e0c8e1ce_module' using\u001b[0m\n", + "\u001b[0m make\u001b[0m\n", + "\u001b[0m make install\u001b[0m\n", + "\u001b[0m\u001b[0m\n", + "\u001b[0mThe library file libnestml_dacbcdc51e4a444f8d6a2af1e0c8e1ce_module.so will be installed to\u001b[0m\n", + "\u001b[0m /var/folders/3h/2lc1zrkd375b1l0m8zcfj6440000gn/T/nestml_target_d3zy41yz\u001b[0m\n", + "\u001b[0mThe module can be loaded into NEST using\u001b[0m\n", + "\u001b[0m (nestml_dacbcdc51e4a444f8d6a2af1e0c8e1ce_module) Install (in SLI)\u001b[0m\n", + "\u001b[0m nest.Install(nestml_dacbcdc51e4a444f8d6a2af1e0c8e1ce_module) (in PyNEST)\u001b[0m\n", + "\u001b[0m\u001b[0m\n", + "\u001b[33mCMake Warning (dev) in CMakeLists.txt:\n", + " No cmake_minimum_required command is present. A line of code such as\n", + "\n", + " cmake_minimum_required(VERSION 3.31)\n", + "\n", + " should be added at the top of the file. The version specified may be lower\n", + " if you wish to support older CMake versions for this project. For more\n", + " information run \"cmake --help-policy CMP0000\".\n", + "This warning is for project developers. Use -Wno-dev to suppress it.\n", + "\u001b[0m\n", + "-- Configuring done (0.4s)\n", + "-- Generating done (0.0s)\n", + "-- Build files have been written to: /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target\n", + "[ 33%] \u001b[32mBuilding CXX object CMakeFiles/nestml_dacbcdc51e4a444f8d6a2af1e0c8e1ce_module_module.dir/nestml_dacbcdc51e4a444f8d6a2af1e0c8e1ce_module.o\u001b[0m\n", + "[ 66%] \u001b[32mBuilding CXX object CMakeFiles/nestml_dacbcdc51e4a444f8d6a2af1e0c8e1ce_module_module.dir/ignore_and_fire_neuron_nestml.o\u001b[0m\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/ignore_and_fire_neuron_nestml.cpp:165:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 165 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/ignore_and_fire_neuron_nestml.cpp:195:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 195 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/ignore_and_fire_neuron_nestml.cpp:238:10: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 238 | auto get_t = [origin, lag](){ return nest::Time( nest::Time::step( origin.get_steps() + lag + 1) ).get_ms(); };\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/ignore_and_fire_neuron_nestml.cpp:232:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 232 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "4 warnings generated.\n", + "[100%] \u001b[32m\u001b[1mLinking CXX shared module nestml_dacbcdc51e4a444f8d6a2af1e0c8e1ce_module.so\u001b[0m\n", + "[100%] Built target nestml_dacbcdc51e4a444f8d6a2af1e0c8e1ce_module_module\n", + "[100%] Built target nestml_dacbcdc51e4a444f8d6a2af1e0c8e1ce_module_module\n", + "\u001b[36mInstall the project...\u001b[0m\n", + "-- Install configuration: \"\"\n", + "-- Installing: /var/folders/3h/2lc1zrkd375b1l0m8zcfj6440000gn/T/nestml_target_d3zy41yz/nestml_dacbcdc51e4a444f8d6a2af1e0c8e1ce_module.so\n", + "[1,GLOBAL, INFO]: List of files that will be processed:\n", + "[2,GLOBAL, INFO]: /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/iaf_psc_exp_neuron.nestml\n", + "[3,GLOBAL, INFO]: /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/neuromodulated_stdp_synapse.nestml\n", + "[4,GLOBAL, INFO]: Target platform code will be generated in directory: '/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target'\n", + "[5,GLOBAL, INFO]: Target platform code will be installed in directory: '/var/folders/3h/2lc1zrkd375b1l0m8zcfj6440000gn/T/nestml_target_js274c83'\n", + "\n", + " -- N E S T --\n", + " Copyright (C) 2004 The NEST Initiative\n", + "\n", + " Version: 3.8.0\n", + " Built: Aug 27 2024 04:38:39\n", + "\n", + " This program is provided AS IS and comes with\n", + " NO WARRANTY. See the file LICENSE for details.\n", + "\n", + " Problems or suggestions?\n", + " Visit https://www.nest-simulator.org\n", + "\n", + " Type 'nest.help()' to find out more about NEST.\n", + "\n", + "[6,GLOBAL, INFO]: The NEST Simulator version was automatically detected as: v3.8.0\n", + "[7,GLOBAL, INFO]: Given template root path is not an absolute path. Creating the absolute path with default templates directory '/opt/homebrew/anaconda3/envs/cart_pole/lib/python3.12/site-packages/pynestml/codegeneration/resources_nest/point_neuron'\n", + "[8,GLOBAL, INFO]: Given template root path is not an absolute path. Creating the absolute path with default templates directory '/opt/homebrew/anaconda3/envs/cart_pole/lib/python3.12/site-packages/pynestml/codegeneration/resources_nest/point_neuron'\n", + "[9,GLOBAL, INFO]: Given template root path is not an absolute path. Creating the absolute path with default templates directory '/opt/homebrew/anaconda3/envs/cart_pole/lib/python3.12/site-packages/pynestml/codegeneration/resources_nest/point_neuron'\n", + "[10,GLOBAL, INFO]: The NEST Simulator installation path was automatically detected as: /opt/homebrew/anaconda3/envs/cart_pole\n", + "[11,GLOBAL, INFO]: Start processing '/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/iaf_psc_exp_neuron.nestml'!\n", + "[12,iaf_psc_exp_neuron_nestml, INFO, [37:19;37:19]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[13,iaf_psc_exp_neuron_nestml, INFO, [40:17;40:17]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[14,iaf_psc_exp_neuron_nestml, INFO, [53:15;53:32]]: Implicit casting from (compatible) type '1 / s buffer' to 'real'.\n", + "[15,GLOBAL, INFO]: Start processing '/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/neuromodulated_stdp_synapse.nestml'!\n", + "[16,neuromodulated_stdp_synapse_nestml, INFO, [8:17;8:17]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[17,neuromodulated_stdp_synapse_nestml, INFO, [9:19;9:19]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[18,neuromodulated_stdp_synapse_nestml, INFO, [22:23;22:23]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[19,iaf_psc_exp_neuron_nestml, WARNING, [40:8;40:17]]: Variable 's' has the same name as a physical unit!\n", + "[20,iaf_psc_exp_neuron_nestml, WARNING, [26:16;26:42]]: Implicit casting from (compatible) type 'mV' to 'real'.\n", + "[21,iaf_psc_exp_neuron_nestml, WARNING, [26:16;26:48]]: Implicit casting from (compatible) type 'mV' to 'real buffer'.\n", + "[22,iaf_psc_exp_neuron_nestml, INFO, [37:19;37:19]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[23,iaf_psc_exp_neuron_nestml, INFO, [40:17;40:17]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[24,iaf_psc_exp_neuron_nestml, INFO, [53:15;53:32]]: Implicit casting from (compatible) type '1 / s buffer' to 'real'.\n", + "[25,neuromodulated_stdp_synapse_nestml, WARNING, [15:8;15:17]]: Variable 'd' has the same name as a physical unit!\n", + "[26,neuromodulated_stdp_synapse_nestml, INFO, [8:17;8:17]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[27,neuromodulated_stdp_synapse_nestml, INFO, [9:19;9:19]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[28,neuromodulated_stdp_synapse_nestml, INFO, [22:23;22:23]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[29,GLOBAL, INFO]: State variables that will be moved from synapse to neuron: ['post_trace']\n", + "[30,GLOBAL, INFO]: Parameters that will be copied from synapse to neuron: ['tau_tr_post']\n", + "[31,GLOBAL, INFO]: Synaptic state variables moved to neuron that will need buffering: []\n", + "[32,GLOBAL, INFO]: Moving state var defining equation(s) post_trace\n", + "[33,GLOBAL, INFO]: Moving state variables for equation(s) post_trace\n", + "[34,GLOBAL, INFO]: Moving definition of post_trace from synapse to neuron\n", + "[35,GLOBAL, INFO]: \tMoving statement post_trace += -1.05e-07 # XXX FIXME!!!! should be ``+= post_trace_increment``\n", + "[36,GLOBAL, INFO]: In synapse: replacing ``continuous`` type input ports that are connected to postsynaptic neuron with external variable references\n", + "[37,GLOBAL, INFO]: Copying parameters from synapse to neuron...\n", + "[38,GLOBAL, INFO]: Copying definition of tau_tr_post from synapse to neuron\n", + "[39,GLOBAL, INFO]: Adding suffix to variables in spike updates\n", + "[40,GLOBAL, INFO]: In synapse: replacing variables with suffixed external variable references\n", + "[41,GLOBAL, INFO]: \t• Replacing variable post_trace\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "INFO:root:Analysing input:\n", + "INFO:root:{\n", + " \"dynamics\": [\n", + " {\n", + " \"expression\": \"g_e' = (-g_e) / tau_g\",\n", + " \"initial_values\": {\n", + " \"g_e\": \"0.0\"\n", + " }\n", + " },\n", + " {\n", + " \"expression\": \"V_m' = (g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\",\n", + " \"initial_values\": {\n", + " \"V_m\": \"E_l\"\n", + " }\n", + " }\n", + " ],\n", + " \"options\": {\n", + " \"output_timestep_symbol\": \"__h\"\n", + " },\n", + " \"parameters\": {\n", + " \"E_e\": \"0\",\n", + " \"E_l\": \"(-74)\",\n", + " \"I_e\": \"0\",\n", + " \"V_reset\": \"(-60)\",\n", + " \"V_th\": \"(-54)\",\n", + " \"s\": \"1000\",\n", + " \"tau_g\": \"5\",\n", + " \"tau_m\": \"10\"\n", + " }\n", + "}\n", + "INFO:root:Processing global options...\n", + "INFO:root:Processing input shapes...\n", + "INFO:root:\n", + "Processing differential-equation form shape g_e with defining expression = \"(-g_e) / tau_g\"\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol g_e, derivative_factors = [-1/tau_g], inhom_term = 0.0, nonlin_term = 0.0\n", + "INFO:root:\tReturning shape: Shape \"g_e\" of order 1\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "INFO:root:\n", + "Processing differential-equation form shape V_m with defining expression = \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\"\n", + "DEBUG:root:Splitting expression (E_l + I_e + I_stim - V_m + g_e*(E_e - V_m))/tau_m (symbols [V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_m]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m\n", + "DEBUG:root:\tnonlinear term: E_e*g_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m\n", + "DEBUG:root:Created Shape with symbol V_m, derivative_factors = [-1/tau_m], inhom_term = E_l/tau_m + I_e/tau_m, nonlin_term = E_e*g_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m\n", + "INFO:root:\tReturning shape: Shape \"V_m\" of order 1\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "INFO:root:All known variables: [g_e, V_m], all parameters used in ODEs: {tau_g, tau_m, I_e, E_l, E_e, I_stim}\n", + "INFO:root:No numerical value specified for parameter \"I_stim\"\n", + "INFO:root:\n", + "Processing differential-equation form shape g_e with defining expression = \"(-g_e) / tau_g\"\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e, V_m, g_e])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol g_e, derivative_factors = [-1/tau_g], inhom_term = 0.0, nonlin_term = 0\n", + "INFO:root:\tReturning shape: Shape \"g_e\" of order 1\n", + "INFO:root:\n", + "Processing differential-equation form shape V_m with defining expression = \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\"\n", + "DEBUG:root:Splitting expression (E_l + I_e + I_stim - V_m + g_e*(E_e - V_m))/tau_m (symbols [g_e, V_m, g_e, V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "DEBUG:root:Created Shape with symbol V_m, derivative_factors = [-1/tau_m], inhom_term = E_l/tau_m + I_e/tau_m + I_stim/tau_m, nonlin_term = E_e*g_e/tau_m - V_m*g_e/tau_m\n", + "INFO:root:\tReturning shape: Shape \"V_m\" of order 1\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols Matrix([[g_e], [V_m]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "DEBUG:root:Splitting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m (symbols Matrix([[g_e], [V_m]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[g_e], [V_m]]), A = Matrix([[-1/tau_g, 0], [E_e/tau_m, -1/tau_m]]), b = Matrix([[0], [E_l/tau_m + I_e/tau_m + I_stim/tau_m]]), c = Matrix([[0], [-V_m*g_e/tau_m]])\n", + "INFO:root:Finding analytically solvable equations...\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e, V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "DEBUG:root:Splitting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m (symbols [g_e, V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "INFO:root:Generating propagators for the following symbols: g_e\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[g_e]]), A = Matrix([[-1/tau_g]]), b = Matrix([[0]]), c = Matrix([[0]])\n", + "DEBUG:root:System of equations:\n", + "DEBUG:root:x = Matrix([[g_e]])\n", + "DEBUG:root:A = Matrix([[-1/tau_g]])\n", + "DEBUG:root:b = Matrix([[0]])\n", + "DEBUG:root:c = Matrix([[0]])\n", + "INFO:root:update_expr[g_e] = __P__g_e__g_e*g_e\n", + "INFO:root:Generating numerical solver for the following symbols: V_m\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[V_m]]), A = Matrix([[-1/tau_m]]), b = Matrix([[E_l/tau_m + I_e/tau_m + I_stim/tau_m]]), c = Matrix([[E_e*g_e/tau_m - V_m*g_e/tau_m]])\n", + "WARNING:root:Not preserving expression for variable \"g_e\" as it is solved by propagator solver\n", + "INFO:root:Preserving expression for variable \"V_m\"\n", + "INFO:root:In ode-toolbox: returning outdict = \n", + "INFO:root:[\n", + " {\n", + " \"initial_values\": {\n", + " \"g_e\": \"0.0\"\n", + " },\n", + " \"parameters\": {\n", + " \"tau_g\": \"5.00000000000000\"\n", + " },\n", + " \"propagators\": {\n", + " \"__P__g_e__g_e\": \"exp(-__h/tau_g)\"\n", + " },\n", + " \"solver\": \"analytical\",\n", + " \"state_variables\": [\n", + " \"g_e\"\n", + " ],\n", + " \"update_expressions\": {\n", + " \"g_e\": \"__P__g_e__g_e*g_e\"\n", + " }\n", + " },\n", + " {\n", + " \"initial_values\": {\n", + " \"V_m\": \"E_l\"\n", + " },\n", + " \"parameters\": {\n", + " \"E_e\": \"0\",\n", + " \"E_l\": \"-74.0000000000000\",\n", + " \"I_e\": \"0\",\n", + " \"tau_m\": \"10.0000000000000\"\n", + " },\n", + " \"solver\": \"numeric\",\n", + " \"state_variables\": [\n", + " \"V_m\"\n", + " ],\n", + " \"update_expressions\": {\n", + " \"V_m\": \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\"\n", + " }\n", + " }\n", + "]\n", + "INFO:root:Analysing input:\n", + "INFO:root:{\n", + " \"dynamics\": [\n", + " {\n", + " \"expression\": \"g_e' = (-g_e) / tau_g\",\n", + " \"initial_values\": {\n", + " \"g_e\": \"0.0\"\n", + " }\n", + " },\n", + " {\n", + " \"expression\": \"V_m' = (g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\",\n", + " \"initial_values\": {\n", + " \"V_m\": \"E_l\"\n", + " }\n", + " }\n", + " ],\n", + " \"options\": {\n", + " \"output_timestep_symbol\": \"__h\"\n", + " },\n", + " \"parameters\": {\n", + " \"E_e\": \"0\",\n", + " \"E_l\": \"(-74)\",\n", + " \"I_e\": \"0\",\n", + " \"V_reset\": \"(-60)\",\n", + " \"V_th\": \"(-54)\",\n", + " \"s\": \"1000\",\n", + " \"tau_g\": \"5\",\n", + " \"tau_m\": \"10\"\n", + " }\n", + "}\n", + "INFO:root:Processing global options...\n", + "INFO:root:Processing input shapes...\n", + "INFO:root:\n", + "Processing differential-equation form shape g_e with defining expression = \"(-g_e) / tau_g\"\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol g_e, derivative_factors = [-1/tau_g], inhom_term = 0.0, nonlin_term = 0.0\n", + "INFO:root:\tReturning shape: Shape \"g_e\" of order 1\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "INFO:root:\n", + "Processing differential-equation form shape V_m with defining expression = \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\"\n", + "DEBUG:root:Splitting expression (E_l + I_e + I_stim - V_m + g_e*(E_e - V_m))/tau_m (symbols [V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_m]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m\n", + "DEBUG:root:\tnonlinear term: E_e*g_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m\n", + "DEBUG:root:Created Shape with symbol V_m, derivative_factors = [-1/tau_m], inhom_term = E_l/tau_m + I_e/tau_m, nonlin_term = E_e*g_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m\n", + "INFO:root:\tReturning shape: Shape \"V_m\" of order 1\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "INFO:root:All known variables: [g_e, V_m], all parameters used in ODEs: {tau_g, tau_m, I_e, E_l, E_e, I_stim}\n", + "INFO:root:No numerical value specified for parameter \"I_stim\"\n", + "INFO:root:\n", + "Processing differential-equation form shape g_e with defining expression = \"(-g_e) / tau_g\"\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e, V_m, g_e])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol g_e, derivative_factors = [-1/tau_g], inhom_term = 0.0, nonlin_term = 0\n", + "INFO:root:\tReturning shape: Shape \"g_e\" of order 1\n", + "INFO:root:\n", + "Processing differential-equation form shape V_m with defining expression = \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\"\n", + "DEBUG:root:Splitting expression (E_l + I_e + I_stim - V_m + g_e*(E_e - V_m))/tau_m (symbols [g_e, V_m, g_e, V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "DEBUG:root:Created Shape with symbol V_m, derivative_factors = [-1/tau_m], inhom_term = E_l/tau_m + I_e/tau_m + I_stim/tau_m, nonlin_term = E_e*g_e/tau_m - V_m*g_e/tau_m\n", + "INFO:root:\tReturning shape: Shape \"V_m\" of order 1\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols Matrix([[g_e], [V_m]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "DEBUG:root:Splitting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m (symbols Matrix([[g_e], [V_m]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[g_e], [V_m]]), A = Matrix([[-1/tau_g, 0], [E_e/tau_m, -1/tau_m]]), b = Matrix([[0], [E_l/tau_m + I_e/tau_m + I_stim/tau_m]]), c = Matrix([[0], [-V_m*g_e/tau_m]])\n", + "INFO:root:Finding analytically solvable equations...\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e, V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "DEBUG:root:Splitting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m (symbols [g_e, V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "INFO:root:Generating numerical solver for the following symbols: g_e, V_m\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[g_e], [V_m]]), A = Matrix([[-1/tau_g, 0], [E_e/tau_m, -1/tau_m]]), b = Matrix([[0], [E_l/tau_m + I_e/tau_m + I_stim/tau_m]]), c = Matrix([[0], [-V_m*g_e/tau_m]])\n", + "INFO:root:Preserving expression for variable \"g_e\"\n", + "INFO:root:Preserving expression for variable \"V_m\"\n", + "INFO:root:In ode-toolbox: returning outdict = \n", + "INFO:root:[\n", + " {\n", + " \"initial_values\": {\n", + " \"V_m\": \"E_l\",\n", + " \"g_e\": \"0.0\"\n", + " },\n", + " \"parameters\": {\n", + " \"E_e\": \"0\",\n", + " \"E_l\": \"-74.0000000000000\",\n", + " \"I_e\": \"0\",\n", + " \"tau_g\": \"5.00000000000000\",\n", + " \"tau_m\": \"10.0000000000000\"\n", + " },\n", + " \"solver\": \"numeric\",\n", + " \"state_variables\": [\n", + " \"g_e\",\n", + " \"V_m\"\n", + " ],\n", + " \"update_expressions\": {\n", + " \"V_m\": \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\",\n", + " \"g_e\": \"(-g_e) / tau_g\"\n", + " }\n", + " }\n", + "]\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[42,GLOBAL, INFO]: Successfully constructed neuron-synapse pair iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml, neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml\n", + "[43,GLOBAL, INFO]: Analysing/transforming model 'iaf_psc_exp_neuron_nestml'\n", + "[44,iaf_psc_exp_neuron_nestml, INFO, [18:0;58:0]]: Starts processing of the model 'iaf_psc_exp_neuron_nestml'\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "INFO:root:Analysing input:\n", + "INFO:root:{\n", + " \"dynamics\": [\n", + " {\n", + " \"expression\": \"g_e' = (-g_e) / tau_g\",\n", + " \"initial_values\": {\n", + " \"g_e\": \"0.0\"\n", + " }\n", + " },\n", + " {\n", + " \"expression\": \"V_m' = (g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\",\n", + " \"initial_values\": {\n", + " \"V_m\": \"E_l\"\n", + " }\n", + " },\n", + " {\n", + " \"expression\": \"post_trace__for_neuromodulated_stdp_synapse_nestml' = (-post_trace__for_neuromodulated_stdp_synapse_nestml) / tau_tr_post__for_neuromodulated_stdp_synapse_nestml\",\n", + " \"initial_values\": {\n", + " \"post_trace__for_neuromodulated_stdp_synapse_nestml\": \"0.0\"\n", + " }\n", + " }\n", + " ],\n", + " \"options\": {\n", + " \"output_timestep_symbol\": \"__h\"\n", + " },\n", + " \"parameters\": {\n", + " \"E_e\": \"0\",\n", + " \"E_l\": \"(-74)\",\n", + " \"I_e\": \"0\",\n", + " \"V_reset\": \"(-60)\",\n", + " \"V_th\": \"(-54)\",\n", + " \"s\": \"1000\",\n", + " \"tau_g\": \"5\",\n", + " \"tau_m\": \"10\",\n", + " \"tau_tr_post__for_neuromodulated_stdp_synapse_nestml\": \"20\"\n", + " }\n", + "}\n", + "INFO:root:Processing global options...\n", + "INFO:root:Processing input shapes...\n", + "INFO:root:\n", + "Processing differential-equation form shape g_e with defining expression = \"(-g_e) / tau_g\"\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol g_e, derivative_factors = [-1/tau_g], inhom_term = 0.0, nonlin_term = 0.0\n", + "INFO:root:\tReturning shape: Shape \"g_e\" of order 1\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "INFO:root:\n", + "Processing differential-equation form shape V_m with defining expression = \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\"\n", + "DEBUG:root:Splitting expression (E_l + I_e + I_stim - V_m + g_e*(E_e - V_m))/tau_m (symbols [V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_m]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m\n", + "DEBUG:root:\tnonlinear term: E_e*g_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m\n", + "DEBUG:root:Created Shape with symbol V_m, derivative_factors = [-1/tau_m], inhom_term = E_l/tau_m + I_e/tau_m, nonlin_term = E_e*g_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m\n", + "INFO:root:\tReturning shape: Shape \"V_m\" of order 1\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "INFO:root:\n", + "Processing differential-equation form shape post_trace__for_neuromodulated_stdp_synapse_nestml with defining expression = \"(-post_trace__for_neuromodulated_stdp_synapse_nestml) / tau_tr_post__for_neuromodulated_stdp_synapse_nestml\"\n", + "DEBUG:root:Splitting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml (symbols [post_trace__for_neuromodulated_stdp_synapse_nestml])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol post_trace__for_neuromodulated_stdp_synapse_nestml, derivative_factors = [-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml], inhom_term = 0.0, nonlin_term = 0.0\n", + "INFO:root:\tReturning shape: Shape \"post_trace__for_neuromodulated_stdp_synapse_nestml\" of order 1\n", + "INFO:root:Shape post_trace__for_neuromodulated_stdp_synapse_nestml: reconstituting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml\n", + "INFO:root:All known variables: [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml], all parameters used in ODEs: {tau_tr_post__for_neuromodulated_stdp_synapse_nestml, tau_g, tau_m, I_e, E_l, E_e, I_stim}\n", + "INFO:root:No numerical value specified for parameter \"I_stim\"\n", + "INFO:root:\n", + "Processing differential-equation form shape g_e with defining expression = \"(-g_e) / tau_g\"\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml, g_e])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol g_e, derivative_factors = [-1/tau_g], inhom_term = 0.0, nonlin_term = 0\n", + "INFO:root:\tReturning shape: Shape \"g_e\" of order 1\n", + "INFO:root:\n", + "Processing differential-equation form shape V_m with defining expression = \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\"\n", + "DEBUG:root:Splitting expression (E_l + I_e + I_stim - V_m + g_e*(E_e - V_m))/tau_m (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml, g_e, V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m], [0], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "DEBUG:root:Created Shape with symbol V_m, derivative_factors = [-1/tau_m], inhom_term = E_l/tau_m + I_e/tau_m + I_stim/tau_m, nonlin_term = E_e*g_e/tau_m - V_m*g_e/tau_m\n", + "INFO:root:\tReturning shape: Shape \"V_m\" of order 1\n", + "INFO:root:\n", + "Processing differential-equation form shape post_trace__for_neuromodulated_stdp_synapse_nestml with defining expression = \"(-post_trace__for_neuromodulated_stdp_synapse_nestml) / tau_tr_post__for_neuromodulated_stdp_synapse_nestml\"\n", + "DEBUG:root:Splitting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml, g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml])\n", + "DEBUG:root:\tlinear factors: Matrix([[0], [0], [-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml], [0], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol post_trace__for_neuromodulated_stdp_synapse_nestml, derivative_factors = [-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml], inhom_term = 0.0, nonlin_term = 0\n", + "INFO:root:\tReturning shape: Shape \"post_trace__for_neuromodulated_stdp_synapse_nestml\" of order 1\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols Matrix([[g_e], [V_m], [post_trace__for_neuromodulated_stdp_synapse_nestml]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "DEBUG:root:Splitting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m (symbols Matrix([[g_e], [V_m], [post_trace__for_neuromodulated_stdp_synapse_nestml]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m], [0]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "INFO:root:Shape post_trace__for_neuromodulated_stdp_synapse_nestml: reconstituting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml\n", + "DEBUG:root:Splitting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml (symbols Matrix([[g_e], [V_m], [post_trace__for_neuromodulated_stdp_synapse_nestml]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[0], [0], [-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[g_e], [V_m], [post_trace__for_neuromodulated_stdp_synapse_nestml]]), A = Matrix([[-1/tau_g, 0, 0], [E_e/tau_m, -1/tau_m, 0], [0, 0, -1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]]), b = Matrix([[0], [E_l/tau_m + I_e/tau_m + I_stim/tau_m], [0]]), c = Matrix([[0], [-V_m*g_e/tau_m], [0]])\n", + "INFO:root:Finding analytically solvable equations...\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "DEBUG:root:Splitting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml])\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m], [0]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "INFO:root:Shape post_trace__for_neuromodulated_stdp_synapse_nestml: reconstituting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml\n", + "DEBUG:root:Splitting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml])\n", + "DEBUG:root:\tlinear factors: Matrix([[0], [0], [-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Generating propagators for the following symbols: g_e, post_trace__for_neuromodulated_stdp_synapse_nestml\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[g_e], [post_trace__for_neuromodulated_stdp_synapse_nestml]]), A = Matrix([[-1/tau_g, 0], [0, -1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]]), b = Matrix([[0], [0]]), c = Matrix([[0], [0]])\n", + "DEBUG:root:System of equations:\n", + "DEBUG:root:x = Matrix([[g_e], [post_trace__for_neuromodulated_stdp_synapse_nestml]])\n", + "DEBUG:root:A = Matrix([\n", + "[-1/tau_g, 0],\n", + "[ 0, -1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]])\n", + "DEBUG:root:b = Matrix([[0], [0]])\n", + "DEBUG:root:c = Matrix([[0], [0]])\n", + "INFO:root:update_expr[g_e] = __P__g_e__g_e*g_e\n", + "INFO:root:update_expr[post_trace__for_neuromodulated_stdp_synapse_nestml] = __P__post_trace__for_neuromodulated_stdp_synapse_nestml__post_trace__for_neuromodulated_stdp_synapse_nestml*post_trace__for_neuromodulated_stdp_synapse_nestml\n", + "INFO:root:Generating numerical solver for the following symbols: V_m\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[V_m]]), A = Matrix([[-1/tau_m]]), b = Matrix([[E_l/tau_m + I_e/tau_m + I_stim/tau_m]]), c = Matrix([[E_e*g_e/tau_m - V_m*g_e/tau_m]])\n", + "WARNING:root:Not preserving expression for variable \"g_e\" as it is solved by propagator solver\n", + "WARNING:root:Not preserving expression for variable \"post_trace__for_neuromodulated_stdp_synapse_nestml\" as it is solved by propagator solver\n", + "INFO:root:Preserving expression for variable \"V_m\"\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[45,iaf_psc_exp_neuron_nestml, WARNING, [40:8;40:17]]: Variable 's' has the same name as a physical unit!\n", + "[46,iaf_psc_exp_neuron_nestml, INFO, [37:19;37:19]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[47,iaf_psc_exp_neuron_nestml, INFO, [40:17;40:17]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[48,iaf_psc_exp_neuron_nestml, INFO, [53:15;53:32]]: Implicit casting from (compatible) type '1 / s buffer' to 'real'.\n", + "[49,GLOBAL, INFO]: Analysing/transforming model 'iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml'\n", + "[50,iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml, INFO, [18:0;58:0]]: Starts processing of the model 'iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml'\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "INFO:root:In ode-toolbox: returning outdict = \n", + "INFO:root:[\n", + " {\n", + " \"initial_values\": {\n", + " \"g_e\": \"0.0\",\n", + " \"post_trace__for_neuromodulated_stdp_synapse_nestml\": \"0.0\"\n", + " },\n", + " \"parameters\": {\n", + " \"tau_g\": \"5.00000000000000\",\n", + " \"tau_tr_post__for_neuromodulated_stdp_synapse_nestml\": \"20.0000000000000\"\n", + " },\n", + " \"propagators\": {\n", + " \"__P__g_e__g_e\": \"exp(-__h/tau_g)\",\n", + " \"__P__post_trace__for_neuromodulated_stdp_synapse_nestml__post_trace__for_neuromodulated_stdp_synapse_nestml\": \"exp(-__h/tau_tr_post__for_neuromodulated_stdp_synapse_nestml)\"\n", + " },\n", + " \"solver\": \"analytical\",\n", + " \"state_variables\": [\n", + " \"g_e\",\n", + " \"post_trace__for_neuromodulated_stdp_synapse_nestml\"\n", + " ],\n", + " \"update_expressions\": {\n", + " \"g_e\": \"__P__g_e__g_e*g_e\",\n", + " \"post_trace__for_neuromodulated_stdp_synapse_nestml\": \"__P__post_trace__for_neuromodulated_stdp_synapse_nestml__post_trace__for_neuromodulated_stdp_synapse_nestml*post_trace__for_neuromodulated_stdp_synapse_nestml\"\n", + " }\n", + " },\n", + " {\n", + " \"initial_values\": {\n", + " \"V_m\": \"E_l\"\n", + " },\n", + " \"parameters\": {\n", + " \"E_e\": \"0\",\n", + " \"E_l\": \"-74.0000000000000\",\n", + " \"I_e\": \"0\",\n", + " \"tau_m\": \"10.0000000000000\"\n", + " },\n", + " \"solver\": \"numeric\",\n", + " \"state_variables\": [\n", + " \"V_m\"\n", + " ],\n", + " \"update_expressions\": {\n", + " \"V_m\": \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\"\n", + " }\n", + " }\n", + "]\n", + "INFO:root:Analysing input:\n", + "INFO:root:{\n", + " \"dynamics\": [\n", + " {\n", + " \"expression\": \"g_e' = (-g_e) / tau_g\",\n", + " \"initial_values\": {\n", + " \"g_e\": \"0.0\"\n", + " }\n", + " },\n", + " {\n", + " \"expression\": \"V_m' = (g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\",\n", + " \"initial_values\": {\n", + " \"V_m\": \"E_l\"\n", + " }\n", + " },\n", + " {\n", + " \"expression\": \"post_trace__for_neuromodulated_stdp_synapse_nestml' = (-post_trace__for_neuromodulated_stdp_synapse_nestml) / tau_tr_post__for_neuromodulated_stdp_synapse_nestml\",\n", + " \"initial_values\": {\n", + " \"post_trace__for_neuromodulated_stdp_synapse_nestml\": \"0.0\"\n", + " }\n", + " }\n", + " ],\n", + " \"options\": {\n", + " \"output_timestep_symbol\": \"__h\"\n", + " },\n", + " \"parameters\": {\n", + " \"E_e\": \"0\",\n", + " \"E_l\": \"(-74)\",\n", + " \"I_e\": \"0\",\n", + " \"V_reset\": \"(-60)\",\n", + " \"V_th\": \"(-54)\",\n", + " \"s\": \"1000\",\n", + " \"tau_g\": \"5\",\n", + " \"tau_m\": \"10\",\n", + " \"tau_tr_post__for_neuromodulated_stdp_synapse_nestml\": \"20\"\n", + " }\n", + "}\n", + "INFO:root:Processing global options...\n", + "INFO:root:Processing input shapes...\n", + "INFO:root:\n", + "Processing differential-equation form shape g_e with defining expression = \"(-g_e) / tau_g\"\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol g_e, derivative_factors = [-1/tau_g], inhom_term = 0.0, nonlin_term = 0.0\n", + "INFO:root:\tReturning shape: Shape \"g_e\" of order 1\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "INFO:root:\n", + "Processing differential-equation form shape V_m with defining expression = \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\"\n", + "DEBUG:root:Splitting expression (E_l + I_e + I_stim - V_m + g_e*(E_e - V_m))/tau_m (symbols [V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_m]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m\n", + "DEBUG:root:\tnonlinear term: E_e*g_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m\n", + "DEBUG:root:Created Shape with symbol V_m, derivative_factors = [-1/tau_m], inhom_term = E_l/tau_m + I_e/tau_m, nonlin_term = E_e*g_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m\n", + "INFO:root:\tReturning shape: Shape \"V_m\" of order 1\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "INFO:root:\n", + "Processing differential-equation form shape post_trace__for_neuromodulated_stdp_synapse_nestml with defining expression = \"(-post_trace__for_neuromodulated_stdp_synapse_nestml) / tau_tr_post__for_neuromodulated_stdp_synapse_nestml\"\n", + "DEBUG:root:Splitting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml (symbols [post_trace__for_neuromodulated_stdp_synapse_nestml])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol post_trace__for_neuromodulated_stdp_synapse_nestml, derivative_factors = [-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml], inhom_term = 0.0, nonlin_term = 0.0\n", + "INFO:root:\tReturning shape: Shape \"post_trace__for_neuromodulated_stdp_synapse_nestml\" of order 1\n", + "INFO:root:Shape post_trace__for_neuromodulated_stdp_synapse_nestml: reconstituting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml\n", + "INFO:root:All known variables: [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml], all parameters used in ODEs: {tau_tr_post__for_neuromodulated_stdp_synapse_nestml, tau_g, tau_m, I_e, E_l, E_e, I_stim}\n", + "INFO:root:No numerical value specified for parameter \"I_stim\"\n", + "INFO:root:\n", + "Processing differential-equation form shape g_e with defining expression = \"(-g_e) / tau_g\"\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml, g_e])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol g_e, derivative_factors = [-1/tau_g], inhom_term = 0.0, nonlin_term = 0\n", + "INFO:root:\tReturning shape: Shape \"g_e\" of order 1\n", + "INFO:root:\n", + "Processing differential-equation form shape V_m with defining expression = \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\"\n", + "DEBUG:root:Splitting expression (E_l + I_e + I_stim - V_m + g_e*(E_e - V_m))/tau_m (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml, g_e, V_m])\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m], [0], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "DEBUG:root:Created Shape with symbol V_m, derivative_factors = [-1/tau_m], inhom_term = E_l/tau_m + I_e/tau_m + I_stim/tau_m, nonlin_term = E_e*g_e/tau_m - V_m*g_e/tau_m\n", + "INFO:root:\tReturning shape: Shape \"V_m\" of order 1\n", + "INFO:root:\n", + "Processing differential-equation form shape post_trace__for_neuromodulated_stdp_synapse_nestml with defining expression = \"(-post_trace__for_neuromodulated_stdp_synapse_nestml) / tau_tr_post__for_neuromodulated_stdp_synapse_nestml\"\n", + "DEBUG:root:Splitting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml, g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml])\n", + "DEBUG:root:\tlinear factors: Matrix([[0], [0], [-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml], [0], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol post_trace__for_neuromodulated_stdp_synapse_nestml, derivative_factors = [-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml], inhom_term = 0.0, nonlin_term = 0\n", + "INFO:root:\tReturning shape: Shape \"post_trace__for_neuromodulated_stdp_synapse_nestml\" of order 1\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols Matrix([[g_e], [V_m], [post_trace__for_neuromodulated_stdp_synapse_nestml]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "DEBUG:root:Splitting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m (symbols Matrix([[g_e], [V_m], [post_trace__for_neuromodulated_stdp_synapse_nestml]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m], [0]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "INFO:root:Shape post_trace__for_neuromodulated_stdp_synapse_nestml: reconstituting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml\n", + "DEBUG:root:Splitting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml (symbols Matrix([[g_e], [V_m], [post_trace__for_neuromodulated_stdp_synapse_nestml]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[0], [0], [-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[g_e], [V_m], [post_trace__for_neuromodulated_stdp_synapse_nestml]]), A = Matrix([[-1/tau_g, 0, 0], [E_e/tau_m, -1/tau_m, 0], [0, 0, -1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]]), b = Matrix([[0], [E_l/tau_m + I_e/tau_m + I_stim/tau_m], [0]]), c = Matrix([[0], [-V_m*g_e/tau_m], [0]])\n", + "INFO:root:Finding analytically solvable equations...\n", + "INFO:root:Shape g_e: reconstituting expression -g_e/tau_g\n", + "DEBUG:root:Splitting expression -g_e/tau_g (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_g], [0], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Shape V_m: reconstituting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m\n", + "DEBUG:root:Splitting expression E_e*g_e/tau_m + E_l/tau_m + I_e/tau_m + I_stim/tau_m - V_m*g_e/tau_m - V_m/tau_m (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml])\n", + "DEBUG:root:\tlinear factors: Matrix([[E_e/tau_m], [-1/tau_m], [0]])\n", + "DEBUG:root:\tinhomogeneous term: E_l/tau_m + I_e/tau_m + I_stim/tau_m\n", + "DEBUG:root:\tnonlinear term: -V_m*g_e/tau_m\n", + "INFO:root:Shape post_trace__for_neuromodulated_stdp_synapse_nestml: reconstituting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml\n", + "DEBUG:root:Splitting expression -post_trace__for_neuromodulated_stdp_synapse_nestml/tau_tr_post__for_neuromodulated_stdp_synapse_nestml (symbols [g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml])\n", + "DEBUG:root:\tlinear factors: Matrix([[0], [0], [-1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Generating numerical solver for the following symbols: g_e, V_m, post_trace__for_neuromodulated_stdp_synapse_nestml\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[g_e], [V_m], [post_trace__for_neuromodulated_stdp_synapse_nestml]]), A = Matrix([[-1/tau_g, 0, 0], [E_e/tau_m, -1/tau_m, 0], [0, 0, -1/tau_tr_post__for_neuromodulated_stdp_synapse_nestml]]), b = Matrix([[0], [E_l/tau_m + I_e/tau_m + I_stim/tau_m], [0]]), c = Matrix([[0], [-V_m*g_e/tau_m], [0]])\n", + "INFO:root:Preserving expression for variable \"g_e\"\n", + "INFO:root:Preserving expression for variable \"V_m\"\n", + "INFO:root:Preserving expression for variable \"post_trace__for_neuromodulated_stdp_synapse_nestml\"\n", + "INFO:root:In ode-toolbox: returning outdict = \n", + "INFO:root:[\n", + " {\n", + " \"initial_values\": {\n", + " \"V_m\": \"E_l\",\n", + " \"g_e\": \"0.0\",\n", + " \"post_trace__for_neuromodulated_stdp_synapse_nestml\": \"0.0\"\n", + " },\n", + " \"parameters\": {\n", + " \"E_e\": \"0\",\n", + " \"E_l\": \"-74.0000000000000\",\n", + " \"I_e\": \"0\",\n", + " \"tau_g\": \"5.00000000000000\",\n", + " \"tau_m\": \"10.0000000000000\",\n", + " \"tau_tr_post__for_neuromodulated_stdp_synapse_nestml\": \"20.0000000000000\"\n", + " },\n", + " \"solver\": \"numeric\",\n", + " \"state_variables\": [\n", + " \"g_e\",\n", + " \"V_m\",\n", + " \"post_trace__for_neuromodulated_stdp_synapse_nestml\"\n", + " ],\n", + " \"update_expressions\": {\n", + " \"V_m\": \"(g_e * (E_e - V_m) + E_l - V_m + I_e + I_stim) / tau_m\",\n", + " \"g_e\": \"(-g_e) / tau_g\",\n", + " \"post_trace__for_neuromodulated_stdp_synapse_nestml\": \"(-post_trace__for_neuromodulated_stdp_synapse_nestml) / tau_tr_post__for_neuromodulated_stdp_synapse_nestml\"\n", + " }\n", + " }\n", + "]\n", + "INFO:root:Analysing input:\n", + "INFO:root:{\n", + " \"dynamics\": [\n", + " {\n", + " \"expression\": \"pre_trace' = (-pre_trace) / tau_tr_pre\",\n", + " \"initial_values\": {\n", + " \"pre_trace\": \"0.0\"\n", + " }\n", + " }\n", + " ],\n", + " \"options\": {\n", + " \"output_timestep_symbol\": \"__h\"\n", + " },\n", + " \"parameters\": {\n", + " \"beta\": \"0.01\",\n", + " \"d\": \"1\",\n", + " \"n\": \"0.0\",\n", + " \"post_trace_increment\": \"1.0\",\n", + " \"pre_trace_increment\": \"1.0\",\n", + " \"tau_tr_post\": \"20\",\n", + " \"tau_tr_pre\": \"20\",\n", + " \"wtr_max\": \"0.1\",\n", + " \"wtr_min\": \"0\"\n", + " }\n", + "}\n", + "INFO:root:Processing global options...\n", + "INFO:root:Processing input shapes...\n", + "INFO:root:\n", + "Processing differential-equation form shape pre_trace with defining expression = \"(-pre_trace) / tau_tr_pre\"\n", + "DEBUG:root:Splitting expression -pre_trace/tau_tr_pre (symbols [pre_trace])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_tr_pre]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol pre_trace, derivative_factors = [-1/tau_tr_pre], inhom_term = 0.0, nonlin_term = 0.0\n", + "INFO:root:\tReturning shape: Shape \"pre_trace\" of order 1\n", + "INFO:root:Shape pre_trace: reconstituting expression -pre_trace/tau_tr_pre\n", + "INFO:root:All known variables: [pre_trace], all parameters used in ODEs: {tau_tr_pre}\n", + "INFO:root:\n", + "Processing differential-equation form shape pre_trace with defining expression = \"(-pre_trace) / tau_tr_pre\"\n", + "DEBUG:root:Splitting expression -pre_trace/tau_tr_pre (symbols [pre_trace, pre_trace])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_tr_pre], [0]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Created Shape with symbol pre_trace, derivative_factors = [-1/tau_tr_pre], inhom_term = 0.0, nonlin_term = 0\n", + "INFO:root:\tReturning shape: Shape \"pre_trace\" of order 1\n", + "INFO:root:Shape pre_trace: reconstituting expression -pre_trace/tau_tr_pre\n", + "DEBUG:root:Splitting expression -pre_trace/tau_tr_pre (symbols Matrix([[pre_trace]]))\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_tr_pre]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[pre_trace]]), A = Matrix([[-1/tau_tr_pre]]), b = Matrix([[0]]), c = Matrix([[0]])\n", + "INFO:root:Finding analytically solvable equations...\n", + "INFO:root:Shape pre_trace: reconstituting expression -pre_trace/tau_tr_pre\n", + "DEBUG:root:Splitting expression -pre_trace/tau_tr_pre (symbols [pre_trace])\n", + "DEBUG:root:\tlinear factors: Matrix([[-1/tau_tr_pre]])\n", + "DEBUG:root:\tinhomogeneous term: 0.0\n", + "DEBUG:root:\tnonlinear term: 0.0\n", + "INFO:root:Generating propagators for the following symbols: pre_trace\n", + "DEBUG:root:Initializing system of shapes with x = Matrix([[pre_trace]]), A = Matrix([[-1/tau_tr_pre]]), b = Matrix([[0]]), c = Matrix([[0]])\n", + "DEBUG:root:System of equations:\n", + "DEBUG:root:x = Matrix([[pre_trace]])\n", + "DEBUG:root:A = Matrix([[-1/tau_tr_pre]])\n", + "DEBUG:root:b = Matrix([[0]])\n", + "DEBUG:root:c = Matrix([[0]])\n", + "INFO:root:update_expr[pre_trace] = __P__pre_trace__pre_trace*pre_trace\n", + "WARNING:root:Not preserving expression for variable \"pre_trace\" as it is solved by propagator solver\n", + "INFO:root:In ode-toolbox: returning outdict = \n", + "INFO:root:[\n", + " {\n", + " \"initial_values\": {\n", + " \"pre_trace\": \"0.0\"\n", + " },\n", + " \"parameters\": {\n", + " \"tau_tr_pre\": \"20.0000000000000\"\n", + " },\n", + " \"propagators\": {\n", + " \"__P__pre_trace__pre_trace\": \"exp(-__h/tau_tr_pre)\"\n", + " },\n", + " \"solver\": \"analytical\",\n", + " \"state_variables\": [\n", + " \"pre_trace\"\n", + " ],\n", + " \"update_expressions\": {\n", + " \"pre_trace\": \"__P__pre_trace__pre_trace*pre_trace\"\n", + " }\n", + " }\n", + "]\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[51,iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml, WARNING, [40:8;40:17]]: Variable 's' has the same name as a physical unit!\n", + "[52,iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml, INFO, [37:19;37:19]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[53,iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml, INFO, [40:17;40:17]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[54,iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml, INFO, [53:15;53:32]]: Implicit casting from (compatible) type '1 / s buffer' to 'real'.\n", + "[55,GLOBAL, INFO]: Analysing/transforming synapse neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.\n", + "[56,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, INFO, [6:0;53:0]]: Starts processing of the model 'neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml'\n", + "[57,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, WARNING, [15:8;15:17]]: Variable 'd' has the same name as a physical unit!\n", + "[58,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, INFO, [8:17;8:17]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[59,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, INFO, [9:19;9:19]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[60,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, INFO, [22:23;22:23]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[61,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, WARNING, [15:8;15:17]]: Variable 'd' has the same name as a physical unit!\n", + "[62,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, INFO, [8:17;8:17]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[63,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, INFO, [9:19;9:19]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[64,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, INFO, [22:23;22:23]]: Implicit casting from (compatible) type 'integer' to 'real'.\n", + "[65,GLOBAL, INFO]: Rendering template /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml.cpp\n", + "[66,GLOBAL, INFO]: Rendering template /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml.h\n", + "[67,iaf_psc_exp_neuron_nestml, INFO, [18:0;58:0]]: Successfully generated code for the model: 'iaf_psc_exp_neuron_nestml' in: '/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target' !\n", + "[68,GLOBAL, INFO]: Rendering template /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.cpp\n", + "[69,GLOBAL, INFO]: Rendering template /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.h\n", + "[70,iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml, INFO, [18:0;58:0]]: Successfully generated code for the model: 'iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml' in: '/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target' !\n", + "[71,GLOBAL, INFO]: Rendering template /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h\n", + "[72,neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml, INFO, [6:0;53:0]]: Successfully generated code for the model: 'neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml' in: '/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target' !\n", + "[73,GLOBAL, INFO]: Rendering template /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/CMakeLists.txt\n", + "[74,GLOBAL, INFO]: Rendering template /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/nestml_df7b0c900d264482ae57d78cfc3bbf9d_module.h\n", + "[75,GLOBAL, INFO]: Rendering template /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/nestml_df7b0c900d264482ae57d78cfc3bbf9d_module.cpp\n", + "[76,GLOBAL, INFO]: Successfully generated NEST module code in '/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target' !\n", + "\u001b[33mCMake Warning (dev) at CMakeLists.txt:95 (project):\n", + " cmake_minimum_required() should be called prior to this top-level project()\n", + " call. Please see the cmake-commands(7) manual for usage documentation of\n", + " both commands.\n", + "This warning is for project developers. Use -Wno-dev to suppress it.\n", + "\u001b[0m\n", + "-- The CXX compiler identification is Clang 18.1.8\n", + "-- Detecting CXX compiler ABI info\n", + "-- Detecting CXX compiler ABI info - done\n", + "-- Check for working CXX compiler: /opt/homebrew/anaconda3/envs/cart_pole/bin/arm64-apple-darwin20.0.0-clang++ - skipped\n", + "-- Detecting CXX compile features\n", + "-- Detecting CXX compile features - done\n", + "\u001b[0m\u001b[0m\n", + "\u001b[0m-------------------------------------------------------\u001b[0m\n", + "\u001b[0mnestml_df7b0c900d264482ae57d78cfc3bbf9d_module Configuration Summary\u001b[0m\n", + "\u001b[0m-------------------------------------------------------\u001b[0m\n", + "\u001b[0m\u001b[0m\n", + "\u001b[0mC++ compiler : /opt/homebrew/anaconda3/envs/cart_pole/bin/arm64-apple-darwin20.0.0-clang++\u001b[0m\n", + "\u001b[0mBuild static libs : OFF\u001b[0m\n", + "\u001b[0mC++ compiler flags : -ftree-vectorize -fPIC -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -isystem /opt/homebrew/anaconda3/envs/cart_pole/include\u001b[0m\n", + "\u001b[0mNEST compiler flags : -ftree-vectorize -fPIC -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -isystem /opt/homebrew/anaconda3/envs/cart_pole/include -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/nest-simulator_1724732993440/work=/usr/local/src/conda/nest-simulator-3.8 -fdebug-prefix-map=/opt/homebrew/anaconda3/envs/cart_pole=/usr/local/src/conda-prefix -std=c++17 -Wall -Xclang -fopenmp -O2\u001b[0m\n", + "\u001b[0mNEST include dirs : -I/opt/homebrew/anaconda3/envs/cart_pole/include/nest -I/opt/homebrew/anaconda3/envs/cart_pole/include -I/opt/homebrew/anaconda3/envs/cart_pole/include -I/opt/homebrew/anaconda3/envs/cart_pole/include -I/opt/homebrew/anaconda3/envs/cart_pole/include\u001b[0m\n", + "\u001b[0mNEST libraries flags : -L/opt/homebrew/anaconda3/envs/cart_pole/lib/nest -lnest -lsli /opt/homebrew/anaconda3/envs/cart_pole/lib/libltdl.dylib /opt/homebrew/anaconda3/envs/cart_pole/lib/libreadline.dylib /opt/homebrew/anaconda3/envs/cart_pole/lib/libncurses.dylib /opt/homebrew/anaconda3/envs/cart_pole/lib/libgsl.dylib /opt/homebrew/anaconda3/envs/cart_pole/lib/libgslcblas.dylib /opt/homebrew/anaconda3/envs/cart_pole/lib/libomp.dylib\u001b[0m\n", + "\u001b[0m\u001b[0m\n", + "\u001b[0m-------------------------------------------------------\u001b[0m\n", + "\u001b[0m\u001b[0m\n", + "\u001b[0mYou can now build and install 'nestml_df7b0c900d264482ae57d78cfc3bbf9d_module' using\u001b[0m\n", + "\u001b[0m make\u001b[0m\n", + "\u001b[0m make install\u001b[0m\n", + "\u001b[0m\u001b[0m\n", + "\u001b[0mThe library file libnestml_df7b0c900d264482ae57d78cfc3bbf9d_module.so will be installed to\u001b[0m\n", + "\u001b[0m /var/folders/3h/2lc1zrkd375b1l0m8zcfj6440000gn/T/nestml_target_js274c83\u001b[0m\n", + "\u001b[0mThe module can be loaded into NEST using\u001b[0m\n", + "\u001b[0m (nestml_df7b0c900d264482ae57d78cfc3bbf9d_module) Install (in SLI)\u001b[0m\n", + "\u001b[0m nest.Install(nestml_df7b0c900d264482ae57d78cfc3bbf9d_module) (in PyNEST)\u001b[0m\n", + "\u001b[0m\u001b[0m\n", + "\u001b[33mCMake Warning (dev) in CMakeLists.txt:\n", + " No cmake_minimum_required command is present. A line of code such as\n", + "\n", + " cmake_minimum_required(VERSION 3.31)\n", + "\n", + " should be added at the top of the file. The version specified may be lower\n", + " if you wish to support older CMake versions for this project. For more\n", + " information run \"cmake --help-policy CMP0000\".\n", + "This warning is for project developers. Use -Wno-dev to suppress it.\n", + "\u001b[0m\n", + "-- Configuring done (0.4s)\n", + "-- Generating done (0.0s)\n", + "-- Build files have been written to: /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target\n", + "[ 25%] \u001b[32mBuilding CXX object CMakeFiles/nestml_df7b0c900d264482ae57d78cfc3bbf9d_module_module.dir/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.o\u001b[0m\n", + "[ 75%] \u001b[32mBuilding CXX object CMakeFiles/nestml_df7b0c900d264482ae57d78cfc3bbf9d_module_module.dir/nestml_df7b0c900d264482ae57d78cfc3bbf9d_module.o\u001b[0m\n", + "[ 75%] \u001b[32mBuilding CXX object CMakeFiles/nestml_df7b0c900d264482ae57d78cfc3bbf9d_module_module.dir/iaf_psc_exp_neuron_nestml.o\u001b[0m\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml.cpp:191:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 191 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "In file included from /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.cpp:44:\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.h:251:8: warning: 'register_stdp_connection' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]\n", + " 251 | void register_stdp_connection( double t_first_read, double delay );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/node.h:482:16: note: overridden virtual function is here\n", + " 482 | virtual void register_stdp_connection( double, double );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml.cpp:271:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 271 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml.cpp:328:10: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 328 | auto get_t = [origin, lag](){ return nest::Time( nest::Time::step( origin.get_steps() + lag + 1) ).get_ms(); };\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml.cpp:322:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 322 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml.cpp:496:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 496 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function \n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.cpp:201:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 201 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.cpp:290:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 290 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.cpp:347:77: warning: unused variable 'node' [-Wunused-variable]\n", + " 347 | const iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml& node = *( reinterpret_cast< iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml* >( pnode ) );\n", + " | ^~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.cpp:366:10: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 366 | auto get_t = [origin, lag](){ return nest::Time( nest::Time::step( origin.get_steps() + lag + 1) ).get_ms(); };\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.cpp:360:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 360 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.cpp:537:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 537 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function \n", + " | ^~~~~~~~~~\n", + "In file included from /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/nestml_df7b0c900d264482ae57d78cfc3bbf9d_module.cpp:33:\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml.h:251:8: warning: 'register_stdp_connection' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]\n", + " 251 | void register_stdp_connection( double t_first_read, double delay );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/node.h:482:16: note: overridden virtual function is here\n", + " 482 | virtual void register_stdp_connection( double, double );\n", + " | ^\n", + "In file included from /Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/nestml_df7b0c900d264482ae57d78cfc3bbf9d_module.cpp:36:\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:429:18: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 429 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:452:12: warning: variable 'timestep' set but not used [-Wunused-but-set-variable]\n", + " 452 | double timestep = 0;\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:716:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 716 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:728:16: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 728 | const double __timestep = nest::Time::get_resolution().get_ms(); // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:792:18: warning: unused variable '__timestep' [-Wunused-variable]\n", + " 792 | const double __timestep = timestep; // do not remove, this is necessary for the timestep() function\n", + " | ^~~~~~~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:431:10: warning: unused variable 'get_thread' [-Wunused-variable]\n", + " 431 | auto get_thread = [tid]()\n", + " | ^~~~~~~~~~\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_base.h:391:18: note: in instantiation of member function 'nest::neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml::send' requested here\n", + " 391 | C_[ lcid ].send( e, tid, cp );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_base.h:227:12: note: in instantiation of member function 'nest::Connector>::send_to_all' requested here\n", + " 227 | explicit Connector( const synindex syn_id )\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:311:45: note: in instantiation of member function 'nest::Connector>::Connector' requested here\n", + " 311 | thread_local_connectors[ syn_id ] = new Connector< ConnectionT >( syn_id );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:292:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection_' requested here\n", + " 292 | add_connection_( src, tgt, thread_local_connectors, syn_id, connection, actual_receptor_type );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model.h:162:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection' requested here\n", + " 162 | GenericConnectorModel( const std::string name )\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/model_manager_impl.h:62:9: note: in instantiation of member function 'nest::GenericConnectorModel>::GenericConnectorModel' requested here\n", + " 62 | new GenericConnectorModel< ConnectionT< TargetIdentifierPtrRport > >( \"dummy\" );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/nest_impl.h:37:26: note: in instantiation of function template specialization 'nest::ModelManager::register_connection_model' requested here\n", + " 37 | kernel().model_manager.register_connection_model< ConnectorModelT >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:600:9: note: in instantiation of function template specialization 'nest::register_connection_model' requested here\n", + " 600 | nest::register_connection_model< neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:504:14: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 504 | auto get_t = [t_hist_entry_ms](){ return t_hist_entry_ms; }; // do not remove, this is in case the predefined time variable ``t`` is used in the NESTML model\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:533:12: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 533 | auto get_t = [__t_spike](){ return __t_spike; }; // do not remove, this is in case the predefined time variable ``t`` is used in the NESTML model\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:574:12: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 574 | auto get_t = [__t_spike](){ return __t_spike; }; // do not remove, this is in case the predefined time variable ``t`` is used in the NESTML model\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:793:10: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 793 | auto get_t = [t_start](){ return t_start; }; // do not remove, this is in case the predefined time variable ``t`` is used in the NESTML model\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:499:9: note: in instantiation of member function 'nest::neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml::update_internal_state_' requested here\n", + " 499 | update_internal_state_(t_lastspike_, (start->t_ + __dendritic_delay) - t_lastspike_, cp);\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_base.h:391:18: note: in instantiation of member function 'nest::neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml::send' requested here\n", + " 391 | C_[ lcid ].send( e, tid, cp );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_base.h:227:12: note: in instantiation of member function 'nest::Connector>::send_to_all' requested here\n", + " 227 | explicit Connector( const synindex syn_id )\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:311:45: note: in instantiation of member function 'nest::Connector>::Connector' requested here\n", + " 311 | thread_local_connectors[ syn_id ] = new Connector< ConnectionT >( syn_id );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:292:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection_' requested here\n", + " 292 | add_connection_( src, tgt, thread_local_connectors, syn_id, connection, actual_receptor_type );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model.h:162:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection' requested here\n", + " 162 | GenericConnectorModel( const std::string name )\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/model_manager_impl.h:62:9: note: in instantiation of member function 'nest::GenericConnectorModel>::GenericConnectorModel' requested here\n", + " 62 | new GenericConnectorModel< ConnectionT< TargetIdentifierPtrRport > >( \"dummy\" );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/nest_impl.h:37:26: note: in instantiation of function template specialization 'nest::ModelManager::register_connection_model' requested here\n", + " 37 | kernel().model_manager.register_connection_model< ConnectorModelT >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:600:9: note: in instantiation of function template specialization 'nest::register_connection_model' requested here\n", + " 600 | nest::register_connection_model< neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:417:7: warning: expression result unused [-Wunused-value]\n", + " 417 | dynamic_cast< iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml& >(t);\n", + " | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:316:14: note: in instantiation of member function 'nest::neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml::check_connection' requested here\n", + " 316 | connection.check_connection( src, tgt, receptor_type, get_common_properties() );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:292:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection_' requested here\n", + " 292 | add_connection_( src, tgt, thread_local_connectors, syn_id, connection, actual_receptor_type );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model.h:162:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection' requested here\n", + " 162 | GenericConnectorModel( const std::string name )\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/model_manager_impl.h:62:9: note: in instantiation of member function 'nest::GenericConnectorModel>::GenericConnectorModel' requested here\n", + " 62 | new GenericConnectorModel< ConnectionT< TargetIdentifierPtrRport > >( \"dummy\" );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/nest_impl.h:37:26: note: in instantiation of function template specialization 'nest::ModelManager::register_connection_model' requested here\n", + " 37 | kernel().model_manager.register_connection_model< ConnectorModelT >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:600:9: note: in instantiation of function template specialization 'nest::register_connection_model' requested here\n", + " 600 | nest::register_connection_model< neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:431:10: warning: unused variable 'get_thread' [-Wunused-variable]\n", + " 431 | auto get_thread = [tid]()\n", + " | ^~~~~~~~~~\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_base.h:391:18: note: in instantiation of member function 'nest::neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml::send' requested here\n", + " 391 | C_[ lcid ].send( e, tid, cp );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_base.h:227:12: note: in instantiation of member function 'nest::Connector>::send_to_all' requested here\n", + " 227 | explicit Connector( const synindex syn_id )\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:311:45: note: in instantiation of member function 'nest::Connector>::Connector' requested here\n", + " 311 | thread_local_connectors[ syn_id ] = new Connector< ConnectionT >( syn_id );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:292:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection_' requested here\n", + " 292 | add_connection_( src, tgt, thread_local_connectors, syn_id, connection, actual_receptor_type );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model.h:162:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection' requested here\n", + " 162 | GenericConnectorModel( const std::string name )\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/model_manager_impl.h:103:38: note: in instantiation of member function 'nest::GenericConnectorModel>::GenericConnectorModel' requested here\n", + " 103 | ConnectorModel* conn_model = new GenericConnectorModel< CompleteConnectionT >( name );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/model_manager_impl.h:67:5: note: in instantiation of function template specialization 'nest::ModelManager::register_specific_connection_model_>' requested here\n", + " 67 | register_specific_connection_model_< ConnectionT< TargetIdentifierIndex > >( name + \"_hpc\" );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/nest_impl.h:37:26: note: in instantiation of function template specialization 'nest::ModelManager::register_connection_model' requested here\n", + " 37 | kernel().model_manager.register_connection_model< ConnectorModelT >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:600:9: note: in instantiation of function template specialization 'nest::register_connection_model' requested here\n", + " 600 | nest::register_connection_model< neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:504:14: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 504 | auto get_t = [t_hist_entry_ms](){ return t_hist_entry_ms; }; // do not remove, this is in case the predefined time variable ``t`` is used in the NESTML model\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:533:12: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 533 | auto get_t = [__t_spike](){ return __t_spike; }; // do not remove, this is in case the predefined time variable ``t`` is used in the NESTML model\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:574:12: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 574 | auto get_t = [__t_spike](){ return __t_spike; }; // do not remove, this is in case the predefined time variable ``t`` is used in the NESTML model\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:793:10: warning: unused variable 'get_t' [-Wunused-variable]\n", + " 793 | auto get_t = [t_start](){ return t_start; }; // do not remove, this is in case the predefined time variable ``t`` is used in the NESTML model\n", + " | ^~~~~\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:499:9: note: in instantiation of member function 'nest::neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml::update_internal_state_' requested here\n", + " 499 | update_internal_state_(t_lastspike_, (start->t_ + __dendritic_delay) - t_lastspike_, cp);\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_base.h:391:18: note: in instantiation of member function 'nest::neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml::send' requested here\n", + " 391 | C_[ lcid ].send( e, tid, cp );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_base.h:227:12: note: in instantiation of member function 'nest::Connector>::send_to_all' requested here\n", + " 227 | explicit Connector( const synindex syn_id )\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:311:45: note: in instantiation of member function 'nest::Connector>::Connector' requested here\n", + " 311 | thread_local_connectors[ syn_id ] = new Connector< ConnectionT >( syn_id );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:292:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection_' requested here\n", + " 292 | add_connection_( src, tgt, thread_local_connectors, syn_id, connection, actual_receptor_type );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model.h:162:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection' requested here\n", + " 162 | GenericConnectorModel( const std::string name )\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/model_manager_impl.h:103:38: note: in instantiation of member function 'nest::GenericConnectorModel>::GenericConnectorModel' requested here\n", + " 103 | ConnectorModel* conn_model = new GenericConnectorModel< CompleteConnectionT >( name );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/model_manager_impl.h:67:5: note: in instantiation of function template specialization 'nest::ModelManager::register_specific_connection_model_>' requested here\n", + " 67 | register_specific_connection_model_< ConnectionT< TargetIdentifierIndex > >( name + \"_hpc\" );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/nest_impl.h:37:26: note: in instantiation of function template specialization 'nest::ModelManager::register_connection_model' requested here\n", + " 37 | kernel().model_manager.register_connection_model< ConnectorModelT >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:600:9: note: in instantiation of function template specialization 'nest::register_connection_model' requested here\n", + " 600 | nest::register_connection_model< neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:417:7: warning: expression result unused [-Wunused-value]\n", + " 417 | dynamic_cast< iaf_psc_exp_neuron_nestml__with_neuromodulated_stdp_synapse_nestml& >(t);\n", + " | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:316:14: note: in instantiation of member function 'nest::neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml::check_connection' requested here\n", + " 316 | connection.check_connection( src, tgt, receptor_type, get_common_properties() );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model_impl.h:292:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection_' requested here\n", + " 292 | add_connection_( src, tgt, thread_local_connectors, syn_id, connection, actual_receptor_type );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/connector_model.h:162:3: note: in instantiation of member function 'nest::GenericConnectorModel>::add_connection' requested here\n", + " 162 | GenericConnectorModel( const std::string name )\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/model_manager_impl.h:103:38: note: in instantiation of member function 'nest::GenericConnectorModel>::GenericConnectorModel' requested here\n", + " 103 | ConnectorModel* conn_model = new GenericConnectorModel< CompleteConnectionT >( name );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/model_manager_impl.h:67:5: note: in instantiation of function template specialization 'nest::ModelManager::register_specific_connection_model_>' requested here\n", + " 67 | register_specific_connection_model_< ConnectionT< TargetIdentifierIndex > >( name + \"_hpc\" );\n", + " | ^\n", + "/opt/homebrew/anaconda3/envs/cart_pole/include/nest/nest_impl.h:37:26: note: in instantiation of function template specialization 'nest::ModelManager::register_connection_model' requested here\n", + " 37 | kernel().model_manager.register_connection_model< ConnectorModelT >( name );\n", + " | ^\n", + "/Users/alexiswisniewski/Library/Mobile Documents/com~apple~CloudDocs/Uni/Work/nestml/doc/tutorials/cart_pole_reinforcement_learning/target/neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml.h:600:9: note: in instantiation of function template specialization 'nest::register_connection_model' requested here\n", + " 600 | nest::register_connection_model< neuromodulated_stdp_synapse_nestml__with_iaf_psc_exp_neuron_nestml >( name );\n", + " | ^\n", + "5 warnings generated.\n", + "7 warnings generated.\n", + "18 warnings generated.\n", + "[100%] \u001b[32m\u001b[1mLinking CXX shared module nestml_df7b0c900d264482ae57d78cfc3bbf9d_module.so\u001b[0m\n", + "[100%] Built target nestml_df7b0c900d264482ae57d78cfc3bbf9d_module_module\n", + "[100%] Built target nestml_df7b0c900d264482ae57d78cfc3bbf9d_module_module\n", + "\u001b[36mInstall the project...\u001b[0m\n", + "-- Install configuration: \"\"\n", + "-- Installing: /var/folders/3h/2lc1zrkd375b1l0m8zcfj6440000gn/T/nestml_target_js274c83/nestml_df7b0c900d264482ae57d78cfc3bbf9d_module.so\n" + ] + } + ], + "source": [ + "# ... generate NESTML model code...\n", + "\n", + "from pynestml.codegeneration.nest_code_generator_utils import NESTCodeGeneratorUtils\n", + "\n", + "# generate and build code\n", + "input_layer_module_name, input_layer_neuron_model_name = \\\n", + " NESTCodeGeneratorUtils.generate_code_for(\"../../../models/neurons/ignore_and_fire_neuron.nestml\")\n", + "\n", + "# ignore_and_fire\n", + "output_layer_module_name, output_layer_neuron_model_name, output_layer_synapse_model_name = \\\n", + " NESTCodeGeneratorUtils.generate_code_for(\"iaf_psc_exp_neuron.nestml\",\n", + " \"neuromodulated_stdp_synapse.nestml\",\n", + " post_ports=[\"post_spikes\"],\n", + " logging_level=\"DEBUG\",\n", + " codegen_opts={\"delay_variable\": {\"neuromodulated_stdp_synapse\": \"d\"},\n", + " \"weight_variable\": {\"neuromodulated_stdp_synapse\": \"w\"}})\n" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "id": "99614c94", + "metadata": {}, + "outputs": [], + "source": [ + "import nest\n", + "import json\n", + "import os\n", + "import enum\n", + "\n", + "nest.set_verbosity(\"M_ERROR\")\n", + "\n", + "class AgentAction(enum.Enum):\n", + " FAILURE = -1\n", + " LEFT = 0\n", + " RIGHT = 1\n", + "\n", + "class SpikingAgent(Agent):\n", + " cycle_period = 40. # [ms], corresponding to 2 physics steps\n", + " \n", + " def __init__(self, initial_state: Tuple[float,float,float,float], gamma) -> None:\n", + " super().__init__(initial_state)\n", + " self.gamma = gamma\n", + " self.construct_neural_network()\n", + " self.Q_left = 0.\n", + " self.Q_right = 0.\n", + " self.Q_left_prev = 0.\n", + " self.Q_right_prev = 0.\n", + " self.scale_n_output_spikes_to_Q_value = 0.1\n", + " self.dopamine_left = 0.\n", + " self.dopamine_right = 0.\n", + " self.last_action_chosen = AgentAction.LEFT # ?! choose first action randomly\n", + " self.R = 1. # reward -- always 1!\n", + "\n", + " def get_state_neuron(self, state) -> int:\n", + " idx = 0\n", + " thresholds = [self.x_thresholds, self.theta_thresholds, self.v_thresholds, self.w_thresholds]\n", + " for dim, val, thresh in zip(self.dimensions, state, thresholds):\n", + " i = self.discretize(val,thresh)\n", + " if i == -1:\n", + " return -1\n", + " idx = idx * dim + i\n", + "\n", + " return idx\n", + " \n", + " def get_state_from_id(self, idx) -> None:\n", + " assert idx >= 0 and idx < len(self.input_population)\n", + " state = [-1,-1,-1,-1]\n", + " for i in reversed(range(len(state))):\n", + " state[i] = idx % self.dimensions[i]\n", + " idx = idx // self.dimensions[i]\n", + " return tuple(state)\n", + " \n", + " def construct_neural_network(self):\n", + " nest.ResetKernel()\n", + " nest.Install(input_layer_module_name) # makes the generated NESTML model available\n", + " nest.Install(output_layer_module_name) # makes the generated NESTML model available\n", + "\n", + " self.input_size = self.dimensions[0] * self.dimensions[1] * self.dimensions[2] * self.dimensions[3]\n", + " self.input_population = nest.Create(input_layer_neuron_model_name, self.input_size)\n", + " \n", + " \n", + " self.output_population_left = nest.Create(output_layer_neuron_model_name, 10)\n", + " self.output_population_right = nest.Create(output_layer_neuron_model_name, 10)\n", + " \n", + " self.spike_recorder_input = nest.Create(\"spike_recorder\")\n", + " nest.Connect(self.input_population, self.spike_recorder_input)\n", + "\n", + " self.multimeter_left = nest.Create('multimeter', 1, {'record_from': ['V_m']})\n", + " nest.Connect(self.multimeter_left, self.output_population_left)\n", + " self.multimeter_right = nest.Create('multimeter', 1, {'record_from': ['V_m']})\n", + " nest.Connect(self.multimeter_right, self.output_population_right)\n", + "\n", + " syn_opts = {\"synapse_model\": output_layer_synapse_model_name,\n", + " \"weight\": 0.1 + nest.random.uniform(min=0.0, max=1.0) * 0.02,\n", + " \"beta\": 0.01,\n", + " \"tau_tr_pre\": 20., # [ms]\n", + " \"tau_tr_post\": 20., # [ms]\n", + " #\"Wmax\": 0.3,\n", + " #\"Wmin\": 0.005,\n", + " \"wtr_max\": 0.1,\n", + " \"wtr_min\": 0.,\n", + " \"pre_trace_increment\": 0.0001,\n", + " \"post_trace_increment\": -1.05E-7}\n", + " \n", + " nest.Connect(self.input_population, self.output_population_left, syn_spec=syn_opts)\n", + " nest.Connect(self.input_population, self.output_population_right, syn_spec=syn_opts)\n", + "\n", + " self.output_population_spike_recorder_left = nest.Create(\"spike_recorder\")\n", + " nest.Connect(self.output_population_left, self.output_population_spike_recorder_left)\n", + "\n", + " self.output_population_spike_recorder_right = nest.Create(\"spike_recorder\")\n", + " nest.Connect(self.output_population_right, self.output_population_spike_recorder_right)\n", + " \n", + " # set default values for prev_syn_wtr_right and left\n", + " syn_right = nest.GetConnections(source=self.input_population, target=self.output_population_right)\n", + " self.prev_syn_wtr_right = syn_right.wtr\n", + " syn_left = nest.GetConnections(source=self.input_population, target=self.output_population_left)\n", + " self.prev_syn_wtr_left = syn_left.wtr\n", + " \n", + " \n", + " #stores important connections in a JSON, can be used to plot features of network\n", + " def save_network(self):\n", + " connection_dictionary = {}\n", + " for input_neuron_id in range(len(self.input_population)):\n", + " neuron = self.input_population[input_neuron_id]\n", + " conn_left = nest.GetConnections(source=neuron, target=self.output_population_left)\n", + " conn_right = nest.GetConnections(source=neuron, target=self.output_population_right)\n", + " state = self.get_state_from_id(input_neuron_id) #state is a tuple of the corresponding bins for each variable indexed at 0\n", + " connection_dictionary[str(state)] = {\"neuron\": neuron.get(),\n", + " \"connection_left\": conn_left.get(),\n", + " \"connection_right\": conn_right.get(),\n", + " }\n", + " #os.makedirs(\"/saved_networks\", exist_ok=True)\n", + " with open(\"saved_networks/network.json\", \"w\") as f:\n", + " json.dump(connection_dictionary, f, indent=4)\n", + "\n", + " def choose_action(self, Q_left, Q_right) -> AgentAction:\n", + " if Q_left > Q_right:\n", + " return AgentAction.LEFT\n", + " \n", + " return AgentAction.RIGHT\n", + "\n", + " def compute_Q_values(self) -> None:\n", + " r\"\"\"The output of the SNN is interpreted as the (scaled) Q values.\"\"\"\n", + " self.Q_left_prev = self.Q_left\n", + " self.Q_right_prev = self.Q_right\n", + "\n", + " n_events_in_last_interval_left = self.output_population_spike_recorder_left.n_events\n", + " n_events_in_last_interval_right = self.output_population_spike_recorder_right.n_events\n", + " self.Q_left = self.scale_n_output_spikes_to_Q_value * n_events_in_last_interval_left\n", + " self.Q_right = self.scale_n_output_spikes_to_Q_value * n_events_in_last_interval_right\n", + "\n", + " # update Q_value using TD-Error with previous Q_value and reward = 0\n", + " # cooldown_time in case the SNN doesn't need 40ms to update\n", + " def failure_reset(self, cooldown_time) -> None:\n", + " # if for some reason the simulation terminates super fast\n", + " if self.Q_left_prev == None and self.Q_right_prev == None:\n", + " return\n", + " # what would we mean by that? negative dopamine is biologically inaccurate\n", + " # inhibitory neuromodulators?\n", + " if self.choose_action(self.Q_left_prev, self.Q_right_prev) == AgentAction.RIGHT:\n", + " syn = nest.GetConnections(source=self.input_population, target=self.output_population_right)\n", + " syn.n = -self.Q_right\n", + " else:\n", + " syn = nest.GetConnections(source=self.input_population, target=self.output_population_left)\n", + " syn.n = -self.Q_left\n", + " nest.Simulate(cooldown_time)\n", + " \n", + " self.episode += 1\n", + "\n", + " def update(self, next_state: Tuple[float,float,float,float]) -> Tuple[int, dict]:\n", + "\n", + " #Reset all spike recorders and multimeters\n", + " #self.multimeter_left.n_events = 0\n", + " #self.multimeter_right.n_events = 0\n", + " #self.spike_recorder_input.n_events = 0\n", + " self.output_population_spike_recorder_left.n_events = 0\n", + " self.output_population_spike_recorder_right.n_events = 0\n", + "\n", + " # make the correct input neuron fire\n", + " self.input_population.firing_rate = 0.\n", + " neuron_id = self.get_state_neuron(next_state)\n", + " \n", + " self.input_population[neuron_id].firing_rate = 5000. # XXX: value not given in Liu&Pan. Got 500 Hz as max freq from BVogler thesis. n.b. 40 ms cycle time. \n", + " \n", + " # if state was a failure\n", + " if neuron_id == -1:\n", + " self.failure_reset(SpikingAgent.cycle_period)\n", + " return AgentAction.FAILURE, None\n", + " \n", + " \n", + " # simulate for one cycle\n", + " nest.Simulate(SpikingAgent.cycle_period)\n", + " \n", + " #passed onto Spiking_Plot_Renderer()\n", + " plot_data = {\n", + " \"input_spikes\": nest.GetStatus(self.spike_recorder_input, keys=\"events\")[0],\n", + " \"multimeter_right_events\": self.multimeter_right.get(\"events\"),\n", + " \"multimeter_left_events\": self.multimeter_left.get(\"events\"),\n", + " \"n_input_neurons\": self.input_size\n", + " }\n", + "\n", + " self.compute_Q_values()\n", + "\n", + " # set new dopamine concentration on the synapses\n", + " # PROBLEM: HOW DO WE HANDLE FAILURE? The physics simulation immediately resets after it.\n", + " # Perhaps run the simulation without spiking to let the weights update? (BVogler)\n", + "\n", + " Q_new = max(self.Q_left, self.Q_right)\n", + " \n", + " if self.last_action_chosen == AgentAction.LEFT:\n", + " Q_old = self.Q_left_prev\n", + " elif self.last_action_chosen == AgentAction.RIGHT:\n", + " Q_old = self.Q_right_prev\n", + " else:\n", + " assert self.last_action_chosen == AgentAction.FAILURE\n", + " \n", + " TD = self.gamma * Q_new + self.R - Q_old\n", + " \n", + " if self.last_action_chosen == AgentAction.RIGHT:\n", + " print(\"last chosen = right\")\n", + " syn = nest.GetConnections(source=self.input_population, target=self.output_population_right)\n", + " syn.w += np.array(syn.beta) * TD * np.array(self.prev_syn_wtr_right)\n", + " else:\n", + " print(\"last chosen = left\")\n", + " assert self.last_action_chosen == AgentAction.LEFT\n", + " syn = nest.GetConnections(source=self.input_population, target=self.output_population_left)\n", + " syn.w += np.array(syn.beta) * TD * np.array(self.prev_syn_wtr_left)\n", + " \n", + "# fig,ax=plt.subplots()\n", + "# ax.plot(np.arange(1200), self.prev_syn_wtr_left)\n", + "# import uuid\n", + "# fig.savefig(\"/tmp/weights_nest\" + str(uuid.uuid4()) + \".png\")\n", + " \n", + " self.last_action_chosen = self.choose_action(self.Q_left, self.Q_right)\n", + " \n", + " return self.last_action_chosen, plot_data \n", + " \n", + " \n", + " def save_prev_syn_wtr(self):\n", + " syn_right = nest.GetConnections(source=self.input_population, target=self.output_population_right)\n", + " self.prev_syn_wtr_right = syn_right.wtr\n", + " syn_left = nest.GetConnections(source=self.input_population, target=self.output_population_left)\n", + " self.prev_syn_wtr_left = syn_left.wtr\n", + " \n", + "# # update Q_value using TD-Error with previous Q_value and reward = 1\n", + "# if self.Q_left_prev != None and self.Q_right_prev != None:\n", + "# if self.choose_action(self.Q_left_prev, self.Q_right_prev) == ...:\n", + "# last_action_chosen = AgentAction....\n", + "# syn = nest.GetConnections(source=self.input_population, target=self.output_population_right)\n", + "# syn.n = self.gamma * self.Q_right + R - self.Q_right_prev\n", + "# self.dopamine_right = syn.n[0] #for displaying stats\n", + "# else:\n", + "# syn = nest.GetConnections(source=self.input_population, target=self.output_population_left)\n", + "# syn.n = self.gamma * self.Q_left + R - self.Q_left_prev\n", + "# self.dopamine_left = syn.n[0] #for displaying stats\n", + " \n", + "# # 0 if action is \"left\", else 1\n" + ] + }, + { + "cell_type": "markdown", + "id": "566fa9c9", + "metadata": {}, + "source": [ + "# Executing spiking version\n", + "\n", + "The main loop looks like this: for every iteration of the loop (for every \"cycle\" or \"step\"):\n", + "\n", + "- set the rate of the input neurons to the current state of the system\n", + "- run the SNN with this input state s_n for a period of time (cycle time, in BVogler's thesis: 40 ms)\n", + "- obtain the Q(sn, a) values, by counting nr of spikes in output population over this cycle period\n", + "- choose action $a_n$ on the basis of Q-values\n", + "- run the environment for the same cycle time (40 ms) to obtain next state $s_{n+1}$\n", + "- compute reward on the basis of the last taken action (????)" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "id": "e4bda6d4", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Automatic pdb calling has been turned OFF\n", + "Dimension of input space: (1, 6, 1, 20)\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = right\n", + "last chosen = left\n", + "last chosen = right\n", + "last chosen = left\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = left\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = left\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = left\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = left\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = right\n", + "last chosen = left\n", + "last chosen = right\n", + "last chosen = left\n", + "last chosen = right\n", + "last chosen = left\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = right\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = left\n", + "last chosen = right\n", + "last chosen = left\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = right\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = left\n", + "last chosen = right\n", + "last chosen = right\n", + "*** SystemExit exception caught in code being profiled. " + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 2542751 function calls (2508685 primitive calls) in 7.673 seconds\n", + "\n", + " Ordered by: internal time\n", + "\n", + " ncalls tottime percall cumtime percall filename:lineno(function)\n", + " 11999 1.943 0.000 1.943 0.000 ll_api.py:81(catching_sli_run)\n", + " 852 1.547 0.002 2.432 0.003 hl_api_types.py:804(get)\n", + " 480 0.524 0.001 1.458 0.003 hl_api_types.py:902(set)\n", + " 219 0.441 0.002 0.452 0.002 backend_agg.py:93(draw_path)\n", + " 12 0.391 0.033 0.391 0.033 {method 'encode' of 'ImagingEncoder' objects}\n", + " 852 0.282 0.000 0.356 0.000 hl_api_helper.py:447(restructure_data)\n", + " 86/0 0.245 0.003 0.000 selectors.py:558(select)\n", + " 86/0 0.210 0.002 0.000 {method 'control' of 'select.kqueue' objects}\n", + " 266/227 0.198 0.001 0.191 0.001 socket.py:632(send)\n", + " 95/0 0.183 0.002 0.000 {built-in method pygame.event.get}\n", + " 950 0.169 0.000 0.169 0.000 {method 'render' of 'pygame.font.Font' objects}\n", + " 372 0.146 0.000 2.538 0.007 hl_api_types.py:774(__getattr__)\n", + " 1077 0.123 0.000 0.676 0.001 lines.py:744(draw)\n", + " 482 0.092 0.000 0.302 0.001 hl_api_connections.py:49(GetConnections)\n", + " 95 0.070 0.001 0.070 0.001 {built-in method pygame.display.flip}\n", + " 1332 0.060 0.000 0.097 0.000 hl_api_simulation.py:255(GetKernelStatus)\n", + " 19/0 0.049 0.003 0.000 backend_agg.py:185(draw_text)\n", + " 962 0.042 0.000 0.068 0.000 hl_api_types.py:645(__init__)\n", + " 109/3 0.040 0.000 0.020 0.007 backend_agg.py:206(get_text_width_height_descent)\n", + " 448284 0.037 0.000 0.037 0.000 {method 'keys' of 'dict' objects}\n", + " 456256 0.037 0.000 0.037 0.000 {method 'append' of 'list' objects}\n", + "638237/638119 0.031 0.000 0.033 0.000 {built-in method builtins.isinstance}\n", + " 15 0.028 0.002 0.028 0.002 {built-in method drawImage}\n", + " 601/12 0.025 0.000 0.001 0.000 backend_agg.py:248(_prepare_font)\n", + " 95 0.023 0.000 0.294 0.003 7730343.py:51(draw_stats)\n", + " 73/6 0.020 0.000 0.023 0.004 events.py:86(_run)\n", + " 7036 0.020 0.000 0.125 0.000 ll_api.py:109(sli_func)\n", + " 6 0.018 0.003 0.018 0.003 {built-in method raise_}\n", + " 12 0.015 0.001 0.016 0.001 backend_agg.py:63(__init__)\n", + " 1 0.015 0.015 0.016 0.016 {built-in method pygame.display.set_mode}\n", + " 11429 0.014 0.000 0.014 0.000 {method 'reduce' of 'numpy.ufunc' objects}\n", + " 55/36 0.014 0.000 0.069 0.002 zmqstream.py:615(_handle_recv)\n", + " 910/1 0.013 0.000 0.009 0.009 text.py:358(_get_layout)\n", + " 8033 0.012 0.000 0.019 0.000 font_manager.py:700(__hash__)\n", + " 526/1 0.012 0.000 0.010 0.010 text.py:926(get_window_extent)\n", + " 56/7 0.012 0.000 0.007 0.001 iostream.py:259(schedule)\n", + " 6 0.010 0.002 0.010 0.002 {method 'copy' of 'ImagingCore' objects}\n", + " 3687 0.009 0.000 0.009 0.000 {built-in method numpy.array}\n", + " 95 0.009 0.000 0.009 0.000 {method 'fill' of 'pygame.surface.Surface' objects}\n", + " 95 0.009 0.000 2.115 0.022 983712435.py:147(update)\n", + " 1 0.008 0.008 0.008 0.008 {built-in method pygame.base.quit}\n", + " 10/0 0.008 0.001 0.000 backend_agg.py:367(copy_from_bbox)\n", + " 90 0.008 0.000 0.012 0.000 hl_api_info.py:318(GetStatus)\n", + " 1122 0.008 0.000 0.069 0.000 hl_api_helper.py:499(get_parameters)\n", + " 7356 0.007 0.000 0.017 0.000 copy.py:61(copy)\n", + "2024/2022 0.007 0.000 0.658 0.000 ll_api.py:213(stack_checker_func)\n", + "2404/1444 0.007 0.000 1.468 0.001 hl_api_types.py:782(__setattr__)\n", + " 408 0.006 0.000 0.044 0.000 ticker.py:2157(_raw_ticks)\n", + "29825/29761 0.006 0.000 0.017 0.000 {built-in method builtins.getattr}\n", + " 514/0 0.006 0.000 0.000 text.py:738(draw)\n", + " 6 0.006 0.001 0.023 0.004 {built-in method processEvents}\n", + " 396 0.006 0.000 0.017 0.000 lines.py:672(recache)\n", + " 950 0.006 0.000 0.006 0.000 {method 'blit' of 'pygame.surface.Surface' objects}\n", + "1952/1591 0.005 0.000 0.012 0.000 transforms.py:2431(get_affine)\n", + " 3951 0.005 0.000 0.005 0.000 {built-in method matplotlib._path.affine_transform}\n", + " 102 0.005 0.000 0.005 0.000 {built-in method _io.open}\n", + " 17136 0.005 0.000 0.011 0.000 __init__.py:778(__getitem__)\n", + " 8 0.005 0.001 0.005 0.001 backend_qt.py:721(_icon)\n", + " 11590 0.005 0.000 0.005 0.000 {method 'copy' of 'numpy.ndarray' objects}\n", + " 942 0.004 0.000 0.008 0.000 ipkernel.py:775(_clean_thread_parent_frames)\n", + " 6/0 0.004 0.001 0.000 backend_qtagg.py:18(paintEvent)\n", + " 204 0.004 0.000 0.131 0.001 axis.py:1287(_update_ticks)\n", + " 1283 0.004 0.000 0.017 0.000 artist.py:1188(_update_props)\n", + " 6 0.004 0.001 0.004 0.001 {built-in method show}\n", + " 15 0.004 0.000 0.004 0.000 {built-in method eraseRect}\n", + " 31161 0.004 0.000 0.004 0.000 {method 'get' of 'dict' objects}\n", + " 3123 0.004 0.000 0.008 0.000 transforms.py:749(__init__)\n", + " 6547 0.004 0.000 0.004 0.000 {built-in method numpy.asarray}\n", + " 1181 0.004 0.000 0.005 0.000 cbook.py:1742(normalize_kwargs)\n", + "18719/15652 0.004 0.000 0.005 0.000 artist.py:315(stale)\n", + " 117 0.004 0.000 0.004 0.000 attrsettr.py:66(_get_attr_opt)\n", + " 4028 0.004 0.000 0.008 0.000 cbook.py:2010(_setattr_cm)\n", + " 4491 0.003 0.000 0.005 0.000 {built-in method builtins.sorted}\n", + " 70/0 0.003 0.000 0.000 base_events.py:1915(_run_once)\n", + " 7293 0.003 0.000 0.005 0.000 transforms.py:1769(__init__)\n", + " 17136 0.003 0.000 0.006 0.000 __init__.py:698(_get)\n", + "28195/24230 0.003 0.000 0.060 0.000 {built-in method builtins.len}\n", + " 110 0.003 0.000 0.003 0.000 {built-in method posix.stat}\n", + " 4375/75 0.003 0.000 0.007 0.000 copy.py:118(deepcopy)\n", + " 1761/0 0.003 0.000 0.000 artist.py:53(draw_wrapper)\n", + " 570 0.003 0.000 0.165 0.000 hl_api_types.py:431(set)\n", + " 17136 0.003 0.000 0.003 0.000 {function RcParams.__getitem__ at 0x12ca4cc20}\n", + "1540/1528 0.003 0.000 0.011 0.000 _base.py:851(_unstale_viewLim)\n", + " 4155 0.003 0.000 0.007 0.000 transforms.py:1886(__init__)\n", + " 3194 0.003 0.000 0.009 0.000 copy.py:247(_reconstruct)\n", + " 20386 0.003 0.000 0.003 0.000 {method 'items' of 'dict' objects}\n", + " 3751 0.003 0.000 0.007 0.000 fromnumeric.py:69(_wrapreduction)\n", + "4772/2201 0.003 0.000 0.004 0.000 transforms.py:164(_invalidate_internal)\n", + "5583/3919 0.003 0.000 0.034 0.000 {built-in method builtins.next}\n", + " 204 0.003 0.000 0.004 0.000 numeric.py:2337(isclose)\n", + " 2028/3 0.003 0.000 0.016 0.005 text.py:65(_get_text_metrics_with_cache)\n", + "13393/8189 0.003 0.000 0.014 0.000 {built-in method builtins.hash}\n", + " 186 0.003 0.000 0.005 0.000 iostream.py:655(write)\n", + " 11573 0.002 0.000 0.003 0.000 transforms.py:110(__init__)\n", + " 17 0.002 0.000 0.019 0.001 backend_agg.py:268(clear)\n", + " 1281 0.002 0.000 0.002 0.000 transforms.py:2917(_interval_contains_close)\n", + " 1615 0.002 0.000 0.007 0.000 fromnumeric.py:41(_wrapit)\n", + " 3951 0.002 0.000 0.009 0.000 transforms.py:1848(transform_affine)\n", + " 1661 0.002 0.000 0.003 0.000 __init__.py:65(check_isinstance)\n", + " 95 0.002 0.000 1.454 0.015 983712435.py:216(save_prev_syn_wtr)\n", + " 29 0.002 0.000 0.080 0.003 socket.py:709(send_multipart)\n", + " 6709 0.002 0.000 0.003 0.000 {built-in method builtins.any}\n", + " 190 0.002 0.000 0.002 0.000 {built-in method pygame.draw.rect}\n", + " 6564 0.002 0.000 0.003 0.000 weakref.py:451(get)\n", + "2075/2072 0.002 0.000 0.005 0.000 cbook.py:348(process)\n", + " 204 0.002 0.000 0.005 0.000 ticker.py:817(_set_format)\n", + " 1188 0.002 0.000 0.004 0.000 transforms.py:1972(rotate)\n", + " 2416 0.002 0.000 0.010 0.000 fromnumeric.py:51(_wrapfunc)\n", + " 2751 0.002 0.000 0.005 0.000 lines.py:1276(set_xdata)\n", + " 438 0.002 0.000 0.004 0.000 transforms.py:2837(nonsingular)\n", + " 1493 0.002 0.000 0.019 0.000 transforms.py:1472(transform)\n", + " 8 0.002 0.000 0.002 0.000 {built-in method setCursor}\n", + " 204 0.002 0.000 0.005 0.000 ticker.py:744(_compute_offset)\n", + " 471 0.002 0.000 0.002 0.000 threading.py:1535(enumerate)\n", + " 400 0.002 0.000 0.002 0.000 _shape_base_impl.py:621(column_stack)\n", + " 1920 0.002 0.000 0.003 0.000 :100(split)\n", + " 408 0.002 0.000 0.003 0.000 _methods.py:99(_clip)\n", + " 641 0.002 0.000 0.010 0.000 font_manager.py:1293(findfont)\n", + " 3746 0.002 0.000 0.002 0.000 {method 'reshape' of 'numpy.ndarray' objects}\n", + " 5218 0.002 0.000 0.075 0.000 hl_api_types.py:305(__len__)\n", + " 2473 0.002 0.000 0.002 0.000 contextlib.py:104(__init__)\n", + " 3194 0.002 0.000 0.002 0.000 {method '__reduce_ex__' of 'object' objects}\n", + " 988 0.002 0.000 0.006 0.000 backend_bases.py:680(__init__)\n", + " 2765 0.002 0.000 0.004 0.000 colors.py:277(to_rgba)\n", + " 6613 0.002 0.000 0.002 0.000 {built-in method builtins.iter}\n", + " 4181 0.002 0.000 0.003 0.000 enum.py:720(__call__)\n", + " 8114 0.002 0.000 0.002 0.000 {built-in method builtins.hasattr}\n", + " 1 0.002 0.002 0.006 0.006 {built-in method exec}\n", + " 3282 0.002 0.000 0.006 0.000 cbook.py:871(get_siblings)\n", + " 1366 0.002 0.000 0.002 0.000 transforms.py:179(set_children)\n", + " 684 0.002 0.000 0.003 0.000 transforms.py:616(translated)\n", + " 4330 0.002 0.000 0.002 0.000 __init__.py:100(check_in_list)\n", + " 1694 0.002 0.000 0.108 0.000 hl_api_types.py:314(get)\n", + " 4891 0.002 0.000 0.002 0.000 {built-in method builtins.max}\n", + " 1203 0.002 0.000 0.010 0.000 transforms.py:804(from_extents)\n", + " 904 0.002 0.000 0.004 0.000 transforms.py:1777(__eq__)\n", + " 1245/675 0.001 0.000 0.166 0.000 hl_api_types.py:607(__setattr__)\n", + " 204 0.001 0.000 0.033 0.000 axis.py:1538(get_minorticklocs)\n", + " 95 0.001 0.000 0.001 0.000 1665476354.py:6(dw_step)\n", + " 1504 0.001 0.000 0.004 0.000 text.py:1292(_preprocess_math)\n", + " 637 0.001 0.000 0.003 0.000 font_manager.py:1586(get_font)\n", + " 844 0.001 0.000 0.008 0.000 axis.py:406(update_position)\n", + " 408 0.001 0.000 0.007 0.000 transforms.py:460(transformed)\n", + " 408 0.001 0.000 0.001 0.000 ticker.py:1982(scale_range)\n", + " 820 0.001 0.000 0.001 0.000 {built-in method builtins.round}\n", + " 5129 0.001 0.000 0.001 0.000 {built-in method numpy.asanyarray}\n", + " 637 0.001 0.000 0.015 0.000 font_manager.py:1363(_find_fonts_by_props)\n", + " 393 0.001 0.000 0.004 0.000 lines.py:717(_transform_path)\n", + " 2935 0.001 0.000 0.001 0.000 {method 'match' of 're.Pattern' objects}\n", + " 5475 0.001 0.000 0.002 0.000 artist.py:723(get_figure)\n", + " 102 0.001 0.000 0.009 0.000 lines.py:287(__init__)\n", + " 204 0.001 0.000 0.014 0.000 axis.py:2591(get_tick_space)\n", + " 8171 0.001 0.000 0.001 0.000 {method 'values' of 'dict' objects}\n", + " 2473 0.001 0.000 0.003 0.000 contextlib.py:299(helper)\n", + " 496 0.001 0.000 0.006 0.000 font_manager.py:656(__init__)\n", + " 6 0.001 0.000 0.393 0.066 ImageFile.py:535(_save)\n", + " 1629 0.001 0.000 0.003 0.000 lines.py:1295(set_ydata)\n", + "4289/2321 0.001 0.000 0.001 0.000 transforms.py:2400()\n", + " 170 0.001 0.000 0.013 0.000 transforms.py:641(union)\n", + " 627 0.001 0.000 0.002 0.000 transforms.py:2040(scale)\n", + " 10816 0.001 0.000 0.001 0.000 artist.py:292(axes)\n", + " 3171 0.001 0.000 0.001 0.000 {method 'update' of 'dict' objects}\n", + " 3846 0.001 0.000 0.003 0.000 font_manager.py:1349()\n", + " 2967 0.001 0.000 0.003 0.000 colors.py:218(_is_nth_color)\n", + " 204 0.001 0.000 0.003 0.000 ticker.py:783(_set_order_of_magnitude)\n", + " 1606 0.001 0.000 0.002 0.000 cbook.py:1324(is_math_text)\n", + " 408 0.001 0.000 0.019 0.000 ticker.py:214(format_ticks)\n", + " 408 0.001 0.000 0.008 0.000 transforms.py:1418(__sub__)\n", + " 578 0.001 0.000 0.002 0.000 font_manager.py:876(set_size)\n", + " 96 0.001 0.000 0.074 0.001 pkgdata.py:45(getResource)\n", + " 204 0.001 0.000 0.013 0.000 axis.py:2821(get_tick_space)\n", + " 3883 0.001 0.000 0.010 0.000 transforms.py:1782(transform)\n", + " 3768 0.001 0.000 0.001 0.000 threading.py:1198(ident)\n", + " 3069 0.001 0.000 0.004 0.000 {method 'max' of 'numpy.ndarray' objects}\n", + " 2967 0.001 0.000 0.015 0.000 font_manager.py:961(copy)\n", + " 667 0.001 0.000 0.030 0.000 hl_api_types.py:232(__getitem__)\n", + " 1281 0.001 0.000 0.004 0.000 ticker.py:608(__call__)\n", + " 8439 0.001 0.000 0.001 0.000 transforms.py:1926(get_matrix)\n", + " 832 0.001 0.000 0.016 0.000 artist.py:1243(_cm_set)\n", + "2473/2057 0.001 0.000 0.013 0.000 contextlib.py:141(__exit__)\n", + " 470 0.001 0.000 0.005 0.000 axis.py:467(update_position)\n", + " 2464 0.001 0.000 0.005 0.000 {method 'min' of 'numpy.ndarray' objects}\n", + " 1856 0.001 0.000 0.005 0.000 fromnumeric.py:3190(min)\n", + " 3768 0.001 0.000 0.001 0.000 hl_api_helper.py:176(is_literal)\n", + " 4683 0.001 0.000 0.001 0.000 _function_base_impl.py:339(iterable)\n", + " 942 0.001 0.000 0.085 0.000 hl_api_types.py:581(__getattr__)\n", + " 4181 0.001 0.000 0.001 0.000 enum.py:1123(__new__)\n", + " 3163 0.001 0.000 0.004 0.000 {built-in method builtins.setattr}\n", + " 2201 0.001 0.000 0.004 0.000 transforms.py:155(invalidate)\n", + " 18 0.001 0.000 0.001 0.000 {built-in method matplotlib._path.is_sorted_and_has_non_nan}\n", + " 1895 0.001 0.000 0.004 0.000 fromnumeric.py:3052(max)\n", + " 1716 0.001 0.000 0.002 0.000 hl_api_helper.py:208(is_iterable)\n", + " 190 0.001 0.000 0.001 0.000 {built-in method pygame.draw.circle}\n", + " 434 0.001 0.000 0.001 0.000 getlimits.py:598(smallest_normal)\n", + " 520 0.001 0.000 0.002 0.000 __init__.py:133(check_shape)\n", + " 95 0.001 0.000 0.001 0.000 {method 'tick' of 'pygame.time.Clock' objects}\n", + " 2602 0.001 0.000 0.014 0.000 font_manager.py:711(__eq__)\n", + " 68 0.001 0.000 0.041 0.001 spines.py:142(get_window_extent)\n", + " 1477 0.001 0.000 0.013 0.000 transforms.py:2408(transform_affine)\n", + " 408 0.001 0.000 0.007 0.000 axis.py:1605(_get_tick_label_size)\n", + " 8670 0.001 0.000 0.001 0.000 font_manager.py:717(get_family)\n", + " 3212 0.001 0.000 0.001 0.000 {method 'count' of 'str' objects}\n", + " 26/3 0.001 0.000 0.013 0.004 session.py:754(send)\n", + " 3194 0.001 0.000 0.001 0.000 copyreg.py:98(__newobj__)\n", + " 3542 0.001 0.000 0.001 0.000 text.py:1275(set_text)\n", + "2473/2057 0.001 0.000 0.016 0.000 contextlib.py:132(__enter__)\n", + " 1 0.001 0.001 0.123 0.123 :1()\n", + " 26/3 0.001 0.000 0.007 0.002 iostream.py:271(send_multipart)\n", + " 95 0.001 0.000 0.001 0.000 7730343.py:39(draw_pole)\n", + " 8033 0.001 0.000 0.001 0.000 font_manager.py:739(get_variant)\n", + " 1289 0.001 0.000 0.002 0.000 ticker.py:550(_format_maybe_minus_and_locale)\n", + " 6 0.001 0.000 0.001 0.000 {method 'close' of '_io.BufferedRandom' objects}\n", + " 1933 0.001 0.000 0.002 0.000 cbook.py:1337(_to_unmasked_float_array)\n", + " 396 0.001 0.000 0.001 0.000 _stride_tricks_impl.py:413(_broadcast_shape)\n", + " 95 0.001 0.000 0.001 0.000 _methods.py:76(_count_reduce_items)\n", + " 29 0.001 0.000 0.134 0.005 iostream.py:276()\n", + " 1094 0.001 0.000 0.019 0.000 artist.py:1237(set)\n", + " 300/75 0.001 0.000 0.007 0.000 copy.py:217(_deepcopy_dict)\n", + " 9078 0.001 0.000 0.001 0.000 font_manager.py:762(get_size)\n", + " 1581 0.001 0.000 0.003 0.000 artist.py:102(_stale_axes_callback)\n", + " 95 0.001 0.000 0.003 0.000 _methods.py:118(_mean)\n", + " 1188 0.001 0.000 0.005 0.000 transforms.py:1995(rotate_deg)\n", + " 702 0.001 0.000 0.002 0.000 transforms.py:2341(__init__)\n", + " 1231 0.001 0.000 0.001 0.000 {method 'format' of 'str' objects}\n", + " 408 0.001 0.000 0.048 0.000 ticker.py:2230(tick_values)\n", + " 396 0.001 0.000 0.002 0.000 _stride_tricks_impl.py:481(broadcast_arrays)\n", + " 55/36 0.001 0.000 0.057 0.002 zmqstream.py:547(_run_callback)\n", + " 33 0.001 0.000 0.018 0.001 axis.py:59(__init__)\n", + " 8033 0.001 0.000 0.001 0.000 font_manager.py:926(get_math_fontfamily)\n", + " 8033 0.001 0.000 0.001 0.000 font_manager.py:768(get_file)\n", + " 8033 0.001 0.000 0.001 0.000 font_manager.py:733(get_style)\n", + " 848 0.001 0.000 0.003 0.000 transforms.py:1832(frozen)\n", + " 1920 0.001 0.000 0.003 0.000 __init__.py:2661(_is_egg_path)\n", + " 233 0.001 0.000 0.002 0.000 artist.py:179(__init__)\n", + " 1504 0.001 0.000 0.001 0.000 text.py:687(_get_wrapped_text)\n", + " 393 0.001 0.000 0.001 0.000 {method 'round' of 'numpy.ndarray' objects}\n", + " 4425 0.001 0.000 0.001 0.000 {built-in method __new__ of type object at 0x104c8f330}\n", + " 187 0.001 0.000 0.025 0.000 patches.py:583(_draw_paths_with_artist_properties)\n", + " 4911 0.001 0.000 0.001 0.000 {built-in method builtins.abs}\n", + " 2112 0.001 0.000 0.004 0.000 __init__.py:1859(_parents)\n", + " 8033 0.001 0.000 0.001 0.000 font_manager.py:745(get_weight)\n", + "1506/1494 0.001 0.000 0.012 0.000 _base.py:865(viewLim)\n", + " 204 0.001 0.000 0.003 0.000 spines.py:235(_adjust_location)\n", + " 637 0.001 0.000 0.001 0.000 backend_agg.py:41(get_hinting_flag)\n", + " 2020 0.001 0.000 0.004 0.000 artist.py:414(pchanged)\n", + " 1 0.001 0.001 0.001 0.001 {built-in method pygame.display.init}\n", + " 8033 0.001 0.000 0.001 0.000 font_manager.py:754(get_stretch)\n", + " 4646 0.001 0.000 0.001 0.000 {method 'lower' of 'str' objects}\n", + " 752 0.001 0.000 0.003 0.000 transforms.py:299(xmin)\n", + " 1107 0.001 0.000 0.009 0.000 transforms.py:795(from_bounds)\n", + " 816 0.001 0.000 0.001 0.000 getlimits.py:697(__init__)\n", + " 916 0.001 0.000 0.003 0.000 transforms.py:2498(composite_transform_factory)\n", + " 3049 0.001 0.000 0.001 0.000 {method 'replace' of 'str' objects}\n", + " 520 0.001 0.000 0.004 0.000 path.py:99(__init__)\n", + " 245 0.001 0.000 0.001 0.000 cbook.py:152(__init__)\n", + " 546 0.001 0.000 0.002 0.000 transforms.py:1612(transform_path_non_affine)\n", + " 408 0.001 0.000 0.052 0.000 ticker.py:2226(__call__)\n", + " 1928 0.001 0.000 0.001 0.000 {method 'startswith' of 'str' objects}\n", + " 1920 0.001 0.000 0.001 0.000 __init__.py:2668(_is_zip_egg)\n", + " 58 0.001 0.000 0.001 0.000 socket.py:780(recv_multipart)\n", + " 4052 0.001 0.000 0.001 0.000 {method 'endswith' of 'str' objects}\n", + " 7149 0.001 0.000 0.001 0.000 {built-in method builtins.id}\n", + " 1486 0.001 0.000 0.001 0.000 figure.py:65(_stale_figure_callback)\n", + " 1902 0.001 0.000 0.001 0.000 hl_api_types.py:665(__len__)\n", + " 1228 0.001 0.000 0.011 0.000 axis.py:2356(getter)\n", + " 6160 0.001 0.000 0.001 0.000 _base.py:855()\n", + " 393 0.001 0.000 0.002 0.000 transforms.py:2751(__init__)\n", + " 95 0.001 0.000 0.003 0.000 7730343.py:19(draw_ground)\n", + " 1680 0.001 0.000 0.001 0.000 {method 'split' of 'str' objects}\n", + " 114 0.001 0.000 0.001 0.000 {method 'write' of '_io.BufferedRandom' objects}\n", + " 1803 0.001 0.000 0.001 0.000 artist.py:448(get_transform)\n", + " 752 0.001 0.000 0.002 0.000 transforms.py:309(xmax)\n", + " 786 0.001 0.000 0.002 0.000 transforms.py:314(ymax)\n", + " 496 0.001 0.000 0.007 0.000 font_manager.py:556(wrapper)\n", + " 1203 0.001 0.000 0.005 0.000 fromnumeric.py:211(reshape)\n", + " 684 0.001 0.000 0.001 0.000 text.py:901(get_unitless_position)\n", + " 939 0.001 0.000 0.001 0.000 path.py:162(_fast_from_codes_and_verts)\n", + " 988 0.001 0.000 0.003 0.000 backend_bases.py:848(set_clip_path)\n", + " 5566 0.001 0.000 0.001 0.000 artist.py:945(get_rasterized)\n", + " 1697 0.001 0.000 0.002 0.000 scale.py:115(get_transform)\n", + " 95 0.001 0.000 0.001 0.000 {built-in method pygame.draw.line}\n", + " 1920 0.001 0.000 0.001 0.000 __init__.py:2676(_is_unpacked_egg)\n", + " 1094 0.001 0.000 0.020 0.000 artist.py:146()\n", + " 117 0.001 0.000 0.005 0.000 attrsettr.py:43(__getattr__)\n", + " 3069 0.001 0.000 0.003 0.000 _methods.py:42(_amax)\n", + " 5566 0.001 0.000 0.001 0.000 artist.py:972(get_agg_filter)\n", + " 1099 0.001 0.000 0.001 0.000 {built-in method _abc._abc_instancecheck}\n", + " 393 0.001 0.000 0.003 0.000 transforms.py:2766(_revalidate)\n", + " 94 0.001 0.000 0.004 0.000 patches.py:800(get_patch_transform)\n", + " 1289 0.001 0.000 0.002 0.000 ticker.py:246(fix_minus)\n", + " 752 0.001 0.000 0.002 0.000 transforms.py:304(ymin)\n", + " 96/0 0.001 0.000 0.000 axis.py:1339(_get_ticklabel_bboxes)\n", + " 6146 0.001 0.000 0.001 0.000 transforms.py:1039(get_points)\n", + " 2464 0.001 0.000 0.004 0.000 _methods.py:46(_amin)\n", + " 4912 0.001 0.000 0.001 0.000 artist.py:853(get_visible)\n", + " 3206 0.001 0.000 0.049 0.000 hl_api_types.py:573(__bool__)\n", + " 988 0.001 0.000 0.007 0.000 backend_bases.py:604(new_gc)\n", + " 374 0.001 0.000 0.001 0.000 879461237.py:39(discretize)\n", + " 3242 0.000 0.000 0.000 0.000 path.py:211(vertices)\n", + " 192 0.000 0.000 0.002 0.000 transforms.py:1108(get_points)\n", + " 1199 0.000 0.000 0.016 0.000 artist.py:1226(_internal_update)\n", + " 1199 0.000 0.000 0.001 0.000 font_manager.py:784(set_family)\n", + " 3991 0.000 0.000 0.001 0.000 {built-in method builtins.issubclass}\n", + " 988 0.000 0.000 0.004 0.000 artist.py:935(_set_gc_clip)\n", + " 192 0.000 0.000 0.010 0.000 __init__.py:411(get_provider)\n", + " 95 0.000 0.000 0.004 0.000 fromnumeric.py:3735(mean)\n", + " 408 0.000 0.000 0.000 0.000 {built-in method numpy.arange}\n", + " 2136 0.000 0.000 0.000 0.000 {method 'rfind' of 'str' objects}\n", + " 419 0.000 0.000 0.000 0.000 {method 'astype' of 'numpy.ndarray' objects}\n", + " 480 0.000 0.000 0.002 0.000 hl_api_types.py:687(__getitem__)\n", + " 1528 0.000 0.000 0.001 0.000 transforms.py:2412(transform_non_affine)\n", + " 112 0.000 0.000 0.001 0.000 encoder.py:205(iterencode)\n", + " 1188 0.000 0.000 0.000 0.000 {method 'tolist' of 'numpy.ndarray' objects}\n", + " 1588 0.000 0.000 0.002 0.000 transforms.py:2248(get_affine)\n", + " 1908 0.000 0.000 0.001 0.000 text.py:1205(set_x)\n", + " 1242 0.000 0.000 0.001 0.000 enum.py:1538(_get_value)\n", + " 735 0.000 0.000 0.001 0.000 lines.py:968(_get_markerfacecolor)\n", + " 204 0.000 0.000 0.014 0.000 ticker.py:735(set_locs)\n", + " 192 0.000 0.000 0.001 0.000 :179(dirname)\n", + " 408 0.000 0.000 0.005 0.000 fromnumeric.py:2241(clip)\n", + " 520 0.000 0.000 0.001 0.000 path.py:202(_update_values)\n", + " 1504 0.000 0.000 0.001 0.000 text.py:284(get_rotation)\n", + " 26/3 0.000 0.000 0.019 0.006 iostream.py:616(_flush)\n", + " 2105 0.000 0.000 0.001 0.000 transforms.py:2120(transform)\n", + " 1632 0.000 0.000 0.001 0.000 transforms.py:1355(_iter_break_from_left_to_right)\n", + " 243 0.000 0.000 0.009 0.000 markers.py:299(_set_marker)\n", + " 80/11 0.000 0.000 0.107 0.010 {method 'run' of '_contextvars.Context' objects}\n", + " 95 0.000 0.000 0.002 0.000 7730343.py:24(draw_car)\n", + " 675 0.000 0.000 0.001 0.000 hl_api_types.py:203(__init__)\n", + " 876 0.000 0.000 0.003 0.000 transforms.py:1340(__add__)\n", + " 91/0 0.000 0.000 0.000 {built-in method builtins.print}\n", + " 2508 0.000 0.000 0.001 0.000 :41(_get_sep)\n", + " 88 0.000 0.000 0.004 0.000 text.py:157(_reset_visual_defaults)\n", + " 920 0.000 0.000 0.002 0.000 {method 'all' of 'numpy.ndarray' objects}\n", + " 1353 0.000 0.000 0.001 0.000 enum.py:202(__get__)\n", + " 768 0.000 0.000 0.000 0.000 transforms.py:329(intervalx)\n", + " 192 0.000 0.000 0.009 0.000 __init__.py:1873(__init__)\n", + " 434 0.000 0.000 0.001 0.000 getlimits.py:493(__new__)\n", + " 192 0.000 0.000 0.001 0.000 __init__.py:3522(_find_adapter)\n", + " 984/628 0.000 0.000 0.002 0.000 transforms.py:2370(_invalidate_internal)\n", + " 150 0.000 0.000 0.001 0.000 artist.py:1167(update_from)\n", + " 720 0.000 0.000 0.000 0.000 transforms.py:338(intervaly)\n", + " 1556 0.000 0.000 0.001 0.000 artist.py:268(convert_xunits)\n", + " 298 0.000 0.000 0.006 0.000 patches.py:307(get_transform)\n", + " 548 0.000 0.000 0.000 0.000 {built-in method _abc._abc_subclasscheck}\n", + " 1615 0.000 0.000 0.000 0.000 {method 'wrap' of 'numpy._core._multiarray_umath._array_converter' objects}\n", + " 238 0.000 0.000 0.001 0.000 enum.py:1545(__or__)\n", + " 496 0.000 0.000 0.001 0.000 font_manager.py:798(set_style)\n", + " 204 0.000 0.000 0.001 0.000 :71(join)\n", + " 1615 0.000 0.000 0.000 0.000 {method 'as_arrays' of 'numpy._core._multiarray_umath._array_converter' objects}\n", + " 988 0.000 0.000 0.000 0.000 backend_bases.py:828(set_antialiased)\n", + " 180 0.000 0.000 0.000 0.000 typing.py:392(inner)\n", + " 393 0.000 0.000 0.001 0.000 markers.py:266(__bool__)\n", + " 1493 0.000 0.000 0.002 0.000 axis.py:753(get_transform)\n", + " 480 0.000 0.000 0.000 0.000 hl_api_helper.py:273(broadcast)\n", + " 1494 0.000 0.000 0.001 0.000 artist.py:280(convert_yunits)\n", + "1818/1794 0.000 0.000 0.001 0.000 transforms.py:2590(get_matrix)\n", + " 192 0.000 0.000 0.001 0.000 __init__.py:1772(_validate_resource_path)\n", + " 95 0.000 0.000 0.001 0.000 983712435.py:30(get_state_neuron)\n", + " 68 0.000 0.000 0.072 0.001 axis.py:2234(_get_tick_boxes_siblings)\n", + " 23 0.000 0.000 0.001 0.000 _linalg.py:496(inv)\n", + " 752 0.000 0.000 0.001 0.000 cbook.py:1861(_str_lower_equal)\n", + " 1732 0.000 0.000 0.000 0.000 {method 'rstrip' of 'str' objects}\n", + " 3146 0.000 0.000 0.000 0.000 figure.py:232(get_figure)\n", + " 1861 0.000 0.000 0.001 0.000 transforms.py:195()\n", + " 124 0.000 0.000 0.001 0.000 transforms.py:365(bounds)\n", + " 55/36 0.000 0.000 0.072 0.002 zmqstream.py:574(_handle_events)\n", + " 1 0.000 0.000 0.037 0.037 983712435.py:16(__init__)\n", + " 2982 0.000 0.000 0.000 0.000 __init__.py:79()\n", + " 1560 0.000 0.000 0.000 0.000 __init__.py:153()\n", + " 496 0.000 0.000 0.001 0.000 font_manager.py:811(set_variant)\n", + " 2218 0.000 0.000 0.000 0.000 {method 'pop' of 'dict' objects}\n", + " 3826 0.000 0.000 0.000 0.000 figure.py:2854(_get_dpi)\n", + " 1585 0.000 0.000 0.001 0.000 backend_bases.py:883(set_foreground)\n", + " 8 0.000 0.000 0.000 0.000 {built-in method addAction}\n", + " 1020 0.000 0.000 0.000 0.000 numeric.py:2429()\n", + " 176 0.000 0.000 0.001 0.000 enum.py:1556(__and__)\n", + " 204 0.000 0.000 0.001 0.000 _methods.py:235(_ptp)\n", + " 28/5 0.000 0.000 0.019 0.004 ioloop.py:742(_run_callback)\n", + " 68 0.000 0.000 0.002 0.000 path.py:607(get_extents)\n", + " 3280 0.000 0.000 0.000 0.000 text.py:915(get_text)\n", + " 192 0.000 0.000 0.001 0.000 __init__.py:1656(__init__)\n", + " 134 0.000 0.000 0.001 0.000 axis.py:711(_get_axis_name)\n", + " 67/2 0.000 0.000 0.016 0.008 text.py:73(_get_text_metrics_with_cache_impl)\n", + " 435 0.000 0.000 0.002 0.000 transforms.py:785(unit)\n", + " 1026 0.000 0.000 0.001 0.000 transforms.py:2208()\n", + " 192 0.000 0.000 0.002 0.000 __init__.py:1762(_fn)\n", + " 3947 0.000 0.000 0.000 0.000 copy.py:102(_copy_immutable)\n", + " 1 0.000 0.000 0.006 0.006 backend_qt.py:676(__init__)\n", + " 2008 0.000 0.000 0.000 0.000 {built-in method math.radians}\n", + " 904 0.000 0.000 0.001 0.000 transforms.py:2216(transform_non_affine)\n", + " 1251 0.000 0.000 0.000 0.000 cbook.py:1850(_str_equal)\n", + " 987 0.000 0.000 0.000 0.000 backend_bases.py:945(get_hatch_path)\n", + " 408 0.000 0.000 0.001 0.000 ticker.py:2025(le)\n", + " 1160 0.000 0.000 0.000 0.000 text.py:1216(set_y)\n", + " 816 0.000 0.000 0.000 0.000 ticker.py:2015(closeto)\n", + " 72 0.000 0.000 0.001 0.000 transforms.py:1057(set)\n", + " 2770 0.000 0.000 0.000 0.000 {built-in method posix.fspath}\n", + " 34 0.000 0.000 0.066 0.002 axis.py:2449(_update_label_position)\n", + " 2066 0.000 0.000 0.000 0.000 transforms.py:1758()\n", + " 800 0.000 0.000 0.000 0.000 copy.py:231(_keep_alive)\n", + " 95 0.000 0.000 0.002 0.000 1665476354.py:26(update)\n", + " 1598 0.000 0.000 0.000 0.000 {built-in method math.cos}\n", + " 702 0.000 0.000 0.000 0.000 {method '__exit__' of '_thread.RLock' objects}\n", + " 358 0.000 0.000 0.002 0.000 markers.py:345(get_transform)\n", + " 577 0.000 0.000 0.001 0.000 backend_bases.py:903(set_joinstyle)\n", + " 920 0.000 0.000 0.002 0.000 _methods.py:67(_all)\n", + " 1393 0.000 0.000 0.003 0.000 figure.py:2857(_set_dpi)\n", + " 820 0.000 0.000 0.001 0.000 core.py:6922(is_masked)\n", + " 1274 0.000 0.000 0.000 0.000 font_manager.py:1610()\n", + " 3008 0.000 0.000 0.000 0.000 text.py:1345(get_usetex)\n", + " 2 0.000 0.000 0.000 0.000 {built-in method time.sleep}\n", + " 58 0.000 0.000 0.135 0.002 iostream.py:157(_handle_event)\n", + " 102 0.000 0.000 0.000 0.000 lines.py:1144(set_linestyle)\n", + " 1099 0.000 0.000 0.001 0.000 :117(__instancecheck__)\n", + " 95 0.000 0.000 0.000 0.000 1665476354.py:16(a_step)\n", + " 264 0.000 0.000 0.000 0.000 {built-in method builtins.min}\n", + " 56 0.000 0.000 0.000 0.000 {method 'isoformat' of 'datetime.datetime' objects}\n", + " 42 0.000 0.000 0.000 0.000 {method '__copy__' of 'numpy.ndarray' objects}\n", + " 192 0.000 0.000 0.008 0.000 __init__.py:1877(_setup_prefix)\n", + " 10/5 0.000 0.000 0.000 0.000 numeric.py:1185(roll)\n", + " 34 0.000 0.000 0.053 0.002 axis.py:2676(_update_label_position)\n", + " 245 0.000 0.000 0.001 0.000 cbook.py:259(__init__)\n", + " 307 0.000 0.000 0.000 0.000 _base.py:569(_axis_map)\n", + " 294 0.000 0.000 0.000 0.000 ticker.py:768()\n", + " 1283 0.000 0.000 0.000 0.000 {built-in method builtins.delattr}\n", + " 425 0.000 0.000 0.000 0.000 traitlets.py:676(__get__)\n", + " 192 0.000 0.000 0.000 0.000 :87(isabs)\n", + " 408 0.000 0.000 0.000 0.000 ticker.py:2032(ge)\n", + " 72 0.000 0.000 0.001 0.000 _base.py:4408(get_children)\n", + " 597 0.000 0.000 0.000 0.000 backend_bases.py:811(set_alpha)\n", + " 22/18 0.000 0.000 0.003 0.000 axis.py:1206(_set_lim)\n", + " 306 0.000 0.000 0.000 0.000 lines.py:1203(_set_markercolor)\n", + " 577 0.000 0.000 0.000 0.000 backend_bases.py:833(set_capstyle)\n", + " 408 0.000 0.000 0.001 0.000 {method 'sum' of 'numpy.ndarray' objects}\n", + " 187 0.000 0.000 0.025 0.000 patches.py:633(draw)\n", + " 570 0.000 0.000 0.000 0.000 7730343.py:15(translate)\n", + " 398 0.000 0.000 0.000 0.000 spines.py:566(__getitem__)\n", + " 204 0.000 0.000 0.027 0.000 axis.py:1655(get_major_ticks)\n", + " 227 0.000 0.000 0.000 0.000 _ufunc_config.py:440(__enter__)\n", + " 140/132 0.000 0.000 0.000 0.000 spines.py:340(get_spine_transform)\n", + " 3350 0.000 0.000 0.000 0.000 copy.py:172(_deepcopy_atomic)\n", + " 204 0.000 0.000 0.028 0.000 axis.py:1534(get_majorticklocs)\n", + " 104 0.000 0.000 0.000 0.000 {method 'searchsorted' of 'numpy.ndarray' objects}\n", + " 408 0.000 0.000 0.000 0.000 {method 'nonzero' of 'numpy.ndarray' objects}\n", + " 573 0.000 0.000 0.000 0.000 {built-in method builtins.all}\n", + " 408 0.000 0.000 0.003 0.000 {method 'clip' of 'numpy.ndarray' objects}\n", + " 1992 0.000 0.000 0.000 0.000 multiarray.py:761(dot)\n", + " 503 0.000 0.000 0.000 0.000 {method 'ravel' of 'numpy.ndarray' objects}\n", + " 979 0.000 0.000 0.000 0.000 {built-in method math.log10}\n", + " 204 0.000 0.000 0.001 0.000 fromnumeric.py:2962(ptp)\n", + " 1598 0.000 0.000 0.000 0.000 {built-in method math.sin}\n", + " 56 0.000 0.000 0.000 0.000 iostream.py:710(_flush_buffers)\n", + " 17 0.000 0.000 0.000 0.000 {built-in method update}\n", + " 955 0.000 0.000 0.000 0.000 transforms.py:1773(__array__)\n", + " 2695 0.000 0.000 0.000 0.000 transforms.py:1808(get_affine)\n", + " 359 0.000 0.000 0.003 0.000 transforms.py:2779(get_transformed_points_and_affine)\n", + " 725 0.000 0.000 0.001 0.000 font_manager.py:677(_from_any)\n", + " 229 0.000 0.000 0.000 0.000 transforms.py:353(height)\n", + " 15 0.000 0.000 0.000 0.000 figure.py:3108(set_size_inches)\n", + " 492 0.000 0.000 0.001 0.000 font_manager.py:1154(get_default_size)\n", + " 820 0.000 0.000 0.000 0.000 core.py:1408(getmask)\n", + " 393 0.000 0.000 0.001 0.000 fromnumeric.py:3618(round)\n", + " 80/34 0.000 0.000 0.001 0.000 units.py:164(get_converter)\n", + " 425 0.000 0.000 0.000 0.000 traitlets.py:629(get)\n", + " 112 0.000 0.000 0.001 0.000 __init__.py:183(dumps)\n", + " 504 0.000 0.000 0.000 0.000 font_manager.py:824(set_weight)\n", + " 1907 0.000 0.000 0.000 0.000 {built-in method builtins.callable}\n", + " 1026 0.000 0.000 0.000 0.000 transforms.py:2676(get_matrix)\n", + " 219 0.000 0.000 0.001 0.000 lines.py:648(set_data)\n", + " 168 0.000 0.000 0.001 0.000 markers.py:250(_recache)\n", + " 28 0.000 0.000 0.002 0.000 session.py:690(serialize)\n", + " 90 0.000 0.000 0.008 0.000 983712435.py:119(compute_Q_values)\n", + " 96 0.000 0.000 0.011 0.000 __init__.py:1359(resource_exists)\n", + " 188 0.000 0.000 0.000 0.000 transforms.py:2027(translate)\n", + " 97 0.000 0.000 0.001 0.000 transforms.py:2575(__init__)\n", + " 102 0.000 0.000 0.003 0.000 :16(exists)\n", + " 17 0.000 0.000 0.002 0.000 figure.py:156(_get_draw_artists)\n", + " 6 0.000 0.000 0.394 0.066 PngImagePlugin.py:1300(_save)\n", + " 28 0.000 0.000 0.000 0.000 {built-in method now}\n", + " 138 0.000 0.000 0.001 0.000 transforms.py:779(frozen)\n", + " 1637 0.000 0.000 0.000 0.000 path.py:223(codes)\n", + " 136 0.000 0.000 0.012 0.000 spines.py:293(draw)\n", + " 243 0.000 0.000 0.009 0.000 markers.py:220(__init__)\n", + " 393 0.000 0.000 0.002 0.000 lines.py:732(_get_transformed_path)\n", + " 1451 0.000 0.000 0.000 0.000 artist.py:608(get_gid)\n", + " 5 0.000 0.000 0.000 0.000 {built-in method activateWindow}\n", + " 96 0.000 0.000 0.005 0.000 __init__.py:1902(get_resource_stream)\n", + " 359 0.000 0.000 0.000 0.000 lines.py:942(get_markeredgecolor)\n", + " 32 0.000 0.000 0.017 0.001 backend_agg.py:387(get_renderer)\n", + " 95 0.000 0.000 0.070 0.001 7730343.py:86(display)\n", + " 816 0.000 0.000 0.000 0.000 {built-in method builtins.divmod}\n", + " 20 0.000 0.000 0.000 0.000 {built-in method matplotlib._path.point_in_path}\n", + " 2024 0.000 0.000 0.000 0.000 ll_api.py:165(get_debug)\n", + " 22 0.000 0.000 0.015 0.001 axis.py:367(__init__)\n", + " 358 0.000 0.000 0.000 0.000 markers.py:290(get_joinstyle)\n", + " 1856 0.000 0.000 0.000 0.000 fromnumeric.py:3185(_min_dispatcher)\n", + " 1895 0.000 0.000 0.000 0.000 fromnumeric.py:3047(_max_dispatcher)\n", + " 84 0.000 0.000 0.002 0.000 text.py:194(update)\n", + " 496 0.000 0.000 0.000 0.000 font_manager.py:850(set_stretch)\n", + " 204 0.000 0.000 0.000 0.000 spines.py:135(get_patch_transform)\n", + " 8 0.000 0.000 0.000 0.000 {function socket.close at 0x1059a54e0}\n", + " 408 0.000 0.000 0.001 0.000 fromnumeric.py:2018(nonzero)\n", + " 990 0.000 0.000 0.000 0.000 artist.py:720(get_path_effects)\n", + " 1094 0.000 0.000 0.000 0.000 text.py:246(_get_multialignment)\n", + " 232 0.000 0.000 0.001 0.000 artist.py:738(set_figure)\n", + " 408 0.000 0.000 0.000 0.000 ticker.py:2000(__init__)\n", + " 1504 0.000 0.000 0.000 0.000 text.py:602(get_wrap)\n", + " 1504 0.000 0.000 0.000 0.000 text.py:292(get_transform_rotates_text)\n", + " 461 0.000 0.000 0.001 0.000 transforms.py:1869(inverted)\n", + " 400 0.000 0.000 0.000 0.000 _shape_base_impl.py:617(_column_stack_dispatcher)\n", + " 238 0.000 0.000 0.001 0.000 {method 'any' of 'numpy.ndarray' objects}\n", + " 7 0.000 0.000 0.003 0.000 hl_api_connections.py:116(Connect)\n", + " 138 0.000 0.000 0.001 0.000 transforms.py:232(frozen)\n", + " 28 0.000 0.000 0.000 0.000 {method 'copy' of '_hashlib.HMAC' objects}\n", + " 408 0.000 0.000 0.000 0.000 ticker.py:1694(raise_if_exceeds)\n", + " 578 0.000 0.000 0.000 0.000 backend_bases.py:914(set_linewidth)\n", + " 496 0.000 0.000 0.000 0.000 font_manager.py:934(set_math_fontfamily)\n", + " 96 0.000 0.000 0.008 0.000 __init__.py:1379(resource_stream)\n", + " 97 0.000 0.000 0.000 0.000 patches.py:792(_convert_units)\n", + " 32 0.000 0.000 0.000 0.000 transforms.py:359(size)\n", + " 29 0.000 0.000 0.083 0.003 iostream.py:278(_really_send)\n", + " 716 0.000 0.000 0.000 0.000 backend_agg.py:258(points_to_pixels)\n", + " 34 0.000 0.000 0.001 0.000 axis.py:2702(_update_offset_text_position)\n", + " 23 0.000 0.000 0.000 0.000 backend_qt.py:269(mouseEventCoords)\n", + " 70 0.000 0.000 0.001 0.000 _base.py:1149(_set_position)\n", + " 59 0.000 0.000 0.002 0.000 zmqstream.py:654(_rebuild_io_state)\n", + " 59 0.000 0.000 0.000 0.000 queue.py:97(empty)\n", + " 34 0.000 0.000 0.004 0.000 axis.py:2475(_update_offset_text_position)\n", + " 227 0.000 0.000 0.000 0.000 {method 'set' of '_contextvars.ContextVar' objects}\n", + " 243 0.000 0.000 0.000 0.000 markers.py:275(_set_fillstyle)\n", + " 548 0.000 0.000 0.001 0.000 :121(__subclasscheck__)\n", + " 80 0.000 0.000 0.006 0.000 text.py:104(__init__)\n", + " 370 0.000 0.000 0.000 0.000 :911(__iter__)\n", + " 716 0.000 0.000 0.000 0.000 enum.py:1281(name)\n", + " 51 0.000 0.000 0.000 0.000 figure.py:162()\n", + " 199 0.000 0.000 0.000 0.000 base_events.py:733(time)\n", + " 236 0.000 0.000 0.000 0.000 transforms.py:2301(get_matrix)\n", + " 112 0.000 0.000 0.001 0.000 encoder.py:183(encode)\n", + " 393 0.000 0.000 0.001 0.000 transforms.py:2806(get_affine)\n", + " 17 0.000 0.000 0.000 0.000 backend_qt.py:467(draw)\n", + " 50 0.000 0.000 0.001 0.000 _base.py:3666(get_xlim)\n", + " 8 0.000 0.000 0.000 0.000 {method 'connect' of 'PyQt5.QtCore.pyqtBoundSignal' objects}\n", + " 112 0.000 0.000 0.001 0.000 session.py:92(json_packer)\n", + " 1451 0.000 0.000 0.000 0.000 backend_bases.py:157(open_group)\n", + " 1504 0.000 0.000 0.000 0.000 text.py:1361(get_parse_math)\n", + " 204 0.000 0.000 0.000 0.000 axis.py:1681(get_minor_ticks)\n", + " 100 0.000 0.000 0.001 0.000 text.py:995(set_color)\n", + " 96 0.000 0.000 0.005 0.000 __init__.py:1675(has_resource)\n", + " 1203 0.000 0.000 0.000 0.000 fromnumeric.py:206(_reshape_dispatcher)\n", + " 408 0.000 0.000 0.000 0.000 getlimits.py:708(min)\n", + " 400 0.000 0.000 0.000 0.000 shape_base.py:208(_arrays_for_stack_dispatcher)\n", + " 75 0.000 0.000 0.008 0.000 lines.py:1338(update_from)\n", + " 434 0.000 0.000 0.001 0.000 getlimits.py:621(tiny)\n", + " 52/34 0.000 0.000 0.093 0.003 asyncio.py:200(_handle_events)\n", + " 76 0.000 0.000 0.000 0.000 fromnumeric.py:89(_wrapreduction_any_all)\n", + " 30 0.000 0.000 0.000 0.000 traitlets.py:718(_validate)\n", + " 28 0.000 0.000 0.000 0.000 iostream.py:718(_rotate_buffers)\n", + " 186 0.000 0.000 0.000 0.000 iostream.py:550(_is_master_process)\n", + " 204 0.000 0.000 0.000 0.000 patches.py:318(get_patch_transform)\n", + " 95 0.000 0.000 0.009 0.000 7730343.py:47(draw_clear)\n", + " 206 0.000 0.000 0.000 0.000 transforms.py:347(width)\n", + " 28 0.000 0.000 0.000 0.000 session.py:600(msg_id)\n", + " 94 0.000 0.000 0.002 0.000 patches.py:934(get_bbox)\n", + " 1451 0.000 0.000 0.000 0.000 backend_bases.py:164(close_group)\n", + " 202 0.000 0.000 0.001 0.000 colors.py:242(_check_color_like)\n", + " 209 0.000 0.000 0.001 0.000 artist.py:435(set_transform)\n", + " 227 0.000 0.000 0.000 0.000 {method 'reset' of '_contextvars.ContextVar' objects}\n", + " 68 0.000 0.000 0.002 0.000 _base.py:1900(apply_aspect)\n", + " 6 0.000 0.000 0.000 0.000 {built-in method setText}\n", + " 1094 0.000 0.000 0.000 0.000 text.py:317(get_rotation_mode)\n", + " 227 0.000 0.000 0.000 0.000 {built-in method numpy._core._multiarray_umath._make_extobj}\n", + " 100 0.000 0.000 0.223 0.002 hl_api_simulation.py:47(Simulate)\n", + " 955 0.000 0.000 0.000 0.000 path.py:242(simplify_threshold)\n", + " 1281 0.000 0.000 0.000 0.000 axis.py:264(get_loc)\n", + " 987 0.000 0.000 0.000 0.000 backend_bases.py:748(get_clip_path)\n", + " 202 0.000 0.000 0.001 0.000 colors.py:223(is_color_like)\n", + " 408 0.000 0.000 0.001 0.000 _methods.py:50(_sum)\n", + " 186 0.000 0.000 0.000 0.000 iostream.py:505(parent_header)\n", + " 186 0.000 0.000 0.002 0.000 iostream.py:577(_schedule_flush)\n", + " 32 0.000 0.000 0.000 0.000 events.py:36(__init__)\n", + " 25 0.000 0.000 0.001 0.000 _base.py:2578(_process_unit_info)\n", + " 8 0.000 0.000 0.001 0.000 ticker.py:664(format_data_short)\n", + " 36 0.000 0.000 0.001 0.000 PngImagePlugin.py:1113(putchunk)\n", + " 28 0.000 0.000 0.001 0.000 session.py:649(msg)\n", + " 29 0.000 0.000 0.000 0.000 base_events.py:766(call_at)\n", + " 86 0.000 0.000 0.000 0.000 selector_events.py:750(_process_events)\n", + " 204 0.000 0.000 0.000 0.000 ticker.py:237(set_locs)\n", + " 116 0.000 0.000 0.000 0.000 typing.py:1285(__hash__)\n", + " 68 0.000 0.000 0.002 0.000 patches.py:654(get_window_extent)\n", + " 170 0.000 0.000 0.000 0.000 text.py:1259(set_verticalalignment)\n", + " 955 0.000 0.000 0.000 0.000 path.py:254(should_simplify)\n", + " 988 0.000 0.000 0.000 0.000 backend_bases.py:918(set_url)\n", + " 100 0.000 0.000 0.000 0.000 983712435.py:113(choose_action)\n", + " 358 0.000 0.000 0.000 0.000 markers.py:293(get_capstyle)\n", + " 192 0.000 0.000 0.000 0.000 :60(isabs)\n", + " 29 0.000 0.000 0.001 0.000 asyncio.py:210(call_at)\n", + " 28 0.000 0.000 0.000 0.000 {method 'hexdigest' of '_hashlib.HMAC' objects}\n", + " 86 0.000 0.000 0.000 0.000 units.py:56(_is_natively_supported)\n", + " 44 0.000 0.000 0.000 0.000 _base.py:3688(_validate_converted_limits)\n", + " 121 0.000 0.000 0.000 0.000 :1390(_handle_fromlist)\n", + " 40 0.000 0.000 0.000 0.000 transforms.py:2487(get_matrix)\n", + " 637 0.000 0.000 0.000 0.000 {built-in method _thread.get_ident}\n", + " 57 0.000 0.000 0.000 0.000 threading.py:1222(is_alive)\n", + " 696 0.000 0.000 0.000 0.000 {method 'copy' of 'list' objects}\n", + " 802 0.000 0.000 0.000 0.000 markers.py:272(get_fillstyle)\n", + " 136 0.000 0.000 0.000 0.000 text.py:1194(set_position)\n", + " 28 0.000 0.000 0.001 0.000 session.py:675(sign)\n", + " 987 0.000 0.000 0.000 0.000 backend_bases.py:941(get_hatch)\n", + " 1024 0.000 0.000 0.000 0.000 typing.py:2183(cast)\n", + " 59 0.000 0.000 0.002 0.000 zmqstream.py:677(_update_handler)\n", + " 987 0.000 0.000 0.000 0.000 backend_bases.py:800(get_snap)\n", + " 125 0.000 0.000 0.000 0.000 {method '__deepcopy__' of 'numpy.ndarray' objects}\n", + " 987 0.000 0.000 0.000 0.000 backend_bases.py:763(get_dashes)\n", + " 86 0.000 0.000 0.000 0.000 cbook.py:2342(_unpack_to_numpy)\n", + " 88 0.000 0.000 0.002 0.000 text.py:1316(set_fontproperties)\n", + " 174 0.000 0.000 0.000 0.000 text.py:1010(set_horizontalalignment)\n", + " 227 0.000 0.000 0.000 0.000 _ufunc_config.py:456(__exit__)\n", + " 186 0.000 0.000 0.000 0.000 {method 'write' of '_io.StringIO' objects}\n", + " 206/114 0.000 0.000 0.000 0.000 _base.py:928(get_xaxis_transform)\n", + " 165 0.000 0.000 0.000 0.000 axis.py:293(_set_artist_props)\n", + " 6 0.000 0.000 0.000 0.000 inspect.py:2397(_signature_from_function)\n", + " 987 0.000 0.000 0.000 0.000 backend_bases.py:952(get_hatch_color)\n", + " 11 0.000 0.000 0.008 0.001 axis.py:428(__init__)\n", + " 987 0.000 0.000 0.000 0.000 backend_bases.py:960(get_hatch_linewidth)\n", + " 68 0.000 0.000 0.001 0.000 transforms.py:1799(transform_path_affine)\n", + " 12/6 0.000 0.000 0.000 0.000 inspect.py:2501(_signature_from_callable)\n", + " 987 0.000 0.000 0.000 0.000 backend_bases.py:968(get_sketch_params)\n", + " 299 0.000 0.000 0.000 0.000 {built-in method posix.getpid}\n", + " 16 0.000 0.000 0.001 0.000 axis.py:302(_apply_params)\n", + " 102 0.000 0.000 0.000 0.000 lines.py:1409(set_dash_capstyle)\n", + " 33 0.000 0.000 0.024 0.001 axis.py:1596(_get_tick)\n", + " 2 0.000 0.000 0.010 0.005 _base.py:1277(__clear)\n", + " 204 0.000 0.000 0.000 0.000 ticker.py:1816(__call__)\n", + " 192 0.000 0.000 0.000 0.000 inspect.py:748(getmro)\n", + " 988 0.000 0.000 0.000 0.000 backend_bases.py:721(restore)\n", + " 6 0.000 0.000 0.004 0.001 backend_qt.py:327(mouseMoveEvent)\n", + " 496 0.000 0.000 0.000 0.000 font_manager.py:906(set_file)\n", + " 20 0.000 0.000 0.001 0.000 path.py:502(contains_point)\n", + " 408 0.000 0.000 0.000 0.000 getlimits.py:721(max)\n", + " 59 0.000 0.000 0.000 0.000 typing.py:1221(__instancecheck__)\n", + " 162 0.000 0.000 0.000 0.000 transforms.py:239(x0)\n", + " 76 0.000 0.000 0.000 0.000 fromnumeric.py:2477(any)\n", + " 30 0.000 0.000 0.000 0.000 traitlets.py:689(set)\n", + " 28 0.000 0.000 0.000 0.000 traitlets.py:2635(validate)\n", + " 219 0.000 0.000 0.000 0.000 artist.py:622(get_snap)\n", + " 222 0.000 0.000 0.000 0.000 artist.py:1055(set_visible)\n", + " 12 0.000 0.000 0.001 0.000 backend_bases.py:1987(_switch_canvas_and_return_print_method)\n", + " 75 0.000 0.000 0.000 0.000 transforms.py:129(__getstate__)\n", + " 28 0.000 0.000 0.000 0.000 session.py:198(utcnow)\n", + " 238 0.000 0.000 0.000 0.000 _methods.py:58(_any)\n", + " 112 0.000 0.000 0.000 0.000 {method 'update' of '_hashlib.HMAC' objects}\n", + " 268 0.000 0.000 0.000 0.000 axis.py:713()\n", + " 236 0.000 0.000 0.000 0.000 lines.py:75(_scale_dashes)\n", + " 476 0.000 0.000 0.000 0.000 image.py:126()\n", + " 57 0.000 0.000 0.000 0.000 iostream.py:138(_event_pipe)\n", + " 92 0.000 0.000 0.000 0.000 text.py:1227(set_rotation)\n", + " 25 0.000 0.000 0.009 0.000 axis.py:1617(_copy_tick_props)\n", + " 1 0.000 0.000 0.000 0.000 {method 'disable' of '_lsprof.Profiler' objects}\n", + " 450 0.000 0.000 0.000 0.000 copy.py:252()\n", + " 10 0.000 0.000 0.003 0.000 backend_bases.py:1266(__init__)\n", + " 152 0.000 0.000 0.000 0.000 {method 'encode' of 'str' objects}\n", + " 102 0.000 0.000 0.000 0.000 lines.py:1071(set_drawstyle)\n", + " 59 0.000 0.000 0.000 0.000 typing.py:1492(__subclasscheck__)\n", + " 20 0.000 0.000 0.002 0.000 patches.py:179(contains_point)\n", + " 2 0.000 0.000 0.014 0.007 _base.py:579(__init__)\n", + " 71 0.000 0.000 0.000 0.000 patches.py:788(get_path)\n", + " 637 0.000 0.000 0.000 0.000 enum.py:1286(value)\n", + " 102 0.000 0.000 0.000 0.000 lines.py:1129(set_linewidth)\n", + " 29 0.000 0.000 0.000 0.000 base_events.py:742(call_later)\n", + " 40 0.000 0.000 0.000 0.000 {built-in method builtins.locals}\n", + " 8 0.000 0.000 0.000 0.000 {built-in method createMaskFromColor}\n", + " 196 0.000 0.000 0.000 0.000 transforms.py:249(y0)\n", + " 6 0.000 0.000 0.392 0.065 ImageFile.py:563(_encode_tile)\n", + " 50 0.000 0.000 0.001 0.000 text.py:342(update_from)\n", + " 66 0.000 0.000 0.001 0.000 lines.py:1189(set_marker)\n", + " 113 0.000 0.000 0.000 0.000 lines.py:33(_get_dash_pattern)\n", + " 96 0.000 0.000 0.003 0.000 __init__.py:1893(_has)\n", + " 68 0.000 0.000 0.000 0.000 cbook.py:1695(_safe_first_finite)\n", + " 56 0.000 0.000 0.000 0.000 jsonutil.py:107(json_default)\n", + " 192 0.000 0.000 0.000 0.000 __init__.py:3512(_always_object)\n", + " 4 0.000 0.000 0.000 0.000 backend_qt.py:155(prepare_notifier)\n", + " 186 0.000 0.000 0.000 0.000 {method 'get' of '_contextvars.ContextVar' objects}\n", + " 424 0.000 0.000 0.000 0.000 {built-in method math.floor}\n", + " 102 0.000 0.000 0.000 0.000 transforms.py:2421(transform_path_non_affine)\n", + " 408 0.000 0.000 0.000 0.000 fromnumeric.py:2236(_clip_dispatcher)\n", + " 23 0.000 0.000 0.001 0.000 artist.py:784(set_clip_path)\n", + " 68 0.000 0.000 0.000 0.000 transforms.py:2666(__init__)\n", + " 68 0.000 0.000 0.000 0.000 :645(parent)\n", + " 104 0.000 0.000 0.000 0.000 {built-in method numpy.lib.array_utils.normalize_axis_index}\n", + " 646 0.000 0.000 0.000 0.000 artist.py:1140(sticky_edges)\n", + " 5 0.000 0.000 0.000 0.000 1665476354.py:36(reset)\n", + " 40/20 0.000 0.000 0.001 0.000 transforms.py:2361(frozen)\n", + " 11 0.000 0.000 0.001 0.000 patches.py:48(__init__)\n", + " 233 0.000 0.000 0.000 0.000 :1()\n", + " 1 0.000 0.000 0.000 0.000 {built-in method addToolBar}\n", + " 72 0.000 0.000 0.000 0.000 {built-in method zlib.crc32}\n", + " 88 0.000 0.000 0.000 0.000 text.py:1040(set_linespacing)\n", + " 34 0.000 0.000 0.002 0.000 backend_bases.py:2907(_wait_cursor_for_draw_cm)\n", + " 578 0.000 0.000 0.000 0.000 artist.py:661(get_sketch_params)\n", + " 28 0.000 0.000 0.002 0.000 backend_bases.py:1187(_process)\n", + " 88 0.000 0.000 0.000 0.000 core.py:624(filled)\n", + " 16 0.000 0.000 0.004 0.000 axis.py:957(set_tick_params)\n", + " 15 0.000 0.000 0.000 0.000 {built-in method end}\n", + " 30 0.000 0.000 0.000 0.000 traitlets.py:708(__set__)\n", + " 11/0 0.000 0.000 0.000 backend_qt.py:498(_draw_idle)\n", + " 29 0.000 0.000 0.001 0.000 ioloop.py:596(call_later)\n", + " 577 0.000 0.000 0.000 0.000 backend_bases.py:926(set_snap)\n", + " 30 0.000 0.000 0.000 0.000 traitlets.py:727(_cross_validate)\n", + " 74 0.000 0.000 0.000 0.000 :827(values)\n", + " 2 0.000 0.000 0.001 0.000 _base.py:2916(autoscale_view)\n", + " 152 0.000 0.000 0.000 0.000 {method 'append' of 'collections.deque' objects}\n", + " 1 0.000 0.000 0.000 0.000 figure.py:2464(__init__)\n", + " 638 0.000 0.000 0.000 0.000 axis.py:500(locator)\n", + " 28 0.000 0.000 0.001 0.000 session.py:645(msg_header)\n", + " 22 0.000 0.000 0.000 0.000 _base.py:956(get_xaxis_text1_transform)\n", + " 20 0.000 0.000 0.000 0.000 cbook.py:293(connect)\n", + " 410 0.000 0.000 0.000 0.000 backend_agg.py:244(get_canvas_width_height)\n", + " 10 0.000 0.000 0.003 0.000 backend_bases.py:1803(inaxes)\n", + " 29 0.000 0.000 0.000 0.000 events.py:111(__init__)\n", + " 59 0.000 0.000 0.000 0.000 zmqstream.py:533(sending)\n", + " 102 0.000 0.000 0.000 0.000 lines.py:1059(set_color)\n", + " 102 0.000 0.000 0.000 0.000 lines.py:1361(set_dash_joinstyle)\n", + " 148 0.000 0.000 0.000 0.000 {built-in method sys.intern}\n", + " 102 0.000 0.000 0.000 0.000 lines.py:738(set_transform)\n", + " 10 0.000 0.000 0.057 0.006 983712435.py:131(failure_reset)\n", + " 75 0.000 0.000 0.001 0.000 copy.py:225(_deepcopy_method)\n", + " 358 0.000 0.000 0.000 0.000 markers.py:296(get_marker)\n", + " 29 0.000 0.000 0.001 0.000 iostream.py:587(_schedule_in_thread)\n", + " 8 0.000 0.000 0.001 0.000 backend_bases.py:1603(_allow_interrupt)\n", + " 12 0.000 0.000 0.000 0.000 pathlib.py:387(_parse_path)\n", + " 4 0.000 0.000 0.001 0.000 _base.py:2975(handle_single_axis)\n", + " 278 0.000 0.000 0.000 0.000 {method 'extend' of 'list' objects}\n", + " 23 0.000 0.000 0.000 0.000 _linalg.py:148(_commonType)\n", + " 279 0.000 0.000 0.000 0.000 __init__.py:1351(_val_or_rc)\n", + " 28 0.000 0.000 0.000 0.000 {built-in method _heapq.heappop}\n", + " 6 0.000 0.000 0.000 0.000 {method 'flush' of '_io.BufferedRandom' objects}\n", + " 158 0.000 0.000 0.000 0.000 transforms.py:2644(get_matrix)\n", + " 358 0.000 0.000 0.000 0.000 markers.py:374(get_snap_threshold)\n", + " 496 0.000 0.000 0.000 0.000 axis.py:511(formatter)\n", + " 102 0.000 0.000 0.000 0.000 lines.py:1425(set_solid_capstyle)\n", + " 68 0.000 0.000 0.001 0.000 transforms.py:1593(transform_path)\n", + " 288 0.000 0.000 0.000 0.000 artist.py:297(axes)\n", + " 28 0.000 0.000 0.000 0.000 session.py:281(extract_header)\n", + " 102 0.000 0.000 0.000 0.000 lines.py:1377(set_solid_joinstyle)\n", + " 8 0.000 0.000 0.001 0.000 spines.py:35(__init__)\n", + " 50 0.000 0.000 0.001 0.000 _base.py:3616(get_xbound)\n", + " 444 0.000 0.000 0.000 0.000 cbook.py:1633()\n", + " 5 0.000 0.000 0.000 0.000 {singleShot}\n", + " 135 0.000 0.000 0.000 0.000 {method 'upper' of 'str' objects}\n", + " 1 0.000 0.000 0.000 0.000 879461237.py:2(__init__)\n", + " 68 0.000 0.000 0.001 0.000 transforms.py:1602(transform_path_affine)\n", + " 86 0.000 0.000 0.000 0.000 axis.py:1811(convert_units)\n", + " 1 0.000 0.000 0.036 0.036 983712435.py:49(construct_neural_network)\n", + " 4 0.000 0.000 0.001 0.000 axis.py:612(__init__)\n", + " 96 0.000 0.000 0.000 0.000 {built-in method _struct.pack}\n", + " 199 0.000 0.000 0.000 0.000 {built-in method time.monotonic}\n", + " 8 0.000 0.000 0.001 0.000 hl_api_nodes.py:44(Create)\n", + " 408 0.000 0.000 0.000 0.000 multiarray.py:180(concatenate)\n", + " 78 0.000 0.000 0.000 0.000 artist.py:1124(set_zorder)\n", + " 82 0.000 0.000 0.000 0.000 text.py:1108(set_fontsize)\n", + " 12 0.000 0.000 0.000 0.000 inspect.py:3029(__init__)\n", + " 410 0.000 0.000 0.000 0.000 text.py:816(get_color)\n", + " 147 0.000 0.000 0.000 0.000 {built-in method math.copysign}\n", + " 28 0.000 0.000 0.000 0.000 transforms.py:1087(__init__)\n", + " 1 0.000 0.000 0.013 0.013 backend_qt.py:567(__init__)\n", + " 4 0.000 0.000 0.000 0.000 {built-in method _socket.socketpair}\n", + " 136 0.000 0.000 0.000 0.000 _base.py:3055()\n", + " 22 0.000 0.000 0.001 0.000 axis.py:395(_apply_tickdir)\n", + " 56 0.000 0.000 0.000 0.000 jsonutil.py:38(_ensure_tzinfo)\n", + " 75 0.000 0.000 0.000 0.000 transforms.py:134(__setstate__)\n", + " 358 0.000 0.000 0.000 0.000 markers.py:355(get_alt_path)\n", + " 1 0.000 0.000 0.000 0.000 backend_qt.py:226(__init__)\n", + " 2 0.000 0.000 0.000 0.000 backend_bases.py:1709(__init__)\n", + " 410 0.000 0.000 0.000 0.000 backend_bases.py:734(get_antialiased)\n", + " 144 0.000 0.000 0.000 0.000 {method 'popleft' of 'collections.deque' objects}\n", + " 34 0.000 0.000 0.000 0.000 :811(__contains__)\n", + " 30 0.000 0.000 0.000 0.000 _base.py:73(wrapper)\n", + " 5 0.000 0.000 0.000 0.000 pyplot.py:526(_warn_if_gui_out_of_main_thread)\n", + " 2 0.000 0.000 0.000 0.000 gridspec.py:144(get_grid_positions)\n", + " 28 0.000 0.000 0.000 0.000 hmac.py:122(copy)\n", + " 107/59 0.000 0.000 0.000 0.000 _base.py:1010(get_yaxis_transform)\n", + " 29 0.000 0.000 0.000 0.000 {built-in method _heapq.heappush}\n", + " 10 0.000 0.000 0.000 0.000 __init__.py:416(by_key)\n", + " 24 0.000 0.000 0.000 0.000 inspect.py:2743(__init__)\n", + " 2 0.000 0.000 0.136 0.068 image.py:1508(imsave)\n", + " 227 0.000 0.000 0.000 0.000 _ufunc_config.py:430(__init__)\n", + " 72 0.000 0.000 0.000 0.000 PngImagePlugin.py:148(_crc32)\n", + " 6 0.000 0.000 0.002 0.000 backend_bases.py:1384(__init__)\n", + " 410 0.000 0.000 0.000 0.000 artist.py:846(get_alpha)\n", + " 24 0.000 0.000 0.000 0.000 mathtext.py:48(__init__)\n", + " 16 0.000 0.000 0.000 0.000 signal.py:36(_enum_to_int)\n", + " 358 0.000 0.000 0.000 0.000 markers.py:336(get_path)\n", + " 408 0.000 0.000 0.000 0.000 fromnumeric.py:2014(_nonzero_dispatcher)\n", + " 16 0.000 0.000 0.000 0.000 axis.py:1056(_translate_tick_params)\n", + " 88 0.000 0.000 0.000 0.000 text.py:1330(set_usetex)\n", + " 102 0.000 0.000 0.000 0.000 lines.py:1262(set_markersize)\n", + " 393 0.000 0.000 0.000 0.000 fromnumeric.py:3614(_round_dispatcher)\n", + " 68 0.000 0.000 0.000 0.000 ticker.py:708(get_offset)\n", + " 22 0.000 0.000 0.000 0.000 _base.py:983(get_xaxis_text2_transform)\n", + " 140/132 0.000 0.000 0.000 0.000 spines.py:203(_ensure_position_is_set)\n", + " 40 0.000 0.000 0.000 0.000 transforms.py:2452(__init__)\n", + " 42 0.000 0.000 0.000 0.000 __init__.py:168(check_getitem)\n", + " 44 0.000 0.000 0.000 0.000 axis.py:701(_get_shared_axes)\n", + " 75 0.000 0.000 0.002 0.000 path.py:279(__deepcopy__)\n", + " 55 0.000 0.000 0.000 0.000 selectors.py:275(_key_from_fd)\n", + " 33 0.000 0.000 0.000 0.000 axis.py:189(_set_labelrotation)\n", + " 396 0.000 0.000 0.000 0.000 _stride_tricks_impl.py:477(_broadcast_arrays_dispatcher)\n", + " 20 0.000 0.000 0.000 0.000 weakref.py:46(__new__)\n", + " 12 0.000 0.000 0.000 0.000 backend_agg.py:85(_update_methods)\n", + " 59/3 0.000 0.000 0.000 0.000 {method 'acquire' of '_thread.lock' objects}\n", + " 68 0.000 0.000 0.000 0.000 {method 'rpartition' of 'str' objects}\n", + " 102 0.000 0.000 0.000 0.000 lines.py:1247(set_markeredgewidth)\n", + " 102 0.000 0.000 0.000 0.000 lines.py:1227(set_markerfacecolor)\n", + " 359 0.000 0.000 0.000 0.000 lines.py:902(get_drawstyle)\n", + " 96 0.000 0.000 0.000 0.000 1665476354.py:33(get_state)\n", + " 154 0.000 0.000 0.000 0.000 __init__.py:259(__iter__)\n", + " 63 0.000 0.000 0.001 0.000 transforms.py:236(__array__)\n", + " 8 0.000 0.000 0.000 0.000 backend_qt.py:407(_mpl_modifiers)\n", + " 391 0.000 0.000 0.000 0.000 artist.py:594(get_url)\n", + " 102 0.000 0.000 0.000 0.000 lines.py:506(set_pickradius)\n", + " 14 0.000 0.000 0.000 0.000 functools.py:35(update_wrapper)\n", + " 5 0.000 0.000 0.016 0.003 backend_qt.py:643(show)\n", + " 6 0.000 0.000 0.000 0.000 {built-in method PIL._imaging.fill}\n", + " 88 0.000 0.000 0.000 0.000 text.py:1349(set_parse_math)\n", + " 410 0.000 0.000 0.000 0.000 backend_bases.py:586(flipy)\n", + " 112 0.000 0.000 0.000 0.000 encoder.py:105(__init__)\n", + " 62 0.000 0.000 0.000 0.000 cbook.py:2303(_is_torch_array)\n", + " 36 0.000 0.000 0.001 0.000 lines.py:1035(get_path)\n", + " 57 0.000 0.000 0.000 0.000 threading.py:1155(_wait_for_tstate_lock)\n", + " 84 0.000 0.000 0.002 0.000 artist.py:1215(update)\n", + " 74 0.000 0.000 0.000 0.000 spines.py:592(__iter__)\n", + " 358 0.000 0.000 0.000 0.000 lines.py:610(get_markevery)\n", + " 219 0.000 0.000 0.000 0.000 backend_bases.py:853(set_dashes)\n", + " 51 0.000 0.000 0.000 0.000 {method 'remove' of 'list' objects}\n", + " 2 0.000 0.000 0.136 0.068 Image.py:2509(save)\n", + " 68 0.000 0.000 0.000 0.000 _base.py:1097(get_position)\n", + " 12 0.000 0.000 0.000 0.000 :133(_splitext)\n", + " 12 0.000 0.000 0.000 0.000 backend_bases.py:150(__init__)\n", + " 2 0.000 0.000 0.000 0.000 gridspec.py:212(__getitem__)\n", + " 34 0.000 0.000 0.001 0.000 transforms.py:2790(get_transformed_path_and_affine)\n", + " 28 0.000 0.000 0.000 0.000 figure.py:2802(axes)\n", + " 6 0.000 0.000 0.000 0.000 _asarray.py:27(require)\n", + " 102 0.000 0.000 0.000 0.000 lines.py:1047(set_antialiased)\n", + " 5 0.000 0.000 0.000 0.000 numeric.py:1386(normalize_axis_tuple)\n", + " 55 0.000 0.000 0.000 0.000 base_events.py:1900(_add_callback)\n", + " 66 0.000 0.000 0.000 0.000 text.py:1054(set_fontfamily)\n", + " 33 0.000 0.000 0.000 0.000 artist.py:1013(set_alpha)\n", + " 92 0.000 0.000 0.000 0.000 text.py:298(set_rotation_mode)\n", + " 3 0.000 0.000 0.000 0.000 _base.py:396(_plot_args)\n", + " 265 0.000 0.000 0.000 0.000 artist.py:857(get_animated)\n", + " 20 0.000 0.000 0.000 0.000 pathlib.py:358(__init__)\n", + " 128 0.000 0.000 0.000 0.000 backend_bases.py:1893(device_pixel_ratio)\n", + " 68 0.000 0.000 0.000 0.000 :804(get)\n", + " 4 0.000 0.000 0.000 0.000 _function_base_impl.py:1369(diff)\n", + " 16 0.000 0.000 0.000 0.000 transforms.py:976(intervalx)\n", + " 112 0.000 0.000 0.000 0.000 hmac.py:117(update)\n", + " 96 0.000 0.000 0.000 0.000 _binary.py:111(o32be)\n", + " 34 0.000 0.000 0.000 0.000 _base.py:3044(_update_title_position)\n", + " 12 0.000 0.000 0.000 0.000 Image.py:587(_new)\n", + " 66 0.000 0.000 0.000 0.000 axis.py:201(_pad)\n", + " 102 0.000 0.000 0.000 0.000 lines.py:1237(set_markerfacecoloralt)\n", + " 12 0.000 0.000 0.000 0.000 axis.py:899(reset_ticks)\n", + " 12 0.000 0.000 0.000 0.000 contextlib.py:567(__exit__)\n", + " 58 0.000 0.000 0.000 0.000 ioloop.py:541(time)\n", + " 75 0.000 0.000 0.000 0.000 {built-in method time.time}\n", + " 30/15 0.000 0.000 0.000 0.000 transforms.py:2439(inverted)\n", + " 20 0.000 0.000 0.000 0.000 cbook.py:133(_weak_or_strong_ref)\n", + " 6 0.000 0.000 0.000 0.000 backend_agg.py:262(buffer_rgba)\n", + " 18 0.000 0.000 0.000 0.000 transforms.py:2275(__init__)\n", + " 125 0.000 0.000 0.000 0.000 {method 'join' of 'str' objects}\n", + " 102 0.000 0.000 0.000 0.000 lines.py:1106(set_gapcolor)\n", + " 28 0.000 0.000 0.001 0.000 axis.py:1749(update_units)\n", + " 102 0.000 0.000 0.000 0.000 lines.py:1217(set_markeredgecolor)\n", + " 22 0.000 0.000 0.000 0.000 markers.py:776(_set_tickdown)\n", + " 12 0.000 0.000 0.000 0.000 :117(splitext)\n", + " 204 0.000 0.000 0.000 0.000 axis.py:722(get_remove_overlapping_locs)\n", + " 34 0.000 0.000 0.000 0.000 figure.py:163()\n", + " 38 0.000 0.000 0.000 0.000 backend_bases.py:1730()\n", + " 6/0 0.000 0.000 0.000 image.py:116(_draw_list_compositing_images)\n", + " 11 0.000 0.000 0.000 0.000 _base.py:1038(get_yaxis_text1_transform)\n", + " 8 0.000 0.000 0.000 0.000 {built-in method setMask}\n", + " 12 0.000 0.000 0.000 0.000 cbook.py:597(_get_data_path)\n", + " 6 0.000 0.000 0.000 0.000 Image.py:3083(new)\n", + " 4 0.000 0.000 0.001 0.000 axis.py:856(clear)\n", + " 204 0.000 0.000 0.000 0.000 numeric.py:2333(_isclose_dispatcher)\n", + " 28 0.000 0.000 0.000 0.000 session.py:272(msg_header)\n", + " 4 0.000 0.000 0.000 0.000 ticker.py:2093(_validate_steps)\n", + " 88 0.000 0.000 0.000 0.000 text.py:321(set_antialiased)\n", + " 20 0.000 0.000 0.000 0.000 patches.py:115(_process_radius)\n", + " 6 0.000 0.000 0.000 0.000 backend_qt.py:400(_mpl_buttons)\n", + " 22 0.000 0.000 0.000 0.000 axis.py:816(limit_range_for_scale)\n", + " 2 0.000 0.000 0.000 0.000 gridspec.py:648(get_position)\n", + " 204 0.000 0.000 0.000 0.000 fromnumeric.py:2958(_ptp_dispatcher)\n", + " 6 0.000 0.000 0.000 0.000 Image.py:3181(frombuffer)\n", + " 28 0.000 0.000 0.000 0.000 iostream.py:725(_hooks)\n", + " 102 0.000 0.000 0.000 0.000 lines.py:551(set_markevery)\n", + " 28 0.000 0.000 0.000 0.000 {method 'getvalue' of '_io.StringIO' objects}\n", + " 66 0.000 0.000 0.000 0.000 axis.py:220(get_tick_padding)\n", + " 72 0.000 0.000 0.000 0.000 spines.py:595(__len__)\n", + " 17 0.000 0.000 0.000 0.000 backend_bases.py:1215(__init__)\n", + " 6 0.000 0.000 0.000 0.000 {built-in method PIL._imaging.map_buffer}\n", + " 6 0.000 0.000 0.000 0.000 inspect.py:2124(_signature_bound_method)\n", + " 12 0.000 0.000 0.000 0.000 backend_bases.py:1292(_set_inaxes)\n", + " 8 0.000 0.000 0.000 0.000 {built-in method _signal.set_wakeup_fd}\n", + " 22/18 0.000 0.000 0.001 0.000 axis.py:2360(setter)\n", + " 1 0.000 0.000 0.000 0.000 backend_qt.py:548(closeEvent)\n", + " 188 0.000 0.000 0.000 0.000 patches.py:821(rotation_point)\n", + " 1 0.000 0.000 0.000 0.000 backend_qt.py:291(enterEvent)\n", + " 6 0.000 0.000 0.000 0.000 backend_bases.py:1514(_mouse_handler)\n", + " 6 0.000 0.000 0.000 0.000 transforms.py:1719(set)\n", + " 22 0.000 0.000 0.000 0.000 axis.py:392(_get_text2_transform)\n", + " 11 0.000 0.000 0.000 0.000 axis.py:456(_apply_tickdir)\n", + " 71 0.000 0.000 0.000 0.000 path.py:737(unit_rectangle)\n", + " 4 0.000 0.000 0.000 0.000 ticker.py:573(set_useMathText)\n", + " 14 0.000 0.000 0.002 0.000 _base.py:3707(set_xlim)\n", + " 16 0.000 0.000 0.000 0.000 {built-in method color}\n", + " 72 0.000 0.000 0.000 0.000 :848(__len__)\n", + " 6 0.000 0.000 0.001 0.000 backend_bases.py:2929(_mouse_event_to_message)\n", + " 136 0.000 0.000 0.000 0.000 text.py:909(get_position)\n", + " 34 0.000 0.000 0.000 0.000 cbook.py:169(__getitem__)\n", + " 204 0.000 0.000 0.000 0.000 spines.py:200(get_path)\n", + " 13 0.000 0.000 0.000 0.000 figure.py:3150(get_size_inches)\n", + " 4 0.000 0.000 0.000 0.000 socket.py:653(socketpair)\n", + " 6 0.000 0.000 0.001 0.000 backend_bases.py:2951(mouse_move)\n", + " 1 0.000 0.000 0.030 0.030 1331834536.py:2(__init__)\n", + " 2 0.000 0.000 0.000 0.000 backend_qt.py:372(resizeEvent)\n", + " 22 0.000 0.000 0.000 0.000 axis.py:389(_get_text1_transform)\n", + " 1 0.000 0.000 0.123 0.123 {built-in method builtins.exec}\n", + " 56 0.000 0.000 0.000 0.000 transforms.py:2377(__eq__)\n", + " 2 0.000 0.000 0.000 0.000 _base.py:3632(set_xbound)\n", + " 4 0.000 0.000 0.000 0.000 _base.py:4034(format_xdata)\n", + " 204 0.000 0.000 0.000 0.000 ticker.py:1819(tick_values)\n", + " 13 0.000 0.000 0.002 0.000 transforms.py:1963(clear)\n", + " 8 0.000 0.000 0.000 0.000 socket.py:221(__init__)\n", + " 33 0.000 0.000 0.000 0.000 axis.py:205(_apply_tickdir)\n", + " 6 0.000 0.000 0.000 0.000 inspect.py:3081(from_callable)\n", + " 7 0.000 0.000 0.000 0.000 hl_api_connection_helpers.py:232(_connect_layers_needed)\n", + " 23 0.000 0.000 0.000 0.000 _linalg.py:123(_makearray)\n", + " 13 0.000 0.000 0.000 0.000 figure.py:2677(set_layout_engine)\n", + " 8 0.000 0.000 0.004 0.000 axis.py:1707(grid)\n", + " 3 0.000 0.000 0.000 0.000 asyncio.py:225(add_callback)\n", + " 8 0.000 0.000 0.000 0.000 axis.py:1957(_set_formatter)\n", + " 22 0.000 0.000 0.000 0.000 transforms.py:2317(blended_transform_factory)\n", + " 140 0.000 0.000 0.000 0.000 spines.py:559(__getattr__)\n", + " 34 0.000 0.000 0.000 0.000 cbook.py:1705(safe_isfinite)\n", + " 1 0.000 0.000 0.014 0.014 gridspec.py:249(subplots)\n", + " 12 0.000 0.000 0.000 0.000 pathlib.py:407(_load_parts)\n", + " 24 0.000 0.000 0.000 0.000 core.py:713(getdata)\n", + " 32 0.000 0.000 0.000 0.000 {built-in method _contextvars.copy_context}\n", + " 38 0.000 0.000 0.000 0.000 transforms.py:1573(get_matrix)\n", + " 20 0.000 0.000 0.000 0.000 pathlib.py:1157(__init__)\n", + " 8 0.000 0.000 0.001 0.000 spines.py:433(linear_spine)\n", + " 4 0.000 0.000 0.001 0.000 _base.py:3435(tick_params)\n", + " 62 0.000 0.000 0.000 0.000 cbook.py:2315(_is_jax_array)\n", + " 1/0 0.000 0.000 0.000 figure.py:3237(draw)\n", + " 44 0.000 0.000 0.000 0.000 {method 'copy' of 'dict' objects}\n", + " 8 0.000 0.000 0.002 0.000 backend_qt.py:265(set_cursor)\n", + " 6 0.000 0.000 0.010 0.002 Image.py:652(_ensure_mutable)\n", + " 88 0.000 0.000 0.000 0.000 text.py:606(set_wrap)\n", + " 4 0.000 0.000 0.001 0.000 scale.py:103(set_default_locators_and_formatters)\n", + " 13 0.000 0.000 0.000 0.000 contextlib.py:481(__init__)\n", + " 1 0.000 0.000 0.000 0.000 {built-in method addWidget}\n", + " 15 0.000 0.000 0.000 0.000 backend_bases.py:1965()\n", + " 6 0.000 0.000 0.000 0.000 PngImagePlugin.py:333(add_text)\n", + " 21 0.000 0.000 0.000 0.000 patches.py:429(set_linewidth)\n", + " 28 0.000 0.000 0.000 0.000 hmac.py:161(hexdigest)\n", + " 2 0.000 0.000 0.000 0.000 {built-in method addSeparator}\n", + " 4 0.000 0.000 0.000 0.000 ticker.py:2108(_staircase)\n", + " 62 0.000 0.000 0.000 0.000 cbook.py:2327(_is_tensorflow_array)\n", + " 15 0.000 0.000 0.000 0.000 {built-in method rect}\n", + " 11 0.000 0.000 0.000 0.000 patches.py:444(set_linestyle)\n", + " 11 0.000 0.000 0.000 0.000 _base.py:1065(get_yaxis_text2_transform)\n", + " 2 0.000 0.000 0.001 0.000 hl_api_info.py:225(SetStatus)\n", + " 26 0.000 0.000 0.000 0.000 ticker.py:1712(nonsingular)\n", + " 22 0.000 0.000 0.000 0.000 markers.py:770(_set_tickup)\n", + " 1 0.000 0.000 0.013 0.013 pyplot.py:872(figure)\n", + " 8 0.000 0.000 0.000 0.000 signal.py:56(signal)\n", + " 6 0.000 0.000 0.000 0.000 backend_qt.py:790(set_message)\n", + " 122 0.000 0.000 0.000 0.000 transforms.py:2116(get_matrix)\n", + " 21 0.000 0.000 0.000 0.000 patches.py:362(_set_edgecolor)\n", + " 117 0.000 0.000 0.000 0.000 zmqstream.py:529(receiving)\n", + " 204 0.000 0.000 0.000 0.000 multiarray.py:690(result_type)\n", + " 6 0.000 0.000 0.010 0.002 Image.py:647(_copy)\n", + " 2 0.000 0.000 0.014 0.007 figure.py:644(add_subplot)\n", + " 4 0.000 0.000 0.000 0.000 axis.py:2613(_init)\n", + " 4 0.000 0.000 0.000 0.000 axis.py:2389(_init)\n", + " 4 0.000 0.000 0.000 0.000 {method 'cumsum' of 'numpy.ndarray' objects}\n", + " 12 0.000 0.000 0.001 0.000 PngImagePlugin.py:1131(write)\n", + " 19 0.000 0.000 0.000 0.000 patches.py:501(set_capstyle)\n", + " 61 0.000 0.000 0.000 0.000 {method '__exit__' of '_thread.lock' objects}\n", + " 29 0.000 0.000 0.000 0.000 iostream.py:213(_is_master_process)\n", + " 6 0.000 0.000 0.001 0.000 _base.py:227(__call__)\n", + " 64 0.000 0.000 0.000 0.000 lines.py:1457(is_dashed)\n", + " 12 0.000 0.000 0.000 0.000 textpath.py:26(__init__)\n", + " 44 0.000 0.000 0.000 0.000 axis.py:757(get_scale)\n", + " 4 0.000 0.000 0.015 0.004 pyplot.py:569(show)\n", + " 34 0.000 0.000 0.000 0.000 transforms.py:951(y0)\n", + " 8 0.000 0.000 0.000 0.000 cbook.py:2196(_g_sig_digits)\n", + " 2 0.000 0.000 0.001 0.001 _base.py:828(_init_axis)\n", + " 1 0.000 0.000 0.000 0.000 cbook.py:330(disconnect)\n", + " 6 0.000 0.000 0.000 0.000 Image.py:445(_getencoder)\n", + " 21 0.000 0.000 0.000 0.000 patches.py:377(set_edgecolor)\n", + " 2 0.000 0.000 0.000 0.000 {method '__exit__' of 'sqlite3.Connection' objects}\n", + " 1 0.000 0.000 0.000 0.000 backend_qt.py:302(leaveEvent)\n", + " 15 0.000 0.000 0.000 0.000 transforms.py:971(p1)\n", + " 15 0.000 0.000 0.000 0.000 {built-in method topLeft}\n", + " 29 0.000 0.000 0.000 0.000 iostream.py:216(_check_mp_mode)\n", + " 2 0.000 0.000 0.000 0.000 _base.py:892(_set_lim_and_transforms)\n", + " 1 0.000 0.000 0.000 0.000 {method 'emit' of 'PyQt5.QtCore.pyqtBoundSignal' objects}\n", + " 21 0.000 0.000 0.000 0.000 patches.py:388(_set_facecolor)\n", + " 34 0.000 0.000 0.000 0.000 transforms.py:946(x0)\n", + " 5 0.000 0.000 0.000 0.000 cbook.py:1837(_topmost_artist)\n", + " 28 0.000 0.000 0.000 0.000 figure.py:83(as_list)\n", + " 4 0.000 0.000 0.015 0.004 backend_bases.py:3520(show)\n", + " 3 0.000 0.000 0.000 0.000 _base.py:2362(add_line)\n", + " 2/0 0.000 0.000 0.000 backend_qt.py:447(flush_events)\n", + " 6 0.000 0.000 0.000 0.000 {built-in method pos}\n", + " 17 0.000 0.000 0.000 0.000 figure.py:220(get_children)\n", + " 15 0.000 0.000 0.000 0.000 {instance}\n", + " 9 0.000 0.000 0.000 0.000 _base.py:1194(_set_artist_props)\n", + " 8 0.000 0.000 0.000 0.000 {built-in method _deco}\n", + " 7 0.000 0.000 0.000 0.000 hl_api_connection_helpers.py:60(_process_syn_spec)\n", + " 20 0.000 0.000 0.000 0.000 transforms.py:1836(is_separable)\n", + " 36 0.000 0.000 0.000 0.000 {method 'join' of 'bytes' objects}\n", + " 3/0 0.000 0.000 0.000 _base.py:3116(draw)\n", + " 8 0.000 0.000 0.000 0.000 pathlib.py:628(with_name)\n", + " 1 0.000 0.000 0.000 0.000 {built-in method windowHandle}\n", + " 20 0.000 0.000 0.000 0.000 pathlib.py:437(__str__)\n", + " 32 0.000 0.000 0.000 0.000 backend_bases.py:1785(_idle_draw_cntx)\n", + " 5 0.000 0.000 0.000 0.000 backend_bases.py:1944(get_width_height)\n", + " 59 0.000 0.000 0.000 0.000 queue.py:209(_qsize)\n", + " 4 0.000 0.000 0.001 0.000 _base.py:4054(format_coord)\n", + " 11 0.000 0.000 0.000 0.000 markers.py:756(_set_tickleft)\n", + " 30 0.000 0.000 0.000 0.000 backend_bases.py:1182(__init__)\n", + " 3 0.000 0.000 0.001 0.000 _axes.py:1532(plot)\n", + " 6 0.000 0.000 0.000 0.000 inspect.py:754(unwrap)\n", + " 95 0.000 0.000 0.000 0.000 fromnumeric.py:3730(_mean_dispatcher)\n", + " 8 0.000 0.000 0.000 0.000 {built-in method _signal.signal}\n", + " 4 0.000 0.000 0.000 0.000 ticker.py:2114(set_params)\n", + " 138 0.000 0.000 0.000 0.000 transforms.py:994(minpos)\n", + " 28 0.000 0.000 0.000 0.000 pathlib.py:569(_tail)\n", + " 11 0.000 0.000 0.000 0.000 pyplot.py:359(_get_backend_mod)\n", + " 2 0.000 0.000 0.000 0.000 _base.py:837(set_figure)\n", + " 6 0.000 0.000 0.000 0.000 {built-in method PIL._imaging.zip_encoder}\n", + " 37 0.000 0.000 0.000 0.000 {method 'setdefault' of 'dict' objects}\n", + " 5 0.000 0.000 0.000 0.000 transforms.py:324(max)\n", + " 29 0.000 0.000 0.000 0.000 events.py:127(__lt__)\n", + " 4 0.000 0.000 0.004 0.001 axis.py:1126(set_clip_path)\n", + " 8 0.000 0.000 0.000 0.000 spines.py:300(set_position)\n", + " 9 0.000 0.000 0.000 0.000 {built-in method devicePixelRatioF}\n", + " 1 0.000 0.000 0.000 0.000 {built-in method sizeHint}\n", + " 150 0.000 0.000 0.000 0.000 enum.py:1267(__deepcopy__)\n", + " 8 0.000 0.000 0.000 0.000 {built-in method setToolTip}\n", + " 4 0.000 0.000 0.000 0.000 _base.py:4044(format_ydata)\n", + " 101 0.000 0.000 0.000 0.000 markers.py:449(_set_nothing)\n", + " 1 0.000 0.000 0.000 0.000 {built-in method pygame.font.init}\n", + " 1 0.000 0.000 0.000 0.000 backend_bases.py:2822(__init__)\n", + " 6 0.000 0.000 0.000 0.000 {built-in method setEnabled}\n", + " 3 0.000 0.000 0.000 0.000 backend_qt.py:848(set_history_buttons)\n", + " 28 0.000 0.000 0.000 0.000 {method 'close' of '_io.StringIO' objects}\n", + " 34 0.000 0.000 0.000 0.000 transforms.py:269(y1)\n", + " 16 0.000 0.000 0.000 0.000 axis.py:2575(get_minpos)\n", + " 8 0.000 0.000 0.000 0.000 {built-in method setDevicePixelRatio}\n", + " 13 0.000 0.000 0.000 0.000 transforms.py:289(p1)\n", + " 3 0.000 0.000 0.000 0.000 patches.py:748(__init__)\n", + " 34 0.000 0.000 0.000 0.000 transforms.py:956(x1)\n", + " 2/0 0.000 0.000 0.000 pyplot.py:735(pause)\n", + " 7 0.000 0.000 0.000 0.000 _pylab_helpers.py:99(get_active)\n", + " 11 0.000 0.000 0.000 0.000 axis.py:453(_get_text2_transform)\n", + " 12 0.000 0.000 0.000 0.000 :138(splitroot)\n", + " 46 0.000 0.000 0.000 0.000 _linalg.py:128(isComplexType)\n", + " 6 0.000 0.000 0.000 0.000 weakref.py:68(__call__)\n", + " 1 0.000 0.000 0.000 0.000 {built-in method setPalette}\n", + " 34 0.000 0.000 0.000 0.000 transforms.py:259(x1)\n", + " 12 0.000 0.000 0.000 0.000 Image.py:3064(_check_size)\n", + " 12 0.000 0.000 0.000 0.000 Image.py:882(load)\n", + " 8 0.000 0.000 0.001 0.000 axis.py:234(set_clip_path)\n", + " 23 0.000 0.000 0.000 0.000 _linalg.py:198(_assert_stacked_square)\n", + " 34 0.000 0.000 0.000 0.000 transforms.py:961(y1)\n", + " 11 0.000 0.000 0.000 0.000 axis.py:450(_get_text1_transform)\n", + " 1 0.000 0.000 0.000 0.000 queues.py:225(get)\n", + " 4 0.000 0.000 0.000 0.000 axis.py:1983(set_major_locator)\n", + " 8 0.000 0.000 0.000 0.000 socket.py:497(_real_close)\n", + " 33 0.000 0.000 0.000 0.000 colors.py:236(_has_alpha_channel)\n", + " 1 0.000 0.000 0.013 0.013 backend_bases.py:3494(new_figure_manager)\n", + " 6 0.000 0.000 0.000 0.000 backend_bases.py:2890(_update_cursor)\n", + " 95 0.000 0.000 0.000 0.000 879461237.py:51(get_episode)\n", + " 20 0.000 0.000 0.000 0.000 pathlib.py:1164(__new__)\n", + " 6 0.000 0.000 0.000 0.000 contextlib.py:543(_push_cm_exit)\n", + " 6 0.000 0.000 0.000 0.000 contextlib.py:511(enter_context)\n", + " 34 0.000 0.000 0.000 0.000 backend_bases.py:1793(is_saving)\n", + " 1 0.000 0.000 0.000 0.000 figure.py:123(__init__)\n", + " 6 0.000 0.000 0.000 0.000 inspect.py:3343(signature)\n", + " 3 0.000 0.000 0.000 0.000 base_events.py:813(_call_soon)\n", + " 1 0.000 0.000 0.006 0.006 backend_bases.py:2609(__init__)\n", + " 76 0.000 0.000 0.000 0.000 fromnumeric.py:2472(_any_dispatcher)\n", + " 29 0.000 0.000 0.000 0.000 tz.py:74(utcoffset)\n", + " 4 0.000 0.000 0.000 0.000 signal.py:62(getsignal)\n", + " 26 0.000 0.000 0.000 0.000 axis.py:1639(get_major_locator)\n", + " 4 0.000 0.000 0.004 0.001 _base.py:3273(grid)\n", + " 4 0.000 0.000 0.000 0.000 ticker.py:452(__init__)\n", + " 4 0.000 0.000 0.000 0.000 _base.py:221(set_prop_cycle)\n", + " 2 0.000 0.000 0.000 0.000 _base.py:1543(_set_title_offset_trans)\n", + " 11 0.000 0.000 0.000 0.000 patches.py:541(set_hatch)\n", + " 1 0.000 0.000 0.000 0.000 {built-in method setCentralWidget}\n", + " 4 0.000 0.000 0.001 0.000 axis.py:761(_set_scale)\n", + " 11 0.000 0.000 0.000 0.000 hatch.py:182(_validate_hatch_pattern)\n", + " 40 0.000 0.000 0.000 0.000 cbook.py:129(__hash__)\n", + " 2 0.000 0.000 0.000 0.000 gridspec.py:397(get_subplot_params)\n", + " 8 0.000 0.000 0.000 0.000 {method 'setblocking' of '_socket.socket' objects}\n", + " 16 0.000 0.000 0.000 0.000 {built-in method palette}\n", + " 23 0.000 0.000 0.000 0.000 {method '__array_wrap__' of 'numpy.ndarray' objects}\n", + " 8 0.000 0.000 0.000 0.000 transforms.py:2244(inverted)\n", + " 1 0.000 0.000 0.000 0.000 colors.py:324(_to_rgba_no_colorcycle)\n", + " 4 0.000 0.000 0.000 0.000 axis.py:1999(set_minor_locator)\n", + " 1 0.000 0.000 0.000 0.000 backend_qt.py:258(showEvent)\n", + " 30 0.000 0.000 0.000 0.000 inspect.py:3076()\n", + " 16 0.000 0.000 0.000 0.000 transforms.py:1509(transform_affine)\n", + " 42 0.000 0.000 0.000 0.000 {built-in method math.isfinite}\n", + " 12 0.000 0.000 0.000 0.000 {method 'values' of 'mappingproxy' objects}\n", + " 21 0.000 0.000 0.000 0.000 patches.py:395(set_facecolor)\n", + " 23 0.000 0.000 0.000 0.000 _linalg.py:192(_assert_stacked_2d)\n", + " 8 0.000 0.000 0.006 0.001 axis.py:534(__get__)\n", + " 4 0.000 0.000 0.000 0.000 ticker.py:2054(__init__)\n", + " 74 0.000 0.000 0.000 0.000 :845(__init__)\n", + " 7 0.000 0.000 0.000 0.000 hl_api_connection_helpers.py:45(_process_conn_spec)\n", + " 13 0.000 0.000 0.000 0.000 cbook.py:305(_connect_picklable)\n", + " 24 0.000 0.000 0.000 0.000 {method 'isidentifier' of 'str' objects}\n", + " 6 0.000 0.000 0.000 0.000 {method 'setimage' of 'ImagingEncoder' objects}\n", + " 57 0.000 0.000 0.000 0.000 threading.py:601(is_set)\n", + " 18 0.000 0.000 0.000 0.000 Image.py:567(im)\n", + " 11 0.000 0.000 0.000 0.000 markers.py:762(_set_tickright)\n", + " 12 0.000 0.000 0.000 0.000 transforms.py:2184(__init__)\n", + " 8 0.000 0.000 0.000 0.000 socket.py:501(close)\n", + " 23 0.000 0.000 0.000 0.000 {built-in method x}\n", + " 1 0.000 0.000 0.000 0.000 traitlets.py:1527(_notify_observers)\n", + " 1 0.000 0.000 0.000 0.000 backend_qt.py:613(_widgetclosed)\n", + " 3 0.000 0.000 0.000 0.000 _base.py:335(_make_line)\n", + " 2 0.000 0.000 0.000 0.000 traitlets.py:3631(set)\n", + " 80 0.000 0.000 0.000 0.000 axis.py:310()\n", + " 14 0.000 0.000 0.000 0.000 functools.py:65(wraps)\n", + " 34 0.000 0.000 0.000 0.000 artist.py:1120(get_zorder)\n", + " 2 0.000 0.000 0.000 0.000 backend_qt.py:393(sizeHint)\n", + " 6 0.000 0.000 0.000 0.000 cbook.py:1348(_check_1d)\n", + " 6 0.000 0.000 0.000 0.000 inspect.py:176(get_annotations)\n", + " 23 0.000 0.000 0.000 0.000 _linalg.py:142(_realType)\n", + " 2 0.000 0.000 0.000 0.000 _base.py:3551(set_xlabel)\n", + " 6 0.000 0.000 0.000 0.000 backend_agg.py:405(buffer_rgba)\n", + " 1 0.000 0.000 0.000 0.000 _pylab_helpers.py:44(destroy)\n", + " 11 0.000 0.000 0.000 0.000 patches.py:521(set_joinstyle)\n", + " 68 0.000 0.000 0.000 0.000 _base.py:1188(get_axes_locator)\n", + " 6 0.000 0.000 0.000 0.000 _base.py:871(_request_autoscale_view)\n", + " 8 0.000 0.000 0.000 0.000 {built-in method PyQt5.QtCore.pyqtSlot}\n", + " 3 0.000 0.000 0.000 0.000 rcsetup.py:151(validate_bool)\n", + " 68 0.000 0.000 0.000 0.000 _base.py:1631(get_aspect)\n", + " 1 0.000 0.000 0.013 0.013 backend_bases.py:2646(create_with_canvas)\n", + " 8 0.000 0.000 0.000 0.000 pathlib.py:380(with_segments)\n", + " 12 0.000 0.000 0.000 0.000 patches.py:349(set_antialiased)\n", + " 29 0.000 0.000 0.000 0.000 figure.py:2744(get_layout_engine)\n", + " 19 0.000 0.000 0.000 0.000 cbook.py:158(__setitem__)\n", + " 1 0.000 0.000 0.000 0.000 1665476354.py:3(__init__)\n", + " 6 0.000 0.000 0.000 0.000 transforms.py:981(intervaly)\n", + " 1 0.000 0.000 0.000 0.000 _pylab_helpers.py:104(_set_new_active_manager)\n", + " 2 0.000 0.000 0.000 0.000 _base.py:803(set_subplotspec)\n", + " 15 0.000 0.000 0.000 0.000 {built-in method left}\n", + " 1 0.000 0.000 0.000 0.000 {built-in method screen}\n", + " 4 0.000 0.000 0.000 0.000 ticker.py:2914(__init__)\n", + " 2 0.000 0.000 0.001 0.000 _base.py:1221(_gen_axes_spines)\n", + " 24 0.000 0.000 0.000 0.000 Image.py:560(im)\n", + " 2 0.000 0.000 0.000 0.000 _base.py:3234(set_axisbelow)\n", + " 4 0.000 0.000 0.000 0.000 axis.py:1889(set_label_text)\n", + " 18 0.000 0.000 0.000 0.000 transforms.py:1009(minposx)\n", + " 1 0.000 0.000 0.000 0.000 backend_qt.py:242(_update_pixel_ratio)\n", + " 12 0.000 0.000 0.000 0.000 pathlib.py:551(drive)\n", + " 6 0.000 0.000 0.000 0.000 inspect.py:3097(replace)\n", + " 28 0.000 0.000 0.000 0.000 traitlets.py:2558(_validate_bounds)\n", + " 2 0.000 0.000 0.000 0.000 _base.py:3804(set_ylabel)\n", + " 2 0.000 0.000 0.001 0.000 axis.py:2385(__init__)\n", + " 4 0.000 0.000 0.000 0.000 scale.py:699(scale_factory)\n", + " 49 0.000 0.000 0.000 0.000 backend_bases.py:844(set_clip_rectangle)\n", + " 3 0.000 0.000 0.000 0.000 _base.py:121(_process_plot_format)\n", + " 12 0.000 0.000 0.000 0.000 {built-in method sys.exc_info}\n", + " 8 0.000 0.000 0.000 0.000 pathlib.py:420(_from_parsed_parts)\n", + " 1 0.000 0.000 0.000 0.000 interactiveshell.py:3741(var_expand)\n", + " 12 0.000 0.000 0.000 0.000 {method 'pixel_access' of 'ImagingCore' objects}\n", + " 17 0.000 0.000 0.000 0.000 lines.py:977(get_markerfacecolor)\n", + " 1 0.000 0.000 0.016 0.016 7730343.py:3(__init__)\n", + " 6 0.000 0.000 0.000 0.000 backend_bases.py:2227(mpl_connect)\n", + " 8 0.000 0.000 0.000 0.000 axis.py:1282(_set_artist_props)\n", + " 16 0.000 0.000 0.000 0.000 pathlib.py:583(name)\n", + " 7 0.000 0.000 0.000 0.000 {built-in method keyboardModifiers}\n", + " 12 0.000 0.000 0.000 0.000 pathlib.py:429(_format_parsed_parts)\n", + " 6 0.000 0.000 0.000 0.000 text.py:587(set_clip_box)\n", + " 7 0.000 0.000 0.000 0.000 hl_api_connection_helpers.py:275(_process_input_nodes)\n", + " 2 0.000 0.000 0.000 0.000 _base.py:1790(set_box_aspect)\n", + " 8 0.000 0.000 0.000 0.000 pathlib.py:852(exists)\n", + " 1 0.000 0.000 0.000 0.000 backend_bases.py:3508(draw_if_interactive)\n", + " 2 0.000 0.000 0.000 0.000 traitlets.py:3474(validate)\n", + " 4 0.000 0.000 0.000 0.000 transforms.py:1701(__init__)\n", + " 8 0.000 0.000 0.000 0.000 {built-in method backgroundRole}\n", + " 6 0.000 0.000 0.000 0.000 _base.py:539()\n", + " 4 0.000 0.000 0.000 0.000 backend_qt.py:150(_allow_interrupt_qt)\n", + " 6 0.000 0.000 0.000 0.000 weakref.py:367(__init__)\n", + " 8 0.000 0.000 0.000 0.000 artist.py:1105(set_label)\n", + " 3 0.000 0.000 0.000 0.000 {built-in method isRunning}\n", + " 12 0.000 0.000 0.000 0.000 signal.py:24(_int_to_enum)\n", + " 8 0.000 0.000 0.000 0.000 backend_qt.py:477(draw_idle)\n", + " 32 0.000 0.000 0.000 0.000 base_events.py:538(_check_closed)\n", + " 1 0.000 0.000 0.000 0.000 contextlib.py:530(callback)\n", + " 8 0.000 0.000 0.000 0.000 axis.py:1647(get_major_formatter)\n", + " 8 0.000 0.000 0.000 0.000 {built-in method fill}\n", + " 28 0.000 0.000 0.000 0.000 hmac.py:139(_current)\n", + " 3 0.000 0.000 0.000 0.000 cbook.py:800(__init__)\n", + " 2 0.000 0.000 0.000 0.000 figure.py:772(_add_axes_internal)\n", + " 22 0.000 0.000 0.000 0.000 axis.py:1808(have_units)\n", + " 4 0.000 0.000 0.000 0.000 axis.py:1169(get_inverted)\n", + " 24 0.000 0.000 0.000 0.000 {method '__contains__' of 'frozenset' objects}\n", + " 3 0.000 0.000 0.000 0.000 base_events.py:784(call_soon)\n", + " 15 0.000 0.000 0.000 0.000 {built-in method top}\n", + " 1 0.000 0.000 0.000 0.000 pyplot.py:695(ion)\n", + " 2 0.000 0.000 0.004 0.002 hl_api_simulation.py:304(Install)\n", + " 1 0.000 0.000 0.000 0.000 backend_qt.py:251(_update_screen)\n", + " 6 0.000 0.000 0.000 0.000 {built-in method buttons}\n", + " 6 0.000 0.000 0.000 0.000 {method 'sort' of 'list' objects}\n", + " 2 0.000 0.000 0.000 0.000 _base.py:1092(_update_transScale)\n", + " 2 0.000 0.000 0.000 0.000 backend_bases.py:3258(update)\n", + " 6 0.000 0.000 0.000 0.000 enum.py:822(__members__)\n", + " 1 0.000 0.000 0.027 0.027 pyplot.py:1620(subplots)\n", + " 2 0.000 0.000 0.000 0.000 traitlets.py:3624(validate_elements)\n", + " 23 0.000 0.000 0.000 0.000 {built-in method y}\n", + " 10 0.000 0.000 0.000 0.000 __init__.py:185(keys)\n", + " 6 0.000 0.000 0.000 0.000 _util.py:9(is_path)\n", + " 1 0.000 0.000 0.014 0.014 figure.py:785(subplots)\n", + " 1 0.000 0.000 0.006 0.006 qt_compat.py:157(_exec)\n", + " 1 0.000 0.000 0.000 0.000 __init__.py:1332(interactive)\n", + " 1 0.000 0.000 0.000 0.000 traitlets.py:1512(_notify_trait)\n", + " 1 0.000 0.000 0.000 0.000 traitlets.py:1523(notify_change)\n", + " 4 0.000 0.000 0.000 0.000 fromnumeric.py:969(sort)\n", + " 4 0.000 0.000 0.000 0.000 __init__.py:164(match)\n", + " 2 0.000 0.000 0.000 0.000 backend_bases.py:1235(__init__)\n", + " 1 0.000 0.000 0.000 0.000 queues.py:256(get_nowait)\n", + " 8 0.000 0.000 0.000 0.000 pathlib.py:447(__fspath__)\n", + " 42 0.000 0.000 0.000 0.000 inspect.py:2796(name)\n", + " 4 0.000 0.000 0.000 0.000 _base.py:2514(_unit_change_handler)\n", + " 3 0.000 0.000 0.000 0.000 _base.py:311(_getdefaults)\n", + " 51 0.000 0.000 0.000 0.000 backend_agg.py:271(option_image_nocomposite)\n", + " 4 0.000 0.000 0.000 0.000 fromnumeric.py:2879(cumsum)\n", + " 1 0.000 0.000 0.000 0.000 {built-in method setWindowTitle}\n", + " 16 0.000 0.000 0.000 0.000 ticker.py:191(set_axis)\n", + " 2 0.000 0.000 0.000 0.000 _base.py:3885(set_ybound)\n", + " 4 0.000 0.000 0.000 0.000 _base.py:216(__init__)\n", + " 1 0.000 0.000 0.000 0.000 gridspec.py:736(__init__)\n", + " 4 0.000 0.000 0.000 0.000 ticker.py:2247(view_limits)\n", + " 1 0.000 0.000 0.000 0.000 markers.py:511(_set_circle)\n", + " 2 0.000 0.000 0.000 0.000 backend_bases.py:2640(notify_axes_change)\n", + " 4/2 0.000 0.000 0.001 0.000 _base.py:3941(set_ylim)\n", + " 22 0.000 0.000 0.000 0.000 axis.py:827(_set_autoscale_on)\n", + " 8 0.000 0.000 0.000 0.000 text.py:1160(set_fontweight)\n", + " 2 0.000 0.000 0.000 0.000 _base.py:1204(_gen_axes_patch)\n", + " 7 0.000 0.000 0.000 0.000 contextlib.py:548(_push_exit_callback)\n", + " 2 0.000 0.000 0.000 0.000 transforms.py:790(null)\n", + " 1 0.000 0.000 0.000 0.000 interactiveshell.py:2554(find_line_magic)\n", + " 1 0.000 0.000 0.013 0.013 pyplot.py:549(new_figure_manager)\n", + " 5 0.000 0.000 0.000 0.000 threading.py:1211(native_id)\n", + " 33 0.000 0.000 0.000 0.000 base_events.py:2010(get_debug)\n", + " 18 0.000 0.000 0.000 0.000 Image.py:549(__init__)\n", + " 6 0.000 0.000 0.000 0.000 artist.py:766(set_clip_box)\n", + " 2 0.000 0.000 0.000 0.000 hl_api_types.py:1083(_binop)\n", + " 1 0.000 0.000 0.000 0.000 {built-in method setMouseTracking}\n", + " 1 0.000 0.000 0.000 0.000 {built-in method pygame.display.set_caption}\n", + " 15 0.000 0.000 0.000 0.000 cbook.py:192(__iter__)\n", + " 1 0.000 0.000 0.000 0.000 {built-in method builtins.vars}\n", + " 1 0.000 0.000 0.000 0.000 {built-in method queryKeyboardModifiers}\n", + " 3 0.000 0.000 0.000 0.000 _base.py:2390(_update_line_limits)\n", + " 3 0.000 0.000 0.000 0.000 __init__.py:1339(is_interactive)\n", + " 2 0.000 0.000 0.000 0.000 axis.py:2609(__init__)\n", + " 3 0.000 0.000 0.000 0.000 {built-in method _asyncio.get_running_loop}\n", + " 4 0.000 0.000 0.000 0.000 hl_api_nodes.py:99()\n", + " 2 0.000 0.000 0.000 0.000 rcsetup.py:163(validate_axisbelow)\n", + " 1 0.000 0.000 0.000 0.000 {built-in method numpy.empty}\n", + " 5 0.000 0.000 0.000 0.000 {built-in method height}\n", + " 8 0.000 0.000 0.000 0.000 {built-in method value}\n", + " 2 0.000 0.000 0.010 0.005 _base.py:1409(clear)\n", + " 6 0.000 0.000 0.000 0.000 PngImagePlugin.py:286(add)\n", + " 6 0.000 0.000 0.000 0.000 axis.py:2805(get_minpos)\n", + " 1 0.000 0.000 0.000 0.000 __init__.py:748(__setitem__)\n", + " 1 0.000 0.000 0.000 0.000 {pos}\n", + " 29 0.000 0.000 0.000 0.000 iostream.py:255(closed)\n", + " 6 0.000 0.000 0.000 0.000 shape_base.py:21(atleast_1d)\n", + " 2 0.000 0.000 0.000 0.000 spines.py:549(from_dict)\n", + " 1 0.000 0.000 0.000 0.000 figure.py:1556(add_gridspec)\n", + " 9 0.000 0.000 0.000 0.000 {method 'values' of 'collections.OrderedDict' objects}\n", + " 30 0.000 0.000 0.000 0.000 inspect.py:2808(kind)\n", + " 9 0.000 0.000 0.000 0.000 cbook.py:1734(sanitize_sequence)\n", + " 12 0.000 0.000 0.000 0.000 inspect.py:378(isfunction)\n", + " 26 0.000 0.000 0.000 0.000 scale.py:78(limit_range_for_scale)\n", + " 2 0.000 0.000 0.000 0.000 {built-in method resize}\n", + " 20 0.000 0.000 0.000 0.000 patches.py:333(get_edgecolor)\n", + " 1 0.000 0.000 0.000 0.000 text.py:579(vformat)\n", + " 4 0.000 0.000 0.000 0.000 __init__.py:280(_compile)\n", + " 1 0.000 0.000 0.013 0.013 backend_bases.py:1772(new_manager)\n", + " 3 0.000 0.000 0.000 0.000 weakref.py:510(update)\n", + " 1 0.000 0.000 0.000 0.000 _pylab_helpers.py:117(set_active)\n", + " 13 0.000 0.000 0.000 0.000 {method 'add' of 'set' objects}\n", + " 4 0.000 0.000 0.000 0.000 axis.py:1917(set_major_formatter)\n", + " 8 0.000 0.000 0.000 0.000 {built-in method foregroundRole}\n", + " 2 0.000 0.000 0.000 0.000 traitlets.py:2304(validate)\n", + " 2 0.000 0.000 0.000 0.000 {built-in method setCheckable}\n", + " 6 0.000 0.000 0.000 0.000 contextlib.py:471(_create_exit_wrapper)\n", + " 5 0.000 0.000 0.000 0.000 hl_api_types.py:1076(__init__)\n", + " 4 0.000 0.000 0.000 0.000 _pylab_helpers.py:89(get_all_fig_managers)\n", + " 1 0.000 0.000 0.000 0.000 backend_bases.py:2290(mpl_disconnect)\n", + " 6 0.000 0.000 0.000 0.000 {method 'remove' of 'set' objects}\n", + " 1 0.000 0.000 0.000 0.000 backend_qt.py:650(destroy)\n", + " 1 0.000 0.000 0.000 0.000 879461237.py:45(get_box)\n", + " 2 0.000 0.000 0.000 0.000 _base.py:3919(get_ylim)\n", + " 1 0.000 0.000 0.000 0.000 {built-in method mapFromGlobal}\n", + " 1 0.000 0.000 0.000 0.000 macosx.py:8(Video_AutoInit)\n", + " 4 0.000 0.000 0.000 0.000 __init__.py:334(__len__)\n", + " 2 0.000 0.000 0.000 0.000 figure.py:1754(_process_projection_requirements)\n", + " 6 0.000 0.000 0.000 0.000 {method 'cleanup' of 'ImagingEncoder' objects}\n", + " 2 0.000 0.000 0.000 0.000 transforms.py:2633(__init__)\n", + " 1 0.000 0.000 0.000 0.000 gridspec.py:313(__init__)\n", + " 8 0.000 0.000 0.000 0.000 hl_api_helper.py:429(model_deprecation_warning)\n", + " 3 0.000 0.000 0.001 0.000 zmqstream.py:685()\n", + " 1 0.000 0.000 0.000 0.000 history.py:839(_writeout_output_cache)\n", + " 8 0.000 0.000 0.000 0.000 transforms.py:1024(minposy)\n", + " 8 0.000 0.000 0.000 0.000 axis.py:504(locator)\n", + " 23 0.000 0.000 0.000 0.000 _linalg.py:492(_unary_dispatcher)\n", + " 1 0.000 0.000 0.000 0.000 {built-in method sys.exit}\n", + " 1 0.000 0.000 0.000 0.000 {restoreOverrideCursor}\n", + " 1 0.000 0.000 0.000 0.000 string.py:287(parse)\n", + " 1 0.000 0.000 0.000 0.000 builtin_trap.py:46(__exit__)\n", + " 1 0.000 0.000 0.000 0.000 backend_qt.py:664(set_window_title)\n", + " 8 0.000 0.000 0.000 0.000 axis.py:515(formatter)\n", + " 3 0.000 0.000 0.000 0.000 cbook.py:564(is_scalar_or_string)\n", + " 1 0.000 0.000 0.000 0.000 figure.py:965(clear)\n", + " 1 0.000 0.000 0.000 0.000 {built-in method setAttribute}\n", + " 4 0.000 0.000 0.000 0.000 axis.py:2015(set_pickradius)\n", + " 8 0.000 0.000 0.000 0.000 {method 'detach' of '_socket.socket' objects}\n", + " 4 0.000 0.000 0.000 0.000 {method 'sort' of 'numpy.ndarray' objects}\n", + " 2 0.000 0.000 0.000 0.000 cbook.py:2055(__init__)\n", + " 24 0.000 0.000 0.000 0.000 Image.py:583(mode)\n", + " 1 0.000 0.000 0.000 0.000 gridspec.py:32(__init__)\n", + " 1 0.000 0.000 0.000 0.000 {built-in method setFocus}\n", + " 18 0.000 0.000 0.000 0.000 artist.py:896(get_clip_on)\n", + " 8 0.000 0.000 0.000 0.000 spines.py:209(register_axis)\n", + " 6 0.000 0.000 0.000 0.000 {method 'islower' of 'bytes' objects}\n", + " 1 0.000 0.000 0.000 0.000 interactiveshell.py:2411(_find_with_lazy_load)\n", + " 12 0.000 0.000 0.000 0.000 __init__.py:336(wrapper)\n", + " 15 0.000 0.000 0.000 0.000 backend_qt.py:232()\n", + " 1 0.000 0.000 0.000 0.000 queues.py:173(qsize)\n", + " 1 0.000 0.000 0.000 0.000 threading.py:299(__enter__)\n", + " 8 0.000 0.000 0.000 0.000 pathlib.py:835(stat)\n", + " 8 0.000 0.000 0.000 0.000 _base.py:2999()\n", + " 1 0.000 0.000 0.000 0.000 pyplot.py:617(isinteractive)\n", + " 1 0.000 0.000 0.000 0.000 backend_bases.py:1906(_set_device_pixel_ratio)\n", + " 1 0.000 0.000 0.001 0.001 figure.py:2758(show)\n", + " 3 0.000 0.000 0.000 0.000 gridspec.py:766(update)\n", + " 1 0.000 0.000 0.000 0.000 {built-in method setAlignment}\n", + " 15 0.000 0.000 0.000 0.000 cbook.py:120(__init__)\n", + " 1 0.000 0.000 0.000 0.000 pyplot.py:556(draw_if_interactive)\n", + " 5 0.000 0.000 0.000 0.000 {built-in method _thread.get_native_id}\n", + " 6 0.000 0.000 0.000 0.000 {method 'pop' of 'collections.deque' objects}\n", + " 1 0.000 0.000 0.000 0.000 {built-in method numpy.zeros}\n", + " 2 0.000 0.000 0.000 0.000 figure.py:3332()\n", + " 2 0.000 0.000 0.000 0.000 transforms.py:1069(mutatedx)\n", + " 2 0.000 0.000 0.000 0.000 __init__.py:110(get_projection_class)\n", + " 4 0.000 0.000 0.000 0.000 {built-in method builtins.sum}\n", + " 5 0.000 0.000 0.000 0.000 {built-in method _operator.index}\n", + " 1 0.000 0.000 0.000 0.000 threading.py:308(_release_save)\n", + " 4 0.000 0.000 0.000 0.000 ticker.py:470(set_usetex)\n", + " 1 0.000 0.000 0.000 0.000 text.py:638(parse)\n", + " 4 0.000 0.000 0.000 0.000 gridspec.py:216(_normalize)\n", + " 3 0.000 0.000 0.000 0.000 weakref.py:417(__len__)\n", + " 18 0.000 0.000 0.000 0.000 Image.py:579(size)\n", + " 6 0.000 0.000 0.000 0.000 _base.py:319()\n", + " 1 0.000 0.000 0.008 0.008 hl_api_simulation.py:180(ResetKernel)\n", + " 1 0.000 0.000 0.000 0.000 {built-in method setAllowedAreas}\n", + " 1 0.000 0.000 0.000 0.000 decorators.py:45(wrapper)\n", + " 1 0.000 0.000 0.000 0.000 figure.py:2207(_set_artist_props)\n", + " 12 0.000 0.000 0.000 0.000 _base.py:454()\n", + " 4 0.000 0.000 0.000 0.000 axis.py:1943(set_minor_formatter)\n", + " 17 0.000 0.000 0.000 0.000 backend_bases.py:1866(draw)\n", + " 8 0.000 0.000 0.000 0.000 axis.py:673(isDefault_majloc)\n", + " 2 0.000 0.000 0.000 0.000 gridspec.py:541(__init__)\n", + " 1 0.000 0.000 0.000 0.000 {function MainWindow.closeEvent at 0x17561ac00}\n", + " 8 0.000 0.000 0.000 0.000 axis.py:494(__init__)\n", + " 6 0.000 0.000 0.000 0.000 {built-in method sys.getrecursionlimit}\n", + " 1 0.000 0.000 0.000 0.000 pyplot.py:282(install_repl_displayhook)\n", + " 2 0.000 0.000 0.000 0.000 figure.py:1702(sca)\n", + " 8 0.000 0.000 0.000 0.000 {method 'fileno' of '_socket.socket' objects}\n", + " 10 0.000 0.000 0.000 0.000 numeric.py:1181(_roll_dispatcher)\n", + " 9 0.000 0.000 0.000 0.000 artist.py:427(is_transform_set)\n", + " 2 0.000 0.000 0.000 0.000 __init__.py:54(__get__)\n", + " 3 0.000 0.000 0.000 0.000 hl_api_types.py:66(CreateParameter)\n", + " 4 0.000 0.000 0.000 0.000 cbook.py:2061(__iter__)\n", + " 6 0.000 0.000 0.000 0.000 PngImagePlugin.py:283(__init__)\n", + " 1 0.000 0.000 0.000 0.000 hl_api_random.py:33(uniform)\n", + " 12 0.000 0.000 0.000 0.000 contextlib.py:564(__enter__)\n", + " 1 0.000 0.000 0.000 0.000 gridspec.py:122(set_height_ratios)\n", + " 2 0.000 0.000 0.000 0.000 {built-in method size}\n", + " 1 0.000 0.000 0.013 0.013 backend_bases.py:3503(new_figure_manager_given_figure)\n", + " 2 0.000 0.000 0.000 0.000 _base.py:3869(get_ybound)\n", + " 2 0.000 0.000 0.000 0.000 {built-in method fromkeys}\n", + " 1 0.000 0.000 0.000 0.000 {built-in method _thread.allocate_lock}\n", + " 2 0.000 0.000 0.000 0.000 transforms.py:1074(mutatedy)\n", + " 1 0.000 0.000 0.000 0.000 {built-in method setFocusPolicy}\n", + " 2 0.000 0.000 0.000 0.000 figure.py:97(add)\n", + " 8 0.000 0.000 0.000 0.000 axis.py:823(_get_autoscale_on)\n", + " 12 0.000 0.000 0.000 0.000 inspect.py:3089(parameters)\n", + " 2 0.000 0.000 0.000 0.000 gridspec.py:551(_from_subplot_args)\n", + " 2 0.000 0.000 0.000 0.000 traitlets.py:3486(validate_elements)\n", + " 9 0.000 0.000 0.000 0.000 artist.py:1362(get_mouseover)\n", + " 4 0.000 0.000 0.000 0.000 {built-in method _signal.getsignal}\n", + " 3 0.000 0.000 0.000 0.000 patches.py:826(rotation_point)\n", + " 8 0.000 0.000 0.000 0.000 axis.py:681(isDefault_majfmt)\n", + " 2 0.000 0.000 0.000 0.000 {resizeEvent}\n", + " 2 0.000 0.000 0.000 0.000 hl_api_types.py:1180(is_spatial)\n", + " 1 0.000 0.000 0.000 0.000 __init__.py:678(_set)\n", + " 4 0.000 0.000 0.000 0.000 ticker.py:534(set_useLocale)\n", + " 2 0.000 0.000 0.000 0.000 __init__.py:81(get_projection_class)\n", + " 8 0.000 0.000 0.000 0.000 cbook.py:123(__call__)\n", + " 6 0.000 0.000 0.000 0.000 axis.py:1849(_set_converter)\n", + " 1 0.000 0.000 0.000 0.000 hl_api_types.py:1112(__mul__)\n", + " 12 0.000 0.000 0.000 0.000 pathlib.py:560(root)\n", + " 1 0.000 0.000 0.000 0.000 pyplot.py:1132(get_fignums)\n", + " 2 0.000 0.000 0.000 0.000 _base.py:3529(set_axis_on)\n", + " 4 0.000 0.000 0.000 0.000 ticker.py:488(set_useOffset)\n", + " 5 0.000 0.000 0.000 0.000 {built-in method width}\n", + " 1 0.000 0.000 0.000 0.000 contextlib.py:475(_create_cb_wrapper)\n", + " 6 0.000 0.000 0.000 0.000 ImageFile.py:93(_tilesort)\n", + " 2 0.000 0.000 0.000 0.000 _base.py:4106(set_navigate)\n", + " 1 0.000 0.000 0.000 0.000 markers.py:508(_half_fill)\n", + " 8 0.000 0.000 0.000 0.000 axis.py:689(isDefault_minloc)\n", + " 1 0.000 0.000 0.000 0.000 interactiveshell.py:1160(_set_call_pdb)\n", + " 2 0.000 0.000 0.000 0.000 cbook.py:126(__eq__)\n", + " 1 0.000 0.000 0.000 0.000 figure.py:3228(clear)\n", + " 1 0.000 0.000 0.000 0.000 {method 'pop' of 'collections.OrderedDict' objects}\n", + " 6 0.000 0.000 0.000 0.000 gridspec.py:74(get_geometry)\n", + " 3 0.000 0.000 0.000 0.000 _pylab_helpers.py:55()\n", + " 8 0.000 0.000 0.000 0.000 axis.py:697(isDefault_minfmt)\n", + " 6 0.000 0.000 0.000 0.000 text.py:580(_update_clip_properties)\n", + " 1 0.000 0.000 0.000 0.000 {method 'squeeze' of 'numpy.ndarray' objects}\n", + " 6 0.000 0.000 0.000 0.000 Image.py:344(preinit)\n", + " 6 0.000 0.000 0.000 0.000 figure.py:2658(_check_layout_engines_compat)\n", + " 2 0.000 0.000 0.000 0.000 figure.py:91(bubble)\n", + " 4 0.000 0.000 0.000 0.000 transforms.py:1756()\n", + " 2 0.000 0.000 0.000 0.000 _base.py:4127(set_navigate_mode)\n", + " 1 0.000 0.000 0.000 0.000 platform.py:1224(platform)\n", + " 1 0.000 0.000 0.000 0.000 builtin_trap.py:39(__enter__)\n", + " 4 0.000 0.000 0.000 0.000 _function_base_impl.py:1365(_diff_dispatcher)\n", + " 5/0 0.000 0.000 0.000 1331834536.py:24(update)\n", + " 1 0.000 0.000 0.000 0.000 markers.py:523(_set_point)\n", + " 3 0.000 0.000 0.000 0.000 cbook.py:648(__len__)\n", + " 5 0.000 0.000 0.000 0.000 threading.py:1631(main_thread)\n", + " 6 0.000 0.000 0.000 0.000 PngImagePlugin.py:1127(__init__)\n", + " 1 0.000 0.000 0.000 0.000 figure.py:3328(add_axobserver)\n", + " 6 0.000 0.000 0.000 0.000 shape_base.py:17(_atleast_1d_dispatcher)\n", + " 4 0.000 0.000 0.000 0.000 artist.py:1101(get_label)\n", + " 4 0.000 0.000 0.000 0.000 _base.py:4100(get_navigate)\n", + " 1 0.000 0.000 0.000 0.000 {built-in method window}\n", + " 8 0.000 0.000 0.000 0.000 spines.py:226(_clear)\n", + " 1 0.000 0.000 0.000 0.000 {method 'discard' of 'set' objects}\n", + " 1 0.000 0.000 0.000 0.000 magic.py:54(on_off)\n", + " 1 0.000 0.000 0.000 0.000 backend_qt.py:397(minimumSizeHint)\n", + " 3 0.000 0.000 0.000 0.000 _base.py:326(_setdefaults)\n", + " 1 0.000 0.000 0.000 0.000 hl_api_types.py:1094(__add__)\n", + " 1 0.000 0.000 0.000 0.000 cbook.py:179(pop)\n", + " 4 0.000 0.000 0.000 0.000 transforms.py:2148(inverted)\n", + " 1 0.000 0.000 0.000 0.000 figure.py:79(__init__)\n", + " 1 0.000 0.000 0.000 0.000 _pylab_helpers.py:33(get_fig_manager)\n", + " 2 0.000 0.000 0.000 0.000 figure.py:3000(set_canvas)\n", + " 4 0.000 0.000 0.000 0.000 transforms.py:1757()\n", + " 1 0.000 0.000 0.000 0.000 hl_api_types.py:1097(__radd__)\n", + " 6 0.000 0.000 0.000 0.000 inspect.py:2800(default)\n", + " 1 0.000 0.000 0.000 0.000 path.py:807(unit_circle)\n", + " 2 0.000 0.000 0.000 0.000 backend_qt.py:214()\n", + " 1 0.000 0.000 0.000 0.000 {built-in method setSizePolicy}\n", + " 1 0.000 0.000 0.000 0.000 {built-in method sys._getframe}\n", + " 1 0.000 0.000 0.000 0.000 queues.py:322(_consume_expired)\n", + " 2 0.000 0.000 0.000 0.000 multiarray.py:1053(unravel_index)\n", + " 1 0.000 0.000 0.000 0.000 {method '__enter__' of '_thread.lock' objects}\n", + " 1 0.000 0.000 0.000 0.000 threading.py:314(_is_owned)\n", + " 1 0.000 0.000 0.000 0.000 {built-in method setVisible}\n", + " 5 0.000 0.000 0.000 0.000 multiarray.py:107(empty_like)\n", + " 4 0.000 0.000 0.000 0.000 artist.py:307(stale)\n", + " 3 0.000 0.000 0.000 0.000 artist.py:904(get_clip_path)\n", + " 1 0.000 0.000 0.000 0.000 {method 'strip' of 'str' objects}\n", + " 1 0.000 0.000 0.000 0.000 {built-in method _string.formatter_parser}\n", + " 4 0.000 0.000 0.000 0.000 fromnumeric.py:2875(_cumsum_dispatcher)\n", + " 2 0.000 0.000 0.000 0.000 cbook.py:639(clear)\n", + " 4 0.000 0.000 0.000 0.000 ticker.py:258(_set_locator)\n", + " 2 0.000 0.000 0.000 0.000 spines.py:546(__init__)\n", + " 4 0.000 0.000 0.000 0.000 fromnumeric.py:965(_sort_dispatcher)\n", + " 2 0.000 0.000 0.000 0.000 gridspec.py:603(num2)\n", + " 2 0.000 0.000 0.000 0.000 {method 'clear' of 'list' objects}\n", + " 4 0.000 0.000 0.000 0.000 scale.py:96(__init__)\n", + " 2 0.000 0.000 0.000 0.000 widgets.py:38(__init__)\n", + " 1 0.000 0.000 0.000 0.000 {method 'move_to_end' of 'collections.OrderedDict' objects}\n", + " 1 0.000 0.000 0.000 0.000 {method 'release' of '_thread.lock' objects}\n", + " 1 0.000 0.000 0.000 0.000 cbook.py:635(__init__)\n", + " 1 0.000 0.000 0.000 0.000 gridspec.py:100(set_width_ratios)\n", + " 2 0.000 0.000 0.000 0.000 _base.py:2667(use_sticky_edges)\n", + " 1 0.000 0.000 0.000 0.000 interactiveshell.py:683(get_ipython)\n", + " 1 0.000 0.000 0.000 0.000 artist.py:1088(set_in_layout)\n", + " 1 0.000 0.000 0.000 0.000 interactiveshell.py:1157(_get_call_pdb)\n", + " 2 0.000 0.000 0.000 0.000 gridspec.py:607(get_gridspec)\n", + " 2 0.000 0.000 0.000 0.000 gridspec.py:599(num2)\n", + " 2 0.000 0.000 0.000 0.000 multiarray.py:995(ravel_multi_index)\n", + " 1 0.000 0.000 0.000 0.000 queues.py:59(_set_timeout)\n", + " 1 0.000 0.000 0.000 0.000 colors.py:93(get_named_colors_mapping)" + ] + } + ], + "source": [ + "%%prun\n", + "%pdb\n", + "\n", + "import sys\n", + "\n", + "r = Renderer(1200, 800, 600, 500, 400)\n", + "clock = pg.time.Clock()\n", + "running = True\n", + "\n", + "p = Physics(0, (np.random.rand() - 1) / 10)\n", + "\n", + "a = SpikingAgent(p.get_state(), 0.98)\n", + "\n", + "plot = Spiking_PlotRenderer()\n", + "\n", + "steps_per_episode = 0\n", + "\n", + "window_size = 20\n", + "window = np.zeros(window_size)\n", + "avg_lifetime = 20000\n", + "\n", + "toggle_sim = True\n", + "plot_spikes = True\n", + "stepping_sim = False\n", + "while running:\n", + " steps_per_episode += 1\n", + " force = 0\n", + " mouse_x = None\n", + " \n", + "# if steps_per_episode > 11:\n", + "# break\n", + "\n", + " # poll for events\n", + " for event in pg.event.get():\n", + " if event.type == pg.QUIT:\n", + " running = False\n", + " pg.quit()\n", + " sys.exit()\n", + " quit()\n", + " elif event.type == pg.MOUSEBUTTONDOWN:\n", + " mouse_x = r.get_relative_mouse_x(pg.mouse.get_pos()[0])\n", + " elif event.type == pg.KEYDOWN:\n", + " #controls if simulation should be shown or not\n", + " toggle_sim ^= pg.key.get_pressed()[pg.K_1]\n", + " #on button press plots the current spikes\n", + " plot_spikes ^= pg.key.get_pressed()[pg.K_2]\n", + " #on button press stores the network in ./saved_networks/network.json\n", + " if pg.key.get_pressed()[pg.K_3]:\n", + " a.save_network()\n", + " #toggles step-by-step simulation, updating now by pressing space\n", + " stepping_sim ^= pg.key.get_pressed()[pg.K_4]\n", + "\n", + " if stepping_sim:\n", + " toggle_sim = True\n", + " plot_spikes = True\n", + " next_step = False\n", + " while not next_step and stepping_sim:\n", + " pg.event.wait()\n", + " stepping_sim ^= pg.key.get_pressed()[pg.K_4]\n", + " next_step ^= pg.key.get_pressed()[pg.K_SPACE]\n", + "\n", + " # Simulate SNN, choose action, simulate physics, receive state\n", + " # Since SNN takes 40ms, it reacts only to every 2nd physics step\n", + " global action\n", + " action, plot_data = a.update(p.get_state())\n", + "\n", + " if action == AgentAction.FAILURE:\n", + " p.reset()\n", + " a.failure_reset(SpikingAgent.cycle_period)\n", + " window = np.roll(window, 1)\n", + " window[0] = steps_per_episode\n", + " steps_per_episode = 0\n", + " elif action == AgentAction.RIGHT:\n", + " force = 10\n", + " elif action == AgentAction.LEFT:\n", + " force = -10\n", + " else:\n", + " assert False, \"Unknown action returned\"\n", + " \n", + " theta, x = p.update(force, mouse_x)\n", + "\n", + " if plot_spikes and (steps_per_episode % 10 == 0):\n", + " plot.update(plot_data)\n", + " #plot_spikes = False\n", + " \n", + " a.save_prev_syn_wtr()\n", + " \n", + " syn_to_left = nest.GetConnections(source=a.input_population, target=a.output_population_left)\n", + " syn_to_right = nest.GetConnections(source=a.input_population, target=a.output_population_right)\n", + " for _syn in [syn_to_left, syn_to_right]:\n", + " _syn.wtr = 0.\n", + " _syn.pre_trace = 0.\n", + " #_syn.post_trace = 0. # need to do this in postsyn. neuron partner...\n", + " \n", + " a.output_population_left.post_trace__for_neuromodulated_stdp_synapse_nestml = 0.\n", + " a.output_population_right.post_trace__for_neuromodulated_stdp_synapse_nestml = 0.\n", + " \n", + " \n", + " \n", + " if np.mean(window) >= avg_lifetime or toggle_sim:\n", + " r.draw_clear()\n", + " r.draw_ground(0.2, \"grey\")\n", + " r.draw_car(x)\n", + " r.draw_pole(x, theta, 2*p.l, 0.02)\n", + " r.draw_stats(theta*180/np.pi, p.w*180/np.pi, x, p.v, a.get_episode(),\n", + " a.output_population_spike_recorder_left.n_events, \n", + " a.output_population_spike_recorder_right.n_events,\n", + " a.dopamine_left,\n", + " a.dopamine_right,\n", + " action)\n", + " r.display()\n", + "\n", + " clock.tick(50) # limits FPS to 50" + ] + }, + { + "cell_type": "markdown", + "id": "f6d4d920", + "metadata": {}, + "source": [ + "## Citations\n", + "\n", + "[1] Liu Y, Pan W. Spiking Neural-Networks-Based Data-Driven Control. Electronics. 2023; 12(2):310. https://doi.org/10.3390/electronics12020310 \n", + "\n", + "## Acknowledgements\n", + "\n", + "The authors would like to thank Prof. Wei Pan and Dr. Yuxiang Liu for kindly providing ..." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "25f41ea7", + "metadata": {}, + "outputs": [], + "source": [ + "a\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4b1c295b", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "cart_pole", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.8" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/doc/tutorials/cart_pole_reinforcement_learning/saved_networks/state_heatmap.py b/doc/tutorials/cart_pole_reinforcement_learning/saved_networks/state_heatmap.py new file mode 100644 index 000000000..bb70c2431 --- /dev/null +++ b/doc/tutorials/cart_pole_reinforcement_learning/saved_networks/state_heatmap.py @@ -0,0 +1,23 @@ +import json +import matplotlib.pyplot as plt +import numpy as np + +with open("network.json", "r") as f: + network = json.load(f) + +avg_weights_left = np.zeros((3,6,3,3)) +avg_weights_right = np.zeros((3,6,3,3)) +for s in network: + state = eval(s) #converts string tuple back to string + avg_weights_left[state[0], state[1], state[2], state[3]] = np.average(network[s]["connection_left"]["weight"]) + avg_weights_left[state[0], state[1], state[2], state[3]] = np.average(network[s]["connection_right"]["weight"]) + +avg_weights = avg_weights_right - avg_weights_left +plt.title("Weight for a state of (Position/Angle)") +# dimensions are (position, angle, velocity, angular velocity) indexed from 1 +# axis=(2,3) plots angle and position and averages over the two selected ones +plt.imshow(np.mean(avg_weights, axis = (2,3)), cmap=plt.cm.coolwarm, vmin=-1, vmax=1, interpolation='none') +plt.ylabel("Position") +plt.xlabel("Angle") +plt.colorbar() +plt.show() \ No newline at end of file diff --git a/doc/tutorials/cart_pole_reinforcement_learning/synapse_test.ipynb b/doc/tutorials/cart_pole_reinforcement_learning/synapse_test.ipynb new file mode 100644 index 000000000..4b453cbde --- /dev/null +++ b/doc/tutorials/cart_pole_reinforcement_learning/synapse_test.ipynb @@ -0,0 +1,204 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from pynestml.codegeneration.nest_code_generator_utils import NESTCodeGeneratorUtils\n", + "\n", + "# generate and build code\n", + "input_layer_module_name, input_layer_neuron_model_name = \\\n", + " NESTCodeGeneratorUtils.generate_code_for(\"../../../models/neurons/ignore_and_fire_neuron.nestml\")\n", + "\n", + "# ignore_and_fire\n", + "output_layer_module_name, output_layer_neuron_model_name, output_layer_synapse_model_name = \\\n", + " NESTCodeGeneratorUtils.generate_code_for(\"iaf_psc_exp_neuron.nestml\",\n", + " \"neuromodulated_stdp_synapse.nestml\",\n", + " post_ports=[\"post_spikes\"],\n", + " logging_level=\"DEBUG\",\n", + " codegen_opts={\"delay_variable\": {\"neuromodulated_stdp_synapse\": \"d\"},\n", + " \"weight_variable\": {\"neuromodulated_stdp_synapse\": \"w\"}})" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [ + { + "ename": "SyntaxError", + "evalue": "invalid syntax (1979800723.py, line 59)", + "output_type": "error", + "traceback": [ + "\u001b[0;36m Cell \u001b[0;32mIn[1], line 59\u001b[0;36m\u001b[0m\n\u001b[0;31m synapse_parameters.update({\"lambda\": lmbda})-\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n" + ] + } + ], + "source": [ + "import nest\n", + "import numpy as np\n", + "\n", + "def run_network(pre_spike_time, post_spike_time,\n", + " module_name,\n", + " neuron_model_name,\n", + " synapse_model_name,\n", + " resolution=1., # [ms]\n", + " delay=1., # [ms]\n", + " lmbda=1E-6,\n", + " sim_time=None, # if None, computed from pre and post spike times\n", + " synapse_parameters=None, # optional dictionary passed to the synapse\n", + " fname_snip=\"\"):\n", + "\n", + " nest.ResetKernel()\n", + " nest.Install(module_name)\n", + " nest.set_verbosity(\"M_ERROR\")\n", + " nest.print_time = False\n", + " nest.SetKernelStatus({\"resolution\": resolution})\n", + "\n", + " wr = nest.Create(\"weight_recorder\")\n", + " nest.CopyModel(synapse_model_name, \"stdp_nestml_rec\",\n", + " {\"weight_recorder\": wr[0],\n", + " \"w\": 1.,\n", + " \"n\": 1.,\n", + " \"d\": delay,\n", + " # \"receptor_type\": 0,\n", + " \"mu_minus\": 0.,\n", + " \"mu_plus\": 0.\n", + " })\n", + "\n", + " # create spike_generators with these times\n", + " pre_sg = nest.Create(\"spike_generator\",\n", + " params={\"spike_times\": [pre_spike_time, sim_time - 10.]})\n", + " post_sg = nest.Create(\"spike_generator\",\n", + " params={\"spike_times\": [post_spike_time],\n", + " \"allow_offgrid_times\": True})\n", + "\n", + " # create parrot neurons and connect spike_generators\n", + " pre_neuron = nest.Create(\"parrot_neuron\")\n", + " post_neuron = nest.Create(neuron_model_name)\n", + "\n", + " spikedet_pre = nest.Create(\"spike_recorder\")\n", + " spikedet_post = nest.Create(\"spike_recorder\")\n", + " #mm = nest.Create(\"multimeter\", params={\"record_from\" : [\"V_m\"]})\n", + "\n", + " nest.Connect(pre_sg, pre_neuron, \"one_to_one\", syn_spec={\"delay\": 1.})\n", + " nest.Connect(post_sg, post_neuron, \"one_to_one\", syn_spec={\"delay\": 1., \"weight\": 9999.})\n", + " nest.Connect(pre_neuron, post_neuron, \"all_to_all\", syn_spec={\"synapse_model\": \"stdp_nestml_rec\"})\n", + " #nest.Connect(mm, post_neuron)\n", + "\n", + " nest.Connect(pre_neuron, spikedet_pre)\n", + " nest.Connect(post_neuron, spikedet_post)\n", + "\n", + " # get STDP synapse and weight before protocol\n", + " syn = nest.GetConnections(source=pre_neuron, synapse_model=\"stdp_nestml_rec\")\n", + " if synapse_parameters is None:\n", + " synapse_parameters = {}\n", + " synapse_parameters.update({\"lambda\": lmbda})\n", + " nest.SetStatus(syn, synapse_parameters)\n", + "\n", + " initial_weight = nest.GetStatus(syn)[0][\"w\"]\n", + " np.testing.assert_allclose(initial_weight, 1)\n", + " nest.Simulate(sim_time)\n", + " updated_weight = nest.GetStatus(syn)[0][\"w\"]\n", + "\n", + " actual_t_pre_sp = nest.GetStatus(spikedet_pre)[0][\"events\"][\"times\"][0]\n", + " actual_t_post_sp = nest.GetStatus(spikedet_post)[0][\"events\"][\"times\"][0]\n", + "\n", + " dt = actual_t_post_sp - actual_t_pre_sp\n", + " dw = (updated_weight - initial_weight) / lmbda\n", + "\n", + " return dt, dw" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + "def plot_stdp_window(dt_vec, dw_vec, delay):\n", + " fig, ax = plt.subplots(dpi=120)\n", + " ax.scatter(dt_vec, dw_vec)\n", + " ax.set_xlabel(r\"t_post - t_pre [ms]\")\n", + " ax.set_ylabel(r\"$\\Delta w$\")\n", + "\n", + " for _ax in [ax]:\n", + " _ax.grid(which=\"major\", axis=\"both\")\n", + " _ax.grid(which=\"minor\", axis=\"x\", linestyle=\":\", alpha=.4)\n", + " _ax.set_xlim(np.amin(dt_vec), np.amax(dt_vec))\n", + " #_ax.minorticks_on()\n", + " #_ax.set_xlim(0., sim_time)\n", + "\n", + " ylim = ax.get_ylim()\n", + " ax.plot((np.amin(dt_vec), np.amax(dt_vec)), (0, 0), linestyle=\"--\", color=\"black\", linewidth=2, alpha=.5)\n", + " ax.plot((-delay, -delay), ylim, linestyle=\"--\", color=\"black\", linewidth=2, alpha=.5)\n", + " ax.set_ylim(ylim)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "def stdp_window(module_name, neuron_model_name, synapse_model_name, synapse_parameters=None):\n", + " sim_time = 1000. # [ms]\n", + " pre_spike_time = 100. #sim_time / 2 # [ms]\n", + " delay = 10. # dendritic delay [ms]\n", + "\n", + " dt_vec = []\n", + " dw_vec = []\n", + " for post_spike_time in np.arange(25, 175).astype(float):\n", + " dt, dw = run_network(pre_spike_time, post_spike_time,\n", + " module_name,\n", + " neuron_model_name,\n", + " synapse_model_name,\n", + " resolution=1., # [ms]\n", + " delay=delay, # [ms]\n", + " synapse_parameters=synapse_parameters,\n", + " sim_time=sim_time)\n", + " dt_vec.append(dt)\n", + " dw_vec.append(dw)\n", + "\n", + " return dt_vec, dw_vec, delay" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%matplotlib qt\n", + "dt_vec, dw_vec, delay = stdp_window(output_layer_module_name, output_layer_neuron_model_name, output_layer_synapse_model_name,\n", + " synapse_parameters={\"alpha\": .5})\n", + "\n", + "plot_stdp_window(dt_vec, dw_vec, delay)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "cart_pole", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.8" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}