Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
New feature | ✨ :sparkles: |
Bugfix | 🐛 :bug: |
""" | |
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) |
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
New feature | ✨ :sparkles: |
Bugfix | 🐛 :bug: |
// a very minimal instruction set. | |
// it has just enough operations to implement a recursive | |
// fibonacci function - what a coincidence :D | |
// NOTE: in my VM, i don't use an `enum`. | |
// this is just for simplicity. | |
#[derive(Clone, Copy, Debug)] | |
enum Instruction { | |
LoadInt { dst: u8, value: i16 }, | |
Copy { dst: u8, src: u8 }, | |
Add { dst: u8, src1: u8, src2: u8 }, |
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
Cython has two major benefits:
Cython gains most of it's benefit from statically typing arguments. However, statically typing is not required, in fact, regular python code is valid cython (but don't expect much of a speed up). By incrementally adding more type information, the code can speed up by several factors. This gist just provides a very basic usage of cython.
# WARNING: These steps seem to not work anymore! | |
#!/bin/bash | |
# Purge existign CUDA first | |
sudo apt --purge remove "cublas*" "cuda*" | |
sudo apt --purge remove "nvidia*" | |
# Install CUDA Toolkit 10 | |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb |
class Expr(object): | |
def accept(self, visitor): | |
method_name = 'visit_{}'.format(self.__class__.__name__.lower()) | |
visit = getattr(visitor, method_name) | |
return visit(self) | |
class Int(Expr): | |
def __init__(self, value): | |
self.value = value |
#include <cudnn.h> | |
#include <cassert> | |
#include <cstdlib> | |
#include <iostream> | |
#include <opencv2/opencv.hpp> | |
#define checkCUDNN(expression) \ | |
{ \ | |
cudnnStatus_t status = (expression); \ | |
if (status != CUDNN_STATUS_SUCCESS) { \ |
"""Short and sweet LSTM implementation in Tensorflow. | |
Motivation: | |
When Tensorflow was released, adding RNNs was a bit of a hack - it required | |
building separate graphs for every number of timesteps and was a bit obscure | |
to use. Since then TF devs added things like `dynamic_rnn`, `scan` and `map_fn`. | |
Currently the APIs are decent, but all the tutorials that I am aware of are not | |
making the best use of the new APIs. | |
Advantages of this implementation: |