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

Fix compute_gradient to include frozen parameters #156

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

Conversation

mcfarljm
Copy link

Update compute_gradient to include frozen parameters. Otherwise, the finite difference gradient does not include frozen parameters, which creates a shape mismatch for the array expected by get_gradient. This occurs when using a model that has frozen parameters but no user-defined gradient function. I have added such a regression test case.

New test cases illustrates an error when calling compute_gradient on a Model
instance that has frozen parameters and does not have a user-defined gradient.
The error occurs because get/set parameter vector is called without including
frozen parameters, whereas the indexing in get_gradient expects the result to
include all parameters.
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.

None yet

1 participant