I want to create an artificial neural network with one hidden layer for a classification task using th titanic data. the problem ist that i can not set the dimension of the hidden layer to 10.
it says that the Output dimensions does not match with the provided data output shape.
the output layer contains 2 neurons because there are 2 classes.
my question is how is it possible to construct a neural network with one hidden layer that contains a different number of neurones as the output layer?
Hi the output layer is the layer which you just need to connect at the end of the model.
Its dimension is the dimension of your output.
Since you are trying a classification problem with 2 classes its size is (None,2).
If you want to build NN with just 1 hidden layer then you need to add 2 dense layer.
1st layer will be your hidden layer with any number of neuron and next dense layer will be your output layer which must have 2 as the output dimension and function as softmax since you are doing binary classification.