In MATLAB, the size of the output of a fully connected layer can be calculated using the following formula:
main.m36 chars2 lines
Where inputSize
is the size of the input to the layer and numNeurons
is the number of neurons in the layer.
For example, if the input to the layer has a size of 10 and the layer has 5 neurons, then the output size will be:
main.m36 chars3 lines
To get the size of the input to the fully connected layer, you can use the size
function in MATLAB. For example, if your input data is stored in a matrix X
, then the size of the input will be:
main.m23 chars2 lines
This will return the number of columns in the matrix X
, which corresponds to the size of the input to the fully connected layer.
gistlibby LogSnag