15.15 Loss functions and optimizers

  • Once network architecture (model) is defined → choose loss function & optimizer
  • Loss function (also called objective function)
    • Quantity that will be minimized during training (measure of success)
  • Optimizer
    • Determines how the network will be updated based on the loss function
# Example code: compile the model
model %>% compile(
    optimizer = "rmsprop", # Optimizer algorithm
    loss = "mse", # Mean squared error loss function
    metrics = c("mae") # mean absolute error (MAE)
  )