I want to use attention mechanism with the code bellow :
attention = Dot([decoder_outputs, encoder_outputs], axes=[2, 1])
attention = Activation('softmax')(attention)
context = Dot([attention, encoder_outputs], axes=[2,1])
decoder_combined_context = concatenate([context, decoder_outputs])
But i have this error message and i don't know how to fix it
Traceback (most recent call last):
attention = Dot([decoder_outputs, encoder_outputs], axes=[2, 1])
TypeError: __init__() got multiple values for argument 'axes'
I'm using keras version 2.3.1 with tensorflow version 2.1.0
The first argument to Dot
is called axes
:
tf.keras.layers.Dot(axes, normalize=False, **kwargs)
So you need to decide what value you want to pass for axes
: either [decoder_outputs, encoder_outputs]
or [2, 1]
.