module Mopti

Mopti is a multivariate optimization library in Ruby.

Constants

VERSION

The version of Mopti you are using.

Public Instance Methods

minimize(algorithm:, **args) click to toggle source

Perform minization of the objective function.

@param algorithm [String] Type of optimizer.

- 'SCG': ScaledConjugateGradient
- 'Nelder-Mead': NelderMead

@return [Hash] Result of optimization.

# File lib/mopti.rb, line 19
def minimize(algorithm:, **args)
  optimizer = case algorithm
              when 'SCG'
                ScaledConjugateGradient.new(**args)
              when 'Nelder-Mead'
                NelderMead.new(**args)
              else
                raise ArgumentError, 'A non-existent algorithm is specified'
              end
  res = nil
  optimizer.each { |params| res = params }
  res
end