Skip to content

Instantly share code, notes, and snippets.

Jaemin Cho j-min

Block or report user

Report or block j-min

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@odashi
odashi / chainer_encoder_decoder.py
Last active Jan 1, 2017
Training and generation processes for neural encoder-decoder machine translation.
View chainer_encoder_decoder.py
#!/usr/bin/python3
import datetime
import sys
import math
import numpy as np
from argparse import ArgumentParser
from collections import defaultdict
from chainer import FunctionSet, Variable, functions, optimizers
@wookayin
wookayin / reload-tensorflow-flags.py
Last active Mar 12, 2018
Reset tensorflow tf.app.flags, in ipython notebook
View reload-tensorflow-flags.py
# use the following snippet in your ipython notebook shell
import argparse
import tensorflow as tf
tf.app.flags.FLAGS = tf.python.platform.flags._FlagValues()
tf.app.flags._global_parser = argparse.ArgumentParser()
@mattbasta
mattbasta / codegen.py
Created Jan 22, 2011
A module to "unparse" a Python AST tree.
View codegen.py
# -*- coding: utf-8 -*-
"""
codegen
~~~~~~~
Extension to ast that allow ast -> python code generation.
:copyright: Copyright 2008 by Armin Ronacher.
:license: BSD.
"""
@ckinsey
ckinsey / chain.py
Last active Aug 19, 2018
Chain.py Builds the Markov Models from Slack
View chain.py
import json
import markovify
import re
import time
from slackclient import SlackClient
BOT_TOKEN = "insert bot token here"
@volkancirik
volkancirik / treernn.py
Last active Oct 9, 2018
Pytorch TreeRNN
View treernn.py
"""
TreeLSTM[1] implementation in Pytorch
Based on dynet benchmarks :
https://github.com/neulab/dynet-benchmark/blob/master/dynet-py/treenn.py
https://github.com/neulab/dynet-benchmark/blob/master/chainer/treenn.py
Other References:
https://github.com/pytorch/examples/tree/master/word_language_model
https://github.com/pfnet/chainer/blob/29c67fe1f2140fa8637201505b4c5e8556fad809/chainer/functions/activation/slstm.py
https://github.com/stanfordnlp/treelstm
@lampts
lampts / gensim2projector_tf.py
Last active Dec 16, 2018
how to convert/port gensim word2vec to tensorflow projector board.
View gensim2projector_tf.py
# required tensorflow 0.12
# required gensim 0.13.3+ for new api model.wv.index2word or just use model.index2word
from gensim.models import Word2Vec
import tensorflow as tf
from tensorflow.contrib.tensorboard.plugins import projector
# loading your gensim
model = Word2Vec.load("YOUR-MODEL")
@decentralion
decentralion / labels_1024.tsv
Last active Apr 28, 2019
TensorBoard: TF Dev Summit Tutorial
View labels_1024.tsv
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
7
2
1
0
4
1
4
9
5
9
@off99555
off99555 / Machine Learning Curriculum.md
Last active Apr 29, 2019
Machine learning resources and related artificial intelligence concepts.
View Machine Learning Curriculum.md
@danijar
danijar / blog_tensorflow_sequence_classification.py
Last active Apr 29, 2019
TensorFlow Sequence Classification
View blog_tensorflow_sequence_classification.py
# Example for my blog post at:
# https://danijar.com/introduction-to-recurrent-networks-in-tensorflow/
import functools
import sets
import tensorflow as tf
def lazy_property(function):
attribute = '_' + function.__name__
@spitis
spitis / bnlstm.py
Created Feb 2, 2017
Batch normalized LSTM Cell for Tensorflow
View bnlstm.py
"""adapted from https://github.com/OlavHN/bnlstm to store separate population statistics per state"""
import tensorflow as tf, numpy as np
RNNCell = tf.nn.rnn_cell.RNNCell
class BNLSTMCell(RNNCell):
'''Batch normalized LSTM as described in arxiv.org/abs/1603.09025'''
def __init__(self, num_units, is_training_tensor, max_bn_steps, initial_scale=0.1, activation=tf.tanh, decay=0.95):
"""
* max bn steps is the maximum number of steps for which to store separate population stats
"""
You can’t perform that action at this time.