-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make likelihoods a type of cost #230
Make likelihoods a type of cost #230
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 210-add-likelihood-classes #230 +/- ##
==============================================================
- Coverage 94.37% 94.22% -0.15%
==============================================================
Files 33 33
Lines 1760 1750 -10
==============================================================
- Hits 1661 1649 -12
- Misses 99 101 +2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks for the additions @NicolaCourtier! I've added a few comments, I'm happy to update these in #210 though :) Let me know if any thoughts on them!
the log-likelihood | ||
""" | ||
raise NotImplementedError | ||
self.log_likelihood = problem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed as it was only required for the ProbabilityCost() wrapper.
self.log_likelihood = problem |
@@ -75,12 +75,6 @@ def test_base_likelihood_init(self, problem): | |||
assert likelihood._n_parameters == 1 | |||
assert np.array_equal(likelihood._target, problem._target) | |||
|
|||
@pytest.mark.unit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still want this test? Looking at the above class, BaseLikelihood
still returns NotImplemented from call(). It would be good to keep a test on that.
optimiser=None, | ||
sigma0=None, | ||
verbose=False, | ||
physical_viability=True, | ||
allow_infeasible_solutions=True, | ||
): | ||
self.cost = cost | ||
self.x0 = x0 | ||
self.x0 = cost.x0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned above. This keeps it open :)
self.x0 = cost.x0 | |
self.x0 = x0 or cost.x0 |
@@ -40,27 +40,24 @@ class Optimisation: | |||
def __init__( | |||
self, | |||
cost, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want users to overwrite the initial conditions, right? This modification should keep that open.
cost, | |
cost, | |
x0=None, |
0b53048
into
210-add-likelihood-classes
Description
Suggestion to make the new likelihood classes a type of cost.
Issue reference
Regarding #210
Type of change