I'm studying machine learning, and often I need to implement math formulas that use no symbols to indicate multiplication between matrix variable, for example $Z = WX + b$
Looking at the formulas I can't seem to understand when that multiplication should be element wise multiplication, and when it should be a matrix multiplication.
I was under the impression that unless the formula included $*$ between variables it referred to a matrix multiplication, but it seems I was wrong. Recently I had to implement the following formula:

The correct implementation used element wise multiplication.
But then I had to implement this formulas where as shown the correct implementation was to use matrix multiplication
How can I know if I should use element wise multiplication or matrix multiplication when looking at a mathmathical formula?
Additional information, since someone asked for more context: The first formula is for cross entropy cost (basically a meassure of how far the a machine learning model predictions are from the truth). The second formulas are used for backward propagation (calculating how to modify weights(W) and biases(B) on machine learning).