自组织映射内存错误数字。零(x*y,x*y)?我的X/Y应该代表什么?

2024-05-15 21:24:43 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用Stephan Marslands 2D Self-Organzing Map(与Principal Components Analysis一起使用)

import som as sm
#put it into som
def som_algorithm(inputs,nIterations,x=0,y=0):
    print "Running Self-Organizing Map!"
    if x == 0 and y == 0:
        y = len(inputs[0])
        x = len(inputs)
    print "x axis is " + str(x) + " / y axis is " + str(y)
    som = sm.som(x,y,inputs)
    som.somtrain(inputs, nIterations)
    print som.somfwd(inputs)

som_algorithm(training, 100)

根据我的数据集after preprocessing,产生这个错误

^{pr2}$

当前myY表示每个数组的元素数量(数组维度包含在较大维度中),myX表示包含较小数组维度的较大维度。是什么导致了这个内存错误?在


Tags: selfmaplenis错误stephan数组algorithm
1条回答
网友
1楼 · 发布于 2024-05-15 21:24:43

代码试图创建一个形状为x*y×x*y的零数组,即10774440000个元素。数组中的每个值为8字节(双精度)。超过80G。你只是在耗尽记忆。在

相关问题 更多 >