numeric-optimization-backprop: Wrapper of numeric-optimization package for using with backprop package

[ algorithms, bsd3, library, math, optimisation, optimization ] [ Propose Tags ]

Modules

  • Numeric
    • Optimization
      • Numeric.Optimization.Backprop
        • Numeric.Optimization.Backprop.ToVector

Flags

Manual Flags

NameDescriptionDefault
build-examples

Build example programs

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1
Change log CHANGELOG.md
Dependencies backprop (>=0.2.6.3 && <0.3), base (>=4.12 && <5), containers (>=0.6.0.1 && <0.7), data-default-class (>=0.1.2.0 && <0.2), microlens (>=0.4.10 && <0.5), mono-traversable (>=1.0.15.1 && <1.1), mtl (>=2.2.2 && <2.4), numeric-optimization (>=0.1.0.0 && <0.2.0.0), numeric-optimization-backprop, primitive (>=0.6.4.0), reflection (>=2.1.5), vector (>=0.12.0.2 && <0.14) [details]
License BSD-3-Clause
Copyright Copyright (c) 2023 Masahiro Sakai
Author Masahiro Sakai
Maintainer masahiro.sakai@gmail.com
Category Math, Algorithms, Optimisation, Optimization
Home page https://github.com/msakai/nonlinear-optimization-ad#readme
Bug tracker https://github.com/msakai/nonlinear-optimization-ad/issues
Source repo head: git clone https://github.com/msakai/nonlinear-optimization-ad
Uploaded by MasahiroSakai at 2023-06-03T08:34:49Z
Distributions
Executables rosenbrock-backprop
Downloads 68 total (8 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2023-06-03 [all 2 reports]

Readme for numeric-optimization-backprop-0.1.0.1

[back to package description]

numeric-optimization-backprop

Hackage Hackage Deps License

Wrapper of numeric-optimization package for using with backprop package.

Example Usage

{-# LANGUAGE FlexibleContexts #-}
import Numeric.Optimization.Backprop
import Lens.Micro

main :: IO ()
main = do
  result <- minimize LBFGS def rosenbrock Nothing [] (-3,-4)
  print (resultSuccess result)  -- True
  print (resultSolution result)  -- [0.999999999009131,0.9999999981094296]
  print (resultValue result)  -- 1.8129771632403013e-18

-- https://en.wikipedia.org/wiki/Rosenbrock_function
rosenbrock :: Reifies s W => BVar s (Double, Double) -> BVar s Double
rosenbrock t = sq (1 - x) + 100 * sq (y - sq x)
  where
    x = t ^^. _1
    y = t ^^. _2

sq :: Floating a => a -> a
sq x = x ** 2