Skip to content

Commit

Permalink
Scale the negative binomial's gamma()
Browse files Browse the repository at this point in the history
For issue awslabs#906 

The `theta` param. of Gamma gets scale by `scale *theta = alpha * mu * scale`. So only need to scale the `mu` .
  • Loading branch information
kashif committed Jul 3, 2020
1 parent 5c2f4ce commit cc09b02
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/gluonts/mx/distribution/neg_binomial.py
Expand Up @@ -133,9 +133,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)

@property
Expand Down

0 comments on commit cc09b02

Please sign in to comment.