Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Eprop examples #107

Draft
wants to merge 88 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
711e910
one neuron test
Sep 19, 2019
2c585c0
add spike source and single spike
oliverrhodes Sep 19, 2019
0a39a84
added regularisation functionality
Sep 26, 2019
65c682b
Merge branch 'eprop_adaptive' of https://github.com/SpiNNakerManchest…
Sep 26, 2019
e17d22f
added adaptive neuron
Sep 26, 2019
c65d33c
clean up working test
oliverrhodes Sep 26, 2019
d31e569
Update tests
Sep 27, 2019
10c38e1
update test script
oliverrhodes Oct 8, 2019
860f972
Merge branch 'eprop_adaptive' of https://github.com/SpiNNakerManchest…
oliverrhodes Oct 8, 2019
3df0760
add signed weights test
Oct 8, 2019
8b589d7
move store recall test to PyNN8_Examples
Oct 8, 2019
8b90542
Update test to read weights back from machine to check
oliverrhodes Oct 8, 2019
cc24f57
tweak tests to match baseline params
oliverrhodes Oct 18, 2019
e3a17b7
Update eprop test scripts
oliverrhodes Nov 15, 2019
8b92ec6
update tests
oliverrhodes Nov 26, 2019
13cab5a
Add test skeleton to include learning signal
oliverrhodes Nov 26, 2019
77ef7d3
update payload testing
oliverrhodes Nov 27, 2019
09e63de
add sinusoid to test script
oliverrhodes Nov 27, 2019
9d6790f
learning signal by payload
oliverrhodes Nov 28, 2019
3645ad2
update test
oliverrhodes Nov 28, 2019
cdd6a93
update params
oliverrhodes Dec 13, 2019
067c81a
Update tests to use new receptor targets
oliverrhodes Jan 24, 2020
b26172a
add delta synapse test
oliverrhodes Jan 24, 2020
2a10c2f
update to one neuron test
oliverrhodes Mar 1, 2020
8031a7a
Merge branch 'eprop_adaptive' of
oliverrhodes Mar 1, 2020
389cc42
full test for all sinusoid learning
adamperrett Mar 2, 2020
f44f078
Merge remote-tracking branch 'origin/eprop_adaptive' into eprop_adaptive
adamperrett Mar 2, 2020
f1ad37b
add test of plastic synapse
oliverrhodes Mar 3, 2020
7e0df0d
Add regularisation test (not yet fully working)
oliverrhodes Mar 3, 2020
4a33b83
Merge branch 'eprop_adaptive' of https://github.com/SpiNNakerManchest…
adamperrett Mar 3, 2020
c292ef8
added some more tests
adamperrett Mar 4, 2020
9d1543a
correct, hopefully, sinusoid test
adamperrett Mar 10, 2020
dad23ad
better prints and init weights more graz like
adamperrett Mar 11, 2020
a0e6c51
prob connector and fancier prints
adamperrett Mar 13, 2020
0e950cf
changes to prints and some minor reformatting
adamperrett Mar 17, 2020
cac91ed
cleaned up mainly
adamperrett Mar 19, 2020
3c6e3bc
File which only performs learning on sinusoid readout, no eprop neuro…
adamperrett Mar 19, 2020
c6ea10b
updates to the way spikes are input into network, cleaner prints and …
adamperrett Mar 26, 2020
a621ba6
Test pause-and-resume for eprop neurons; update scripts for Python 3
andrewgait Apr 6, 2020
e77d1c2
Revert "Test pause-and-resume for eprop neurons; update scripts for P…
andrewgait Apr 6, 2020
10eb384
Test pause-and-resume for eprop neurons, fix for Python 3
andrewgait Apr 6, 2020
3ab9c6c
Add configuration to test single input cycle per target cycle
oliverrhodes Apr 8, 2020
0d18074
Merge pull request #35 from SpiNNakerManchester/eprop_pause_and_resume
oliverrhodes Apr 8, 2020
0d1501e
'best' learning with only readout, spike pattern now creates actual 1…
adamperrett Apr 21, 2020
ad736db
Merge remote-tracking branch 'origin/eprop_adaptive' into eprop_adaptive
adamperrett Apr 21, 2020
58e4b35
fixed control edge bug, prints spikes
adamperrett Apr 29, 2020
83822de
Tests for delayed weight update
oliverrhodes May 26, 2020
82f35a1
better plots and more up to date tests, test script for comparing fir…
adamperrett Jun 1, 2020
50a36e4
Merge pull request #38 from SpiNNakerManchester/eprop_adpative_delaye…
oliverrhodes Jun 2, 2020
66301b8
created test for network that completes the task to a low level, mino…
adamperrett Jun 11, 2020
53937d8
Merge remote-tracking branch 'origin/eprop_adaptive' into eprop_adaptive
adamperrett Jun 11, 2020
7206e3e
New tests to explore readout and left-right issues
adamperrett Jun 17, 2020
4df74b6
beta input, binary classification added, connections sorted properly …
adamperrett Jun 26, 2020
22fe35f
good parameters for learning
adamperrett Jul 3, 2020
d3cb445
parameter updates, xavier init, incremental learning with plotting an…
adamperrett Jul 16, 2020
aeff217
Update to run in python 3, remove some recording
andrewgait Jul 22, 2020
145d6ff
updated to python3, small updates to variables and plotting
adamperrett Sep 25, 2020
bcf5ebc
created a number of files for running eprop LR with increasing number…
adamperrett Sep 25, 2020
5fb64f4
slight change to variable and random seed, number_of_cues now input too
adamperrett Sep 29, 2020
2e9ae8d
removed unnecessary code, slight change to params
adamperrett Sep 29, 2020
2277eeb
Missing "clear" parameters
andrewgait Sep 29, 2020
80bb4f5
Merge branch 'eprop_incremental_graph' of https://github.com/SpiNNake…
andrewgait Sep 29, 2020
f8f98a8
Put the clear parameter in the right place... !
andrewgait Sep 30, 2020
a33514f
Turned off recording, plotting learning curve now includes a cumulati…
adamperrett Oct 2, 2020
2fef072
Merge remote-tracking branch 'origin/eprop_incremental_graph' into ep…
adamperrett Oct 2, 2020
33c2373
Major updates to plotting, video creation function
adamperrett Oct 6, 2020
6a320fc
Added free string for easy addition of custom changes to test label
adamperrett Oct 6, 2020
5d933be
Code clean up
adamperrett Oct 6, 2020
93d787a
Added setup file for terminal execution
adamperrett Oct 6, 2020
9b73122
Removed PyNN8Examples include as terminal doesn't like it
adamperrett Oct 6, 2020
e2db1a3
small changes to tests
adamperrett Oct 13, 2020
2b59123
Merge branch 'eprop_adaptive' into eprop_incremental_graph
andrewgait Oct 22, 2020
a6a94c5
Merge pull request #42 from SpiNNakerManchester/eprop_incremental_graph
andrewgait Oct 22, 2020
61a72d7
Merge remote-tracking branch 'origin/master' into eprop_adaptive_update
andrewgait Mar 24, 2023
84d8826
Update scripts to work with current version
andrewgait May 5, 2023
72d5d93
Merge remote-tracking branch 'origin/master' into eprop_adaptive_update
andrewgait May 9, 2023
e3aedfd
Tidy up scripts
andrewgait May 12, 2023
6055986
Switch scripts to use pyNN.spiNNaker and minor tidying up
andrewgait May 25, 2023
e3456a0
Add cfg file and update gitignore
andrewgait Jul 6, 2023
2e08c07
Merge branch 'master' into eprop_adaptive_update
andrewgait Jul 6, 2023
b650ef2
Merge branch 'master' into eprop_adaptive_update
andrewgait Aug 8, 2023
23edf9d
Not sure why this file is still here
andrewgait Aug 8, 2023
f7771af
Add licenses
andrewgait Aug 8, 2023
d5c2cf1
Missing license and add to excludes
andrewgait Aug 9, 2023
1fcfef2
Not sure where these two files came from
andrewgait Aug 9, 2023
b8eef33
Merge branch 'master' into eprop_adaptive_update
andrewgait Sep 20, 2023
0664975
Merge branch 'master' into eprop_adaptive_update
Christian-B Jan 5, 2024
056d28a
Merge branch 'master' into eprop_adaptive_update
Christian-B May 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ __pycache__
*application_generated_data_files/
*reports/
.mypy_cache/
*big_with_labels/
*graphs/
1 change: 1 addition & 0 deletions .ratexcludes
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
**/*.colour_map
**/*.col
**/*.npy
**/SpiNNUtils/**
**/SpiNNMachine/**
**/SpiNNMan/**
Expand Down
Binary file added eprop_testing/1000 neurons - 10Hz - 100*1024s.npy
Binary file not shown.
13 changes: 13 additions & 0 deletions eprop_testing/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2019 The University of Manchester
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
425 changes: 425 additions & 0 deletions eprop_testing/create_pops_for_incremental_learning.py

Large diffs are not rendered by default.

92 changes: 92 additions & 0 deletions eprop_testing/delta_synapse_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Copyright (c) 2019 The University of Manchester
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import pyNN.spiNNaker as pynn
import numpy as np
import matplotlib.pyplot as plt
from pyNN.random import NumpyRNG, RandomDistribution
from pyNN.utility.plotting import Figure, Panel


runtime = 100
pynn.setup(1.0)

neuron_params = {
"v": 0,
"i_offset": 0,
"v_rest": 0
}


inp_spike_source = pynn.Population(2,
pynn.SpikeSourceArray,
{'spike_times': [10]},
label='Spike Source')

pseudo_rec_spike_source = pynn.Population(2,
pynn.SpikeSourceArray,
{'spike_times': [80]},
label='Spike Source')

neuron = pynn.Population(2,
pynn.extra_models.EPropAdaptive(**neuron_params),
label='eprop_pop')

inp_proj = pynn.Projection(inp_spike_source, neuron,
pynn.OneToOneConnector(),
# note that delays are now fixed to one in terms of spikes,
# but the synaptic word field indexes the synapse array
pynn.StaticSynapse(weight=[-0.5, 10] , delay=[1, 1]),
receptor_type='input_connections')


rec_proj = pynn.Projection(pseudo_rec_spike_source, neuron,
pynn.OneToOneConnector(),
# note that delays are now fixed to one in terms of spikes,
# but the synaptic word field indexes the synapse array
pynn.StaticSynapse(weight=[0.5, -10] , delay=[1, 1]),
receptor_type='recurrent_connections')



neuron.record('all')

pynn.run(runtime)

res = neuron.get_data('all')
weights = inp_proj.get('weight', 'list', with_address=False)
delays = inp_proj.get('delay', 'list', with_address=False)

for i in range(len(weights)):
print(weights[i], delays[i])

Figure(
Panel(res.segments[0].filter(name='v')[0],
ylabel="Membrane potential (mV)",
data_labels=neuron.label, yticks=True, xlim=(0, runtime)),
Panel(res.segments[0].filter(name='gsyn_exc')[0],
ylabel="gsyn excitatory (mV)",
data_labels=neuron.label, yticks=True, xlim=(0, runtime)),
Panel(res.segments[0].filter(name='gsyn_inh')[0],
xlabel="Time (ms)", xticks=True,
ylabel="gsyn inhibitory (mV)",
data_labels=neuron.label, yticks=True, xlim=(0, runtime)),
Panel(res.segments[0].spiketrains,
ylabel="Output Spikes",
data_labels=neuron.label, yticks=True, xlim=(0, runtime)),
title="Single eprop neuron"
)

plt.show()

pynn.end()
285 changes: 285 additions & 0 deletions eprop_testing/frozen_poisson.py

Large diffs are not rendered by default.

Loading
Loading