CARLsim
5.0.0
CARLsim: a GPU-accelerated SNN simulator
|
Once a network has reached SETUP_STATE or RUN_STATE, the network state can be stored in a file for later processing or for restoring a specific network using the CARLsim::saveSimulation function. The network state consists of all the synaptic connections, weights, delays, and whether the connections are plastic or fixed. The network state data can be analyzed with the MATLAB ConnectionMonitor.
Furthermore, the network state can be loaded from a file using the CARLsim::loadSimulation function call. However, this function can only be called in the CONFIG_STATE.
Saving and loading network state data can be especially time-saving when an SNN is extremely large or if it must be trained for a long period of time. After training for the first run is completed and saved to file, subsequent testing runs will be much faster.
A network can be saved at any time in SETUP_STATE or RUN_STATE, for as many times as desired, via CARLsim::saveSimulation:
where the user specifies a filename (e.g., "networkA.dat") and a flag whether or not to store the synapse information. In this example, "networkA.dat" will contain the network state at the beginning of the experiment, and "networkZ.dat" will contain the network state at the end of the experiment (which might be different from the beginning if there is synaptic plasticity enabled). If the flag saveSynapseInfo
is set to true, the method will store all the synaptic connections, weights, delays, and whether the connections are plastic or fixed. The value of this flag is true
by default.
Past CARLsim networks can be loaded from file by setting up the same number of groups, connections, and neurons as was used to store the network via CARLsim::saveSimulation, and then calling CARLsim::loadSimulation to overwrite all corresponding synaptic weight and delay values from file.
The following code snippet configures a network and calls CARLsim::loadSimulation with a file pointer to "networkA.dat", which is a file that was created with CARLsim::saveSimulation and flag saveSynapseInfo
set to true
:
saveSynapseInfo
set to true
.