Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deepmatch/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def l2_normalize(x, axis=-1):
return Lambda(lambda x: tf.nn.l2_normalize(x, axis))(x)


def inner_product(x, y, temperature=1.0):
return Lambda(lambda x: tf.reduce_sum(tf.multiply(x[0], x[1])) / temperature)([x, y])
def inner_product(x, y, temperature=1.0, axis=None, keepdims=False):
return Lambda(lambda x: tf.reduce_sum(tf.multiply(x[0], x[1]),axis=axis, keepdims=keepdims) / temperature)([x, y])


def recall_N(y_true, y_pred, N=50):
Expand Down