diff --git a/LICENSE b/LICENSE index 53c1cf7..596fd59 100644 --- a/LICENSE +++ b/LICENSE @@ -1,35 +1,3 @@ -<<<<<<< HEAD -Copyright Author name here (c) 2016 - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - - * Neither the name of Author name here nor the names of other - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -======= GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -684,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - {project} Copyright (C) {year} {fullname} + Sibe Copyright (C) 2016 Mahdi Dibaiee This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. @@ -704,4 +672,3 @@ may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . ->>>>>>> ba301efb2909d359ae56cc0bce3710ccf10b139f diff --git a/app/Main b/app/Main index 367d6d7..a6b12eb 100755 Binary files a/app/Main and b/app/Main differ diff --git a/app/Main.hi b/app/Main.hi index 16ac671..db4ed59 100644 Binary files a/app/Main.hi and b/app/Main.hi differ diff --git a/app/Main.hs b/app/Main.hs index 1048322..fff805b 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -1,6 +1,6 @@ module Main where -import Lib +import Sibe import Numeric.LinearAlgebra import Data.List import Debug.Trace diff --git a/app/Main.o b/app/Main.o index b2fb99f..fbde522 100644 Binary files a/app/Main.o and b/app/Main.o differ diff --git a/examples/xor b/examples/xor index e2d784f..610d452 100755 Binary files a/examples/xor and b/examples/xor differ diff --git a/examples/xor.hs b/examples/xor.hs index dba674d..48bd810 100644 --- a/examples/xor.hs +++ b/examples/xor.hs @@ -1,5 +1,5 @@ module Main where - import Lib + import Sibe import Numeric.LinearAlgebra import Data.List import Debug.Trace @@ -21,12 +21,11 @@ module Main where updated_network = session inputs network labels learning_rate (iterations, epochs) results = map (`forward` updated_network) inputs - rounded = map (map round) $ map toList results - in sequence [putStrLn "", - putStrLn $ "inputs: " ++ show inputs, + rounded = map (map round . toList) results + in sequence [putStrLn $ "inputs: " ++ show inputs, putStrLn $ "labels: " ++ show labels, putStrLn $ "learning rate: " ++ show learning_rate, putStrLn $ "iterations/epochs: " ++ show (iterations, epochs), - putStrLn $ "...", + putStrLn "...", putStrLn $ "rounded result: " ++ show rounded, putStrLn $ "actual result: " ++ show results] diff --git a/sibe.cabal b/sibe.cabal index e0c0879..3be1a23 100644 --- a/sibe.cabal +++ b/sibe.cabal @@ -1,22 +1,24 @@ name: sibe version: 0.1.0.0 synopsis: Initial project template from stack -description: Please see README.md -homepage: https://github.com/githubuser/sibe#readme -license: BSD3 +description: Haskell Machine Learning +homepage: https://github.com/mdibaiee/sibe +license: GPL-3 license-file: LICENSE -author: Author name here -maintainer: example@example.com -copyright: 2016 Author name here -category: Web +author: Mahdi Dibaiee +maintainer: mdibaiee@aol.com +copyright: 2016 Mahdi Dibaiee +category: Web, Machine Learning, Data Science build-type: Simple -- extra-source-files: cabal-version: >=1.10 library hs-source-dirs: src - exposed-modules: Lib + exposed-modules: Sibe build-depends: base >= 4.7 && < 5 + , hmatrix + , random default-language: Haskell2010 executable sibe-exe @@ -25,6 +27,7 @@ executable sibe-exe ghc-options: -threaded -rtsopts -with-rtsopts=-N build-depends: base , sibe + , hmatrix default-language: Haskell2010 executable example-xor @@ -33,6 +36,7 @@ executable example-xor ghc-options: -threaded -rtsopts -with-rtsopts=-N build-depends: base , sibe + , hmatrix default-language: Haskell2010 test-suite sibe-test @@ -41,9 +45,10 @@ test-suite sibe-test main-is: Spec.hs build-depends: base , sibe + , hmatrix ghc-options: -threaded -rtsopts -with-rtsopts=-N default-language: Haskell2010 source-repository head type: git - location: https://github.com/githubuser/sibe + location: https://github.com/mdibaiee/sibe diff --git a/src/Lib.hs b/src/Sibe.hs similarity index 98% rename from src/Lib.hs rename to src/Sibe.hs index b0e06a1..c8d53a7 100644 --- a/src/Lib.hs +++ b/src/Sibe.hs @@ -3,7 +3,7 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} -module Lib +module Sibe (Network(..), Layer, Input, @@ -15,7 +15,6 @@ module Lib shuffle, ) where import Numeric.LinearAlgebra - import Control.Monad.Random import System.Random import Debug.Trace import Data.List (foldl', sortBy) diff --git a/stack.yaml b/stack.yaml index 6f398d0..305964d 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,5 +1,5 @@ # This file was automatically generated by 'stack init' -# +# # Some commonly used options have been documented as comments in this file. # For advanced use and comprehensive documentation of the format, please see: # http://docs.haskellstack.org/en/stable/yaml_configuration/ @@ -7,7 +7,7 @@ # Resolver to choose a 'specific' stackage snapshot or a compiler version. # A snapshot resolver dictates the compiler version and the set of packages # to be used for project dependencies. For example: -# +# # resolver: lts-3.5 # resolver: nightly-2015-09-21 # resolver: ghc-7.10.2 @@ -19,7 +19,7 @@ resolver: lts-6.7 # User packages to be built. # Various formats can be used as shown in the example below. -# +# # packages: # - some-directory # - https://example.com/foo/bar/baz-0.0.2.tar.gz @@ -31,7 +31,7 @@ resolver: lts-6.7 # subdirs: # - auto-update # - wai -# +# # A package marked 'extra-dep: true' will only be built if demanded by a # non-dependency (i.e. a user package), and its test suites and benchmarks # will not be run. This is useful for tweaking upstream packages. @@ -39,9 +39,9 @@ packages: - location: git: git@github.com:albertoruiz/hmatrix.git commit: 42a88fbcb6bd1d2c4dc18fae5e962bd34fb316a1 - subdirs: + subdirs: - packages/base -#- '.' +- '.' # Dependency packages to be pulled from upstream that are not in the resolver # (e.g., acme-missiles-0.3) @@ -55,18 +55,18 @@ extra-package-dbs: [] # Control whether we use the GHC we find on the path # system-ghc: true -# +# # Require a specific version of stack, using version ranges # require-stack-version: -any # Default # require-stack-version: ">=1.1" -# +# # Override the architecture used by stack, especially useful on Windows # arch: i386 # arch: x86_64 -# +# # Extra directories used by stack for building # extra-include-dirs: [/path/to/dir] # extra-lib-dirs: [/path/to/dir] -# +# # Allow a newer minor version of GHC than the snapshot specifies # compiler-check: newer-minor diff --git a/test/Spec.hs b/test/Spec.hs index cd4753f..54067d7 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -1,2 +1,8 @@ -main :: IO () -main = putStrLn "Test suite not yet implemented" +module Main where + import System.Exit (exitFailure) + + import Sibe + + main = do + putStrLn "Hey" + exitFailure