Skip to content

Instantly share code, notes, and snippets.

View fsodogandji's full-sized avatar

Fabrice Sodogandji fsodogandji

View GitHub Profile
@slashdotdash
slashdotdash / index.html
Last active August 25, 2017 01:30
React + D3
<!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>
@danoneata
danoneata / fisher_vector.py
Last active December 6, 2023 06:25
Fisher vectors with sklearn
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.
@staltz
staltz / introrx.md
Last active July 17, 2025 11:35
The introduction to Reactive Programming you've been missing
@andreasvc
andreasvc / TopicModeling.ipynb
Created October 23, 2014 20:51
Topic Modeling with gensim. Load in ipython notebook or view online: http://nbviewer.ipython.org/gist/andreasvc/66fe7547b05569c9a273
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""
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:
@karpathy
karpathy / min-char-rnn.py
Last active July 16, 2025 02:33
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
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`
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mkoehrsen
mkoehrsen / segment.py
Created November 25, 2015 18:48
Superpixel segmentation in python with SLIC and watershed
# 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