Skip to content

Commit

Permalink
Fix bug in FileStimGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
fzenke committed Aug 17, 2023
2 parents 77f3061 + 5a27e72 commit 19a9174
Show file tree
Hide file tree
Showing 243 changed files with 2,765 additions and 383 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ script:
notifications:
email:
recipients:
- [email protected]
- [email protected]
on_success: change
on_failure: always
8 changes: 4 additions & 4 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Auryn package created by Friedemann Zenke <[email protected]>
Auryn package created by Friedemann Zenke <[email protected]>

Contributors:
Lorric Ziegler <[email protected]>
Ankur Sinha <[email protected]>
Emre Neftci <[email protected]>
Anders Lansner <[email protected]>
Alexandre Payeur <[email protected]>








Copyright 2014-2018 Friedemann Zenke.
Copyright 2014-2023 Friedemann Zenke.
Copying and distribution of this file, with or without modification, are
permitted provided the copyright notice and this notice are preserved.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
PROJECT(Auryn)

# The version number.
SET(Auryn_VERSION_MAJOR 0)
SET(Auryn_VERSION_MAJOR 1)
SET(Auryn_VERSION_MINOR 8)

# Important GCC Compiler flags for Auryn's performance
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Bibtex:
License & Copyright
-------------------

Copyright 2014-2018 Friedemann Zenke
Copyright 2014-2023 Friedemann Zenke

Auryn is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
8 changes: 4 additions & 4 deletions build/release/run_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ DATE=`date +"%Y-%m-%d"`
# REVISION=`git log --pretty=oneline -1 | cut -d " " -f 1`
REVISION=`git describe`
TMPDIR=`mktemp -d`
echo "temp dir= $TMPDIR"
trap "{ rm -rf $TMPDIR; }" EXIT

# Function declaration
function fun_benchmark()
Expand All @@ -39,18 +41,16 @@ fun_benchmark "$CMD_BENCHMARK1"
RESULT_BENCHMARK1=$FUNCTION_RESULT

# Zenke plasticity benchmark, single core
CMD_BENCHMARK2="examples/sim_background --fast --tau 10 --simtime $SIMTIME --dir $TMPDIR"
CMD_BENCHMARK2="examples/plasticity/sim_background --fast --tau 10 --simtime $SIMTIME --dir $TMPDIR"
fun_benchmark "$CMD_BENCHMARK2"
RESULT_BENCHMARK2=$FUNCTION_RESULT

# Zenke plasticity benchmark, two cores
CMD_BENCHMARK3="mpirun -n 2 examples/sim_background --fast --tau 10 --simtime $SIMTIME --dir $TMPDIR"
CMD_BENCHMARK3="mpirun -n 2 examples/plasticity/sim_background --fast --tau 10 --simtime $SIMTIME --dir $TMPDIR"
fun_benchmark "$CMD_BENCHMARK3"
RESULT_BENCHMARK3=$FUNCTION_RESULT


# Writ result to file
echo "$HOSTNAME $REVISION $RESULT_BENCHMARK1 $RESULT_BENCHMARK2 $RESULT_BENCHMARK3 $DATE" >> benchmark_results.dat

# Clean up
rm -r $TMPDIR
7 changes: 7 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
ADD_SUBDIRECTORY(currents)
ADD_SUBDIRECTORY(misc)
ADD_SUBDIRECTORY(plasticity)
ADD_SUBDIRECTORY(poisson)
ADD_SUBDIRECTORY(tutorials)
ADD_SUBDIRECTORY(monitoring)

FILE( GLOB SIM_SOURCES *.cpp )
FOREACH( sourcepath ${SIM_SOURCES} )
GET_FILENAME_COMPONENT( sourcefile ${sourcepath} NAME )
Expand Down
9 changes: 9 additions & 0 deletions examples/currents/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FILE( GLOB SIM_SOURCES *.cpp )
FOREACH( sourcepath ${SIM_SOURCES} )
GET_FILENAME_COMPONENT( sourcefile ${sourcepath} NAME )
STRING( REPLACE ".cpp" "" simname ${sourcefile} )
ADD_EXECUTABLE( ${simname} ${sourcefile} )
TARGET_LINK_LIBRARIES( ${simname} auryn ${AURYN_EXT_LINKLIBS} )
ENDFOREACH( sourcepath ${SIM_SOURCES} )

CONFIGURE_FILE(inject_current.txt inject_current.txt COPYONLY)
100 changes: 100 additions & 0 deletions examples/currents/inject_current.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
0.000000 0.000000
0.050000 0.125333
0.100000 0.248690
0.150000 0.368125
0.200000 0.481754
0.250000 0.587785
0.300000 0.684547
0.350000 0.770513
0.400000 0.844328
0.450000 0.904827
0.500000 0.951057
0.550000 0.982287
0.600000 0.998027
0.650000 0.998027
0.700000 0.982287
0.750000 0.951057
0.800000 0.904827
0.850000 0.844328
0.900000 0.770513
0.950000 0.684547
1.000000 0.587785
1.050000 0.481754
1.100000 0.368125
1.150000 0.248690
1.200000 0.125333
1.250000 0.000000
1.300000 -0.125333
1.350000 -0.248690
1.400000 -0.368125
1.450000 -0.481754
1.500000 -0.587785
1.550000 -0.684547
1.600000 -0.770513
1.650000 -0.844328
1.700000 -0.904827
1.750000 -0.951057
1.800000 -0.982287
1.850000 -0.998027
1.900000 -0.998027
1.950000 -0.982287
2.000000 -0.951057
2.050000 -0.904827
2.100000 -0.844328
2.150000 -0.770513
2.200000 -0.684547
2.250000 -0.587785
2.300000 -0.481754
2.350000 -0.368125
2.400000 -0.248690
2.450000 -0.125333
2.500000 -0.000000
2.550000 0.125333
2.600000 0.248690
2.650000 0.368125
2.700000 0.481754
2.750000 0.587785
2.800000 0.684547
2.850000 0.770513
2.900000 0.844328
2.950000 0.904827
3.000000 0.951057
3.050000 0.982287
3.100000 0.998027
3.150000 0.998027
3.200000 0.982287
3.250000 0.951057
3.300000 0.904827
3.350000 0.844328
3.400000 0.770513
3.450000 0.684547
3.500000 0.587785
3.550000 0.481754
3.600000 0.368125
3.650000 0.248690
3.700000 0.125333
3.750000 0.000000
3.800000 -0.125333
3.850000 -0.248690
3.900000 -0.368125
3.950000 -0.481754
4.000000 -0.587785
4.050000 -0.684547
4.100000 -0.770513
4.150000 -0.844328
4.200000 -0.904827
4.250000 -0.951057
4.300000 -0.982287
4.350000 -0.998027
4.400000 -0.998027
4.450000 -0.982287
4.500000 -0.951057
4.550000 -0.904827
4.600000 -0.844328
4.650000 -0.770513
4.700000 -0.684547
4.750000 -0.587785
4.800000 -0.481754
4.850000 -0.368125
4.900000 -0.248690
4.950000 -0.125333
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2018 Friedemann Zenke
* Copyright 2014-2020 Friedemann Zenke
*
* This file is part of Auryn, a simulation package for plastic
* spiking neural networks.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2018 Friedemann Zenke
* Copyright 2014-2020 Friedemann Zenke
*
* This file is part of Auryn, a simulation package for plastic
* spiking neural networks.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2018 Friedemann Zenke
* Copyright 2014-2020 Friedemann Zenke
*
* This file is part of Auryn, a simulation package for plastic
* spiking neural networks.
Expand Down
77 changes: 77 additions & 0 deletions examples/currents/sim_file_current_inject.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* Copyright 2014-2020 Friedemann Zenke
*
* This file is part of Auryn, a simulation package for plastic
* spiking neural networks.
*
* Auryn is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Auryn is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Auryn. If not, see <http://www.gnu.org/licenses/>.
*/

#include "auryn.h"

#define N 1

/*!\file
*
* \brief Example simulation which demonstrates the use of FileCurrentInjector
* */

using namespace auryn;

namespace po = boost::program_options;

int main(int ac, char* av[])
{

int errcode = 0;
string simname = "fcur_inject";
string logfile = simname;
string tmpstr;

// BEGIN Global definitions
auryn_init( ac, av );
sys->set_simulation_name(simname);
// END Global definitions

// define receiving group
IFGroup * neurons = new IFGroup(3);

// define monitors
VoltageMonitor * vmon0 = new VoltageMonitor( neurons, 0, sys->fn("neuron",0,"mem"), 1e-3 );
VoltageMonitor * vmon1 = new VoltageMonitor( neurons, 1, sys->fn("neuron",1,"mem"), 1e-3 );

// define FileCurrentInjector
FileCurrentInjector * injector = new FileCurrentInjector( neurons, "inject_current.txt", "mem" );
injector->set_scale(1.2); // Scales all current values by this factor

// To repeat the input current enable looping by uncommenting the following lines
// injector->loop = true;
// injector->set_loop_grid(10.0); // align time series to 1s grid (should be larger or equal to the input time series)

// To only inject current in some neurons uncomment the following code
// injector->mode = LIST;
// injector->target_neuron_ids->push_back(0);
// injector->target_neuron_ids->push_back(2);

// run simulation
logger->msg("Running ...",PROGRESS);
sys->run(15.0);

if (errcode)
auryn_abort(errcode);

logger->msg("Freeing ...",PROGRESS,true);
auryn_free();
return errcode;
}
8 changes: 8 additions & 0 deletions examples/misc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FILE( GLOB SIM_SOURCES *.cpp )
FOREACH( sourcepath ${SIM_SOURCES} )
GET_FILENAME_COMPONENT( sourcefile ${sourcepath} NAME )
STRING( REPLACE ".cpp" "" simname ${sourcefile} )
ADD_EXECUTABLE( ${simname} ${sourcefile} )
TARGET_LINK_LIBRARIES( ${simname} auryn ${AURYN_EXT_LINKLIBS} )
ENDFOREACH( sourcepath ${SIM_SOURCES} )

78 changes: 78 additions & 0 deletions examples/misc/sim_delay_connection.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
* Copyright 2014-2020 Friedemann Zenke
*
* This file is part of Auryn, a simulation package for plastic
* spiking neural networks.
*
* Auryn is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Auryn is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Auryn. If not, see <http://www.gnu.org/licenses/>.
*/

#include "auryn.h"

#define N 1

/*!\file
*
* \brief Example simulation illustrating the effect of delay connection.
*
* The simulation sets up a single input neuron and connects it to a single output neuron via a SparseConnection
* (which only has the axonal delay from IFGroup) and via a DelayConnection which has both the axonal delay plus
* an added 10ms dendritic delay. The latter connection is GABAergic to make it easily differntiable in the
* membrane trace.
* */

using namespace auryn;

int main(int ac, char* av[])
{

int errcode = 0;
string simname = "delay_connection";
string logfile = simname;
string tmpstr;
AurynWeight w = 1.0;

// BEGIN Global definitions
auryn_init( ac, av );
sys->set_simulation_name(simname);
// END Global definitions

// define input group
PoissonGroup * poisson = new PoissonGroup(N,1.);

// define receiving group
IFGroup * neuron = new IFGroup(1);

// define connections
SparseConnection * con = new SparseConnection(poisson, neuron, w, 1.0, GLUT);
DelayConnection * dly_con = new DelayConnection(poisson, neuron, w, 1.0, GABA);
dly_con->set_delay(10e-3); // 10ms delay added

// define monitors
SpikeMonitor * smon = new SpikeMonitor( neuron, sys->fn("ras") );
VoltageMonitor * vmon = new VoltageMonitor( neuron, 0, sys->fn("mem"), 1e-3 );
StateMonitor * amon = new StateMonitor( neuron, 0, "g_ampa", sys->fn("ampa") );
StateMonitor * nmon = new StateMonitor( neuron, 0, "g_gaba", sys->fn("gaba") );

// run simulation
logger->msg("Running ...",PROGRESS);
sys->run(10);

if (errcode)
auryn_abort(errcode);

logger->msg("Freeing ...",PROGRESS,true);
auryn_free();
return errcode;
}
2 changes: 1 addition & 1 deletion examples/sim_epsp.cpp → examples/misc/sim_epsp.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2018 Friedemann Zenke
* Copyright 2014-2020 Friedemann Zenke
*
* This file is part of Auryn, a simulation package for plastic
* spiking neural networks.
Expand Down
Loading

0 comments on commit 19a9174

Please sign in to comment.