Created
September 26, 2017 07:20
-
-
Save lilalinux/3c60537510e3aea64bcef63c899b6251 to your computer and use it in GitHub Desktop.
Are dataSets shuffled?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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