andabi / music-source-separation

Deep neural networks for separating singing voice from music written in TensorFlow
795 stars 150 forks source link

how to write the mask layer in keras ? #50

Open ucasiggcas opened 4 years ago

ucasiggcas commented 4 years ago

hi, I just want to use keras instead of tf to write the model, but I can't when I find that it's not easy to write the easy Ops in tf that is, I can't translate the codes into keras # time-freq masking layer y_tilde_src1 = y_hat_src1 / (y_hat_src1 + y_hat_src2 + np.finfo(float).eps) * self.x_mixed y_tilde_src2 = y_hat_src2 / (y_hat_src1 + y_hat_src2 + np.finfo(float).eps) * self.x_mixed

any one could help me ?

I know the x_mixed is the inputs, shape =(None,None,513) if I set the second None as 5,and the first is the batch,