SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
TwoStateModel.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2012 Fernando José Iglesias García
8  * Copyright (C) 2012 Fernando José Iglesias García
9  */
10 
11 #ifndef __TWO_STATE_MODEL_H__
12 #define __TWO_STATE_MODEL_H__
13 
14 #include <shogun/lib/config.h>
15 
18 
19 namespace shogun
20 {
21 
27 {
28  public:
31 
33  virtual ~CTwoStateModel();
34 
45  virtual SGMatrix< float64_t > loss_matrix(CSequence* label_seq);
46 
56  virtual float64_t loss(CSequence* label_seq_lhs, CSequence* label_seq_rhs);
57 
69  virtual void reshape_emission_params(SGVector< float64_t >& emission_weights,
70  SGVector< float64_t > w, int32_t num_feats, int32_t num_obs);
71 
82  virtual void reshape_emission_params(CDynamicObjectArray* plif_matrix,
83  SGVector< float64_t > w, int32_t num_feats, int32_t num_plif_nodes);
84 
93  virtual void reshape_transmission_params(
94  SGMatrix< float64_t >& transmission_weights,
96 
103  virtual SGVector< int32_t > labels_to_states(CSequence* label_seq) const;
104 
111  virtual CSequence* states_to_labels(SGVector< int32_t > state_seq) const;
112 
125  virtual void weights_to_vector(SGVector< float64_t >& psi,
126  SGMatrix< float64_t > transmission_weights,
127  SGVector< float64_t > emission_weights,
128  int32_t num_feats, int32_t num_obs) const;
129 
143  SGVector< float64_t > emission_weights, int32_t num_feats, int32_t num_obs) const;
144 
157  virtual SGVector< int32_t > get_monotonicity(int32_t num_free_states,
158  int32_t num_feats) const;
159 
171  static CHMSVMModel* simulate_data(int32_t num_exm, int32_t exm_len, int32_t num_features, int32_t num_noise_features);
172 
174  virtual const char* get_name() const { return "TwoStateModel"; }
175 };
176 
177 } /* namespace shogun */
178 
179 #endif /* __TWO_STATE_MODEL_H__ */
virtual void reshape_emission_params(SGVector< float64_t > &emission_weights, SGVector< float64_t > w, int32_t num_feats, int32_t num_obs)
Class CHMSVMModel that represents the application specific model and contains the application depende...
Definition: HMSVMModel.h:31
class CTwoStateModel class for the internal two-state representation used in the CHMSVMModel.
Definition: TwoStateModel.h:26
virtual SGMatrix< float64_t > loss_matrix(CSequence *label_seq)
class CStateModel base, abstract class for the internal state representation used in the CHMSVMModel...
Definition: StateModel.h:30
virtual CSequence * states_to_labels(SGVector< int32_t > state_seq) const
Class CSequence to be used in the application of Structured Output (SO) learning to Hidden Markov Sup...
virtual float64_t loss(CSequence *label_seq_lhs, CSequence *label_seq_rhs)
virtual void weights_to_vector(SGVector< float64_t > &psi, SGMatrix< float64_t > transmission_weights, SGVector< float64_t > emission_weights, int32_t num_feats, int32_t num_obs) const
virtual SGVector< int32_t > labels_to_states(CSequence *label_seq) const
double float64_t
Definition: common.h:50
virtual const char * get_name() const
Dynamic array class for CSGObject pointers that creates an array that can be used like a list or an a...
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
virtual void reshape_transmission_params(SGMatrix< float64_t > &transmission_weights, SGVector< float64_t > w)
static CHMSVMModel * simulate_data(int32_t num_exm, int32_t exm_len, int32_t num_features, int32_t num_noise_features)
virtual SGVector< int32_t > get_monotonicity(int32_t num_free_states, int32_t num_feats) const

SHOGUN Machine Learning Toolbox - Documentation