Skip to content

Commit

Permalink
updated hmatrix-morpheus example app
Browse files Browse the repository at this point in the history
  • Loading branch information
aligusnet committed Aug 27, 2017
1 parent 1b94374 commit eb62793
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 13 deletions.
9 changes: 0 additions & 9 deletions hmatrix-morpheus.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,6 @@ benchmark hmatrix-morpheus-bench
if os(OSX)
extra-lib-dirs: /usr/lib

executable hmatrix-morpheus-example
hs-source-dirs: hmatrix-morpheus/examples
main-is: Main.hs
build-depends: base
, hmatrix-morpheus
, hmatrix >= 0.17.0.1
ghc-options: -threaded -rtsopts -with-rtsopts=-N
default-language: Haskell2010

source-repository head
type: git
location: https://github.com/alexander-ignatyev/morpheus
14 changes: 12 additions & 2 deletions hmatrix-morpheus/examples/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ a = matrix 5 [

main :: IO ()
main = do
putStrLn "Numeric.Morpheus.MatrixReduce functions: "
putStrLn "\nNumeric.Morpheus.MatrixReduce functions: "

putStr "sum of elements of rows: "
print $ rowSum a
Expand All @@ -29,7 +29,7 @@ main = do
print $ snd $ columnMaxIndex a


putStrLn "Numeric.Morpheus.Activation functions: "
putStrLn "\n\nNumeric.Morpheus.Activation functions: "

putStrLn "\nSigmoid:"
disp 3 (sigmoid a)
Expand All @@ -39,3 +39,13 @@ main = do

putStrLn "ReLu gradient:"
disp 3 (reluGradient a)


putStrLn "\n\nNumeric.Morpheus.Statistics functions: "

putStrLn "\nColumn Means:"
let colmeans = columnMean a
print colmeans

putStrLn "Column Standard Deviations: "
print (columnStddev_m colmeans a)
2 changes: 2 additions & 0 deletions hmatrix-morpheus/examples/Setup.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import Distribution.Simple
main = defaultMain
25 changes: 25 additions & 0 deletions hmatrix-morpheus/examples/hmatrix-morpheus-example.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: hmatrix-morpheus-example
version: 0.1.0.0
synopsis: hmatrix-morpheus examples
homepage: https://github.com/Alexander-Ignatyev/morpheus/tree/master/hmatrix-morpheus/examples
license: BSD3
author: Alexander Ignatyev
maintainer: ignatyev.alexander@gmail.com
copyright: Alexander Ignatyev
category: math
build-type: Simple
cabal-version: >=1.10


executable hmatrix-morpheus-example
hs-source-dirs: .
main-is: Main.hs
build-depends: base
, hmatrix-morpheus
, hmatrix >= 0.17.0.1
ghc-options: -threaded -rtsopts -with-rtsopts=-N
default-language: Haskell2010

source-repository head
type: git
location: https://github.com/alexander-ignatyev/morpheus
8 changes: 8 additions & 0 deletions hmatrix-morpheus/examples/stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resolver: lts-8.20
packages:
- '.'
- '../..'
extra-deps: []
flags: {}
extra-package-dbs: []
extra-lib-dirs: [/usr/lib]
16 changes: 14 additions & 2 deletions hmatrix-morpheus/src/Numeric/Morpheus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ a = matrix 5 [
main :: IO ()
main = do
putStrLn "Numeric.Morpheus.MatrixReduce functions: "
putStrLn "\nNumeric.Morpheus.MatrixReduce functions: "
putStr "sum of elements of rows: "
print $ rowSum a
Expand All @@ -58,7 +58,7 @@ main = do
print $ snd $ columnMaxIndex a
putStrLn "Numeric.Morpheus.Activation functions: "
putStrLn "\n\nNumeric.Morpheus.Activation functions: "
putStrLn "\nSigmoid:"
disp 3 (sigmoid a)
Expand All @@ -68,16 +68,28 @@ main = do
putStrLn "ReLu gradient:"
disp 3 (reluGradient a)
putStrLn "\n\nNumeric.Morpheus.Statistics functions: "
putStrLn "\nColumn Means:"
let colmeans = columnMean a
print colmeans
putStrLn "Column Standard Deviations: "
print (columnStddev_m colmeans a)
@
-}

module Numeric.Morpheus
(
module Numeric.Morpheus.Activation
, module Numeric.Morpheus.MatrixReduce
, module Numeric.Morpheus.Statistics
)

where

import Numeric.Morpheus.Activation
import Numeric.Morpheus.MatrixReduce
import Numeric.Morpheus.Statistics

0 comments on commit eb62793

Please sign in to comment.