10 #ifndef __SEGMENT_LOSS__
11 #define __SEGMENT_LOSS__
22 template <
class T>
class CArray;
23 template <
class T>
class CArray2;
24 template <
class T>
class CArray3;
93 inline virtual const char*
get_name()
const {
return "SegmentLoss"; }
155 int32_t from_pos_shift = from_pos ;
164 while (from_pos_shift<to_pos && m_segment_ids->element(from_pos_shift)==
m_segment_ids->
element(from_pos_shift+1))
CArray< int32_t > * m_segment_ids
CArray3< float64_t > m_segment_loss
virtual const char * get_name() const
void set_segment_mask(CArray< float64_t > *segment_mask)
const T & element(int32_t idx1, int32_t idx2) const
float32_t get_segment_loss(int32_t from_pos, int32_t to_pos, int32_t segment_id)
CArray< float64_t > * m_segment_mask
void compute_loss(int32_t *all_pos, int32_t len)
CArray2< float32_t > m_segment_loss_matrix
float32_t get_segment_loss_extend(int32_t from_pos, int32_t to_pos, int32_t segment_id)
const T & element(int32_t idx1, int32_t idx2, int32_t idx3) const
Class SGObject is the base class of all shogun objects.
void set_num_segment_types(int32_t num_segment_types)
void set_segment_ids(CArray< int32_t > *segment_ids)
const T & element(int32_t idx1) const
int32_t m_num_segment_types
void set_segment_loss(float64_t *segment_loss, int32_t m, int32_t n)