Skip to content

Commit

Permalink
refactor: change power loss calculation approach (?)
Browse files Browse the repository at this point in the history
  • Loading branch information
vsheg committed Jul 22, 2024
1 parent f84cc13 commit f4a8068
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion moll/measures/_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def power(diff: ArrayLike, p: float = 2.0) -> Array:
Array(1000., dtype=...)
"""
diff = jnp.asarray(diff)
return jnp.where(diff > 0, jnp.power(diff, p), jnp.inf)
return jnp.power(jnp.abs(diff), p) * jnp.sign(diff) # TODO: is this a good idea?


@public
Expand Down

0 comments on commit f4a8068

Please sign in to comment.