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: Log data to W&B.
  
  Parameters
  ----------
  data: dict
      the data to be logged to W&B
  step: int
      the step number at which the data is to be logged
  dataset_id: int or str, optional (default None)
      the unique id of the dataset to differentiate during logging.
      Typically used when there are multiple ValidationCallbacks with
      different datasets.
docstr_tok: ["Log","data","to","W","&","B",".","Parameters","--","--","--","--","--","data",":","dict","the","data","to","be","logged","to","W","&","B","step",":","int","the","step","number","at","which","the","data","is","to","be","logged","dataset_id",":","int","or","str",",","optional","(","default","None",")","the","unique","id","of","the","dataset","to","differentiate","during","logging",".","Typically","used","when","there","are","multiple","ValidationCallbacks","with","different","datasets","."]
code: def log_data(
      self,
      data: Dict,
      step: int,
      dataset_id: Optional[Union[int, str]] = None,
  ):
      """Log data to W&B.
  
      Parameters
      ----------
      data: dict
          the data to be logged to W&B
      step: int
          the step number at which the data is to be logged
      dataset_id: int or str, optional (default None)
          the unique id of the dataset to differentiate during logging.
          Typically used when there are multiple ValidationCallbacks with
          different datasets.
      """
      if dataset_id is not None:
          if dataset_id in self.dataset_ids:
              for key in list(data.keys()):
                  idx = self.dataset_ids.index(dataset_id)
                  new_key = str(key) + "_(" + str(idx) + ")"
                  data[new_key] = data.pop(key)
          else:
              self.dataset_ids.append(dataset_id)
              for key in list(data.keys()):
                  idx = self.dataset_ids.index(dataset_id)
                  new_key = str(key) + "_(" + str(idx) + ")"
                  data[new_key] = data.pop(key)
  
      # log data
      self.wandb_run.log(data, step=step)
  
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 3 for calling the WandbLogger obj's underlying member method code with example usage: obj.log_data(data, step, dataset_id) without return types