Effacer les filtres
Effacer les filtres

How to only use 2 of my 4 cores (intel i5) to train neural network?

1 vue (au cours des 30 derniers jours)
Jay Cheng
Jay Cheng le 27 Juil 2015
I tried following codes to train NN. But instead of using 2 cores, the train() still uses 4 cores because I can see all of my 4 cores are running high in the Windows 7 task manager. How do I use only two cores to train NN? So that I can use the rest of two cores to do something else?
%%%%%%%%%%%%Code starts
N=2;
myCluster=parcluster('local'); myCluster.NumWorkers=N; parpool(myCluster,N)
net2 = train(net1,x,t,'useParallel','yes','showResources','yes');
y = net2(x,'useParallel','yes','showResources','yes');

Réponses (1)

Edric Ellis
Edric Ellis le 28 Juil 2015
I tried the following:
N=2;
myCluster=parcluster('local');
myCluster.NumWorkers=N;
parpool(myCluster,N)
[x,t] = vinyl_dataset;
net = fitnet(140,'trainscg');
net2 = train(net,x,t,'useParallel','yes','showResources','yes');
and did not see any excessive CPU usage - the two MATLAB workers each used a single CPU. (I tried in R2015a on both Windows and Linux)...

Catégories

En savoir plus sur Parallel and Cloud dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by