spyrit.misc.statistics.stat_1

spyrit.misc.statistics.stat_1(dataloader, device, root, n_loop=1)[source]

1D mean and covariance matrix of an image database.

The statistics are computed across batches, channels, and image rows.

nloop > 1 is relevant for dataloaders with random crops such as that provided by data_loaders_ImageNet