Skip to content

Commit 881cf64

Browse files
committed
Merge branch 'master' of github.com:0xdata/h2o
2 parents 192f9ee + 9c87422 commit 881cf64

File tree

6 files changed

+30
-17
lines changed

6 files changed

+30
-17
lines changed

py/testdir_0xdata_only/test_DeepLearning_mnist.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ def test_DeepLearning_mnist(self):
5151
'activation' : 'RectifierWithDropout',
5252
'input_dropout_ratio' : 0.2,
5353
'hidden' : '1024,1024,2048',
54-
'adaptive_rate' : 0,
54+
'adaptive_rate' : 1,
5555
'mini_batch' : 0, ## 0: better accuracy! -1: best scalability! 10000: best accuracy?
56-
'rate' : 0.01,
57-
'rate_annealing' : 1e-6,
58-
'momentum_start' : 0.5,
59-
'momentum_ramp' : 1800000,
60-
'momentum_stable' : 0.99,
56+
# 'rate' : 0.01,
57+
# 'rate_annealing' : 1e-6,
58+
# 'momentum_start' : 0.5,
59+
# 'momentum_ramp' : 1800000,
60+
# 'momentum_stable' : 0.99,
6161
'l1' : 1e-5,
6262
'l2' : 0.0,
6363
'seed' : 98037452452,

src/main/java/water/DTask.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ public boolean onExceptionalCompletion( Throwable ex, CountedCompleter caller )
124124
@Override public int frozenType() {throw barf("frozeType");}
125125
@Override public AutoBuffer writeJSONFields(AutoBuffer bb) { return bb; }
126126
@Override public water.api.DocGen.FieldDoc[] toDocField() { return null; }
127-
public void copyOver(T that) {
127+
public void copyOver(Freezable other) {
128+
DTask that = (DTask)other;
128129
this._exception = that._exception;
129130
this._eFromNode = that._eFromNode;
130131
this._lineNum = that._lineNum;

src/main/java/water/Weaver.java

+18-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
public class Weaver {
1111
private final ClassPool _pool;
12-
private final CtClass _dtask, _iced, _enum;
12+
private final CtClass _dtask, _iced, _enum, _freezable;
1313
private final CtClass[] _serBases;
1414
private final CtClass _fielddoc;
1515
private final CtClass _arg;
@@ -22,7 +22,8 @@ public class Weaver {
2222
_iced = _pool.get("water.Iced"); // Needs serialization
2323
_dtask= _pool.get("water.DTask");// Needs serialization and remote execution
2424
_enum = _pool.get("java.lang.Enum"); // Needs serialization
25-
_serBases = new CtClass[] { _iced, _dtask, _enum, };
25+
_freezable = _pool.get("water.Freezable"); // Needs serialization
26+
_serBases = new CtClass[] { _iced, _dtask, _enum, _freezable };
2627
for( CtClass c : _serBases ) c.freeze();
2728
_fielddoc = _pool.get("water.api.DocGen$FieldDoc");// Is auto-documentation result
2829
_arg = _pool.get("water.api.RequestArguments$Argument"); // Needs auto-documentation
@@ -74,6 +75,16 @@ private synchronized CtClass javassistLoadClass(String name) {
7475
if( cc.subclassOf(base) )
7576
return javassistLoadClass(cc);
7677

78+
// Subtype of an alternative freezable?
79+
if( cc.subtypeOf( _freezable ) ) {
80+
// Find the alternative freezable base
81+
CtClass xcc = cc;
82+
CtClass ycc = null;
83+
while( xcc.subtypeOf(_freezable) ) { ycc = xcc; xcc = xcc.getSuperclass(); }
84+
if( !ycc.isFrozen() ) ycc.freeze(); // Freeze the alternative base
85+
return cc == ycc ? cc : javassistLoadClass(cc); // And weave the subclass
86+
}
87+
7788
return cc;
7889
} catch( NotFoundException nfe ) {
7990
return null; // Not found? Use the normal loader then
@@ -125,7 +136,8 @@ CtClass addSerializationMethods( CtClass cc ) throws CannotCompileException, Not
125136
if( cc.subclassOf(_enum) ) exposeRawEnumArray(cc);
126137
if( cc.subclassOf(_iced) ) ensureAPImethods(cc);
127138
if( cc.subclassOf(_iced) ||
128-
cc.subclassOf(_dtask) ) {
139+
cc.subclassOf(_dtask)||
140+
cc.subtypeOf(_freezable)) {
129141
cc.setModifiers(javassist.Modifier.setPublic(cc.getModifiers()));
130142
ensureSerMethods(cc);
131143
ensureNullaryCtor(cc);
@@ -335,11 +347,11 @@ private void ensureSerMethods(CtClass cc) throws NotFoundException, CannotCompil
335347
boolean w = hasExisting("write", "(Lwater/AutoBuffer;)Lwater/AutoBuffer;", ccms);
336348
boolean r = hasExisting("read" , "(Lwater/AutoBuffer;)Lwater/Freezable;" , ccms);
337349
boolean d = cc.subclassOf(_dtask); // Subclass of DTask?
338-
boolean c = hasExisting("copyOver" , "(Lwater/DTask;)V" , ccms);
350+
boolean c = hasExisting("copyOver" , "(Lwater/Freezable;)V" , ccms);
339351
if( w && r && (!d || c) ) return;
340352
if( w || r || c )
341353
throw new RuntimeException(cc.getName() +" must implement all of " +
342-
"read(AutoBuffer) and write(AutoBuffer) and copyOver(DTask) or none");
354+
"read(AutoBuffer) and write(AutoBuffer) and copyOver(Freezable) or none");
343355

344356
// Add the serialization methods: read, write.
345357
CtField ctfs[] = cc.getDeclaredFields();
@@ -396,7 +408,7 @@ private void ensureSerMethods(CtClass cc) throws NotFoundException, CannotCompil
396408
// _d = s._d;
397409
// }
398410
if( d ) make_body(cc,ctfs,callsuper,
399-
"public void copyOver(water.DTask i) {\n"+
411+
"public void copyOver(water.Freezable i) {\n"+
400412
" "+cc.getName()+" s = ("+cc.getName()+")i;\n",
401413
" super.copyOver(s);\n",
402414
" %s = s.%s;\n",

src/main/java/water/exec/ASTRApply.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ else if( _gatherRows ) {
364364
_groups.put(ab.get(Group.class),new NewChunk(null,-99));
365365
return this;
366366
}
367-
@Override public void copyOver( DTask dt ) {
367+
@Override public void copyOver( Freezable dt ) {
368368
ddplyPass1 that = (ddplyPass1)dt;
369369
super.copyOver(that);
370370
this._gatherRows = that._gatherRows;

src/main/java/water/fvec/Vec.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -755,15 +755,15 @@ public CollectDomain(Vec v) { }
755755
return ab.putA8(_uniques==null ? null : _uniques.keySetLong());
756756
}
757757

758-
@Override public CollectDomain read( AutoBuffer ab ) {
758+
@Override public Freezable read( AutoBuffer ab ) {
759759
super.read(ab);
760760
assert _uniques == null || _uniques.size()==0;
761761
long ls[] = ab.getA8();
762762
_uniques = new NonBlockingHashMapLong();
763763
if( ls != null ) for( long l : ls ) _uniques.put(l,"");
764764
return this;
765765
}
766-
@Override public void copyOver(DTask that) {
766+
@Override public void copyOver(Freezable that) {
767767
super.copyOver(that);
768768
_uniques = ((CollectDomain)that)._uniques;
769769
}

src/test/java/water/fvec/WordCountTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ private static int isChar( int b ) {
117117
System.out.println("WC Read takes "+t+"msec for "+cnt+" words");
118118
return this;
119119
}
120-
@Override public void copyOver(DTask wc) { _words = ((WordCount)wc)._words; }
120+
@Override public void copyOver(Freezable wc) { _words = ((WordCount)wc)._words; }
121121
}
122122

123123

0 commit comments

Comments
 (0)