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

Keep track of model logprob during fitting #67

Open
calebweinreb opened this issue Jun 19, 2023 · 0 comments
Open

Keep track of model logprob during fitting #67

calebweinreb opened this issue Jun 19, 2023 · 0 comments
Assignees

Comments

@calebweinreb
Copy link
Contributor

It would be nice to compute the log probability of the model during each fitting iteration of fitting and plot it so that people have a sense of whether the model has converged or not. Here are a few notes on implementation:

  • The log likelihood can be computed using jax_moseq.models.keypoint_slds.model_likelihood
  • model_likelihood returns a dictionary that maps each variable name to the conditional probability of that variable. We could store all of these values separately, but it might be simpler to just store their sum (the total joint log prob)
  • In terms of where/when to call model_likelihood, one option would be every resample iteration (and perhaps store the result in the model dictionary). Another option would be just when updating the history during model fitting (i.e. here)
  • We can then plot the history of logprobs in the plot_progress function
  • When plotting, there's going to be a huge increase in the first few iterations and then a slow increase after that. If the y-axis includes the full range, it may be hard to see then the slow increase becomes a plateau. Therefore, I propose that we superimpose two copies of the plot, one with the full-yaxis and one with a zoomed in y-axis (and perhaps use color coded axis ticks on the left and right sides of the subplot). Another option would be to just show the zoomed-in version.
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

No branches or pull requests

2 participants