class_docstr: Weights & Biases Logger.
  
  This is a logger class that can be passed into the initialization
  of a KerasModel or TorchModel. It initializes and sets up a wandb logger which
  will log the specified metrics calculated on the specific datasets
  to the user's W&B dashboard.
  
  If a WandbLogger is provided to the wandb_logger flag,
  the metrics are logged to Weights & Biases, along with other information
  such as epoch number, losses, sample counts, and model configuration data.
class_docstr_tok: ["Weights","&","Biases","Logger",".","This","is","a","logger","class","that","can","be","passed","into","the","initialization","of","a","KerasModel","or","TorchModel",".","It","initializes","and","sets","up","a","wandb","logger","which","will","log","the","specified","metrics","calculated","on","the","specific","datasets","to","the","user","'s","W","&","B","dashboard",".","If","a","WandbLogger","is","provided","to","the","wandb_logger","flag",",","the","metrics","are","logged","to","Weights","&","Biases",",","along","with","other","information","such","as","epoch","number",",","losses",",","sample","counts",",","and","model","configuration","data","."]
docstr: Creates a WandbLogger.
  
  Parameters
  ----------
  name: str
      a display name for the run in the W&B dashboard
  entity: str
      an entity is a username or team name where you're sending the W&B run
  project: str
      the name of the project where you're sending the new W&B run
  mode: str
      W&B online or offline mode
  id: str
      a unique ID for this run, used for resuming
  resume: bool or str
      sets the resuming behavior
  anonymous: str
      controls anonymous data logging
  save_run_history: bool
      whether to save the run history to the logger at the end (for testing purposes)
docstr_tok: ["Creates","a","WandbLogger",".","Parameters","--","--","--","--","--","name",":","str","a","display","name","for","the","run","in","the","W","&","B","dashboard","entity",":","str","an","entity","is","a","username","or","team","name","where","you","'re","sending","the","W","&","B","run","project",":","str","the","name","of","the","project","where","you","'re","sending","the","new","W","&","B","run","mode",":","str","W","&","B","online","or","offline","mode","id",":","str","a","unique","ID","for","this","run",",","used","for","resuming","resume",":","bool","or","str","sets","the","resuming","behavior","anonymous",":","str","controls","anonymous","data","logging","save_run_history",":","bool","whether","to","save","the","run","history","to","the","logger","at","the","end","(","for","testing","purposes",")"]
code: def __init__(
      self,
      name: Optional[str] = None,
      entity: Optional[str] = None,
      project: Optional[str] = "deepchem",
      mode: Optional[str] = "online",
      id: Optional[str] = None,
      resume: Optional[Union[bool, str]] = None,
      anonymous: Optional[str] = "never",
      save_run_history: Optional[bool] = False,
      **kwargs,
  ):
      """Creates a WandbLogger.
  
      Parameters
      ----------
      name: str
          a display name for the run in the W&B dashboard
      entity: str
          an entity is a username or team name where you're sending the W&B run
      project: str
          the name of the project where you're sending the new W&B run
      mode: str
          W&B online or offline mode
      id: str
          a unique ID for this run, used for resuming
      resume: bool or str
          sets the resuming behavior
      anonymous: str
          controls anonymous data logging
      save_run_history: bool
          whether to save the run history to the logger at the end (for testing purposes)
      """
  
      assert (
          is_wandb_available()
      ), "WandbLogger requires wandb to be installed. Please run `pip install wandb --upgrade`"
      import wandb
  
      self._wandb = wandb
  
      if mode == "offline":
          logger.warning(
              "Note: Model checkpoints will not be uploaded to W&B in offline mode.\n"
              'Please set `mode="online"` if you need to log your model.'
          )
  
      self.save_run_history = save_run_history
  
      # set wandb init arguments
      self.wandb_init_params = dict(
          name=name,
          project=project,
          entity=entity,
          mode=mode,
          id=id,
          resume=resume,
          anonymous=anonymous,
      )
      self.wandb_init_params.update(**kwargs)
      self.initialized = False
  
      # Dataset ids are used to differentiate datasets seen by the logger
      self.dataset_ids: List[Union[int, str]] = []
  
file_path: deepchem/deepchem/models/wandblogger.py
imports: import logging
  import importlib.util
  from typing import Optional, Union, List, Dict
label_desc: Use image node_id 1 to create a new WandbLogger object from inherited base classes: object with example: obj = WandbLogger(name, entity, project, mode, id, resume, anonymous, save_run_history)