LBANN  0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
lbann::layer_metric Class Reference

#include <layer_metric.hpp>

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

Public Member Functions

 layer_metric (lbann_comm *comm=nullptr, std::string name="", std::string unit="")
 
 layer_metric (const layer_metric &other)=default
 
layer_metricoperator= (const layer_metric &other)=default
 
virtual ~layer_metric ()=default
 
layer_metriccopy () const override
 
std::string name () const override
 
std::string get_unit () const override
 
template<class Archive >
void serialize (Archive &ar)
 
void set_layer (ViewingLayerPtr l)
 
Layerget_layer ()
 
const Layerget_layer () const
 
std::vector< ViewingLayerPtrget_layer_pointers () const override
 
void set_layer_pointers (std::vector< ViewingLayerPtr > layers) override
 
bool save_to_checkpoint_shared (persist &p) override
 
bool load_from_checkpoint_shared (persist &p) override
 
bool save_to_checkpoint_distributed (persist &p) override
 
bool load_from_checkpoint_distributed (persist &p) override
 
- Public Member Functions inherited from lbann::metric
 metric (lbann_comm *comm)
 
 metric (const metric &other)=default
 
metricoperator= (const metric &other)=default
 
virtual ~metric ()=default
 
template<class Archive >
void serialize (Archive &ar)
 
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
 
EvalType get_evaluate_time () const
 
EvalTypeget_evaluate_time ()
 
void reset_counters ()
 

Protected Member Functions

void setup (model &m) override
 
EvalType evaluate (execution_mode mode, int mini_batch_size) override
 
EvalType evaluate_compute (const AbsDistMat &prediction, const AbsDistMat &ground_truth) override
 
- Protected Member Functions inherited from lbann::metric
lbann_commget_comm ()
 
std::map< execution_mode, metric_statistics > & get_statistics ()
 

Private Member Functions

Layerget_evaluation_layer ()
 

Private Attributes

std::string m_name
 
std::string m_unit
 
ViewingLayerPtr m_layer
 

Detailed Description

Definition at line 35 of file layer_metric.hpp.

Constructor & Destructor Documentation

◆ layer_metric() [1/2]

lbann::layer_metric::layer_metric ( lbann_comm comm = nullptr,
std::string  name = "",
std::string  unit = "" 
)
Here is the caller graph for this function:

◆ layer_metric() [2/2]

lbann::layer_metric::layer_metric ( const layer_metric other)
default

◆ ~layer_metric()

virtual lbann::layer_metric::~layer_metric ( )
virtualdefault

Member Function Documentation

◆ copy()

layer_metric* lbann::layer_metric::copy ( ) const
inlineoverridevirtual

Copy function.

Implements lbann::metric.

Definition at line 45 of file layer_metric.hpp.

Here is the call graph for this function:

◆ evaluate()

EvalType lbann::layer_metric::evaluate ( execution_mode  mode,
int  mini_batch_size 
)
overrideprotectedvirtual

Evaluate the metric value. 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 stored in history.

Implements lbann::metric.

Here is the caller graph for this function:

◆ evaluate_compute()

EvalType lbann::layer_metric::evaluate_compute ( const AbsDistMat prediction,
const AbsDistMat ground_truth 
)
overrideprotectedvirtual

Computation to evaluate the metric function (deprecated). This function is not called since the 'evaluate' function is overridden.

Implements lbann::metric.

Here is the caller graph for this function:

◆ get_evaluation_layer()

Layer& lbann::layer_metric::get_evaluation_layer ( )
private

Get corresponding evaluation layer.

◆ get_layer() [1/2]

Layer& lbann::layer_metric::get_layer ( )

Get corresponding layer.

Here is the caller graph for this function:

◆ get_layer() [2/2]

const Layer& lbann::layer_metric::get_layer ( ) const

Get corresponding layer (const).

◆ get_layer_pointers()

std::vector<ViewingLayerPtr> lbann::layer_metric::get_layer_pointers ( ) const
overridevirtual

Get list of pointers to layers.

Reimplemented from lbann::metric.

Here is the caller graph for this function:

◆ get_unit()

std::string lbann::layer_metric::get_unit ( ) const
inlineoverridevirtual

Return a display unit for this metric. Default is an empty string. This is overriden if the metric has units, e.g. "%" or "sec".

Reimplemented from lbann::metric.

Definition at line 49 of file layer_metric.hpp.

Here is the call graph for this function:

◆ load_from_checkpoint_distributed()

bool lbann::layer_metric::load_from_checkpoint_distributed ( persist p)
overridevirtual

Implements lbann::metric.

Here is the caller graph for this function:

◆ load_from_checkpoint_shared()

bool lbann::layer_metric::load_from_checkpoint_shared ( persist p)
overridevirtual

Load metric state from checkpoint.

Implements lbann::metric.

Here is the caller graph for this function:

◆ name()

std::string lbann::layer_metric::name ( ) const
overridevirtual

Return a string name for this metric.

Implements lbann::metric.

Here is the caller graph for this function:

◆ operator=()

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

◆ save_to_checkpoint_distributed()

bool lbann::layer_metric::save_to_checkpoint_distributed ( persist p)
overridevirtual

Implements lbann::metric.

Here is the caller graph for this function:

◆ save_to_checkpoint_shared()

bool lbann::layer_metric::save_to_checkpoint_shared ( persist p)
overridevirtual

Save metric state to checkpoint.

Implements lbann::metric.

Here is the caller graph for this function:

◆ serialize()

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

Archive for checkpoint and restart

Here is the caller graph for this function:

◆ set_layer()

void lbann::layer_metric::set_layer ( ViewingLayerPtr  l)

Set corresponding layer.

Here is the caller graph for this function:

◆ set_layer_pointers()

void lbann::layer_metric::set_layer_pointers ( std::vector< ViewingLayerPtr layers)
overridevirtual

Set list of pointers to layers.

Reimplemented from lbann::metric.

Here is the caller graph for this function:

◆ setup()

void lbann::layer_metric::setup ( model m)
overrideprotectedvirtual

Setup metric.

Reimplemented from lbann::metric.

Here is the caller graph for this function:

Member Data Documentation

◆ m_layer

ViewingLayerPtr lbann::layer_metric::m_layer
private

Corresponding layer.

Definition at line 94 of file layer_metric.hpp.

◆ m_name

std::string lbann::layer_metric::m_name
private

Descriptive name for metric.

Definition at line 88 of file layer_metric.hpp.

◆ m_unit

std::string lbann::layer_metric::m_unit
private

Metric unit. If the unit is "%", the reported value is multiplied by 100.

Definition at line 92 of file layer_metric.hpp.


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