How to install the HM-SVM toolbox? ---------------------------------- 1) Create mex files Run the mex compiler as follows: mex compute_score_matrix.cpp score_plif_struct.cpp and mex best_path.cpp (Note that Shogun is no longer required for this version of the HM-SVM toolbox) 2) Adjust and compile solver interface If you want to use the CPLEX otimizer, compile its interface for MATLAB in - opt_interface/cplex for Octave in - opt_interface/oct_cplex (see README files in those directories, for the instructions). The interface for the Mosek optimizer does not need compilation, it should run right away once library and license paths have been set properly (see README file in opt_interface/mosek/). For more details see the README files in the opt_interface subdirectories cplex and/or mosek. 3) Generate simulated toy data for 2-state HM-SVM model Execute the matlab script simulate_data.m in the models/two_state/ subdirectory. It writes the data to ./hmsvm_toydata/hmsvm_data.mat (directory is created if non-existent). Execute: addpath models/two_state simulate_data 4) Train 2-state HM-SVM Call the matlab script main.m which reads data from ./hmsvm_toydata/hmsvm_data.mat and writes the trained HM-SVM (as well as intermediate results) to ./hmsvm_toydata/segmentation/ (directory is created if not existent). Execute: For MATLAB: 1. main('cplex') to use the CPLEX optimizer 2. main('mosek') to use the MOSEK optimizer For Octave: 1. main('oct_cplex') to use the CPLEX optimizer 2. main('mosek') to use the MOSEK optimizer This script offers a range of configuration options for HM-SVM training thereby also facilitating cross-validation and model selection. Make sure to set the library path correctly before starting matlab or octave, e.g. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/mosek/6/tools/platform/linux64x86/bin/ How to specify other state models? ---------------------------------- Create another subdirectory under models/ (like two_state/) and re-implement all matlab functions present in the model/two-state/ subdirectory (except for simulate_data.m). Their function names have to be specified in the model_config.m function. Adjust setup_hmsvm_training.m (lines 30-35) accordingly. When writing code for a new state model make_model.m is a good starting point.