output dimension of fully connected layer in matlab

To output the dimensions of a fully connected layer in Matlab, you can use the "size" function. Assuming you have already created a fully connected layer object named "fc_layer", you can simply run:

main.m
size(fc_layer.weights)
23 chars
2 lines

This will output a 1x2 array containing the number of rows and columns in the weight matrix of the layer. Similarly, you can also output the number of neurons in the layer by running:

main.m
size(fc_layer.weights, 2)
26 chars
2 lines

This will output a scalar value representing the number of columns in the weight matrix, which is equal to the number of neurons in the layer.

gistlibby LogSnag