1
2
3
4
5
6
7
8
9
10
11
model = tf.keras.Sequential([
input_layers,
layers.Dense(1024, activation='relu'),
layers.BatchNormalization(),
layers.Dense(512, activation='relu'),
layers.BatchNormalization(),
layers.Dropout(.2),
layers.Dense(1, activation='sigmoid')
])
model.compile(optimizer, loss, metrics)
model.fit(train_ds, val_ds, epochs, callbacks)
1
2
3
4
5
6
for units in hidden_units:
inputs = layers.Dense(units)(inputs)
inputs = layers.BatchNormalization()(inputs)
inputs = layers.ReLU()(inputs)
inputs = layers.Dropout(dropout)(inputs)
model = layers.Dense(1, activation='sigmoid')(inputs)