Menu

Compiling the ANN Model

Compiling the ANN Model

Compile the model before training.

Code

ann.compile(
optimizer='SGD',
loss='sparse_categorical_crossentropy',
metrics=['accuracy']
)

Explanation

The model uses:

  • SGD optimizer
  • Sparse Categorical Crossentropy loss function
  • Accuracy as the evaluation metric

Compiling prepares the model for training.