In pytorch 0.4.0, I want to know how do we train this model where i assign one additional tensor
task_parameters = torch.ones(2).cuda().requires_grad_()
to learn the task weights via
precision = torch.exp(-1*self.task_parameters)
total_loss = loss * precision[0] + self.task_parameters[0]+ loss_quality * precision[1] + self.task_parameters[1]
Now, how do I update task_parameters in optimizer
optimizer = optim.SGD(itertools.chain(list(model.parameters()),[task_parameters]), lr=args.lr, momentum=args.momentum)???