std :: ml::trainer
Struct std::TrainConfig
struct TrainConfig {
unsigned long epochs;
unsigned long batchSize;
unsigned long seed;
int shuffle;
float clipNorm;
float lrDecay;
int device;
int precision;
}Fields
shuffling
0: clip the global gradient norm to this
lr *= lrDecay after every epoch (1 = constant)
Where to train (device.h): the optimizer's parameters are placed there when fitting starts and stay there (model_to(&m, DEVICE_CPU) or model_sync brings them back). DEVICE_CPU (the default) leaves them where they are; DEVICE_AUTO picks device_default(). The dataset is uploaded once and each batch gathered on the device.
What that device's convolutions and matrix products compute in while fitting (device.h's DEVICE_FP32, DEVICE_FP16 with a dynamic loss scale, DEVICE_BF16); the device's previous precision comes back afterwards. DEVICE_PRECISION_KEEP (the default) uses the device's own setting (device_set_precision).
Methods
epochs 10, batch 32, seed 1, shuffled, no clipping, constant lr, no device change, the device's precision.