I was wondering what the difference is between doing something like
dense = Dense(64)
x = dense(input)
and this
dense = Dense(64)(input)
Are these two notations equivalent?
I was wondering what the difference is between doing something like
dense = Dense(64)
x = dense(input)
and this
dense = Dense(64)(input)
Are these two notations equivalent?
AFTER EDIT:
No, there is no difference, they generate the same exact model.
BEFORE EDIT:
From keras functional API documentation:
You create a new node in the graph of layers by calling a layer on this inputs object:
dense = layers.Dense(64, activation="relu")
x = dense(inputs)
In the code you posted there are no assignments.
Check how the model is connected with the plot method, a layer could exist but not be connected with the rest of the model.
keras.utils.plot_model(model, "my_first_model.png")
source: