#
def forward(self, x, epoch=None, kwargs):
output, extra_outputs = self.model(x, kwargs)
for i in range(len(self.curriculum_steps)):
if epoch is not None and epoch < self.curriculum_steps[i]:
output[-len(self.curriculum_steps) + i] = 0
return output, extra_outputs
#
I am confused about the implement of the code when conducting the 2order experiment. If the "self.curriculum_steps" is setted as [9000,0,0,0] and the batch size is 16. My understanding about the code is as follow, the shape of "output" is torch.Size([16, 35]), and the line 12 in "output" will be setted as 0 (i.e. [-4,35] = 0). If do this, some samples will be setted as 0 in the batch. To this end, it will not achieve the goal of setting high-order polynomial coefficients to 0. Maybe it should be applied to dimension 1 instead of 0? Could you tell me why use this way to achieve the function? Thank you!
# def forward(self, x, epoch=None, kwargs): output, extra_outputs = self.model(x, kwargs) for i in range(len(self.curriculum_steps)): if epoch is not None and epoch < self.curriculum_steps[i]: output[-len(self.curriculum_steps) + i] = 0 return output, extra_outputs # I am confused about the implement of the code when conducting the 2order experiment. If the "self.curriculum_steps" is setted as [9000,0,0,0] and the batch size is 16. My understanding about the code is as follow, the shape of "output" is torch.Size([16, 35]), and the line 12 in "output" will be setted as 0 (i.e. [-4,35] = 0). If do this, some samples will be setted as 0 in the batch. To this end, it will not achieve the goal of setting high-order polynomial coefficients to 0. Maybe it should be applied to dimension 1 instead of 0? Could you tell me why use this way to achieve the function? Thank you!