Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1316 from iglesias/feature/fix_matrixlist
Feature/fix matrixlist
- Loading branch information
Showing
7 changed files
with
61 additions
and
15 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
examples/undocumented/libshogun/structure_discrete_hmsvm_bmrm.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include <shogun/structure/HMSVMModel.h> | ||
#include <shogun/structure/DualLibQPBMSOSVM.h> | ||
#include <shogun/structure/StateModelTypes.h> | ||
#include <shogun/features/MatrixFeatures.h> | ||
|
||
|
||
using namespace shogun; | ||
|
||
int main() | ||
{ | ||
init_shogun_with_defaults(); | ||
|
||
float64_t features_dat[] = {0,1, 2,1, 0,1, 0,2}; | ||
SGMatrix<float64_t> features_mat(features_dat,1,8,false); | ||
CMatrixFeatures<float64_t>* features = new CMatrixFeatures<float64_t>(features_mat,2,4); | ||
|
||
int32_t labels_dat[] = {0,0, 1,1, 0,0, 1,1}; | ||
SGVector<int32_t> labels_vec(labels_dat,8,false); | ||
CSequenceLabels* labels = new CSequenceLabels(labels_vec,2,4,2); | ||
|
||
CHMSVMModel* model = new CHMSVMModel(features, labels, SMT_TWO_STATE, 3); | ||
CDualLibQPBMSOSVM* sosvm = new CDualLibQPBMSOSVM(model, labels, 5000,0); | ||
sosvm->train(); | ||
|
||
SG_UNREF(sosvm); | ||
exit_shogun(); | ||
return 0; | ||
} |
21 changes: 21 additions & 0 deletions
21
examples/undocumented/libshogun/structure_plif_hmsvm_bmrm.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <shogun/structure/TwoStateModel.h> | ||
#include <shogun/structure/HMSVMModel.h> | ||
#include <shogun/structure/DualLibQPBMSOSVM.h> | ||
|
||
using namespace shogun; | ||
|
||
int main() | ||
{ | ||
init_shogun_with_defaults(); | ||
CTwoStateModel* tsm = new CTwoStateModel(); | ||
CHMSVMModel* model = tsm->simulate_data(100,250,3,1); | ||
CStructuredLabels* labels = model->get_labels(); | ||
CDualLibQPBMSOSVM* sosvm = new CDualLibQPBMSOSVM(model, labels, 5000.0); | ||
sosvm->train(); | ||
|
||
SG_UNREF(sosvm); | ||
SG_UNREF(labels); | ||
SG_UNREF(tsm); | ||
exit_shogun(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters