Skip to content

Instantly share code, notes, and snippets.

@lilrex
lilrex / speaker_segmentation.py
Created May 17, 2017 13:11
Speaker Segmentation using BIC agglomerative clustering on MFCC features
import numpy as np
from sklearn import mixture
from sklearn.cluster import KMeans
from sklearn.externals import joblib
init_cluster = 10 # initial number of clusters in KMeans
d = 13 # feature dimension
n_components = 16 # number of Gaussian mixtures in GMM
scale = 200 # number of frames per second
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
/**
* A simple class to solve the Set game with arbitrary number of cards, dimensions and feature values.
* It uses a 2-D array of integers to represent a deck a cards, where d1 represents the card index
* and d1 represents the feature values for the card dimensions, the solver can benefit from this simplification.
*
* Another way to look at it is to assume that an ordinal dictionary of feature names and values is given.
@lilrex
lilrex / index.html
Created May 13, 2016 00:43
Simple auto-suggestion/completion demo using jQuery and Elasticsearch
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Autosuggestion Elasticsearch Demo</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
</head>