Dear sir or madam,
I will run my code on the HPC in our school, I would like to ask that Does PySMILE has the capability to use multiple CPU? Does SMILE allow to use multiple CPU's?
kind regards!
Yajie
does PySMILE has the capability to use multiple CPU?
-
- Posts: 34
- Joined: Thu Mar 19, 2020 11:49 am
-
- Site Admin
- Posts: 63
- Joined: Mon Nov 06, 2017 6:41 pm
Re: does PySMILE has the capability to use multiple CPU?
You can use PySMILE code with Python multiprocessing package, like below:
I hope it helps :)
Code: Select all
import pysmile
import pysmile_license
import multiprocessing
import time
ds = pysmile.learning.DataSet()
ds.read_file("[path_to_dataset_file]")
def learn_net_from_dataset(ds):
bs = pysmile.learning.BayesianSearch()
bs.learn(ds)
if __name__ == '__main__':
starttime = time.time()
processes = []
for i in range(1000):
p = multiprocessing.Process(target=learn_net_from_dataset, args=(ds,))
processes.append(p)
p.start()
for process in processes:
process.join()
print('Learning with multiprocessing took {} seconds'.format(time.time() - starttime))
starttime = time.time()
for i in range(1000):
learn_net_from_dataset(ds)
print('Learning without multiprocessing took {} seconds'.format(time.time() - starttime))
-
- Posts: 34
- Joined: Thu Mar 19, 2020 11:49 am
Re: does PySMILE has the capability to use multiple CPU?
thank you. but your answer is related to structure learning. I create the network by myself and I need to learn the parameter of this created network in HPC.
Is it possible to use more than one CPU cores when making the parameter learning?
And Is it possible to use multiple cores in the single CPU when making parameter learning?
Is it possible to use more than one CPU cores when making the parameter learning?
And Is it possible to use multiple cores in the single CPU when making parameter learning?
-
- Site Admin
- Posts: 1441
- Joined: Mon Nov 26, 2007 5:51 pm
Re: does PySMILE has the capability to use multiple CPU?
The answer to both question is negative. SMILE currently does not use multiple threads in its inference and learning algorithms.Is it possible to use more than one CPU cores when making the parameter learning?
And Is it possible to use multiple cores in the single CPU when making parameter learning?
We had at one point a proof of concept code running in the Hadoop cluster performing EM learning. This required some changes in the core library and the support from SMILE's Java wrapper.