class Chainer::Functions::Noise::DropoutGrad

Computes the gradient of the Dropout function.

Public Class Methods

new(mask) click to toggle source
# File lib/chainer/functions/noise/dropout.rb, line 45
def initialize(mask)
  @mask = mask
end

Public Instance Methods

backward(indexes, gy) click to toggle source
# File lib/chainer/functions/noise/dropout.rb, line 54
def backward(indexes, gy)
  DropoutGrad.new(@mask).apply(gy)
end
forward(inputs) click to toggle source
# File lib/chainer/functions/noise/dropout.rb, line 49
def forward(inputs)
  y = inputs.first * @mask
  [y]
end