class_docstr: The Thompson Sampling MAB with Normal-Gamma distribution for rewards.
  Appropriate for MAB with normally distributed rewards.
  We use posterior update equations from
      https://en.wikipedia.org/wiki/Normal-gamma_distribution#Posterior_distribution_of_the_parameters
class_docstr_tok: ["The","Thompson","Sampling","MAB","with","Normal-Gamma","distribution","for","rewards",".","Appropriate","for","MAB","with","normally","distributed","rewards",".","We","use","posterior","update","equations","from","https",":","\/\/en.wikipedia.org\/wiki\/Normal-gamma_distribution","#","Posterior_distribution_of_the_parameters"]
code: def __init__(
      self,
      randomize_ties: bool = True,
      min_num_obs_per_arm: int = 1,
      *,
      n_arms: Optional[int] = None,
      arm_ids: Optional[List[str]] = None,
  ) -> None:
      super().__init__(
          randomize_ties=randomize_ties,
          n_arms=n_arms,
          arm_ids=arm_ids,
          min_num_obs_per_arm=min_num_obs_per_arm,
      )
      self.mus = torch.zeros(self.n_arms)
      self.alpha_0 = 1.5  # initial value of the alpha parameter
      self.lambda_0 = 1.0  # initial value of the lambda parameter
      self.gamma_rates = torch.ones(self.n_arms)
  
file_path: ReAgent/reagent/mab/thompson_sampling.py
imports: from abc import abstractmethod
  from typing import List, Optional
  import torch
  from reagent.mab.mab_algorithm import MABAlgo, reindex_multiple_tensors
  from torch import Tensor
label_desc: Use image node_id 1 to create a new NormalGammaThompson object from inherited base classes: BaseThompsonSampling with example: obj = NormalGammaThompson(randomize_ties, min_num_obs_per_arm)