SG++
sgpp::datadriven::ConvergenceMonitor Class Reference

A monitor to decide if a learning algorithm has converged. More...

#include <ConvergenceMonitor.hpp>

Public Member Functions

bool checkConvergence ()
 Examines the convergence criterion with the current error observations. More...
 
 ConvergenceMonitor (double pDeclineThreshold, size_t pBufferSize, size_t pMinRefInterval)
 Constructor. More...
 
void pushToBuffer (double currentValidError, double currentTrainError)
 Stores the current error values in the buffer. More...
 
virtual ~ConvergenceMonitor ()
 Destructor. More...
 

Public Attributes

size_t minRefInterval
 
size_t nextRefCnt
 
std::deque< double > trainErrorDeclineBuffer
 
std::deque< double > validErrorDeclineBuffer
 

Detailed Description

A monitor to decide if a learning algorithm has converged.

The convergence criterion is based on the comparison of error measurements throughout the training process.

Constructor & Destructor Documentation

sgpp::datadriven::ConvergenceMonitor::ConvergenceMonitor ( double  pDeclineThreshold,
size_t  pBufferSize,
size_t  pMinRefInterval 
)

Constructor.

Parameters
pDeclineThresholdThe convergence threshold
pBufferSizeNumber of error measurements which are considered for convergence check
pMinRefIntervalMinimum number of iterations before next refinement is allowed to be performed
sgpp::datadriven::ConvergenceMonitor::~ConvergenceMonitor ( )
virtual

Destructor.

Member Function Documentation

bool sgpp::datadriven::ConvergenceMonitor::checkConvergence ( )

Examines the convergence criterion with the current error observations.

Returns
True if converged, false otherwise

References trainErrorDeclineBuffer, and validErrorDeclineBuffer.

Referenced by sgpp::datadriven::RefinementHandler::checkRefinementNecessary().

void sgpp::datadriven::ConvergenceMonitor::pushToBuffer ( double  currentValidError,
double  currentTrainError 
)

Stores the current error values in the buffer.

If the buffer has reached the maximum size, the oldest values are removed.

Parameters
currentValidErrorThe current validation error
currentTrainErrorThe current training error

References trainErrorDeclineBuffer, and validErrorDeclineBuffer.

Referenced by sgpp::datadriven::RefinementHandler::checkRefinementNecessary().

Member Data Documentation

size_t sgpp::datadriven::ConvergenceMonitor::minRefInterval
std::deque<double> sgpp::datadriven::ConvergenceMonitor::trainErrorDeclineBuffer

Referenced by checkConvergence(), and pushToBuffer().

std::deque<double> sgpp::datadriven::ConvergenceMonitor::validErrorDeclineBuffer

Referenced by checkConvergence(), and pushToBuffer().


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