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

Spinncer weight scale #1386

Draft
wants to merge 307 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
307 commits
Select commit Hold shift + click to select a range
b944223
Return the provenance
rowleya May 19, 2020
1284951
Fix unit tests
rowleya May 20, 2020
ad128f8
Need to pass the parameters!
rowleya May 20, 2020
25cd5ca
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Jul 28, 2020
d4132ff
flake8 line lengths, unused imports
andrewgait Jul 28, 2020
20d210a
Updates to fix integration tests, particularly for kernel connectors
andrewgait Jul 30, 2020
be89efd
Deal with array length of 1
andrewgait Jul 30, 2020
979891a
flake8 whitespaces
andrewgait Jul 30, 2020
459ff56
Check representable weights properly when weight_scale isn't 1
andrewgait Jul 31, 2020
780d513
Also need to use (float) gcd in STDP cases for better representation
andrewgait Jul 31, 2020
3802b28
tagged IMPLICIT WEIGHT SCALING with a comment
pabogdan Aug 3, 2020
7f11fbf
round to nearest wherever I can
pabogdan Aug 12, 2020
c06ecdd
exponential time constant is now an unsigned long fract
pabogdan Aug 12, 2020
2aa4f94
potentially fixed v recording
pabogdan Aug 14, 2020
129a45e
correct recording of v
pabogdan Aug 17, 2020
8a4991d
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Aug 20, 2020
01a55b4
Again Python 2 appears to be doing something weird
andrewgait Aug 20, 2020
9851271
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Sep 1, 2020
b3da07b
Got the merge slightly wrong...
andrewgait Sep 1, 2020
16bad5d
Wrong argument again...
andrewgait Sep 1, 2020
611148f
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Sep 10, 2020
fb027ec
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Sep 15, 2020
5db07d9
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Sep 17, 2020
baf36a1
Use a better tolerance for float gcd, and give constant a name
andrewgait Sep 17, 2020
4627b95
flake8 unused import
andrewgait Sep 17, 2020
687f791
Get closest representable weight before doing gcd, edit tolerance
andrewgait Sep 18, 2020
b817ead
Fiddle with tolerance again
andrewgait Sep 18, 2020
e764529
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Oct 6, 2020
9e5ac2a
Avoid dividing by zero...
andrewgait Oct 6, 2020
d42a790
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Oct 15, 2020
15be8d3
flake8 sort imports out
andrewgait Oct 15, 2020
4547624
Missing arguments in unittest functions
andrewgait Oct 15, 2020
0b67f24
Update to work properly for cases with multiple edges into same vertex
andrewgait Oct 16, 2020
ce0f603
Smarter multiplication needed...
andrewgait Oct 20, 2020
7f8098a
Update to fix STDP examples
andrewgait Oct 20, 2020
04782bc
Seriously...
andrewgait Oct 20, 2020
156a8e0
Another one to stop python 2.7 complaining
andrewgait Oct 20, 2020
4397eef
Calculation should happen after checking None / zero
andrewgait Oct 21, 2020
b6f2734
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Jan 15, 2021
4dc0659
flake8 unused import
andrewgait Jan 15, 2021
e182a42
missing argument
andrewgait Jan 15, 2021
2a39154
Attempt to bypass python2 issue
andrewgait Jan 15, 2021
7501669
Helps if you actually write what you meant to... and, not or...
andrewgait Jan 15, 2021
898651e
Fix multiplicative STDP rule
andrewgait Jan 19, 2021
d44b9e7
Try this tolerance instead... ?
andrewgait Jan 19, 2021
9a642f2
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Feb 5, 2021
87f4900
missed these when merging
andrewgait Feb 5, 2021
f9008a5
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Feb 26, 2021
18d3268
flake8 imports
andrewgait Mar 1, 2021
cb2a3ce
Further tidying up
andrewgait Mar 1, 2021
0964a1e
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Mar 30, 2021
dda8431
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Apr 13, 2021
68fd70d
Don't need to check weight if using distance-dependent; fix test
andrewgait Apr 13, 2021
3f1ab5d
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Apr 29, 2021
3aa4ef5
Missed a removed config
andrewgait Apr 29, 2021
03c2d34
Actually import function
andrewgait Apr 29, 2021
f16aee3
Use get_config_str instead?
andrewgait Apr 29, 2021
d57a79f
Switch to get_config_float for these parameters
andrewgait Apr 29, 2021
3ac340c
Merge branch 'master' into weight_scale
andrewgait Apr 29, 2021
e2b5475
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Jun 10, 2021
40e3610
Unneeded argument
andrewgait Jun 10, 2021
e641aef
Argument left in here too somehow; removed
andrewgait Jun 10, 2021
9c6d00a
flake8 unused imports; replace get_simulator
andrewgait Jun 10, 2021
426b944
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Jul 9, 2021
6f4f681
Use correct arguments in create_vertex
andrewgait Jul 9, 2021
d00063f
doc fix
andrewgait Jul 9, 2021
dcfa118
try this doc fix instead
andrewgait Jul 9, 2021
3728d61
It might be these docs that are wrong instead
andrewgait Jul 9, 2021
4cd4d9f
I guess this doc isn't actually necessary...
andrewgait Jul 9, 2021
44b05c8
Merge branch 'master' into weight_scale
andrewgait Jul 9, 2021
1f5f197
These tolerances / constants seem to strike the right balance for now
andrewgait Jul 29, 2021
6a579ca
Reset min_weights after connection cache is cleared
andrewgait Jul 29, 2021
27736f8
Only reset min_weights if requried to do so
andrewgait Jul 30, 2021
c976494
Merge branch 'master' into weight_scale
andrewgait Aug 24, 2021
f16511d
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Oct 7, 2021
1421414
Do the minimum weight calculation for RandomDistributions better
andrewgait Oct 11, 2021
130f2b8
Use the maximum weight if necessary in the minimum weight calculation
andrewgait Oct 12, 2021
f4d2bcd
Better choice of tolerance for microcircuit that still works with STDP
andrewgait Oct 18, 2021
5205b70
Merge branch 'master' into weight_scale
andrewgait Oct 18, 2021
587b489
Tolerance shouldn't be lower than smallest representable value
andrewgait Oct 18, 2021
368951b
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Oct 27, 2021
b8a6581
Remove print statement
andrewgait Oct 28, 2021
abb3b13
Merge branch 'master' into weight_scale
andrewgait Nov 2, 2021
cf89bbe
Merge branch 'master' into weight_scale
andrewgait Nov 2, 2021
a1deebc
Merge branch 'master' into weight_scale
andrewgait Nov 5, 2021
5cae4e2
Merge branch 'master' into weight_scale
andrewgait Nov 5, 2021
960b452
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Nov 8, 2021
fa1e909
Fix STDP weight rules; works for current-based neurons...
andrewgait Nov 10, 2021
2e8179c
Merge branch 'master' into weight_scale
andrewgait Nov 10, 2021
2e2428d
Merge branch 'master' into weight_scale
andrewgait Nov 11, 2021
dd9f02d
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Nov 25, 2021
5aa6e47
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Dec 6, 2021
9d64eb2
moved function to header but not the associated header...
andrewgait Dec 6, 2021
f2aac78
Move IF_cond_alpha from spynnaker8 repo
andrewgait Dec 6, 2021
bcc4809
spinncer single cell experiment running
andrewgait Dec 6, 2021
db29ff8
add rb_left_shifts to tests
andrewgait Dec 6, 2021
44d569e
Can't take logs of something that could be zero
andrewgait Dec 6, 2021
bb735e6
fix to pass tests for now, but this constant was 64 earlier on branch...
andrewgait Dec 6, 2021
2a70830
flake8
andrewgait Dec 6, 2021
8318cb9
pylint caught a missed argument
andrewgait Dec 6, 2021
7b1789f
pylint, again I somehow missed this argument
andrewgait Dec 6, 2021
51196ab
Add copyright to spike_profiling.h
andrewgait Dec 6, 2021
3d1f36c
Allow up to 64 time slots for delays, update test accordingly
andrewgait Dec 7, 2021
f7de591
move send_spike out of sub-cycle; fix peak for n_atoms=1
andrewgait Dec 8, 2021
9714ba4
Add structured provenance filename reference
andrewgait Dec 16, 2021
8751d8d
Merge branch 'master' into weight_scale
andrewgait Jan 10, 2022
efa4d56
Merge branch 'master' into weight_scale
andrewgait Feb 25, 2022
29e72f8
Merge branch 'master' into weight_scale
andrewgait Mar 11, 2022
2299939
Merge branch 'master' into weight_scale
andrewgait Mar 28, 2022
4c4c090
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Apr 1, 2022
cb19247
Merge branch 'master' into weight_scale
andrewgait Apr 14, 2022
af03b49
Merge branch 'master' into weight_scale
andrewgait Apr 20, 2022
e8773dd
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Apr 20, 2022
5c17e82
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Apr 21, 2022
00f589d
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Apr 22, 2022
3c4430a
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait May 9, 2022
b96bf3e
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait May 11, 2022
2f9a312
Merge branch 'master' into weight_scale
andrewgait May 19, 2022
97bff12
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait May 20, 2022
20130b5
Switch to using less current source ITCM in larger binary cases
andrewgait May 20, 2022
d6a0cfb
Merge branch 'master' into weight_scale
andrewgait May 20, 2022
d841462
Switch some makefiles to step-only CS since DC is a subset of Step
andrewgait May 23, 2022
6d1f472
Oops, too big
andrewgait May 23, 2022
d194eb7
Don't use config for min_weight; move to (pop) additional_parameters
andrewgait May 25, 2022
ab813da
remove unused import
andrewgait May 25, 2022
7829121
Add doc back in
andrewgait May 25, 2022
5d781fe
Merge branch 'master' into weight_scale
andrewgait May 25, 2022
bf997b6
Simplify
andrewgait May 25, 2022
6d99601
Move specific min weight calculations from vertex to synapse dynamics
andrewgait May 26, 2022
c5f7a75
Remove no longer used imports and add missing line at end of file
andrewgait May 26, 2022
6be8bb6
Remove commented out code
andrewgait May 26, 2022
c17a073
Test via tolerance rather than using adjustment from code function
andrewgait May 26, 2022
a599cbe
Remove unused import
andrewgait May 26, 2022
9a75735
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Jun 16, 2022
30f7c1a
Merge branch 'master' into weight_scale
andrewgait Jun 17, 2022
c53f6f6
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Jul 11, 2022
bad2c1a
Missed in merge
andrewgait Jul 11, 2022
471251b
reduce binary size
andrewgait Jul 11, 2022
7f65411
w_max no longer needed here
andrewgait Jul 11, 2022
c87d501
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Jul 19, 2022
16422d9
Missed these prints
andrewgait Jul 19, 2022
caf6b48
Move print functions under log debug
andrewgait Jul 19, 2022
2c95c1f
Not sure how this file came back again...
andrewgait Jul 19, 2022
f8ec966
Turn off largest binaries for now
andrewgait Jul 19, 2022
e51cfed
Implement no current source; update Makefiles for large binaries
andrewgait Jul 20, 2022
32ca82c
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Jul 22, 2022
9df970f
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Jul 26, 2022
8d63c76
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Aug 3, 2022
e279e00
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Aug 4, 2022
9684999
Merge branch 'master' into weight_scale
andrewgait Aug 4, 2022
021bffb
Merge branch 'master' into weight_scale
andrewgait Aug 22, 2022
683cbf7
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Aug 22, 2022
7809948
Merge branch 'master' into weight_scale
andrewgait Aug 31, 2022
6e86dbd
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Aug 31, 2022
b11c316
Delay slots constant has been moved to the splitter
andrewgait Aug 31, 2022
9c154f5
Merge branch 'spinncer_update' of https://github.com/SpiNNakerManches…
andrewgait Aug 31, 2022
f696f04
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Sep 9, 2022
4fc7cf8
flake8
andrewgait Sep 9, 2022
3848c81
more linting
andrewgait Sep 9, 2022
1523ae8
Override get_weight_minimum for new kernel-based connectors
andrewgait Sep 12, 2022
7cb9898
Update comment
andrewgait Sep 12, 2022
d197122
Fix min_weight calculation for local-only case
andrewgait Sep 14, 2022
0f62aa8
Merge branch 'master' into weight_scale
andrewgait Sep 14, 2022
65eae83
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Sep 15, 2022
040382f
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Sep 16, 2022
bbb2713
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Sep 21, 2022
125005e
Fit debug builds into ITCM
andrewgait Sep 22, 2022
df38557
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Sep 22, 2022
08f377e
Delete test no longer in master, go back to spinncer delay tics values
andrewgait Sep 22, 2022
4f0eaec
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Sep 26, 2022
0d78f41
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Sep 27, 2022
ed4912c
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Sep 27, 2022
1bcdb6e
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Sep 29, 2022
97ea253
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Sep 30, 2022
0418d8a
Attempt to catch possible issues with ring buffer DTCM for longer delays
andrewgait Oct 3, 2022
10d430c
Adjust DELAY_MASK calculations
andrewgait Oct 4, 2022
91ea67d
Revert "Adjust DELAY_MASK calculations"
andrewgait Oct 4, 2022
43f4178
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Oct 21, 2022
bd8e776
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Oct 27, 2022
d855623
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Nov 18, 2022
6b23dbe
Comment out unnecessary printing
andrewgait Nov 18, 2022
6261369
flake8 sort out imports
andrewgait Nov 18, 2022
b205190
Reduce ITCM further...
andrewgait Nov 18, 2022
7ecb575
See if this helps with ITCM
andrewgait Nov 18, 2022
2022748
Reduce ITCM by using min_weight reciprocal
andrewgait Nov 22, 2022
2c4bfcd
vera line length, and change info to debug
andrewgait Nov 22, 2022
16ccb43
Vera line length and tidy up
andrewgait Nov 22, 2022
a624e57
More tidying up
andrewgait Nov 22, 2022
f6754fe
Remove unneeded check in alpha synapse
andrewgait Nov 22, 2022
a8d864b
Trying to save more ITCM
andrewgait Nov 22, 2022
d3d745d
Yet more ITCM savings...
andrewgait Nov 22, 2022
514c8c8
Saving more ITCM...
andrewgait Nov 22, 2022
aab7916
Simplify code on machine to only split array when needed
andrewgait Nov 23, 2022
de09312
Add missing check to _get_weight_maximum
andrewgait Nov 24, 2022
e874b99
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Nov 24, 2022
f7fc478
Update to stop compiler warnings
andrewgait Nov 30, 2022
92333ae
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Nov 30, 2022
d7bf5de
missed in merge
andrewgait Nov 30, 2022
5905d56
Still trying to work out ITCM problems on this branch
andrewgait Dec 1, 2022
5261019
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Dec 1, 2022
1204c55
Seems like this UFRACT is the culprit
andrewgait Dec 1, 2022
2feb571
Only need to sum g_syn on the first step
andrewgait Dec 2, 2022
543e8f7
Put the rounding multiplications back in...
andrewgait Dec 2, 2022
001e4d9
Save ITCM
andrewgait Dec 5, 2022
c2de26b
vera remove trailing line
andrewgait Dec 5, 2022
5e16ddc
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Jan 11, 2023
768e721
Merge branch 'master' into weight_scale
andrewgait Jan 11, 2023
94f97a9
pylint is now more strict
andrewgait Jan 12, 2023
7ed6b66
Merge branch 'weight_scale' of https://github.com/SpiNNakerManchester…
andrewgait Jan 12, 2023
a430559
Merge branch 'master' into weight_scale
andrewgait Jan 12, 2023
6d52191
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Jan 17, 2023
7ea6378
Try 16 delay tics by default
andrewgait Jan 17, 2023
e4143f4
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Jan 18, 2023
e73f796
Merge branch 'master' into weight_scale
andrewgait Jan 24, 2023
8308d03
Merge branch 'master' into weight_scale
andrewgait Jan 27, 2023
e8f49fb
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Feb 10, 2023
d3e4fe5
pylint fix exception
andrewgait Feb 10, 2023
bff3186
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Feb 20, 2023
13b2e10
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Feb 23, 2023
9ee5037
Merge branch 'master' into weight_scale
andrewgait Mar 1, 2023
ed6aad6
Turn this error off for now
andrewgait Mar 6, 2023
5d26f57
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Apr 11, 2023
f9720f6
Fix doc error
andrewgait Apr 11, 2023
badb25e
Merge branch 'master' into weight_scale
andrewgait Apr 21, 2023
19df82d
Remove debug print statements
andrewgait Apr 21, 2023
62f68bb
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait May 17, 2023
fac0eba
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Jun 23, 2023
3a71b6e
DataType is now in FrontEndCommon
andrewgait Jun 23, 2023
9ac6bb8
Upgrade actions OS (to use a newer compiler)
andrewgait Jun 23, 2023
7460fb8
Merge remote-tracking branch 'origin/master' into weight_scale
andrewgait Jul 6, 2023
30c0127
Merge remote-tracking branch 'origin/master' into spinncer_update
andrewgait Jul 7, 2023
c2cbfaa
Update license
andrewgait Jul 7, 2023
0cc50f5
Merge branch 'weight_scale' into spinncer_weight_scale
andrewgait Jul 7, 2023
a54c0a2
Merge remote-tracking branch 'origin/weight_scale' into
andrewgait Jul 7, 2023
5afe281
Merge remote-tracking branch 'origin/master' into spinncer_weight_scale
andrewgait Aug 3, 2023
257ce82
Fix merge
andrewgait Aug 4, 2023
f381fb6
flake8
andrewgait Aug 4, 2023
0161cb0
Not sure how this license got missed in merge
andrewgait Aug 4, 2023
9d0022f
Add round-to-nearest multiplies back in neuron components
andrewgait Aug 11, 2023
69a5ec4
Adding rounding here should work but causes UNDEF errors?
andrewgait Aug 11, 2023
da5a0b3
Add comment about UNDEF
andrewgait Aug 11, 2023
a49b959
Merge remote-tracking branch 'origin/master' into spinncer_weight_scale
andrewgait Aug 29, 2023
1bc1f03
Merge remote-tracking branch 'origin/master' into spinncer_weight_scale
andrewgait Sep 12, 2023
0cb28ac
Use stochastic rounding everywhere, particularly for synapse row
andrewgait Sep 12, 2023
17339cb
Add previous method back in comment
andrewgait Sep 12, 2023
f09928f
Merge remote-tracking branch 'origin/master' into spinncer_weight_scale
andrewgait Sep 20, 2023
e9a6956
Try this instead
andrewgait Sep 20, 2023
6d8ec3a
Use absolute value for min weight change and fix test
andrewgait Sep 21, 2023
08e6e26
Merge remote-tracking branch 'origin/master' into spinncer_weight_scale
andrewgait Sep 26, 2023
f25485a
Merge remote-tracking branch 'origin/master' into spinncer_weight_scale
andrewgait Sep 29, 2023
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
25 changes: 25 additions & 0 deletions neural_modelling/makefiles/neuron/IF_cond_alpha/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) 2017 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.

APP = $(notdir $(CURDIR))

NEURON_MODEL = $(NEURON_DIR)/neuron/models/neuron_model_lif_impl.c
NEURON_MODEL_H = $(NEURON_DIR)/neuron/models/neuron_model_lif_impl.h
INPUT_TYPE_H = $(NEURON_DIR)/neuron/input_types/input_type_conductance.h
NEURON_IMPL_H = $(NEURON_DIR)/neuron/implementations/neuron_impl_standard.h
THRESHOLD_TYPE_H = $(NEURON_DIR)/neuron/threshold_types/threshold_type_static.h
SYNAPSE_TYPE_H = $(NEURON_DIR)/neuron/synapse_types/synapse_types_alpha_impl.h
SYNAPSE_DYNAMICS = $(NEURON_DIR)/neuron/plasticity/synapse_dynamics_static_impl.c

include ../neural_build.mk
8 changes: 4 additions & 4 deletions neural_modelling/src/common/send_mc.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ static inline void wait_for_cc(void) {
spin1_delay_us(1);
n_loops++;
}
if (!(cc[CC_TCR] & TX_NOT_FULL_MASK)) {
log_error("Couldn't send spike; TCR=0x%08x\n", cc[CC_TCR]);
rt_error(RTE_SWERR);
}
// if (!(cc[CC_TCR] & TX_NOT_FULL_MASK)) {
// log_error("Couldn't send spike; TCR=0x%08x\n", cc[CC_TCR]);
// rt_error(RTE_SWERR);
// }
}

//! \brief Perform direct spike sending with hardware for speed
Expand Down
3 changes: 3 additions & 0 deletions neural_modelling/src/delay_extension/delay_extension.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

#include <common-typedefs.h>

//! Constants
#define DELAY_STAGE_LENGTH 64

//! region identifiers
typedef enum region_identifiers {
//! General simulation system control
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static inline input_t additional_input_get_input_value_as_current(
additional_input->i_ca2 *= additional_input->exp_tau_ca2;

// Return the Ca2
return -additional_input->i_ca2;
return additional_input->i_ca2;
}

//! \brief Notifies the additional input type that the neuron has spiked
Expand Down
25 changes: 22 additions & 3 deletions neural_modelling/src/neuron/c_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@
#include "c_main_common.h"
#include "regions.h"
#include "profile_tags.h"
//#include "spike_profiling.h"
#include "spike_processing.h"

//struct spike_holder_t spike_counter;
//struct spike_holder_t spike_cache;
//struct spike_holder_t spike_counter_inh;
//struct spike_holder_t spike_cache_inh;

//! The combined provenance from synapses and neurons
struct combined_provenance {
struct neuron_provenance neuron_provenance;
Expand Down Expand Up @@ -70,6 +76,7 @@ const struct common_priorities COMMON_PRIORITIES = {
.timer = TIMER
};


//! From the regions, extract those that are neuron-specific
const struct neuron_regions NEURON_REGIONS = {
.core_params = CORE_PARAMS_REGION,
Expand Down Expand Up @@ -153,9 +160,9 @@ static inline void process_ring_buffers(void) {
neuron_transfer(&ring_buffers[first_index]);

// Print the neuron inputs.
#if LOG_LEVEL >= LOG_DEBUG
neuron_print_inputs();
#endif // LOG_LEVEL >= LOG_DEBUG
#if LOG_LEVEL >= LOG_DEBUG
neuron_print_inputs();
#endif // LOG_LEVEL >= LOG_DEBUG
}

//! \brief Background activities called from timer
Expand All @@ -179,6 +186,18 @@ void background_callback(uint timer_count, uint local_time) {
//! executed since start of simulation
//! \param[in] unused: unused parameter kept for API consistency
void timer_callback(uint timer_count, UNUSED uint unused) {

// // Get number of spikes in last tick, and reset spike counter
// spike_processing_get_and_reset_spikes_this_tick();
// spike_processing_get_and_reset_dmas_this_tick();
// spike_processing_get_and_reset_pipeline_restarts_this_tick();
//
// // cache and flush spike counters
// spike_profiling_cache_and_flush_spike_holder(&spike_counter,
// &spike_cache);
// spike_profiling_cache_and_flush_spike_holder(&spike_counter_inh,
// &spike_cache_inh);

// Disable interrupts to stop DMAs and MC getting in the way of this bit
uint32_t state = spin1_int_disable();

Expand Down
9 changes: 5 additions & 4 deletions neural_modelling/src/neuron/c_main_synapse_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,12 @@ static inline bool initialise_synapse_regions(
bool *clear_input_buffer_of_late_packets,
uint32_t *n_recording_regions_used) {
// Set up the synapses
uint32_t *ring_buffer_to_input_buffer_left_shifts;
REAL *min_weights;
uint32_t n_neurons;
uint32_t n_synapse_types;
if (!synapses_initialise(
data_specification_get_region(regions.synapse_params, ds_regions),
&n_neurons, &n_synapse_types, ring_buffers,
&ring_buffer_to_input_buffer_left_shifts,
&n_neurons, &n_synapse_types, ring_buffers, &min_weights,
clear_input_buffer_of_late_packets,
incoming_spike_buffer_size)) {
return false;
Expand All @@ -124,10 +123,11 @@ static inline bool initialise_synapse_regions(
row_max_n_words)) {
return false;
}

// Set up the synapse dynamics
if (!synapse_dynamics_initialise(
data_specification_get_region(regions.synapse_dynamics, ds_regions),
n_neurons, n_synapse_types, ring_buffer_to_input_buffer_left_shifts)) {
n_neurons, n_synapse_types, min_weights)) {
return false;
}

Expand All @@ -137,5 +137,6 @@ static inline bool initialise_synapse_regions(
return false;
}


return true;
}
22 changes: 22 additions & 0 deletions neural_modelling/src/neuron/c_main_synapses.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,20 @@
#include "c_main_synapse_common.h"
#include "c_main_common.h"
#include "spike_processing_fast.h"
#include "spike_profiling.h"
#include "structural_plasticity/synaptogenesis_dynamics.h"
#include <spin1_api_params.h>

//! spike profiling
struct spike_holder_t spike_counter;
struct spike_holder_t spike_cache;
struct spike_holder_t spike_counter_inh;
struct spike_holder_t spike_cache_inh;

//// FLUSH SPIKES ??
//bool timer_callback_active = false;
//extern volatile bool dma_busy;

//! values for the priority for each callback
typedef enum callback_priorities {
MC = -1, DMA = -2, TIMER = 0, SDP = 0
Expand Down Expand Up @@ -129,6 +140,17 @@ void resume_callback(void) {
//! \param[in] unused0: unused
//! \param[in] unused1: unused
void timer_callback(UNUSED uint unused0, UNUSED uint unused1) {
// Get number of spikes in last tick, and reset spike counter
spike_processing_get_and_reset_spikes_this_tick();
spike_processing_get_and_reset_dmas_this_tick();
spike_processing_get_and_reset_pipeline_restarts_this_tick();

// cache and flush spike counters
spike_profiling_cache_and_flush_spike_holder(&spike_counter,
&spike_cache);
spike_profiling_cache_and_flush_spike_holder(&spike_counter_inh,
&spike_cache_inh);

time++;
if (simulation_is_finished()) {
// Enter pause and resume state to avoid another tick
Expand Down
5 changes: 2 additions & 3 deletions neural_modelling/src/neuron/current_sources/current_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ SOMETIMES_UNUSED // Marked unused as only used sometimes
static bool current_source_initialise(address_t cs_address, uint32_t n_neurons) {
// Avoid the loops if no current sources
#if !defined(_CURRENT_SOURCE_DC_H_) && !defined(_CURRENT_SOURCE_AC_H) && \
!defined(_CURRENT_SOURCE_STEP_H_) && !defined(_CURRENT_SOURCE_NOISY_H_)
!defined(_CURRENT_SOURCE_STEP_H_) && !defined(_CURRENT_SOURCE_NOISY_H_)
return true;
#else

Expand Down Expand Up @@ -150,7 +150,6 @@ static bool current_source_load_parameters(address_t cs_address) {
// Avoid the loops if no current sources
#if !defined(_CURRENT_SOURCE_DC_H_) && !defined(_CURRENT_SOURCE_AC_H) && \
!defined(_CURRENT_SOURCE_STEP_H_) && !defined(_CURRENT_SOURCE_NOISY_H_)
io_printf(IO_BUF, "no current sources defined \n");
return true;
#else

Expand Down Expand Up @@ -207,7 +206,7 @@ SOMETIMES_UNUSED // Marked unused as only used sometimes
static inline REAL current_source_get_offset(uint32_t time, uint32_t neuron_index) {
// Avoid the loops if no current sources defined
#if !defined(_CURRENT_SOURCE_DC_H_) && !defined(_CURRENT_SOURCE_AC_H) && \
!defined(_CURRENT_SOURCE_STEP_H_) && !defined(_CURRENT_SOURCE_NOISY_H_)
!defined(_CURRENT_SOURCE_STEP_H_) && !defined(_CURRENT_SOURCE_NOISY_H_)
return ZERO;
#else

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static bool current_source_ac_init(uint32_t n_ac_sources, uint32_t *next) {
for (uint32_t n_ac=0; n_ac < n_ac_sources; n_ac++) {
ac_source[n_ac] = spin1_malloc(sizeof(ac_source_t));
if (ac_source[n_ac] == NULL) {
log_error("Unable to allocate DC source parameters - out of DTCM");
log_error("Unable to allocate AC source parameters - out of DTCM");
return false;
}
*next += sizeof(ac_source_t) / 4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static bool current_source_noisy_init(uint32_t n_noisy_sources, uint32_t *next)
for (uint32_t n_noisy=0; n_noisy < n_noisy_sources; n_noisy++) {
noisy_source[n_noisy] = spin1_malloc(sizeof(noisy_current_source_t));
if (noisy_source[n_noisy] == NULL) {
log_error("Unable to allocate DC source parameters - out of DTCM");
log_error("Unable to allocate noisy source parameters - out of DTCM");
return false;
}
*next += sizeof(noisy_current_source_t) / 4;
Expand Down
15 changes: 3 additions & 12 deletions neural_modelling/src/neuron/current_sources/current_source_step.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,20 @@ static bool current_source_step_init(
step_cs_amps = spin1_malloc(n_step_current_sources * sizeof(uint32_t*));
step_cs_amp_last = spin1_malloc(n_step_current_sources * sizeof(REAL));
step_cs_index = spin1_malloc(n_step_current_sources * sizeof(uint32_t));
if (step_cs_amp_last == NULL) {
log_error("Unable to allocate step current source amp last - out of DTCM");
return false;
}
if (step_cs_index == NULL) {
log_error("Unable to allocate step current source index - out of DTCM");
return false;
}
}

for (uint32_t n_step=0; n_step < n_step_current_sources; n_step++) {
uint32_t arr_len = (uint32_t) cs_address[*next];
uint32_t struct_size = (arr_len + 1) * sizeof(uint32_t);
step_cs_times[n_step] = spin1_malloc(struct_size);
if (step_cs_times[n_step] == NULL) {
log_error("Unable to allocate step current source times - out of DTCM",
"struct_size is %u next %u n_step %u)", struct_size, *next, n_step);
log_error("Unable to allocate step current source times - out of DTCM");
return false;
}

step_cs_amps[n_step] = spin1_malloc(struct_size);
if (step_cs_amps[n_step] == NULL) {
log_error("Unable to allocate step current source amplitudes - out of DTCM",
"(struct_size is %u next %u n_step %u)", struct_size, *next, n_step);
log_error("Unable to allocate step current source amplitudes - out of DTCM");
return false;
}

Expand Down
36 changes: 23 additions & 13 deletions neural_modelling/src/neuron/implementations/neuron_impl_standard.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ SOMETIMES_UNUSED // Marked unused as only used sometimes
static void neuron_impl_load_neuron_parameters(
address_t address, uint32_t next, uint32_t n_neurons,
address_t save_initial_state) {

// Read the number of steps per timestep
n_steps_per_timestep = address[next++];
if (n_steps_per_timestep == 0) {
Expand Down Expand Up @@ -252,6 +251,8 @@ static void neuron_impl_do_timestep_update(
additional_input_t *additional_inputs = &additional_input_array[neuron_index];
synapse_types_t *the_synapse_type = &synapse_types_array[neuron_index];

// bool spike = false;

// Loop however many times requested; do this in reverse for efficiency,
// and because the index doesn't actually matter
for (uint32_t i_step = n_steps_per_timestep; i_step > 0; i_step--) {
Expand All @@ -265,26 +266,25 @@ static void neuron_impl_do_timestep_update(
input_t inh_values[NUM_INHIBITORY_RECEPTORS];
input_t *inh_syn_values =
synapse_types_get_inhibitory_input(inh_values, the_synapse_type);

// Call functions to obtain exc_input and inh_input
input_t *exc_input_values = input_type_get_input_value(
exc_syn_values, input_types, NUM_EXCITATORY_RECEPTORS);
input_t *inh_input_values = input_type_get_input_value(
inh_syn_values, input_types, NUM_INHIBITORY_RECEPTORS);

// Sum g_syn contributions from all receptors for recording
REAL total_exc = ZERO;
REAL total_inh = ZERO;

for (int i = 0; i < NUM_EXCITATORY_RECEPTORS; i++) {
total_exc += exc_input_values[i];
}
for (int i = 0; i < NUM_INHIBITORY_RECEPTORS; i++) {
total_inh += inh_input_values[i];
}

// Do recording if on the first step
if (i_step == n_steps_per_timestep) {
// Sum g_syn contributions from all receptors for recording
REAL total_exc = ZERO;
REAL total_inh = ZERO;

for (int i = 0; i < NUM_EXCITATORY_RECEPTORS; i++) {
total_exc += exc_input_values[i];
}
for (int i = 0; i < NUM_INHIBITORY_RECEPTORS; i++) {
total_inh += inh_input_values[i];
}

neuron_recording_record_accum(
V_RECORDING_INDEX, neuron_index, soma_voltage);
neuron_recording_record_accum(
Expand Down Expand Up @@ -319,6 +319,8 @@ static void neuron_impl_do_timestep_update(
// If spike occurs, communicate to relevant parts of model
if (spike_now) {

// spike = true;

// Call relevant model-based functions
// Tell the neuron model
neuron_model_has_spiked(this_neuron);
Expand All @@ -340,6 +342,14 @@ static void neuron_impl_do_timestep_update(
#if LOG_LEVEL >= LOG_DEBUG
neuron_model_print_state_variables(this_neuron);
#endif // LOG_LEVEL >= LOG_DEBUG

// if (spike) {
// // Record the spike
// neuron_recording_record_bit(SPIKE_RECORDING_BITFIELD, neuron_index);
//
// // Send the spike
// send_spike(timer_count, time, neuron_index);
// }
}
}

Expand Down
11 changes: 9 additions & 2 deletions neural_modelling/src/neuron/input_types/input_type_conductance.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define _INPUT_TYPE_CONDUCTANCE_H_

#include "input_type.h"
#include "round.h"

//! Conductance input parameters
struct input_type_params_t {
Expand Down Expand Up @@ -59,7 +60,7 @@ static inline input_t *input_type_get_input_value(
input_t *restrict value, UNUSED input_type_t *input_type,
uint16_t num_receptors) {
for (int i = 0; i < num_receptors; i++) {
value[i] = value[i] >> 10;
value[i] = value[i] >> 5;
}
return &value[0];
}
Expand All @@ -74,7 +75,10 @@ static inline void input_type_convert_excitatory_input_to_current(
input_t *restrict exc_input, const input_type_t *input_type,
state_t membrane_voltage) {
for (int i=0; i < NUM_EXCITATORY_RECEPTORS; i++) {
exc_input[i] = exc_input[i] *
// accum = accum * (accum - accum)
// exc_input[i] = MULT_ROUND_STOCHASTIC_ACCUM(exc_input[i],
// (input_type->V_rev_E - membrane_voltage));
exc_input[i] = exc_input[i] *
(input_type->V_rev_E - membrane_voltage);
}
}
Expand All @@ -89,6 +93,9 @@ static inline void input_type_convert_inhibitory_input_to_current(
input_t *restrict inh_input, const input_type_t *input_type,
state_t membrane_voltage) {
for (int i=0; i < NUM_INHIBITORY_RECEPTORS; i++) {
// accum = accum * (accum - accum)
// inh_input[i] = MULT_ROUND_STOCHASTIC_ACCUM(-inh_input[i],
// (input_type->V_rev_I - membrane_voltage));
inh_input[i] = -inh_input[i] *
(input_type->V_rev_I - membrane_voltage);
}
Expand Down
2 changes: 1 addition & 1 deletion neural_modelling/src/neuron/models/neuron_model_izh_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ static inline state_t neuron_model_state_update(
}

input_t input_this_timestep = total_exc - total_inh
+ external_bias + neuron->I_offset + current_offset;
- external_bias + neuron->I_offset + current_offset;

// the best AR update so far
rk2_kernel_midpoint(neuron->this_h, neuron, input_this_timestep);
Expand Down
Loading