I would like to compute a loss function but I have a problem in using the fft function. Here the code with numpy:
def bidule(y_true, y_pred):
product = np.fft.fft(y_true) * np.fft.fft( y_pred).conj()
cc = np.fft.fftshift(np.fft.ifft(product))
return np.argmax(cc.real)
I would like to use the Keras backends but when I replace np by K the code don't run. "module 'keras.backend' has no attribute 'fft'"