Guest User

Untitled

a guest
Jan 16th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. # Feed the target as the next input
  2. for di in range(target_length):
  3.  
  4. # The ouput of different steps
  5. decoder_output, decoder_hidden, decoder_attention = decoder(
  6. decoder_input, decoder_hidden, encoder_outputs)
  7.  
  8. # Calculate the NLLLoss fro each step
  9. loss += criterion(decoder_output, summary[:, di])
  10.  
  11. decoder_input = summary[:, di] # Supervised
  12.  
  13. # Calculate the gradient
  14. loss.backward()
Add Comment
Please, Sign In to add comment