960f18e759ac0ed76bb9193f29527a209bfd2b1a,qucumber/nn_states/density_matrix.py,DensityMatrix,rotated_gradient,#DensityMatrix#,319
Before Change
UrhoU = torch.sum(UrhoU_v, dim=(1, 2))
for i in range(v.shape[0]):
for j in range(v.shape[0]):
rotated_grad[0] += cplx.scalar_mult(
UrhoU_v[:, i, j], self.am_grads(v[i, ...], v[j, ...])
)
rotated_grad[1] += cplx.scalar_mult(
UrhoU_v[:, i, j], self.ph_grads(v[i, ...], v[j, ...])
)
grad = [
-cplx.real(cplx.scalar_divide(rotated_grad[0], UrhoU)),
-cplx.real(cplx.scalar_divide(rotated_grad[1], UrhoU)),
]
After Change
ph_grads = self.ph_grads(v, v, expand=True)
rotated_grad[0] = cplx.einsum("ij,ij...->...", UrhoU_v, am_grads)
rotated_grad[1] = cplx.einsum("ij,ij...->...", UrhoU_v, ph_grads)
grad = [
-cplx.real(cplx.scalar_divide(rotated_grad[0], UrhoU)),
-cplx.real(cplx.scalar_divide(rotated_grad[1], UrhoU)),
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: PIQuIL/QuCumber
Commit Name: 960f18e759ac0ed76bb9193f29527a209bfd2b1a
Time: 2019-12-19
Author: emerali@users.noreply.github.com
File Name: qucumber/nn_states/density_matrix.py
Class Name: DensityMatrix
Method Name: rotated_gradient
Project Name: PIQuIL/QuCumber
Commit Name: 76b2432b1c1ee03c80895a5c7d49cde485323102
Time: 2019-12-22
Author: emerali@users.noreply.github.com
File Name: qucumber/nn_states/density_matrix.py
Class Name: DensityMatrix
Method Name: rotated_gradient
Project Name: hmmlearn/hmmlearn
Commit Name: 0ed87cd7846d0573e93ae005dba3d1d0c7eb5588
Time: 2016-02-25
Author: anntzer.lee@gmail.com
File Name: hmmlearn/hmm.py
Class Name: GaussianHMM
Method Name: _accumulate_sufficient_statistics