bob.ip.binseg.engine.trainer

Functions

run(model, data_loader, valid_loader, ...)

Fits an FCN model using supervised learning and save it to disk.

torch_evaluation(model)

Context manager to turn ON/OFF model evaluation

bob.ip.binseg.engine.trainer.torch_evaluation(model)[source]

Context manager to turn ON/OFF model evaluation

This context manager will turn evaluation mode ON on entry and turn it OFF when exiting the with statement block.

Parameters

model (torch.nn.Module) – Network (e.g. driu, hed, unet)

Yields

model (torch.nn.Module) – Network (e.g. driu, hed, unet)

bob.ip.binseg.engine.trainer.run(model, data_loader, valid_loader, optimizer, criterion, scheduler, checkpointer, checkpoint_period, device, arguments, output_folder)[source]

Fits an FCN model using supervised learning and save it to disk.

This method supports periodic checkpointing and the output of a CSV-formatted log with the evolution of some figures during training.

Parameters