SpikeStream Nemo Plugin
0.2
|
#include <NemoWrapper.h>
Signals | |
void | progress (int stepsComplete, int totalSteps) |
void | simulationStopped () |
void | timeStepChanged (unsigned int timeStep) |
void | timeStepChanged (unsigned int timeStep, const QList< unsigned > &neuronIDList) |
void | timeStepChanged (unsigned int timeStep, const QHash< unsigned, float > &membranePotentialMap) |
Public Member Functions | |
NemoWrapper () | |
~NemoWrapper () | |
void | addDeviceManager (AbstractDeviceManager *deviceManager) |
void | cancelLoading () |
void | cancelResetWeights () |
void | cancelSaveWeights () |
void | clearWaitForGraphics () |
unsigned | getArchiveID () |
int | getCurrentTask () |
QString | getErrorMessage () |
QList< neurid_t > | getFiringNeuronIDs () |
nemo_configuration_t | getNemoConfig () |
unsigned | getSTDPFunctionID () |
timestep_t | getTimeStep () |
unsigned | getUpdateInterval_ms () |
unsigned | getWaitInterval_ms () |
bool | isError () |
bool | isMonitorFiringNeurons () |
bool | isMonitorWeights () |
bool | isWaitForGraphics () |
bool | isWeightsReset () |
bool | isWeightsSaved () |
bool | isSimulationLoaded () |
bool | isSimulationRunning () |
void | resetWeights () |
void | run () |
void | saveWeights () |
void | setArchiveMode (bool mode, const QString &archiveDescription="") |
void | setFrameRate (unsigned int frameRate) |
void | setInjectCurrent (unsigned neuronGroupID, double percentage, double current, bool sustain) |
void | setFiringNeuronIDs (QList< neurid_t > &neurIDList) |
void | setInjectCurrentNeuronIDs (QList< neurid_t > &neurIDList, double current) |
void | setInjectNoise (unsigned neuronGroupID, double percentage, bool sustain) |
void | setFiringInjectionPattern (const Pattern &pattern, unsigned neuronGroupID, bool sustain) |
void | setCurrentInjectionPattern (const Pattern &pattern, float current, unsigned neuronGroupID, bool sustain) |
void | setMonitor (bool mode) |
void | setMonitorNeurons (bool firing, bool membranePotential) |
void | setNemoConfig (nemo_configuration_t nemoConfig) |
void | setMonitorWeights (bool enable) |
void | setNeuronParameters (unsigned neuronGroupID, QHash< QString, double > parameterMap) |
void | setSynapseParameters (unsigned connectionGroupID, QHash< QString, double > parameterMap) |
void | setSTDPFunctionID (unsigned stdpFunctionID) |
void | setSustainNoise (bool sustain) |
void | setSustainPattern (bool sustainPattern) |
void | setUpdateFiringNeurons (bool updateFiringNeurons) |
void | setWaitInterval (unsigned waitInterval_ms) |
void | playSimulation () |
void | stepSimulation () |
void | stopSimulation () |
void | unloadSimulation () |
Static Public Attributes | |
static const int | NO_TASK_DEFINED = 0 |
==================== VARIABLES ========================== | |
static const int | RESET_WEIGHTS_TASK = 1 |
static const int | RUN_SIMULATION_TASK = 2 |
static const int | SAVE_WEIGHTS_TASK = 3 |
static const int | SET_NEURON_PARAMETERS_TASK = 4 |
static const int | STEP_SIMULATION_TASK = 5 |
Wraps the Nemo CUDA simulation library launching separate threads for heavy functions such as play and load
Definition at line 31 of file NemoWrapper.h.
Constructor
Definition at line 32 of file NemoWrapper.cpp.
Destructor
Definition at line 58 of file NemoWrapper.cpp.
void NemoWrapper::addDeviceManager | ( | AbstractDeviceManager * | deviceManager | ) |
Adds a manager to interface with a device
Definition at line 69 of file NemoWrapper.cpp.
void NemoWrapper::cancelLoading | ( | ) |
Cancels the loading of a simulation
Definition at line 75 of file NemoWrapper.cpp.
void NemoWrapper::cancelResetWeights | ( | ) |
Cancels the resetting of weights
Definition at line 81 of file NemoWrapper.cpp.
void NemoWrapper::cancelSaveWeights | ( | ) |
Cancels the saving of weights
Definition at line 87 of file NemoWrapper.cpp.
void spikestream::NemoWrapper::clearWaitForGraphics | ( | ) | [inline] |
Definition at line 41 of file NemoWrapper.h.
unsigned spikestream::NemoWrapper::getArchiveID | ( | ) | [inline] |
Definition at line 42 of file NemoWrapper.h.
int spikestream::NemoWrapper::getCurrentTask | ( | ) | [inline] |
Definition at line 43 of file NemoWrapper.h.
QString spikestream::NemoWrapper::getErrorMessage | ( | ) | [inline] |
Definition at line 44 of file NemoWrapper.h.
QList<neurid_t> spikestream::NemoWrapper::getFiringNeuronIDs | ( | ) | [inline] |
Definition at line 45 of file NemoWrapper.h.
nemo_configuration_t spikestream::NemoWrapper::getNemoConfig | ( | ) | [inline] |
Definition at line 46 of file NemoWrapper.h.
unsigned spikestream::NemoWrapper::getSTDPFunctionID | ( | ) | [inline] |
Definition at line 47 of file NemoWrapper.h.
timestep_t spikestream::NemoWrapper::getTimeStep | ( | ) | [inline] |
Definition at line 48 of file NemoWrapper.h.
unsigned spikestream::NemoWrapper::getUpdateInterval_ms | ( | ) | [inline] |
Definition at line 49 of file NemoWrapper.h.
unsigned spikestream::NemoWrapper::getWaitInterval_ms | ( | ) | [inline] |
Definition at line 50 of file NemoWrapper.h.
bool spikestream::NemoWrapper::isError | ( | ) | [inline] |
Definition at line 51 of file NemoWrapper.h.
bool spikestream::NemoWrapper::isMonitorFiringNeurons | ( | ) | [inline] |
Definition at line 52 of file NemoWrapper.h.
bool spikestream::NemoWrapper::isMonitorWeights | ( | ) | [inline] |
Definition at line 53 of file NemoWrapper.h.
bool spikestream::NemoWrapper::isSimulationLoaded | ( | ) | [inline] |
Definition at line 57 of file NemoWrapper.h.
bool NemoWrapper::isSimulationRunning | ( | ) |
Returns true if simulation is currently being played
Definition at line 93 of file NemoWrapper.cpp.
bool spikestream::NemoWrapper::isWaitForGraphics | ( | ) | [inline] |
Definition at line 54 of file NemoWrapper.h.
bool spikestream::NemoWrapper::isWeightsReset | ( | ) | [inline] |
Definition at line 55 of file NemoWrapper.h.
bool spikestream::NemoWrapper::isWeightsSaved | ( | ) | [inline] |
Definition at line 56 of file NemoWrapper.h.
void NemoWrapper::playSimulation | ( | ) |
Plays the simulation
Definition at line 180 of file NemoWrapper.cpp.
void spikestream::NemoWrapper::progress | ( | int | stepsComplete, |
int | totalSteps | ||
) | [signal] |
void NemoWrapper::resetWeights | ( | ) |
Resets the temporary weights to the stored values.
Definition at line 196 of file NemoWrapper.cpp.
void NemoWrapper::run | ( | ) |
Definition at line 317 of file NemoWrapper.cpp.
void NemoWrapper::saveWeights | ( | ) |
Saves the volatile weights to the database
Definition at line 206 of file NemoWrapper.cpp.
void NemoWrapper::setArchiveMode | ( | bool | newArchiveMode, |
const QString & | description = "" |
||
) |
Sets the archive mode. An archive is created the first time this method is called after the simulation has loaded.
Definition at line 403 of file NemoWrapper.cpp.
void NemoWrapper::setCurrentInjectionPattern | ( | const Pattern & | pattern, |
float | current, | ||
unsigned | neuronGroupID, | ||
bool | sustain | ||
) |
Sets a current injection pattern along with the neuron group. The pattern can be injected for one time step or continuously.
Definition at line 451 of file NemoWrapper.cpp.
void NemoWrapper::setFiringInjectionPattern | ( | const Pattern & | pattern, |
unsigned | neuronGroupID, | ||
bool | sustain | ||
) |
Sets a firing pattern along with the neuron group. The pattern can be injected for one time step or continuously.
Definition at line 427 of file NemoWrapper.cpp.
void NemoWrapper::setFiringNeuronIDs | ( | QList< neurid_t > & | neurIDList | ) |
Forces neurons with the specified IDs to fire in the next time step.
Definition at line 239 of file NemoWrapper.cpp.
void NemoWrapper::setFrameRate | ( | unsigned int | frameRate | ) |
Sets the number of frames per second. This is converted into the update interval. If the frame rate is 0 the simulation runs at maximum speed.
Definition at line 392 of file NemoWrapper.cpp.
void NemoWrapper::setInjectCurrent | ( | unsigned | neuronGroupID, |
double | percentage, | ||
double | current, | ||
bool | sustain | ||
) |
Injects the specified amount of current in the specified percentage of randomly selected neurons at each time step. Throws an exception if the number of neurons is greater than the number of neurons in the network.
Definition at line 217 of file NemoWrapper.cpp.
void NemoWrapper::setInjectCurrentNeuronIDs | ( | QList< neurid_t > & | neurIDList, |
double | current | ||
) |
Injects the specified amount of current into the specified neurons in the next time step.
Definition at line 257 of file NemoWrapper.cpp.
void NemoWrapper::setInjectNoise | ( | unsigned | neuronGroupID, |
double | percentage, | ||
bool | sustain | ||
) |
Forces the specified percentage of neurons in the specified neuron group to fire at the next time step. Throws an exception if the neuron group ID does not exist in the current network or if the percentage is < 0 or > 100.
Definition at line 277 of file NemoWrapper.cpp.
void NemoWrapper::setMonitor | ( | bool | mode | ) |
Controls whether the time step is updated at each time step.
Definition at line 489 of file NemoWrapper.cpp.
void NemoWrapper::setMonitorNeurons | ( | bool | firing, |
bool | membranePotential | ||
) |
Sets the monitor mode, which controls whether firing neuron data is extracted from the simulation at each time step
Definition at line 476 of file NemoWrapper.cpp.
void NemoWrapper::setMonitorWeights | ( | bool | enable | ) |
Sets wrapper to retrieve the weights from NeMo and save them to the current weight field in the database. Does this operation every time step until it is turned off.
Definition at line 496 of file NemoWrapper.cpp.
void spikestream::NemoWrapper::setNemoConfig | ( | nemo_configuration_t | nemoConfig | ) | [inline] |
Definition at line 72 of file NemoWrapper.h.
void NemoWrapper::setNeuronParameters | ( | unsigned | neuronGroupID, |
QHash< QString, double > | parameterMap | ||
) |
Sets the parameters of the neurons within NeMo
Definition at line 502 of file NemoWrapper.cpp.
void spikestream::NemoWrapper::setSTDPFunctionID | ( | unsigned | stdpFunctionID | ) | [inline] |
Definition at line 76 of file NemoWrapper.h.
void spikestream::NemoWrapper::setSustainNoise | ( | bool | sustain | ) | [inline] |
Definition at line 77 of file NemoWrapper.h.
void spikestream::NemoWrapper::setSustainPattern | ( | bool | sustainPattern | ) | [inline] |
Definition at line 78 of file NemoWrapper.h.
void NemoWrapper::setSynapseParameters | ( | unsigned | connectionGroupID, |
QHash< QString, double > | parameterMap | ||
) |
Sets the parameters of the synapses within NeMo
Definition at line 512 of file NemoWrapper.cpp.
void spikestream::NemoWrapper::setUpdateFiringNeurons | ( | bool | updateFiringNeurons | ) | [inline] |
Definition at line 79 of file NemoWrapper.h.
void spikestream::NemoWrapper::setWaitInterval | ( | unsigned | waitInterval_ms | ) | [inline] |
Definition at line 80 of file NemoWrapper.h.
void spikestream::NemoWrapper::simulationStopped | ( | ) | [signal] |
void NemoWrapper::stepSimulation | ( | ) |
Steps through a single time step
Definition at line 297 of file NemoWrapper.cpp.
void NemoWrapper::stopSimulation | ( | ) |
Stops the simulation playing without exiting the thread.
Definition at line 520 of file NemoWrapper.cpp.
void spikestream::NemoWrapper::timeStepChanged | ( | unsigned int | timeStep | ) | [signal] |
void spikestream::NemoWrapper::timeStepChanged | ( | unsigned int | timeStep, |
const QList< unsigned > & | neuronIDList | ||
) | [signal] |
void spikestream::NemoWrapper::timeStepChanged | ( | unsigned int | timeStep, |
const QHash< unsigned, float > & | membranePotentialMap | ||
) | [signal] |
void NemoWrapper::unloadSimulation | ( | ) |
Unloads the current simulation and exits run method.
Definition at line 526 of file NemoWrapper.cpp.
const int spikestream::NemoWrapper::NO_TASK_DEFINED = 0 [static] |
==================== VARIABLES ==========================
No task defined
Definition at line 89 of file NemoWrapper.h.
const int spikestream::NemoWrapper::RESET_WEIGHTS_TASK = 1 [static] |
Task of resetting temporary weight values to stored values.
Definition at line 92 of file NemoWrapper.h.
const int spikestream::NemoWrapper::RUN_SIMULATION_TASK = 2 [static] |
Task of playing simulation
Definition at line 95 of file NemoWrapper.h.
const int spikestream::NemoWrapper::SAVE_WEIGHTS_TASK = 3 [static] |
Task of saving weights from simulation into database.
Definition at line 98 of file NemoWrapper.h.
const int spikestream::NemoWrapper::SET_NEURON_PARAMETERS_TASK = 4 [static] |
Task of setting neuron parameters in NeMo
Definition at line 101 of file NemoWrapper.h.
const int spikestream::NemoWrapper::STEP_SIMULATION_TASK = 5 [static] |
Task of advancing one time step of the simulation.
Definition at line 104 of file NemoWrapper.h.