Skip to content

Commit 1f68819

Browse files
committed
Undo breaking changes
1 parent c2c6ab7 commit 1f68819

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/layers/basic.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,13 @@ julia> Flux.params(d1) # no trainable bias
138138
Params([[1.0 1.0 … 1.0 1.0; 1.0 1.0 … 1.0 1.0]])
139139
```
140140
"""
141-
struct Dense{M<:AbstractMatrix, B, F}
141+
struct Dense{F, M<:AbstractMatrix, B}
142142
weight::M
143143
bias::B
144144
σ::F
145145
function Dense(W::M, bias = true, σ::F = identity) where {M<:AbstractMatrix, F}
146146
b = create_bias(W, bias, size(W,1))
147-
new{M, typeof(b), F}(W, b, σ)
147+
new{F,M,typeof(b)}(W, b, σ)
148148
end
149149
end
150150

@@ -156,9 +156,8 @@ end
156156
@functor Dense
157157

158158
function (a::Dense)(x::AbstractVecOrMat)
159-
W, b = a.weight, a.bias
160159
σ = NNlib.fast_act(a.σ, x) # replaces tanh => tanh_fast, etc
161-
return σ.(W * x .+ b)
160+
return σ.(a.weight * x .+ a.bias)
162161
end
163162

164163
(a::Dense)(x::AbstractArray) =

0 commit comments

Comments
 (0)