double errorInstance = 0;
for (double[] instance : instanceList) {
DoubleVector vector = new DenseDoubleVector(instance);
DoubleVector decoded = encoder.getOutput(vector);
DoubleVector diff = vector.subtract(decoded);
double error = diff.dot(diff);
if (error > 0.1) {
++errorInstance;
}
}
Log.info(String.format("Autoecoder error rate: %f%%\n", errorInstance * 100 / instanceList.size()));