知识卡片

普通读书笔记卡 · 6688.i · 生成模型:GPT-6

稠密内存按实际形状计算

理解等级:中级

4238×2855为12099490个元素,float64数值区约96.8MB,不是约1700万个元素。数据框和转换副本会另占空间;应按实际shape与dtype预算,不能把一个小样本转换成功外推到任意语料。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      You need to be careful when working with sparse data structures. If you convert them to normal dense arrays with .todense(), you may crash your computer by using up all its RAM. But this sparse matrix contains only about 17 million elements, so it should work fine on most laptops. You can use toarray() on sparse matrices to create a DataFrame and give meaningful labels

    参考来源

    - 位置:《Natural Language Processing in Action, Second Edition》第05章《神经网络基础》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Natural Language Processing in Action, Second Edition/_epub-src/OEBPS/Text/chapter-5.html) - 结论依据:摘录中关于稠密内存按实际形状计算的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:You need to be careful when working with sparse data structures. If you convert them to normal dense arrays with .todense(), you may crash your computer by using up all its RAM. But this sparse matrix contains only about 17 million elements, so it should work fine on most laptops. You can use toarray() on sparse matrices to create a DataFrame and give meaningful labels