Commit c349f95e authored by Laanait, Nouamane's avatar Laanait, Nouamane

filtering fft before use in ynet loss functions


Former-commit-id: a951a885
parent 3704e04f
......@@ -258,7 +258,8 @@ def fftshift(tensor, tens_format='NCHW'):
def thin_object(psi_k_re, psi_k_im, potential):
mask = np.zeros(psi_k_re.shape.as_list(), dtype=np.float32)
center = slice(mask.shape[-1]//5, 4 * mask.shape[-1]//5)
ratio = 0.33
center = slice(int(ratio * mask.shape[-1]), int((1-ratio)* mask.shape[-1]))
mask[:,:,center,center] = 1.
mask = tf.constant(mask, dtype=tf.complex64)
psi_x = fftshift(tf.ifft2d(mask * tf.cast(psi_k_re, tf.complex64) * tf.exp( 1.j * tf.cast(psi_k_im, tf.complex64))))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment