DiSMEC++
dismec::l2_reg_sq_hinge_detail Namespace Reference

Functions

template<class Derived >
void htd_sum_naive (const std::vector< int > &indices, Eigen::Ref< DenseRealVector > output, const Eigen::EigenBase< Derived > &features, const DenseRealVector &costs, const DenseRealVector &direction)
 
template<int LOOK_AHEAD = 2>
void htd_sum (const std::vector< int > &indices, Eigen::Ref< DenseRealVector > output, const SparseFeatures &features, const DenseRealVector &costs, const DenseRealVector &direction)
 
void __attribute__ ((hot)) htd_sum_new(const std
 
template<typename Derived >
real_t value_from_xTw (const DenseRealVector &cost, const BinaryLabelVector &labels, const Eigen::DenseBase< Derived > &xTw)
 

Function Documentation

◆ __attribute__()

void dismec::l2_reg_sq_hinge_detail::__attribute__ ( (hot)  ) const
inline

◆ htd_sum()

template<int LOOK_AHEAD = 2>
void dismec::l2_reg_sq_hinge_detail::htd_sum ( const std::vector< int > &  indices,
Eigen::Ref< DenseRealVector output,
const SparseFeatures features,
const DenseRealVector costs,
const DenseRealVector direction 
)
inline

◆ htd_sum_naive()

template<class Derived >
void dismec::l2_reg_sq_hinge_detail::htd_sum_naive ( const std::vector< int > &  indices,
Eigen::Ref< DenseRealVector output,
const Eigen::EigenBase< Derived > &  features,
const DenseRealVector costs,
const DenseRealVector direction 
)
inline

Definition at line 17 of file reg_sq_hinge_detail.h.

Referenced by TEST_CASE().

◆ value_from_xTw()

template<typename Derived >
real_t dismec::l2_reg_sq_hinge_detail::value_from_xTw ( const DenseRealVector cost,
const BinaryLabelVector labels,
const Eigen::DenseBase< Derived > &  xTw 
)

Given a vector expression xTw that contains the product of feature matrix and weight vector, a label vector and a vector of cost factors, calculates the squared hinge loss

Definition at line 83 of file reg_sq_hinge_detail.h.

References dismec::to_long().

Referenced by dismec::objective::GenericLinearClassifier::lookup_on_line(), dismec::objective::LinearClassifierImpBase< Derived >::lookup_on_line(), and dismec::objective::GenericLinearClassifier::value_unchecked().