Algorithms¶
MSAF comes with two types of algorithms: boundary detection and label clustering algorithms. Below, the included algorithms are discussed and classified based on these two categories. Note that some algorithms can actually approach both subproblems.
Additionally, two other algorithms published under a GPL license can be obtained from the msaf-gpl repo.
Boundary Algorithms¶
Checkerboard Kernel¶
Segmenter (file_struct[, in_bound_idxs, ...]) |
This script identifies the boundaries of a given track using the Foote |
Convex Non-Negative Matrix Factorization¶
Segmenter (file_struct[, in_bound_idxs, ...]) |
This script identifies the structure of a given track using a modified version |
Ordinal Linear Discriminant Analysis¶
Segmenter (file_struct[, in_bound_idxs, ...]) |
This class implements the algorithm described here: |
Laplacian Segmentation¶
Segmenter (file_struct[, in_bound_idxs, ...]) |
This script identifies the boundaries of a given track using the Spectral |
Label Algorithms¶
2D-Fourier Magnitude Coefficients¶
Segmenter (file_struct[, in_bound_idxs, ...]) |
This method labels segments using the 2D-FMC method described here: |
Convex Non-Negative Matrix Factorization¶
Segmenter (file_struct[, in_bound_idxs, ...]) |
This script identifies the structure of a given track using a modified version |
Adding A New Algorithm to MSAF¶
To include a new algorithm in MSAF, the following steps should be performed:
Create new directory in the algorithms directory with the desired algorithm name.
Create 3 new files in this new directory:
__init__.py
,config.py
, andsegmenter.py
.The
__init__.py
file should import everything from the newconfig.py
andsegmenter.py
files.The
config.py
should contain the following variables:
config
: variable with the parameters of the algorithm.algo_id
: string with the algorithm identifier.is_boundary_type
: boolean that determines whether the algorithm allows boundary detection.is_label_type
: boolean that determines whether the algorithm allows labeling.The
segmenter.py
should contain a classSegmenter
that inherits fromSegmenterInterface
and implements the methodprocessFlatt
. This is where the main algorithm is implemented.
In the folder algorithms/example an example of a new algorithm is included. The easiest way to add a new algorithm to MSAF is to copy and paste the example directory to use it as the base code of the new algorithm.