added metadata and reward_range for each tasks
This commit is contained in:
		
							parent
							
								
									106317015d
								
							
						
					
					
						commit
						2c933da684
					
				@ -4,7 +4,7 @@ import numpy as np
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
class Atari:
 | 
					class Atari:
 | 
				
			||||||
    LOCK = None
 | 
					    LOCK = None
 | 
				
			||||||
 | 
					    metadata = {}
 | 
				
			||||||
    def __init__(
 | 
					    def __init__(
 | 
				
			||||||
        self,
 | 
					        self,
 | 
				
			||||||
        name,
 | 
					        name,
 | 
				
			||||||
@ -64,6 +64,7 @@ class Atari:
 | 
				
			|||||||
        self._last_lives = None
 | 
					        self._last_lives = None
 | 
				
			||||||
        self._done = True
 | 
					        self._done = True
 | 
				
			||||||
        self._step = 0
 | 
					        self._step = 0
 | 
				
			||||||
 | 
					        self.reward_range = [-np.inf, np.inf]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def observation_space(self):
 | 
					    def observation_space(self):
 | 
				
			||||||
 | 
				
			|||||||
@ -3,12 +3,14 @@ import numpy as np
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Crafter:
 | 
					class Crafter:
 | 
				
			||||||
 | 
					    metadata = {}
 | 
				
			||||||
    def __init__(self, task, size=(64, 64), seed=None):
 | 
					    def __init__(self, task, size=(64, 64), seed=None):
 | 
				
			||||||
        assert task in ("reward", "noreward")
 | 
					        assert task in ("reward", "noreward")
 | 
				
			||||||
        import crafter
 | 
					        import crafter
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self._env = crafter.Env(size=size, reward=(task == "reward"), seed=seed)
 | 
					        self._env = crafter.Env(size=size, reward=(task == "reward"), seed=seed)
 | 
				
			||||||
        self._achievements = crafter.constants.achievements.copy()
 | 
					        self._achievements = crafter.constants.achievements.copy()
 | 
				
			||||||
 | 
					        self.reward_range = [-np.inf, np.inf]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def observation_space(self):
 | 
					    def observation_space(self):
 | 
				
			||||||
 | 
				
			|||||||
@ -3,6 +3,7 @@ import numpy as np
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class DeepMindControl:
 | 
					class DeepMindControl:
 | 
				
			||||||
 | 
					    metadata = {}
 | 
				
			||||||
    def __init__(self, name, action_repeat=1, size=(64, 64), camera=None):
 | 
					    def __init__(self, name, action_repeat=1, size=(64, 64), camera=None):
 | 
				
			||||||
        domain, task = name.split("_", 1)
 | 
					        domain, task = name.split("_", 1)
 | 
				
			||||||
        if domain == "cup":  # Only domain with multiple words.
 | 
					        if domain == "cup":  # Only domain with multiple words.
 | 
				
			||||||
@ -19,6 +20,7 @@ class DeepMindControl:
 | 
				
			|||||||
        if camera is None:
 | 
					        if camera is None:
 | 
				
			||||||
            camera = dict(quadruped=2).get(domain, 0)
 | 
					            camera = dict(quadruped=2).get(domain, 0)
 | 
				
			||||||
        self._camera = camera
 | 
					        self._camera = camera
 | 
				
			||||||
 | 
					        self.reward_range = [-np.inf, np.inf]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def observation_space(self):
 | 
					    def observation_space(self):
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user