SHOGUN  v3.0.0
 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 
16 
17 namespace shogun
18 {
19 
25 {
26  public:
29 
31  virtual ~CTwoStateModel();
32 
43  virtual SGMatrix< float64_t > loss_matrix(CSequence* label_seq);
44 
54  virtual float64_t loss(CSequence* label_seq_lhs, CSequence* label_seq_rhs);
55 
67  virtual void reshape_emission_params(SGVector< float64_t >& emission_weights,
68  SGVector< float64_t > w, int32_t num_feats, int32_t num_obs);
69 
80  virtual void reshape_emission_params(CDynamicObjectArray* plif_matrix,
81  SGVector< float64_t > w, int32_t num_feats, int32_t num_plif_nodes);
82 
91  virtual void reshape_transmission_params(
92  SGMatrix< float64_t >& transmission_weights,
94 
101  virtual SGVector< int32_t > labels_to_states(CSequence* label_seq) const;
102 
109  virtual CSequence* states_to_labels(SGVector< int32_t > state_seq) const;
110 
123  virtual void weights_to_vector(SGVector< float64_t >& psi,
124  SGMatrix< float64_t > transmission_weights,
125  SGVector< float64_t > emission_weights,
126  int32_t num_feats, int32_t num_obs) const;
127 
141  SGVector< float64_t > emission_weights, int32_t num_feats, int32_t num_obs) const;
142 
155  virtual SGVector< int32_t > get_monotonicity(int32_t num_free_states,
156  int32_t num_feats) const;
157 
169  static CHMSVMModel* simulate_data(int32_t num_exm, int32_t exm_len, int32_t num_features, int32_t num_noise_features);
170 
172  virtual const char* get_name() const { return "TwoStateModel"; }
173 };
174 
175 } /* namespace shogun */
176 
177 #endif /* __TWO_STATE_MODEL_H__ */

SHOGUN Machine Learning Toolbox - Documentation