LBANN  0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
lbann::SGDExecutionContext Class Referencefinal

SGD Uses the step to track the Current mini-batch step for execution mode. More...

#include <sgd_execution_context.hpp>

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

Public Member Functions

 SGDExecutionContext (execution_mode mode)
 
virtual ~SGDExecutionContext ()=default
 
 SGDExecutionContext (SGDExecutionContext &&other)=default
 
SGDExecutionContextoperator= (SGDExecutionContext &&other)=default
 
 SGDExecutionContext (const SGDExecutionContext &other)=delete
 Get a clean sgd_execution_context. More...
 
SGDExecutionContextoperator= (const SGDExecutionContext &other)=delete
 
std::unique_ptr< ExecutionContextget_new () const override
 
template<class Archive >
void serialize (Archive &ar)
 
std::string get_state_string () const noexcept override
 Return the state of the execution context as a string. More...
 
size_t get_epoch () const noexcept
 
void inc_epoch () noexcept
 Increment the current epoch in the execution context. More...
 
void save_to_checkpoint_shared (persist &p) override
 
void load_from_checkpoint_shared (persist &p) override
 
void save_to_checkpoint_distributed (persist &p) override
 Checkpoint exection_context to a distributed checkpoint. More...
 
void load_from_checkpoint_distributed (persist &p) override
 Restore execution_context from a distributed checkpoint. More...
 
std::string get_type () const override
 Get a string identifying the type of execution context. More...
 
void set_execution_mode (execution_mode mode) noexcept
 
execution_mode get_execution_mode () const noexcept override
 
void set_early_stop (bool stop) noexcept
 
bool get_early_stop () const noexcept
 
void start_timer () noexcept
 
void stop_timer () noexcept
 
double get_current_execution_time () const noexcept
 
- Public Member Functions inherited from lbann::ExecutionContext
 ExecutionContext ()
 
virtual ~ExecutionContext ()=default
 
size_t get_step () const noexcept
 Current step in the training algorithm. More...
 
void inc_step () noexcept
 Increment the current step in the training algorithm. More...
 
template<class Archive >
void serialize (Archive &ar)
 

Private Member Functions

 SGDExecutionContext ()=default
 

Private Attributes

lbann::Timer m_timer
 Timer tracking execution time. More...
 
size_t m_epoch = 0
 
execution_mode m_execution_mode
 
bool m_stop_early = false
 

Friends

class cereal::access
 

Additional Inherited Members

- Protected Member Functions inherited from lbann::ExecutionContext
 ExecutionContext (const ExecutionContext &other)=delete
 
ExecutionContextoperator= (const ExecutionContext &other)=delete
 
 ExecutionContext (ExecutionContext &&other)=default
 
ExecutionContextoperator= (ExecutionContext &&other)=default
 

Detailed Description

SGD Uses the step to track the Current mini-batch step for execution mode.

Step counts are not reset after each epoch.

Definition at line 41 of file sgd_execution_context.hpp.

Constructor & Destructor Documentation

◆ SGDExecutionContext() [1/4]

lbann::SGDExecutionContext::SGDExecutionContext ( execution_mode  mode)

Constructor.

◆ ~SGDExecutionContext()

virtual lbann::SGDExecutionContext::~SGDExecutionContext ( )
virtualdefault

Destructor.

◆ SGDExecutionContext() [2/4]

lbann::SGDExecutionContext::SGDExecutionContext ( SGDExecutionContext &&  other)
default

Move constructor.

◆ SGDExecutionContext() [3/4]

lbann::SGDExecutionContext::SGDExecutionContext ( const SGDExecutionContext other)
delete

Get a clean sgd_execution_context.

Copy constructor – deleted.

◆ SGDExecutionContext() [4/4]

lbann::SGDExecutionContext::SGDExecutionContext ( )
privatedefault

Member Function Documentation

◆ get_current_execution_time()

double lbann::SGDExecutionContext::get_current_execution_time ( ) const
inlinenoexcept

Definition at line 116 of file sgd_execution_context.hpp.

Here is the call graph for this function:

◆ get_early_stop()

bool lbann::SGDExecutionContext::get_early_stop ( ) const
inlinenoexcept

Definition at line 112 of file sgd_execution_context.hpp.

Here is the caller graph for this function:

◆ get_epoch()

size_t lbann::SGDExecutionContext::get_epoch ( ) const
inlinenoexcept

Number of times the training set has been traversed.

Definition at line 81 of file sgd_execution_context.hpp.

Here is the caller graph for this function:

◆ get_execution_mode()

execution_mode lbann::SGDExecutionContext::get_execution_mode ( ) const
inlineoverridevirtualnoexcept

Get the mode that the trainer is currenting executing.

Reimplemented from lbann::ExecutionContext.

Definition at line 106 of file sgd_execution_context.hpp.

Here is the caller graph for this function:

◆ get_new()

std::unique_ptr<ExecutionContext> lbann::SGDExecutionContext::get_new ( ) const
inlineoverridevirtual

Get a "clean" execution_context of the same type.

Implements lbann::ExecutionContext.

Definition at line 60 of file sgd_execution_context.hpp.

Here is the call graph for this function:

◆ get_state_string()

std::string lbann::SGDExecutionContext::get_state_string ( ) const
inlineoverridevirtualnoexcept

Return the state of the execution context as a string.

Implements lbann::ExecutionContext.

Definition at line 70 of file sgd_execution_context.hpp.

Here is the call graph for this function:

◆ get_type()

std::string lbann::SGDExecutionContext::get_type ( ) const
overridevirtual

Get a string identifying the type of execution context.

Should match the training algorithm.

Todo:
Absorb completely into get_state_string().

Implements lbann::ExecutionContext.

Here is the caller graph for this function:

◆ inc_epoch()

void lbann::SGDExecutionContext::inc_epoch ( )
inlinenoexcept

Increment the current epoch in the execution context.

Increment the counter tracking the number of times that the data set has been traversed.

Definition at line 87 of file sgd_execution_context.hpp.

Here is the call graph for this function:

◆ load_from_checkpoint_distributed()

void lbann::SGDExecutionContext::load_from_checkpoint_distributed ( persist p)
overridevirtual

Restore execution_context from a distributed checkpoint.

Implements lbann::ExecutionContext.

Here is the caller graph for this function:

◆ load_from_checkpoint_shared()

void lbann::SGDExecutionContext::load_from_checkpoint_shared ( persist p)
overridevirtual

Restore training_algorithm by reading checkpoint from given file descriptor

Implements lbann::ExecutionContext.

Here is the caller graph for this function:

◆ operator=() [1/2]

SGDExecutionContext& lbann::SGDExecutionContext::operator= ( SGDExecutionContext &&  other)
default

Move assignment operator.

◆ operator=() [2/2]

SGDExecutionContext& lbann::SGDExecutionContext::operator= ( const SGDExecutionContext other)
delete

Copy assignment operator – deleted.

◆ save_to_checkpoint_distributed()

void lbann::SGDExecutionContext::save_to_checkpoint_distributed ( persist p)
overridevirtual

Checkpoint exection_context to a distributed checkpoint.

Implements lbann::ExecutionContext.

Here is the caller graph for this function:

◆ save_to_checkpoint_shared()

void lbann::SGDExecutionContext::save_to_checkpoint_shared ( persist p)
overridevirtual

Checkpoint training_algorithm to given file descriptor

Implements lbann::ExecutionContext.

Here is the caller graph for this function:

◆ serialize()

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

Archive for checkpoint and restart

Here is the caller graph for this function:

◆ set_early_stop()

void lbann::SGDExecutionContext::set_early_stop ( bool  stop)
inlinenoexcept

Definition at line 111 of file sgd_execution_context.hpp.

◆ set_execution_mode()

void lbann::SGDExecutionContext::set_execution_mode ( execution_mode  mode)
inlinenoexcept

Get the mode that the trainer is currenting executing.

Definition at line 100 of file sgd_execution_context.hpp.

◆ start_timer()

void lbann::SGDExecutionContext::start_timer ( )
inlinenoexcept

Definition at line 114 of file sgd_execution_context.hpp.

Here is the call graph for this function:

◆ stop_timer()

void lbann::SGDExecutionContext::stop_timer ( )
inlinenoexcept

Definition at line 115 of file sgd_execution_context.hpp.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ cereal::access

friend class cereal::access
friend

Definition at line 119 of file sgd_execution_context.hpp.

Member Data Documentation

◆ m_epoch

size_t lbann::SGDExecutionContext::m_epoch = 0
private

Number of times the training data set has been traversed.

Definition at line 127 of file sgd_execution_context.hpp.

◆ m_execution_mode

execution_mode lbann::SGDExecutionContext::m_execution_mode
private

Definition at line 129 of file sgd_execution_context.hpp.

◆ m_stop_early

bool lbann::SGDExecutionContext::m_stop_early = false
private

Definition at line 131 of file sgd_execution_context.hpp.

◆ m_timer

lbann::Timer lbann::SGDExecutionContext::m_timer
private

Timer tracking execution time.

Definition at line 124 of file sgd_execution_context.hpp.


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