Example #1
0
import theano.tensor as t
import numpy as np

from corpus import Corpus
from model import Model

logfile = 'log_' + str(time.time())

logging.basicConfig(filename = logfile, level = logging.INFO)
logger = logging.getLogger('test')

filepath = 'train1K'
vocab = 'vocab_train1K'

c = Corpus(logger)
c.loadVocabulary(vocab)

n_hid = 50
n_steps = 10
n_seq = 5
n_classes = 3
n_out = n_classes

fs = open(filepath, 'r')
tokens = None

softmax_time = 0

#Retrives the inputs and targets
seq, targets, tokens = c.encode(n_seq, n_steps, tokens, fs)
_, __, n_in = seq.shape