MODULE

IVORY.NNABLA.TRAINER

The ivory.nnabla.trainer module provides the Trainer class for nnable.

Classes
  • Trainer Trainer(epoch: int = -1, epochs: int = 1, global_step: int = -1, batch_size: int = 32, shuffle: bool = True, dataloaders: str = 'ivory.nnabla.data.DataLoaders', verbose: int = 1, loss: Union[Callable, NoneType] = None, gpu: bool = False, precision: int = 32, amp_level: str = 'O1')</>
dataclass

ivory.nnabla.trainer.Trainer(epoch=-1, epochs=1, global_step=-1, batch_size=32, shuffle=True, dataloaders='ivory.nnabla.data.DataLoaders', verbose=1, loss=None, gpu=False, precision=32, amp_level='O1')

Trainer(epoch: int = -1, epochs: int = 1, global_step: int = -1, batch_size: int = 32, shuffle: bool = True, dataloaders: str = 'ivory.nnabla.data.DataLoaders', verbose: int = 1, loss: Union[Callable, NoneType] = None, gpu: bool = False, precision: int = 32, amp_level: str = 'O1')

Parameters
  • epoch (int, optional)
  • epochs (int, optional)
  • global_step (int, optional)
  • batch_size (int, optional)
  • shuffle (bool, optional)
  • dataloaders (str, optional)
  • verbose (int, optional)
  • loss (callable, optional)
  • gpu (bool, optional)
  • precision (int, optional)
  • amp_level (str, optional)
Attributes
  • amp_level (str)
  • batch_size (int)
  • dataloaders (str)
  • epoch (int)
  • epochs (int)
  • global_step (int)
  • gpu (bool)
  • loss (callable, optional)
  • precision (int)
  • shuffle (bool)
  • verbose (int)
Methods
  • start(run) Starts a train or test loop.</>
  • test_step(run, index, input, target) Performs a single test step.</>
  • train_step(run, index, input, target) Performs a single train step.</>
  • val_step(run, index, input, target) Performs a single validation step.</>
method

start(run)

Starts a train or test loop.

Parameters
  • run (Run) a run instance.
method

train_step(run, index, input, target)

Performs a single train step.

Parameters
  • run (Run)
  • index
  • input
  • target
method

val_step(run, index, input, target)

Performs a single validation step.

Parameters
  • run (Run)
  • index
  • input
  • target
method

test_step(run, index, input, target)

Performs a single test step.

Parameters
  • run (Run)
  • index
  • input
  • target