83c9130b8ac6e5cf76fb804282c652343ed2167d,env.py,Env,reset,#Env#,34

Before Change


      self.state_buffer.append(torch.zeros(84, 84, device=self.device))

  def reset(self):
    if self.life_termination:
      self.life_termination = False  // Reset flag
      self.ale.act(0)  // Use a no-op after loss of life
    else:
      // Reset internals
      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)

After Change


    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:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


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


Project Name: kevinzakka/recurrent-visual-attention
Commit Name: e47ca7b4947c8b009ff787da2a681225be13c6d1
Time: 2018-01-28
Author: kevinarmandzakka@gmail.com
File Name: trainer.py
Class Name: Trainer
Method Name: train


Project Name: mozilla/TTS
Commit Name: 14c2381207c5972359b2af450a233730ff877ee1
Time: 2020-10-29
Author: erogol@hotmail.com
File Name: TTS/bin/train_wavegrad.py
Class Name:
Method Name: train