from local

This commit is contained in:
dohe0342 2022-12-30 11:56:40 +09:00
parent 31340420ce
commit 9b16457fdc
3 changed files with 1 additions and 0 deletions

View File

@ -41,6 +41,7 @@ class TransformerEncoderAdapter(TransformerEncoder):
for p in self.adapters.parameters():
#p.data = nn.Parameter(torch.zeros(p.size()).to('cuda'))
p.data = nn.Parameter(torch.randn(p.size()).to('cuda')/10000.)
print(p)
def forward(self, x, padding_mask=None, layer=None, tgt_layer=None):
x, layer_results = self.extract_features_with_adapter(