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: Finishes and closes the W&B run.
  Save run history data as field if configured to do that.
docstr_tok: ["Finishes","and","closes","the","W","&","B","run",".","Save","run","history","data","as","field","if","configured","to","do","that","."]
code: def finish(self):
      """Finishes and closes the W&B run.
      Save run history data as field if configured to do that.
      """
      if self.save_run_history:
          history = self.wandb_run.history._data
          self.run_history = history
      if self.wandb_run is not None:
          self.wandb_run.finish()
  
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 4 for calling the WandbLogger obj's underlying member method code with example usage: obj.finish() without return types