MATLAB: Does the neural net toolbox handle model training/prediction in a future-time-indepenent manner

forecastingneural networkstraining

Does the neural net toolbox handle model training/prediction in a future-time-indepenent manner? I.e. the prediction for x(t) doesn't use a model trained on data from x(t+n)
For a code example:
inputDelays = 1:delays;
feedbackDelays = 1:delays;
hiddenLayerSize = 10;
net = narxnet(inputDelays,feedbackDelays,hiddenLayerSize);
net = removedelay(net);
[inputs,inputStates,layerStates,targets] = preparets(net,tonndata(x,false,false),{},tonndata(y,false,false));
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
[net,tr,Ys Es Xf Af] = train(net,inputs,targets,inputStates,layerStates);
outputs = net(inputs,inputStates,layerStates);
Would output(i) only be predicted from a model trained on inputs(1:i-1), and if not, is there a simple function for doing this other than re-training and re-predicting at every time step?

Best Answer

About running matlab using MDCS, I would like to ask you 2 questions:
1) It seems that in the beginning matlab starts SMPD in all the workers. Does my code executes in all the workers at the same time or only when I use my parfor cycle? This is because I would expect all the works to communicate when using my parfor cycle.
2) Although I am able to get my job output correctly (the output is a .mat file), I get this error on my cluster .OUT file, whcih is shown by all matlab workers:
%-------------------------------------------------------------------------------------------------------------%
[3]Error using distcomp/getSchedulerUDDConstructor (line 30)
[3]Unable to supply constructor for scheduler . This is an unknown type
[3]Error in distcomp_evaluate_filetask>iCreateSchedulerObject (line 474)
[3]schedulerConstructor = distcomp.getSchedulerUDDConstructor(type);
[3]Error in distcomp_evaluate_filetask>iSetup (line 407)
[3]sched = iCreateSchedulerObject(root, schedulerType, storage);
[3]Error in distcomp_evaluate_filetask (line 41)
[3]runprop = iSetup(handlers, mdceDebugEnabled, varargin);
%-------------------------------------------------------------------------------------------------------------%
I am running my job using this file:
sched = findResource('scheduler', 'type', 'torque');
set(sched, 'ClusterSize', 8);
set(sched, 'ClusterOsType', 'unix');
set(sched, 'RcpCommand', 'scp');
set(sched, 'RshCommand', 'ssh');
set(sched, 'ClusterMatlabRoot', '/vsc-mounts/leuven-apps/matlab/R2011b');
set(sched, 'ResourceTemplate', '-l nodes=2:ppn=6,mem=8gb');
set(sched, 'SubmitArguments', '-l walltime=2:00:00');
set(sched, 'DataLocation', '/user/leuven/306/vsc30684/.matlab/local_scheduler_data/R2011b');
job = createMatlabPoolJob(sched, 'PathDependencies', {'/user/leuven/306/vsc30684/Model Discrimination/CTMI_Schwaab/'});
set(job, 'MinimumNumberOfWorkers', 8);
set(job, 'MaximumNumberOfWorkers', 8);
task = createTask(job, @run, 0, {5,1});
tasks = get(job, 'Tasks');
set(tasks, 'CaptureCommandWindowOutput', true);
submit(job);
waitForState(job, 'finished');
destroy(job);