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

Add Support for Weighted Inputs in flow.train #107

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

astro-jingtao
Copy link

Description:

This PR introduces support for weighted inputs in the flow.train method, allowing users to provide a sample_weight parameter. Users can now call the method as follows:

flow.train(data, sample_weight=sample_weight)

Key details:

  • If sample_weight is not provided or is set to None, the function will maintain its previous behavior.
  • This feature is particularly beneficial for astronomical applications, such as utilizing a 1/V weighted galaxy sample.

Changes Made:

  • Modified the flow.train implementation to accept an optional sample_weight argument.
  • Updated relevant docstring to reflect the new functionality.

Please review the changes and consider incorporating this feature into the main branch. I believe it will enhance the utility of the flow.train function for users working with weighted data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant