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 os | |
import csv | |
from zipfile import ZipFile | |
from contextlib import contextmanager | |
import torch | |
from PIL import Image | |
class _ImageZipDataset(torch.utils.data.Dataset): |
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 torch | |
import numpy as np | |
from matplotlib import pyplot as plt | |
def make_model_diagrams(outputs, labels, n_bins=10): | |
""" | |
outputs - a torch tensor (size n x num_classes) with the outputs from the final linear layer | |
- NOT the softmaxes | |
labels - a torch tensor (size n) with the labels | |
""" |
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 fs from 'fs-promise'; | |
import DAG from 'dag-map'; | |
import glob from 'glob'; | |
import promisify from 'es6-promisify'; | |
const promisedGlob = promisify(glob); | |
(async function() { | |
const dag = new DAG(); | |
const allPackageFilePaths = await promisedGlob('**/node_modules/*/package.json'); |
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
def has_analytics_message?(msg) | |
document.synchronize do |variable| | |
gaq = evaluate_script('window._gaq') | |
raise Capybara::ElementNotFound, "#{msg} was not fired.\nActual analytics events triggered:\n\n#{gaq}" unless gaq.include?(msg) | |
end | |
true | |
end |