Thank you @ptrblck for your reply. But When I apply sigmoid before wrapping my variable to nn.Parameter, after a few epochs, my parameter violates its range, i.e., [0,1]. How can I handle that?
my_param= nn.Parameter(torch.sigmoid(torch.rand(1)).cuda(), requires_grad=True)