.format(
"The dimension of training instance is %d, but requires %d.",
trainingInstance.getDimension(), inputDimension
+ outputDimension));
inputInstance = new DenseDoubleVector(this.layerSizeList.get(0));
inputInstance.set(0, 1); // add bias
// get the features from the transformed vector
for (int i = 0; i < inputDimension; ++i) {
inputInstance.set(i + 1, transformedVector.get(i));
}
// get the labels from the original training instance
labels = trainingInstance.sliceUnsafe(inputInstance.getDimension() - 1,
trainingInstance.getDimension() - 1);
} else if (this.learningStyle == LearningStyle.UNSUPERVISED) {
// labels are identical to input features
outputDimension = inputDimension;
// validate training instance
Preconditions.checkArgument(inputDimension == trainingInstance
.getDimension(), String.format(
"The dimension of training instance is %d, but requires %d.",
trainingInstance.getDimension(), inputDimension));
inputInstance = new DenseDoubleVector(this.layerSizeList.get(0));
inputInstance.set(0, 1); // add bias
// get the features from the transformed vector
for (int i = 0; i < inputDimension; ++i) {
inputInstance.set(i + 1, transformedVector.get(i));
}