Hello,
I am having trouble fitting a model. I keep getting the error: Labels and preOutput must have equal shapes: got shapes [39, 9] vs [780, 9]
. I am not sure why I’m getting the error and was wondering if anyone could help out.
My model configuration looks like:
new NeuralNetConfiguration.Builder()
.weightInit(WeightInit.NORMAL)
.activation(Activation.RELU)
.updater(new Adam.Builder().build())
.list()
.setInputType(InputType.feedForward(1000))
.layer(new EmbeddingSequenceLayer.Builder()
.nOut(16)
.inputLength(20)
.build())
.layer(new DenseLayer.Builder()
.nOut(16)
.activation(Activation.RELU)
.build())
.layer(new DenseLayer.Builder()
.nOut(16)
.activation(Activation.RELU)
.build())
.layer(new OutputLayer.Builder()
.nOut(9)
.activation(Activation.SOFTMAX)
.lossFunction(LossFunctions.LossFunction.RECONSTRUCTION_CROSSENTROPY)
.build())
.backpropType(BackpropType.Standard)
I have a training set (INDArray) which is 39 x 20 matrix where the features represent a tokenized sequence of words. My training labels are a 39 x 9 matrix with each row representing a one-hot encoded vector of specific classes.
Problem Description
I am trying to essentially port this medium article to DL4J.
Please let me know if I need to add anything to the description to clarify the question!