Skip to content

Instantly share code, notes, and snippets.

View fsodogandji's full-sized avatar

Fabrice Sodogandji fsodogandji

View GitHub Profile
@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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@unicolet
unicolet / linuxservers.db
Created October 31, 2012 14:50
Generate a dns zone definition from Salt
@ in soa localhost. root 1 3H 15M 1W 1D
ns localhost.
{% set nets=salt['publish.publish']('*','network.interfaces') %}{% for n in nets %}{% set pdata=salt['publish.publish'](n,'pillar.data') %}{% if pdata.has_key(n) %}{% if pdata[n].has_key('zone') %}{% if pdata[n]['zone']=='linuxservers' %}
{{ n }} IN A {{ nets[n]['eth0']['inet'][0]['address'] }}
{% endif %}{% endif %}{% endif %}{% endfor %}
@Kami
Kami / cassandra_cfstats_histogram.py
Last active October 13, 2015 04:58
Turns output of Cassandra nodetool cfhistograms into pretty graphs (histograms)
#!/usr/bin/env python
# Licensed to Tomaz Muraus under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# Tomaz muraus licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@ogrisel
ogrisel / .gitignore
Last active December 14, 2015 16:29
Demo Notebook + Helper For Distributed Model Selection with IPython.parallel and scikit-learn
*.pyc
*.npy
*.pkl
*.mmap
@fsodogandji
fsodogandji / elastic_transform.py
Created August 11, 2016 10:54 — forked from chsasank/elastic_transform.py
Elastic transformation of an image in Python
import numpy as np
from scipy.ndimage.interpolation import map_coordinates
from scipy.ndimage.filters import gaussian_filter
def elastic_transform(image, alpha, sigma, random_state=None):
"""Elastic deformation of images as described in [Simard2003]_.
.. [Simard2003] Simard, Steinkraus and Platt, "Best Practices for
Convolutional Neural Networks applied to Visual Document Analysis", in
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nlm
nlm / async_loop.py
Created October 18, 2016 08:18
python async loop demo to understand asyncio basics
from functools import wraps
from types import FunctionType, GeneratorType
import logging
import time
def coroutine(f):
@wraps(f)
def wrapper(*args, **kwargs):
logging.debug('coroutine starting: {}'.format(f.__name__))
return f(*args, **kwargs)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stared
stared / README.md
Last active January 18, 2017 13:28
Sequential model in Keras -> ASCII
#!/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