Merge pull request #750 from FluxML/dg/bound_tracker
Added NNlib/ Tracker version bounds
This commit is contained in:
commit
01ffa21939
|
@ -27,3 +27,8 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
|
|||
|
||||
[targets]
|
||||
test = ["Test"]
|
||||
|
||||
[compat]
|
||||
julia = "0.7, 1"
|
||||
NNlib = "0.5"
|
||||
Tracker = "0.1"
|
||||
|
|
|
@ -27,6 +27,12 @@ git-tree-sha1 = "055eb2690182ebc31087859c3dd8598371d3ef9e"
|
|||
uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
|
||||
version = "0.5.3"
|
||||
|
||||
[[CSTParser]]
|
||||
deps = ["LibGit2", "Test", "Tokenize"]
|
||||
git-tree-sha1 = "437c93bc191cd55957b3f8dee7794b6131997c56"
|
||||
uuid = "00ebfdb7-1f24-5e51-bd34-a7502290713f"
|
||||
version = "0.5.2"
|
||||
|
||||
[[CodecZlib]]
|
||||
deps = ["BinaryProvider", "Libdl", "Test", "TranscodingStreams"]
|
||||
git-tree-sha1 = "36bbf5374c661054d41410dc53ff752972583b9b"
|
||||
|
@ -53,9 +59,9 @@ version = "0.2.0"
|
|||
|
||||
[[Compat]]
|
||||
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
|
||||
git-tree-sha1 = "195a3ffcb8b0762684b6821de18f83a16455c6ea"
|
||||
git-tree-sha1 = "84aa74986c5b9b898b0d1acaf3258741ee64754f"
|
||||
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
|
||||
version = "2.0.0"
|
||||
version = "2.1.0"
|
||||
|
||||
[[DataStructures]]
|
||||
deps = ["InteractiveUtils", "OrderedCollections", "Random", "Serialization", "Test"]
|
||||
|
@ -89,9 +95,9 @@ uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
|
|||
|
||||
[[DocStringExtensions]]
|
||||
deps = ["LibGit2", "Markdown", "Pkg", "Test"]
|
||||
git-tree-sha1 = "1df01539a1c952cef21f2d2d1c092c2bcf0177d7"
|
||||
git-tree-sha1 = "4d30e889c9f106a51ffa4791a88ffd4765bf20c3"
|
||||
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
|
||||
version = "0.6.0"
|
||||
version = "0.7.0"
|
||||
|
||||
[[Documenter]]
|
||||
deps = ["Base64", "DocStringExtensions", "InteractiveUtils", "LibGit2", "Logging", "Markdown", "Pkg", "REPL", "Random", "Test", "Unicode"]
|
||||
|
@ -106,10 +112,10 @@ uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
|
|||
version = "0.5.3"
|
||||
|
||||
[[Flux]]
|
||||
deps = ["AbstractTrees", "Adapt", "CodecZlib", "Colors", "Juno", "LinearAlgebra", "MacroTools", "NNlib", "Pkg", "Printf", "Random", "Reexport", "Requires", "SHA", "Statistics", "StatsBase", "Test", "Tracker", "ZipFile"]
|
||||
deps = ["AbstractTrees", "Adapt", "CodecZlib", "Colors", "DelimitedFiles", "Juno", "LinearAlgebra", "MacroTools", "NNlib", "Pkg", "Printf", "Random", "Reexport", "Requires", "SHA", "Statistics", "StatsBase", "Tracker", "ZipFile"]
|
||||
path = ".."
|
||||
uuid = "587475ba-b771-5e3f-ad9e-33799f191a9c"
|
||||
version = "0.7.3+"
|
||||
version = "0.8.2+"
|
||||
|
||||
[[ForwardDiff]]
|
||||
deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "InteractiveUtils", "LinearAlgebra", "NaNMath", "Random", "SparseArrays", "SpecialFunctions", "StaticArrays", "Test"]
|
||||
|
@ -123,9 +129,9 @@ uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
|
|||
|
||||
[[Juno]]
|
||||
deps = ["Base64", "Logging", "Media", "Profile", "Test"]
|
||||
git-tree-sha1 = "ce6246e19061e36cbdce954caaae717498daeed8"
|
||||
git-tree-sha1 = "4e4a8d43aa7ecec66cadaf311fbd1e5c9d7b9175"
|
||||
uuid = "e5e0dc1b-0480-54bc-9374-aad01c23163d"
|
||||
version = "0.5.4"
|
||||
version = "0.7.0"
|
||||
|
||||
[[LibGit2]]
|
||||
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
|
||||
|
@ -141,10 +147,10 @@ uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
|
|||
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
|
||||
|
||||
[[MacroTools]]
|
||||
deps = ["Compat"]
|
||||
git-tree-sha1 = "3fd1a3022952128935b449c33552eb65895380c1"
|
||||
deps = ["CSTParser", "Compat", "DataStructures", "Test"]
|
||||
git-tree-sha1 = "daecd9e452f38297c686eba90dba2a6d5da52162"
|
||||
uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
|
||||
version = "0.4.5"
|
||||
version = "0.5.0"
|
||||
|
||||
[[Markdown]]
|
||||
deps = ["Base64"]
|
||||
|
@ -167,9 +173,9 @@ uuid = "a63ad114-7e13-5084-954f-fe012c677804"
|
|||
|
||||
[[NNlib]]
|
||||
deps = ["Libdl", "LinearAlgebra", "MacroTools", "Requires", "Test"]
|
||||
git-tree-sha1 = "51330bb45927379007e089997bf548fbe232589d"
|
||||
git-tree-sha1 = "9ac5cd21484189339b27840818c4882d1b6df7fd"
|
||||
uuid = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
|
||||
version = "0.4.3"
|
||||
version = "0.5.0"
|
||||
|
||||
[[NaNMath]]
|
||||
deps = ["Compat"]
|
||||
|
@ -179,9 +185,9 @@ version = "0.3.2"
|
|||
|
||||
[[OrderedCollections]]
|
||||
deps = ["Random", "Serialization", "Test"]
|
||||
git-tree-sha1 = "85619a3f3e17bb4761fe1b1fd47f0e979f964d5b"
|
||||
git-tree-sha1 = "c4c13474d23c60d20a67b217f1d7f22a40edf8f1"
|
||||
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
|
||||
version = "1.0.2"
|
||||
version = "1.1.0"
|
||||
|
||||
[[Pkg]]
|
||||
deps = ["Dates", "LibGit2", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
|
||||
|
@ -255,15 +261,21 @@ deps = ["LinearAlgebra", "SparseArrays"]
|
|||
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
|
||||
|
||||
[[StatsBase]]
|
||||
deps = ["DataStructures", "DelimitedFiles", "LinearAlgebra", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "Test"]
|
||||
git-tree-sha1 = "435707791dc85a67d98d671c1c3fcf1b20b00f94"
|
||||
deps = ["DataStructures", "LinearAlgebra", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics"]
|
||||
git-tree-sha1 = "8a0f4b09c7426478ab677245ab2b0b68552143c7"
|
||||
uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
|
||||
version = "0.29.0"
|
||||
version = "0.30.0"
|
||||
|
||||
[[Test]]
|
||||
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
|
||||
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
|
||||
|
||||
[[Tokenize]]
|
||||
deps = ["Printf", "Test"]
|
||||
git-tree-sha1 = "3e83f60b74911d3042d3550884ca2776386a02b8"
|
||||
uuid = "0796e94c-ce3b-5d07-9a54-7f471281c624"
|
||||
version = "0.5.3"
|
||||
|
||||
[[Tracker]]
|
||||
deps = ["Adapt", "DiffRules", "ForwardDiff", "LinearAlgebra", "MacroTools", "NNlib", "NaNMath", "Printf", "Random", "Requires", "SpecialFunctions", "Statistics", "Test"]
|
||||
git-tree-sha1 = "4eeea9f0ef9b8c7d1c5c5b1f8f68cb9b7f45d7df"
|
||||
|
@ -271,10 +283,10 @@ uuid = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
|
|||
version = "0.1.0"
|
||||
|
||||
[[TranscodingStreams]]
|
||||
deps = ["Pkg", "Random", "Test"]
|
||||
git-tree-sha1 = "90f845c65c50bc57d6ffc815dbab2a4003ccf75c"
|
||||
deps = ["Random", "Test"]
|
||||
git-tree-sha1 = "a25d8e5a28c3b1b06d3859f30757d43106791919"
|
||||
uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
|
||||
version = "0.9.1"
|
||||
version = "0.9.4"
|
||||
|
||||
[[URIParser]]
|
||||
deps = ["Test", "Unicode"]
|
||||
|
@ -291,6 +303,6 @@ uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
|
|||
|
||||
[[ZipFile]]
|
||||
deps = ["BinaryProvider", "Libdl", "Printf", "Test"]
|
||||
git-tree-sha1 = "4000c633efe994b2e10b31b6d91382c4b7412dac"
|
||||
git-tree-sha1 = "5f6f663890dfb9bad6af75a86a43f67904e5050e"
|
||||
uuid = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
|
|
|
@ -47,10 +47,10 @@ julia> f(x) = W * x + b;
|
|||
julia> grads = Tracker.gradient(() -> f(4), params(W, b));
|
||||
|
||||
julia> grads[W]
|
||||
4.0
|
||||
4.0 (tracked)
|
||||
|
||||
julia> grads[b]
|
||||
1.0
|
||||
1.0 (tracked)
|
||||
```
|
||||
|
||||
There are a few things to notice here. Firstly, `W` and `b` now show up as *tracked*. Tracked things behave like normal numbers or arrays, but keep records of everything you do with them, allowing Flux to calculate their gradients. `gradient` takes a zero-argument function; no arguments are necessary because the `params` tell it what to differentiate.
|
||||
|
|
Loading…
Reference in New Issue