Skip to content

Instantly share code, notes, and snippets.

View evaluation.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
impredicative /
Last active Mar 23, 2020
Python json logging using structlog and stdlib logging
Usage example:
from logger import get_logger
log = get_logger()'my_event', my_key1='val 1', my_key2=5, my_key3=[1, 2, 3], my_key4={'a': 1, 'b': 2})
List of metadata keys in each log message:
udibr /
Last active Nov 7, 2020
Keras GRU with Layer Normalization
import numpy as np
from keras.layers import GRU, initializations, K
from collections import OrderedDict
class GRULN(GRU):
'''Gated Recurrent Unit with Layer Normalization
Current impelemtation only works with consume_less = 'gpu' which is already
# Arguments
aabadie /
Created Jun 17, 2016
Dump arbitrary object in an Amazon S3 cloud storage using Joblib
"""Example of usage of Joblib with Amazon S3."""
import s3io
import joblib
import numpy as np
big_obj = [np.ones((500, 500)), np.random.random((1000, 1000))]
# Customize the following values with yours
bucket = "my-bucket"

Interactive Machine Learning

Taught by Brad Knox at the MIT Media Lab in 2014. Course website. Lecture and visiting speaker notes.

tomrunia /
Created Mar 2, 2016
Reading out binary TensorFlow log file and plotting process using MatplotLib
import numpy as np
from tensorflow.python.summary.event_accumulator import EventAccumulator
import matplotlib as mpl
import matplotlib.pyplot as plt
def plot_tensorflow_log(path):
# Loading too much data is slow...
tf_size_guidance = {
felipou /
Last active Jul 13, 2021
Retry command
# Created by Felipe Machado - 2016/02/14
# A retry command for bash
# Retries the given command up to MAX_RETRIES, with an interval of SLEEP_TIME
# between each retry. Just put it on your bash_profile and be happy :)
# Usage:
mmmikael /
Last active Jan 24, 2021
Keras example for siamese training on mnist
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
np.random.seed(1337) # for reproducibility
import random
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers.core import *
from keras.optimizers import SGD, RMSprop
matburt / org2idonethis.el
Created Jan 13, 2016
Emacs module for submitting org journal items to idonethis
View org2idonethis.el
(defun org-idonethis-capture ()
"Captures captures and sends them to idonethis"
(message "before hook")
(cond ((string-match "\:tag-to-match\:" (buffer-string))
(goto-char (point-min))
(search-forward "****")
(setq note-contents (buffer-substring (+ (point) 1) (line-end-position)))
(message note-contents)
View Hungarian.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.