def log_mse_loss(prep_labels, data, generator, output_preprocessor):
    'MSE loss between a reflectivity curve and a model curve generated with the given normalized labels.'
    restored_labels = output_preprocessor.restore_labels(np.atleast_2d(prep_labels))
    model = generator.simulate_reflectivity(restored_labels, progress_bar=False)[0]
    loss = mean_squared_error(np.log10(data), np.log10(model))
    return loss
MSE loss between a reflectivity curve and a model curve generated with the given normalized labels.
def log_mse_loss(prep_labels, data, generator, output_preprocessor):
    
    restored_labels = output_preprocessor.restore_labels(np.atleast_2d(prep_labels))
    model = generator.simulate_reflectivity(restored_labels, progress_bar=False)[0]
    loss = mean_squared_error(np.log10(data), np.log10(model))
    return loss