{"action":"closed","issue":{"url":"https://api.github.com/repos/Non-Contradiction/autodiffr/issues/2","repository_url":"https://api.github.com/repos/Non-Contradiction/autodiffr","labels_url":"https://api.github.com/repos/Non-Contradiction/autodiffr/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/Non-Contradiction/autodiffr/issues/2/comments","events_url":"https://api.github.com/repos/Non-Contradiction/autodiffr/issues/2/events","html_url":"https://github.com/Non-Contradiction/autodiffr/issues/2","id":322873370,"number":2,"title":"Progress of Wrapping APIs of ForwardDiff ","user":{"login":"Non-Contradiction","id":10393778,"avatar_url":"https://avatars3.githubusercontent.com/u/10393778?v=4","gravatar_id":"","url":"https://api.github.com/users/Non-Contradiction","html_url":"https://github.com/Non-Contradiction","followers_url":"https://api.github.com/users/Non-Contradiction/followers","following_url":"https://api.github.com/users/Non-Contradiction/following{/other_user}","gists_url":"https://api.github.com/users/Non-Contradiction/gists{/gist_id}","starred_url":"https://api.github.com/users/Non-Contradiction/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Non-Contradiction/subscriptions","organizations_url":"https://api.github.com/users/Non-Contradiction/orgs","repos_url":"https://api.github.com/users/Non-Contradiction/repos","events_url":"https://api.github.com/users/Non-Contradiction/events{/privacy}","received_events_url":"https://api.github.com/users/Non-Contradiction/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/Non-Contradiction/autodiffr/milestones/1","html_url":"https://github.com/Non-Contradiction/autodiffr/milestone/1","labels_url":"https://api.github.com/repos/Non-Contradiction/autodiffr/milestones/1/labels","id":3345356,"number":1,"title":"First phase","description":null,"creator":{"login":"Non-Contradiction","id":10393778,"avatar_url":"https://avatars3.githubusercontent.com/u/10393778?v=4","gravatar_id":"","url":"https://api.github.com/users/Non-Contradiction","html_url":"https://github.com/Non-Contradiction","followers_url":"https://api.github.com/users/Non-Contradiction/followers","following_url":"https://api.github.com/users/Non-Contradiction/following{/other_user}","gists_url":"https://api.github.com/users/Non-Contradiction/gists{/gist_id}","starred_url":"https://api.github.com/users/Non-Contradiction/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Non-Contradiction/subscriptions","organizations_url":"https://api.github.com/users/Non-Contradiction/orgs","repos_url":"https://api.github.com/users/Non-Contradiction/repos","events_url":"https://api.github.com/users/Non-Contradiction/events{/privacy}","received_events_url":"https://api.github.com/users/Non-Contradiction/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":1,"state":"open","created_at":"2018-05-14T16:49:59Z","updated_at":"2018-05-26T14:27:09Z","due_on":null,"closed_at":null},"comments":23,"created_at":"2018-05-14T15:43:28Z","updated_at":"2018-05-26T14:27:09Z","closed_at":"2018-05-26T14:27:09Z","author_association":"OWNER","body":"From <http://www.juliadiff.org/ForwardDiff.jl/stable/user/api.html>\r\n\r\nNote that since common R native functions are not supposed to modify the content of its input, so methods in `ForwardDiff.jl` api with `f!` (which is a common notation in julia that the function is supposed to modify the content of its input) are omitted here. For similar reasons, method like `derivative!` will also not be wrapped. (??)\r\n\r\n## Derivatives of `f(x::Real)::Union{Real,AbstractArray}`\r\n\r\n- [x] `ForwardDiff.derivative(f, x::Real)` \r\nReturn df/dx evaluated at x, assuming f is called as f(x).\r\nThis method assumes that isa(f(x), Union{Real,AbstractArray}).\r\n\r\n- [x] `ForwardDiff.derivative!(result::Union{AbstractArray,DiffResult}, f, x::Real)` \r\nCompute df/dx evaluated at x and store the result(s) in result, assuming f is called as f(x).\r\nThis method assumes that isa(f(x), Union{Real,AbstractArray}).\r\n\r\n## Gradients of `f(x::AbstractArray)::Real`\r\n\r\n- [x] `ForwardDiff.gradient(f, x::AbstractArray, cfg::GradientConfig = GradientConfig(f, x), check=Val{true}())`\r\nReturn ∇f evaluated at x, assuming f is called as f(x).\r\nThis method assumes that isa(f(x), Real).\r\nSet check to Val{false}() to disable tag checking. This can lead to perturbation confusion, so should be used with care.\r\n\r\n- [x] `ForwardDiff.gradient!(result::Union{AbstractArray,DiffResult}, f, x::AbstractArray, cfg::GradientConfig = GradientConfig(f, x), check=Val{true}())`\r\nCompute ∇f evaluated at x and store the result(s) in result, assuming f is called as f(x).\r\nThis method assumes that isa(f(x), Real).\r\n\r\n## Jacobians of `f(x::AbstractArray)::AbstractArray`\r\n\r\n- [x] `ForwardDiff.jacobian(f, x::AbstractArray, cfg::JacobianConfig = JacobianConfig(f, x), check=Val{true}())`\r\nReturn J(f) evaluated at x, assuming f is called as f(x).\r\nThis method assumes that isa(f(x), AbstractArray).\r\nSet check to Val{false}() to disable tag checking. This can lead to perturbation confusion, so should be used with care.\r\n\r\n- [x] `ForwardDiff.jacobian!(result::Union{AbstractArray,DiffResult}, f, x::AbstractArray, cfg::JacobianConfig = JacobianConfig(f, x), check=Val{true}())`\r\nCompute J(f) evaluated at x and store the result(s) in result, assuming f is called as f(x).\r\nThis method assumes that isa(f(x), AbstractArray).\r\nSet check to Val{false}() to disable tag checking. This can lead to perturbation confusion, so should be used with care.\r\n\r\n## Hessians of `f(x::AbstractArray)::Real`\r\n\r\n- [x] `ForwardDiff.hessian(f, x::AbstractArray, cfg::HessianConfig = HessianConfig(f, x), check=Val{true}())`\r\nReturn H(f) (i.e. J(∇(f))) evaluated at x, assuming f is called as f(x).\r\nThis method assumes that isa(f(x), Real).\r\nSet check to Val{false}() to disable tag checking. This can lead to perturbation confusion, so should be used with care.\r\n\r\n- [x] `ForwardDiff.hessian!(result::AbstractArray, f, x::AbstractArray, cfg::HessianConfig = HessianConfig(f, x), check=Val{true}())`\r\nCompute H(f) (i.e. J(∇(f))) evaluated at x and store the result(s) in result, assuming f is called as f(x).\r\nThis method assumes that isa(f(x), Real).\r\nSet check to Val{false}() to disable tag checking. This can lead to perturbation confusion, so should be used with care.\r\n\r\n- [x] `ForwardDiff.hessian!(result::DiffResult, f, x::AbstractArray, cfg::HessianConfig = HessianConfig(f, result, x), check=Val{true}())`\r\nExactly like ForwardDiff.hessian!(result::AbstractArray, f, x::AbstractArray, cfg::HessianConfig), but because isa(result, DiffResult), cfg is constructed as HessianConfig(f, result, x) instead of HessianConfig(f, x).\r\nSet check to Val{false}() to disable tag checking. This can lead to perturbation confusion, so should be used with care.\r\n\r\n## Preallocating/Configuring Work Buffers\r\n\r\nFor the sake of convenience and performance, all \"extra\" information used by ForwardDiff's\r\nAPI methods is bundled up in the `ForwardDiff.AbstractConfig` family of types. These types\r\nallow the user to easily feed several different parameters to ForwardDiff's API methods,\r\nsuch as chunk size, work buffers, and perturbation seed configurations.\r\n\r\nForwardDiff's basic API methods will allocate these types automatically by default,\r\nbut you can drastically reduce memory usage if you preallocate them yourself.\r\n\r\nNote that for all constructors below, the chunk size `N` may be explicitly provided,\r\nor omitted, in which case ForwardDiff will automatically select a chunk size for you.\r\nHowever, it is highly recommended to specify the chunk size manually when possible\r\n(see [Configuring Chunk Size](@ref)).\r\n\r\nNote also that configurations constructed for a specific function `f` cannot be reused to\r\ndifferentiate other functions (though can be reused to differentiate `f` at different\r\nvalues). To construct a configuration which can be reused to differentiate any function, you\r\ncan pass `nothing` as the function argument. While this is more flexible, it decreases\r\nForwardDiff's ability to catch and prevent [perturbation\r\nconfusion](https://github.com/JuliaDiff/ForwardDiff.jl/issues/83).\r\n\r\n- [x] `ForwardDiff.GradientConfig(f, x::AbstractArray, chunk::Chunk = Chunk(x))`\r\nReturn a GradientConfig instance based on the type of f and type/shape of the input vector x.\r\nThe returned GradientConfig instance contains all the work buffers required by ForwardDiff.gradient and ForwardDiff.gradient!.\r\nIf f is nothing instead of the actual target function, then the returned instance can be used with any target function. However, this will reduce ForwardDiff's ability to catch and prevent perturbation confusion (see https://github.com/JuliaDiff/ForwardDiff.jl/issues/83).\r\nThis constructor does not store/modify x.\r\n\r\n- [x] `ForwardDiff.JacobianConfig(f, x::AbstractArray, chunk::Chunk = Chunk(x))`\r\nReturn a JacobianConfig instance based on the type of f and type/shape of the input vector x.\r\nThe returned JacobianConfig instance contains all the work buffers required by ForwardDiff.jacobian and ForwardDiff.jacobian! when the target function takes the form f(x).\r\nIf f is nothing instead of the actual target function, then the returned instance can be used with any target function. However, this will reduce ForwardDiff's ability to catch and prevent perturbation confusion (see https://github.com/JuliaDiff/ForwardDiff.jl/issues/83).\r\nThis constructor does not store/modify x.\r\n\r\n- [x] `ForwardDiff.HessianConfig(f, x::AbstractArray, chunk::Chunk = Chunk(x))`\r\nReturn a HessianConfig instance based on the type of f and type/shape of the input vector x.\r\nThe returned HessianConfig instance contains all the work buffers required by ForwardDiff.hessian and ForwardDiff.hessian!. For the latter, the buffers are configured for the case where the result argument is an AbstractArray. If it is a DiffResult, the HessianConfig should instead be constructed via ForwardDiff.HessianConfig(f, result, x, chunk).\r\nIf f is nothing instead of the actual target function, then the returned instance can be used with any target function. However, this will reduce ForwardDiff's ability to catch and prevent perturbation confusion (see https://github.com/JuliaDiff/ForwardDiff.jl/issues/83).\r\nThis constructor does not store/modify x.\r\n\r\n- [x] `ForwardDiff.HessianConfig(f, result::DiffResult, x::AbstractArray, chunk::Chunk = Chunk(x))`\r\nReturn a HessianConfig instance based on the type of f, types/storage in result, and type/shape of the input vector x.\r\nThe returned HessianConfig instance contains all the work buffers required by ForwardDiff.hessian! for the case where the result argument is an DiffResult.\r\nIf f is nothing instead of the actual target function, then the returned instance can be used with any target function. However, this will reduce ForwardDiff's ability to catch and prevent perturbation confusion (see https://github.com/JuliaDiff/ForwardDiff.jl/issues/83).\r\nThis constructor does not store/modify x.\r\n\r\n### Update\r\nSince we have finished all the basic implementations. The next step will be:\r\n- [x]  Export the wrapper functions.\r\n- [x]  Finish the documentation.\r\n- [x]  Add tests."}}
{"actor":{"display_login":"Non-Contradiction"}}