fix flatten/softmax batching behaviour
This commit is contained in:
parent
b54281bdea
commit
07c523a13d
@ -8,11 +8,9 @@ back!(::typeof(σ), Δ, x) = Δ .* σ(x).*(1.-σ(x))
|
|||||||
relu(x) = max(0, x)
|
relu(x) = max(0, x)
|
||||||
back!(::typeof(relu), Δ, x) = Δ .* (x .> 0)
|
back!(::typeof(relu), Δ, x) = Δ .* (x .> 0)
|
||||||
|
|
||||||
# TODO: correct behaviour with batches
|
softmax(xs) = exp.(xs) ./ sum(exp.(xs), 2)
|
||||||
softmax(xs) = exp.(xs) ./ sum(exp.(xs))
|
|
||||||
|
|
||||||
# TODO: correct behaviour with batches
|
flatten(xs) = reshape(xs, size(xs, 1), :)
|
||||||
flatten(xs) = reshape(xs, length(xs))
|
|
||||||
|
|
||||||
infer(::typeof(softmax), x) = x
|
infer(::typeof(softmax), x) = x
|
||||||
infer(::typeof(tanh), x) = x
|
infer(::typeof(tanh), x) = x
|
||||||
|
Loading…
Reference in New Issue
Block a user