Skip to content

Commit

Permalink
Activated train log statements in run.py
Browse files Browse the repository at this point in the history
  • Loading branch information
batzner committed Aug 25, 2017
1 parent a82ced2 commit 487c2fb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions aws-clipboard.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ scp -i ~/dev/pems/tensorflow.pem ~/dev/python-hacks/tensorlm/datasets/sherlock/t
scp -i ~/dev/pems/tensorflow.pem ~/dev/python-hacks/tensorlm/datasets/sherlock/valid.txt ubuntu@54.149.27.213:~/tensorlm/datasets/sherlock/valid.txt

# Train
screen
python3 -m tensorlm.run --train=True --level=word --max_vocab_size=10000 --neurons_per_layer=250 --num_layers=3 --max_batch_size=100 --num_timesteps=160 --save_dir=out/model --evaluate_text_path=datasets/sherlock/valid.txt --train_text_path=datasets/sherlock/train.txt --max_epochs=30 --save_interval_hours=1

# ctrl-a d

python3 -m tensorlm.run --train=True --log_interval=1 --level=word --max_vocab_size=1000 --neurons_per_layer=250 --num_layers=3 --max_batch_size=100 --num_timesteps=160 --save_dir=out/model-small --evaluate_text_path=datasets/sherlock/valid.txt --train_text_path=datasets/sherlock/train.txt --max_epochs=30 --save_interval_hours=1
2 changes: 1 addition & 1 deletion tensorlm/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def load_from_dir(save_dir, level="char"):

@staticmethod
def create_from_text(text_path, max_vocab_size, level="char"):
LOGGER.info("Creating vocabulary from {}", text_path)
LOGGER.info("Creating vocabulary from %s", text_path)

# Get the most common tokens from the text
token_counter = Counter()
Expand Down
3 changes: 2 additions & 1 deletion tensorlm/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def main(_):
evaluate_text_path=FLAGS.evaluate_text_path,
sample_interval=FLAGS.train_sample_interval,
sample_prime=FLAGS.train_sample_prime,
save_interval_hours=FLAGS.save_interval_hours)
save_interval_hours=FLAGS.save_interval_hours,
print_logs=True)

elif FLAGS.evaluate:
loss = model.evaluate(session, FLAGS.evaluate_text_path)
Expand Down
1 change: 1 addition & 0 deletions tensorlm/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def train(self, tf_session, max_epochs=10, max_steps=None, batch_size=None, text
train_set = Dataset(text_path, self.vocab, batch_size,
self.num_timesteps)

LOGGER.info()
while (train_state.epoch <= max_epochs and
(not max_steps or train_state.global_step <= max_steps)):

Expand Down

0 comments on commit 487c2fb

Please sign in to comment.