Skip to content

Commit

Permalink
bug fix: add builder for StudentTOutput and clamp the min value in ne…
Browse files Browse the repository at this point in the history
…g_binomial
  • Loading branch information
Carkham committed Sep 19, 2022
1 parent 0f39651 commit d821993
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public NegativeBinomialOutput() {
public NDList domainMap(NDList arrays) {
NDArray mu = arrays.get(0);
NDArray alpha = arrays.get(1);
mu = mu.getNDArrayInternal().softPlus().squeeze(-1);
alpha = alpha.getNDArrayInternal().softPlus().squeeze(-1);
mu = mu.getNDArrayInternal().softPlus().maximum(Float.MIN_VALUE).squeeze(-1);
alpha = alpha.getNDArrayInternal().softPlus().maximum(Float.MIN_VALUE).squeeze(-1);
// TODO: make setName() must be implemented
mu.setName("mu");
alpha.setName("alpha");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import ai.djl.ndarray.NDArray;
import ai.djl.ndarray.NDList;
import ai.djl.timeseries.distribution.Distribution;
import ai.djl.timeseries.distribution.StudentT;
import ai.djl.util.PairList;

/**
Expand Down Expand Up @@ -50,6 +51,6 @@ public NDList domainMap(NDList arrays) {
/** {@inheritDoc} */
@Override
public Distribution.DistributionBuilder<?> distributionBuilder() {
return null;
return StudentT.builder();
}
}

0 comments on commit d821993

Please sign in to comment.