use nnlib for activations
This commit is contained in:
parent
3e0f45046c
commit
ef681f16ea
1
REQUIRE
1
REQUIRE
@ -2,3 +2,4 @@ julia 0.6.0
|
|||||||
DataFlow 0.2.1 0.3-
|
DataFlow 0.2.1 0.3-
|
||||||
Juno
|
Juno
|
||||||
MacroTools 0.3.3
|
MacroTools 0.3.3
|
||||||
|
NNlib
|
||||||
|
@ -5,10 +5,13 @@ module Flux
|
|||||||
using Juno
|
using Juno
|
||||||
using Lazy: @forward
|
using Lazy: @forward
|
||||||
|
|
||||||
export Chain, Linear, σ, softmax
|
export Chain, Linear
|
||||||
|
|
||||||
# Zero Flux Given
|
# Zero Flux Given
|
||||||
|
|
||||||
|
using NNlib
|
||||||
|
export σ, relu, softmax
|
||||||
|
|
||||||
include("Tracker/Tracker.jl")
|
include("Tracker/Tracker.jl")
|
||||||
using .Tracker
|
using .Tracker
|
||||||
export track, back!
|
export track, back!
|
||||||
|
@ -1,11 +1,3 @@
|
|||||||
# Activation Functions
|
|
||||||
|
|
||||||
σ(x) = 1 / (1 + exp(-x))
|
|
||||||
|
|
||||||
relu(x) = max(0, x)
|
|
||||||
|
|
||||||
softmax(xs) = exp.(xs) ./ sum(exp.(xs), 2)
|
|
||||||
|
|
||||||
# Cost functions
|
# Cost functions
|
||||||
|
|
||||||
mse(ŷ, y) = sumabs2(ŷ .- y)/2
|
mse(ŷ, y) = sumabs2(ŷ .- y)/2
|
||||||
|
Loading…
Reference in New Issue
Block a user