Code Monkey home page Code Monkey logo

Comments (5)

jrevels avatar jrevels commented on September 18, 2024 1

It turns out I was still using Julia v0.6.0-rc3 (the final release candidate just before the v0.6.0 release), just updated to Julia v0.6.0 and now I can reproduce it. AFAICT, that means it was JuliaLang/julia@e5e8be2 that introduced the bug here. I'll dig through that commit tomorrow. Thanks again for finding this!

Maybe it's something about my GPU? I don't think I have CUDA libraries b/c when I ran Pkg.update() last time Tensorflow complained about it:

ReverseDiff doesn't automatically run anything on the GPU; it falls back to however array operations are defined on your input array type.

from reversediff.jl.

jrevels avatar jrevels commented on September 18, 2024

I can't reproduce this...here's what I'm getting on my end (using ReverseDiff v0.1.4, the latest version):

julia> using ReverseDiff

julia> f(X) = sum([if x > 0; x else 0 end for x in X])
f (generic function with 1 method)

julia> ReverseDiff.gradient(f, [2,3,-1])
3-element Array{Int64,1}:
 1
 1
 0

I'll close this since it seems to be fixed on the latest ReverseDiff version, but please let me know if you encounter any issues with this.

from reversediff.jl.

NHDaly avatar NHDaly commented on September 18, 2024

Huh, that is super weird. I just installed it again on a new machine, and I have v0.1.4 as well. I also just ran Pkg.update():

$ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.6.0 (2017-06-19 13:05 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-apple-darwin13.4.0

julia> Pkg.update()
INFO: Updating METADATA...
INFO: Computing changes...
INFO: No packages to install, update or remove

julia> using ReverseDiff

julia> f(X) = sum([if x > 0; x else 0 end for x in X])
f (generic function with 1 method)

julia> ReverseDiff.gradient(f, [2,3,-1])
3-element Array{Int64,1}:
 0
 0
 0

julia>

Maybe it's something to do with my machine? I'm on a 2017 13" MacBook Pro, macOS 10.12.5.

Maybe it's something about my GPU? I don't think I have CUDA libraries b/c when I ran Pkg.update() last time Tensorflow complained about it:

INFO: Upgrading TensorFlow: v0.6.2 => v0.6.6
INFO: Building CUDAdrv
======================================================================[ ERROR: CUDAdrv ]======================================================================

LoadError: Could not find the CUDA driver library (specify the path to libcuda using the CUDA_DRIVER environment variable).
while loading /Users/nhdaly/.julia/v0.6/CUDAdrv/deps/build.jl, in expression starting on line 119

==============================================================================================================================================================

from reversediff.jl.

NHDaly avatar NHDaly commented on September 18, 2024

Also, for more context:

julia> Pkg.installed()["ReverseDiff"]
v"0.1.4"

julia> Pkg.installed()["ForwardDiff"]
v"0.4.2"

from reversediff.jl.

NHDaly avatar NHDaly commented on September 18, 2024

cool, glad to help! good luck!

from reversediff.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.