spmd running multiple times
Show older comments
I'm running 2 RBF networks with different spread constant values. I'm trying to use spmd to get both executed in concurrent fashion. Following is the code:
spread1=365;
spread2=575;
goal=0.0;
max_neurons=2500;
neuron_jump=500;
tic
spmd(2)
RB_SC_365=newrb(input_mat, targets, goal, spread1, max_neurons, neuron_jump);
RB_SC_575=newrb(input_mat, targets, goal, spread2, max_neurons, neuron_jump);
end
toc
Per my understanding of spmd, spmd(2) will take 2 worker threads from the pool, one will execute RB_SC_365 and other will execute RB_SC_575, and then the script will exit. However, the script is being executed twice.
Here is the output I'm getting:
Lab 1:
NEWRB, neurons = 0, MSE = 0.16
Lab 2:
NEWRB, neurons = 0, MSE = 0.16
NEWRB, neurons = 500, MSE = 1.14309e-28
Lab 1:
NEWRB, neurons = 500, MSE = 1.14309e-28
Lab 2:
NEWRB, neurons = 0, MSE = 0.16
Lab 1:
NEWRB, neurons = 0, MSE = 0.16
Lab 2:
NEWRB, neurons = 500, MSE = 5.26541e-29
Lab 1:
NEWRB, neurons = 500, MSE = 5.26541e-29
As can be seen above, the script has executed twice. The output that I expect is:
Lab 1:
NEWRB, neurons = 0, MSE = 0.16
Lab 2:
NEWRB, neurons = 0, MSE = 0.16
NEWRB, neurons = 500, MSE = 1.14309e-28
Lab 1:
NEWRB, neurons = 500, MSE = 1.14309e-28
Is there some way to execute the script only once with spmd?
Accepted Answer
More Answers (0)
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!