aboutsummaryrefslogblamecommitdiff
path: root/layer/sigmoid.lua
blob: 41a6ef7861193069be5cdcc8158b926457e8ab15 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11






                                                                  



                                                   
                                              
                               


                                                                        
                                                     
   
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[0]:sigmoid(input[0])
end

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