Skip to content

Commit

Permalink
Merge branch 'master' of github.com:h2oai/h2o
Browse files Browse the repository at this point in the history
  • Loading branch information
jessica0xdata committed Dec 10, 2014
2 parents 28b7ced + 03f40bf commit f547c91
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion R/h2o-package/R/ParseImport.R
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ h2o.loadModel <- function(object, path="") {
# Read models from model_names meta file
if(length(grep("hdfs://", path)) == 1) {
fileConn = paste(path, "model_names", sep = "/")
model_names.hex = h2o.importFile(object = conn, path = fileConn)
model_names.hex = h2o.importFile(object = object, path = fileConn)
model_names = as.matrix(model_names.hex)
h2o.rm(object, model_names.hex@key)
} else {
Expand Down
4 changes: 4 additions & 0 deletions lib/resources/h2o/js/ga.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions lib/resources/h2o/js/ga.release.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/main/java/hex/deeplearning/Neurons.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import water.Iced;
import water.MemoryManager;
import water.api.Request.API;
import water.util.Log;
import water.util.Utils;

import java.nio.ByteBuffer;
Expand Down Expand Up @@ -985,11 +986,11 @@ protected void fprop() {
scale += _a.get(row);
}
for( int row = 0; row < rows; row++ ) {
_a.raw()[row] /= scale;
if (Float.isNaN(_a.get(row))) {
_minfo.set_unstable();
throw new RuntimeException("Numerical instability, predicted NaN.");
}
_a.raw()[row] /= scale;
}
}

Expand Down
18 changes: 4 additions & 14 deletions src/test/java/hex/DeepLearningSpiralsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,33 +60,23 @@ public class DeepLearningSpiralsTest extends TestUtil {
p.score_training_samples = 1000;
p.score_validation_samples = 10000;
p.shuffle_training_data = false;
p.force_load_balance = true; //multi-threaded
p.force_load_balance = false;
p.replicate_training_data = false;
p.destination_key = dest;
p.adaptive_rate = true;
p.reproducible = true;
p.rho = 0.99;
p.epsilon = 5e-3;
p.invoke();
}

// score and check result
{
DeepLearningModel mymodel = UKV.get(dest); //this actually *requires* frame to also still be in UKV (because of DataInfo...)
Frame pred = mymodel.score(frame);
water.api.ConfusionMatrix CM = new water.api.ConfusionMatrix();
CM.actual = frame;
CM.vactual = frame.lastVec();
CM.predict = pred;
CM.vpredict = pred.vecs()[0];
CM.invoke();
StringBuilder sb = new StringBuilder();
CM.toASCII(sb);
double error = new ConfusionMatrix(CM.cm).err();
Log.info(sb);
DeepLearningModel mymodel = UKV.get(dest);
double error = mymodel.error();
if (error >= 0.025) {
Assert.fail("Classification error is not less than 0.025, but " + error + ".");
}
pred.delete();
mymodel.delete();
mymodel.delete_best_model();
}
Expand Down

0 comments on commit f547c91

Please sign in to comment.