kertas model call code example

Example 1: keras model compile

model = Sequential([
    Dense(32, input_shape=(784,)),
    Activation('relu'),
    Dense(10),
    Activation('sigmoid'),
])

model.compile(
    optimizer="rmsprop",
    loss=None,
    metrics=None,
    loss_weights=None,
    weighted_metrics=None,
    run_eagerly=None,
    steps_per_execution=None
)

model.fit(x, y, batch_size=32, epochs=50)

Example 2: keras model.fit function

model.fit(trainX, trainY, batch_size=32, epochs=50)

Tags:

Misc Example