A whole layer of these dense neurones can be written using a matrix product
For example given the following setup of neurones for layer
with a batch size of
The weights would then take the form
When these are multiplied together we get the following output values
The dimensions of the matrices in the following equations are probably not compatible for dot products, and in practice some might need to be transposed
If the layer is not the output layer:
If the layer is the output layer: