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
impredicative / logger.py
Last active Mar 23, 2020
Python json logging using structlog and stdlib logging
View logger.py
"""
Usage example:
from logger import get_logger
log = get_logger()
log.info('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:
event
_func
@udibr
udibr / gruln.py
Last active Nov 7, 2020
Keras GRU with Layer Normalization
View gruln.py
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
set.
# Arguments
@aabadie
aabadie / joblib-s3.py
Created Jun 17, 2016
Dump arbitrary object in an Amazon S3 cloud storage using Joblib
View joblib-s3.py
"""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"
View interactive_machine_learning.md

Interactive Machine Learning

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

@tomrunia
tomrunia / tensorflow_log_loader.py
Created Mar 2, 2016
Reading out binary TensorFlow log file and plotting process using MatplotLib
View tensorflow_log_loader.py
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
felipou / retry.sh
Last active Jul 13, 2021
Retry command
View retry.sh
#!/bin/bash
#
# 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:
# retry [-s SLEEP_TIME] [-m MAX_RETRIES] COMMAND_WITH_ARGUMENTS
#
@mmmikael
mmmikael / mnist_siamese.py
Last active Jan 24, 2021
Keras example for siamese training on mnist
View mnist_siamese.py
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
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)
(request
"https://idonethis.com/api/v0.1/dones/"
View Hungarian.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.