Giter VIP home page Giter VIP logo

diff-zoo's People

Contributors

arkoniak avatar dhairyalgandhi avatar mikeinnes avatar tomjaguarpaw avatar tpapp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

diff-zoo's Issues

Minor details and personal feedback.

First I want to thanks you because this is perfectly done!
It help me a lot to understand because your truly start from the basics with very high quality explanation.

-LaTeX rendering bug after out[31] (in the intro part).

-In[20] (in the forward part) could be write with LaTeX in the text to help fast readers.
Also this section "Perturbation Confusion" could have a conclusion about solutions or the lack of solution to fix this problem.

Division Formulae are Wrong : Dual Numbers

Thank you for this extremely wonderful tutorial. I learnt a lot.
Also please mention that they need to read backandforth.ipynb after the intro.ipynb. It makes most sense that way. And it took me a while to figure that out.

And now the bug...

struct Dual{T<:Real} <: Real
    x::T
    y::T
end
Base.show(io::IO, d::Dual) = println(io, d.x, d.y0 ? "+" : "", d.y, "ϵ")

import Base: +, -, *, /
a::Dual + b::Dual = Dual(a.x + b.x, a.y + b.y)
a::Dual * b::Dual = Dual(a.x * b.x, b.x * a.y + a.x * b.y)
a::Dual / b::Dual = Dual(a.x / b.x,(b.x * a.y - a.x * b.y)/b.x^2)

Base.convert(::Type{Dual{T}}, a::Dual) where T = Dual(convert(T, a.x), convert(T, a.y))
Base.convert(::Type{Dual{T}}, a::Real) where T = Dual(convert(T, a), zero(T))
Base.promote_rule(::Type{Dual{T}}, ::Type{R}) where {T,R} = Dual{promote_type(T,R)}

Now let us try a simple function. I am also giving a numerical derivative for reference.

f(x) = x/(1+x*x)
ndf(x, ϵ=eps()) = (f(x+ϵ)-f(x-ϵ))/2ϵ
f(7), ndf(7)
(0.14, -0.01919999998062849)

Now let us try with Dual numbers

f(Dual(7., 1.))
0.14-0.0192ϵ

Works!

But with your definition of division,

a::Dual / b::Dual = Dual(a.x * b.x, b.x * a.y - a.x * b.y)
f(Dual(7., 1.))
350.0-48.0ϵ

It is obviously wrong. Also you can see that my formula for division matches with your high school text book.

Typo in intro

The first sentence reads:

These notebooks are an exploration of various approaches to analytical differentiation.

From what I can tell, "analytical" should be "algorithmic".

tracing.jl notebook will not build

┌ Error: error when executing notebook based on input file: `<path>\diff-zoo\src\tracing.jl`
└ @ Literate <path>\.julia\packages\Literate\3qT7A\src\Literate.jl:555
ERROR: LoadError: LoadError: syntax: unexpected semicolon in tuple around string:1
in expression starting at string:1
when executing the following code block

@eval dcube(x) = $(Expr(dy))

dcube(5)

If I comment out these lines, then the next lines error too.
I tested with Julia 1.6 and 1.10 and with Literate v2.2.0 and v2.16.0. All had the same error.
There is also a Pkg error updating dependency versions unless name = "diff-zoo" is removed from the Project.toml.

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.