addpath('./Train_LBFGS/')
addpath('./Train_LBFGS/lb')
addpath('./Train_LBFGS/Matlab')
addpath('./layersfunction/')
data_dir = './data/DATA-1D-Cartesian-0.2-complex-brain/Calgary_Brain_Train/';
save('data_dir.mat', 'data_dir');
load('./mask/1D-Cartesian-0.4.mat');
save('mask.mat', 'mask');
l0 = loss_with_gradient_total(wei0)
fun = @loss_with_gradient_total;
low = -inf*ones(length(wei0),1);
upp = inf*ones(length(wei0),1);
opts.x0 = double(gather(wei0));
opts.maxTotalIts = 7.2e4;
[wei1, l1, info] = lbfgsb(fun, low, upp, opts);
fprintf('Before training, error is %f; after training, error is %f.\n', l0, l1);
When I try to run this Deep Learning Training Code, I get this error:
Unrecognized field name "data".
Error in getMData_train (line 11)
data.label = double(ma.data.i.label);
Error in loss_with_gradient_total (line 13)
data = getMData_train(i);
Error in L_BFGSnetTrain (line 28)
l0 = loss_with_gradient_total(wei0)
The Code for getMData_train:
function data = getMData_train(n)
ImageSize = nnconfig.ImageSize ;
data.train = double(zeros(ImageSize));
data.label = double(zeros(ImageSize));
ma = load (strcat(data_dir , saveName(n, 2)));
data.label = double(ma.data.label);
data.train = double(ma.data.train);