|
def compute_accuracy(self, loss): |
|
r""" |
|
Compute the accuracy of the losses according to |
|
Joseph Turian and Max Henry, “I'm sorry for your loss: Spectrally-based |
|
audio distances are bad at pitch,” arXiv preprint arXiv:2012.04572, 2020. |
|
""" |
|
steps = self.steps |
|
steps = steps.cpu().numpy() |
|
# find the index in steps of the element closest to the target value |
|
target_indx = np.abs(steps - self.param_config.target_value).argmin() |
|
accuracy = np.empty(loss.shape) |
|
for i_crit in range(len(self.criteria)): |
|
for i_run in range(loss.shape[0]): |
|
for i_step in range(loss.shape[1]): |
|
accuracy[i_run, i_step, i_crit] = int( |
|
loss[i_run, i_step, i_crit] > loss[i_run, target_indx, i_crit] |
|
) |
|
|
|
return accuracy.mean(axis=0) |
Does not coincide with Eq. (5) and Eq. (6) of arXiv:2012.04572
flamo/flamo/optimize/surface.py
Lines 305 to 323 in 68d0a71
Does not coincide with Eq. (5) and Eq. (6) of arXiv:2012.04572