from local
This commit is contained in:
parent
39b345a6df
commit
f08b07d152
Binary file not shown.
Binary file not shown.
@ -41,9 +41,9 @@ class TransformerEncoderAdapter(TransformerEncoder):
|
|||||||
super().__init__(args)
|
super().__init__(args)
|
||||||
self.adapters = ResidualAdapterModule()
|
self.adapters = ResidualAdapterModule()
|
||||||
|
|
||||||
#for p in self.adapters.parameters():
|
for p in self.adapters.parameters():
|
||||||
# p.data = nn.Parameter(torch.zeros(p.size()).to('cuda'))
|
# p.data = nn.Parameter(torch.zeros(p.size()).to('cuda'))
|
||||||
# p.data = nn.Parameter(torch.randn(p.size()).to('cuda')/50.)
|
p.data = nn.Parameter(torch.randn(p.size()).to('cuda')/10.)
|
||||||
|
|
||||||
def forward(self, x, padding_mask=None, layer=None, tgt_layer=None):
|
def forward(self, x, padding_mask=None, layer=None, tgt_layer=None):
|
||||||
x, layer_results = self.extract_features_with_adapter(
|
x, layer_results = self.extract_features_with_adapter(
|
||||||
|
|||||||
Reference in New Issue
Block a user