Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
This file contains 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
################################################################ | |
# DOWNLOAD ENTIRE FOLDER STRUCTURE FROM DROPBOX TO LOCAL DRIVE # | |
################################################################ | |
# Instructions: | |
# (1) install dropbox API using pip | |
# > pip install dropbox | |
# (2) Create application to make requests to the Dropbox API | |
# - Go to: https://dropbox.com/developers/apps |
This file contains 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 | |
from torch import LongTensor | |
from torch.nn import Embedding, LSTM | |
from torch.autograd import Variable | |
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence | |
## We want to run LSTM on a batch of 3 character sequences ['long_str', 'tiny', 'medium'] | |
# | |
# Step 1: Construct Vocabulary | |
# Step 2: Load indexed data (list of instances, where each instance is list of character indices) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 TemporalBlock(tf.layers.Layer): | |
def __init__(self, n_outputs, kernel_size, strides, dilation_rate, dropout=0.2, | |
trainable=True, name=None, dtype=None, | |
activity_regularizer=None, **kwargs): | |
super(TemporalBlock, self).__init__( | |
trainable=trainable, dtype=dtype, | |
activity_regularizer=activity_regularizer, | |
name=name, **kwargs | |
) | |
self.dropout = dropout |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
library(tidyverse) | |
# Data is downloaded from here: | |
# https://www.kaggle.com/c/digit-recognizer | |
kaggle_data <- read_csv("~/Downloads/train.csv") | |
pixels_gathered <- kaggle_data %>% | |
mutate(instance = row_number()) %>% | |
gather(pixel, value, -label, -instance) %>% | |
extract(pixel, "pixel", "(\\d+)", convert = TRUE) |
This file contains 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 numpy as np | |
from scipy.optimize import curve_fit | |
import scipy as sy | |
import matplotlib.pyplot as plt | |
d = np.array([75, 80, 90, 95, 100, 105, 110, 115, 120, 125], dtype=float) | |
p1 = np.array([6, 13, 25, 29, 29, 29, 30, 29, 30, 30], dtype=float) / 30. # scale to 0..1 | |
# psychometric function | |
def pf(x, alpha, beta): |
This file contains 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
# wavfile.py (Enhanced) | |
# Date: 20190213_2328 Joseph Ernest | |
# | |
# URL: https://gist.github.com/josephernest/3f22c5ed5dabf1815f16efa8fa53d476 | |
# Source: scipy/io/wavfile.py | |
# | |
# Added: | |
# * read: also returns bitrate, cue markers + cue marker labels (sorted), loops, pitch | |
# See https://web.archive.org/web/20141226210234/http://www.sonicspot.com/guide/wavefiles.html#labl | |
# * read: 24 bit & 32 bit IEEE files support (inspired from wavio_weckesser.py from Warren Weckesser) |
This is a guide for aligning images.
See the full Advanced Markdown doc for more tips and tricks
NewerOlder