(self, eta, kl_threshold, costs)
return (eta * kl_threshold + max_costs
                + eta * np.log((1.0 / len(costs)) *
                np.sum(np.exp(exponent / eta))))
Dual function for optimizing the temperature eta according to the given
        KL-divergence constraint.
        
        Args:
            eta: Temperature that has to be optimized.
            kl_threshold: Max. KL-divergence constraint.
            costs: Roll-out costs.            
        Returns:
            Value of the dual function.
Dual function for optimizing the temperature eta according to the given
        KL-divergence constraint.
        
        Args:
            eta: Temperature that has to be optimized.
            kl_threshold: Max. KL-divergence constraint.
            costs: Roll-out costs.            
        Returns:
            Value of the dual function.
Dual function for optimizing the temperature eta according to the given KL - divergence constraint . Args : eta : Temperature that has to be optimized . kl_threshold : Max . KL - divergence constraint . costs : Roll - out costs . Returns : Value of the dual function .
def kl_dual(self, eta, kl_threshold, costs):
        """
        Dual function for optimizing the temperature eta according to the given
        KL-divergence constraint.
        
        Args:
            eta: Temperature that has to be optimized.
            kl_threshold: Max. KL-divergence constraint.
            costs: Roll-out costs.            
        Returns:
            Value of the dual function.
        """
        max_costs = np.max(-costs)
        exponent = -costs - max_costs
        return (eta * kl_threshold + max_costs
                + eta * np.log((1.0 / len(costs)) *
                np.sum(np.exp(exponent / eta))))
def kl_dual ( self , eta , kl_threshold , costs ) : max_costs = np . max ( - costs ) exponent = - costs - max_costs return ( eta * kl_threshold + max_costs + eta * np . log ( ( 1.0 / len ( costs ) ) * np . sum ( np . exp ( exponent / eta ) ) ) )