keunwoochoi/kapre

Amplitude-to-decibel conversion produces different results on different batches

auroracramer opened this issue ยท 7 comments

Related to #16, I found another issue that contributes to different prediction results depending on batch size (and the batches themselves). In particular, it occurs when using converting spectrograms to decibels.

https://github.com/keunwoochoi/kapre/blob/master/kapre/backend_keras.py#L17

The maximum is taken over the entire tensor, instead of per example in the batch. This results in different normalization when the examples in a batch are different.

Oh, you're correct, I didn't realise it. Thanks! In the next version (which tbh I'm not sure when I'd release) I'll fix it.

@keunwoochoi that would be awesome I have the same problem since I'm converting to decibel too!

Ok, what a delay for such a small change :) [this branch] has fixed, sample-wise max(). Will merge later when it seems fine.

Memo for me: DO NOT FORGET TO UPDATE THE VERSION

..and #44.

@keunwoochoi Would it be possible to make a new release soon? We're hoping to make a new release of one of our repos that depend on this issue being fixed as soon as we can.

Thanks for interests! version 0.1.4 fixes the problem and is on here/pip (8090823)