This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from sklearn.datasets import fetch_mldata | |
from sklearn.decomposition import FastICA, PCA | |
from sklearn.cluster import KMeans | |
# fetch natural image patches | |
image_patches = fetch_mldata("natural scenes data") | |
X = image_patches.data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A deep neural network with or w/o dropout in one file. | |
""" | |
import numpy | |
import theano | |
import sys | |
import math | |
from theano import tensor as T | |
from theano import shared |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# clear the workspace | |
rm(list = ls()) | |
# load the relevant libraries | |
# install.packages(rCUR) | |
library(rCUR) # for CUR decomposition | |
# install.packages(irlba) | |
library(irlba) # for fast svd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import time | |
from sklearn import cluster | |
from sklearn import datasets | |
lfw = datasets.fetch_lfw_people() | |
X_lfw = lfw.data[:, :5] | |
eps = 8. # This choice of EPS gives 44 clusters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from itertools import product | |
from sklearn.decomposition import RandomizedPCA | |
from sklearn.datasets import fetch_mldata | |
from sklearn.utils import shuffle | |
mnist = fetch_mldata("MNIST original") | |
X_train, y_train = mnist.data[:60000] / 255., mnist.target[:60000] |
NewerOlder