Non-Contradiction / autodiffr

Automatic Differentiation for R
https://non-contradiction.github.io/autodiffr/
Other
23 stars 2 forks source link

Have something like `forward.chunk` for `ForwardDiff.Chunk`? #12

Closed Non-Contradiction closed 6 years ago

Non-Contradiction commented 6 years ago

If users want to use a chunk of certain size, they need to do it like this:

c = 10
JuliaCall::julia_assign("c", c)
JuliaCall::julia_eval("ForwardDiff.Chunk{c}()")

which is quite inconvenient.

Although it's not in the basic API of ForwardDiff, it's in the advantage usage guide and is recommended "If your input dimension is constant across calls, you should explicitly select a chunk size rather than relying on ForwardDiff's heuristic. "

So my idea is that we should wrap the related Chunk functions.

Non-Contradiction commented 6 years ago

After more thinking, a chunk_size argument can be added to the Config methods. A separate forward.chunk method may be too much with setting chunk size as the only functionality. And it looks more idiomatic from R's point of view.

Non-Contradiction commented 6 years ago

And the new chunk_size parameter can replace the chunk parameter we currently have.

Non-Contradiction commented 6 years ago

The change in the API has been finished, documentation and testing has been updated.