Skip to main content
. 2023 Sep 12;8(5):422. doi: 10.3390/biomimetics8050422
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 N_epochs 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 dprime<threshold

  • 13.

        Reset the wait_count.

  • 14.

    else

  • 15.

        Increase the wait_count.

  • 16.

        if wait_countpatience

  • 17.

               Break the training loop

  • 18.

         end if

  • 19.

    end if

  • 20.

    Finish the algorithm execution.