-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Pure Haskell implementation of the Levenberg-Marquardt algorithm -- -- The Levenberg-Marquardt algorithm is a minimization algorithm for -- functions expressed as a sum of squared errors -- -- This can be used for curve-fitting, multidimensional function -- optimization, or neural networks training -- -- Go to https://github.com/ktklam9/HaskellLM for example usage -- (in tests) @package HaskellLM @version 0.1.0 -- | The Levenberg-Marquardt algorithm is a minimization algorithm for -- functions expressed as a sum of squared errors -- -- This can be used for curve-fitting, multidimensional function -- optimization, or neural networks training module Math.LevenbergMarquardt -- | Type that represents the function that can calculate the residues type Function = Vector Double -> Vector Double -- | Type that represents the function that can calculate the jacobian -- matrix of the residue with respect to each parameter type Jacobian = Vector Double -> Matrix Double -- | Evolves the parameter x for f(x) = sum-square(e(x)) so that f(x) will -- be minimized, where: -- -- f = real-valued error function, e(x) = {e1(x),e2(x),..,eN(x)}, where -- e1(x) = the residue at the vector x -- -- NOTE: eN(x) is usually represented as (sample - hypothesis(x)) -- -- e.g.: In training neural networks, hypothesis(x) would be the -- network's output for a training set, and sample would be the expected -- output for that training set -- -- NOTE: The dampening constant(lambda) should be set to 0.01 and the -- dampening update value (beta) should be set to be 10 lmMinimize :: Function -> Jacobian -> Vector Double -> Double -> Double -> Double -> Int -> (Vector Double, Matrix Double)