LBANN  0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
lbann::objective_function_term Class Referenceabstract

#include <objective_function_term.hpp>

Inheritance diagram for lbann::objective_function_term:
[legend]
Collaboration diagram for lbann::objective_function_term:
[legend]

Public Member Functions

 objective_function_term (EvalType scale_factor=EvalType(1))
 
 objective_function_term (const objective_function_term &other)=default
 
objective_function_termoperator= (const objective_function_term &other)=default
 
virtual ~objective_function_term ()=default
 
virtual objective_function_termcopy () const =0
 
template<class Archive >
void serialize (Archive &ar)
 
virtual std::string name () const =0
 
virtual void setup (model &m)
 
virtual void start_evaluation ()=0
 
virtual EvalType finish_evaluation ()=0
 
virtual void differentiate ()=0
 
virtual void compute_weight_regularization ()=0
 
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)
 
virtual void write_specific_proto (lbann_data::ObjectiveFunction &proto) const =0
 

Protected Member Functions

lbann_commget_comm ()
 

Protected Attributes

EvalType m_scale_factor
 
std::vector< ViewingLayerPtrm_layers
 
std::vector< ViewingWeightsPtrm_weights
 

Private Attributes

lbann_commm_comm
 

Detailed Description

Abstract class for objective function terms.

Definition at line 47 of file objective_function_term.hpp.

Constructor & Destructor Documentation

◆ objective_function_term() [1/2]

lbann::objective_function_term::objective_function_term ( EvalType  scale_factor = EvalType(1))

Default constructor.

◆ objective_function_term() [2/2]

lbann::objective_function_term::objective_function_term ( const objective_function_term other)
default

Copy constructor.

◆ ~objective_function_term()

virtual lbann::objective_function_term::~objective_function_term ( )
virtualdefault

Destructor.

Member Function Documentation

◆ compute_weight_regularization()

virtual void lbann::objective_function_term::compute_weight_regularization ( )
pure virtual

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

Implemented in lbann::l2_weight_regularization, and lbann::layer_term.

◆ copy()

virtual objective_function_term* lbann::objective_function_term::copy ( ) const
pure virtual

Copy function.

Implemented in lbann::l2_weight_regularization, and lbann::layer_term.

◆ differentiate()

virtual void lbann::objective_function_term::differentiate ( )
pure virtual

Compute the gradient of the objective function term. The gradient is computed w.r.t. the objective function term inputs. This should include the scaling factor.

Implemented in lbann::l2_weight_regularization, and lbann::layer_term.

◆ finish_evaluation()

virtual EvalType lbann::objective_function_term::finish_evaluation ( )
pure virtual

Complete evaluation of the objective function term.

Implemented in lbann::l2_weight_regularization, and lbann::layer_term.

◆ get_comm()

lbann_comm& lbann::objective_function_term::get_comm ( )
inlineprotected

Get LBANN communicator.

Definition at line 116 of file objective_function_term.hpp.

◆ get_layer_pointers()

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

Get list of pointers to layers.

◆ get_weights_pointers()

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

Get list of pointers to weights.

◆ name()

virtual std::string lbann::objective_function_term::name ( ) const
pure virtual

Get the name of the objective function term.

Implemented in lbann::l2_weight_regularization, and lbann::layer_term.

◆ operator=()

objective_function_term& lbann::objective_function_term::operator= ( const objective_function_term other)
default

Copy assignment operator.

◆ serialize()

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

Archive for checkpoint and restart

◆ set_layer_pointers()

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

Set list of pointers to layers.

◆ set_weights_pointers()

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

Set list of pointers to weights.

◆ setup()

virtual void lbann::objective_function_term::setup ( model m)
virtual

Setup objective function term.

Reimplemented in lbann::l2_weight_regularization, and lbann::layer_term.

◆ start_evaluation()

virtual void lbann::objective_function_term::start_evaluation ( )
pure virtual

Start evaluation of the objective function term. This should include the scaling factor. The result is not available until finish_evaluation has been called.

Implemented in lbann::l2_weight_regularization, and lbann::layer_term.

◆ write_specific_proto()

virtual void lbann::objective_function_term::write_specific_proto ( lbann_data::ObjectiveFunction &  proto) const
pure virtual

Add Objective function data to prototext

Implemented in lbann::l2_weight_regularization, and lbann::layer_term.

Member Data Documentation

◆ m_comm

lbann_comm* lbann::objective_function_term::m_comm
private

LBANN communicator.

Definition at line 120 of file objective_function_term.hpp.

◆ m_layers

std::vector<ViewingLayerPtr> lbann::objective_function_term::m_layers
protected

Layers used to compute objective function term.

Definition at line 111 of file objective_function_term.hpp.

◆ m_scale_factor

EvalType lbann::objective_function_term::m_scale_factor
protected

Scaling factor for objective function term.

Definition at line 108 of file objective_function_term.hpp.

◆ m_weights

std::vector<ViewingWeightsPtr> lbann::objective_function_term::m_weights
protected

Weights used to compute objective function term.

Definition at line 113 of file objective_function_term.hpp.


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