LBANN  0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
lbann::objective_function Class Reference

#include <objective_function.hpp>

Public Member Functions

 objective_function ()
 
 objective_function (const objective_function &other)
 
objective_functionoperator= (const objective_function &other)
 
 ~objective_function ()=default
 
objective_functioncopy () const
 
template<class Archive >
void serialize (Archive &ar)
 
void add_term (std::unique_ptr< objective_function_term > term)
 
std::vector< objective_function_term * > get_terms ()
 
void setup (model &m)
 
void start_evaluation (execution_mode mode, int mini_batch_size)
 
EvalType finish_evaluation (execution_mode mode, int mini_batch_size)
 
void differentiate ()
 
void compute_weight_regularization ()
 
void reset_statistics ()
 
void reset_statistics (execution_mode mode)
 
EvalType get_mean_value (execution_mode mode) const
 
int get_statistics_num_samples (execution_mode mode) const
 
std::vector< ViewingLayerPtrget_layer_pointers () const
 
void set_layer_pointers (std::vector< ViewingLayerPtr > layers)
 
std::vector< ViewingWeightsPtrget_weights_pointers () const
 
void set_weights_pointers (std::vector< ViewingWeightsPtr > w)
 
EvalType get_evaluation_time () const
 
EvalType get_differentiation_time () const
 
void reset_counters ()
 
void write_proto (lbann_data::ObjectiveFunction &proto) const
 

Private Attributes

std::vector< std::unique_ptr< objective_function_term > > m_terms
 
std::map< execution_mode, metric_statisticsm_statistics
 
EvalType m_evaluation_time = EvalType(0)
 
EvalType m_differentiation_time = EvalType(0)
 

Detailed Description

Objective function class.

Definition at line 36 of file objective_function.hpp.

Constructor & Destructor Documentation

◆ objective_function() [1/2]

lbann::objective_function::objective_function ( )
inline

Default constructor.

Definition at line 40 of file objective_function.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ objective_function() [2/2]

lbann::objective_function::objective_function ( const objective_function other)

Copy constructor.

◆ ~objective_function()

lbann::objective_function::~objective_function ( )
default

Destructor.

Here is the caller graph for this function:

Member Function Documentation

◆ add_term()

void lbann::objective_function::add_term ( std::unique_ptr< objective_function_term term)

Add a term to the objective function.

Here is the caller graph for this function:

◆ compute_weight_regularization()

void lbann::objective_function::compute_weight_regularization ( )

Compute the gradient of the weight regularization term. The gradient is computed w.r.t. the weights.

Here is the caller graph for this function:

◆ copy()

objective_function* lbann::objective_function::copy ( ) const
inline

Copy function.

Definition at line 49 of file objective_function.hpp.

Here is the call graph for this function:

◆ differentiate()

void lbann::objective_function::differentiate ( )

Compute the objective function gradient. The gradient is with respect to the objective function inputs

Here is the caller graph for this function:

◆ finish_evaluation()

EvalType lbann::objective_function::finish_evaluation ( execution_mode  mode,
int  mini_batch_size 
)

Complete evaluation of the objective function. The result is stored in history.

Here is the caller graph for this function:

◆ get_differentiation_time()

EvalType lbann::objective_function::get_differentiation_time ( ) const
inline

Get the time spent computing the objective function gradient.

Definition at line 117 of file objective_function.hpp.

◆ get_evaluation_time()

EvalType lbann::objective_function::get_evaluation_time ( ) const
inline

Get the time spent evaluating the objective function.

Definition at line 115 of file objective_function.hpp.

◆ get_layer_pointers()

std::vector<ViewingLayerPtr> lbann::objective_function::get_layer_pointers ( ) const

Get list of pointers to layers.

Here is the caller graph for this function:

◆ get_mean_value()

EvalType lbann::objective_function::get_mean_value ( execution_mode  mode) const

Get mean objective function value. This is a weighted average such that each mini-batch sample makes an equal contribution.

Here is the caller graph for this function:

◆ get_statistics_num_samples()

int lbann::objective_function::get_statistics_num_samples ( execution_mode  mode) const

Get number of samples for statistics.

Here is the caller graph for this function:

◆ get_terms()

std::vector<objective_function_term*> lbann::objective_function::get_terms ( )

Get list of objective function terms.

Here is the caller graph for this function:

◆ get_weights_pointers()

std::vector<ViewingWeightsPtr> lbann::objective_function::get_weights_pointers ( ) const

Get list of pointers to weights.

Here is the caller graph for this function:

◆ operator=()

objective_function& lbann::objective_function::operator= ( const objective_function other)

Copy assignment operator.

Here is the caller graph for this function:

◆ reset_counters()

void lbann::objective_function::reset_counters ( )
inline

Reset time counters.

Definition at line 119 of file objective_function.hpp.

Here is the call graph for this function:

◆ reset_statistics() [1/2]

void lbann::objective_function::reset_statistics ( )
inline

Clear all statistics.

Definition at line 88 of file objective_function.hpp.

◆ reset_statistics() [2/2]

void lbann::objective_function::reset_statistics ( execution_mode  mode)
inline

Clear statistics for an execution mode.

Definition at line 95 of file objective_function.hpp.

Here is the call graph for this function:

◆ serialize()

template<class Archive >
void lbann::objective_function::serialize ( Archive &  ar)

Archive for checkpoint and restart

Here is the caller graph for this function:

◆ set_layer_pointers()

void lbann::objective_function::set_layer_pointers ( std::vector< ViewingLayerPtr layers)

Set list of pointers to layers.

Here is the caller graph for this function:

◆ set_weights_pointers()

void lbann::objective_function::set_weights_pointers ( std::vector< ViewingWeightsPtr w)

Set list of pointers to weights.

Here is the caller graph for this function:

◆ setup()

void lbann::objective_function::setup ( model m)

Setup objective function.

Here is the caller graph for this function:

◆ start_evaluation()

void lbann::objective_function::start_evaluation ( execution_mode  mode,
int  mini_batch_size 
)

Start evaluating the objective function. This function takes the model's current mini-batch size. If multiple models are being trained, the current mini-batch size may be different from the effective mini-batch size. The result is not guaranteed to be available until finish_evaluation is called.

Here is the caller graph for this function:

◆ write_proto()

void lbann::objective_function::write_proto ( lbann_data::ObjectiveFunction &  proto) const

Add Objection Function data to prototext

Here is the caller graph for this function:

Member Data Documentation

◆ m_differentiation_time

EvalType lbann::objective_function::m_differentiation_time = EvalType(0)
private

Time spent computing the objective function gradient.

Definition at line 138 of file objective_function.hpp.

◆ m_evaluation_time

EvalType lbann::objective_function::m_evaluation_time = EvalType(0)
private

Time spent evaluating the objective function.

Definition at line 136 of file objective_function.hpp.

◆ m_statistics

std::map<execution_mode, metric_statistics> lbann::objective_function::m_statistics
private

Objective funciton statistics.

Definition at line 133 of file objective_function.hpp.

◆ m_terms

std::vector<std::unique_ptr<objective_function_term> > lbann::objective_function::m_terms
private

List of objective function terms.

Definition at line 130 of file objective_function.hpp.


The documentation for this class was generated from the following file: