Skip to content

Commit

Permalink
fixed seed arg to ensure reproducibility in conditional-samples model
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignacio Lopez-Francos authored and WuTheFWasThat committed Feb 20, 2019
1 parent 2cf46d9 commit 946facf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/interactive_conditional_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ def interact_model(
if batch_size is None:
batch_size = 1
assert nsamples % batch_size == 0
np.random.seed(seed)
tf.set_random_seed(seed)

enc = encoder.get_encoder(model_name)
hparams = model.default_hparams()
Expand All @@ -35,6 +33,8 @@ def interact_model(

with tf.Session(graph=tf.Graph()) as sess:
context = tf.placeholder(tf.int32, [batch_size, None])
np.random.seed(seed)
tf.set_random_seed(seed)
output = sample.sample_sequence(
hparams=hparams, length=length,
context=context,
Expand Down

0 comments on commit 946facf

Please sign in to comment.