from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense model = Sequential([ Dense(units=64, activation='relu', input_shape=(784,)), Dense(units=10, activation='softmax') ]) model.summary()
Model: "sequential" _________________________________________________________________ Layer (type) Output Shape Param # ================================================================= dense (Dense) (None, 64) 50240 _________________________________________________________________ dense_1 (Dense) (None, 10) 650 ================================================================= Total params: 50,890 Trainable params: 50,890 Non-trainable params: 0 _________________________________________________________________In this example, a simple sequential model is defined with two dense layers. The summary shows that the first layer has 50,240 trainable parameters and the second layer has 650 trainable parameters. The total number of trainable parameters in the model is 50,890. The package library used in this example is tensorflow.