我正在尝试标准化 CSR 矩阵,
但我收到此错误: (*** TypeError: No matching signature found).
from sklearn.preprocessing import normalize
normalize(x_m, norm="l2", axis=1)
Run Code Online (Sandbox Code Playgroud)
该矩阵是 609186x849632 类型为 'numpy.float16' 的稀疏矩阵,其中包含 189140200 个以压缩稀疏行格式存储的元素
我有 50 种不同的方法想要运行。我有 10 个可用的 cpu,所以我只能同时运行 10 个进程。所以我运行了 5 次。然而,问题是前 10 个进程必须完成才能启动后 10 个进程,这会增加完成所需的时间。我想要的是,一旦 9 个进程运行,一个新进程就应该启动并始终运行 10 个进程。
我将 50 个班级分成 5 个不同的小组并运行。
group1 = [class1, class2...] group2 = [class11, class12..]
组 = [组 1, 组 2, ..., 组 5]
for group in groups:
threads = []
for x in group:
threads.append(mp.Process(target= x().method(), args= (b,)))
for thread in threads:
thread.start()
for thread in threads:
thread.join()
Run Code Online (Sandbox Code Playgroud)