Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __TWO_STATE_MODEL_H__
00012 #define __TWO_STATE_MODEL_H__
00013
00014 #include <shogun/structure/StateModel.h>
00015 #include <shogun/structure/HMSVMModel.h>
00016
00017 namespace shogun
00018 {
00019
00024 class CTwoStateModel : public CStateModel
00025 {
00026 public:
00028 CTwoStateModel();
00029
00031 virtual ~CTwoStateModel();
00032
00043 virtual SGMatrix< float64_t > loss_matrix(CSequence* label_seq);
00044
00054 virtual float64_t loss(CSequence* label_seq_lhs, CSequence* label_seq_rhs);
00055
00067 virtual void reshape_emission_params(SGVector< float64_t >& emission_weights,
00068 SGVector< float64_t > w, int32_t num_feats, int32_t num_obs);
00069
00078 virtual void reshape_transmission_params(
00079 SGMatrix< float64_t >& transmission_weights,
00080 SGVector< float64_t > w);
00081
00088 virtual SGVector< int32_t > labels_to_states(CSequence* label_seq) const;
00089
00096 virtual CSequence* states_to_labels(SGVector< int32_t > state_seq) const;
00097
00111 virtual void weights_to_vector(SGVector< float64_t >& psi,
00112 SGMatrix< float64_t > transmission_weights,
00113 SGVector< float64_t > emission_weights,
00114 int32_t num_feats, int32_t num_obs) const;
00115
00128 virtual SGVector< int32_t > get_monotonicity(int32_t num_free_states,
00129 int32_t num_feats) const;
00130
00137 static CHMSVMModel* simulate_two_state_data();
00138
00140 virtual const char* get_name() const { return "TwoStateModel"; }
00141 };
00142
00143 }
00144
00145 #endif