フィルターのクリア

fft and complex number operation for dlarray?

1 回表示 (過去 30 日間)
andyFan
andyFan 2020 年 11 月 15 日
コメント済み: Aditya Patil 2021 年 9 月 16 日
Is there any ways to do complex number and fft operations for dlarray?
I'm trying to use auto differentiation to calculate the gradient of a mse loss function.
init_phase = 2*pi*rand(1080,1080)-pi;
phase = dlarray(init_phase,'SS');
in_complex_field = ones(size(phase,1,2)).*exp(1j.*phase);
target_amp = im2double(imread('1,bmp'));
out_complex_field = fft2(ifftshift(in_complex_field));
out_amp = abs(out_complex_field).^2;
mse_val = mse(out_amp, target_amp);
grad = dlgradient(mse_val,phase);
Although I could do basic complex number operations with separable real and imaginary parts,
[real,imag] = polar_to_rect(ones(size(phase,1,2)),phase);
in_complex_field = cat(3,real,imag);
is there any ways that I could do fft2 operation with dlarray?

採用された回答

Aditya Patil
Aditya Patil 2020 年 11 月 18 日
As of now, fft does not support dlarray. This is an known issue, and it might get fixed in any upcoming release.
  2 件のコメント
Hengfa Lu
Hengfa Lu 2021 年 9 月 15 日
Hi Aditya, I want to follow up to see if fft supports dlarray now? Thank you.
Aditya Patil
Aditya Patil 2021 年 9 月 16 日
fft doesn't support dlarray. You can see the list of supported functions.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCustom Training Loops についてさらに検索

タグ

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by