This file contains hidden or 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
| package processing.segmentation; | |
| import java.util.ArrayList; | |
| /** | |
| * Compute the Dynamic Time Warping Distance | |
| * | |
| * @author Daniel Kohlsdorf | |
| */ | |
| public class DynamicTimeWarping { |
This file contains hidden or 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
| package processing.inference; | |
| import java.util.ArrayList; | |
| import processing.model.HiddenMarkovModel; | |
| import processing.utils.ProbabilityUtils; | |
| /** | |
| * Inference algorithms used for training and decoding hidden markov models. |
This file contains hidden or 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
| package processing.inference; | |
| import java.util.ArrayList; | |
| import java.util.Vector; | |
| import processing.model.Gaussian; | |
| import processing.model.GaussianMixture; | |
| import processing.model.HiddenMarkovModel; | |
| import processing.model.ProbabilityDistibution; | |
| import processing.utils.ProbabilityUtils; |
This file contains hidden or 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
| package processing.signals; | |
| import java.util.ArrayList; | |
| import processing.utils.ProbabilityUtils; | |
| /** | |
| * Viterbi Style Whistle Tracing | |
| * | |
| * @author Daniel Kohlsdorf |
This file contains hidden or 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
| package processing.utils; | |
| /** | |
| * Utilities to compute log probabilities | |
| * | |
| * @author Daniel Kohlsdorf | |
| */ | |
| public class ProbabilityUtils { | |
| public static final double ZERO = Double.NEGATIVE_INFINITY; |
This file contains hidden or 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
| package analysis.preprocessing; | |
| import java.util.HashMap; | |
| import java.util.Vector; | |
| import database.OhuraDB; | |
| import database.indexing.LocalFeature; | |
| /** | |
| * Topic Modeling using the Latent Dirichlet |
This file contains hidden or 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
| package prediction; | |
| import org.apache.commons.math3.linear.Array2DRowRealMatrix; | |
| import org.apache.commons.math3.linear.ArrayRealVector; | |
| /** | |
| * Item based interpolation | |
| * | |
| * @author Daniel Kohlsdorf | |
| */ |
This file contains hidden or 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
| public class BinarySearch { | |
| public static int search(int[] sorted, int element) { | |
| int min = 0; | |
| int max = sorted.length; | |
| while(max > min) { | |
| int mid = min + (max - min) / 2; | |
| if(sorted[mid] == element) { | |
| return element; |
This file contains hidden or 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
| public class RecerseAString { | |
| public static String reverse(String string) { | |
| char str[] = string.toCharArray(); | |
| for(int i = 0; i < str.length / 2; i++) { | |
| char tmp = str[i]; | |
| str[i] = str[str.length - 1 - i]; | |
| str[str.length - 1 - i] = tmp; | |
| } |
This file contains hidden or 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
| public class LongestCommonSubsequence { | |
| public static int length(String x, String y) { | |
| int N = x.length(); | |
| int M = y.length(); | |
| int lcs[][] = new int[N + 1][M + 1]; | |
| for(int i = 1; i < N + 1; i++) { | |
| for(int j = 1; j < M + 1; j++) { |
OlderNewer