Fix an issue which prevents EarlyStopping callback (#678)
Fix an issue which prevents EarlyStopping callback (#678)

* Fix an issue which prevents EarlyStopping callback

When `val_loss` is used as metric for `EarlyStopping` monitoring, it only takes in scalar for comparison, raising the following error: `ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()`, since `loss_vals['loss']` is a 1st order tensor. A simple fix is to only add `det_loss[0]` to `total_loss`.

* Remove trailing values in _detection_loss.

* yapf'ed
google/automl,google/automl