JuliaDiff / JuliaDiff/DiffResults.jl

impossible to differentiate over integer array

Open
#10 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
37
Forks
9
PR merge metrics
No merged PRs in 30d

Description

l(xu) = sum(sqrt(i^2 + 1) for i in xu)
xu = Vector(1:6)
result = DiffResults.HessianResult(xu)

result = ForwardDiff.hessian!(result, l, xu) will give
InexactError: Int64(Int64, 22.11744686954993)

Problem will be solve if xu = Vector{Float64}(1:6)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported call with xu = Vector(1:6) and compare it with the Float64 version. Trace how DiffResults.HessianResult(xu) stores results and identify what behavior should be considered done: integer input should work without the reported InexactError, or the required input type should be made explicit.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.