(images, model, batch_size=64,
                                    dims=2048, cuda=False, verbose=False)
return mu, sigma
Calculation of the statistics used by the FID.
    Params:
    -- images      : Numpy array of dimension (n_images, 3, hi, wi). The values
                     must lie between 0 and 1.
    -- model       : Instance of inception model
    -- batch_size  : The images numpy array is split into batches with
                     batch size batch_size. A reasonable batch size
                     depends on the hardware.
    -- dims        : Dimensionality of features returned by Inception
    -- cuda        : If set to True, use GPU
    -- verbose     : If set to True and parameter out_step is given, the
                     number of calculated batches is reported.
    Returns:
    -- mu    : The mean over samples of the activations of the pool_3 layer of
               the inception model.
    -- sigma : The covariance matrix of the activations of the pool_3 layer of
               the inception model.
Calculation of the statistics used by the FID.
    Params:
    -- images      : Numpy array of dimension (n_images, 3, hi, wi). The values
                     must lie between 0 and 1.
    -- model       : Instance of inception model
    -- batch_size  : The images numpy array is split into batches with
                     batch size batch_size. A reasonable batch size
                     depends on the hardware.
    -- dims        : Dimensionality of features returned by Inception
    -- cuda        : If set to True, use GPU
    -- verbose     : If set to True and parameter out_step is given, the
                     number of calculated batches is reported.
    Returns:
    -- mu    : The mean over samples of the activations of the pool_3 layer of
               the inception model.
    -- sigma : The covariance matrix of the activations of the pool_3 layer of
               the inception model.
Calculation of the statistics used by the FID . Params : -- images : Numpy array of dimension ( n_images 3 hi wi ) . The values must lie between 0 and 1 . -- model : Instance of inception model -- batch_size : The images numpy array is split into batches with batch size batch_size . A reasonable batch size depends on the hardware . -- dims : Dimensionality of features returned by Inception -- cuda : If set to True use GPU -- verbose : If set to True and parameter out_step is given the number of calculated batches is reported . Returns : -- mu : The mean over samples of the activations of the pool_3 layer of the inception model . -- sigma : The covariance matrix of the activations of the pool_3 layer of the inception model .
def calculate_activation_statistics(images, model, batch_size=64,
                                    dims=2048, cuda=False, verbose=False):
    """Calculation of the statistics used by the FID.
    Params:
    -- images      : Numpy array of dimension (n_images, 3, hi, wi). The values
                     must lie between 0 and 1.
    -- model       : Instance of inception model
    -- batch_size  : The images numpy array is split into batches with
                     batch size batch_size. A reasonable batch size
                     depends on the hardware.
    -- dims        : Dimensionality of features returned by Inception
    -- cuda        : If set to True, use GPU
    -- verbose     : If set to True and parameter out_step is given, the
                     number of calculated batches is reported.
    Returns:
    -- mu    : The mean over samples of the activations of the pool_3 layer of
               the inception model.
    -- sigma : The covariance matrix of the activations of the pool_3 layer of
               the inception model.
    """
    act = get_activations(images, model, batch_size, dims, cuda, verbose)
    #print("get_activations done")
    #print(act.shape, act)

    mu = np.mean(act, axis=0)
    #print(mu.shape, [i for i in mu if i == 0])

    sigma = np.cov(act, rowvar=0, ddof=1)
    #print(sigma.shape)
    #print("cal activation stat done")
    return mu, sigma
def calculate_activation_statistics ( images , model , batch_size = 64 , dims = 2048 , cuda = False , verbose = False ) : act = get_activations ( images , model , batch_size , dims , cuda , verbose ) #print("get_activations done") #print(act.shape, act) mu = np . mean ( act , axis = 0 ) #print(mu.shape, [i for i in mu if i == 0]) sigma = np . cov ( act , rowvar = 0 , ddof = 1 ) #print(sigma.shape) #print("cal activation stat done") return mu , sigma