agent/DQ_agent.py
def observe(self, replay_start_size: int=50000) -> None:
        """
        Observe random moves to initialize the replay memory.

        Args:
            replay_start_size: the number of random observations to make
                i.e. the size to fill the replay memory with to start
        """
        progress = tqdm(total=replay_start_size, unit='frame')
        # loop indefinitely, the loop breaks when the number of
        # frames passed is greater than replay_start_size
        while replay_start_size > 0:
            # reset the game and get the initial state
            state = self._initial_state()
            done = False
            while not done:
                # sample a random action to perform
                action = self.env.action_space.sample()
                # perform action and observe the reward and next state
                next_state, reward, done = self._next_state(action)
                # push the memory onto the replay queue
                self.queue.push(state, action, reward, done, next_state)
                # set the state to the new state
                state = next_state
                # decrement the observation counter
                replay_start_size -= 1
                # update the progress bar
                progress.update(1)

        progress.close()

        Observe random moves to initialize the replay memory.

        Args:
            replay_start_size: the number of random observations to make
                i.e. the size to fill the replay memory with to start
        
Observe random moves to initialize the replay memory.
Observe random moves to initialize the replay memory .
def observe(self, replay_start_size: int=50000) -> None:
        progress = tqdm(total=replay_start_size, unit='frame')
        while replay_start_size > 0:
            state = self._initial_state()
            done = False
            while not done:
                action = self.env.action_space.sample()
                next_state, reward, done = self._next_state(action)
                self.queue.push(state, action, reward, done, next_state)
                state = next_state
                replay_start_size -= 1
                progress.update(1)
        progress.close()
def observe ( self , replay_start_size : int = 50000 ) -> None : progress = tqdm ( total = replay_start_size , unit = 'frame' ) while replay_start_size > 0 : state = self . _initial_state ( ) done = False while not done : action = self . env . action_space . sample ( ) next_state , reward , done = self . _next_state ( action ) self . queue . push ( state , action , reward , done , next_state ) state = next_state replay_start_size -= 1 progress . update ( 1 ) progress . close ( )
Observe random moves to initialize the replay memory.
Observe random moves to initialize the replay memory .
"""
        Observe random moves to initialize the replay memory.

        Args:
            replay_start_size: the number of random observations to make
                i.e. the size to fill the replay memory with to start
        """ # loop indefinitely, the loop breaks when the number of # frames passed is greater than replay_start_size # reset the game and get the initial state # sample a random action to perform # perform action and observe the reward and next state # push the memory onto the replay queue # set the state to the new state # decrement the observation counter # update the progress bar
self
replay_start_size
int
the number of random observations to make
i.e. the size to fill the replay memory with to start
the number of random observations to make i . e . the size to fill the replay memory with to start