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

RemovableEventHandle

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

Shortcut method to attach OptimizerParamsHandler to the logger.

Parameters
  • 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

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 (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

RemovableEventHandle

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

Base handler for logging optimizer parameters

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

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

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

Helper handler to log model’s weights as histograms.

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

Helper handler to log model’s weights as scalars.

Parameters