Skip to content

Commit

Permalink
Make the weights of the CombinedLoss optimizable in a QuaPy gridsearc…
Browse files Browse the repository at this point in the history
…h (and bump the version number to a new release)
  • Loading branch information
mirkobunse committed Jul 2, 2024
1 parent e30373c commit 88a63ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions qunfold/losses.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,11 @@ class CombinedLoss(AbstractLoss):
"""
def __init__(self, *losses, weights=None):
self.losses = losses
if weights is None:
weights = jnp.ones(len(losses))
self.weights = weights
def _instantiate(self, q, M, N):
weights = self.weights
if weights is None:
weights = jnp.ones(len(self.losses))
return lambda p: _combine_losses(self.losses, self.weights, q, M, p, N)

# helpers for TikhonovRegularization
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def readme():

setup(
name="qunfold",
version="0.1.4-rc",
version="0.1.4",
description="Composable quantification and unfolding methods",
long_description=readme(),
classifiers=[
Expand Down

0 comments on commit 88a63ef

Please sign in to comment.