KZKY memo

自分用メモ.

numpy

Comparison between Multiprocessing and Multithreading in Python

Comparison between Multiprocessing and Multithreading in Python See github.com

PythonにおけるShared Memory

前提 pythonはGILの影響でmulti thread programmingでcpu-bound jobが早くならない. なので,multiprocessingを使うしかない.CPythonのmultiprocessingはforkなので,unixならcopy-on-write.なので,globで定義したデータなら,Read-onlyに限り,特段気に…

python: pairwise-distance

numpyでfor-loopしながらpairwise distanceを計算すると非常に遅い. pairwise distanceはgram行列のカーネルにrbfを使った時に絶対に出てくるので,高速計算は必須要件. 比較 普通のfor-loop 行列計算ベースで一気に行う方法 numbaで比較する 環境 Ubuntu1…