Coverage for adaro_rl / zoo / Template / environment.py: 75%
12 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-14 07:50 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-14 07:50 +0000
1# flake8: noqa: F021
2import numpy as np
4import gymnasium as gym
6from ..eval import custom_evaluate_policy
9class EnvWrapper(gym.Wrapper):
10 def __init__(self, env):
11 super(EnvWrapper, self).__init__(env)
13 observation_perturbation_space = gym.spaces.Box(
14 low=-self.observation_space.high,
15 high=self.observation_space.high,
16 dtype=np.float32,
17 )
18 proportional_obs_perturbation_mask = np.zeros(self.observation_space.shape)
21train_env_config = {
22 "env_id": "...",
23 "wrapper_class": EnvWrapper,
24 "n_envs": 1,
25 "n_frame_stack": 1,
26 "env_kwargs": {},
27}
29eval_env_config = {
30 "env_id": "...",
31 "wrapper_class": EnvWrapper,
32 "n_envs": 1,
33 "n_frame_stack": 1,
34 "env_kwargs": {},
35}
37render_env_config = {
38 "env_id": "...",
39 "wrapper_class": EnvWrapper,
40 "n_envs": 1,
41 "n_frame_stack": 1,
42 "env_kwargs": {},
43}
45eval_config = {
46 "evaluate_policy_fct": custom_evaluate_policy,
47 "deterministic_eval": False,
48}