Given a defined Convolutional Neural Network, is there a function or method on how to compute the number of Multiply-Adds
operations?
The term was introduced MobileNetV2
paper : https://arxiv.org/pdf/1801.04381.pdf.
We evaluate the trade-offs between accuracy, and number of operations measured by multiply-adds (MAdd), as well as actual latency, and the number of parameters.
Counting the Multiply-Add
operations is equivalent to calculating the FLOPs of a model. This can be achieved using the profiler from tensorflow.
flops = tf.profiler.profile(graph,\
options=tf.profiler.ProfileOptionBuilder.float_operation())
print('FLOP = ', flops.total_float_ops)
Be sure to look at the caveats explained in this answer. Basically:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With