DLPrimitives
|
Public Member Functions | |
SGD (Context &ctx, DataType dtype=float_data) | |
void | init (Net &n, ExecutionContext const &q) |
Prepare solver - takes all parameters that need to be trained and prepares buffers. | |
void | zero_grad (Net &n, ExecutionContext const &e) |
zero all gradients before accumulating them for next batch | |
void | apply (Net &n, ExecutionContext const &e) |
apply solver updates | |
Public Member Functions inherited from dlprim::solvers::SolverBase | |
void | step (Net &n, ExecutionContext const &e) |
shortcut for single training step zero_grad, forward, backward, apply | |
Public Attributes | |
float | lr = 0.1 |
float | momentum = 0.9 |
float | weight_decay = 0.0005 |