@@ -16,12 +16,13 @@
"""Batch reader to seq2seq attention model, with bucketing support."""
from collections import namedtuple
-import Queue
from random import shuffle
from threading import Thread
import time
import numpy as np
+from six.moves.queue import Queue
+from six.moves import xrange
import tensorflow as tf
import data
@@ -21,10 +21,11 @@ K*K results, and start over again until certain number of results are fully
decoded.
"""
FLAGS = tf.flags.FLAGS
-tf.flags.DEFINE_bool('normalize_by_length', True, 'Whether normalize')
+tf.flags.DEFINE_bool('normalize_by_length', True, 'Whether to normalize')
class Hypothesis(object):
@@ -18,9 +18,10 @@
import os
-import tensorflow as tf
import beam_search
+import tensorflow as tf
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_integer('max_decode_steps', 1000000,
@@ -18,9 +18,9 @@
import seq2seq_lib
-
HParams = namedtuple('HParams',
'mode, min_lr, lr, batch_size, '