Why does using the parallelization option slow down my neural network simulations?
Mostrar comentarios más antiguos
Hi,
I am using the neural network toolbox to train and simulate a feedforeward neural network in the following manner:
net1 = feedforwardnet(60); net2 = train(net1,inputs,targets,'useParallel','yes') outputs = net2(input_big,'useParallel','yes');
Theese comands are taken straigth from mathworks homepages: http://www.mathworks.se/help/nnet/gs/parallel-computing.html
Without parallelization the code takes about 26 seconds to finish, with parallelization it varies somewhat, but takes between 40-60 seconds. I am using a pool of four workers on an intel core i7 with R2013a.
If you have an idea for something I could try to speed things up it would very appreciated.
Pål Egil
2 comentarios
Mark Hudson Beale
el 5 de Jun. de 2013
Editada: Mark Hudson Beale
el 5 de Jun. de 2013
What size dataset are you using? How much RAM do you have? Are you setting the random seed so that each run is comparable? (Different random initial conditions can result in different times.)
Here are two runs to compare with:
------
For the following code, I get 87 and 40 seconds in R2013a with 4 workers.
[x,t] = vinyl_dataset;
net1 = feedforwardnet(10);
rng(0), tic, net2 = train(net1,x,t); toc
matlabpool open 4
rng(0), tic, net3 = train(net1,x,t,'useParallel','yes'); toc
-------
This code ran in 41 and 10 seconds:
[x,t] = house_dataset;
net1 = feedforwardnet(60);
rng(0), tic, net2 = train(net1,x,t); toc
rng(0), tic, net3 = train(net1,x,t,'useParallel','yes'); toc
------
What times do you get?
Mark
Giovanni Barbarossa
el 12 de Mayo de 2020
I have the same problem with patternnet. The training is 5 times slower with the parallel option. It makes no sense.
Respuestas (0)
Categorías
Más información sobre Pattern Recognition en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!