Skip to content

Instantly share code, notes, and snippets.

View faroit's full-sized avatar
🚀
Rocket Science

Fabian-Robert Stöter faroit

🚀
Rocket Science
View GitHub Profile
"""Easily save tf.data.Datasets as tfrecord files, and restore tfrecords as Datasets.
The goal of this module is to create a SIMPLE api to tfrecords that can be used without
learning all of the underlying mechanics.
Users only need to deal with 2 functions:
save(dataset)
dataset = load(tfrecord, header)
To make this work, we create a .header file for each tfrecord which encodes metadata
@carlthome
carlthome / Signal reconstruction from spectrograms.ipynb
Created May 31, 2018 13:53
Try to recover audio from filtered magnitudes when phase information has been lost.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@f0k
f0k / LICENSE
Last active January 15, 2023 22:32
STFT Benchmarks on CPU and GPU in Python
MIT License
Copyright (c) 2017 Jan Schlüter
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@khardix
khardix / download.py
Created October 6, 2017 11:26
Python AsyncIO/aiohttp downloader with progressbars
#!/usr/bin/env python3.6
import asyncio
from contextlib import closing
import aiohttp
import tqdm
async def download(session, url, progress_queue):
@kevinzakka
kevinzakka / data_loader.py
Last active April 19, 2024 23:42
Train, Validation and Test Split for torchvision Datasets
"""
Create train, valid, test iterators for CIFAR-10 [1].
Easily extended to MNIST, CIFAR-100 and Imagenet.
[1]: https://discuss.pytorch.org/t/feedback-on-pytorch-for-kaggle-competitions/2252/4
"""
import torch
import numpy as np
@spro
spro / pytorch-simple-rnn.py
Last active April 25, 2022 10:50
PyTorch RNN training example
import torch
import torch.nn as nn
from torch.nn import functional as F
from torch.autograd import Variable
from torch import optim
import numpy as np
import math, random
# Generating a noisy multi-sin wave
@davecg
davecg / keras_1_to_2.py
Created April 9, 2017 18:01
Convert Keras 1 models to Keras 2
#!/usr/bin/env python3
'''
This will convert Keras 1 model weights and configurations
to their Keras 2 equivalent. Please note that all optimizer
configuration is ignored with this script and models will
need to be recompiled.
'''
import h5py
@udibr
udibr / gruln.py
Last active November 7, 2020 02:34
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
set.
# Arguments
@alexanderwallin
alexanderwallin / unpack_stems.sh
Created June 27, 2016 18:38
Unpacks stems into folders with cover art and separate tracks using ffmpeg
#!/bin/bash
#
# Extracts tracks from stems files and puts them in folders
# named after the stem filenames.
#
for stem in *.mp4
do
name=${stem%\.*}