Roll your own iPython Notebook server with Amazon Web Services (EC2) using their Free Tier.
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
+/* | |
+ * Author: Samyak Datta (datta[dot]samyak[at]gmail.com) | |
+ * | |
+ * A program to demonstrate contour detection using the Active Contour | |
+ * Model (Snake). The cvSnakeImage() method is applied to detect lip | |
+ * contour in a lip ROI image. | |
+ * | |
+ */ | |
+ | |
+#include "opencv2/highgui/highgui.hpp" |
I've been interested in computer vision for a long time, but I haven't had any free time to make any progress until this holiday season. Over Christmas and the New Years I experimented with various methodologies in OpenCV to detect road signs and other objects of interest to OpenStreetMap. After some failed experiments with thresholding and feature detection, the excellent /r/computervision suggested using the dlib C++ module because it has more consistently-good documentation and the pre-built tools are faster.
After a day or two figuring out how to compile the examples, I finally made some progress:
- Clone
dlib
from Github to your local machine:
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
#include "CsvWriter.h" | |
#include <windows.h> | |
#include <time.h> // for random number generator | |
#include <string> | |
#include <vector> | |
#include <fstream> // std::ofstream |
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
%gpuDevice() %info about GPU | |
clear | |
gpuDevice(1); %reset GPU device | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
%test matrix multiplication | |
try | |
%n= 100; | |
for m=100:100:10000 | |
n=m; |
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 = [1 2 3; 2 5 7; 3 7 9] | |
a = | |
1 2 3 | |
2 5 7 | |
3 7 9 | |
>> [U S V] = svd(a) |
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
# Mathieu Blondel, September 2010 | |
# License: BSD 3 clause | |
import numpy as np | |
from numpy import linalg | |
import cvxopt | |
import cvxopt.solvers | |
def linear_kernel(x1, x2): | |
return np.dot(x1, x2) |
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 | |
def read_data(): | |
#M x N | |
data= np.loadtxt("data_3d.txt",delimiter=" ", skiprows=1, usecols=(0,1,2)) | |
print data.shape | |
# print data | |
return data | |