class CooCoo::ActivationFunctions::MinMax

Public Instance Methods

call(x) click to toggle source
# File lib/coo-coo/activation_functions.rb, line 245
def call(x)
  if x.respond_to?(:minmax_normalize)
    x.minmax_normalize
  else
    x
  end
end
derivative(x, y = nil) click to toggle source
# File lib/coo-coo/activation_functions.rb, line 253
def derivative(x, y = nil)
  min, max = x.minmax
  (y || x).class.new((y || x).size, 1.0 / (max - min))
end
prep_output_target(x) click to toggle source
# File lib/coo-coo/activation_functions.rb, line 258
def prep_output_target(x)
  x.minmax_normalize(true)
end