Skip to content

Instantly share code, notes, and snippets.

@mhuesch
mhuesch / edit_distance_haskell.md
Last active December 17, 2017 15:08
Haskell edit distance

These functions are taken from https://wiki.haskell.org/Edit_distance, but cleaned up so they're copy-paste-able.

@mhuesch
mhuesch / hmatrix_binary_explanation.md
Last active October 1, 2017 22:29
Serialize/deserialize hmatrix matrices to/from a file.

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.

@mhuesch
mhuesch / linear_regression_ad_and_analytic.hs
Created August 6, 2017 13:45
Motivated by Andrew Ng's Machine Learning Coursera course, I used AD to minimize the cost function and compared it to an analytic form
module Main where
import Numeric.AD.Newton
main = do
let n = 500
putStrLn $ "gradientDescent after " ++ show n ++ " iterations"
print (gradDesc !! n)
putStrLn $ "analytic form"

Keybase proof

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: