Skip to content

Commit

Permalink
switched to mean on regularization
Browse files Browse the repository at this point in the history
  • Loading branch information
Jhsmit committed Jul 17, 2020
1 parent 2ad393c commit 90a1b0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyhdx/fitting_tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def __call__(self, x):
regularization = 0.
diff = x[:-1] - x[1:]
if self.l1:
regularization += self.l1*math_ops.reduce_sum(math_ops.abs(diff))
regularization += self.l1*tf.math.reduce_mean(math_ops.abs(diff))
if self.l2:
regularization += self.l2*math_ops.reduce_sum(math_ops.square(diff)) # should we take the sqrt of the sum?
regularization += self.l2*tf.math.reduce_mean(math_ops.square(diff)) # should we take the sqrt of the sum?

return regularization

Expand Down

0 comments on commit 90a1b0c

Please sign in to comment.