Skip to content

Commit

Permalink
move dependencies to reinforce-prelude
Browse files Browse the repository at this point in the history
  • Loading branch information
stites committed Sep 30, 2017
1 parent 343fa0b commit 5db65b9
Show file tree
Hide file tree
Showing 21 changed files with 139 additions and 108 deletions.
14 changes: 1 addition & 13 deletions reinforce-algorithms/package.yaml
Expand Up @@ -18,20 +18,8 @@ default-extensions:

dependencies:
- base
- bytestring
- containers
- dlist
- hashable
- microlens-platform
- monad-loops
- mtl
- mwc-random
- reinforce
- safe-exceptions
- statistics
- text
- unordered-containers
- vector
- reinforce-prelude

library:
source-dirs: src
Expand Down
28 changes: 2 additions & 26 deletions reinforce-algorithms/reinforce-algorithms.cabal
Expand Up @@ -15,20 +15,8 @@ library
ghc-options: -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
build-depends:
base
, bytestring
, containers
, dlist
, hashable
, microlens-platform
, monad-loops
, mtl
, mwc-random
, reinforce
, safe-exceptions
, statistics
, text
, unordered-containers
, vector
, reinforce-prelude
exposed-modules:
Reinforce.Agents
Reinforce.Agents.DoubleQTable
Expand All @@ -54,20 +42,8 @@ test-suite spec
ghc-options: -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
build-depends:
base
, bytestring
, containers
, dlist
, hashable
, microlens-platform
, monad-loops
, mtl
, mwc-random
, reinforce
, safe-exceptions
, statistics
, text
, unordered-containers
, vector
, reinforce-prelude
, reinforce-algorithms
, reinforce-environments
, hspec
Expand Down
5 changes: 1 addition & 4 deletions reinforce-environments-gym/package.yaml
Expand Up @@ -39,16 +39,13 @@ default-extensions:


dependencies:
- aeson # >= 1.0 && < 1.1
- base # >= 4.9 && < 4.10
- http-client
- mtl
- reinforce
- reinforce-environments
- reinforce-prelude
- gym-http-api
- servant-client
- text # >= 1.2 && < 1.3
- vector # >= 0.11 && < 0.12


library:
Expand Down
7 changes: 2 additions & 5 deletions reinforce-environments-gym/reinforce-environments-gym.cabal
Expand Up @@ -29,16 +29,13 @@ library
default-extensions: NoImplicitPrelude MultiParamTypeClasses OverloadedStrings LambdaCase TypeFamilies
ghc-options: -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
build-depends:
aeson
, base
base
, http-client
, mtl
, reinforce
, reinforce-environments
, reinforce-prelude
, gym-http-api
, servant-client
, text
, vector
exposed-modules:
Environments.Gym.ClassicControl.AcrobotV1
Environments.Gym.ClassicControl.CartPoleV0
Expand Down
Expand Up @@ -37,6 +37,8 @@ import qualified Environments.Gym.Internal as I

import Data.Aeson.Types
import OpenAI.Gym (GymEnv(AcrobotV1))
import Servant.Client (BaseUrl)
import Network.HTTP.Client (Manager)


-- | The Acrobot's State
Expand Down
Expand Up @@ -38,6 +38,8 @@ import Control.MonadEnv (MonadEnv(..), Reward)
import Environments.Gym.Internal (GymEnvironmentT)
import qualified Environments.Gym.Internal as I
import OpenAI.Gym (GymEnv(CartPoleV0))
import Servant.Client (BaseUrl)
import Network.HTTP.Client (Manager)


-- ========================================================================= --
Expand Down
Expand Up @@ -37,6 +37,8 @@ module Environments.Gym.ClassicControl.CartPoleV1
import Reinforce.Prelude hiding (State)
import Data.CartPole
import OpenAI.Gym (GymEnv(CartPoleV1))
import Servant.Client (BaseUrl)
import Network.HTTP.Client (Manager)
import Environments.Gym.ClassicControl.CartPoleV0 as Env hiding
( runEnvironment
, runEnvironmentT
Expand Down
Expand Up @@ -37,6 +37,8 @@ module Environments.Gym.ClassicControl.MountainCarContinuousV0

import Reinforce.Prelude hiding (State)
import OpenAI.Gym (GymEnv(MountainCarContinuousV0))
import Servant.Client (BaseUrl)
import Network.HTTP.Client (Manager)
import Environments.Gym.ClassicControl.MountainCarV0 as Env hiding
( runEnvironment
, runDefaultEnvironment
Expand Down
Expand Up @@ -45,7 +45,8 @@ import qualified Environments.Gym.Internal as I

import Data.Aeson.Types
import OpenAI.Gym (GymEnv(MountainCarV0))

import Servant.Client (BaseUrl)
import Network.HTTP.Client (Manager)

-- | State of a car stuck between two hills
data State = State
Expand Down
Expand Up @@ -35,6 +35,8 @@ import qualified Environments.Gym.Internal as I

import Data.Aeson.Types
import OpenAI.Gym (GymEnv(PendulumV0))
import Servant.Client as X (BaseUrl)
import Network.HTTP.Client as X (Manager)


-- | State of a PendulumV0 environment
Expand Down
Expand Up @@ -41,6 +41,8 @@ import qualified Data.Vector as V
import Data.Aeson
import Data.Aeson.Types
import OpenAI.Gym (GymEnv(FrozenLakeV0))
import Servant.Client as X (BaseUrl)
import Network.HTTP.Client as X (Manager)


-- | The current position of the agent on the frozen lake
Expand Down
10 changes: 2 additions & 8 deletions reinforce-environments/package.yaml
Expand Up @@ -16,7 +16,7 @@ description: See <https://github.com/Sentenai/reinforce README.md>.
<https://github.com/openai/gym-http-api/ gym-http-api>, as well as
haskell-native environments which provide a substantial speed-up to the
http-server interface.

This is an environment-first library, with basic reinforcment
learning algorithms being developed on branches in subpackages (see
<https://github.com/Sentenai/reinforce#development-and-milestones
Expand All @@ -39,19 +39,13 @@ default-extensions:


dependencies:
- aeson # >= 1.0 && < 1.1
- base # >= 4.9 && < 4.10
- dlist #
- mwc-random # >= 0.13 && < 0.14
- reinforce
- safe-exceptions # >= 0.1 && < 0.2
- vector # >= 0.11 && < 0.12
- reinforce-prelude


library:
source-dirs: src
dependencies:
- gym-http-api
reexported-modules:
- Control.MonadEnv, Reinforce.Spaces.Action, Data.Logger, Data.Event, Reinforce.Spaces, Reinforce.Spaces.State

Expand Down
9 changes: 2 additions & 7 deletions reinforce-environments/reinforce-environments.cabal
Expand Up @@ -29,14 +29,9 @@ library
default-extensions: NoImplicitPrelude MultiParamTypeClasses OverloadedStrings LambdaCase TypeFamilies
ghc-options: -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
build-depends:
aeson
, base
, dlist
, mwc-random
base
, reinforce
, safe-exceptions
, vector
, gym-http-api
, reinforce-prelude
exposed-modules:
Data.CartPole
Data.Gym
Expand Down
1 change: 1 addition & 0 deletions reinforce-prelude/LICENSE
57 changes: 57 additions & 0 deletions reinforce-prelude/package.yaml
@@ -0,0 +1,57 @@
name: reinforce-prelude
version: 0.0.0.1
synopsis: Reinforcement learning in Haskell
category: Reinforcement learning, machine learning, artificial intelligence
author: Sam Stites, Sentenai Inc.
maintainer: sam@sentenai.com
github: Sentenai/reinforce/reinforce-prelude
license: BSD3
copyright: 2017 Sentenai, Inc.
ghc-options: -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
# -Wmissing-import-lists <-- due to NoImplicitPrelude.

description: See <https://github.com/Sentenai/reinforce README.md>.
@reinforce@ is a library which exports an OpenAI-gym-like
typeclass, @MonadEnv@, with both an interface to the
<https://github.com/openai/gym-http-api/ gym-http-api>, as well as
haskell-native environments which provide a substantial speed-up to the
http-server interface.

This is an environment-first library, with basic reinforcment
learning algorithms being developed on branches in subpackages (see
<https://github.com/Sentenai/reinforce#development-and-milestones
Development and Milestones>). @reinforce@ is currently an "alpha"
release since it still needs some work defining some formal structures
around what state-spaces and action-spaces should look like,
however haskell's typesystem is expressive enough that this seems to be
more of a "nice-to-have."

It's in active development and has some beginner-friendly contributions -
from porting new gym environments to implementing new algorithms.


default-extensions:
- NoImplicitPrelude

library:
source-dirs: src
dependencies:
- aeson # >= 1.0 && < 1.1
- base # >= 4.9 && < 4.10
- dlist # >= 0.8 && < 0.9
- hashable # >= 1.2 && < 1.3
- http-client # >= 0.4 && < 0.6
- mtl # >= 2.2 && < 2.3
- microlens-platform
- mwc-random # >= 0.13 && < 0.14
- primitive # >= 0.6 && < 0.7
- safe-exceptions # >= 0.1 && < 0.2
- statistics # >= 0.13 && < 0.14
- text # >= 1.2 && < 1.3
- unordered-containers
- vector # >= 0.11 && < 0.12

reexported-modules:
- Control.Monad.Primitive, Data.Text, Data.Vector, Statistics.Distribution, System.Random.MWC, Data.HashMap.Strict, Control.Exception.Safe, Data.Aeson, Data.Aeson.Types, Data.DList, Control.Monad.Except


53 changes: 53 additions & 0 deletions reinforce-prelude/reinforce-prelude.cabal
@@ -0,0 +1,53 @@
-- This file has been generated from package.yaml by hpack version 0.18.1.
--
-- see: https://github.com/sol/hpack

name: reinforce-prelude
version: 0.0.0.1
synopsis: Reinforcement learning in Haskell
description: See <https://github.com/Sentenai/reinforce README.md>. @reinforce@ is a library which exports an OpenAI-gym-like typeclass, @MonadEnv@, with both an interface to the <https://github.com/openai/gym-http-api/ gym-http-api>, as well as haskell-native environments which provide a substantial speed-up to the http-server interface.
This is an environment-first library, with basic reinforcment learning algorithms being developed on branches in subpackages (see <https://github.com/Sentenai/reinforce#development-and-milestones Development and Milestones>). @reinforce@ is currently an "alpha" release since it still needs some work defining some formal structures around what state-spaces and action-spaces should look like, however haskell's typesystem is expressive enough that this seems to be more of a "nice-to-have."
It's in active development and has some beginner-friendly contributions - from porting new gym environments to implementing new algorithms.
category: Reinforcement learning, machine learning, artificial intelligence
homepage: https://github.com/Sentenai/reinforce#readme
bug-reports: https://github.com/Sentenai/reinforce/issues
author: Sam Stites, Sentenai Inc.
maintainer: sam@sentenai.com
copyright: 2017 Sentenai, Inc.
license: BSD3
license-file: LICENSE
build-type: Simple
cabal-version: >= 1.21

source-repository head
type: git
location: https://github.com/Sentenai/reinforce
subdir: reinforce-prelude

library
hs-source-dirs:
src
default-extensions: NoImplicitPrelude
ghc-options: -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
build-depends:
aeson
, base
, dlist
, hashable
, http-client
, mtl
, microlens-platform
, mwc-random
, primitive
, safe-exceptions
, statistics
, text
, unordered-containers
, vector
exposed-modules:
Reinforce.Prelude
other-modules:
Paths_reinforce_prelude
reexported-modules:
Control.Monad.Primitive, Data.Text, Data.Vector, Statistics.Distribution, System.Random.MWC, Data.HashMap.Strict, Control.Exception.Safe, Data.Aeson, Data.Aeson.Types, Data.DList, Control.Monad.Except
default-language: Haskell2010
Expand Up @@ -49,11 +49,6 @@ import Lens.Micro.Platform as X
import Statistics.Distribution.Normal as X (normalDistr, NormalDistribution)
import System.Random.MWC as X (GenIO, Variate)

-- ========================================================================= --
-- Gym-required types:
import Servant.Client as X (BaseUrl(..), ServantError(..))
import Network.HTTP.Client as X (Manager)

-- ========================================================================= --

import qualified Prelude as P (head)
Expand Down
16 changes: 1 addition & 15 deletions reinforce/package.yaml
Expand Up @@ -41,21 +41,7 @@ default-extensions:
library:
source-dirs: src
dependencies:
- aeson # >= 1.0 && < 1.1
- base # >= 4.9 && < 4.10
- dlist # >= 0.8 && < 0.9
- hashable # >= 1.2 && < 1.3
- http-client # >= 0.4 && < 0.6
- mtl # >= 2.2 && < 2.3
- microlens-platform
- mwc-random # >= 0.13 && < 0.14
- primitive # >= 0.6 && < 0.7
- safe-exceptions # >= 0.1 && < 0.2
- servant-client # >= 0.10 && < 0.11
- servant-client # >= 0.9 && < 0.10
- statistics # >= 0.13 && < 0.14
- text # >= 1.2 && < 1.3
- unordered-containers
- vector # >= 0.11 && < 0.12
- reinforce-prelude


19 changes: 2 additions & 17 deletions reinforce/reinforce.cabal
Expand Up @@ -30,29 +30,14 @@ library
default-extensions: NoImplicitPrelude MultiParamTypeClasses OverloadedStrings LambdaCase TypeFamilies
ghc-options: -Wall -Wincomplete-uni-patterns -Wincomplete-record-updates
build-depends:
aeson
, base
, dlist
, hashable
, http-client
, mtl
, microlens-platform
, mwc-random
, primitive
, safe-exceptions
, servant-client
, servant-client
, statistics
, text
, unordered-containers
, vector
base
, reinforce-prelude
exposed-modules:
Control.MonadEnv
Control.MonadMWCRandom
Data.Event
Data.Logger
Reinforce.Gym
Reinforce.Prelude
Reinforce.Spaces
Reinforce.Spaces.Action
Reinforce.Spaces.State
Expand Down

0 comments on commit 5db65b9

Please sign in to comment.