def _k(x, y, s) : "Returns the matrix of k(x_i,y_j)." sq = _squared_distances(x, y) / (s**2) #return torch.exp( -sq ) return torch.pow( 1. / ( 1. + sq ), .25 )