Trainer
Trainer class to train and finetune networks
BaseTrainer
Base abstraction for a trainer. Takes network, configs and datagens, allows to fit the network based on configs
Source code in conftrainer/training/trainer.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
metrics
abstractmethod
property
Create and metrics based on config
loss
abstractmethod
property
Loss(es) to use during compilation
loss_weights
property
Define loss weights. Usable only for setting with multiple losses. Defaults to None
base_callbacks: Iterable
property
Prepare the base callbacks that are the same for pretraining and finetuning phases
get_callbacks(callback_config_list)
staticmethod
Create callbacks for the
Source code in conftrainer/training/trainer.py
prepare_train_args(conf)
Prepare the training phase parameters based on given config
Source code in conftrainer/training/trainer.py
train(conf)
Train a network based on given config
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conf |
CNNOptimizationConfig
|
training configuration to determine learning rate, batch size and other training parameters |
required |
Returns:
| Name | Type | Description |
|---|---|---|
history |
callbacks.History
|
callbacks object containing information about training process |
Source code in conftrainer/training/trainer.py
Trainer
Bases: BaseTrainer
A wrapper around tensorflow network that trains and finetunes it based on given config
Source code in conftrainer/training/trainer.py
metrics
property
Create and metrics based on config
loss
property
Loss(es) to use during compilation
predict_and_report()
Make predictions on train, test and val datasets, and save them alongside the model
Source code in conftrainer/training/trainer.py
MultiOutputTrainer
Bases: BaseTrainer
Trainer to work with multi output networks. Parses metrics and losses and wraps them into dictionaries
Source code in conftrainer/training/trainer.py
loss
property
Loss(es) to use during compilation
loss_weights
property
Parse loss weights for each branch and wrap them into a dictionary