Skip to content

Commit

Permalink
Fix POJO for DL regression.
Browse files Browse the repository at this point in the history
  • Loading branch information
arnocandel committed Mar 24, 2015
1 parent 9ba0e12 commit 3d8bc46
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/hex/deeplearning/DeepLearningModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -1947,16 +1947,16 @@ else if( model_info().size() > 100000 ) {
bodySb.i(1).p("}").nl();
bodySb.i().p("}").nl();
} else if (!get_params().autoencoder) { //Regression
bodySb.i().p("}").nl();
bodySb.i().p("if (i == ACTIVATION.length-1) {").nl();
bodySb.i(1).p("if (i == ACTIVATION.length-1) {").nl();
// regression: set preds[1], FillPreds0 will put it into preds[0]
if (model_info().data_info()._normRespMul != null) {
bodySb.i().p("preds[1] = (float) (ACTIVATION[i][0] / NORMRESPMUL[0] + NORMRESPSUB[0]);").nl();
bodySb.i(2).p("preds[1] = (float) (ACTIVATION[i][0] / NORMRESPMUL[0] + NORMRESPSUB[0]);").nl();
}
else {
bodySb.i().p("preds[1] = ACTIVATION[i][0];").nl();
bodySb.i(2).p("preds[1] = ACTIVATION[i][0];").nl();
}
bodySb.i().p("if (Float.isNaN(preds[1])) throw new RuntimeException(\"Predicted regression target NaN!\");").nl();
bodySb.i(2).p("if (Float.isNaN(preds[1])) throw new RuntimeException(\"Predicted regression target NaN!\");").nl();
bodySb.i(1).p("}").nl();
bodySb.i().p("}").nl();
} else { //AutoEncoder
bodySb.i(1).p("if (i == ACTIVATION.length-1) {").nl();
Expand Down

0 comments on commit 3d8bc46

Please sign in to comment.