5ec418e8146079d6797bb15b0f5e777862815df6,env.py,Env,reset,#Env#,54

Before Change


  def reset(self):
    observation = self._reset()
    // Press fire (raw action 1) to reset game if needed
    if 1 in self.actions.keys():
      observation, _, done = self.step(1)
      if done:
        self._reset()
      observation, _, done = self.step(2)
      if done:
        self._reset()
    return observation
 
  def step(self, action):
    // Repeat action 4 times, max pool over last 2 frames

After Change


      self._reset_buffer()
      self.ale.reset_game()
      // Perform up to 30 random no-ops before starting
      for _ in range(random.randrange(30)):
        self.ale.act(0)  // Assumes raw action 0 is always no-op
        if self.ale.game_over():
          self.ale.reset_game()
    // Process and return "initial" state
    observation = self._get_state()
    self.state_buffer.append(observation)
    self.lives = self.ale.lives()
    return torch.stack(list(self.state_buffer), 0)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: Kaixhin/Rainbow
Commit Name: 5ec418e8146079d6797bb15b0f5e777862815df6
Time: 2018-05-07
Author: design@kaixhin.com
File Name: env.py
Class Name: Env
Method Name: reset


Project Name: yangyanli/PointCNN
Commit Name: 161b24af716a1e7a3221fce2903544ac1429387d
Time: 2018-06-08
Author: yangyan.lee@gmail.com
File Name: pointfly.py
Class Name:
Method Name: get_indices


Project Name: commonsense/conceptnet5
Commit Name: 2a437760c9344a20a5785f5b4706950c911534b6
Time: 2015-04-08
Author: rob@luminoso.com
File Name: conceptnet5/formats/sql.py
Class Name: EdgeIndexReader
Method Name: random