graykode / nlp-tutorial

Natural Language Processing Tutorial for Deep Learning Researchers
https://www.reddit.com/r/MachineLearning/comments/amfinl/project_nlptutoral_repository_who_is_studying/
MIT License
14.03k stars 3.9k forks source link

seq2seq_torch maybe have a small mistake #53

Closed wmathor closed 1 year ago

wmathor commented 4 years ago
# output : [max_len+1, batch_size, num_directions(=1) * n_hidden]
    output = output.transpose(0, 1) # [batch_size, max_len+1(=6), num_directions(=1) * n_hidden]

to

# output : [max_len+1, batch_size, n_class]
    output = output.transpose(0, 1) # [batch_size, max_len+1(=6), n_class]
Angry-Echo commented 1 year ago

Nope~ I guess you forget an important thing, the last layer of the network is Fully Connected layer , it trans the dim from hidden_size to input_size(n_class) However, i konw you are a amaing coder, if you see me, can we make a friend

wmathor commented 1 year ago

Nope~ I guess you forget an important thing, the last layer of the network is Fully Connected layer , it trans the dim from hidden_size to input_size(n_class) However, i konw you are a amaing coder, if you see me, can we make a friend

Oh my god, I can't believe someone actually responded to my stupid question after all this time. Anyway, thank you for your answer.