-
Notifications
You must be signed in to change notification settings - Fork 755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nonnegative predictions for deepar mxnet #2957
Nonnegative predictions for deepar mxnet #2957
Conversation
Improve readability on testing Co-authored-by: Lorenzo Stella <[email protected]>
Hardcode nonnegative parameter in tests Co-authored-by: Lorenzo Stella <[email protected]>
""" | ||
|
||
if self.nonnegative_pred_samples: | ||
return F.Activation(samples, act_type="relu") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if this works both in symbolic vs eager mode
return F.Activation(samples, act_type="relu") | |
return F.relu(samples) |
|
||
dataset_train, dataset_test = datasets | ||
predictor = estimator.train(dataset_train) | ||
forecasts = list(predictor.predict(dataset_test)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To ensure the added feature also works in symbolic mode, you can call as_symbol_block_predictor
on the predictor object, see
gluonts/src/gluonts/mx/model/predictor.py
Line 316 in a818f69
def as_symbol_block_predictor( |
Issue #, if available:
Description of changes:
Add functionality to generate nonnegative prediction samples for DeepAR. This is applied only to final samples for prediction.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Please tag this pr with at least one of these labels to make our release process faster: BREAKING, new feature, bug fix, other change, dev setup