Reranker Framework (ReFr)
Reranking framework for structure prediction and discriminative language modeling
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Friends | List of all members
reranker::Time Class Reference

A simple class to hold the three notions of time during training: the current epoch, the current time index within the current epoch, and the absolute time index. More...

#include <training-time.H>

Public Member Functions

 Time ()
 Constructs a new time instance, ready for its indices to be incremented. More...
 
 Time (int epoch, int index, int absolute_index)
 Constructs a new time instance with the specified time indices. More...
 
int epoch () const
 Returns the index of the current epoch. More...
 
int index () const
 Returns the index of the current training example within the current epoch. More...
 
int absolute_index () const
 Returns the total number of training examples seen in all epochs. More...
 
double absolute_seconds () const
 
double seconds_since_last_epoch () const
 
string to_string () const
 
void Tick ()
 Increments both the time index for the current epoch and the absolute time index. More...
 
void NewEpoch ()
 Increments the epoch counter. More...
 

Friends

ostream & operator<< (ostream &os, const Time &time)
 

Detailed Description

A simple class to hold the three notions of time during training: the current epoch, the current time index within the current epoch, and the absolute time index.

Definition at line 56 of file training-time.H.

Constructor & Destructor Documentation

reranker::Time::Time ( )
inline

Constructs a new time instance, ready for its indices to be incremented.

Definition at line 59 of file training-time.H.

reranker::Time::Time ( int  epoch,
int  index,
int  absolute_index 
)
inline

Constructs a new time instance with the specified time indices.

Parameters
epochthe current epoch
indexthe current time index within the current epoch
absolute_indexthe absolute time index

Definition at line 66 of file training-time.H.

Member Function Documentation

int reranker::Time::absolute_index ( ) const
inline

Returns the total number of training examples seen in all epochs.

Definition at line 79 of file training-time.H.

double reranker::Time::absolute_seconds ( ) const
inline

Definition at line 81 of file training-time.H.

int reranker::Time::epoch ( ) const
inline

Returns the index of the current epoch.

Definition at line 74 of file training-time.H.

int reranker::Time::index ( ) const
inline

Returns the index of the current training example within the current epoch.

Definition at line 77 of file training-time.H.

void reranker::Time::NewEpoch ( )
inline

Increments the epoch counter.

Definition at line 109 of file training-time.H.

double reranker::Time::seconds_since_last_epoch ( ) const
inline

Definition at line 85 of file training-time.H.

void reranker::Time::Tick ( )
inline

Increments both the time index for the current epoch and the absolute time index.

Definition at line 104 of file training-time.H.

string reranker::Time::to_string ( ) const
inline

Definition at line 95 of file training-time.H.

Friends And Related Function Documentation

ostream& operator<< ( ostream &  os,
const Time time 
)
friend

Definition at line 90 of file training-time.H.


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