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 glob | |
import logging | |
import os | |
import numpy as np | |
import re | |
import soundfile | |
from numpy.lib.stride_tricks import as_strided | |
from maracas.maracas import asl_meter | |
from audio_tools import iterate_invert_spectrogram |
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.autograd import Variable | |
import numpy as np | |
import pickle | |
import os | |
from glob import glob | |
from tqdm import tqdm |
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
-- Build files have been written to: /home/jfsantos/pytorch/torch/lib/build/libshm | |
[ 50%] Built target torch_shm_manager | |
[ 75%] Building CXX object CMakeFiles/shm.dir/core.cpp.o | |
/home/jfsantos/pytorch/torch/lib/libshm/core.cpp:149:1: error: invalid conversion from 'void* (*)(void*, long int)' to 'void* (*)(void*, ptrdiff_t) {aka void* (*)(void*, int)}' [-fpermissive] | |
}; | |
^ | |
/home/jfsantos/pytorch/torch/lib/libshm/core.cpp:149:1: error: invalid conversion from 'void* (*)(void*, void*, long int)' to 'void* (*)(void*, void*, ptrdiff_t) {aka void* (*)(void*, void*, int)}' [-fpermissive] | |
CMakeFiles/shm.dir/build.make:62: recipe for target 'CMakeFiles/shm.dir/core.cpp.o' failed | |
make[2]: *** [CMakeFiles/shm.dir/core.cpp.o] Error 1 | |
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/shm.dir/all' failed |
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
from __future__ import division | |
import multiprocessing | |
import scipy.spatial.distance | |
import numpy as np | |
import sklearn.datasets | |
from time import time | |
from multiprocessing import Pool | |
from itertools import combinations |
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
def train_fn(model, optimizer, criterion, batch): | |
x, y, lengths = batch | |
x = Variable(x.cuda()) | |
y = Variable(y.cuda(), requires_grad=False) | |
mask = Variable(torch.ByteTensor(x.size()).fill_(1).cuda(), | |
requires_grad=False) | |
for k, l in enumerate(lengths): | |
mask[:l, k, :] = 0 |
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
from torch.utils.data import Dataset | |
class DummyDataset(Dataset): | |
def __init__(self, items): | |
super(DummyDataset, self).__init__() | |
self.items = items | |
def __getitem__(self, index): | |
return self.items[index] |
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
Agility | |
&{template:default} {{name=@{selected|character_name}}}{{Agility roll=[[1d20 + @{selected|agility_mod} + [[?{# Boons|0} - ?{# Banes|0}]]d6k1]]}} | |
Intellect | |
&{template:default} {{name=@{selected|character_name}}}{{Intellect roll=[[1d20 + @{selected|intellect_mod} + [[?{# Boons|0} - ?{# Banes|0}]]d6k1]]}} | |
Perception |
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
''' | |
A logistic regression example using the meta-graph checkpointing | |
features of Tensorflow. | |
Author: João Felipe Santos, based on code by Aymeric Damien | |
(https://github.com/aymericdamien/TensorFlow-Examples/) | |
''' | |
from __future__ import print_function |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
from keras.models import Sequential | |
from keras.layers import Dense | |
from keras.utils.io_utils import HDF5Matrix | |
import numpy as np | |
def create_dataset(): | |
import h5py | |
X = np.random.randn(200,10).astype('float32') | |
y = np.random.randint(0, 2, size=(200,1)) | |
f = h5py.File('test.h5', 'w') |
NewerOlder