Skip to content

Conversation

mohamed82008
Copy link
Member

No description provided.

@mohamed82008
Copy link
Member Author

I will add examples when the AD packages support AbstractDifferentiation.

@mohamed82008 mohamed82008 merged commit 4aca738 into master Aug 29, 2021
```julia
using AbstractDifferentiation
```
`AbstractDifferentiation` exports a single name `AD` which is just an alias for the `AbstractDifferentiation` module itself. You can use this to access names inside `AbstractDifferentiation` using `AD.<>` instead of typing the long name `AbstractDifferentiation`.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the point of this? Can't someone just do

import AbstractDifferentiation as AD

or

using AbstractDifferentiation
const AD = AbstractDifferentiation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I am happy to remove this export if folks here agree that it's not useful. Technically, one can use const to alias any name in a package but I am not sure if this justifies not exporting anything at all. Exporting makes life easier, that's all. But I don't have strong opinions on this.

### Lazy operators

You can also get a struct for the lazy derivative/gradient/Jacobian/Hessian of a function. You can then use the `*` operator to apply the lazy operator on a value or tuple of the correct shape. To get a lazy derivative/gradient/Jacobian/Hessian use any one of:
- `ld = lazyderivative(ab::AbstractBackend, f, xs::Number...)`: returns an operator `ld` for multiplying by the derivative of `f` at `xs`. You can apply the operator by multiplication e.g. `ld * y` where `y` is a number if `f` has a single input, a tuple of the same length as `xs` if `f` has multiple inputs, or an array of numbers/tuples.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be lazy_derivative (and below) to match the rest of the snake_case?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid point. I will open an issue.

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.

2 participants