def updateLearnRate(self, phi, phi_prime, eligibility_trace,
					discount_factor, nnz, terminal):
        """Computes a new learning rate (learn_rate) for the agent based on
        ``self.learn_rate_decay_mode``.

        :param phi: The feature vector evaluated at state (s) and action (a)
        :param phi_prime_: The feature vector evaluated at the new state (ns) = (s') and action (na)
        :param eligibility_trace: Eligibility trace
        :param discount_factor: The discount factor for learning (gamma)
        :param nnz: The number of nonzero features
        :param terminal: Boolean that determines if the step is terminal or not

        """

        if self.learn_rate_decay_mode == 'dabney':
            # We only update learn_rate if this step is non-terminal; else phi_prime becomes
            # zero and the dot product below becomes very large, creating a very
            # small learn_rate
            if not terminal:
                # Automatic learning rate: [Dabney W. 2012]
                # http://people.cs.umass.edu/~wdabney/papers/alphaBounds.pdf
                candid_learn_rate = np.dot(discount_factor * phi_prime - phi,
                                                   eligibility_trace)
                if candid_learn_rate < 0:
                    self.learn_rate = np.minimum(self.learn_rate,-1.0/candid_learn_rate)
        elif self.learn_rate_decay_mode == 'boyan':
            self.learn_rate = self.initial_learn_rate * \
                (self.boyan_N0 + 1.) / \
                (self.boyan_N0 + (self.episode_count + 1) ** 1.1)
            # divide by l1 of the features; note that this method is only called if phi != 0
            self.learn_rate /= np.sum(np.abs(phi))
        elif self.learn_rate_decay_mode == 'boyan_const':
            # New little change from not having +1 for episode count
            self.learn_rate = self.initial_learn_rate * \
                (self.boyan_N0 + 1.) / \
                (self.boyan_N0 + (self.episode_count + 1) ** 1.1)
        elif self.learn_rate_decay_mode == "const":
            self.learn_rate = self.initial_learn_rate
        else:
            self.logger.warn("Unrecognized decay mode ")
dataset/ETHPy150Open rlpy/rlpy/rlpy/Agents/Agent.py/DescentAlgorithm.updateLearnRate/original