|
Mila
Deep Neural Network Library
|
Runtime behavioral mode for training-built Components. More...
#include <cstdint>Namespaces | |
| namespace | Mila |
| Mila main API namespace. | |
Enumerations | |
| enum class | Mila::Dnn::TrainingMode : uint8_t { Normal , Eval } |
| Runtime behavioral state for Components built with RuntimeMode::Training. More... | |
Runtime behavioral mode for training-built Components.
|
exportstrong |
Runtime behavioral state for Components built with RuntimeMode::Training.
TrainingMode governs the runtime behavioral state of a Component that was built with RuntimeMode::Training. It is orthogonal to RuntimeMode – RuntimeMode is a build-time allocation policy while TrainingMode is a runtime behavioral toggle.
| TrainingMode | Gradients | Dropout | Batch Norm |
|---|---|---|---|
| Normal | active | on | uses batch stats |
| Eval | inactive | off | uses running stats |
TrainingMode is only meaningful on Components built with RuntimeMode::Training. Calling setTrainingMode() on a Component built with RuntimeMode::Inference throws std::runtime_error.
Model drives transitions via Network::setTrainingMode() – the toggle is never exposed directly to the user.
| Enumerator | |
|---|---|
| Normal | Gradients active, dropout on, batch norm uses batch stats. |
| Eval | No gradients, dropout off, batch norm uses running stats. |