Skip to content

Instantly share code, notes, and snippets.

View theeluwin's full-sized avatar
🎹
스콜라아이돌교수버튜버

Jinseok Seol theeluwin

🎹
스콜라아이돌교수버튜버
View GitHub Profile
@theeluwin
theeluwin / HighwaySpeech.py
Created December 6, 2017 04:52
ASR by CNN-Highway-RNN CTC
from model import *
class HighwaySpeech(DeepSpeech):
def __init__(self, rnn_type=nn.LSTM, labels="abc", rnn_hidden_size=1024, nb_layers=3, audio_conf=None, bidirectional=True):
super(HighwaySpeech, self).__init__()
# fixed-values
rnn_type = nn.LSTM
nb_layers = 3
for cdn
import logging
# setting
logger = logging.getLogger('mylog')
log_handler = logging.FileHandler('path/to/file/mylog.log')
log_formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
log_handler.setFormatter(log_formatter)
logger.addHandler(log_handler)
logger.setLevel(logging.DEBUG)
from collections import Counter
def F1(precision, recall):
denominator = precision + recall
if not denominator:
return 0
return 2 * precision * recall / denominator
@theeluwin
theeluwin / mnist-yellowfin.py
Created July 19, 2017 22:46
Testing fully-connected mnist with yellowfin. See https://github.com/JianGoForIt/YellowFin
# -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
from yellowfin import YFOptimizer
from tensorflow.examples.tutorials.mnist import input_data
def linear(X, fanout, scope=None):
@theeluwin
theeluwin / chem2_ex3.py
Created October 6, 2016 05:49
chem2_ex3.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
__author__ = "theeluwin"
__email__ = "[email protected]"
import numpy as np
@theeluwin
theeluwin / pull.py
Last active August 3, 2016 08:59
모나드 => 몬앋으
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from korean import hangul
def pull(text):
exploded = [list(hangul.split_char(c)) if hangul.is_hangul(c) else c for c in text]
for i in range(len(exploded)):
pip freeze --local | grep -v "^\-e" | cut -d = -f 1 | xargs pip install -U
# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
import re
from collections import Counter
from konlpy.tag import Mecab
tagger = Mecab()
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals, division
import sys
import time
def main(duration=600):