Batch Normalization

  • Batch normalization can help to stabilize and speed up training, especially in deep networks.pythonCopy codefrom tensorflow.keras.layers import BatchNormalization model = Sequential([ Dense(64, input_shape=(20,)), BatchNormalization(), Activation('relu'), Dense(32), BatchNormalization(), Activation('relu'), Dense(1) ]) model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *