To be able to use logsumexp in the keras.backend, what is the appropriate way to import Keras 2?
Here is what I have tried and failed in colab. Both get AttributeError: module 'keras.backend' has no attribute 'logsumexp'
- 1st round:
import tensorflow
import keras
import keras.backend as K
K.logsumexp
keras.__version__ # 2.15.0
tensorflow.__version__ #2.15.0
- 2nd round with a new session
import tensorflow
from tensorflow import keras
from keras import backend as K
K.logsumexp
tensorflow.__version__ #2.15.0
I doubt the reason is that logsumexp is not decorated as others in keras.backends.
@keras_export('keras.backend.logsumexp')
@dispatch.add_dispatch_support