agent.py
def select_action(self, x_t = None):
        """
        Selects either an epsilon random action
        or just the best action according to the
        current state of the neural network
        """
        a_t = np.zeros([self.nactions])
        do_action = 0
        if x_t is None or random.random() <= self.epsilon:
            log.debug('random action selected with epsilon ' + str(self.epsilon))
            do_action = random.randrange(self.nactions)
        else:
            log.debug('greedy action selected with epsilon ' + str(self.epsilon))
            do_action = self.perception.select_best_action(x_t)

        if self.epsilon > self.final_epsilon and self.step > self.observe:
            self.epsilon -= (self.initial_epsilon - self.final_epsilon) / self.explore
        log.debug('epsilon was updated to ' + str(self.epsilon))

        a_t[do_action] = 1
        log.debug('action distribution looks like ' + str(a_t))
        return a_t

        Selects either an epsilon random action
        or just the best action according to the
        current state of the neural network
        
Selects either an epsilon random action
or just the best action according to the
current state of the neural network
Selects either an epsilon random action or just the best action according to the current state of the neural network
def select_action(self, x_t = None):
        a_t = np.zeros([self.nactions])
        do_action = 0
        if x_t is None or random.random() <= self.epsilon:
            log.debug('random action selected with epsilon ' + str(self.epsilon))
            do_action = random.randrange(self.nactions)
        else:
            log.debug('greedy action selected with epsilon ' + str(self.epsilon))
            do_action = self.perception.select_best_action(x_t)
        if self.epsilon > self.final_epsilon and self.step > self.observe:
            self.epsilon -= (self.initial_epsilon - self.final_epsilon) / self.explore
        log.debug('epsilon was updated to ' + str(self.epsilon))
        a_t[do_action] = 1
        log.debug('action distribution looks like ' + str(a_t))
        return a_t
def select_action ( self , x_t = None ) : a_t = np . zeros ( [ self . nactions ] ) do_action = 0 if x_t is None or random . random ( ) <= self . epsilon : log . debug ( 'random action selected with epsilon ' + str ( self . epsilon ) ) do_action = random . randrange ( self . nactions ) else : log . debug ( 'greedy action selected with epsilon ' + str ( self . epsilon ) ) do_action = self . perception . select_best_action ( x_t ) if self . epsilon > self . final_epsilon and self . step > self . observe : self . epsilon -= ( self . initial_epsilon - self . final_epsilon ) / self . explore log . debug ( 'epsilon was updated to ' + str ( self . epsilon ) ) a_t [ do_action ] = 1 log . debug ( 'action distribution looks like ' + str ( a_t ) ) return a_t
Selects either an epsilon random action
or just the best action according to the
current state of the neural network
Selects either an epsilon random action or just the best action according to the current state of the neural network
"""
        Selects either an epsilon random action
        or just the best action according to the
        current state of the neural network
        """
self
x_t