Skip to content

Commit

Permalink
Depend on sensAI instead of copying its utils (logging, string)
Browse files Browse the repository at this point in the history
  • Loading branch information
opcode81 committed Oct 27, 2023
1 parent 5952993 commit fdb0eba
Show file tree
Hide file tree
Showing 37 changed files with 761 additions and 747 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,5 @@ videos/
# might be needed for IDE plugins that can't read ruff config
.flake8

# temporary scripts (for ad-hoc testing), temp folder
# folder for temporary files
/temp
/temp*.py
5 changes: 3 additions & 2 deletions examples/atari/atari_dqn_hl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import os

from sensai.util import logging
from sensai.util.logging import datetime_tag

from examples.atari.atari_callbacks import (
TestEpochCallbackDQNSetEps,
TrainEpochCallbackNatureDQNEpsLinearDecay,
Expand All @@ -20,8 +23,6 @@
from tianshou.highlevel.params.policy_wrapper import (
PolicyWrapperFactoryIntrinsicCuriosity,
)
from tianshou.utils import logging
from tianshou.utils.logging import datetime_tag


def main(
Expand Down
5 changes: 3 additions & 2 deletions examples/atari/atari_iqn_hl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import os
from collections.abc import Sequence

from sensai.util import logging
from sensai.util.logging import datetime_tag

from examples.atari.atari_callbacks import (
TestEpochCallbackDQNSetEps,
TrainEpochCallbackNatureDQNEpsLinearDecay,
Expand All @@ -17,8 +20,6 @@
IQNExperimentBuilder,
)
from tianshou.highlevel.params.policy_params import IQNParams
from tianshou.utils import logging
from tianshou.utils.logging import datetime_tag


def main(
Expand Down
5 changes: 3 additions & 2 deletions examples/atari/atari_ppo_hl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import os
from collections.abc import Sequence

from sensai.util import logging
from sensai.util.logging import datetime_tag

from examples.atari.atari_network import (
ActorFactoryAtariDQN,
IntermediateModuleFactoryAtariDQNFeatures,
Expand All @@ -18,8 +21,6 @@
from tianshou.highlevel.params.policy_wrapper import (
PolicyWrapperFactoryIntrinsicCuriosity,
)
from tianshou.utils import logging
from tianshou.utils.logging import datetime_tag


def main(
Expand Down
5 changes: 3 additions & 2 deletions examples/atari/atari_sac_hl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import os

from sensai.util import logging
from sensai.util.logging import datetime_tag

from examples.atari.atari_network import (
ActorFactoryAtariDQN,
IntermediateModuleFactoryAtariDQNFeatures,
Expand All @@ -17,8 +20,6 @@
from tianshou.highlevel.params.policy_wrapper import (
PolicyWrapperFactoryIntrinsicCuriosity,
)
from tianshou.utils import logging
from tianshou.utils.logging import datetime_tag


def main(
Expand Down
4 changes: 2 additions & 2 deletions examples/mujoco/mujoco_a2c_hl.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from collections.abc import Sequence
from typing import Literal

from sensai.util import logging
from sensai.util.logging import datetime_tag
from torch import nn

from examples.mujoco.mujoco_env import MujocoEnvFactory
Expand All @@ -15,8 +17,6 @@
from tianshou.highlevel.optim import OptimizerFactoryRMSprop
from tianshou.highlevel.params.lr_scheduler import LRSchedulerFactoryLinear
from tianshou.highlevel.params.policy_params import A2CParams
from tianshou.utils import logging
from tianshou.utils.logging import datetime_tag


def main(
Expand Down
5 changes: 3 additions & 2 deletions examples/mujoco/mujoco_ddpg_hl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import os
from collections.abc import Sequence

from sensai.util import logging
from sensai.util.logging import datetime_tag

from examples.mujoco.mujoco_env import MujocoEnvFactory
from tianshou.highlevel.config import SamplingConfig
from tianshou.highlevel.experiment import (
Expand All @@ -11,8 +14,6 @@
)
from tianshou.highlevel.params.noise import MaxActionScaledGaussian
from tianshou.highlevel.params.policy_params import DDPGParams
from tianshou.utils import logging
from tianshou.utils.logging import datetime_tag


def main(
Expand Down
4 changes: 2 additions & 2 deletions examples/mujoco/mujoco_npg_hl.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from typing import Literal

import torch
from sensai.util import logging
from sensai.util.logging import datetime_tag

from examples.mujoco.mujoco_env import MujocoEnvFactory
from tianshou.highlevel.config import SamplingConfig
Expand All @@ -17,8 +19,6 @@
)
from tianshou.highlevel.params.lr_scheduler import LRSchedulerFactoryLinear
from tianshou.highlevel.params.policy_params import NPGParams
from tianshou.utils import logging
from tianshou.utils.logging import datetime_tag


def main(
Expand Down
4 changes: 2 additions & 2 deletions examples/mujoco/mujoco_ppo_hl.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from typing import Literal

import torch
from sensai.util import logging
from sensai.util.logging import datetime_tag

from examples.mujoco.mujoco_env import MujocoEnvFactory
from tianshou.highlevel.config import SamplingConfig
Expand All @@ -17,8 +19,6 @@
)
from tianshou.highlevel.params.lr_scheduler import LRSchedulerFactoryLinear
from tianshou.highlevel.params.policy_params import PPOParams
from tianshou.utils import logging
from tianshou.utils.logging import datetime_tag


def main(
Expand Down
5 changes: 3 additions & 2 deletions examples/mujoco/mujoco_redq_hl.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
from collections.abc import Sequence
from typing import Literal

from sensai.util import logging
from sensai.util.logging import datetime_tag

from examples.mujoco.mujoco_env import MujocoEnvFactory
from tianshou.highlevel.config import SamplingConfig
from tianshou.highlevel.experiment import (
Expand All @@ -12,8 +15,6 @@
)
from tianshou.highlevel.params.alpha import AutoAlphaFactoryDefault
from tianshou.highlevel.params.policy_params import REDQParams
from tianshou.utils import logging
from tianshou.utils.logging import datetime_tag


def main(
Expand Down
4 changes: 2 additions & 2 deletions examples/mujoco/mujoco_reinforce_hl.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from typing import Literal

import torch
from sensai.util import logging
from sensai.util.logging import datetime_tag

from examples.mujoco.mujoco_env import MujocoEnvFactory
from tianshou.highlevel.config import SamplingConfig
Expand All @@ -14,8 +16,6 @@
)
from tianshou.highlevel.params.lr_scheduler import LRSchedulerFactoryLinear
from tianshou.highlevel.params.policy_params import PGParams
from tianshou.utils import logging
from tianshou.utils.logging import datetime_tag


def main(
Expand Down
5 changes: 3 additions & 2 deletions examples/mujoco/mujoco_sac_hl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import os
from collections.abc import Sequence

from sensai.util import logging
from sensai.util.logging import datetime_tag

from examples.mujoco.mujoco_env import MujocoEnvFactory
from tianshou.highlevel.config import SamplingConfig
from tianshou.highlevel.experiment import (
Expand All @@ -11,8 +14,6 @@
)
from tianshou.highlevel.params.alpha import AutoAlphaFactoryDefault
from tianshou.highlevel.params.policy_params import SACParams
from tianshou.utils import logging
from tianshou.utils.logging import datetime_tag


def main(
Expand Down
4 changes: 2 additions & 2 deletions examples/mujoco/mujoco_td3_hl.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from collections.abc import Sequence

import torch
from sensai.util import logging
from sensai.util.logging import datetime_tag

from examples.mujoco.mujoco_env import MujocoEnvFactory
from tianshou.highlevel.config import SamplingConfig
Expand All @@ -16,8 +18,6 @@
MaxActionScaledGaussian,
)
from tianshou.highlevel.params.policy_params import TD3Params
from tianshou.utils import logging
from tianshou.utils.logging import datetime_tag


def main(
Expand Down
4 changes: 2 additions & 2 deletions examples/mujoco/mujoco_trpo_hl.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from typing import Literal

import torch
from sensai.util import logging
from sensai.util.logging import datetime_tag

from examples.mujoco.mujoco_env import MujocoEnvFactory
from tianshou.highlevel.config import SamplingConfig
Expand All @@ -17,8 +19,6 @@
)
from tianshou.highlevel.params.lr_scheduler import LRSchedulerFactoryLinear
from tianshou.highlevel.params.policy_params import TRPOParams
from tianshou.utils import logging
from tianshou.utils.logging import datetime_tag


def main(
Expand Down
Loading

0 comments on commit fdb0eba

Please sign in to comment.