Shortcuts

base_logger#

Base logger and its helper handlers.

Classes

BaseHandler

Base handler for defining various useful handlers.

BaseLogger

Base logger handler.

BaseOptimizerParamsHandler

Base handler for logging optimizer parameters

BaseOutputHandler

Helper handler to log engine's output and/or metrics

BaseWeightsHistHandler

Helper handler to log model's weights as histograms.

BaseWeightsScalarHandler

Helper handler to log model's weights as scalars.

class ignite.contrib.handlers.base_logger.BaseHandler[source]#

Base handler for defining various useful handlers.

class ignite.contrib.handlers.base_logger.BaseLogger[source]#

Base logger handler. See implementations: TensorboardLogger, VisdomLogger, PolyaxonLogger, MLflowLogger, …

attach(engine, log_handler, event_name, *args, **kwargs)[source]#

Attach the logger to the engine and execute log_handler function at event_name events.

Parameters
Returns

RemovableEventHandle, which can be used to remove the handler.

Return type

ignite.engine.events.RemovableEventHandle

attach_opt_params_handler(engine, event_name, *args, **kwargs)[source]#

Shortcut method to attach OptimizerParamsHandler to the logger.

Parameters
  • engine (ignite.engine.engine.Engine) – engine object.

  • event_name (Any) – event to attach the logging handler to. Valid events are from Events or any event_name added by register_events().

  • args (Any) – args to initialize OptimizerParamsHandler

  • kwargs (Any) – kwargs to initialize OptimizerParamsHandler

Returns

RemovableEventHandle, which can be used to remove the handler.

Return type

ignite.engine.events.RemovableEventHandle

Changed in version 0.4.3: Added missing return statement.

attach_output_handler(engine, event_name, *args, **kwargs)[source]#

Shortcut method to attach OutputHandler to the logger.

Parameters
  • engine (ignite.engine.engine.Engine) – engine object.

  • event_name (Any) – event to attach the logging handler to. Valid events are from Events or any event_name added by register_events().

  • args (Any) – args to initialize OutputHandler

  • kwargs (Any) – kwargs to initialize OutputHandler

Returns

RemovableEventHandle, which can be used to remove the handler.

Return type

ignite.engine.events.RemovableEventHandle

class ignite.contrib.handlers.base_logger.BaseOptimizerParamsHandler(optimizer, param_name='lr', tag=None)[source]#

Base handler for logging optimizer parameters

Parameters
  • optimizer (torch.optim.optimizer.Optimizer) –

  • param_name (str) –

  • tag (Optional[str]) –

class ignite.contrib.handlers.base_logger.BaseOutputHandler(tag, metric_names=None, output_transform=None, global_step_transform=None)[source]#

Helper handler to log engine’s output and/or metrics

Parameters
  • tag (str) –

  • metric_names (Optional[Union[str, List[str]]]) –

  • output_transform (Optional[Callable]) –

  • global_step_transform (Optional[Callable]) –

class ignite.contrib.handlers.base_logger.BaseWeightsHistHandler(model, tag=None)[source]#

Helper handler to log model’s weights as histograms.

Parameters
  • model (torch.nn.modules.module.Module) –

  • tag (Optional[str]) –

class ignite.contrib.handlers.base_logger.BaseWeightsScalarHandler(model, reduction=<function norm>, tag=None)[source]#

Helper handler to log model’s weights as scalars.

Parameters
  • model (torch.nn.modules.module.Module) –

  • reduction (Callable) –

  • tag (Optional[str]) –