Loading...
Searching...
No Matches
opennn::LevenbergMarquardt Class Referencefinal

#include <opennn/training/levenberg_marquardt.h>

Inheritance diagram for opennn::LevenbergMarquardt:
opennn::Optimizer

Public Types

enum  DataSlot { ParameterUpdate }
 
- Public Types inherited from opennn::Optimizer
using StoppingCondition = opennn::StoppingCondition
 

Public Member Functions

 LevenbergMarquardt (Loss *=nullptr)
 
void set_damping_parameter_factor (const float)
 
void set_minimum_loss_decrease (const float new_minimum_loss_decrease)
 
TrainingResult train () override
 
void from_JSON (const JsonDocument &) override
 
void to_JSON (JsonWriter &) const override
 
- Public Member Functions inherited from opennn::Optimizer
 Optimizer (Loss *=nullptr)
 
virtual ~Optimizer ()
 
const Loss * get_loss () const noexcept
 
bool get_display () const noexcept
 
void set (Loss *new_loss)
 
virtual void set_display (bool new_display)
 
void set_display_period (const Index new_display_period)
 
void set_workers_number (int new_workers_number)
 
void set_cuda_graph (bool enabled)
 
bool get_cuda_graph_capture_failed () const noexcept
 
void set_shuffle (bool enabled)
 
void set_batch_pool_size (int size)
 
void set_maximum_epochs (const Index new_maximum_epochs)
 
Index get_maximum_epochs () const noexcept
 
void set_maximum_time (const float new_maximum_time)
 
void set_loss_goal (const float new_loss_goal)
 
void set_maximum_validation_failures (const Index new_maximum_validation_failures)
 
void set_validation_period (const Index n)
 
void set_restore_best (bool enabled)
 
void set_gradient_clip_norm (const float new_clip)
 
void set_joint_gradient_arena (bool enabled) noexcept
 
Index get_batch_size () const noexcept
 
void set_batch_size (const Index new_batch_size)
 
virtual void configure_for_task (NetworkTask)
 
Index get_maximum_batch_size () const
 
const string & get_name () const noexcept
 
void save (const filesystem::path &) const
 
void load (const filesystem::path &)
 

Additional Inherited Members

- Public Attributes inherited from opennn::Optimizer
function< void(Index, float, float, Network *)> post_epoch_callback
 
function< void(Network *)> post_batch_callback
 
function< void(Index, float)> post_best_callback
 
- Protected Types inherited from opennn::Optimizer
enum class  UpdateMode { Standard , Capturable }
 
- Protected Member Functions inherited from opennn::Optimizer
void set_names ()
 
void prepare_training_artifacts ()
 
Index get_epoch_budget () const noexcept
 
optional< StoppingCondition > find_stopping_condition (const EpochReport &, float minimum_loss_decrease=-MAX) const
 
void close_training_result (TrainingResult &, const EpochReport &, bool has_validation) const
 
void update_best_parameters (Network *, float, Index, Index &, BestModelSnapshot &)
 
void restore_best_parameters (Network *, TrainingResult &, const BestModelSnapshot &)
 
void write_common_json (JsonWriter &) const
 
void read_common_json (const Json *)
 
void setup_device_training ()
 
void teardown_device_training ()
 
void warmup_device_training (TrainingContext &, ThreadSafeQueue< Batch * > &, const vector< vector< Index > > &, const FeatureSelection &, TrainingSession &, OptimizerData &, ForwardPropagation *validation_forward_propagation=nullptr, ThreadSafeQueue< Batch * > *validation_empty_queue=nullptr, const vector< vector< Index > > *validation_batches=nullptr)
 
void prefetch_batch (Batch &)
 
void sync_device (bool on_gpu, bool has_recurrent_layers, TrainingSession &)
 
bool should_display (Index epoch) const noexcept
 
void display_epoch_results (Index epoch, float training_error, float training_accuracy, float validation_error, float validation_accuracy, bool has_validation, bool validation_fresh, bool is_token_cross_entropy, float elapsed_time) const
 
void setup_batch_pools (BatchPools &pools, Dataset &dataset, Network &network, Index training_batch_size, Index validation_batch_size, bool has_validation, TrainingSession &training_session)
 
unique_ptr< BatchPrefetchSession > start_batch_prefetch (ThreadSafeQueue< Batch * > &, const vector< vector< Index > > &, const FeatureSelection &, FillMode, WorkerProfileCounters *profile_counters=nullptr)
 
int get_batch_pool_size (const Network &) const
 
Loss::EvaluationResult run_epoch_loop (EpochLoopContext &)
 
void prepare_full_batch_training (FullBatchContext &, const char *banner)
 
TrainingResult train_full_batch (FullBatchContext &, const FullBatchHooks &)
 
virtual string get_display_name () const
 
virtual void setup_optimizer_data (OptimizerData &, Index, Device)
 
virtual void update_parameters (BackPropagation &, OptimizerData &, UpdateMode=UpdateMode::Standard)
 
virtual bool supports_cuda_graph () const noexcept
 
bool network_has_active_dropout () const
 
bool can_use_cuda_graph () const
 
virtual void on_epoch_begin (Index, OptimizerData &)
 
bool uses_joint_gradient_arena () const noexcept
 
Loss::EvaluationResult run_graph_epoch (TrainingSession &, OptimizerData &, ForwardPropagation &, BackPropagation &, ThreadSafeQueue< Batch * > &, const vector< vector< Index > > &, const FeatureSelection &)
 
Loss::EvaluationResult train_epoch (TrainingContext &, ThreadSafeQueue< Batch * > &, const vector< vector< Index > > &, const FeatureSelection &, TrainingSession &, OptimizerData &)
 
Loss::EvaluationResult evaluate_epoch (ForwardPropagation &, ThreadSafeQueue< Batch * > &, const vector< vector< Index > > &, const FeatureSelection &, TrainingSession &)
 
- Static Protected Member Functions inherited from opennn::Optimizer
static void clip_gradient_norm (BackPropagation &, float)
 
- Protected Attributes inherited from opennn::Optimizer
Loss * loss = nullptr
 
float training_loss_goal = 0.0f
 
Index maximum_validation_failures = numeric_limits<Index>::max()
 
Index validation_period = 1
 
float gradient_clip_norm = 0.0f
 
bool joint_gradient_arena = false
 
bool restore_best = true
 
Index maximum_epochs = 10000
 
Index batch_size = 0
 
float maximum_time = 360000.0f
 
Index display_period = 10
 
bool display = true
 
bool shuffle_samples = true
 
int batch_pool_size_override = 0
 
int workers_number = default_workers_number
 
bool use_cuda_graph = false
 
bool cuda_graph_capture_failed = false
 
string name
 
- Static Protected Attributes inherited from opennn::Optimizer
static const int default_workers_number
 

Member Enumeration Documentation

◆ DataSlot

Enumerator
ParameterUpdate 

Constructor & Destructor Documentation

◆ LevenbergMarquardt()

opennn::LevenbergMarquardt::LevenbergMarquardt ( Loss * = nullptr)
explicit

Member Function Documentation

◆ from_JSON()

void opennn::LevenbergMarquardt::from_JSON ( const JsonDocument & )
overridevirtual

Reimplemented from opennn::Optimizer.

◆ set_damping_parameter_factor()

void opennn::LevenbergMarquardt::set_damping_parameter_factor ( const float )

◆ set_minimum_loss_decrease()

void opennn::LevenbergMarquardt::set_minimum_loss_decrease ( const float new_minimum_loss_decrease)
inline

◆ to_JSON()

void opennn::LevenbergMarquardt::to_JSON ( JsonWriter & ) const
overridevirtual

Reimplemented from opennn::Optimizer.

◆ train()

TrainingResult opennn::LevenbergMarquardt::train ( )
overridevirtual

Reimplemented from opennn::Optimizer.