Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jacobian not implemented in v0.6.3 ? #910

Closed
stash-196 opened this issue Feb 24, 2021 · 6 comments
Closed

jacobian not implemented in v0.6.3 ? #910

stash-196 opened this issue Feb 24, 2021 · 6 comments

Comments

@stash-196
Copy link

To my understanding, a Jacobian function was added in #890, and this merge is included in v0.6.3.

However, the changes don't seem to exist on my Zygote v0.6.3.

(@v1.5) pkg> status Zygote
Status `~/.julia/environments/v1.5/Project.toml`
  [e88e6eb3] Zygote v0.6.3

julia> Zygote.jacobian
ERROR: UndefVarError: jacobian not defined
Stacktrace:
 [1] getproperty(::Module, ::Symbol) at ./Base.jl:26
 [2] top-level scope at REPL[8]:1

julia> Zygote.hessian
hessian (generic function with 1 method)
@stash-196
Copy link
Author

For reference...
~/.julia/packages/Zygote/KpME9/src/Zygote.jl:

module Zygote

using LinearAlgebra, Statistics
using LinearAlgebra: copytri!, AbstractTriangular

import ZygoteRules: @adjoint, @adjoint!, AContext, adjoint, _pullback, pullback,
  literal_getproperty, literal_getfield

using ChainRules: ChainRules, rrule, unthunk
using IRTools
using MacroTools, Requires
using MacroTools: @forward

import Distributed: pmap, CachingPool, workers
export Params, gradient, pullback, pushforward, @code_adjoint

include("tools/idset.jl")
include("tools/buffer.jl")
include("tools/builtins.jl")

include("forward/Forward.jl")
using .Forward

include("compiler/reverse.jl")
include("compiler/emit.jl")
include("compiler/chainrules.jl")
include("compiler/interface.jl")
include("compiler/show.jl")

include("lib/grad.jl")
include("lib/lib.jl")
include("lib/number.jl")
include("lib/base.jl")
include("lib/array.jl")
include("lib/buffer.jl")
include("lib/broadcast.jl")
include("lib/forward.jl")
include("lib/utils.jl")
include("lib/range.jl")
@init @require Distances="b4f34e82-e78d-54a5-968a-f98e89d6e8f7" include("lib/distances.jl")
@init @require StatsFuns="4c63d2b9-4356-54db-8cca-17b64c39e42c" include("lib/statsfuns.jl")

# we need to define this late, so that the genfuncs see lib.jl
# Move using statements out of this file to help with sysimage building
using IRTools: varargs!, inlineable!, pis!, slots!
using IRTools.Inner: argnames!, update!
include("compiler/interface2.jl")

include("profiler/Profile.jl")

@init @require Tracker="9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" begin
  include("flux.jl")
end

@init @require Colors="5ae59095-9a9b-59fe-a467-6f913c188581" begin
  @nograd Colors.ColorTypes._parameter_upper_bound
end

using InteractiveUtils
precompile() = Requires.@include("precompile.jl")

# helps to work around 265-y issues
function refresh()
  Requires.@include("compiler/interface2.jl")
  precompile()
  return
end

macro profile(ex)
  @capture(ex, f_(x__)) || error("@profile f(args...)")
  quote
    _, back = _pullback($(esc(f)), $(esc.(x)...))
    Profile.juno(Profile.profile(back))
  end
end

end # module

beginning of ~/.julia/packages/Zygote/KpME9/Project.toml:

name = "Zygote"
uuid = "e88e6eb3-aa80-5325-afca-941959d7151f"
version = "0.6.3"

@darsnack
Copy link
Member

It doesn't look like it made it into the release: v0.6.3...master

@stash-196
Copy link
Author

stash-196 commented Feb 24, 2021

...but it's like the 4th commit in v0.6.3...master. ("new jacobian implementation, and tests", 93a4c5b)

Does that not count? Was it rejected afterward?

@darsnack
Copy link
Member

Those are commits that were added to master after 0.6.3 was released. The dates are a bit of misdirection, since they are the date the author committed to their PR branch, not the date that the commit was merged into master.

You can see the final merge commit landed on Feb 2 which was a day after 0.6.3 was released (I think).

@darsnack
Copy link
Member

darsnack commented Feb 24, 2021

The commit that merged jacobian

The commit that the release points to

If you look at the commit history, you'll see that the jacobian commit is right after the release commit. Close but no cigar I'm afraid.

If you are excited to try jacobian, you can always use the master branch:

julia>]add Zygote#master

@stash-196
Copy link
Author

stash-196 commented Feb 24, 2021

Oh, I see now... that makes sense.

Sorry for the trouble, and thanks.

I'll be looking forward to the next release then:)

Edit: Didn't cross my mind to directly add the master branch. I just did and it's amazing, thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants