Skip to content

Instantly share code, notes, and snippets.

View rikvdkleij's full-sized avatar

Rik rikvdkleij

View GitHub Profile
@rikvdkleij
rikvdkleij / Autoencoder.scala
Created February 15, 2018 09:44
Autoencoder with TF
import java.nio.file.Paths
import org.platanios.tensorflow.api._
import org.platanios.tensorflow.api.learn.Mode
import org.platanios.tensorflow.api.learn.layers.Layer
import org.platanios.tensorflow.api.ops.variables.RandomNormalInitializer
object Autoencoder2 {
case class IrisFlowerRecord(sepalLength: Float, sepalWidth: Float, petalLength: Float, petalWidth: Float, irisClass: String)
{-# LANGUAGE NoImplicitPrelude #-}
module Example where
import qualified Prelude as P
foo :: (P.Int, P.Int) -> P.Int
foo t = fst t where fst = P.fst
foo2 :: (P.Int, P.Int) -> P.Int
@rikvdkleij
rikvdkleij / Intero :loc-at
Created October 9, 2016 20:22
Intero issue #260
module LocAt where
import Prelude
bla :: [Integer]
bla = [x | x <- [1,10]]
{-
loc-at /home/rik/projects/haskellbook/src/LocAt.hs 6 8 6 9 x
/home/rik/projects/haskellbook/src/LocAt.hs:(6,12)-(6,13)
In Scala I can do:
Option<Response> responseForTransaction = Option(getResponseForTransaction(transaction))
responseForTransaction match {
case Some(r) => // do something with r
case None => ....
}
In Javaslang I tried this:
Option<Response> responseForTransaction = getResponseForTransaction(transaction);
Match(responseForTransaction).of(
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
module LocAt where
import Prelude
import Data.Aeson
import Data.Text
import GHC.Generics
data User =
@rikvdkleij
rikvdkleij / gist:6cec00ef1058ed00e935
Last active August 29, 2015 14:21
Purescript Monoid Action exercise
module Data.Action where
import Data.Array
import Data.Monoid
class (Monoid m) <= Action m a where
act :: m -> a -> a
instance numberSemigroup :: Semigroup Number where
(<>) x y = x * y