-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
L1 and L2 norms (Euclidean and taxicab lengths) #2562
Comments
I would like to work on this issue! |
Hi, @tvrsimhan. That'd be great. We accept pull requests for issues. Please let us know if you have any questions about how to implement it or test it (questions on the issue are fine). There are two possible ways to do this: either by adding the functions with inefficient autodiff implementations or by adding custom gradients. We'd accept the former, but the advantage in compute speed is from the latter. |
Thank you, @bob-carpenter! In which directory should this be implemented? I read through the guide but I couldn't locate those directories. Also, please point me to any other links I can refer to! I'll try my best and get back to you with any questions I have! I'll try to add custom gradients, but I'll get back to you if I have any trouble with it! |
It should follow the other functions. That means a primitive ( You can see how
|
Thank you for your guidance! I'll do my best! |
@tvrsimhan any update on this issue? Thanks. |
@tvrsimhan the stan math docs have some examples to get started with as well |
Ah sorry, was too quick to close. #2636 addressed the first point of the issue, the second one is still open. Reopening. |
Description
We should have L1 and L2 norm functions in the Stan language. They have to be implemented in the math library first, which is what this PR is for. We want the functions, but ideally we want custom derivatives.
The definitions are:
The derivatives are:
norm1
andnorm2
in the Stan Math library with autodiff test framework testsnorm2
Current Version:
v4.1.0
The text was updated successfully, but these errors were encountered: