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

Add an API for third order tensor products #482

Open
amontoison opened this issue Sep 10, 2024 · 4 comments
Open

Add an API for third order tensor products #482

amontoison opened this issue Sep 10, 2024 · 4 comments
Assignees

Comments

@amontoison
Copy link
Member

amontoison commented Sep 10, 2024

It will be great to have a few routines to compute tensor products.
We can do that with Enzyme.jl and add a backend for it in ADNLPModels.jl.

@tmigot
Copy link
Member

tmigot commented Sep 11, 2024

I have the code, for third order products so I can upload it and see how can improve it :).

@tmigot
Copy link
Member

tmigot commented Sep 12, 2024

@amontoison Do you have a link to what Enzyme is doing for this?

@tmigot tmigot self-assigned this Sep 12, 2024
@amontoison
Copy link
Member Author

amontoison commented Sep 12, 2024

@wsmoses and @michel2323 can probably better explain than me.
The first step is to add it in the API on Enzyme.jl,
I discussed about it with Michel this morning.
I hope that we can discuss about that all together next week during AD2024.

@amontoison
Copy link
Member Author

We discussed about the API for n-th order tensor products with @michel2323 and we think that this API could be relevant:

"""
    tensor_projection(nlp, n, x, directions, args...)

Computes the projection of the n-th derivative of `nlp` at `x` along the specified directions.

# Arguments

- `nlp`: An NLPModel.
- `n::Int`: The order of the derivative to compute.
- `x::AbstractVector`: The point at which the derivative is evaluated.
- `directions::Tuple{Int, Vararg{Int}}`: A tuple of indices specifying the derivative directions 
  (e.g., `(1, 2)` for a tensor projection along the first and second axes).
- `args...`: A list of vectors, one for each direction specified in `directions`.

# Output

The projection of the n-th derivative of `nlp` at `x` along the specified directions.
"""
function tensor_projection end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants