original_docstring: 
          Input: s - tensor representing hidden state of task
          Description: return best action state using polynomial upper confidence trees
          Output: list containing pUCT values for all acitons
          
docstring: tensor representing hidden state of task
  Description: return best action state using polynomial upper confidence trees
  Output: list containing pUCT values for all acitons
docstring_tokens: tensor representing hidden state of task Description : return best action state using polynomial upper confidence trees Output : list containing pUCT values for all acitons
code: def pUCT(self, s):
          """
          Input: s - tensor representing hidden state of task
          Description: return best action state using polynomial upper confidence trees
          Output: list containing pUCT values for all acitons
          """
          p_visits = sum([self.tree[(s, b)].N for b in range(self.action_space)]) #Sum of all potential nodes
          u_bank = {}
          for a in range(self.action_space):
              U = self.tree[(s, a)].P * ((p_visits**(0.5))/(1+self.tree[(s, a)].N)) #First part of exploration
              if isnan(U):
                  continue
              U *= self.c1 + (math.log((p_visits + (self.action_space * self.c2) + self.action_space) / self.c2)) #Second part of exploration
              Q_n = (self.tree[(s, a)].Q - self.Q_min) / (self.Q_max - self.Q_min) #Normalized value
              u_bank[a] = Q_n + U
          #print(u_bank)
          m_u = max(u_bank.values())
          a_bank = [k for k,v in u_bank.items() if v == m_u]
          return random.choice(a_bank)
code_tokens: def pUCT ( self , s ) : p_visits = sum ( [ self . tree [ ( s , b ) ] . N for b in range ( self . action_space ) ] ) u_bank = { } for a in range ( self . action_space ) : U = self . tree [ ( s , a ) ] . P * ( ( p_visits ** ( 0.5 ) ) / ( 1 + self . tree [ ( s , a ) ] . N ) ) if isnan ( U ) : continue U *= self . c1 + ( math . log ( ( p_visits + ( self . action_space * self . c2 ) + self . action_space ) / self . c2 ) ) Q_n = ( self . tree [ ( s , a ) ] . Q - self . Q_min ) / ( self . Q_max - self . Q_min ) u_bank [ a ] = Q_n + U m_u = max ( u_bank . values ( ) ) a_bank = [ k for k , v in u_bank . items ( ) if v == m_u ] return random . choice ( a_bank )
short_docstring: Input: s - tensor representing hidden state of task
  Description: return best action state using polynomial upper confidence trees
  Output: list containing pUCT values for all acitons
short_docstring_tokens: Input : s - tensor representing hidden state of task Description : return best action state using polynomial upper confidence trees Output : list containing pUCT values for all acitons
comment: """
          Input: s - tensor representing hidden state of task
          Description: return best action state using polynomial upper confidence trees
          Output: list containing pUCT values for all acitons
          """$SEP$#Sum of all potential nodes$SEP$#First part of exploration$SEP$#Second part of exploration$SEP$#Normalized value$SEP$#print(u_bank)