Skip to content

Instantly share code, notes, and snippets.

View sksq96's full-sized avatar

Shubham Chandel sksq96

View GitHub Profile
@sksq96
sksq96 / min-char-rnn.py
Created December 16, 2016 19:17 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@sksq96
sksq96 / pg-pong.py
Created January 2, 2017 13:01 — forked from karpathy/pg-pong.py
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@sksq96
sksq96 / README.md
Created January 7, 2017 04:01 — forked from jxson/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

@sksq96
sksq96 / CartPole-v0.py
Created January 7, 2017 10:05 — forked from carlos-aguayo/CartPole-v0.py
OpenAI Gym CartPole-v0
import gym
import pandas as pd
import numpy as np
import random
# https://gym.openai.com/envs/CartPole-v0
# Carlos Aguayo - carlos.aguayo@gmail.com
class QLearner(object):
@sksq96
sksq96 / agent.py
Created January 7, 2017 10:09
Random weighted product of parameters for CartPole-v0
# -*- coding: utf-8 -*-
# @Author: shubham
# @Date: 2016-12-25 23:40:18
# @Last Modified by: shubham
# @Last Modified time: 2017-01-07 15:30:41
import gym
from gym import wrappers
import numpy as np
@sksq96
sksq96 / preproc.py
Created January 22, 2017 20:23 — forked from kastnerkyle/preproc.py
General preprocessing transforms in scikit-learn compatible format
# (C) Kyle Kastner, June 2014
# License: BSD 3 clause
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.utils import gen_batches
from scipy.linalg import eigh
from scipy.linalg import svd
import numpy as np
# From sklearn master
@sksq96
sksq96 / tmux-cheatsheet.markdown
Created March 7, 2017 22:29 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@sksq96
sksq96 / gist:a1b1c6331e2e60ea773ae725866668ac
Created March 16, 2017 05:54 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:

How to install dlib HEAD (w/ python bindings) from github

These instructions assume you are on macOS, but basically the same on Linux.

Pre-reqs:

  • Have Python 3 installed. On macOS, this could be installed from homebrew or even via standard Python 3.6 downloaded installer from https://www.python.org/download. On Linux, just use your package manager.
  • On macOS, install XCode from the Mac App Store (or install the XCode command line utils).
  • On Linux, install boost (sudo apt-get install libboost-all-dev)
@sksq96
sksq96 / a2dp.py
Created April 27, 2017 20:31 — forked from pylover/a2dp.py
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3.5
"""
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04 and also debian jessie, with bluez5.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .