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

1 次查看(过去 30 天)
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');

回答(1 个)

Edric Ellis
Edric Ellis 2015-7-28
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)...

类别

Help CenterFile Exchange 中查找有关 Parallel and Cloud 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by