def METHOD_NAME(energy,
             f_p_opt,
             f_dp_opt,
             f_p_noisy_ss,
             f_dp_noisy_ss,
             inds,
             known_response_energy=None,
             known_response_f_p=None,
             known_response_f_dp=None,
             ):
    """Optimization loss is the MSE of the match to the noisy subsampled data summed with the penalty for
    violating the Kramers-Kronig relations"""
    data_loss = torch.mean((f_p_opt[inds]-f_p_noisy_ss)**2 + (f_dp_opt[inds]-f_dp_noisy_ss)**2)
    kk_loss = kramers_kronig.get_penalty(energy, f_p_opt, f_dp_opt, padn=0, trim=0,
                                         known_response_energy=known_response_energy,
                                         known_response_f_p=known_response_f_p,
                                         known_response_f_dp=known_response_f_dp,
                                         )
    return(data_loss + kk_loss)