/** The shipped classifier sources and the starting point for a custom one. */ import silenceGapKnnSrc from './silence_gap_knn.m?raw'; import overlapPursuitSrc from './overlap_pursuit.m?raw'; /** The built-in numbl classifiers, keyed by their ClassifierState method * value. silence_gap_knn is the default; overlap_pursuit adds matching * pursuit over merged regions for takes with overlapping hits. */ export const BUILTIN_CLASSIFIERS = { builtin: { name: 'silence_gap_knn', source: silenceGapKnnSrc }, pursuit: { name: 'overlap_pursuit', source: overlapPursuitSrc }, } as const; export type BuiltinMethod = keyof typeof BUILTIN_CLASSIFIERS; export const DEFAULT_CLASSIFIER_NAME = BUILTIN_CLASSIFIERS.builtin.name; export const DEFAULT_CLASSIFIER_SOURCE = BUILTIN_CLASSIFIERS.builtin.source; export const CUSTOM_CLASSIFIER_TEMPLATE = `function [times, labels] = my_classifier(x, fs, training) % x the take, column vector at fs Hz (16 kHz) % training struct: snips {1 x nVoices} cell of [snipLen x nSnips] % matrices (columns are training snippets), names {1 x nVoices}, % pre (samples before the hit onset within each snippet) % Return column vectors: hit times in seconds and 1-based voice indices. % The same interface as the audio-spike-sorting benchmark, so an % algorithm developed there drops in here unchanged. times = zeros(0, 1); labels = zeros(0, 1); end `;