Assuming I have a dataset of size (1000, 64) where 64 is the number of columns (i.e., features). In Keras, suppose I want to build a NN model as the following architecture:
- Input layer: Obviously should be one layer having a number of neurons equal to the number of features in my dataset. Hence, the number of neurons here = 64.
- Hidden Layer: I want to this hidden layer to have 100 neurons.
- Output Layer: This is one neuron because I am working with a binary classification problem.
Now, to build the aformentioned architecture in Keras, I usually do the following:
model = Sequential()
model.add(Dense(units=64, input_dim=64, activation='tanh')) # Input layer
model.add(Dense(units=100, activation='tanh')) # Hidden layer
model.add(Dense(units=1, activation='sigmoid')) # Output layer
The problem is that I cannot distinguish between the arguments units and input_dim for the Dense() layer (For the role as the first layer (Input Layer)). I do understand that input_dim is meant to specify the number of features in your dataset (which is in my case = 64), but I don't understand the role of units here for the input layer. Should units be 64? In another word, is the argument units supposed to be the same input_dim for the input layer?
Thank you very much.
