Objective: To train a neural network as shown in the image below, for an image classification task. (Input dimension can be seen in the image.)
I have been able to create the network, but am facing problems below:
train_minibatch
dictionary.I am using a generator to feed the data to the network, and thus using train_minibatch
to feed the data. The output of this generator are the input images, and a list of 4 items containing the 1 hot encoded labels.
I was able to figure it out myself. For such a scenario, we have to define separate output variables
for each of the branches and then feed the data to them separately.
Consider that y
is a list of 4 elements that are supposed to be the output of the neural network. We would define our data dictionary as shown
trainer.train_minibatch(
{
input_placeholder: x,
output_placeholder0: y[0],
output_placeholder1: y[1],
output_placeholder2: y[2],
output_placeholder3: y[3]
}
)
Other variables like loss, classification error can be a simple sum over the individual losses (This will depend on the specific use case)
For more details have a look at this notebook where I have created the above network, fed the data and trained the model.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With