File size: 494 Bytes
906d507 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import tensorflow as tf
def create_model(input_shape=8):
# neural network for binary classification
model = tf.keras.Sequential([
tf.keras.layers.Input(shape=(input_shape,)),
tf.keras.layers.Dense(64, activation='relu'),
tf.keras.layers.Dense(32, activation='relu'),
tf.keras.layers.Dense(1, activation='sigmoid')
])
model.compile(
optimizer='adam',
loss='binary_crossentropy',
metrics=['accuracy']
)
return model |