Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Problem with W^1/2 weight exponent #78
Problem with W^1/2 weight exponent #78
Changes from 6 commits
fc578da
603607b
16f5c63
67710c4
71deb29
1b12a7c
7db54df
911e846
89cd822
1d93d7f
d23dedd
f9b0ffc
a3cc78d
9a91bc2
adb5c67
86e12ca
1b274d3
8dc136d
d241130
ce30a7c
a4e259c
449d0b2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Is this change desirable? Dropping the use if
self.functional
seems like it may have consequences for derived classes.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 don't think it does. Does it?
I have this to keep it consistent with the weighted case where we can avoid computing the square root of the weights.
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.
Understood, and that's a worthwhile goal, but we should make sure there aren't any undesirable consequences before we make this change.
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 don't mind this change for the time being.
Longer term, consider: Why is
functional
a property at all if it is not used here? Broadly, I think this discussion is a symptom of the existence ofLoss
. One might hope to implement__call__
at the level ofLoss
(and therefore usingself.functional
) to reduce repeated code. But we can't do that, becauseLoss
is so general it doesn't know that it should beA@x - y
.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.
Agreed: if this change is made, we should consider removing the
functional
attribute. With respect toLoss
, do you recall why it's so general? If there's good reason, perhaps we should have a specialization that really isA@x - y
?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 the reason it is general is because of the Poisson. I think the reason it exists at all is that it used to not be a subclass of
Functional
and therefore having a baseLoss
class made sense.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.
Nitpick: change to "Measurement."
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.
fixed in 7db54df
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.
See earlier comment on similar lines.
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.
Let's see whether that is still the case when we add the test for the Hessian.
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.
Still unhappy, it seems. It would be best to address this before we merge.
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 added a test for
loss.PoissonLoss
which will, I assume, resolve this.@Michael-T-McCann : Would you not agree that the
Loss
tests should be in a separatetest_loss.py
file rather than included intest_functional.py
?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.
Loss
is currently a subclass ofFunctional
(was not always this way). Therefore I think it makes sense for the losses to get tested intest_functional.py
, unless the file is much too long.