Skip to content

Instantly share code, notes, and snippets.

@dangxuanhong
dangxuanhong / Q-Net Learning Clean.ipynb
Created July 22, 2018 21:28 — forked from awjuliani/Q-Net Learning Clean.ipynb
Basic Q-Learning algorithm using Tensorflow
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dangxuanhong
dangxuanhong / gru_tensorflow.py
Created July 10, 2018 18:30 — forked from kmjjacobs/gru_tensorflow.py
GRU (Gated Recurrent Unit) implementation in TensorFlow and used in a simple Machine Learning task. The corresponding tutorial is found on Data Blogger: https://www.data-blogger.com/2017/08/27/gru-implementation-tensorflow/.
#%% (0) Important libraries
import tensorflow as tf
import numpy as np
from numpy import random
import matplotlib.pyplot as plt
from IPython import display
% matplotlib inline
#%% (1) Dataset creation.
from gensim import models
sentence = models.doc2vec.LabeledSentence(
words=[u'so`bme', u'words', u'here'], tags=["SENT_0"])
sentence1 = models.doc2vec.LabeledSentence(
words=[u'here', u'we', u'go'], tags=["SENT_1"])
sentences = [sentence, sentence1]
class LabeledLineSentence(object):