These functions are taken from https://wiki.haskell.org/Edit_distance
, but cleaned up so they're copy-paste-able.
After searching unsuccessfully for how to do this, I discovered that there's a Binary instance internal to hmatrix. The following code depends on hmatrix
, binary
, and bytestring
.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Numeric.AD.Newton | |
main = do | |
let n = 500 | |
putStrLn $ "gradientDescent after " ++ show n ++ " iterations" | |
print (gradDesc !! n) | |
putStrLn $ "analytic form" |
I hereby claim:
- I am mhuesch on github.
- I am mhueschen (https://keybase.io/mhueschen) on keybase.
- I have a public key ASBlKieWm12UIb1Piiq-yNGoEqcuUwaBxkDhDrLLzsxFCwo
To claim this, I am signing this object: