From 6eb8a6c1e3a3a62be7be1f14922c8973aed7b4bb Mon Sep 17 00:00:00 2001 From: Andrew Gait Date: Thu, 11 Nov 2021 13:32:15 +0000 Subject: [PATCH 1/3] Make some adjustments of weight / STDP values to make examples better --- .../extra_models_examples/stdp_example_izk_cond.py | 2 +- examples/stdp_example_cond.py | 12 ++++++------ examples/stdp_example_izk.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/extra_models_examples/stdp_example_izk_cond.py b/examples/extra_models_examples/stdp_example_izk_cond.py index 7e79dc98..3e313e62 100644 --- a/examples/extra_models_examples/stdp_example_izk_cond.py +++ b/examples/extra_models_examples/stdp_example_izk_cond.py @@ -173,7 +173,7 @@ weight_dependence=sim.AdditiveWeightDependence(w_min=0, w_max=0.1)) plastic_projection = sim.Projection( - pre_pop, post_pop, sim.FixedProbabilityConnector(p_connect=1.0), # 0.5 + pre_pop, post_pop, sim.FixedProbabilityConnector(p_connect=0.5), # 0.5 synapse_type=stdp_model) # Record neurons' potentials diff --git a/examples/stdp_example_cond.py b/examples/stdp_example_cond.py index 9856e2e6..9e0e2f2c 100644 --- a/examples/stdp_example_cond.py +++ b/examples/stdp_example_cond.py @@ -146,20 +146,20 @@ # Noise projections sim.Projection( INoisePre, pre_pop, ee_connector, receptor_type='excitatory', - synapse_type=sim.StaticSynapse(weight=JEE * 0.001)) + synapse_type=sim.StaticSynapse(weight=JEE * 0.0012)) sim.Projection( INoisePost, post_pop, ee_connector, receptor_type='excitatory', - synapse_type=sim.StaticSynapse(weight=JEE * 0.001)) + synapse_type=sim.StaticSynapse(weight=JEE * 0.0012)) # Additional Inputs projections for i in range(len(IAddPre)): sim.Projection( IAddPre[i], pre_pop, ee_connector, receptor_type='excitatory', - synapse_type=sim.StaticSynapse(weight=JEE * 0.001)) + synapse_type=sim.StaticSynapse(weight=JEE * 0.0012)) for i in range(len(IAddPost)): sim.Projection( IAddPost[i], post_pop, ee_connector, receptor_type='excitatory', - synapse_type=sim.StaticSynapse(weight=JEE * 0.001)) + synapse_type=sim.StaticSynapse(weight=JEE * 0.0012)) # Plastic Connections between pre_pop and post_pop stdp_model = sim.STDPMechanism( @@ -182,7 +182,7 @@ # Run simulation sim.run(simtime) -print("Weights:{}".format(plastic_projection.get('weight', 'list'))) +# print("Weights:{}".format(plastic_projection.get('weight', 'list'))) pre_spikes = pre_pop.get_data('spikes') post_spikes = post_pop.get_data('spikes') @@ -192,7 +192,7 @@ Panel(pre_spikes.segments[0].spiketrains, yticks=True, markersize=0.5, xlim=(0, simtime)), Panel(post_spikes.segments[0].spiketrains, - yticks=True, markersize=0.5, xlim=(0, simtime)), + yticks=True, xticks=True, markersize=0.5, xlim=(0, simtime)), title="stdp example cond", annotations="Simulated with {}".format(sim.name())) plt.show() diff --git a/examples/stdp_example_izk.py b/examples/stdp_example_izk.py index 9b467147..5988f4bb 100644 --- a/examples/stdp_example_izk.py +++ b/examples/stdp_example_izk.py @@ -166,7 +166,7 @@ # Plastic Connections between pre_pop and post_pop stdp_model = sim.STDPMechanism( timing_dependence=sim.SpikePairRule( - tau_plus=20.0, tau_minus=20.0, A_plus=0.045, A_minus=0.045), + tau_plus=20.0, tau_minus=20.0, A_plus=0.45, A_minus=0.45), weight_dependence=sim.AdditiveWeightDependence(w_min=0, w_max=10)) plastic_projection = sim.Projection( From a391ad8f6d37db4a194eead0762def7d41de1f26 Mon Sep 17 00:00:00 2001 From: Andrew Gait Date: Mon, 11 Jul 2022 14:22:00 +0100 Subject: [PATCH 2/3] Stop float_gcd from failing --- examples/extra_models_examples/vogel_2011/vogels_2011_live.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/extra_models_examples/vogel_2011/vogels_2011_live.py b/examples/extra_models_examples/vogel_2011/vogels_2011_live.py index 7d33a251..831ae095 100644 --- a/examples/extra_models_examples/vogel_2011/vogels_2011_live.py +++ b/examples/extra_models_examples/vogel_2011/vogels_2011_live.py @@ -73,7 +73,7 @@ # Build inhibitory plasticity model stdp_model = sim.STDPMechanism( timing_dependence=sim.extra_models.Vogels2011Rule(alpha=0.12, tau=20.0, - A_plus=0.05), + A_plus=0.0005), weight_dependence=sim.AdditiveWeightDependence(w_min=0.0, w_max=1.0)) # Make inhibitory->excitatory projections From be6b25ba5ee1d5b4d5ce153ba3f2ce2d155ea9f1 Mon Sep 17 00:00:00 2001 From: Andrew Gait Date: Wed, 13 Sep 2023 14:20:12 +0100 Subject: [PATCH 3/3] Edit numbers to fix curve to look better --- examples/stdp_curve_cond.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/stdp_curve_cond.py b/examples/stdp_curve_cond.py index fbafed08..df330dcf 100644 --- a/examples/stdp_curve_cond.py +++ b/examples/stdp_curve_cond.py @@ -26,7 +26,7 @@ # ------------------------------------------------------------------ time_between_pairs = 1000 num_pairs = 60 -start_w = 0.005 +start_w = 0.05 delta_t = [-100, -60, -40, -30, -20, -10, -1, 1, 10, 20, 30, 40, 60, 100] start_time = 200 mad = True @@ -89,7 +89,7 @@ post_stim = sim.Population( 1, sim.SpikeSourceArray(spike_times=[post_times])) - weight = 0.035 + weight = 0.075 # Connections between spike sources and neuron populations ee_connector = sim.OneToOneConnector() @@ -104,9 +104,9 @@ stdp_model = sim.STDPMechanism( timing_dependence=sim.SpikePairRule( tau_plus=16.7, tau_minus=33.7, - A_plus=0.0000875, A_minus=0.0000875), + A_plus=0.00075, A_minus=0.00075), weight_dependence=sim.AdditiveWeightDependence( - w_min=0.0, w_max=0.0175), weight=start_w) + w_min=0.0, w_max=1.0), weight=start_w) projections.append(sim.Projection( pre_pop, post_pop, sim.OneToOneConnector(),