High-level orchestrator pairing a Loss with an Optimizer for a network/dataset.
More...
#include <training_strategy.h>
High-level orchestrator pairing a Loss with an Optimizer for a network/dataset.
◆ TrainingStrategy()
Constructs the strategy with default loss (MSE) and optimizer (Adam) bound to the given network and dataset.
◆ from_JSON()
| void opennn::TrainingStrategy::from_JSON |
( |
const JsonDocument & | | ) |
|
Restores the full strategy (loss + optimizer configurations) from a JSON document.
◆ get_dataset() [1/2]
| Dataset * opennn::TrainingStrategy::get_dataset |
( |
| ) |
|
|
inline |
◆ get_dataset() [2/2]
| const Dataset * opennn::TrainingStrategy::get_dataset |
( |
| ) |
const |
|
inline |
◆ get_loss() [1/2]
| Loss * opennn::TrainingStrategy::get_loss |
( |
| ) |
|
|
inline |
◆ get_loss() [2/2]
| const Loss * opennn::TrainingStrategy::get_loss |
( |
| ) |
const |
|
inline |
◆ get_neural_network() [1/2]
◆ get_neural_network() [2/2]
| const NeuralNetwork * opennn::TrainingStrategy::get_neural_network |
( |
| ) |
const |
|
inline |
◆ get_optimization_algorithm() [1/2]
| Optimizer * opennn::TrainingStrategy::get_optimization_algorithm |
( |
| ) |
|
|
inline |
◆ get_optimization_algorithm() [2/2]
| const Optimizer * opennn::TrainingStrategy::get_optimization_algorithm |
( |
| ) |
const |
|
inline |
◆ load()
| void opennn::TrainingStrategy::load |
( |
const filesystem::path & | | ) |
|
Loads the strategy configuration from a JSON file at the given path.
◆ save()
| void opennn::TrainingStrategy::save |
( |
const filesystem::path & | | ) |
const |
Writes the strategy configuration to a JSON file at the given path.
◆ set()
Rebinds the strategy to a new network/dataset, resetting loss and optimizer to defaults.
◆ set_dataset()
| void opennn::TrainingStrategy::set_dataset |
( |
Dataset * | new_dataset | ) |
|
|
inline |
◆ set_default()
| void opennn::TrainingStrategy::set_default |
( |
| ) |
|
Resets the loss and optimizer to their default types and hyperparameters.
◆ set_loss()
| void opennn::TrainingStrategy::set_loss |
( |
const string & | | ) |
|
Replaces the current loss with one selected by name (e.g. "MeanSquaredError", "CrossEntropy").
◆ set_neural_network()
| void opennn::TrainingStrategy::set_neural_network |
( |
NeuralNetwork * | new_neural_network | ) |
|
|
inline |
◆ set_optimization_algorithm()
| void opennn::TrainingStrategy::set_optimization_algorithm |
( |
const string & | | ) |
|
Replaces the current optimizer with one selected by name (e.g. "Adam", "SGD", "QuasiNewton", "LM").
◆ to_JSON()
| void opennn::TrainingStrategy::to_JSON |
( |
JsonWriter & | | ) |
const |
Serializes the full strategy (loss + optimizer configurations) to JSON.
◆ train()
Runs the configured optimizer against the configured loss and returns the training history.