• KNN实现mnist、fashion mnist数据集的分类


    一、遇到的问题小结

    1.python读取数据集文件,因为路径的问题总是报错,错误是no file directory,改了很久,最后正确的示例(要注意的一点就是一定要仔细核对,我有一个地方将‘-’变成了‘.’竟然报错OSError,一下子懵逼,后面才发现写错了):

    2.python的struct.pack_into函数

    struct.pack_into(fmt, buffer, offset, v1, v2, ...)

    Pack the values v1, v2, ... according to the format string fmt and write the packed bytes into the writable buffer buffer starting at position offset. Note that offset is a required argument.

    按照指定的格式fmt,将v1,v2...打包到buffer中,其中偏移位置为offset

    3. python的struct.pack_from函数

    struct.unpack_from(fmt, buffer, offset=0)

    Unpack from buffer starting at position offset, according to the format string fmt. The result is a tuple even if it contains exactly one item. The buffer’s size in bytes, minus offset, must be at least the size required by the format, as reflected by calcsize().

    按照指定的格式fmt,从偏移位置offset开始解包,返回数据格式是一个元组(v1,v2...)

    参考链接:https://www.aliyun.com/jiaocheng/526451.html

    4. shape函数是numpy.core.fromnumeric中的函数,它的功能是查看矩阵或者数组的维数。

    参考链接:https://blog.csdn.net/u010758410/article/details/71554224

    5. tile函数。

    原型:numpy.tile(A,reps)

    tile共有2个参数,A指待输入数组,reps则决定A重复的次数。整个函数用于重复数组A来构建新的数组。

    一生有所追!
  • 相关阅读:
    Elixir 学习资源
    elixir 模块
    elixir 表单 map
    elixir 关键字列表
    elixir case cond if
    elixir 模式匹配
    elixir 基础数据结构
    5、OpenCV Python ROI和泛洪填充
    6、OpenCV Python 图像模糊
    4、OpenCV Python 像素运算
  • 原文地址:https://www.cnblogs.com/BlueBlue-Sky/p/9296722.html
Copyright © 2020-2023  润新知