parent
581a14118c
commit
ea504bff41
|
@ -36,6 +36,7 @@ pom.xml.versionsBackup
|
||||||
pom.xml.next
|
pom.xml.next
|
||||||
release.properties
|
release.properties
|
||||||
*dependency-reduced-pom.xml
|
*dependency-reduced-pom.xml
|
||||||
|
*/build/*
|
||||||
|
|
||||||
# Specific for Nd4j
|
# Specific for Nd4j
|
||||||
*.md5
|
*.md5
|
||||||
|
|
|
@ -334,6 +334,7 @@ public class DataSet implements org.nd4j.linalg.dataset.api.DataSet {
|
||||||
public void save(File to) {
|
public void save(File to) {
|
||||||
try (FileOutputStream fos = new FileOutputStream(to, false);
|
try (FileOutputStream fos = new FileOutputStream(to, false);
|
||||||
BufferedOutputStream bos = new BufferedOutputStream(fos)) {
|
BufferedOutputStream bos = new BufferedOutputStream(fos)) {
|
||||||
|
to.mkdirs();
|
||||||
save(bos);
|
save(bos);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|
|
@ -166,10 +166,10 @@ public class DataSetIteratorTest extends BaseDL4JTest {
|
||||||
int seed = 123;
|
int seed = 123;
|
||||||
int listenerFreq = 1;
|
int listenerFreq = 1;
|
||||||
|
|
||||||
LFWDataSetIterator lfw = new LFWDataSetIterator(batchSize, numSamples,
|
final LFWDataSetIterator lfw = new LFWDataSetIterator(batchSize, numSamples,
|
||||||
new int[] {numRows, numColumns, numChannels}, outputNum, false, true, 1.0, new Random(seed));
|
new int[] {numRows, numColumns, numChannels}, outputNum, false, true, 1.0, new Random(seed));
|
||||||
|
|
||||||
NeuralNetConfiguration.NeuralNetConfigurationBuilder builder = NeuralNetConfiguration.builder().seed(seed)
|
final var builder = NeuralNetConfiguration.builder().seed(seed)
|
||||||
.gradientNormalization(GradientNormalization.RenormalizeL2PerLayer)
|
.gradientNormalization(GradientNormalization.RenormalizeL2PerLayer)
|
||||||
.optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT)
|
.optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT)
|
||||||
.layer(0, ConvolutionLayer.builder(5, 5).nIn(numChannels).nOut(6)
|
.layer(0, ConvolutionLayer.builder(5, 5).nIn(numChannels).nOut(6)
|
||||||
|
@ -181,7 +181,7 @@ public class DataSetIteratorTest extends BaseDL4JTest {
|
||||||
.build())
|
.build())
|
||||||
.inputType(InputType.convolutionalFlat(numRows, numColumns, numChannels));
|
.inputType(InputType.convolutionalFlat(numRows, numColumns, numChannels));
|
||||||
|
|
||||||
MultiLayerNetwork model = new MultiLayerNetwork(builder.build());
|
final MultiLayerNetwork model = new MultiLayerNetwork(builder.build());
|
||||||
model.init();
|
model.init();
|
||||||
|
|
||||||
model.addTrainingListeners(new ScoreIterationListener(listenerFreq));
|
model.addTrainingListeners(new ScoreIterationListener(listenerFreq));
|
||||||
|
|
Loading…
Reference in New Issue