def checkpoint_test_loss(filename):
    """
    Reads the checkpoint test loss off of the filename
    and returns it. Returns float('inf') if not possible
    """
    par = filename.split('-')
    if len(par) < 5:
        return float('inf')
    try:
        loss = par[-4][1:]
        loss = float(loss)
    except:
        return float('inf')
    return loss