Fixes (#213)
* Increase timeouts for 2 tests occasionally failing on CI Signed-off-by: AlexDBlack <blacka101@gmail.com> * Explicitly set character encoding via argline for maven surefire tests Signed-off-by: AlexDBlack <blacka101@gmail.com> * CUDA gradient check timeout fix + simple rnn masking fix Signed-off-by: AlexDBlack <blacka101@gmail.com>master
parent
5d28e6143d
commit
569a46f87d
|
@ -192,7 +192,7 @@
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>${maven-surefire-plugin.version}</version>
|
<version>${maven-surefire-plugin.version}</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<argLine>-Ddtype=double -Xmx3024m -Xms3024m</argLine>
|
<argLine>-Ddtype=double -Dfile.encoding=UTF-8 -Xmx3024m -Xms3024m</argLine>
|
||||||
<!--
|
<!--
|
||||||
By default: Surefire will set the classpath based on the manifest. Because tests are not included
|
By default: Surefire will set the classpath based on the manifest. Because tests are not included
|
||||||
in the JAR, any tests that rely on class path scanning for resources in the tests directory will not
|
in the JAR, any tests that rely on class path scanning for resources in the tests directory will not
|
||||||
|
|
|
@ -148,7 +148,7 @@
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>${maven-surefire-plugin.version}</version>
|
<version>${maven-surefire-plugin.version}</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<argLine>-Ddtype=float</argLine>
|
<argLine>-Ddtype=float -Dfile.encoding=UTF-8</argLine>
|
||||||
<!--
|
<!--
|
||||||
By default: Surefire will set the classpath based on the manifest. Because tests are not included
|
By default: Surefire will set the classpath based on the manifest. Because tests are not included
|
||||||
in the JAR, any tests that rely on class path scanning for resources in the tests directory will not
|
in the JAR, any tests that rely on class path scanning for resources in the tests directory will not
|
||||||
|
|
|
@ -56,6 +56,11 @@ public class GradientCheckTestsMasking extends BaseDL4JTest {
|
||||||
Nd4j.setDataType(DataType.DOUBLE);
|
Nd4j.setDataType(DataType.DOUBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getTimeoutMilliseconds() {
|
||||||
|
return 90000L;
|
||||||
|
}
|
||||||
|
|
||||||
private static class GradientCheckSimpleScenario {
|
private static class GradientCheckSimpleScenario {
|
||||||
private final ILossFunction lf;
|
private final ILossFunction lf;
|
||||||
private final Activation act;
|
private final Activation act;
|
||||||
|
@ -159,9 +164,8 @@ public class GradientCheckTestsMasking extends BaseDL4JTest {
|
||||||
.updater(new NoOp())
|
.updater(new NoOp())
|
||||||
.dataType(DataType.DOUBLE)
|
.dataType(DataType.DOUBLE)
|
||||||
.dist(new NormalDistribution(0, 1.0)).seed(12345L).list()
|
.dist(new NormalDistribution(0, 1.0)).seed(12345L).list()
|
||||||
.layer(0, new GravesBidirectionalLSTM.Builder().nIn(nIn).nOut(layerSize)
|
.layer(0, new SimpleRnn.Builder().nIn(nIn).nOut(2).activation(Activation.TANH).build())
|
||||||
.activation(Activation.TANH).build())
|
.layer(1, new GravesBidirectionalLSTM.Builder().nIn(2).nOut(layerSize)
|
||||||
.layer(1, new GravesBidirectionalLSTM.Builder().nIn(layerSize).nOut(layerSize)
|
|
||||||
.activation(Activation.TANH).build())
|
.activation(Activation.TANH).build())
|
||||||
.layer(2, new RnnOutputLayer.Builder(LossFunctions.LossFunction.MCXENT)
|
.layer(2, new RnnOutputLayer.Builder(LossFunctions.LossFunction.MCXENT)
|
||||||
.activation(Activation.SOFTMAX).nIn(layerSize).nOut(nOut).build())
|
.activation(Activation.SOFTMAX).nIn(layerSize).nOut(nOut).build())
|
||||||
|
@ -390,24 +394,24 @@ public class GradientCheckTestsMasking extends BaseDL4JTest {
|
||||||
Nd4j.getRandom().setSeed(12345);
|
Nd4j.getRandom().setSeed(12345);
|
||||||
//Idea: RNN input, global pooling, OutputLayer - with "per example" mask arrays
|
//Idea: RNN input, global pooling, OutputLayer - with "per example" mask arrays
|
||||||
|
|
||||||
int mb = 10;
|
int mb = 4;
|
||||||
int tsLength = 5;
|
int tsLength = 5;
|
||||||
MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()
|
MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()
|
||||||
.dataType(DataType.DOUBLE)
|
.dataType(DataType.DOUBLE)
|
||||||
.weightInit(new NormalDistribution(0,2))
|
.weightInit(new NormalDistribution(0,2))
|
||||||
.updater(new NoOp())
|
.updater(new NoOp())
|
||||||
.list()
|
.list()
|
||||||
.layer(new LSTM.Builder().nIn(10).nOut(10).build())
|
.layer(new LSTM.Builder().nIn(3).nOut(3).build())
|
||||||
.layer(new GlobalPoolingLayer.Builder().poolingType(PoolingType.AVG).build())
|
.layer(new GlobalPoolingLayer.Builder().poolingType(PoolingType.AVG).build())
|
||||||
.layer(new OutputLayer.Builder().nIn(10).nOut(10).activation(Activation.SOFTMAX).build())
|
.layer(new OutputLayer.Builder().nIn(3).nOut(3).activation(Activation.SOFTMAX).build())
|
||||||
.setInputType(InputType.recurrent(10))
|
.setInputType(InputType.recurrent(3))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
MultiLayerNetwork net = new MultiLayerNetwork(conf);
|
MultiLayerNetwork net = new MultiLayerNetwork(conf);
|
||||||
net.init();
|
net.init();
|
||||||
|
|
||||||
INDArray f = Nd4j.rand(new int[]{mb, 10, tsLength});
|
INDArray f = Nd4j.rand(new int[]{mb, 3, tsLength});
|
||||||
INDArray l = TestUtils.randomOneHot(mb, 10);
|
INDArray l = TestUtils.randomOneHot(mb, 3);
|
||||||
INDArray lm = TestUtils.randomBernoulli(mb, 1);
|
INDArray lm = TestUtils.randomBernoulli(mb, 1);
|
||||||
|
|
||||||
assertTrue(lm.sumNumber().intValue() > 0);
|
assertTrue(lm.sumNumber().intValue() > 0);
|
||||||
|
@ -449,18 +453,18 @@ public class GradientCheckTestsMasking extends BaseDL4JTest {
|
||||||
.updater(new NoOp())
|
.updater(new NoOp())
|
||||||
.graphBuilder()
|
.graphBuilder()
|
||||||
.addInputs("in")
|
.addInputs("in")
|
||||||
.layer("0", new LSTM.Builder().nIn(10).nOut(10).build(), "in")
|
.layer("0", new LSTM.Builder().nIn(3).nOut(3).build(), "in")
|
||||||
.layer("1", new GlobalPoolingLayer.Builder().poolingType(PoolingType.AVG).build(), "0")
|
.layer("1", new GlobalPoolingLayer.Builder().poolingType(PoolingType.AVG).build(), "0")
|
||||||
.layer("out", new OutputLayer.Builder().nIn(10).nOut(10).activation(Activation.SOFTMAX).build(), "1")
|
.layer("out", new OutputLayer.Builder().nIn(3).nOut(3).activation(Activation.SOFTMAX).build(), "1")
|
||||||
.setOutputs("out")
|
.setOutputs("out")
|
||||||
.setInputTypes(InputType.recurrent(10))
|
.setInputTypes(InputType.recurrent(3))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
ComputationGraph net = new ComputationGraph(conf);
|
ComputationGraph net = new ComputationGraph(conf);
|
||||||
net.init();
|
net.init();
|
||||||
|
|
||||||
INDArray f = Nd4j.rand(new int[]{mb, 10, tsLength});
|
INDArray f = Nd4j.rand(new int[]{mb, 3, tsLength});
|
||||||
INDArray l = TestUtils.randomOneHot(mb, 10);
|
INDArray l = TestUtils.randomOneHot(mb, 3);
|
||||||
INDArray lm = TestUtils.randomBernoulli(mb, 1);
|
INDArray lm = TestUtils.randomBernoulli(mb, 1);
|
||||||
|
|
||||||
assertTrue(lm.sumNumber().intValue() > 0);
|
assertTrue(lm.sumNumber().intValue() > 0);
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<argLine>-Ddtype=float -Xmx8g -Dtest.solr.allowed.securerandom=NativePRNG</argLine>
|
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx8g -Dtest.solr.allowed.securerandom=NativePRNG</argLine>
|
||||||
<includes>
|
<includes>
|
||||||
<!-- Default setting only runs tests that start/end with "Test" -->
|
<!-- Default setting only runs tests that start/end with "Test" -->
|
||||||
<include>*.java</include>
|
<include>*.java</include>
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<argLine>-Ddtype=float -Xmx8g -Dtest.solr.allowed.securerandom=NativePRNG</argLine>
|
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx8g -Dtest.solr.allowed.securerandom=NativePRNG</argLine>
|
||||||
<includes>
|
<includes>
|
||||||
<!-- Default setting only runs tests that start/end with "Test" -->
|
<!-- Default setting only runs tests that start/end with "Test" -->
|
||||||
<include>*.java</include>
|
<include>*.java</include>
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<argLine>-Ddtype=float -Xmx8g</argLine>
|
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx8g</argLine>
|
||||||
<includes>
|
<includes>
|
||||||
<!-- Default setting only runs tests that start/end with "Test" -->
|
<!-- Default setting only runs tests that start/end with "Test" -->
|
||||||
<include>*.java</include>
|
<include>*.java</include>
|
||||||
|
|
|
@ -38,6 +38,11 @@ public class KMeansTest extends BaseDL4JTest {
|
||||||
|
|
||||||
private boolean[] useKMeansPlusPlus = {true, false};
|
private boolean[] useKMeansPlusPlus = {true, false};
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getTimeoutMilliseconds() {
|
||||||
|
return 60000L;
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testKMeans() {
|
public void testKMeans() {
|
||||||
Nd4j.getRandom().setSeed(7);
|
Nd4j.getRandom().setSeed(7);
|
||||||
|
|
|
@ -282,6 +282,12 @@ public class SimpleRnn extends BaseRecurrentLayer<org.deeplearning4j.nn.conf.lay
|
||||||
|
|
||||||
a.getActivation(currOut, training);
|
a.getActivation(currOut, training);
|
||||||
|
|
||||||
|
if( maskArray != null){
|
||||||
|
//If mask array is present: Also need to zero out errors to avoid sending anything but 0s to layer below for masked steps
|
||||||
|
INDArray maskCol = maskArray.getColumn(i, true).castTo(dataType);
|
||||||
|
currOut.muliColumnVector(maskCol);
|
||||||
|
}
|
||||||
|
|
||||||
prevStepOut = currOut;
|
prevStepOut = currOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -380,7 +380,7 @@
|
||||||
-->
|
-->
|
||||||
<useSystemClassLoader>true</useSystemClassLoader>
|
<useSystemClassLoader>true</useSystemClassLoader>
|
||||||
<useManifestOnlyJar>false</useManifestOnlyJar>
|
<useManifestOnlyJar>false</useManifestOnlyJar>
|
||||||
<argLine>-Ddtype=float -Xmx8g</argLine>
|
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx8g</argLine>
|
||||||
<includes>
|
<includes>
|
||||||
<!-- Default setting only runs tests that start/end with "Test" -->
|
<!-- Default setting only runs tests that start/end with "Test" -->
|
||||||
<include>*.java</include>
|
<include>*.java</include>
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
Maximum heap size was set to 6g, as a minimum required value for tests run.
|
Maximum heap size was set to 6g, as a minimum required value for tests run.
|
||||||
Depending on a build machine, default value is not always enough.
|
Depending on a build machine, default value is not always enough.
|
||||||
-->
|
-->
|
||||||
<argLine>-Ddtype=float -Xmx8g</argLine>
|
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx8g</argLine>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
Maximum heap size was set to 8g, as a minimum required value for tests run.
|
Maximum heap size was set to 8g, as a minimum required value for tests run.
|
||||||
Depending on a build machine, default value is not always enough.
|
Depending on a build machine, default value is not always enough.
|
||||||
-->
|
-->
|
||||||
<argLine>-Ddtype=float -Xmx8g</argLine>
|
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx8g</argLine>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|
|
@ -224,7 +224,7 @@
|
||||||
Depending on a build machine, default value is not always enough.
|
Depending on a build machine, default value is not always enough.
|
||||||
-->
|
-->
|
||||||
<skip>false</skip>
|
<skip>false</skip>
|
||||||
<argLine>-Xmx6g</argLine>
|
<argLine>-Xmx6g -Dfile.encoding=UTF-8</argLine>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
@ -296,7 +296,7 @@
|
||||||
Maximum heap size was set to 6g, as a minimum required value for tests run.
|
Maximum heap size was set to 6g, as a minimum required value for tests run.
|
||||||
Depending on a build machine, default value is not always enough.
|
Depending on a build machine, default value is not always enough.
|
||||||
-->
|
-->
|
||||||
<argLine>-Xmx6g</argLine>
|
<argLine>-Xmx6g -Dfile.encoding=UTF-8</argLine>
|
||||||
<skipTests>false</skipTests>
|
<skipTests>false</skipTests>
|
||||||
<skip>false</skip>
|
<skip>false</skip>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
|
@ -252,7 +252,7 @@
|
||||||
Maximum heap size was set to 6g, as a minimum required value for tests run.
|
Maximum heap size was set to 6g, as a minimum required value for tests run.
|
||||||
Depending on a build machine, default value is not always enough.
|
Depending on a build machine, default value is not always enough.
|
||||||
-->
|
-->
|
||||||
<argLine>-Ddtype=float -Xmx6g</argLine>
|
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx6g</argLine>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|
|
@ -44,6 +44,11 @@ public class TestOpMapping extends BaseNd4jTest {
|
||||||
return 'c';
|
return 'c';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getTimeoutMilliseconds() {
|
||||||
|
return 60000L;
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testOpMappingCoverage() throws Exception {
|
public void testOpMappingCoverage() throws Exception {
|
||||||
Reflections reflections = new Reflections("org.nd4j");
|
Reflections reflections = new Reflections("org.nd4j");
|
||||||
|
|
|
@ -91,7 +91,7 @@
|
||||||
|
|
||||||
For testing large zoo models, this may not be enough (so comment it out).
|
For testing large zoo models, this may not be enough (so comment it out).
|
||||||
-->
|
-->
|
||||||
<argLine>-Ddtype=float -Xmx8g</argLine>
|
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx8g</argLine>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|
|
@ -109,7 +109,7 @@
|
||||||
|
|
||||||
For testing large zoo models, this may not be enough (so comment it out).
|
For testing large zoo models, this may not be enough (so comment it out).
|
||||||
-->
|
-->
|
||||||
<argLine>-Ddtype=float -Xmx8g</argLine>
|
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx8g</argLine>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|
|
@ -100,7 +100,7 @@
|
||||||
|
|
||||||
For testing large zoo models, this may not be enough (so comment it out).
|
For testing large zoo models, this may not be enough (so comment it out).
|
||||||
-->
|
-->
|
||||||
<argLine>-Ddtype=float -Xmx8g</argLine>
|
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx8g</argLine>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|
|
@ -220,7 +220,7 @@
|
||||||
Maximum heap size was set to 6g, as a minimum required value for tests run.
|
Maximum heap size was set to 6g, as a minimum required value for tests run.
|
||||||
Depending on a build machine, default value is not always enough.
|
Depending on a build machine, default value is not always enough.
|
||||||
-->
|
-->
|
||||||
<argLine>-Ddtype=float -Xmx6g</argLine>
|
<argLine>-Ddtype=float -Dfile.encoding=UTF-8 -Xmx6g</argLine>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|
Loading…
Reference in New Issue