class_docstr: Implements Boltzmann-Gumbel exploration (BGE) adapted for Q learning
  based on the paper Boltzmann Exploration Done Right
  (https://arxiv.org/pdf/1705.10257.pdf).
  
  BGE is invariant with respect to the mean of the rewards but not their
  variance. The parameter C, which defaults to 1, can be used to correct for
  this, and should be set to the least upper bound on the standard deviation
  of the rewards.
  
  BGE is only available for training, not testing. For testing purposes, you
  can achieve approximately the same result as BGE after training for N steps
  on K actions with parameter C by using the BoltzmannQPolicy and setting
  tau = C/sqrt(N/K).
class_docstr_tok: ["Implements","Boltzmann-Gumbel","exploration","(","BGE",")","adapted","for","Q","learning","based","on","the","paper","Boltzmann","Exploration","Done","Right","(","https",":","\/\/arxiv.org\/pdf\/1705.10257.pdf",")",".","BGE","is","invariant","with","respect","to","the","mean","of","the","rewards","but","not","their","variance",".","The","parameter","C",",","which","defaults","to","1",",","can","be","used","to","correct","for","this",",","and","should","be","set","to","the","least","upper","bound","on","the","standard","deviation","of","the","rewards",".","BGE","is","only","available","for","training",",","not","testing",".","For","testing","purposes",",","you","can","achieve","approximately","the","same","result","as","BGE","after","training","for","N","steps","on","K","actions","with","parameter","C","by","using","the","BoltzmannQPolicy","and","setting","tau","=","C\/sqrt","(","N\/K",")","."]
code: def __init__(self, C=1.0):
      assert (
          C > 0
      ), "BoltzmannGumbelQPolicy C parameter must be > 0, not " + repr(
          C
      )
      super(BoltzmannGumbelQPolicy, self).__init__()
      self.C = C
      self.action_counts = None
  
imports: from __future__ import division
  import numpy
  from rl.util import *
label_desc: Use image node_id 1 to create a new BoltzmannGumbelQPolicy object from inherited base classes: Policy with example: obj = BoltzmannGumbelQPolicy(C)