aboutsummaryrefslogtreecommitdiff
path: root/layer/sigmoid.lua
blob: d0a87c03ea0cc1353479d23f4d2fdf84d8ef53c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
local SigmoidLayer = nerv.class("nerv.SigmoidLayer", "nerv.Layer")

function SigmoidLayer:__init(id, global_conf)
    self.id = id
    self.gconf = global_conf
end

function SigmoidLayer:update(bp_err, input, output)
    -- no params, therefore do nothing
end

function SigmoidLayer:propagate(input, output)
    output:sigmoid(input)
end

function SigmoidLayer:back_propagate(next_bp_err, bp_err, input, output)
    next_bp_err:sigmoid_grad(bp_err, output)
end