spikingjelly.datasets package#
备注
API 改动说明
SpikingJelly 0.0.0.1.0 对 datasets 包进行了结构性重构,以提升代码的模块化程度和可维护性。主要改动为:
datasets/__init__.py被拆分为base.py、utils.py以及transform.py;新的
datasets/__init__.py仅作为 API 门面(facade),负责引入并暴露各子模块中的公开对象;datasets/to_rep_x.py及其中内容已被移除。
使用建议:
数据集类:推荐从
spikingjelly.datasets命名空间直接导入;工具函数和数据增强:推荐通过
spikingjelly.datasets.utils和spikingjelly.datasets.transform子模块访问;
# 推荐 ✅
from spikingjelly.datasets import DVS128Gesture
from spikingjelly.datasets.utils import create_sub_dataset
# 旧的导入方式,不推荐 ❌
from spikingjelly.datasets.dvs128_gesture import DVS128Gesture
from spikingjelly.datasets import create_sub_dataset
为保证兼容性,以上旧的导入方式在当前版本中仍然可用,但不再推荐在新代码中使用。
API Change Notice
In SpikingJelly 0.0.0.1.0, the datasets package has undergone a structural refactor to improve modularity and maintainability. The main changes include:
datasets/__init__.pyhas been split intobase.py,utils.py, andtransform.py;the new
datasets/__init__.pynow serves solely as an API facade, responsible for importing and re-exporting public objects from its submodules;datasets/to_rep_x.pyand its contents have been removed.
Usage recommendations:
Dataset classes: import them directly from the
spikingjelly.datasetsnamespace;Utility functions and data augmentation: access them via the
spikingjelly.datasets.utilsandspikingjelly.datasets.transformsubmodules;
# Recommended ✅
from spikingjelly.datasets import DVS128Gesture
from spikingjelly.datasets.utils import create_sub_dataset
# Legacy import patterns, not recommended ❌
from spikingjelly.datasets.dvs128_gesture import DVS128Gesture
from spikingjelly.datasets import create_sub_dataset
To preserve compatibility, the legacy import patterns shown above remain supported in the current version, but their use is discouraged.