def evaluate_risks(data, predict_f, loss_f, model_param):
  """Returns the risk of a model for various loss functions.

  Args:
    data: An array of data samples for approximating the risk.
    predict_f: Function that predicts labels given input.
    loss_f: Function that outputs model's specific loss function.
    model_param: Model parameters.

  Returns:
    Dictionary of risks for following loss functions:
        (model's loss, 0/1, adversarial risk wrt a single norm-ball).
  """
  inputs, labels = data
  pred = predict_f(model_param, inputs)
  loss = loss_f(model_param, inputs, labels)
  zero_one_risk = (1 - (pred == labels)).mean()
  return {
      'loss': loss,
      'zero_one': zero_one_risk,
  }