PRIOR icon indicating copy to clipboard operation
PRIOR copied to clipboard

How to construct SPB

Open JadeCityYC opened this issue 10 months ago • 2 comments

Dear author,

Thank you for your great work. I could not find the content in terms of the construction of the SPB, because the sentence feature will be updated by the SPB, could you kindly point out which part in the code related with the SPB?

Thanks

JadeCityYC avatar Feb 14 '25 08:02 JadeCityYC

Thanks for your kind attention. The construction of SPB is https://github.com/QtacierP/PRIOR/blob/086bf2e0d379d7dacc47a6ad738ffabc1ad6e25f/codes/prior/models/prior.py#L58

and we use it in the forward process, like https://github.com/QtacierP/PRIOR/blob/086bf2e0d379d7dacc47a6ad738ffabc1ad6e25f/codes/prior/models/prior.py#L455

QtacierP avatar Feb 14 '25 08:02 QtacierP

Thanks for your kind attention. The construction of SPB is

PRIOR/codes/prior/models/prior.py

Line 58 in 086bf2e

self.sentence_bank = SPB(embed_dim, spb_k) and we use it in the forward process, like

PRIOR/codes/prior/models/prior.py

Line 455 in 086bf2e

proto_local_text_embed_stacks, proto_loss, embed_ind = self.sentence_bank(torch.cat(local_text_embed_stacks, dim=0))

Thank you for your quick reply. So the SPB module is learnable during the training process, right?

JadeCityYC avatar Feb 14 '25 09:02 JadeCityYC