Skip to content

Instantly share code, notes, and snippets.


Jaganadh Gopinadhan jaganadhg

Block or report user

Report or block jaganadhg

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
from sklearn.cluster import KMeans
from sklearn import metrics
import cv2
# By Adrian Rosebrock
import numpy as np
import cv2
# Load the image
image = cv2.imread("red.png")
jaganadhg /
Created May 18, 2017 — forked from chsasank/
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
View something2vec.list
- word2vec
- sentence2vec, paragraph2vec, doc2vec
- tweet2vec
- tweet2vec
- author2vec
- item2vec
- lda2vec
- illustration2vec
- tag2vec
- category2vec
jaganadhg / gap
Last active Feb 11, 2018
Implementation of Gap Statistic from Tibshirani, Walther, Hastie to determine the inherent number of clusters in a dataset with k-means clustering.
View gap
#!/usr/bin/env python
Author : Jaganadh Gopinadhan
Licence : Apahce 2
e-mail jaganadhg at gmail dot com
import scipy
from sklearn.cluster import KMeans
View friggericvjagan.tex
%!TEX TS-program = xelatex
jaganadhg / MSSS_BMS.txt
Last active Jul 1, 2016
View MSSS_BMS.txt
Amazon question/answer data
Deep Learning for Visual Question Answering
R Clustering Packages
Deep learning
Cluster with Theano
from sklearn.cluster import k_means_
from sklearn.metrics.pairwise import cosine_similarity, pairwise_distances
from sklearn.preprocessing import StandardScaler
def create_cluster(sparse_data, nclust = 10):
# Manually override euclidean
def euc_dist(X, Y = None, Y_norm_squared = None, squared = False):
#return pairwise_distances(X, Y, metric = 'cosine', n_jobs = 10)
jaganadhg / 0_reuse_code.js
Created Jan 8, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
import pylab as plt
import numpy as np
from scipy.spatial.distance import cdist, pdist
from sklearn.cluster import KMeans
from sklearn.datasets import load_iris
iris = load_iris()
k = range(1,11)
You can’t perform that action at this time.