--
You received this message because you are subscribed to the Google Groups "torch7" group.
To unsubscribe from this group and stop receiving emails from it, send an email to torch7+un...@googlegroups.com.
To post to this group, send email to tor...@googlegroups.com.
Visit this group at http://groups.google.com/group/torch7.
For more options, visit https://groups.google.com/d/optout.
function torch.Tensor.powm(self, power) local U,D,V = torch.svd(self) local result = U*(D:pow(power):diag())*V:t() return resultend
th> A = torch.randn(5,5) [0.0001s]th> A = A:t()*A -- make A positive semi-definite [0.0000s]th> A_sqrt = A:powm(0.5) [0.0001s]th> A 3.1788 -0.2700 3.5322 0.5113 0.4057 -0.2700 0.5782 -0.6825 1.6945 -0.1207 3.5322 -0.6825 5.3633 0.2835 -1.0688 0.5113 1.6945 0.2835 11.3951 -4.5324 0.4057 -0.1207 -1.0688 -4.5324 4.4123[torch.DoubleTensor of dimension 5x5]
[0.0002s]th> A_sqrt*A_sqrt 3.1788 -0.2700 3.5322 0.5113 0.4057 -0.2700 0.5782 -0.6825 1.6945 -0.1207 3.5322 -0.6825 5.3633 0.2835 -1.0688 0.5113 1.6945 0.2835 11.3951 -4.5324 0.4057 -0.1207 -1.0688 -4.5324 4.4123[torch.DoubleTensor of dimension 5x5]
Take torch.svd and then take the :sqrt on the eigen values.