def get_val_stats(learner):
    """returns final stats from recorder"""
    rec = learner.recorder
    ret = {'loss':float(rec.val_losses[-1])}
    for i, name in enumerate(rec.metrics_names):
        ret[name] = float(rec.metrics[-1][i])
    return ret