ModErn Text Analysis
META Enumerates Textual Applications
Classes | Functions
meta::classify::loss Namespace Reference

Loss functions for sgd. More...

Classes

struct  hinge
 The hinge loss for SGD algorithms. More...
 
struct  huber
 The huber loss for SGD algorithms. More...
 
struct  least_squares
 The least-squares loss function for SGD algorithms. More...
 
struct  logistic
 The logistic loss for SGD algorithms. More...
 
struct  loss_function
 Base class for all loss functions that can be passed to the sgd classifier. More...
 
class  loss_function_factory
 Factory that is responsible for creating loss functions from strings. More...
 
struct  modified_huber
 The modified huber loss function for SGD algorithms. More...
 
struct  perceptron
 The perceptron loss function for SGD algorithms. More...
 
struct  smooth_hinge
 The smooth hinge loss function for SGD algorithms. More...
 
struct  squared_hinge
 The squared hinge loss function for SGD algorithms. More...
 

Functions

std::unique_ptr< loss_functionmake_loss_function (const std::string &identifier)
 Convenience method for making a loss function using the factory. More...
 
template<class Loss >
std::unique_ptr< loss_functionmake_loss_function ()
 Factory method for creating a loss function. More...
 
template<class Loss >
void register_loss_function ()
 Registration method for loss functions. More...
 

Detailed Description

Loss functions for sgd.

Function Documentation

std::unique_ptr< loss_function > meta::classify::loss::make_loss_function ( const std::string &  identifier)

Convenience method for making a loss function using the factory.

Parameters
identifierthe identifier for the loss function to be created
Returns
a unique_ptr to the loss function created
template<class Loss >
std::unique_ptr<loss_function> meta::classify::loss::make_loss_function ( )

Factory method for creating a loss function.

Returns
a unique_ptr to a loss_function (of derived type Loss)
template<class Loss >
void meta::classify::loss::register_loss_function ( )

Registration method for loss functions.

Clients should use this method to register any new loss functions they write.