Train_X must be a float.

1 回表示 (過去 30 日間)
Rizwan Hassan
Rizwan Hassan 2019 年 11 月 11 日
回答済み: Puru Kathuria 2020 年 3 月 6 日
May anybody help me to train my autoencoder for training dataset.
My training dataset is of size 10000*3072.But I want to let my model to train for its subset of different sizes like 1000*700, 1500*1000, 784,100 etc
but for every dataset sometimes it generates error: train_x must be float or train_x must be an integer.
here is the error.
here is the code
function demo_SAE
load('data_batch_1.mat');
train_x=(data(1:1200,1:1200));
rand('state',0)
sae = saesetup([784 100]);
sae.ae{1}.activation_function = 'sigm';
sae.ae{1}.learningRate = 1;
sae.ae{1}.inputZeroMaskedFraction = 0.0;
opts.numepochs = 10;
opts.batchsize = 100;
sae = saetrain(sae, train_x, opts);
visualize(sae.ae{1}.W{1}(:,2:end)')
  3 件のコメント
Rizwan Hassan
Rizwan Hassan 2019 年 11 月 19 日
train_x=training data set
Walter Roberson
Walter Roberson 2019 年 11 月 19 日
Use the GUI to put a breakpoint at the beginning of the line
rand('state',0)
Now execute the code. It will stop before executing the rand() call. Now at the command window, give the command
class(train_x)
and copy and paste the result into a response here.

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

回答 (1 件)

Puru Kathuria
Puru Kathuria 2020 年 3 月 6 日
Hi,
I see that you are not able to train your model because of the data type of your training data. I think the following snippet might solve your issue. Put the following snippet before training and see if it helps.
isItFloat = isfloat(train_x);
if(isItFloat == 0)
train_x = double(train_x);
end

カテゴリ

Help Center および File ExchangeModel Building and Assessment についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by