spikingjelly.datasets.n_mnist module#

class spikingjelly.datasets.n_mnist.NMNIST(root: str, train: bool = True, data_type: str | None = 'event', frames_number: int | None = None, split_by: str | None = None, duration: int | None = None, custom_integrate_function: Callable | None = None, custom_integrated_frames_dir_name: str | None = None, transform: Callable | None = None, target_transform: Callable | None = None)[源代码]#

基类:NeuromorphicDatasetFolder

API Language: 中文 | English


  • 中文

N-MNIST 数据集,由 Converting Static Image Datasets to Spiking Neuromorphic Datasets Using Saccades 提出。

有关参数的更多详细信息,请参考 NeuromorphicDatasetFolder


  • English

The N-MNIST dataset, which is proposed by Converting Static Image Datasets to Spiking Neuromorphic Datasets Using Saccades.

Refer to NeuromorphicDatasetFolder

参数:
  • root (Union[str, Path]) -- 数据集的根路径

  • train (Optional[bool]) -- 是否使用训练集

  • data_type (str) -- "event""frame"

  • frames_number (Optional[int]) -- 积分帧的数量

  • split_by (Optional[str]) -- "time""number"

  • duration (Optional[int]) -- 每帧的时间时长

  • custom_integrate_function (Optional[Callable]) -- 用户自定义积分函数

  • custom_integrated_frames_dir_name (Optional[str]) -- 自定义积分帧目录名

  • transform (Optional[Callable]) -- 数据变换

  • target_transform (Optional[Callable]) -- 标签变换

  • root -- Root directory of the dataset

  • train -- Whether to use training set or test set

  • data_type -- "event" or "frame"

  • frames_number -- Number of frames to integrate

  • split_by -- "time" or "number"

  • duration -- Time duration per frame

  • custom_integrate_function -- User-defined integrate function

  • custom_integrated_frames_dir_name -- Custom frames directory name

  • transform -- Transform function

  • target_transform -- Target transform function

返回:

None

返回类型:

None

classmethod get_H_W() Tuple[源代码]#

API Language: 中文 | English


  • 中文

返回:

(34, 34)

返回类型:

Tuple[int, int]


  • English

返回:

(34, 34)

返回类型:

Tuple[int, int]

classmethod resource_url_md5() list[源代码]#

API Language: 中文 | English


  • 中文

返回:

N-MNIST 数据集的下载链接与 MD5 校验值列表

返回类型:

list


  • English

返回:

List of download URLs and MD5 checksums for the N-MNIST dataset

返回类型:

list

classmethod downloadable() bool[源代码]#

API Language: 中文 | English


  • 中文

由于数据集版权限制,N-MNIST 不提供自动下载,用户需手动下载。

返回:

False

返回类型:

bool


  • English

The N-MNIST dataset does not provide automatic download due to copyright restrictions. Users need to download it manually.

返回:

False

返回类型:

bool

classmethod extract_downloaded_files(download_root: Path, extract_root: Path)[源代码]#

API Language: 中文 | English


  • 中文

download_root 中的所有 zip 文件提取到 extract_root

参数:
  • download_root (Path) -- 下载文件所在目录

  • extract_root (Path) -- 提取目标目录

返回:

None

返回类型:

None


  • English

Extract all zip files from download_root into extract_root.

参数:
  • download_root (Path) -- Directory containing the downloaded files

  • extract_root (Path) -- Directory to extract into

返回:

None

返回类型:

None

classmethod create_raw_from_extracted(extract_root: Path, raw_root: Path)[源代码]#

API Language: 中文 | English


  • 中文

将提取后的 ATIS 二进制文件按训练/测试集转换为 .npz 格式并保存。 每个类别目录下的 .bin 文件会被并行转换为 .npz 文件。

参数:
  • extract_root (Path) -- 包含已提取文件的目录

  • raw_root (Path) -- 保存原始数据的目录

返回:

None

返回类型:

None


  • English

Convert extracted ATIS binary files to .npz format by train/test split. Each .bin file under the class directories is converted to .npz in parallel.

参数:
  • extract_root (Path) -- Directory containing the extracted files

  • raw_root (Path) -- Directory to save the raw dataset

返回:

None

返回类型:

None