Skip to content

Commit

Permalink
change fm code in layers/fm.py (#381)
Browse files Browse the repository at this point in the history
  • Loading branch information
livmortis authored Jun 19, 2023
1 parent 6d06d4c commit a24f2a8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions easy_rec/python/layers/fm.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ def __init__(self, name='fm'):

def __call__(self, fm_fea):
with tf.name_scope(self._name):
fm_feas = tf.concat(fm_fea, axis=1)
fm_feas = tf.expand_dims(fm_feas, axis=1)
fm_feas = tf.stack(fm_fea, axis=1)
sum_square = tf.square(tf.reduce_sum(fm_feas, 1))
square_sum = tf.reduce_sum(tf.square(fm_feas), 1)
y_v = 0.5 * tf.subtract(sum_square, square_sum)
Expand Down

0 comments on commit a24f2a8

Please sign in to comment.