import torch
import numpy as np

def correlation(x):
    m = x.mean(0)
    xp = x - m
    c = xp.t().mm(xp)
    c = c/(x.shape[0]-1)
    std = torch.diag(c)**0.5
    s = std.expand_as(c)*std.expand_as(c).t()
    return c/s

def cor(x):
    batchSize = x.shape[0]
    c =  x.t().mm(x)/(batchSize)
    norm = torch.diag(c)**0.5
    s = norm.expand_as(c)*norm.expand_as(c).t()
    return c/s
dc39025df562468a0ab5f815e255b3b066bbf7a0
<mask token>

<mask token>


def cor(x):
    batchSize = x.shape[0]
    c = x.t().mm(x) / batchSize
    norm = torch.diag(c) ** 0.5
    s = norm.expand_as(c) * norm.expand_as(c).t()
    return c / s

<mask token>


def correlation(x):
    m = x.mean(0)
    xp = x - m
    c = xp.t().mm(xp)
    c = c / (x.shape[0] - 1)
    std = torch.diag(c) ** 0.5
    s = std.expand_as(c) * std.expand_as(c).t()
    return c / s


def cor(x):
    batchSize = x.shape[0]
    c = x.t().mm(x) / batchSize
    norm = torch.diag(c) ** 0.5
    s = norm.expand_as(c) * norm.expand_as(c).t()
    return c / s

import torch
import numpy as np


def correlation(x):
    m = x.mean(0)
    xp = x - m
    c = xp.t().mm(xp)
    c = c / (x.shape[0] - 1)
    std = torch.diag(c) ** 0.5
    s = std.expand_as(c) * std.expand_as(c).t()
    return c / s


def cor(x):
    batchSize = x.shape[0]
    c = x.t().mm(x) / batchSize
    norm = torch.diag(c) ** 0.5
    s = norm.expand_as(c) * norm.expand_as(c).t()
    return c / s

import torch
import numpy as np

def correlation(x):
    m = x.mean(0)
    xp = x - m
    c = xp.t().mm(xp)
    c = c/(x.shape[0]-1)
    std = torch.diag(c)**0.5
    s = std.expand_as(c)*std.expand_as(c).t()
    return c/s

def cor(x):
    batchSize = x.shape[0]
    c =  x.t().mm(x)/(batchSize)
    norm = torch.diag(c)**0.5
    s = norm.expand_as(c)*norm.expand_as(c).t()
    return c/s