Hi,
I have a model which fits a mean and sigma for some data.
I have parameterised sigma using softplus:
q_sigma = torch.nn.Parameter(torch.nn.functional.softplus(torch.randn(n, dim)))
but encounter this error because the q_sigma value become a small negative number (-0.0015)

  File "/home/vidhi/anaconda3/lib/python3.8/site-packages/torch/distributions/distribution.py", line 53, in __init__
    raise ValueError("The parameter {} has invalid values".format(param))

ValueError: The parameter scale has invalid values

I’m guessing this is classic numerical instability issue, but is there a better transform to learn sigma?
Thanks.