How to find the number of operation ( multiplication or addition etc) required given a Keras model?
I want to implement an FPGA code or hardware code of a Keras model. As a first step, I want to find the number of mathematical operations required to evaluate a predicted output given a model. The model below is a two-class classifier and a sample of input is a vector of size 232X1. The model is:
model.add(keras.layers.Dense(5, input_dim=232, activation='relu'))
model.add(keras.layers.Dense(1, activation='sigmoid'))
The question is given in the model above, how many mathematical operations (plus, minus, multiplication, division) are required to find the output value. In my understanding since there are 5 output neurons in the first layer we have 5232 weights so we need to calculate 5232 multiplication in the first stage and next as we have 5 relu activation calculation. As there are no other layers except the last layer, which is just the output we need only 5 multiplication and 5 sigmoid calculation, and 5 addition.
Is the above approach correct?
Category Data Science