Giter Club home page Giter Club logo

Comments (7)

mcabbott avatar mcabbott commented on June 11, 2024

The obvious thing here is ForwardDiff.gradient(x -> det(ForwardDiff.hessian(g, x)), x). Does this fail?

from forwarddiff.jl.

tlorance avatar tlorance commented on June 11, 2024

That might work; I didn't know you could do that. Just to be clear, though, my determinant is not the full determinant of the hessian (which would be a 3x3), so I'm still not sure how to construct it. I will experiment with the ForwardDiff.hessian function, see how its output is formatted, and see if I can select the first two rows and columns via an inline method.

from forwarddiff.jl.

tlorance avatar tlorance commented on June 11, 2024

I am new enough to Julia that I am not entirely sure which "x"s in your formula should be replaced with my input and which should be left alone (since my function is defined as g(x::Vector)=...). However, it was easy to select the first two rows and columns via an inline method, so I'm sure this will work, as soon as I figure it out.

from forwarddiff.jl.

tlorance avatar tlorance commented on June 11, 2024

Final question: is the partial derivative in row 2, column 1 of my formula in the corresponding location in the hessian?

from forwarddiff.jl.

tlorance avatar tlorance commented on June 11, 2024

Well, the code runs and appears to function, but the answer is very different from what I obtained by hand-coding a finite difference, so I think I screwed something up.

from forwarddiff.jl.

longemen3000 avatar longemen3000 commented on June 11, 2024

is this related to criticality conditions?

from forwarddiff.jl.

tlorance avatar tlorance commented on June 11, 2024

I found an example in a journal article, coded the example, and managed to replicate it, so perhaps the code is OK and my hand-coded version is wrong. I still have issues, but they seem to be chemistry issues, not numerical methods issues, so: thank you very much, your solution worked like a charm!

from forwarddiff.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.