nip.trainers.malt_pure_text._dispatch_to_trainer

nip.trainers.malt_pure_text._dispatch_to_trainer#

nip.trainers.malt_pure_text._dispatch_to_trainer(method: Callable[[Concatenate[PureTextMaltTrainer, P]], R]) Callable[[Concatenate[PureTextMaltTrainer, P]], R][source]#

Dispatch a method to the appropriate trainer.

This decorator dispatches a method either to the PureTextMaltTrainer implementation or to the PureTextEiTrainer <nip.trainers.ei_pure_text.PureTextEiTrainer> implementation, depending on the iteration number. This allows doing some rounds of Expert Iteration (EI) before doing MALT.

Parameters:

method (Callable) – The method to dispatch. This should be a method of the PureTextMaltTrainer class.

Returns:

dispatch_method (Callable) – The dispatched method, which will call either method or the base class implementation of the method, depending on the iteration number.