Skip to content

Instantly share code, notes, and snippets.

View wonglkd's full-sized avatar

Daniel Wong wonglkd

View GitHub Profile
@wonglkd
wonglkd / cluster.md
Last active August 30, 2018 14:53
Tool Chain
  • Brooce for managing jobs
  • Secure Pipes for managing SSH tunnels (great when you have Bastions)
  • ?? for monitoring
  • tmux on bastion for session management
@eshelman
eshelman / latency.txt
Last active April 21, 2024 07:13 — forked from jboner/latency.txt
HPC-oriented Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference/hit 1.5 ns 4 cycles
Floating-point add/mult/FMA operation 1.5 ns 4 cycles
L2 cache reference/hit 5 ns 12 ~ 17 cycles
Branch mispredict 6 ns 15 ~ 20 cycles
L3 cache hit (unshared cache line) 16 ns 42 cycles
L3 cache hit (shared line in another core) 25 ns 65 cycles
Mutex lock/unlock 25 ns
L3 cache hit (modified in another core) 29 ns 75 cycles
'''Trains a multi-output deep NN on the MNIST dataset using crossentropy and
policy gradients (REINFORCE).
The goal of this example is twofold:
* Show how to use policy graidents for training
* Show how to use generators with multioutput models
# Policy graidients
This is a Reinforcement Learning technique [1] that trains the model
following the gradient of the logarithm of action taken scaled by the advantage
(reward - baseline) of that action.
# Generators
@jkleint
jkleint / shuffle_weights.py
Created July 10, 2016 05:24
Quickly re-initialize weights of a Keras model
#!/usr/bin/env python
"""Demonstrate Keras model weight shuffling as fast alternative to re-creating a model."""
from __future__ import print_function
import numpy as np
from keras.layers import Dense
from keras.models import Sequential
@EderSantana
EderSantana / CATCH_Keras_RL.md
Last active October 16, 2023 08:32
Keras plays catch - a single file Reinforcement Learning example
@vanderlin
vanderlin / Sublime Text 3 Command
Last active March 21, 2023 07:49
Create a Sublime Text 3 symbolic link to open a file via command line. paste this into terminal and now you can run `subl .` to open the directory in sublime or `subl file.html`
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
@karpathy
karpathy / min-char-rnn.py
Last active May 4, 2024 17:44
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)
@twosixcode
twosixcode / gist:1988097
Created March 6, 2012 18:40
Make "Paste and Indent" the default paste in Sublime Text 2
// swap the keybindings for paste and paste_and_indent
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" }