Skip to content

Instantly share code, notes, and snippets.

@stray-leone
stray-leone / min-char-rnn.py
Created November 28, 2016 08:10 — 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)
@stray-leone
stray-leone / pg-pong.py
Created July 1, 2016 01:56 — 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
@stray-leone
stray-leone / cloudSettings
Last active September 25, 2020 12:34 — forked from syhw/dnn.py
vscode settings sync data
{"lastUpload":"2020-09-25T12:33:59.722Z","extensionVersion":"v3.4.3"}
import theano
from theano.tensor.io import send, recv, mpi_cmps
import theano.sandbox.linalg as linalg
from theano.gof.sched import sort_schedule_fn
from time import time
dot = theano.tensor.dot
dtype = 'float32'
n = 500
run = False
@stray-leone
stray-leone / AutoEncoder.py
Last active August 29, 2015 14:14 — forked from arngarden/gist:6087798
pylearn2 example using python code without yaml
from pylearn2.models import mlp
from pylearn2.models import autoencoder
from pylearn2.models.autoencoder import Autoencoder
from pylearn2.training_algorithms import sgd
from pylearn2.training_algorithms.sgd import SGD
from pylearn2.termination_criteria import EpochCounter
from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix
from pylearn2.utils.serial import save, load
from pylearn2.train import Train
from pylearn2.costs.autoencoder import MeanSquaredReconstructionError
#!/usr/bin/env python2
# coding: utf-8
from __future__ import print_function
import sys
import re
import json
import urllib
from colorama import init, Fore, Back, Style
URL = 'http://csearch.naver.com/dcontent/spellchecker.nhn'
@echo off
SET st2Path=C:\Program Files\Sublime Text 2\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 2\command" /t REG_SZ /v "" /d "%st2Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 2" /t REG_SZ /v "" /d "Open with Sublime Text 2" /f