Skip to content
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

Streamlining #206

Merged
merged 9 commits into from
Sep 25, 2020
Merged

Streamlining #206

merged 9 commits into from
Sep 25, 2020

Conversation

pmelchior
Copy link
Owner

This PR streamlines common tasks.

  • Blend.fit writes logger message with number of iterations and final logL
  • display.show_likelihood shows our convergence plots from a fit Blend instance.
  • display.show_observation shows the image and PSF in common norm and size (like show_scene but without sources)

In the process, I renamed loss to log_likelihood in both Blend and Observation, and fixed the stupid -1 for good.

Copy link
Collaborator

@fred3m fred3m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. The only change that I requested is to make logger output an info instead of a warning to show the final logL, since this isn't really indicative of something that went wrong and will pollute peoples consoles/terminals.

scarlet/blend.py Outdated
@@ -164,6 +167,12 @@ def expand_grads(*X, func=None):
**alg_kwargs
)

logger.warning(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems more like info than a warning.

@fred3m
Copy link
Collaborator

fred3m commented Sep 7, 2020

Of course, the docs are failing to build, as well as some changes that are needed in scarlet_extensions since you changed the name of Blend.loss. So either deprecate Blend.loss or fix scarlet_extensions using a branch with the same name.

@pmelchior
Copy link
Owner Author

I will re-introduce Blend.loss to be backward compatible.

As for logger.warning, I am aware that it's not formally a warning, but it's the default visible value, and I think it information most people would like to see after Blend.fit.

@pmelchior pmelchior merged commit 9140c01 into master Sep 25, 2020
@pmelchior pmelchior deleted the more-display branch September 25, 2020 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants