Closed haolin512900 closed 2 years ago
This part is for initializing the attention scores of KCA in each feed forward process. During testing, this line of code is not important. But during training, without this line of code, the attention score will be messed up.
Thank your reply!
But Why use three att
in the code self.RFRModule.att.att.att_scores_prev = None
?Why not use aatt
? Example,self.RFRModule.att_scores_prev = None
.
First .att
is because the AttentionModule
is part of the RFRModule
.
Second .att
because KnowledgeConsistentAttention
is part of the AttentionModule
. The AttentionModule
is a module that combines KnowledgeConsistentAttention
with standard (before attention) to create a combination thru a learnable point wise (kernel size 1) convolution layer (the combiner).
And finally, att_scres_prev
and masks_prev
in KnowledgeConsistentAttention
is kind of like an initial parameter that is initialized at the beginning of an inpainting process. A bit similar in idea to how we initialize the hidden state in the decoder in a LSTM/GRU model.
Just my 2 cents.
First
.att
is because theAttentionModule
is part of theRFRModule
.Second
.att
becauseKnowledgeConsistentAttention
is part of theAttentionModule
. TheAttentionModule
is a module that combinesKnowledgeConsistentAttention
with standard (before attention) to create a combination thru a learnable point wise (kernel size 1) convolution layer (the combiner).And finally,
att_scres_prev
andmasks_prev
inKnowledgeConsistentAttention
is kind of like an initial parameter that is initialized at the beginning of an inpainting process. A bit similar in idea to how we initialize the hidden state in the decoder in a LSTM/GRU model.Just my 2 cents. Thank your reply! Good lucky
Hello,thank your great project! I come again! In the modules/RFRNet.py, the class RFRNet ,what is the work of
self.RFRModule.att.att.att_scores_prev = None self.RFRModule.att.att.masks_prev = None
? Looking forward your reply