This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from keras.layers import Lambda | |
from keras import backend as K | |
from numpy import newaxis | |
from keras.models import Model, Input | |
def outer_product(inputs): | |
""" | |
inputs: list of two tensors (of equal dimensions, | |
for which you need to compute the outer product |