def inference(epoch):
    val_loss = evaluate(val_data)
    print(('-' * 89))
    print('| End of epoch {:3d} | valid loss {:5.3f} | valid bpc {:8.3f}'.format(epoch, val_loss, (val_loss / math.log(2))))
    test_loss = evaluate(test_data)
    print('| End of epoch {:3d} | test loss {:5.3f} | test bpc {:8.3f}'.format(epoch, test_loss, (test_loss / math.log(2))))
    print(('-' * 89))
    return (val_loss, test_loss)
def inference(epoch):
    val_loss = evaluate(val_data)
    print(('-' * 89))
    print('| End of epoch {:3d} | valid loss {:5.3f} | valid bpc {:8.3f}'.format(epoch, val_loss, (val_loss / math.log(2))))
    test_loss = evaluate(test_data)
    print('| End of epoch {:3d} | test loss {:5.3f} | test bpc {:8.3f}'.format(epoch, test_loss, (test_loss / math.log(2))))
    print(('-' * 89))
    return (val_loss, test_loss)