protected function pairwiseDistances(Matrix $samples) : Matrix
    {
        $distances = [];

        foreach ($samples as $a) {
            $temp = [];

            foreach ($samples as $b) {
                $temp[] = $this->kernel->compute($a, $b);
            }

            $distances[] = $temp;
        }

        return Matrix::quick($distances);
    }
protected function pairwiseDistances(Matrix $samples) : Matrix
    {
        $distances = [];

        foreach ($samples as $a) {
            $temp = [];

            foreach ($samples as $b) {
                $temp[] = $this->kernel->compute($a, $b);
            }

            $distances[] = $temp;
        }

        return Matrix::quick($distances);
    }
protected function pairwiseDistances ( Matrix $ samples ) : Matrix { $ distances = [ ] ; foreach ( $ samples as $ a ) { $ temp = [ ] ; foreach ( $ samples as $ b ) { $ temp [ ] = $ this -> kernel -> compute ( $ a , $ b ) ; } $ distances [ ] = $ temp ; } return Matrix :: quick ( $ distances ) ; }
Calculate the pairwise distances for each sample.

@param \Rubix\Tensor\Matrix $samples
@return \Rubix\Tensor\Matrix
Calculate the pairwise distances for each sample .