Skip to content

Instantly share code, notes, and snippets.

@AcOfSJ
AcOfSJ / check_grad.m
Created September 18, 2017 01:28 — forked from jiayuzhou/check_grad.m
The simple gradient check function.
function check_grad(f, x0, varargin)
% a simple function that checks the correctness of gradient.
% INPUT
% f - a function handle of f(x) that returns function values and gradients given parameter x
% x0 - the location near which the gradient will be evaluted.
% For a correct gradiet, the displayed ratio should be near 1.0
%
% to check why the code works there is a useful link:
% http://ufldl.stanford.edu/tutorial/supervised/DebuggingGradientChecking/
@AcOfSJ
AcOfSJ / pg-pong.py
Created September 18, 2017 01:25 — 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
@AcOfSJ
AcOfSJ / TMAC1900_Merlin.md
Created September 18, 2017 01:24 — forked from jiayuzhou/TMAC1900_Merlin.md
Flash Merlin to TM-AC1900

Flash Merlin (https://asuswrt.lostrealm.ca) experience

Bought TMobile Cellspot (TM-AC1900) and would like to flash Merlin firmware.

  1. Purchased router equipped with TMobile firmware version: 3.0.0.4.376_2827 Gateway address: 192.168.27.1

  2. Downgrade TMoble firmware to enable TELNET 1.1 Get into recovery mode (hold reset and power up, until ping TTL=100) 1.2 Downgrade to Tmobile firmware version: 3.0.0.4_376_1703 TRX use tftp binary transfer.

@AcOfSJ
AcOfSJ / uninstall-GHfM.sh
Last active September 18, 2017 01:22 — forked from lukehefson/uninstall-GHfM.sh
Completely uninstall GitHub for Mac
#!/bin/bash
function remove_dir () {
rm -rf "$1_"
if [ -d "$1" ]
then
mv "$1" "$1_"
fi
}