class_docstr: WandB logger to manage logging of experiments
  parameters, metrics update, models log, gradient
  values and other information. The logger will log
  all run into the same experiment.
  
  Args:
      name(str): Display name for the run.
      group (Optional[str]): Specify a group to organize individual runs into a larger experiment
      config (Optional[Dict]): A dictionary summarizing the configuration
          related to the current run.
      save_dir(str): Path where data is saved (wandb dir by default).
      offline(bool): Run logger offline to later stream data to a remote server.
      id(str): Sets the version, mainly used to resume a previous run.
      version(str): Same as id.
      anonymous(bool): Enables or explicitly disables anonymous logging.
      project(str): The project's name to which this run will belong.
      experiment: WandB run to use instead of creating a new one. The other WandB's configuration
          parameters will be ignored.
      batch_granularity(bool): Whether to also output the result of each batch in addition to the epochs.
          (Default value = False).
      checkpoints_path (Optional[str]): A path leading to the checkpoint saving directory.
          You need to specify this argument to log the model checkpoints at the end of the training phase.
      initial_artifacts_paths (Optional[List[str]]): a list of paths leading to artifacts
          to be logged before the start of the training.
      log_gradient_frequency(int): log gradients and parameters every N batches (Default value = None).
      training_batch_shape(tuples): Shape of a training batch. Used for logging architecture on wandb.
  
  Example:
      .. code-block:: python
  
          wandb_logger = pt.WandBLogger(name="A run", project="A project")
          config_dict = {"Optimizer": "sgd", "Loss": "Cross-Entropy", "lr": 0.01}
          wandb_logger.log_config_params(config_params=config_dict)  # logging the config dictionary
          # our Poutyne experiment
          experiment = pt.Experiment(
              directory="a/path",
              network=network,
              device="cpu",
              optimizer="sgd",
              loss_function="cross_entropy",
              batch_metrics=["accuracy"],
          )
          # Using the WandB logger callback during training
          experiment.train(
              train_generator=train_loader, valid_generator=valid_loader, epochs=2, seed=42, callbacks=[wandb_logger]
          )
          # You can access the wandb run via the attribute .run if you want to use other wandb features
          image = wandb.Image('a/image.png', caption="a caption")
          wandb_logger.run.log({"My image": image})
  
          wandb.finish()  # Call once your finished with your experiment.
class_docstr_tok: ["WandB","logger","to","manage","logging","of","experiments","parameters",",","metrics","update",",","models","log",",","gradient","values","and","other","information",".","The","logger","will","log","all","run","into","the","same","experiment",".","Args",":","name","(","str",")",":","Display","name","for","the","run",".","group","(","Optional","[","str","]",")",":","Specify","a","group","to","organize","individual","runs","into","a","larger","experiment","config","(","Optional","[","Dict","]",")",":","A","dictionary","summarizing","the","configuration","related","to","the","current","run",".","save_dir","(","str",")",":","Path","where","data","is","saved","(","wandb","dir","by","default",")",".","offline","(","bool",")",":","Run","logger","offline","to","later","stream","data","to","a","remote","server",".","id","(","str",")",":","Sets","the","version",",","mainly","used","to","resume","a","previous","run",".","version","(","str",")",":","Same","as","id",".","anonymous","(","bool",")",":","Enables","or","explicitly","disables","anonymous","logging",".","project","(","str",")",":","The","project","'s","name","to","which","this","run","will","belong",".","experiment",":","WandB","run","to","use","instead","of","creating","a","new","one",".","The","other","WandB","'s","configuration","parameters","will","be","ignored",".","batch_granularity","(","bool",")",":","Whether","to","also","output","the","result","of","each","batch","in","addition","to","the","epochs",".","(","Default","value","=","False",")",".","checkpoints_path","(","Optional","[","str","]",")",":","A","path","leading","to","the","checkpoint","saving","directory",".","You","need","to","specify","this","argument","to","log","the","model","checkpoints","at","the","end","of","the","training","phase",".","initial_artifacts_paths","(","Optional","[","List","[","str","]","]",")",":","a","list","of","paths","leading","to","artifacts","to","be","logged","before","the","start","of","the","training",".","log_gradient_frequency","(","int",")",":","log","gradients","and","parameters","every","N","batches","(","Default","value","=","None",")",".","training_batch_shape","(","tuples",")",":","Shape","of","a","training","batch",".","Used","for","logging","architecture","on","wandb",".","Example",":","..","code-block",":",":","python","wandb_logger","=","pt.WandBLogger","(","name=","''","A","run","''",",","project=","''","A","project","''",")","config_dict","=","{","``","Optimizer","''",":","``","sgd","''",",","``","Loss","''",":","``","Cross-Entropy","''",",","``","lr","''",":","0.01","}","wandb_logger.log_config_params","(","config_params=config_dict",")","#","logging","the","config","dictionary","#","our","Poutyne","experiment","experiment","=","pt.Experiment","(","directory=","''","a\/path","''",",","network=network",",","device=","''","cpu","''",",","optimizer=","''","sgd","''",",","loss_function=","''","cross_entropy","''",",","batch_metrics=","[","``","accuracy","''","]",",",")","#","Using","the","WandB","logger","callback","during","training","experiment.train","(","train_generator=train_loader",",","valid_generator=valid_loader",",","epochs=2",",","seed=42",",","callbacks=","[","wandb_logger","]",")","#","You","can","access","the","wandb","run","via","the","attribute",".run","if","you","want","to","use","other","wandb","features","image","=","wandb.Image","(","'","a\/image.png","'",",","caption=","''","a","caption","''",")","wandb_logger.run.log","(","{","``","My","image","''",":","image","}",")","wandb.finish","(",")","#","Call","once","your","finished","with","your","experiment","."]
docstr: Log artifacts for a specific step.
  This function logs multiple artifacts under the same artifact group. if
  you wish to log multiple artifacts alone (i.e. under different artifact
  groups), you should make multiple calls to this function.
  Args:
      paths (List[str]): A list of paths leading to the directories or files
          that are to be logged.
      name (str): The artifact group name.
      artifact_type (str): The artifact group type.
docstr_tok: ["Log","artifacts","for","a","specific","step",".","This","function","logs","multiple","artifacts","under","the","same","artifact","group",".","if","you","wish","to","log","multiple","artifacts","alone","(","i.e",".","under","different","artifact","groups",")",",","you","should","make","multiple","calls","to","this","function",".","Args",":","paths","(","List","[","str","]",")",":","A","list","of","paths","leading","to","the","directories","or","files","that","are","to","be","logged",".","name","(","str",")",":","The","artifact","group","name",".","artifact_type","(","str",")",":","The","artifact","group","type","."]
code: def _log_artifacts(
      self, paths: List[str], name: str, artifact_type: str
  ) -> None:
      """
      Log artifacts for a specific step.
      This function logs multiple artifacts under the same artifact group. if
      you wish to log multiple artifacts alone (i.e. under different artifact
      groups), you should make multiple calls to this function.
      Args:
          paths (List[str]): A list of paths leading to the directories or files
              that are to be logged.
          name (str): The artifact group name.
          artifact_type (str): The artifact group type.
      """
  
      artifact = wandb.Artifact(name=name, type=artifact_type)
      for path in paths:
          if not os.path.exists(path):
              raise FileNotFoundError(
                  f"The path {path} is not a file nor a directory"
              )
  
          if os.path.isdir(path):
              artifact.add_dir(path)
          elif os.path.isfile(path):
              artifact.add_file(path)
  
      self.run.log_artifact(artifact)
  
file_path: poutyne/poutyne/framework/callbacks/wandb_logger.py
imports: import os
  import warnings
  from typing import Dict, List, Optional
  import torch
  from poutyne.framework.callbacks.logger import Logger
label_desc: Use image node_id 11 for calling the WandBLogger obj's underlying member method code with example usage: obj._log_artifacts(paths, name, artifact_type) without return types