(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>React + D3</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/react/0.8.0/react.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/react/0.8.0/JSXTransformer.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.3.13/d3.js"></script> |
import numpy as np | |
import pdb | |
from sklearn.datasets import make_classification | |
from sklearn.mixture import GaussianMixture as GMM | |
def fisher_vector(xx, gmm): | |
"""Computes the Fisher vector on a set of descriptors. |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
""" | |
Implementations of: | |
Probabilistic Matrix Factorization (PMF) [1], | |
Bayesian PMF (BPMF) [2], | |
Modified BPFM (mBPMF) | |
using `pymc3`. mBPMF is, to my knowledge, my own creation. It is an attempt | |
to circumvent the limitations of `pymc3` w/regards to the Wishart distribution: |
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
#!/bin/bash | |
# | |
# Requires: | |
# - gdal_sieve.py | |
# - ogr2ogr (GDAL) | |
# - topojson (node.js) | |
# Grab the relative directory for source file. | |
SRC_DIR=`dirname $0` |
# Superpixel segmentation approach that seems to give pretty good contiguous segments. | |
# (SLIC and quickshift don't seem to guarantee contiguity). The approach is to get initial | |
# segments from SLIC, use the centroid of each as a marker for watershed, then clean up. | |
import os, argparse | |
from skimage import segmentation | |
from skimage.future import graph | |
import cv2, numpy | |
import tempfile | |
import random |
#!/usr/bin/python | |
import numpy as np | |
import cv2 | |
import densecrf as dcrf | |
from skimage.segmentation import relabel_sequential | |
import sys | |
# Usage: | |
# python dense_inference.py image annotations output |