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
Reserve scale
parameter to ScalarProductMetric
#1761
Conversation
scale
parameter to ScalarProductMetricscale
parameter to ScalarProductMetric
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.
Thanks @johnharveymath! Please take a look to my comments (most of them are little details).
I'll try to understand the tests that are failing. @YannCabanes, your feedback and help would be of great value here, as most of scale
related things were developed by you.
Seems like for most classes it was the distance that was scaled by |
Codecov Report
@@ Coverage Diff @@
## master #1761 +/- ##
==========================================
+ Coverage 80.90% 90.60% +9.70%
==========================================
Files 120 126 +6
Lines 12856 13199 +343
==========================================
+ Hits 10400 11957 +1557
+ Misses 2456 1242 -1214
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Hello @johnharveymath and @LPereira95,
However, I see that in the current master branch, the file I am currently looking at the how the scale influences the curvature, sectional_curvature, riemann_tensor... |
Thanks for the feedback @YannCabanes. I think the implementation of Nevertheless, are you sure about the correctness of |
Hello @johnharveymath and @LPereira95,
|
Hello @LPereira95,
|
Thanks for the explanation - this was caused by my ignorance of the geometry. I though the 3 had something to do with the scale parameter. This test passes now. |
I'm glad you did, @YannCabanes! Your review reveals that some parameters were being divided by As I mentioned earlier, it's definitely best to just have one implementation that is in |
… which no longer accept a `scale` parameter. Update `ScalarProductMetric` to make it a child of `RiemannianMetric` so that the recommended action works.
OK - I think we're ready to go. In summary, this PR:
|
Great work @johnharveymath and @YannCabanes! I'm merging now. @johnharveymath, just two last comments for future reference:
|
…roductMetric` no longer inherits from `RiemannianMetric`
That's makes sense to me. The only issue is that you cannot actually assign
the `ScalarProductMetric` object to be an attribute of a `Manifold`, ie,
you cannot do `manifold.metric = 2.0 * manifold.metric`. I have changed
`manifold.py` in one additional commit to permit this. I know there has
been discussion about making `manifold.metric` a read-only object in
future, but it seems to me that this might be one time you want to be able
edit it.
…On Thu, Dec 15, 2022 at 1:53 PM Luís F. Pereira ***@***.***> wrote:
Great work @johnharveymath <https://github.com/johnharveymath> and
@YannCabanes <https://github.com/YannCabanes>! I'm merging now.
@johnharveymath <https://github.com/johnharveymath>, just two last
comments for future reference:
1.
I think we should remove the error messages for scale soon. I thought
about removing it before merging, but I see we should not do it as our
inits accept kwargs (which mean code with scale will not fail, but
will provide unexpected results). Very soon I want to remove **kwargs
from all the inits, so we can remove this kind of errors (python error
messages will be good enough then).
2.
I think ScalarProductMetric shouldn't inherit from RiemannianMetric.
The reason is that by doing that we lose control over the methods we are
providing: e.g. in *init* we do not wrap private methods of
underlying_metric, but we inherit them from RiemannianMetric, without
providing proper scaling (e.g. imagine in the future we implement
_inner_product for some reason, it will become available for
ScalarProductMetric). What do you think? We can simply implement the
multiplication in ScalarProductMetric also.
—
Reply to this email directly, view it on GitHub
<#1761 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOQUDAOU57G4CD4TI3NIJHDWNMIGNANCNFSM6AAAAAAS5MJOGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Thanks @johnharveymath! I added multiplication to Merging now... |
Well spotted. Thanks for all your advice and help on this one.
…On Thu, Dec 15, 2022 at 2:23 PM Luís F. Pereira ***@***.***> wrote:
Thanks @johnharveymath <https://github.com/johnharveymath>!
I added multiplication to ScalarProductMetric (because it is not being
inherited). It is code duplication, but I think for a good reason here.
Merging now...
—
Reply to this email directly, view it on GitHub
<#1761 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOQUDAPPJZHAA64ID4LZHNDWNMLU5ANCNFSM6AAAAAAS5MJOGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Closes #1757 and closes #1758 by removing the
scale
parameter from various manifolds.These are the
Hyperbolic
,HPDMatrices
andPoincarePolydisk
manifolds, along with all their related classes.@YannCabanes The tests are failing on
PoincarePolydisk
and I don't understand the objects well enough to remedy the issue. Maybe you could have a look?