|
Algorithm 1 Learning algorithm for dynamic synapse model |
|
Input: matrix of preprocessed input objects, initial distribution of weights, neuron parameters, plasticity parameters, vector of classes.
Parameter: N_epochs, Adam optimizer, BSE loss function, threshold, patience.
Output: distribution of weights of the neural network, spike times of the output.
-
1.
Initialize a stimulus generator and define the input dimension of the feature vector.
-
2.
Create a neural network model based on the dynamic synapse model.
-
3.
Define the loss function and optimizer.
-
4.
Initialize tracking variables for loss and d-prime.
-
5.
for in do
-
6.
Generate train batch.
-
7.
Execute a forward pass within the model.
-
8.
Compute the loss function by comparing the predicted values with the target.
-
9.
Perform backpropagation.
-
10.
end for
-
11.
Append the loss and d-prime values to the corresponding lists for tracking.
-
12.
if
-
13.
Reset the wait_count.
-
14.
else
-
15.
Increase the wait_count.
-
16.
if
-
17.
Break the training loop
-
18.
end if
-
19.
end if
-
20.
Finish the algorithm execution.
|