Skip to content
{{ message }}

Instantly share code, notes, and snippets.

🎯
Focusing

Chris Hoyean Song chris-chris

🎯
Focusing
Last active Sep 11, 2017
simple 1-step gradient descent
View simple_gradient_descent.py
 # From udacity Machine Learning Nanodegree course import numpy as np # Define sigmoid function def sigmoid(x): return 1/(1+np.exp(-x)) # Derivative of the sigmoid function def sigmoid_derivative(x):
Last active Aug 1, 2021
System Design Cheatsheet
View System Design.md

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

1. Clarify and agree on the scope of the system
• User cases (description of sequences of events that, taken together, lead to a system doing something useful)
• Who is going to use it?
• How are they going to use it?
Last active Jul 30, 2021
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
View min-char-rnn.py
 """ 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)
Last active Jul 30, 2021
An efficient, batched LSTM.
View gist:587454dc0146a6ae21fc
 """ This is a batched LSTM forward and backward pass """ import numpy as np import code class LSTM: @staticmethod def init(input_size, hidden_size, fancy_forget_bias_init = 3):