GithubHelp home page GithubHelp logo

Gaussian distribution? about hlearn HOT 3 CLOSED

gliptak avatar gliptak commented on September 21, 2024
Gaussian distribution?

from hlearn.

Comments (3)

mikeizbicki avatar mikeizbicki commented on September 21, 2024

The Gaussian distribution has been renamed to the Normal distribution. Use that and you should be good. I thought I removed Gaussian.lhs from the repo, but apparently not :)

from hlearn.

gliptak avatar gliptak commented on September 21, 2024

Thanks. From http://izbicki.me/blog/gausian-distributions-are-monoids

,bench "HLearn-Gaussian" $
 whnf (train :: VU.Vector Double -> Normal Double Double)
 (VU.enumFromN (0 ::Double) size)

gives compile error:

hlearn1.hs:46:12:
No instance for (Data.Foldable.Foldable VU.Vector)
  arising from a use of `train'
Possible fix:
  add an instance declaration for (Data.Foldable.Foldable VU.Vector)
In the first argument of `whnf', namely
  `(train :: VU.Vector Double -> Normal Double Double)'
In the second argument of `($)', namely
  `whnf
     (train :: VU.Vector Double -> Normal Double Double)
     (VU.enumFromN (0 :: Double) size)'
In the expression:
  bench "HLearn-Gaussian"
  $ whnf
      (train :: VU.Vector Double -> Normal Double Double)
      (VU.enumFromN (0 :: Double) size)

which can be corrected by

import qualified Data.Vector as V
,bench "HLearn-Gaussian" $
 whnf (train :: V.Vector Double -> Normal Double Double)
 (V.enumFromN (0 ::Double) size)

but now the benchmarks are no longer comparable ...

Could you suggest a different way to correct?

from hlearn.

mikeizbicki avatar mikeizbicki commented on September 21, 2024

The interface has been updated to include a function called trainck. (This simplifies the type signature for the train function considerably, and in practice I've found that the performance benefit of unboxed vectors isn't super important.) This function uses the version of Foldable found in the ConstraintKinds package, also on gihub and hackage. This package uses the ConstraintKinds extension to allow us to make Unboxed Vectors instances of Foldable.

from hlearn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.