Skip to content

Commit

Permalink
bound negbin scale above 1 (awslabs#814)
Browse files Browse the repository at this point in the history
  • Loading branch information
lostella committed May 10, 2020
1 parent b42a85f commit 46e22a7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/gluonts/distribution/neg_binomial.py
Expand Up @@ -129,6 +129,7 @@ def distribution(
return NegativeBinomial(mu, alpha)
else:
F = getF(mu)
scale = 1.0 + softplus(F, scale - 1.0)
mu = F.broadcast_mul(mu, scale)
alpha = F.broadcast_add(alpha, F.broadcast_div(scale - 1, mu))
return NegativeBinomial(mu, alpha, F)
Expand Down

0 comments on commit 46e22a7

Please sign in to comment.