snntoolbox.datasets
¶
The modules in this package provide functionality to load and process datasets into the SNN conversion toolbox.
snntoolbox.datasets.utils
¶
The main purpose of this module is to load a dataset from disk and feed it to the toolbox in one of the formats it can handle.
For details see
get_dataset |
Get dataset, either from .npz files or keras.ImageDataGenerator . |
@author: rbodo
-
snntoolbox.datasets.utils.
get_dataset
(config)[source]¶ Get dataset, either from
.npz
files orkeras.ImageDataGenerator
.Returns Dictionaries with keys
x_test
andy_test
if data set was loaded in.npz
format, or withdataflow
key if data will be loaded from.jpg
,.png
, or.bmp
files by akeras.ImageDataGenerator
.Parameters: config (configparser.ConfigParser) – Settings. Returns: - normset (dict) – Used to normalized the network parameters.
- testset (dict) – Used to test the networks.
-
snntoolbox.datasets.utils.
try_get_normset_from_scalefacs
(config)[source]¶ Instead of loading a normalization data set to calculate scale-factors, try to get the scale-factors stored on disk during a previous run.
Parameters: config (configparser.ConfigParser) – Settings. Returns: A dictionary with single key ‘scale_facs’. The corresponding value is itself a dictionary containing the scale factors for each layer. Returns None
if no scale factors were found.Return type: Union[dict, None]