Shortcuts

Tools

FrozenClass

class catalyst.tools.frozen_class.FrozenClass[source]

Bases: object

Class which prohibit __setattr__ on existing attributes.

Examples

>>> class IRunner(FrozenClass):

MetricHandler

class catalyst.tools.metric_handler.MetricHandler(minimize: bool = True, min_delta: float = 1e-06)[source]

Bases: object

@TODO: docs.

Parameters
  • minimize – @TODO: docs

  • min_delta – @TODO: docs

__init__(minimize: bool = True, min_delta: float = 1e-06)[source]

Init.

ModelForwardWrapper

class catalyst.tools.forward_wrapper.ModelForwardWrapper(model, method_name)[source]

Bases: torch.nn.modules.module.Module

Model that calls specified method instead of forward.

Parameters
  • model – @TODO: docs

  • method_name – @TODO: docs

(Workaround, single method tracing is not supported)

__init__(model, method_name)[source]

Init

forward(*args, **kwargs)[source]

Forward pass.

Parameters
  • *args – some args

  • **kwargs – some kwargs

Returns

specified method output

Return type

output

training: bool

TimeManager

class catalyst.tools.time_manager.TimeManager[source]

Bases: object

@TODO: Docs. Contribution is welcome.

__init__()[source]

Initialization

reset() None[source]

Reset all previous timers.

start(name: str) None[source]

Starts timer name.

Parameters

name – name of a timer

stop(name: str) None[source]

Stops timer name.

Parameters

name – name of a timer