Skip to content

Commit b64bd5a

Browse files
committed
resolve conflicts
2 parents 2d6bd11 + 30486f9 commit b64bd5a

28 files changed

+1016
-364
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ docs/build/
55
docs/site/
66
docs/flux.css
77
deps
8-
Manifest.toml

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ os:
44
- linux
55
# - osx
66
julia:
7-
- 0.7
87
- 1.0
98
- nightly
109
# uncomment the following lines to override the default test script
@@ -15,5 +14,5 @@ matrix:
1514
allow_failures:
1615
- julia: nightly
1716
after_success:
18-
- julia -e 'using Pkg; Pkg.add("Documenter"); Pkg.add("NNlib")'
17+
- julia -e 'using Pkg; ps=Pkg.PackageSpec(name="Documenter", version="0.19"); Pkg.add(ps); Pkg.pin(ps); Pkg.add("NNlib")'
1918
- julia -e 'using Pkg; cd(Pkg.dir("Flux")); include(joinpath("docs", "make.jl"))'

Manifest.toml

Lines changed: 270 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,270 @@
1+
[[AbstractTrees]]
2+
deps = ["Markdown", "Test"]
3+
git-tree-sha1 = "feb8b2c99359901e295443c9d0c7e711604acf39"
4+
uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
5+
version = "0.2.0"
6+
7+
[[Adapt]]
8+
deps = ["LinearAlgebra", "Test"]
9+
git-tree-sha1 = "a1245c11af6876245c32f82f2067bf67f7da8cee"
10+
uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
11+
version = "0.4.0"
12+
13+
[[Base64]]
14+
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
15+
16+
[[BinDeps]]
17+
deps = ["Compat", "Libdl", "SHA", "URIParser"]
18+
git-tree-sha1 = "12093ca6cdd0ee547c39b1870e0c9c3f154d9ca9"
19+
uuid = "9e28174c-4ba2-5203-b857-d8d62c4213ee"
20+
version = "0.8.10"
21+
22+
[[BinaryProvider]]
23+
deps = ["Libdl", "Pkg", "SHA", "Test"]
24+
git-tree-sha1 = "9930c1a6cd49d9fcd7218df6be417e6ae4f1468a"
25+
uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
26+
version = "0.5.2"
27+
28+
[[CodecZlib]]
29+
deps = ["BinaryProvider", "Libdl", "Pkg", "Test", "TranscodingStreams"]
30+
git-tree-sha1 = "83cb3d65c37ea1364c2d5bf7bcea41843ba645dc"
31+
uuid = "944b1d66-785c-5afd-91f1-9de20f533193"
32+
version = "0.5.0"
33+
34+
[[ColorTypes]]
35+
deps = ["FixedPointNumbers", "Random", "Test"]
36+
git-tree-sha1 = "f73b0e10f2a5756de7019818a41654686da06b09"
37+
uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
38+
version = "0.7.5"
39+
40+
[[Colors]]
41+
deps = ["ColorTypes", "FixedPointNumbers", "InteractiveUtils", "Pkg", "Printf", "Reexport", "Test"]
42+
git-tree-sha1 = "9f0a0210450acb91c730b730a994f8eef1d3d543"
43+
uuid = "5ae59095-9a9b-59fe-a467-6f913c188581"
44+
version = "0.9.5"
45+
46+
[[CommonSubexpressions]]
47+
deps = ["Test"]
48+
git-tree-sha1 = "efdaf19ab11c7889334ca247ff4c9f7c322817b0"
49+
uuid = "bbf7d656-a473-5ed7-a52c-81e309532950"
50+
version = "0.2.0"
51+
52+
[[Compat]]
53+
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
54+
git-tree-sha1 = "2d9e14d19bad3f9ad5cc5e4cffabc3cfa59de825"
55+
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
56+
version = "1.3.0"
57+
58+
[[DataStructures]]
59+
deps = ["InteractiveUtils", "OrderedCollections", "REPL", "Random", "Serialization", "Test"]
60+
git-tree-sha1 = "8fc6e166e24fda04b2b648d4260cdad241788c54"
61+
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
62+
version = "0.14.0"
63+
64+
[[Dates]]
65+
deps = ["Printf"]
66+
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
67+
68+
[[DelimitedFiles]]
69+
deps = ["Mmap"]
70+
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"
71+
72+
[[DiffResults]]
73+
deps = ["Compat", "StaticArrays"]
74+
git-tree-sha1 = "db8acf46717b13d6c48deb7a12007c7f85a70cf7"
75+
uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5"
76+
version = "0.0.3"
77+
78+
[[DiffRules]]
79+
deps = ["Random", "Test"]
80+
git-tree-sha1 = "c49ec69428ffea0c1d1bbdc63d1a70f5df5860ad"
81+
uuid = "b552c78f-8df3-52c6-915a-8e097449b14b"
82+
version = "0.0.7"
83+
84+
[[Distributed]]
85+
deps = ["LinearAlgebra", "Random", "Serialization", "Sockets"]
86+
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
87+
88+
[[FixedPointNumbers]]
89+
deps = ["Pkg", "Test"]
90+
git-tree-sha1 = "b8045033701c3b10bf2324d7203404be7aef88ba"
91+
uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
92+
version = "0.5.3"
93+
94+
[[ForwardDiff]]
95+
deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "InteractiveUtils", "LinearAlgebra", "NaNMath", "Pkg", "Random", "SparseArrays", "SpecialFunctions", "StaticArrays", "Test"]
96+
git-tree-sha1 = "d8f3e0f19d0d546aa92eb1cd67cd3e515768d9f7"
97+
uuid = "f6369f11-7733-5829-9624-2563aa707210"
98+
version = "0.10.0"
99+
100+
[[InteractiveUtils]]
101+
deps = ["LinearAlgebra", "Markdown"]
102+
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
103+
104+
[[Juno]]
105+
deps = ["Base64", "Logging", "Media", "Profile", "Test"]
106+
git-tree-sha1 = "3c29a199713e7ec62cfdc11f44d7760219d5f658"
107+
uuid = "e5e0dc1b-0480-54bc-9374-aad01c23163d"
108+
version = "0.5.3"
109+
110+
[[LibGit2]]
111+
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
112+
113+
[[Libdl]]
114+
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
115+
116+
[[LinearAlgebra]]
117+
deps = ["Libdl"]
118+
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
119+
120+
[[Logging]]
121+
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
122+
123+
[[MacroTools]]
124+
deps = ["Compat"]
125+
git-tree-sha1 = "c443e1c8d58a4e9f61b708ad0a88286c7042145b"
126+
uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
127+
version = "0.4.4"
128+
129+
[[Markdown]]
130+
deps = ["Base64"]
131+
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
132+
133+
[[Media]]
134+
deps = ["MacroTools", "Test"]
135+
git-tree-sha1 = "9f390271c9a43dcbe908a10b5b9632cf58cbab5b"
136+
uuid = "e89f7d12-3494-54d1-8411-f7d8b9ae1f27"
137+
version = "0.4.1"
138+
139+
[[Missings]]
140+
deps = ["Dates", "InteractiveUtils", "SparseArrays", "Test"]
141+
git-tree-sha1 = "adc26d2ee85a49c413464110d922cf21efc9d233"
142+
uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
143+
version = "0.3.1"
144+
145+
[[Mmap]]
146+
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
147+
148+
[[NNlib]]
149+
deps = ["Libdl", "LinearAlgebra", "MacroTools", "Requires", "Test"]
150+
git-tree-sha1 = "d7f65ad9734adea3c5a4c473bc65b365f8afbb2b"
151+
uuid = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
152+
version = "0.4.2"
153+
154+
[[NaNMath]]
155+
deps = ["Compat"]
156+
git-tree-sha1 = "ce3b85e484a5d4c71dd5316215069311135fa9f2"
157+
uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
158+
version = "0.3.2"
159+
160+
[[OrderedCollections]]
161+
deps = ["Pkg", "Random", "Serialization", "Test"]
162+
git-tree-sha1 = "85619a3f3e17bb4761fe1b1fd47f0e979f964d5b"
163+
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
164+
version = "1.0.2"
165+
166+
[[Pkg]]
167+
deps = ["Dates", "LibGit2", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
168+
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
169+
170+
[[Printf]]
171+
deps = ["Unicode"]
172+
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
173+
174+
[[Profile]]
175+
deps = ["Printf"]
176+
uuid = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79"
177+
178+
[[REPL]]
179+
deps = ["InteractiveUtils", "Markdown", "Sockets"]
180+
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
181+
182+
[[Random]]
183+
deps = ["Serialization"]
184+
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
185+
186+
[[Reexport]]
187+
deps = ["Pkg"]
188+
git-tree-sha1 = "7b1d07f411bc8ddb7977ec7f377b97b158514fe0"
189+
uuid = "189a3867-3050-52da-a836-e630ba90ab69"
190+
version = "0.2.0"
191+
192+
[[Requires]]
193+
deps = ["Test"]
194+
git-tree-sha1 = "f6fbf4ba64d295e146e49e021207993b6b48c7d1"
195+
uuid = "ae029012-a4dd-5104-9daa-d747884805df"
196+
version = "0.5.2"
197+
198+
[[SHA]]
199+
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
200+
201+
[[Serialization]]
202+
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
203+
204+
[[SharedArrays]]
205+
deps = ["Distributed", "Mmap", "Random", "Serialization"]
206+
uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"
207+
208+
[[Sockets]]
209+
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
210+
211+
[[SortingAlgorithms]]
212+
deps = ["DataStructures", "Random", "Test"]
213+
git-tree-sha1 = "03f5898c9959f8115e30bc7226ada7d0df554ddd"
214+
uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c"
215+
version = "0.3.1"
216+
217+
[[SparseArrays]]
218+
deps = ["LinearAlgebra", "Random"]
219+
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
220+
221+
[[SpecialFunctions]]
222+
deps = ["BinDeps", "BinaryProvider", "Libdl", "Test"]
223+
git-tree-sha1 = "c35c9c76008babf4d658060fc64aeb369a41e7bd"
224+
uuid = "276daf66-3868-5448-9aa4-cd146d93841b"
225+
version = "0.7.1"
226+
227+
[[StaticArrays]]
228+
deps = ["InteractiveUtils", "LinearAlgebra", "Pkg", "Random", "Statistics", "Test"]
229+
git-tree-sha1 = "ebc5c2a27d91d5ec611a9861168182e2168effd3"
230+
uuid = "90137ffa-7385-5640-81b9-e52037218182"
231+
version = "0.9.2"
232+
233+
[[Statistics]]
234+
deps = ["LinearAlgebra", "SparseArrays"]
235+
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
236+
237+
[[StatsBase]]
238+
deps = ["DataStructures", "LinearAlgebra", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "Test"]
239+
git-tree-sha1 = "723193a13e8078cec6dcd0b8fe245c8bfd81690e"
240+
uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
241+
version = "0.25.0"
242+
243+
[[Test]]
244+
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
245+
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
246+
247+
[[TranscodingStreams]]
248+
deps = ["DelimitedFiles", "Pkg", "Random", "Test"]
249+
git-tree-sha1 = "a34a2d588e2d2825602bf14a24216d5c8b0921ec"
250+
uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
251+
version = "0.8.1"
252+
253+
[[URIParser]]
254+
deps = ["Test", "Unicode"]
255+
git-tree-sha1 = "6ddf8244220dfda2f17539fa8c9de20d6c575b69"
256+
uuid = "30578b45-9adc-5946-b283-645ec420af67"
257+
version = "0.4.0"
258+
259+
[[UUIDs]]
260+
deps = ["Random"]
261+
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
262+
263+
[[Unicode]]
264+
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
265+
266+
[[ZipFile]]
267+
deps = ["Printf", "Test"]
268+
git-tree-sha1 = "c191e56c849b1784cacbf7cd5e52cc672f1ae2db"
269+
uuid = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"
270+
version = "0.7.0"

Project.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name = "Flux"
2+
uuid = "587475ba-b771-5e3f-ad9e-33799f191a9c"
3+
4+
[deps]
5+
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
6+
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
7+
CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193"
8+
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
9+
DiffRules = "b552c78f-8df3-52c6-915a-8e097449b14b"
10+
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
11+
Juno = "e5e0dc1b-0480-54bc-9374-aad01c23163d"
12+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
13+
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
14+
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
15+
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
16+
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
17+
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
18+
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
19+
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
20+
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
21+
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
22+
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
23+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
24+
ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
julia 0.7
1+
julia 1.0
22
Juno
33
MacroTools 0.3.3
44
NNlib

docs/src/internals/tracker.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,16 @@ minus(a, b) = a - b
100100
Firstly, we must tell the tracker system to stop when it sees a call to `minus`, and record it. We can do this using dispatch:
101101
102102
```julia
103-
using Flux.Tracker: TrackedReal, track, @grad
103+
using Flux.Tracker: TrackedArray, track, @grad
104104

105-
minus(a::TrackedArray, b::TrackedArray) = Tracker.track(minus, a, b)
105+
minus(a::TrackedArray, b::TrackedArray) = track(minus, a, b)
106106
```
107107
108108
`track` takes care of building a new `Tracked` object and recording the operation on the tape. We just need to provide a gradient definition.
109109
110110
```julia
111111
@grad function minus(a, b)
112-
return minus(data(a),data(b)), Δ -> (Δ, -Δ)
112+
return minus(data(a), data(b)), Δ -> (Δ, -Δ)
113113
end
114114
```
115115
@@ -121,6 +121,19 @@ Note that in the backpropagator we don't call `data(a)`; we *do* in fact want to
121121
@grad a * b = data(a)*data(b), Δ ->*b, a*Δ)
122122
```
123123
124+
We can then calculate the first derivative of `minus` as follows:
125+
126+
```julia
127+
a = param([1,2,3])
128+
b = param([3,2,1])
129+
130+
c = minus(a, b) # [-2.0 (tracked), 0.0 (tracked), 2.0 (tracked)]
131+
132+
Tracker.back!(c, 1)
133+
Tracker.grad(a) # [1.00, 1.00, 1.00]
134+
Tracker.grad(b) # [-1.00, -1.00, -1.00]
135+
```
136+
124137
For multi-argument functions with custom gradients, you likely want to catch not just `minus(::TrackedArray, ::TrackedArray)` but also `minus(::Array, TrackedArray)` and so on. To do so, just define those extra signatures as needed:
125138
126139
```julia

docs/src/models/layers.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ MaxPool
1010
MeanPool
1111
```
1212

13+
## Additional Convolution Layers
14+
15+
```@docs
16+
DepthwiseConv
17+
```
18+
1319
## Recurrent Layers
1420

1521
Much like the core layers above, but can be used to process sequence data (as well as other kinds of structured data).

src/Flux.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ module Flux
55
using MacroTools, Juno, Requires, Reexport, Statistics, Random
66
using MacroTools: @forward
77

8-
export Chain, Dense, RNN, LSTM, GRU, Conv, CrossCor, MaxPool, MeanPool,
9-
Dropout, LayerNorm, BatchNorm,
10-
params, mapleaves, cpu, gpu
8+
export Chain, Dense, RNN, LSTM, GRU, Conv, MaxPool, MeanPool,
9+
DepthwiseConv, Dropout, LayerNorm, BatchNorm,
10+
params, mapleaves, cpu, gpu, CrossCor
1111

1212
@reexport using NNlib
1313

@@ -19,8 +19,9 @@ export Tracker, TrackedArray, TrackedVector, TrackedMatrix, param
1919
include("optimise/Optimise.jl")
2020
using .Optimise
2121
using .Optimise: @epochs
22-
export SGD, ADAM, ADAMW, AdaMax, Momentum, Nesterov,
23-
RMSProp, ADAGrad, ADADelta, AMSGrad, NADAM
22+
export SGD, Descent, ADAM, Momentum, Nesterov, RMSProp,
23+
ADAGrad, AdaMax, ADADelta, AMSGrad, NADAM,
24+
ADAMW, InvDecay, ExpDecay, WeightDecay
2425

2526
include("utils.jl")
2627
include("onehot.jl")

0 commit comments

Comments
 (0)