To determine the size of the output of a fully connected layer in deep learning, you need to know the number of neurons in the layer and the size of the input.
Assuming the fully connected layer has 50 neurons, the output size would be 50x1.
In order to calculate the output of the fully connected layer given an input size of 25x2, you would need to perform a matrix multiplication between the input vector (1x2) and weight matrix (2x50) of the layer. The output vector would be of size (1x50).
Here is an example code snippet in JavaScript that demonstrates how to perform the matrix multiplication:
index.tsx393 chars10 lines
Note that the above code snippet requires the math.js library which can be installed via npm.
index.tsx19 chars2 lines
gistlibby LogSnag