フィルターのクリア

I want to know how to writ code to net1 = train(net,input,z) but z is double(complex)??

2 ビュー (過去 30 日間)
Darshini
Darshini 2022 年 9 月 10 日
回答済み: Walter Roberson 2022 年 9 月 11 日
net1 = train(net, input, z);
Error using nntraining.setup>setupPerWorker
Targets T is complex.
Error in nntraining.setup (line 77)
[net,data,tr,err] = setupPerWorker(net,trainFcn,X,Xi,Ai,T,EW,enableConfigure);
Error in network/train (line 342)
[net,data,tr,err] = nntraining.setup(net,net.trainFcn,X,Xi,Ai,T,EW,enableConfigure,isComposite);
  2 件のコメント
KSSV
KSSV 2022 年 9 月 10 日
It looks your target is complex number. NN do not support complex values. Instead you may take target as two values real and imaginary seperately.
Darshini
Darshini 2022 年 9 月 10 日
If I can't change the Z function, how should I code it?
z= ((exp(sin(x))).*(cos(y)))+((sin(y)).*log(abs(tan(x.^2))+(x.^3)));

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

回答 (2 件)

Chunru
Chunru 2022 年 9 月 10 日
編集済み: Chunru 2022 年 9 月 10 日
net1 = train(net,input,[real(z) imag(z)])
  5 件のコメント
Darshini
Darshini 2022 年 9 月 10 日
now it show
Error using network/train
Inputs and targets have different numbers of samples.
again
If I can't change the Z function, how should I code it?
z= ((exp(sin(x))).*(cos(y)))+((sin(y)).*log(abs(tan(x.^2))+(x.^3)));
Chunru
Chunru 2022 年 9 月 11 日
Attach your code to demonstrate the problem. Otherwise it's difficult to guess what is wrong.

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


Walter Roberson
Walter Roberson 2022 年 9 月 11 日
z= ((exp(sin(x))).*(cos(y)))+((sin(y)).*log(abs(tan(x.^2))+(x.^3)));
z appears to be your target for a fitting function. You tell us that z is complex-valued.
Create a 2 x N array xy with x in the first row and y in the second row.
Create a 2 x N array zri with real(z) in the first row and imag(z) in the second row.
Now you can train xy as the features and zri as the targets.
You might possibly have to transpose xy tne N x 2 and zri to N x 2 for the particular training function you use.

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by