Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions Contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ Lawrence Scott

Star Wong

## 2026
Dhruva Pyapali


<!-- ---------------------------------------------------------------------------------- -->
# Graduate

Expand Down
4 changes: 2 additions & 2 deletions Simulator/Edges/Neuro/AllDSSynapses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void AllDSSynapses::resetEdge(BGSIZE iEdg, BGFLOAT deltaT)
{
AllSpikingSynapses::resetEdge(iEdg, deltaT);

u_[iEdg] = DEFAULT_U;
u_[iEdg] = AllSpikingSynapses::DEFAULT_U;
r_[iEdg] = 1.0;
lastSpike_[iEdg] = ULONG_MAX;
}
Expand All @@ -117,7 +117,7 @@ void AllDSSynapses::createEdge(BGSIZE iEdg, int srcVertex, int destVertex, BGFLO
{
AllSpikingSynapses::createEdge(iEdg, srcVertex, destVertex, deltaT, type);

U_[iEdg] = DEFAULT_U;
U_[iEdg] = AllSpikingSynapses::DEFAULT_U;

BGFLOAT U;
BGFLOAT D;
Expand Down
4 changes: 2 additions & 2 deletions Simulator/Edges/Neuro/AllDynamicSTDPSynapses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void AllDynamicSTDPSynapses::resetEdge(BGSIZE iEdg, BGFLOAT deltaT)
{
AllSTDPSynapses::resetEdge(iEdg, deltaT);

u_[iEdg] = DEFAULT_U;
u_[iEdg] = AllSpikingSynapses::DEFAULT_U;
r_[iEdg] = 1.0;
lastSpike_[iEdg] = ULONG_MAX;
}
Expand All @@ -117,7 +117,7 @@ void AllDynamicSTDPSynapses::createEdge(BGSIZE iEdg, int srcVertex, int destVert
{
AllSTDPSynapses::createEdge(iEdg, srcVertex, destVertex, deltaT, type);

U_[iEdg] = DEFAULT_U;
U_[iEdg] = AllSpikingSynapses::DEFAULT_U;

BGFLOAT U;
BGFLOAT D;
Expand Down
2 changes: 1 addition & 1 deletion Simulator/Edges/Neuro/AllSpikingSynapses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ void AllSpikingSynapses::createEdge(BGSIZE iEdg, int srcVertex, int destVertex,
sourceVertexIndex_[iEdg] = srcVertex;
W_[iEdg] = edgSign(type) * 10.0e-9;
type_[iEdg] = type;
tau_[iEdg] = DEFAULT_tau;
tau_[iEdg] = AllSpikingSynapses::DEFAULT_tau;

BGFLOAT tau;
switch (type) {
Expand Down
5 changes: 5 additions & 0 deletions Simulator/Edges/Neuro/AllSpikingSynapses.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ using fpPostSynapsesSpikeHit_t = void (*)(const BGSIZE, AllSpikingSynapsesDevice

class AllSpikingSynapses : public AllNeuroEdges {
public:
// Default synapse parameter values
static constexpr BGFLOAT DEFAULT_tau = 3e-3; // The default synaptic time constant
static constexpr BGFLOAT DEFAULT_U = 0.4; // The default synaptic efficiency
static constexpr BGFLOAT DEFAULT_delay_weight = 0; // The default delay weight

AllSpikingSynapses();

AllSpikingSynapses(int numVertices, int maxEdges);
Expand Down
39 changes: 21 additions & 18 deletions Simulator/Edges/Neuro/AllSynapsesDeviceFuncs_d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "AllDynamicSTDPSynapses.h"
#include "AllNeuroEdges.h"
#include "AllSTDPSynapses.h"
#include "AllSpikingSynapses.h"
#include "AllSynapsesDeviceFuncs.h"
#include <vector>

Expand Down Expand Up @@ -96,7 +97,7 @@ CUDA_CALLABLE void createSpikingSynapse(AllSpikingSynapsesDeviceProperties *allE
int neuronIndex, int synapseOffset, int sourceIndex,
int destIndex, BGFLOAT deltaT, edgeType type)
{
BGFLOAT delay;
BGFLOAT delay = 0.8e-3;
BGSIZE maxEdges = allEdgesDevice->maxEdgesPerVertex_;
BGSIZE iEdg = maxEdges * neuronIndex + synapseOffset;

Expand All @@ -112,7 +113,7 @@ CUDA_CALLABLE void createSpikingSynapse(AllSpikingSynapsesDeviceProperties *allE
allEdgesDevice->psr_[iEdg] = 0.0;
allEdgesDevice->type_[iEdg] = type;

allEdgesDevice->tau_[iEdg] = DEFAULT_tau;
allEdgesDevice->tau_[iEdg] = AllSpikingSynapses::DEFAULT_tau;

BGFLOAT tau;
switch (type) {
Expand Down Expand Up @@ -173,17 +174,17 @@ CUDA_CALLABLE void createDSSynapse(AllDSSynapsesDeviceProperties *allEdgesDevice

allEdgesDevice->psr_[iEdg] = 0.0;
allEdgesDevice->r_[iEdg] = 1.0;
allEdgesDevice->u_[iEdg] = 0.4; // DEFAULT_U
allEdgesDevice->u_[iEdg] = AllSpikingSynapses::DEFAULT_U;
allEdgesDevice->lastSpike_[iEdg] = ULONG_MAX;
allEdgesDevice->type_[iEdg] = type;

allEdgesDevice->U_[iEdg] = DEFAULT_U;
allEdgesDevice->tau_[iEdg] = DEFAULT_tau;
allEdgesDevice->U_[iEdg] = AllSpikingSynapses::DEFAULT_U;
allEdgesDevice->tau_[iEdg] = AllSpikingSynapses::DEFAULT_tau;

BGFLOAT U;
BGFLOAT D;
BGFLOAT F;
BGFLOAT tau;
BGFLOAT U = AllSpikingSynapses::DEFAULT_U;
BGFLOAT D = 0.144;
BGFLOAT F = 0.06;
BGFLOAT tau = AllSpikingSynapses::DEFAULT_tau;
switch (type) {
case edgeType::II:
U = 0.32;
Expand Down Expand Up @@ -214,6 +215,7 @@ CUDA_CALLABLE void createDSSynapse(AllDSSynapsesDeviceProperties *allEdgesDevice
delay = 1.5e-3;
break;
default:
assert(false && "Unexpected edgeType in createDSSynapse");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kind of tricky. I'll allow it 😀, as we eventually want to move to our own set of exceptions, but that issue hasn't risen to the top yet.

Copy link
Copy Markdown
Contributor

@stiber stiber Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a comment. You can just resolve it and merge, I believe.

break;
}

Expand Down Expand Up @@ -243,7 +245,7 @@ CUDA_CALLABLE void createSTDPSynapse(AllSTDPSynapsesDeviceProperties *allEdgesDe
int neuronIndex, int synapseOffset, int sourceIndex,
int destIndex, BGFLOAT deltaT, edgeType type)
{
BGFLOAT delay;
BGFLOAT delay = 0.8e-3;
BGSIZE maxEdges = allEdgesDevice->maxEdgesPerVertex_;
BGSIZE iEdg = maxEdges * neuronIndex + synapseOffset;

Expand All @@ -259,7 +261,7 @@ CUDA_CALLABLE void createSTDPSynapse(AllSTDPSynapsesDeviceProperties *allEdgesDe
allEdgesDevice->psr_[iEdg] = 0.0;
allEdgesDevice->type_[iEdg] = type;

allEdgesDevice->tau_[iEdg] = DEFAULT_tau;
allEdgesDevice->tau_[iEdg] = AllSpikingSynapses::DEFAULT_tau;

BGFLOAT tau;
switch (type) {
Expand Down Expand Up @@ -341,17 +343,17 @@ CUDA_CALLABLE void createDynamicSTDPSynapse(AllDynamicSTDPSynapsesDeviceProperti

allEdgesDevice->psr_[iEdg] = 0.0;
allEdgesDevice->r_[iEdg] = 1.0;
allEdgesDevice->u_[iEdg] = 0.4; // DEFAULT_U
allEdgesDevice->u_[iEdg] = AllSpikingSynapses::DEFAULT_U;
allEdgesDevice->lastSpike_[iEdg] = ULONG_MAX;
allEdgesDevice->type_[iEdg] = type;

allEdgesDevice->U_[iEdg] = DEFAULT_U;
allEdgesDevice->tau_[iEdg] = DEFAULT_tau;
allEdgesDevice->U_[iEdg] = AllSpikingSynapses::DEFAULT_U;
allEdgesDevice->tau_[iEdg] = AllSpikingSynapses::DEFAULT_tau;
Comment thread
CodersRepo marked this conversation as resolved.

BGFLOAT U;
BGFLOAT D;
BGFLOAT F;
BGFLOAT tau;
BGFLOAT U = AllSpikingSynapses::DEFAULT_U;
BGFLOAT D = 0.144;
BGFLOAT F = 0.06;
BGFLOAT tau = AllSpikingSynapses::DEFAULT_tau;
switch (type) {
case edgeType::II:
U = 0.32;
Expand Down Expand Up @@ -382,6 +384,7 @@ CUDA_CALLABLE void createDynamicSTDPSynapse(AllDynamicSTDPSynapsesDeviceProperti
delay = 1.5e-3;
break;
default:
assert(false && "Unexpected edgeType in createDynamicSTDPSynapse");
break;
}

Expand Down
27 changes: 0 additions & 27 deletions Simulator/Utils/Global.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,35 +126,8 @@ inline std::ostream &operator<<(std::ostream &os, edgeType eT)
return os;
}

// The default membrane capacitance.
#define DEFAULT_Cm (3e-8)
// The default membrane resistance.
#define DEFAULT_Rm (1e6)
// The default resting voltage.
#define DEFAULT_Vrest (0.0)
// The default reset voltage.
#define DEFAULT_Vreset (-0.06)
// The default absolute refractory period.
#define DEFAULT_Trefract (3e-3)
// The default synaptic noise.
#define DEFAULT_Inoise (0.0)
// The default injected current.
#define DEFAULT_Iinject (0.0)
// The default threshold voltage. If \f$V_m >= V_{thresh}\f$ then the neuron fires.
#define DEFAULT_Vthresh (-0.04)
// The default time step size.
#define DEFAULT_dt (1e-4) // MODEL INDEPENDENT
// The default absolute refractory period for inhibitory neurons.
#define DEFAULT_InhibTrefract (2.0e-3)
// The default absolute refractory period for excitory neurons.
#define DEFAULT_ExcitTrefract (3.0e-3)

// The default synaptic time constant.
#define DEFAULT_tau (3e-3)
// The default synaptic efficiency.
#define DEFAULT_U (0.4)
// The default synaptic efficiency.
#define DEFAULT_delay_weight (0)
// } NMV-END

// Converts a 1-d index into a coordinate string.
Expand Down
26 changes: 13 additions & 13 deletions Simulator/Vertices/Neuro/AllIFNeurons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,13 @@ void AllIFNeurons::createNeuron(int i, Layout &layout)
case vertexType::INH:
LOG4CPLUS_DEBUG(vertexLogger_, "Setting inhibitory neuron: " << i);
// set inhibitory absolute refractory period
Trefract_[i] = DEFAULT_InhibTrefract; // TODO(derek): move defaults inside model.
Trefract_[i] = AllIFNeurons::DEFAULT_InhibTrefract;
break;

case vertexType::EXC:
LOG4CPLUS_DEBUG(vertexLogger_, "Setting excitatory neuron: " << i);
// set excitatory absolute refractory period
Trefract_[i] = DEFAULT_ExcitTrefract;
Trefract_[i] = AllIFNeurons::DEFAULT_ExcitTrefract;
break;

default:
Expand All @@ -152,7 +152,7 @@ void AllIFNeurons::createNeuron(int i, Layout &layout)
// set endogenously active threshold voltage, reset voltage, and refractory period
Vthresh_[i] = initRNG.inRange(starterVthreshRange_[0], starterVthreshRange_[1]);
Vreset_[i] = initRNG.inRange(starterVresetRange_[0], starterVresetRange_[1]);
Trefract_[i] = DEFAULT_ExcitTrefract; // TODO(derek): move defaults inside model.
Trefract_[i] = AllIFNeurons::DEFAULT_ExcitTrefract;
}

LOG4CPLUS_DEBUG(vertexLogger_, "\nCREATE NEURON[" << i << "] {" << endl
Expand All @@ -172,16 +172,16 @@ void AllIFNeurons::createNeuron(int i, Layout &layout)
/// @param index Index of the Neuron that the synapse belongs to.
void AllIFNeurons::setNeuronDefaults(int index)
{
Cm_[index] = DEFAULT_Cm;
Rm_[index] = DEFAULT_Rm;
Vthresh_[index] = DEFAULT_Vthresh;
Vrest_[index] = DEFAULT_Vrest;
Vreset_[index] = DEFAULT_Vreset;
Vinit_[index] = DEFAULT_Vreset;
Trefract_[index] = DEFAULT_Trefract;
Inoise_[index] = DEFAULT_Inoise;
Iinject_[index] = DEFAULT_Iinject;
Tau_[index] = DEFAULT_Cm * DEFAULT_Rm;
Cm_[index] = AllIFNeurons::DEFAULT_Cm;
Rm_[index] = AllIFNeurons::DEFAULT_Rm;
Vthresh_[index] = AllIFNeurons::DEFAULT_Vthresh;
Vrest_[index] = AllIFNeurons::DEFAULT_Vrest;
Vreset_[index] = AllIFNeurons::DEFAULT_Vreset;
Vinit_[index] = AllIFNeurons::DEFAULT_Vreset;
Trefract_[index] = AllIFNeurons::DEFAULT_Trefract;
Inoise_[index] = AllIFNeurons::DEFAULT_Inoise;
Iinject_[index] = AllIFNeurons::DEFAULT_Iinject;
Tau_[index] = AllIFNeurons::DEFAULT_Cm * AllIFNeurons::DEFAULT_Rm;
}

/// Initializes the Neuron constants at the indexed location.
Expand Down
14 changes: 14 additions & 0 deletions Simulator/Vertices/Neuro/AllIFNeurons.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@ using AllIFNeuronsDeviceProperties = AllSpikingNeuronsDeviceProperties;

class AllIFNeurons : public AllSpikingNeurons {
public:
// Default neuron parameter values
static constexpr BGFLOAT DEFAULT_Cm = 3e-8; // The default membrane capacitance
static constexpr BGFLOAT DEFAULT_Rm = 1e6; // The default membrane resistance
static constexpr BGFLOAT DEFAULT_Vrest = 0.0; // The default resting voltage
static constexpr BGFLOAT DEFAULT_Vreset = -0.06; // The default reset voltage
static constexpr BGFLOAT DEFAULT_Trefract = 3e-3; // The default absolute refractory period
static constexpr BGFLOAT DEFAULT_Inoise = 0.0; // The default synaptic noise
static constexpr BGFLOAT DEFAULT_Iinject = 0.0; // The default injected current
static constexpr BGFLOAT DEFAULT_Vthresh = -0.04; // The default threshold voltage
static constexpr BGFLOAT DEFAULT_InhibTrefract
= 2.0e-3; // The default absolute refractory period for inhibitory neurons
static constexpr BGFLOAT DEFAULT_ExcitTrefract
= 3.0e-3; // The default absolute refractory period for excitatory neurons

AllIFNeurons() = default;

virtual ~AllIFNeurons() = default;
Expand Down
Loading