Skip to content

Commit

Permalink
Fixes issue abisee#4 for NaN loss
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrobalage committed May 31, 2017
1 parent b3cae0e commit 434d696
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions model.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,6 @@ def _calc_final_dist(self, vocab_dists, attn_dists):
final_dists = [vocab_dist + copy_dist for (vocab_dist, copy_dist) in zip(
vocab_dists_extended, attn_dists_projected)]

return final_dists

# Issue #4: suggestion from user: 'rahul-iisc'
# OOV part of vocab is max_art_oov long. Not all the sequences in a batch will have max_art_oov tokens.
# That will cause some entries to be 0 in the distribution, which will result in NaN when calulating log_dists
Expand Down
2 changes: 1 addition & 1 deletion run_summarization.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import util

os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
os.environ["CUDA_VISIBLE_DEVICES"] = "1"

FLAGS = tf.app.flags.FLAGS

Expand Down

0 comments on commit 434d696

Please sign in to comment.