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
| # origin: https://github.com/fabric/fabric/blob/1.14/fabric/colors.py | |
| import os | |
| def _wrap_with(code): | |
| def inner(text, bold=False): | |
| c = code | |
| if os.environ.get('FABRIC_DISABLE_COLORS'): |
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
| # -*- coding: utf-8 -*- | |
| import os | |
| import json | |
| import torch | |
| import pickle | |
| import requests | |
| import numpy as np | |
| import torch as t | |
| import torch.nn as nn |
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 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 |
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
| for cdn |
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 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) |
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 collections import Counter | |
| def F1(precision, recall): | |
| denominator = precision + recall | |
| if not denominator: | |
| return 0 | |
| return 2 * precision * recall / denominator | |
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
| # -*- 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): |
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 | |
| # -*- coding: utf-8 -*- | |
| from __future__ import division, print_function, unicode_literals | |
| __author__ = "theeluwin" | |
| __email__ = "[email protected]" | |
| import numpy as np |
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
| # -*- 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)): |
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
| pip freeze --local | grep -v "^\-e" | cut -d = -f 1 | xargs pip install -U |