XGBoostLSS: Distribution error: Tensor of shape..
First of all thanks for the new pytorch version. I’ve been using the previous versions and today saw a new version and wanted to give it a try, with the data and code that worked fine in previous version.
After I edited the old code with the differences of the new version, following the examples, i’ve noticed some problems with distributions. So when I give my label data to the optimization or training I get something on the lines of:
Expected value argument (Tensor of shape (8700,)) to be within the support (GreaterThan(lower_bound=0.0)) of the distribution LogNormal(), but found invalid values:
tensor([0.2782, 0.3064, 0.3202, ..., 0.3338, 0.3202, 0.3202])
or
Expected parameter scale (Tensor of shape ()) of distribution Normal(loc: -974.14453125, scale: -1210.6866455078125) to satisfy the constraint GreaterThan(lower_bound=0.0), but found invalid values:
-1210.6866455078125
This happens with every distribution that I’ve tried. My dataset is between 0.09 and 0.9 in value, I’ve tried with similar datasets and got similar results. With one dataset I’ve managed to run the model by multiplying the values by 10, but for other datasets does not work.
Reminding that all these datasets worked fine with previous version. Do you know what might be the reason?
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16 (10 by maintainers)
@maxfield-green Ok cool, thanks for the notebook.
Setting base_margin is not something you do, but it is implicit in the code. So no worries, nothing you can account for.
@sirdawar, @maxfield-green I report back once your problems are fixed.
@sirdawar Glad that the
BetaandLogNormalare now working.Given the Skewness and the support
(0,1)of the data, I wouldn’t recommend using a symmetric distribution like theGaussian, since this very likely leads to numerical instabilities. This is also what you see from your output.In case you still want to use the
Gaussianyou can try andsoftplusy*10and see if this is runningI have attached an example that runs end-to-end using the
Gaussian. I used thesoftplusinstead ofexpwhen initializing the distribution.Thanks again for using the package!
Gaussian Example.zip