Skip to content

Commit

Permalink
close fig to avoid memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
w19787 committed Mar 27, 2018
1 parent 6375051 commit 531bd03
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def plot_alignment(alignment, gs, dir=hp.logdir):
fig.colorbar(im)
plt.title('{} Steps'.format(gs))
plt.savefig('{}/alignment_{}.png'.format(dir, gs), format='png')
plt.close(fig)

def guided_attention(g=0.2):
'''Guided attention. Refer to page 3 on the paper.'''
Expand Down

0 comments on commit 531bd03

Please sign in to comment.