Commit Graph
17 Commits
Author SHA1 Message Date
Rémi Louf 61ed889005 remove old seq2seq file 2019-10-08 16:30:58 +02:00
Rémi Louf 8abfee9ec3 rename Bert2Bert -> Bert2Rnd 2019-10-08 16:30:58 +02:00
Rémi Louf 82628b0fc9 add a placeholder test 2019-10-08 16:30:58 +02:00
Rémi Louf 0700983090 Add BertDecoderModel and Bert2Bert classes
I am not sure what happens when the class is initialized with the
pretrained weights.
2019-10-08 16:30:58 +02:00
Rémi Louf 75feacf172 add general structure for Bert2Bert class 2019-10-08 16:30:58 +02:00
Rémi Louf 15a2fc88a6 add General attention classes
The modifications that I introduced in a previous commit did break
Bert's internal API. I reverted these changes and added more general
classes to handle the encoder-decoder attention case.

There may be a more elegant way to deal with retro-compatibility (I am
not comfortable with the current state of the code), but I cannot see it
right now.
2019-10-08 16:30:58 +02:00
Rémi Louf cd6a59d5c1 add a decoder layer for Bert 2019-10-08 16:30:58 +02:00
Rémi Louf 45de313a9e add bullet point on modifying an existing PR 2019-10-08 11:54:10 +02:00
Rémi Louf ade05b6cef add code contribution 2019-10-07 23:20:25 +02:00
Rémi Louf e9c09052a4 add issues and requests guidelines 2019-10-07 22:30:55 +02:00
Rémi Louf 7afd00a661 freeze dev requirements 2019-10-07 17:58:13 +02:00
Rémi Louf a0dcefa382 generalize BertSelfAttention to take separate query, key, value
There is currently no way to specify the quey, key and value separately
in the Attention module. However, the decoder's "encoder-decoder
attention" layers take the decoder's last output as a query, the
encoder's states as key and value. We thus modify the existing code so
query, key and value can be added separately.

This obviously poses some naming conventions; `BertSelfAttention` is not
a self-attention module anymore. The way the residual is forwarded is
now awkard, etc. We will need to do some refacto once the decoder is
fully implemented.
2019-10-07 17:53:58 +02:00
Rémi Louf 31adbb247c add class wireframes for Bert decoder 2019-10-07 16:43:21 +02:00
Rémi Louf dda1adad6d rename BertLayer to BertEncoderLayer 2019-10-07 16:31:46 +02:00
Rémi Louf 0053c0e052 do some (light) housekeeping
Several packages were imported but never used, indentation and line
spaces did not follow PEP8.
2019-10-07 16:29:15 +02:00
Rémi Louf 386e86e222 raise exception when class initialized with __init__ 2019-10-07 13:00:06 +02:00
Rémi Louf 4446c02b8a add wireframe for seq2seq model 2019-10-07 12:04:05 +02:00