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 CenterFile Exchange에서 Model Building and Assessment에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by