def save_params(net, best_metric, current_metric, epoch, save_interval, prefix):
    """Logic for if/when to save/checkpoint model parameters"""
    if current_metric < best_metric:
        best_metric = current_metric
        net.save_parameters('{:s}_best.params'.format(prefix, epoch, current_metric))
        with open(prefix+'_best.log', 'a') as f:
            f.write('\n{:04d}:\t{:.4f}'.format(epoch, current_metric))
    if save_interval and (epoch + 1) % save_interval == 0:
        net.save_parameters('{:s}_{:04d}_{:.4f}.params'.format(prefix, epoch, current_metric))
    return best_metric