I have a parameter that is learnable, I want the model to update it. Here is how I attached it to the model:
class Dan(nn.Module):
    def __init__(self):
        super(Dan, self).__init__()
blah blah blah
        self.alpha = t.tensor(0.5, requires_grad=True).cuda()

It is alpha. However, after training, I find its value unchanged. It must hven’t been passed to optimizer when I asked for model.parameters. Why isn’t included in that method, and how to include it?