Hi, I would like to use two separate files for ANN.one file for training and the other file for test of data.Here is for the one input.
inputs = ii';targets = f';inputGap = ig;targetGap = fg; hiddenLayerSize = j; net = fitnet(hiddenLayerSize); net.inputs{1}.processFcns = {'removeconstantrows','mapminmax'}; net.outputs{2}.processFcns = {'removeconstantrows','mapminmax'}; net.divideFcn = 'dividerand'; net.divideMode = 'sample'; net.divideParam.trainRatio = 70/100; net.divideParam.valRatio = 15/100; net.divideParam.testRatio = 15/100; net.trainFcn = 'trainlm'; net.performFcn = 'mse'; % Train the Network
[net,tr] = train(net,inputs,targets); outputs = net(inputs); errors = gsubtract(targets,outputs); performance = perform(net,targets,outputs); valTargets = targets .* tr.valMask{1}; testTargets = target .* tr.testMask; trainPerformance = perform(net,trainTagets,outputs); testPerformance = perform(net,testTargets,outputs); out1.net = net; out1.inputs = inputs; out1.targets = targets;
Best Answer