예제 #1
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.s = nn.ParameterList([
         nn.Parameter(module_util.rank_one_init(self).unsqueeze(0))
         for _ in range(pargs.num_tasks)
     ])
     self.t = nn.ParameterList([
         nn.Parameter(module_util.rank_one_initv2(self).unsqueeze(0))
         for _ in range(pargs.num_tasks)
     ])
예제 #2
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.s = nn.ParameterList([
         nn.Parameter(module_util.rank_one_init(self).unsqueeze(1))
         for _ in range(pargs.num_tasks)
     ])
     self.t = nn.ParameterList([
         nn.Parameter(module_util.rank_one_initv2(self).unsqueeze(0))
         for _ in range(pargs.num_tasks)
     ])
     if pargs.train_weight_tasks == 0:
         self.weight.requires_grad = False