-1

I saw the following in a guide to text classification:

hidden_layer = layers.Dense(100, activation="relu")(input_layer)

What does the (input_layer) mean?

The context is:

def create_model_architecture(input_size):

    # create input layer 
    input_layer = layers.Input((input_size, ), sparse=True)
    
    # create hidden layer
    hidden_layer = layers.Dense(100, activation="relu")(input_layer)
    
    # create output layer
    output_layer = layers.Dense(1, activation="sigmoid")(hidden_layer)

    classifier = models.Model(inputs = input_layer, outputs = output_layer)
    classifier.compile(optimizer=optimizers.Adam(), loss='binary_crossentropy')
    return classifier 

Also - is this a sequential model?

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Pearl
  • 53
  • 1
  • 5

1 Answers1

0

See input layer is nothing but how many neurons or nodes you want for input. Suppose I have 3 features in my dataset then I'll have 3 neurons in input layer. And yes it's sequential model.

Vibhav Surve
  • 73
  • 1
  • 6