Better way to instantiate myCallback class to avoid confusion


To avoid confusion, used a different name for the class instant:

Instantiate class

thecallback = myCallback()

Train the model with a callback, y_train, epochs=10, callbacks=[thecallback])

instead of : callbacks=[callbacks]

You can do that. Given that python can differentiate between the names based on context, it’s not necessary.

Happy learning.