10 #ifndef __SEGMENT_LOSS__
11 #define __SEGMENT_LOSS__
22 template <
class T>
class CDynamicArray;
91 virtual const char*
get_name()
const {
return "SegmentLoss"; }
153 int32_t from_pos_shift = from_pos ;
162 while (from_pos_shift<to_pos && m_segment_ids->element(from_pos_shift)==
m_segment_ids->
element(from_pos_shift+1))
virtual const char * get_name() const
float32_t get_segment_loss(int32_t from_pos, int32_t to_pos, int32_t segment_id)
CDynamicArray< int32_t > * m_segment_ids
void compute_loss(int32_t *all_pos, int32_t len)
float32_t get_segment_loss_extend(int32_t from_pos, int32_t to_pos, int32_t segment_id)
Class SGObject is the base class of all shogun objects.
void set_segment_ids(CDynamicArray< int32_t > *segment_ids)
void set_num_segment_types(int32_t num_segment_types)
all of classes and functions are contained in the shogun namespace
CDynamicArray< float64_t > * m_segment_mask
CDynamicArray< float64_t > m_segment_loss
const T & element(int32_t idx1, int32_t idx2=0, int32_t idx3=0) const
CDynamicArray< float32_t > m_segment_loss_matrix
int32_t m_num_segment_types
void set_segment_loss(float64_t *segment_loss, int32_t m, int32_t n)
void set_segment_mask(CDynamicArray< float64_t > *segment_mask)