Skip to content

Instantly share code, notes, and snippets.

View shravankumar147's full-sized avatar
🎯
Focusing

Shravankumar shravankumar147

🎯
Focusing
View GitHub Profile
@shravankumar147
shravankumar147 / mnist_estimator.py
Created July 3, 2018 18:38 — forked from peterroelants/mnist_estimator.py
Example using TensorFlow Estimator, Experiment & Dataset on MNIST data.
"""Script to illustrate usage of tf.estimator.Estimator in TF v1.3"""
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data as mnist_data
from tensorflow.contrib import slim
from tensorflow.contrib.learn import ModeKeys
from tensorflow.contrib.learn import learn_runner
# Show debugging output
@shravankumar147
shravankumar147 / build_face_dataset.py
Created June 28, 2018 03:32 — forked from machinelearning147/build_face_dataset.py
build_face_dataset using webcam
# USAGE
# python build_face_dataset.py --cascade haarcascade_frontalface_default.xml --output dataset/adrian
# import the necessary packages
from imutils.video import VideoStream
import argparse
import imutils
import time
import cv2
import os
@shravankumar147
shravankumar147 / simple_mlp_tensorflow.py
Created December 1, 2017 01:51 — forked from vinhkhuc/simple_mlp_tensorflow.py
Simple Feedforward Neural Network using TensorFlow
# Implementation of a simple MLP network with one hidden layer. Tested on the iris data set.
# Requires: numpy, sklearn>=0.18.1, tensorflow>=1.0
# NOTE: In order to make the code simple, we rewrite x * W_1 + b_1 = x' * W_1'
# where x' = [x | 1] and W_1' is the matrix W_1 appended with a new row with elements b_1's.
# Similarly, for h * W_2 + b_2
import tensorflow as tf
import numpy as np
from sklearn import datasets
from sklearn.model_selection import train_test_split
@shravankumar147
shravankumar147 / how-to-use-pelican.md
Created May 11, 2017 05:01 — forked from JosefJezek/how-to-use-pelican.md
How to use Pelican on GitHub Pages
@shravankumar147
shravankumar147 / beautiful_idiomatic_python.md
Created March 17, 2017 08:14 — forked from JeffPaine/beautiful_idiomatic_python.md
Transforming Code into Beautiful, Idiomatic Python: notes from Raymond Hettinger's talk at pycon US 2013. The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]:
@shravankumar147
shravankumar147 / gist:5433ff6bcb4c98d8902c51840f804597
Created November 6, 2016 06:44 — forked from entaroadun/gist:1653794
Recommendation and Ratings Public Data Sets For Machine Learning

Movies Recommendation:

Music Recommendation:

'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
filename = 'twins';
OUTPUT = 'C:\\Users\\huy\\Desktop\\matlab\\';
TRAIN = 'C:\\Users\\huy\\Desktop\\matlab\\faces\\';
INPUT = 'C:\\Users\\huy\\Desktop\\matlab\\';
% load the training data set (60 faces)
load('data60_256.mat');
% read in original image, face and eyes coordinates/sizes data (from OpenCV's