This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import tensorflow.contrib as tfc | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import observations | |
from functools import lru_cache | |
tf.reset_default_graph() | |
train_data, test_data = observations.cifar10('data/cifar',) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RingBuffer: | |
def __init__(self, scope_name, components, size): | |
""" | |
Create a new ring buffer of size `size`. | |
Each item in the ring buffer is a tuple of variables of size `len(components)`. | |
:param scope_name: A scope name for the newly created variables | |
:param components: Defines the type of items in the buffer. An iterable of tuples (name: str, shape: Iterable, dtype) | |
:param size: The maximum size of the buffer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
name=${1:-slides} | |
replace='s/^([^ ].*)/# \1§/g; s/^ {8}([^ ].*)/§### \1§/g; s/^ {4}([^ ].*)/§## \1§/g; s/ +(\![[])/\1/g; s/ {12}([^ ]+)/- \1/g; s/\[)]/\1/g' | |
sed -E "$replace" <&0 | tr "§" "\n" > $name.md | |
markdown-to-slides -d $name.md -o $name.html | |
open $name.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fig, ax = plt.subplots() | |
ax.set_title('Figure 2 - Progressing samples') | |
ax.set_xlabel('Erruption length') | |
ax.set_ylabel('Time since last erruption') | |
ax.set_xlim((np.min(x[:, 0]), np.max(x[:, 0]))) | |
ax.set_ylim((np.min(x[:, 1]), np.max(x[:, 1]))) | |
line, = ax.plot([], []) | |
def init(): | |
line.set_data([], []) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
import time | |
plt.rcParams['toolbar'] = 'None' | |
fig = plt.figure() | |
ax = fig.add_subplot(1, 1, 1) | |
def draw(): |