-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
def compute_mean_std(dataloader): ''' We assume that the images of the dataloader have the same height and width source: https://github.com/aladdinpersson/Machine-Learning-Collection/blob/master/ML/Pytorch/Basics/pytorch_std_mean.py ''' # var[X] = E[X**2] - E[X]**2 channels_sum, channels_sqrd_sum, num_batches = 0, 0, 0 for batch_images, labels in tqdm(dataloader): # (B,H,W,C) batch_images = batch_images.permute(0,3,4,2,1) channels_sum += torch.mean(batch_images, dim=[0, 1, 2, 3]) channels_sqrd_sum += torch.mean(batch_images ** 2, dim=[0, 1, 2,3]) num_batches += 1 mean = channels_sum / num_batches std = (channels_sqrd_sum / num_batches - mean ** 2) ** 0.5 return mean, std compute_mean_std(dataloader)
Git Repo: https://github.com/akshayballal95/autodrive-snake/tree/blog
Related posts
-
What can be the reasons of BatchNorm working and Dropout not working in YoloV1 Pytorch implementation?
-
How to create a custom parallel corpus for machine translation with recent versions of pytorch and torchtext?
-
I need help knowing how to improve a CycleGan I am working on.
-
Pytorch: Custom Dataset for Machine Translation
-
Project to prettify music notes