188 "%s::set_energies(): ft_energies is not a valid energy table!\n",
get_name());
195 REQUIRE(ei >= 0 && ei < m_factor_type->get_num_assignments(),
196 "%s::set_energy(): ei is out of index!\n",
get_name());
199 energy table is fixed in data dependent factor!\n",
get_name());
283 return (m_dense.
size() == 0);
298 m_dense = dense.
clone();
307 void CFactorDataSource::init()
void set_energy(int32_t ei, float64_t value)
bool is_data_sparse() const
float64_t get_energy(int32_t index) const
CTableFactorType * get_factor_type() const
SGSparseVector< float64_t > get_data_sparse() const
virtual SGVector< float64_t > get_data() const
virtual void compute_energies(const SGVector< float64_t > factor_data, SGVector< float64_t > &energies) const
const SGVector< int32_t > get_variables() const
virtual SGVector< float64_t > get_w()
void set_variables(SGVector< int32_t > vars)
virtual bool is_table() const
SGVector< float64_t > get_data() const
virtual const char * get_name() const
virtual SGSparseVector< float64_t > get_data_sparse() const
void compute_gradients(const SGVector< float64_t > marginals, SGVector< float64_t > ¶meter_gradient, double mult=1.0) const
float64_t evaluate_energy(const SGVector< int32_t > state) const
virtual void set_data_sparse(SGSparseVectorEntry< float64_t > *sparse, int32_t dlen)
SGVector< float64_t > get_energies() const
bool is_data_dependent() const
Class SGObject is the base class of all shogun objects.
SGSparseVector< float64_t > m_data_sparse
SGVector< int32_t > m_var_index
virtual void compute_gradients(const SGVector< float64_t > factor_data, const SGVector< float64_t > marginals, SGVector< float64_t > ¶meter_gradient, double mult) const
Class CFactorDataSource Source for factor data. In some cases, the same data can be shared by many fa...
virtual void set_data(SGVector< float64_t > dense)
const int32_t get_num_vars() const
void set_energies(SGVector< float64_t > ft_energies)
all of classes and functions are contained in the shogun namespace
void set_data_sparse(SGSparseVectorEntry< float64_t > *data_sparse, int32_t dlen)
virtual bool is_sparse() const
Class CTableFactorType the way that store assignments of variables and energies in a table or a multi...
void set_factor_type(CTableFactorType *ftype)
SGVector< T > clone() const
virtual const SGVector< int32_t > get_cardinalities() const
virtual ~CFactorDataSource()
void resize_vector(int32_t n)
CTableFactorType * m_factor_type
int32_t index_from_universe_assignment(const SGVector< int32_t > assig, const SGVector< int32_t > var_index) const
#define SG_UNSTABLE(func,...)
void set_data(SGVector< float64_t > data_dense)
const SGVector< int32_t > get_cardinalities() const
SGVector< float64_t > m_data
virtual int32_t get_num_assignments() const
CFactorDataSource * m_data_source
SGVector< float64_t > m_energies