SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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__ */

SHOGUN Machine Learning Toolbox - Documentation