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
#!/usr/bin/env python | |
# | |
# Very basic example of using Python and IMAP to iterate over emails in a | |
# gmail folder/label. This code is released into the public domain. | |
# | |
# RKI July 2013 | |
# http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/ | |
# | |
import sys | |
import imaplib |
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 matplotlib.pyplot as plt | |
import soundfile as sf | |
import librosa | |
import librosa.display | |
plt.rcParams['font.family'] = 'serif' | |
plt.rcParams['font.serif'] = 'Ubuntu' | |
plt.rcParams['font.monospace'] = 'Ubuntu Mono' | |
plt.rcParams['font.size'] = 10 | |
plt.rcParams['axes.labelsize'] = 10 # Time and Hz, i.e. 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 matplotlib.pyplot as plt | |
import soundfile as sf | |
import librosa | |
plt.rcParams['font.family'] = 'serif' | |
plt.rcParams['font.serif'] = 'Ubuntu' | |
plt.rcParams['font.monospace'] = 'Ubuntu Mono' | |
plt.rcParams['font.size'] = 10 | |
plt.rcParams['axes.labelsize'] = 10 # Time and Hz, i.e. labels | |
plt.rcParams['axes.labelweight'] = 'bold' |
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 tensorflow as tf | |
from time import time | |
start = time() | |
mnist = tf.keras.datasets.mnist | |
(x_train, y_train),(x_test, y_test) = mnist.load_data() | |
x_train, x_test = x_train / 255.0, x_test / 255.0 |
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
FROM nvidia/cuda:9.0-base-ubuntu16.04 | |
LABEL maintainer="Seyoung Park <[email protected]>" | |
# This Dockerfile is forked from Tensorflow Dockerfile | |
# Pick up some PyTorch gpu dependencies | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
build-essential \ | |
cuda-command-line-tools-9-0 \ |
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
name: how-bots-type | |
channels: | |
- pytorch | |
- defaults | |
dependencies: | |
- click=7.0 | |
- ffmpeg=4.0 | |
- ipython=7.2 | |
- jupyterlab=0.35 | |
- matplotlib=3.0 |
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
#---------------------------------------------------------- | |
# Remove local uncommited changes | |
# https://docs.gitlab.com/ee/topics/git/numerous_undo_possibilities_in_git/ | |
git reset --hard | |
#---------------------------------------------------------- | |
# Fetch | |
# https://www.atlassian.com/git/tutorials/syncing/git-fetch | |
git fetch origin master |
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 shelving(ys, cut_off, gain, mode='low'): | |
'''Shelving filter for bass | |
Args: | |
ys (numpy.array): 1D signals | |
cut_off (float): Normalized cut-off frequency. 0 < cut_off < 1 | |
gain (float): gain in dB | |
''' | |
gain = 10 ** (gain / 20) # NOTE: is it 20 or 40? | |
wc = 2 * np.pi * cut_off / 44100 # cut_off frequency in radians(0 <= wc <= pi) |
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 numpy as np | |
from scipy import constants | |
def fibonacci(n): | |
"""Calculate fibonacci system in signal processing way; weighted sum of fundamental modes. | |
The complexity: O(1). | |
""" | |
p = constants.golden | |
return int(np.around( |
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
class EasyDict(dict): | |
def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) | |
def __getattr__(self, name): return self[name] | |
def __setattr__(self, name, value): self[name] = value | |
def __delattr__(self, name): del self[name] |