Skip to content

Instantly share code, notes, and snippets.

View jaekookang's full-sized avatar
🎯
Focusing

jkang jaekookang

🎯
Focusing
View GitHub Profile
@jaekookang
jaekookang / autoencoder.py
Created December 3, 2016 22:56 — forked from saliksyed/autoencoder.py
Tensorflow Auto-Encoder Implementation
""" Deep Auto-Encoder implementation
An auto-encoder works as follows:
Data of dimension k is reduced to a lower dimension j using a matrix multiplication:
softmax(W*x + b) = x'
where W is matrix from R^k --> R^j
A reconstruction matrix W' maps back from R^j --> R^k
@jaekookang
jaekookang / min-char-rnn.py
Created December 12, 2016 22:31 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@jaekookang
jaekookang / thread.py
Created April 7, 2018 04:19 — forked from ruedesign/thread.py
Python thread sample with handling Ctrl-C
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, time, threading, abc
from optparse import OptionParser
def parse_options():
parser = OptionParser()
parser.add_option("-t", action="store", type="int", dest="threadNum", default=1,
help="thread count [1]")
@jaekookang
jaekookang / train.py
Created July 3, 2018 04:14
Task: Fill in the blank in a sentence.
'''
Train
python 3.6.4
tensorflow 0.12.1
2018-06-30
'''
import ipdb as pdb
import os
import utils
@jaekookang
jaekookang / train.py
Created July 3, 2018 04:16
Task: Fill in the blank in a sentence / training script snippet (in progress)
'''
Train
python 3.6.4
tensorflow 0.12.1
2018-06-30
'''
import ipdb as pdb
import os
import utils
@jaekookang
jaekookang / git-clearHistory
Created February 24, 2019 17:34 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
@jaekookang
jaekookang / ffmpeg.md
Created May 16, 2019 22:12 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@jaekookang
jaekookang / audioprobe_mex.cpp
Created December 5, 2019 19:16
Compile MEX function (Matlab) with RtAudio on macOS
/*
Compiling MEX function including RtAudio for audio mauipulation (Toy example)
Tested on:
- macOS Catalina 10.15
- Matlab R2019b (XCode clang++)
- RtAudio v5.1.0
To use this .cpp file to compile mex function, you need to download RtAudio first
(See https://www.music.mcgill.ca/~gary/rtaudio/).
@jaekookang
jaekookang / download_cmu_arctic.sh
Created April 17, 2020 18:30 — forked from r9y9/download_cmu_arctic.sh
CMU ARCTIC download script
#!/bin/bash
# This is a yet another download script for the cmu arctic speech corpus.
# The corpus will be downloaded in $HOME/data/cmu_arctic/
location=$HOME/data/cmu_arctic/
if [ ! -e $location ]
then
echo "Create " $location
@jaekookang
jaekookang / monitor.py
Last active November 30, 2020 01:46
TensorFlow2.x Keras Custom Train Logger Callback
'''
This code snippet was developed based on
- https://github.com/keras-team/keras/issues/2850#issuecomment-222494059
How to use:
```
logger = NBatchLogger(n_display, n_epoch, log_dir)
model.fit(data_generator,
epochs=n_epoch,
callbacks=[logger],