class_docstr: `Polyaxon tracking client <https://polyaxon.com/>`_ handler to log parameters and metrics during the training
  and validation.
  
  This class requires `polyaxon <https://github.com/polyaxon/polyaxon/>`_ package to be installed:
  
  .. code-block:: bash
  
      pip install polyaxon
  
      // If you are using polyaxon v0.x
  
      pip install polyaxon-client
  
  Args:
      args: Positional arguments accepted from
          `Experiment <https://polyaxon.com/docs/experimentation/tracking/client/>`_.
      kwargs: Keyword arguments accepted from
          `Experiment <https://polyaxon.com/docs/experimentation/tracking/client/>`_.
  
  Examples:
      .. code-block:: python
  
          from ignite.contrib.handlers.polyaxon_logger import *
  
          # Create a logger
          plx_logger = PolyaxonLogger()
  
          # Log experiment parameters:
          plx_logger.log_inputs(**{
              "seed": seed,
              "batch_size": batch_size,
              "model": model.__class__.__name__,
  
              "pytorch version": torch.__version__,
              "ignite version": ignite.__version__,
              "cuda version": torch.version.cuda,
              "device name": torch.cuda.get_device_name(0)
          })
  
          # Attach the logger to the trainer to log training loss at each iteration
          plx_logger.attach_output_handler(
              trainer,
              event_name=Events.ITERATION_COMPLETED,
              tag="training",
              output_transform=lambda loss: {"loss": loss}
          )
  
          # Attach the logger to the evaluator on the training dataset and log NLL, Accuracy metrics after each epoch
          # We setup `global_step_transform=global_step_from_engine(trainer)` to take the epoch
          # of the `trainer` instead of `train_evaluator`.
          plx_logger.attach_output_handler(
              train_evaluator,
              event_name=Events.EPOCH_COMPLETED,
              tag="training",
              metric_names=["nll", "accuracy"],
              global_step_transform=global_step_from_engine(trainer),
          )
  
          # Attach the logger to the evaluator on the validation dataset and log NLL, Accuracy metrics after
          # each epoch. We setup `global_step_transform=global_step_from_engine(trainer)` to take the epoch of the
          # `trainer` instead of `evaluator`.
          plx_logger.attach_output_handler(
              evaluator,
              event_name=Events.EPOCH_COMPLETED,
              tag="validation",
              metric_names=["nll", "accuracy"],
              global_step_transform=global_step_from_engine(trainer)),
          )
  
          # Attach the logger to the trainer to log optimizer's parameters, e.g. learning rate at each iteration
          plx_logger.attach_opt_params_handler(
              trainer,
              event_name=Events.ITERATION_STARTED,
              optimizer=optimizer,
              param_name='lr'  # optional
          )
          # to manually end a run
          plx_logger.close()
class_docstr_tok: ["`","Polyaxon","tracking","client","<","https",":","\/\/polyaxon.com\/",">","`","_","handler","to","log","parameters","and","metrics","during","the","training","and","validation",".","This","class","requires","`","polyaxon","<","https",":","\/\/github.com\/polyaxon\/polyaxon\/",">","`","_","package","to","be","installed",":","..","code-block",":",":","bash","pip","install","polyaxon","\/\/","If","you","are","using","polyaxon","v0.x","pip","install","polyaxon-client","Args",":","args",":","Positional","arguments","accepted","from","`","Experiment","<","https",":","\/\/polyaxon.com\/docs\/experimentation\/tracking\/client\/",">","`","_",".","kwargs",":","Keyword","arguments","accepted","from","`","Experiment","<","https",":","\/\/polyaxon.com\/docs\/experimentation\/tracking\/client\/",">","`","_",".","Examples",":","..","code-block",":",":","python","from","ignite.contrib.handlers.polyaxon_logger","import","*","#","Create","a","logger","plx_logger","=","PolyaxonLogger","(",")","#","Log","experiment","parameters",":","plx_logger.log_inputs","(","*","*","{","``","seed","''",":","seed",",","``","batch_size","''",":","batch_size",",","``","model","''",":","model.__class__.__name__",",","``","pytorch","version","''",":","torch.__version__",",","``","ignite","version","''",":","ignite.__version__",",","``","cuda","version","''",":","torch.version.cuda",",","``","device","name","''",":","torch.cuda.get_device_name","(","0",")","}",")","#","Attach","the","logger","to","the","trainer","to","log","training","loss","at","each","iteration","plx_logger.attach_output_handler","(","trainer",",","event_name=Events.ITERATION_COMPLETED",",","tag=","''","training","''",",","output_transform=lambda","loss",":","{","``","loss","''",":","loss","}",")","#","Attach","the","logger","to","the","evaluator","on","the","training","dataset","and","log","NLL",",","Accuracy","metrics","after","each","epoch","#","We","setup","`","global_step_transform=global_step_from_engine","(","trainer",")","`","to","take","the","epoch","#","of","the","`","trainer","`","instead","of","`","train_evaluator","`",".","plx_logger.attach_output_handler","(","train_evaluator",",","event_name=Events.EPOCH_COMPLETED",",","tag=","''","training","''",",","metric_names=","[","``","nll","''",",","``","accuracy","''","]",",","global_step_transform=global_step_from_engine","(","trainer",")",",",")","#","Attach","the","logger","to","the","evaluator","on","the","validation","dataset","and","log","NLL",",","Accuracy","metrics","after","#","each","epoch",".","We","setup","`","global_step_transform=global_step_from_engine","(","trainer",")","`","to","take","the","epoch","of","the","#","`","trainer","`","instead","of","`","evaluator","`",".","plx_logger.attach_output_handler","(","evaluator",",","event_name=Events.EPOCH_COMPLETED",",","tag=","''","validation","''",",","metric_names=","[","``","nll","''",",","``","accuracy","''","]",",","global_step_transform=global_step_from_engine","(","trainer",")",")",",",")","#","Attach","the","logger","to","the","trainer","to","log","optimizer","'s","parameters",",","e.g",".","learning","rate","at","each","iteration","plx_logger.attach_opt_params_handler","(","trainer",",","event_name=Events.ITERATION_STARTED",",","optimizer=optimizer",",","param_name='lr","'","#","optional",")","#","to","manually","end","a","run","plx_logger.close","(",")"]
code: def _create_opt_params_handler(
      self, *args: Any, **kwargs: Any
  ) -> "OptimizerParamsHandler":
      return OptimizerParamsHandler(*args, **kwargs)
  
file_path: ignite/ignite/contrib/handlers/polyaxon_logger.py
imports: from typing import Any, Callable, List, Optional, Union
  from torch.optim import Optimizer
  from ignite.contrib.handlers.base_logger import BaseLogger, BaseOptimizerParamsHandler, BaseOutputHandler
  from ignite.engine import Engine, Events
  from ignite.handlers import global_step_from_engine
label_desc: Use image node_id 5 for calling the PolyaxonLogger obj's underlying member method code with example usage: obj._create_opt_params_handler() and returns: OptimizerParamsHandler