Skip to content

Instantly share code, notes, and snippets.

@lilalinux
Created September 26, 2017 07:20
Show Gist options
  • Save lilalinux/3c60537510e3aea64bcef63c899b6251 to your computer and use it in GitHub Desktop.
Save lilalinux/3c60537510e3aea64bcef63c899b6251 to your computer and use it in GitHub Desktop.
Are dataSets shuffled?
net.rnnClearPreviousState();
trainDataIter.reset();
INDArray pred = null;
List<INDArray> predictionsTrain = new ArrayList<>();
while (trainDataIter.hasNext()) {
DataSet t = trainDataIter.next();
INDArray featureMatrix = t.getFeatureMatrix(); // [miniBatchSize,inputSize,inputTimeSeriesLength], 5000x2x20 -> [3,5000,2,20,1,100000,5000,0,-1,99]
INDArray predictionMiniBatch = net.rnnTimeStep(featureMatrix);
normalizer.revertLabels(predictionMiniBatch);
predictionsTrain.add(predictionMiniBatch);
if (pred == null) {
pred = predictionMiniBatch;
} else {
pred = Nd4j.concat(0, pred, predictionMiniBatch);
}
}
trainDataIter.reset();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment