Skip to content

Instantly share code, notes, and snippets.

View Duum's full-sized avatar

杜渺 Duum

  • Beijing jiaotong university
View GitHub Profile
@Duum
Duum / gist:9b3d6ff9ca38f4314db5
Created February 22, 2016 06:39 — forked from benanne/gist:3274371
mel spectrograms
import numpy as np
def freq2mel(freq):
return 1127.01048 * np.log(1 + freq / 700.0)
def mel2freq(mel):
return (np.exp(mel / 1127.01048) - 1) * 700
def mel_binning_matrix(specgram_window_size, sample_frequency, num_mel_bands):
@Duum
Duum / install-tensorflow.sh
Created March 7, 2016 05:36 — forked from erikbern/install-tensorflow.sh
Installing TensorFlow on EC2
# Note – this is not a bash script (some of the steps require reboot)
# I named it .sh just so Github does correct syntax highlighting.
#
# This is also available as an AMI in us-east-1 (virginia): ami-cf5028a5
#
# The CUDA part is mostly based on this excellent blog post:
# http://tleyden.github.io/blog/2014/10/25/cuda-6-dot-5-on-aws-gpu-instance-running-ubuntu-14-dot-04/
# Install various packages
sudo apt-get update
@Duum
Duum / faux_cudnn.py
Created November 20, 2017 12:44 — forked from JonathanRaiman/faux_cudnn.py
Convert CUDNN LSTM to Dynamic RNN
"""
Little script demonstration how to run cudnn rnns
without cudnn using dynamic rnn with the same weights
(e.g. train on cudnn, use with dynamic rnn on cpu).
Note: this will run slower than cudnn on a gpu (see below).
Tested on Titan X Pascal:
With cudnn 3.5s vs. with dynamic_rnn 8s to run through 79 batches
with batch size 128.
Network: input size: 127, 2 layer bidirectional LSTM with num_units 200.
@Duum
Duum / git_rebase.md
Created September 20, 2022 08:52 — forked from ravibhure/git_rebase.md
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream