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

Normalization of Resps and Mixture Coefs #2

Open
rmnldwg opened this issue Sep 10, 2024 · 1 comment
Open

Normalization of Resps and Mixture Coefs #2

rmnldwg opened this issue Sep 10, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@rmnldwg
Copy link
Owner

rmnldwg commented Sep 10, 2024

Because the responsibilities and the mixture coefficients live on a simplex (along one axis), it is not straighforward to set just one of them without altering the corresponding other values.

To somehow make that clearer, I separated the setting and the normalization into separate steps. However, that, too, seems at times counterintuitive and cumbersome, because one always has to call separate methods.

One option to make it a little better could be a context manager, like this:

# some code to initialize the mixture model
model = ...

# enter the "mixture coefficient context"
with model.mixture_coefs_context():
    model.set_mixture_coefs(arr1, component=1)
    model.set_mixture_coefs(arr2, subgroup="C01")

Upon exiting the context, everything would be normalized.

@rmnldwg rmnldwg added enhancement New feature or request help wanted Extra attention is needed labels Sep 10, 2024
@rmnldwg rmnldwg self-assigned this Sep 10, 2024
@rmnldwg
Copy link
Owner Author

rmnldwg commented Sep 10, 2024

In case one uses the context manager approach: This could mean that we automatically normalize the coefficients after setting them, when NOT in the context. Only when IN the context, we could omit this step as it is performed automatically when leaving the context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant