Skip to content

Commit

Permalink
workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cnheider committed Mar 10, 2020
1 parent 9bac43b commit 60a2d79
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 40 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/on_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: On Push Any Documentation Check
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: cnheider/postdoc@master
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
import argparse

from neodroid.environments.unity_environment import SingleUnityEnvironment
from neodroid.environments.droid_environment import SingleUnityEnvironment
from neodroid.utilities import Displayable
from neodroidagent.agents.numpy_agents.numpy_agent import NumpyAgent
from neodroidagent.utilities.exploration.ucb1 import UCB1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(
optimiser_spec: GDKC = GDKC(constructor=torch.optim.Adam, lr=3e-4),
continuous_arch_spec: GDKC = GDKC(ActorCriticMLP),
discrete_arch_spec: GDKC = GDKC(CategoricalActorCriticMLP),
gradient_norm_clipping: ClipFeature = ClipFeature(True, -0.5, 0.5),
gradient_norm_clipping: ClipFeature = ClipFeature(True, 0, 0.5),
**kwargs,
) -> None:
"""
Expand Down Expand Up @@ -313,7 +313,7 @@ def _update(self, metric_writer: Writer = MockWriter()) -> float:
if early_stop_inner:
break

mean_loss = accum_loss.send()
mean_loss = next(accum_loss)

if metric_writer:
metric_writer.scalar("Inner Updates", i)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from cloudpickle import cloudpickle
from garage.experiment import to_local_command

from neodroid.environments.unity_environment import UnityEnvironment
from neodroid.environments.droid_environment import UnityEnvironment
from neodroidagent.agents import SACAgent
from neodroidagent.common import CategoricalMLP

Expand Down
2 changes: 1 addition & 1 deletion neodroidagent/common/session_factory/vertical/linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from neodroid.environments import Environment
from neodroid.environments.gym_environment import NeodroidGymEnvironment
from neodroid.environments.unity_environment import VectorUnityEnvironment
from neodroid.environments.droid_environment import VectorUnityEnvironment
from trolls import NormalisedActions, VectorWrap
from warg import super_init_pass_on_kws
from .procedures import OnPolicyEpisodic, Procedure
Expand Down
2 changes: 1 addition & 1 deletion neodroidagent/common/session_factory/vertical/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from neodroid.environments import Environment
from neodroid.environments.gym_environment import NeodroidVectorGymEnvironment
from neodroid.environments.unity_environment import VectorUnityEnvironment
from neodroid.environments.droid_environment import VectorUnityEnvironment
from warg import super_init_pass_on_kws
from .procedures import OnPolicyEpisodic, Procedure
from .single_agent_environment_session import SingleAgentEnvironmentSession
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Procedure,
)
from neodroidagent.utilities.misc import is_positive_and_mod_zero
from warg.kw_passing import drop_unused_kws, passes_kws_to
from warg.decorators.kw_passing import drop_unused_kws, passes_kws_to

__author__ = "Christian Heider Nielsen"
__all__ = ["rollout_on_policy", "OnPolicyEpisodic"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from tqdm import tqdm

from neodroid.environments.unity_environment import VectorUnityEnvironment
from neodroid.environments.droid_environment import VectorUnityEnvironment


def run(self, environment: VectorUnityEnvironment, render: bool = True) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,14 @@
# -*- coding: utf-8 -*-
from typing import Union

from torch import nn
from torch.nn.functional import mse_loss

from neodroidagent.agents import PPOAgent
from neodroidagent.common import OffPolicyBatched, ParallelSession
from neodroidagent.common.architectures.mlp_variants.actor_critic import (
ActorCriticMLP,
CategoricalActorCriticMLP,
)
from neodroidagent.common import ParallelSession
from neodroidagent.configs.test_reference.base_continous_test_config import *

__author__ = "Christian Heider Nielsen"

from neodroidagent.entry_points.session_factory import session_factory

from warg import NOD

"""
Description: Config for training
Author: Christian Heider Nielsen
Expand Down
20 changes: 0 additions & 20 deletions neodroidagent/utilities/exceptions/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,12 @@
__all__ = [
"NoData",
"NoAgent",
"NoEnvironment",
"NoProcedure",
"NoTrajectoryException",
"ActionSpaceNotSupported",
"HasNoEnvError",
]


class HasNoEnvError(Exception):
"""
Raised when an agent has no environment assigned and some implicit next or step called.
"""

def __init__(self, msg="Agent has no env assigned"):
Exception.__init__(self, msg)


class NoEnvironment(Exception):
"""
"""

def __init__(self, msg="No Environment"):
Exception.__init__(self, msg)


class NoProcedure(Exception):
"""
Expand Down
2 changes: 2 additions & 0 deletions requirements_docs.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
sphinx
m2r
sphinxcontrib-programoutput
2 changes: 1 addition & 1 deletion samples/continuous/c2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import draugr
from draugr.stopping.stopping_key import add_early_stopping_key_combination
from neodroid.environments.unity_environment import SingleUnityEnvironment
from neodroid.environments.droid_environment import SingleUnityEnvironment

__author__ = "Christian Heider Nielsen"

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,5 +207,5 @@ def version(self):
tests_require=pkg.dependencies_testing,
setup_requires=pkg.setup_dependencies,
include_package_data=True,
python_requires=">=3",
python_requires=">=3.6",
)

0 comments on commit 60a2d79

Please sign in to comment.