Hi Hamid,
I understand that you need to implement your own classification layer in your network. You can write your own classification output layer in MATLAB. For that you will need to provide the following details while defining the layer:
- Name: A suitable name for the layer.
- Layer properties: Define the properties of the layer which can be used in the functions.
- Constructor (optional) : Define a constructor to execute initialization code.
- Forward loss function : Define the loss function for forward pass.
- Backward loss function (optional) : Define the derivative of the loss function for back propagation.
You can refer to the following documentation for more details on how to create and include a custom classification layer in a neural network:
I hope it helps.