In [3]:
import numpy as np
import theano as theano
import theano.tensor as T
import time
import operator
from utils import load_data, load_model_parameters_theano, generate_sentences
from gru_theano import *
import sys

In [4]:
# Load data (this may take a few minutes)
VOCABULARY_SIZE = 8000
X_train, y_train, word_to_index, index_to_word = load_data("data/reddit-comments-2015.csv", VOCABULARY_SIZE)


Reading CSV file...
Parsed 502183 sentences.
Found 193212 unique words tokens.
Using vocabulary size 8000.
The least frequent word in our vocabulary is 'playlist' and appeared 52 times.

In [21]:
# Load parameters of pre-trained model
model = load_model_parameters_theano('./data/pretrained_TrainedModel.npz')


Building model model from ./data/pretrained_TrainedModel.npz with hidden_dim=128 word_dim=8000

In [2]:
# Build your own model (not recommended unless you have a lot of time!)

# LEARNING_RATE = 1e-3
# NEPOCH = 20
# HIDDEN_DIM = 128

# model = GRUTheano(VOCABULARY_SIZE, HIDDEN_DIM)

# t1 = time.time()
# model.sgd_step(X_train[0], y_train[0], LEARNING_RATE)
# t2 = time.time()
# print "SGD Step time: ~%f milliseconds" % ((t2 - t1) * 1000.)

# train_with_sgd(model, X_train, y_train, LEARNING_RATE, NEPOCH, decay=0.9)

In [23]:
generate_sentences(model, 100, index_to_word, word_to_index)


i do n't see it all .
i do n't 4 expected a few years ago .
that here go i just miss it again , friend .
because there is no joke at all .
i place hi out respected that you are lucky .
crucial work .
it seems .
read about this system .
controversial experience , you just have to hold your hands ignorant of your own .
that 's more reliable than having too much like a profession .
you are subs for the right to feeling like this is from negotiate .
( because i quietly find out admitting they mexican talk . )
i think they are very casual to confirm if not just melee .
i 'll be twins , it was a fail muslims to influence .
believe just it site and use loyal difficulty
and thank you ?
i strange to me , does n't mean it means consistent places ... lol .
first home rock hook ! ! !
laptop station , and support lower income tires , maxed , vs. influence .
if i are some partner i quitting as well .
and instinct on diseases that is n't receives for facing bitcoin .
you pony that desire to trilogy you to yourself .
i do n't think at all in my opinion , fucks the water them ?
point them , i would look down to participate and get across the anywhere .
you should even have a shitty story of fire and the double eggs .
ca n't dc when i 'd be a varying dramatic player .
i would n't do it .
basically , most of your incidents staff should be a situations of music .
offer my first 5-10 distinct magazine .
it 's just been true either .
thank you .
god look some touched in the thread got similar fun .
when they enter this , it was because of it .
that is crazy .
anyways , great bullshit .
the approaches is definitely a new one .
that pop branch .
`` i 'm feeling better ! ''
i should do it legit .
also that 's boring to be mentally fucked up pc .
her dawn is spiders .
honestly i 'm twist damn over the hour crack it a bit emphasis .
so that 's pop in them .
sudden sony would have done this .
that 's a resume with throwing everyone !
i 'll sadness , cs calendar to situation , but honestly ?
however the against failure is switching to the salary .
i have no idea he could reliable it several clubs notice .
holy shit man !
the new one !
this is approaching engineers at those to make you realize that .
i 'm glad anyone has to go !
- til fan made a lot of mail out and mandatory .
my upon gym is today ... was n't that fan top-level ''
i 'd imagine that 's very pacific and there might be a cancelled horse .
something na system will overall have in consumer neighborhood .
my free pets up shit tough instructions right now .
that sucks .
foul is an alternative to fantasy then porn barely it’s come to a realistic quarter
he at more statistically limit superiority events , though others are not have won time .
i think they have to site bonds .
you can see what you described about : )
not very much too , certainly at parking destructive spends more
: ) they are bold , but not somewhere good than something else .
dial all and temperatures , most change in the site .
its worth it so i get mall is so close .
if they have no idea something on so eliminate those comics .
lucky to long when you lose both the existing .
you can make fun of yourself .
thank you very much just !
i would go on the wheel of their feature .
it should n't have wanted much much more capable of weed trigger lion sounds
whereas legs alright .
i verify how few of these right now , but kits hands can oblivion .
honestly it 's considered av after you get earth depending on what were bad .
other than that , you can check out if you have chaos gear .
good earned to them for anything new crit ! ''
that 's further sex .
yeah , i have algo complain about going up to swimming in the future .
probably not recognition .
chances are , i giants from cap .
that whole intentions really feels nothing .
you like the colored or missions , fnatic , angry moon .
it will be more patients than abuse like a country which is adc .
writer earlier !
he likely brings that greatly .
liability you besides paying her own 4. is not united to convince anyone ?
hyper famous guards nyc class .
saturday comes over , bike mode , etc .
and collected mindset . )
should you be easily fast charging asap ?
that 's bitch .
that listening to an interview and so was going to release you afterwards .
not everyone became collected by the destiny version of the game .
i can remember that .
that 's lighter than anyone .
meaningless error .
i 'm also really doses to throw excited so much when i get home .
wishing i may think it 's good ?
my podemos ' huge pretend for these are me .

In [ ]: