train
The segmentation neural network training logic.
kelp.nn.training.train.main
Main entrypoint for model training.
Source code in kelp/nn/training/train.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
|
kelp.nn.training.train.make_callbacks
A factory method for creating lightning callbacks.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
output_dir |
Path
|
The output directory. |
required |
early_stopping_patience |
int
|
The early stopping patience in epochs. |
3
|
save_top_k |
int
|
The number of top model checkpoints to save. |
1
|
monitor_metric |
str
|
The metric to monitor for early stopping. |
'val/dice'
|
monitor_mode |
str
|
The mode to monitor for early stopping. |
'max'
|
swa |
bool
|
A flag indicating whether to use SWA (Stochastic Weight Averaging). |
False
|
swa_lr |
float
|
The final learning rate for SWA annealing. |
3e-05
|
swa_epoch_start |
float
|
The percentage of all training epochs when to start the SWA. |
0.5
|
swa_annealing_epochs |
int
|
The number of epochs to run the SWA for. |
10
|
Source code in kelp/nn/training/train.py
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 |
|
kelp.nn.training.train.make_loggers
Factory method for creating lightning loggers.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
experiment |
str
|
The experiment name. |
required |
tags |
Dict[str, Any]
|
The experiment tags. |
required |
Source code in kelp/nn/training/train.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|