Skip to content

Commit

Permalink
Update Attention Visualization.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengm authored Nov 17, 2017
1 parent 4756636 commit 406a1f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Attention Visualization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@
" # print weights\n",
"\n",
" vector = weights.sum( 0 )\n",
" vector = vector / vector.sum( 1 )[ 0,0 ]\n",
" att, ids_to_show = vector.sort( 1, descending=True )\n",
" vector = vector / vector.sum()\n",
" att, ids_to_show = vector.sort( 0, descending=True )\n",
"\n",
" ids_to_show = ids_to_show.squeeze( 0 ).tolist()[:words2show]\n",
"\n",
Expand Down

0 comments on commit 406a1f2

Please sign in to comment.