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

Bug in gradient #1

Open
thodson-usgs opened this issue Aug 3, 2023 · 0 comments
Open

Bug in gradient #1

thodson-usgs opened this issue Aug 3, 2023 · 0 comments

Comments

@thodson-usgs
Copy link
Member

There is a bug in the gradient code.
The current implementation seems fine, so long as the gradient is given as given as a vector of length (n) but fails when the gradient is a scalar.

For example, to apply a scalar gradient term (as in a change of units), you'd need to convert it to a vector of length n.

l1 = normal_ll(y, y_hat, transform=lambda x: x*5, gradient=np.repeat(5, n))
l2 = normal_ll(y, y_hat)
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

1 participant