In the tensorflow documentation I see the call() method defined when subclassing activations and models. However, in case of subclassing regularizers, initializers and constraints, they define the __class__() method instead.
When playing around with both, I could not find any differences myself.
Could someone tell me what the difference is?
__call__ is a python magic method (or dunder method) that makes class objects callable. but on the other hand call is a user-defined method in Keras which in the background uses mentioned __call__ method but before using it this user-defined call does some extra things like building weight and bias tensors based on the input tensor shape.
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