@@ -157,114 +157,3 @@ def _get_reward(self, action: T) -> float:
157157
158158 def render (self , mode : str = "human" ) -> None :
159159 pass
160-
161-
162- # Not Work Yet
163- class IdentityEnvBox (IdentityEnv [np .ndarray ]):
164- def __init__ (
165- self ,
166- low : float = - 1.0 ,
167- high : float = 1.0 ,
168- eps : float = 0.05 ,
169- ep_length : int = 100 ,
170- ):
171- """
172- Identity environment for testing purposes
173-
174- :param low: the lower bound of the box dim
175- :param high: the upper bound of the box dim
176- :param eps: the epsilon bound for correct value
177- :param ep_length: the length of each episode in timesteps
178- """
179- space = spaces .Box (low = low , high = high , shape = (1 ,), dtype = np .float32 )
180- super ().__init__ (ep_length = ep_length , space = space )
181- self .eps = eps
182-
183- def step (
184- self , action : np .ndarray
185- ) -> Tuple [np .ndarray , float , bool , Dict [str , Any ]]:
186- reward = self ._get_reward (action )
187- self ._choose_next_state ()
188- self .current_step += 1
189- done = self .current_step >= self .ep_length
190- return self .state , reward , done , {}
191-
192- def _get_reward (self , action : np .ndarray ) -> float :
193- return (
194- 1.0 if (self .state - self .eps ) <= action <= (self .state + self .eps ) else 0.0
195- )
196-
197-
198- # Not Work Yet
199- class IdentityEnvMultiDiscrete (IdentityEnv [np .ndarray ]):
200- def __init__ (self , dim : int = 1 , ep_length : int = 100 ) -> None :
201- """
202- Identity environment for testing purposes
203-
204- :param dim: the size of the dimensions you want to learn
205- :param ep_length: the length of each episode in timesteps
206- """
207- space = spaces .MultiDiscrete ([dim , dim ])
208- super ().__init__ (ep_length = ep_length , space = space )
209-
210-
211- # Not Work Yet
212- class IdentityEnvMultiBinary (IdentityEnv [np .ndarray ]):
213- def __init__ (self , dim : int = 1 , ep_length : int = 100 ) -> None :
214- """
215- Identity environment for testing purposes
216-
217- :param dim: the size of the dimensions you want to learn
218- :param ep_length: the length of each episode in timesteps
219- """
220- space = spaces .MultiBinary (dim )
221- super ().__init__ (ep_length = ep_length , space = space )
222-
223-
224- # Not Work Yet
225- class FakeImageEnv (gym .Env ):
226- """
227- Fake image environment for testing purposes, it mimics Atari games.
228-
229- :param action_dim: Number of discrete actions
230- :param screen_height: Height of the image
231- :param screen_width: Width of the image
232- :param n_channels: Number of color channels
233- :param discrete: Create discrete action space instead of continuous
234- :param channel_first: Put channels on first axis instead of last
235- """
236-
237- def __init__ (
238- self ,
239- action_dim : int = 6 ,
240- screen_height : int = 84 ,
241- screen_width : int = 84 ,
242- n_channels : int = 1 ,
243- discrete : bool = True ,
244- channel_first : bool = False ,
245- ) -> None :
246- self .observation_shape = (screen_height , screen_width , n_channels )
247- if channel_first :
248- self .observation_shape = (n_channels , screen_height , screen_width )
249- self .observation_space = spaces .Box (
250- low = 0 , high = 255 , shape = self .observation_shape , dtype = np .uint8
251- )
252- if discrete :
253- self .action_space = spaces .Discrete (action_dim )
254- else :
255- self .action_space = spaces .Box (low = - 1 , high = 1 , shape = (5 ,), dtype = np .float32 )
256- self .ep_length = 10
257- self .current_step = 0
258-
259- def reset (self ) -> np .ndarray :
260- self .current_step = 0
261- return self .observation_space .sample ()
262-
263- def step (self , action : Union [np .ndarray , int ]):
264- reward = 0.0
265- self .current_step += 1
266- done = self .current_step >= self .ep_length
267- return self .observation_space .sample (), reward , done , {}
268-
269- def render (self , mode : str = "human" ) -> None :
270- pass
0 commit comments