class_docstr: WandbLoggerCallback
  
  Weights and biases (https://www.wandb.ai/) is a tool for experiment
  tracking, model optimization, and dataset versioning. This Ray Tune
  ``LoggerCallback`` sends metrics to Wandb for automatic tracking and
  visualization.
  
  Example:
  
      .. testcode::
  
          import random
  
          from ray import train, tune
          from ray.train import RunConfig
          from ray.air.integrations.wandb import WandbLoggerCallback
  
  
          def train_func(config):
              offset = random.random() / 5
              for epoch in range(2, config["epochs"]):
                  acc = 1 - (2 + config["lr"]) ** -epoch - random.random() / epoch - offset
                  loss = (2 + config["lr"]) ** -epoch + random.random() / epoch + offset
                  train.report({"acc": acc, "loss": loss})
  
  
          tuner = tune.Tuner(
              train_func,
              param_space={
                  "lr": tune.grid_search([0.001, 0.01, 0.1, 1.0]),
                  "epochs": 10,
              },
              run_config=RunConfig(
                  callbacks=[WandbLoggerCallback(project="Optimization_Project")]
              ),
          )
          results = tuner.fit()
  
      .. testoutput::
          :hide:
  
          ...
  
  Args:
      project: Name of the Wandb project. Mandatory.
      group: Name of the Wandb group. Defaults to the trainable
          name.
      api_key_file: Path to file containing the Wandb API KEY. This
          file only needs to be present on the node running the Tune script
          if using the WandbLogger.
      api_key: Wandb API Key. Alternative to setting ``api_key_file``.
      excludes: List of metrics and config that should be excluded from
          the log.
      log_config: Boolean indicating if the ``config`` parameter of
          the ``results`` dict should be logged. This makes sense if
          parameters will change during training, e.g. with
          PopulationBasedTraining. Defaults to False.
      upload_checkpoints: If ``True``, model checkpoints will be uploaded to
          Wandb as artifacts. Defaults to ``False``.
      **kwargs: The keyword arguments will be pased to ``wandb.init()``.
  
  Wandb's ``group``, ``run_id`` and ``run_name`` are automatically selected
  by Tune, but can be overwritten by filling out the respective configuration
  values.
  
  Please see here for all other valid configuration settings:
  https://docs.wandb.ai/library/init
class_docstr_tok: ["WandbLoggerCallback","Weights","and","biases","(","https",":","\/\/www.wandb.ai\/",")","is","a","tool","for","experiment","tracking",",","model","optimization",",","and","dataset","versioning",".","This","Ray","Tune","``","LoggerCallback","``","sends","metrics","to","Wandb","for","automatic","tracking","and","visualization",".","Example",":","..","testcode",":",":","import","random","from","ray","import","train",",","tune","from","ray.train","import","RunConfig","from","ray.air.integrations.wandb","import","WandbLoggerCallback","def","train_func","(","config",")",":","offset","=","random.random","(",")","\/","5","for","epoch","in","range","(","2",",","config","[","``","epochs","''","]",")",":","acc","=","1","-","(","2","+","config","[","``","lr","''","]",")","*","*","-epoch","-","random.random","(",")","\/","epoch","-","offset","loss","=","(","2","+","config","[","``","lr","''","]",")","*","*","-epoch","+","random.random","(",")","\/","epoch","+","offset","train.report","(","{","``","acc","''",":","acc",",","``","loss","''",":","loss","}",")","tuner","=","tune.Tuner","(","train_func",",","param_space=","{","``","lr","''",":","tune.grid_search","(","[","0.001",",","0.01",",","0.1",",","1.0","]",")",",","``","epochs","''",":","10",",","}",",","run_config=RunConfig","(","callbacks=","[","WandbLoggerCallback","(","project=","''","Optimization_Project","''",")","]",")",",",")","results","=","tuner.fit","(",")","..","testoutput",":",":",":","hide",":","...","Args",":","project",":","Name","of","the","Wandb","project",".","Mandatory",".","group",":","Name","of","the","Wandb","group",".","Defaults","to","the","trainable","name",".","api_key_file",":","Path","to","file","containing","the","Wandb","API","KEY",".","This","file","only","needs","to","be","present","on","the","node","running","the","Tune","script","if","using","the","WandbLogger",".","api_key",":","Wandb","API","Key",".","Alternative","to","setting","``","api_key_file","``",".","excludes",":","List","of","metrics","and","config","that","should","be","excluded","from","the","log",".","log_config",":","Boolean","indicating","if","the","``","config","``","parameter","of","the","``","results","``","dict","should","be","logged",".","This","makes","sense","if","parameters","will","change","during","training",",","e.g",".","with","PopulationBasedTraining",".","Defaults","to","False",".","upload_checkpoints",":","If","``","True","``",",","model","checkpoints","will","be","uploaded","to","Wandb","as","artifacts",".","Defaults","to","``","False","``",".","*","*","kwargs",":","The","keyword","arguments","will","be","pased","to","``","wandb.init","(",")","``",".","Wandb","'s","``","group","``",",","``","run_id","``","and","``","run_name","``","are","automatically","selected","by","Tune",",","but","can","be","overwritten","by","filling","out","the","respective","configuration","values",".","Please","see","here","for","all","other","valid","configuration","settings",":","https",":","\/\/docs.wandb.ai\/library\/init"]
code: def __init__(
      self,
      project: Optional[str] = None,
      group: Optional[str] = None,
      api_key_file: Optional[str] = None,
      api_key: Optional[str] = None,
      excludes: Optional[List[str]] = None,
      log_config: bool = False,
      upload_checkpoints: bool = False,
      save_checkpoints: bool = False,
      upload_timeout: int = DEFAULT_SYNC_TIMEOUT,
      **kwargs,
  ):
      if not wandb:
          raise RuntimeError(
              "Wandb was not found - please install with `pip install wandb`"
          )
  
      if save_checkpoints:
          warnings.warn(
              "`save_checkpoints` is deprecated. Use `upload_checkpoints` instead.",
              DeprecationWarning,
          )
          upload_checkpoints = save_checkpoints
  
      self.project = project
      self.group = group
      self.api_key_path = api_key_file
      self.api_key = api_key
      self.excludes = excludes or []
      self.log_config = log_config
      self.upload_checkpoints = upload_checkpoints
      self._upload_timeout = upload_timeout
      self.kwargs = kwargs
  
      self._remote_logger_class = None
  
      self._trial_logging_actors: Dict[
          "Trial", ray.actor.ActorHandle[_WandbLoggingActor]
      ] = {}
      self._trial_logging_futures: Dict["Trial", ray.ObjectRef] = {}
      self._logging_future_to_trial: Dict[ray.ObjectRef, "Trial"] = {}
      self._trial_queues: Dict["Trial", Queue] = {}
  
imports: import enum
  import os
  import pickle
  import urllib
  import warnings
  import numpy
  from numbers import Number
  import pyarrow.fs
  from types import ModuleType
  from typing import Any, Dict, List, Optional, Sequence, Tuple, Union
  import ray
  from ray import logger
  from ray.air import session
  from ray.air._internal import usage
  from ray.air.util.node import _force_on_current_node
  from ray.tune.logger import LoggerCallback
  from ray.tune.utils import flatten_dict
  from ray.tune.experiment import Trial
  from ray.train._internal.syncer import DEFAULT_SYNC_TIMEOUT
  from ray._private.storage import _load_class
  from ray.util import PublicAPI
  from ray.util.queue import Queue
label_desc: Use image node_id 1 to create a new WandbLoggerCallback object from inherited base classes: LoggerCallback with example: obj = WandbLoggerCallback(project, group, api_key_file, api_key, excludes, log_config, upload_checkpoints, save_checkpoints, upload_timeout)