c762d68aa5b3f8f370e66e59aeda3e661c281566,torch_geometric/transforms/spherical.py,Spherical,__call__,#Spherical#Any#,41
Before Change
rho = torch.norm(cart, p=2, dim=-1).view(-1, 1)
theta = torch.atan2(cart[..., 1], cart[..., 0]).view(-1, 1)
theta += (theta < 0).type_as(theta)
phi = torch.acos(cart[..., 2] / rho).view(-1, 1)
if self.norm:
if self.max_value is None:
max_value = rho.max().item()
else:
max_value = self.max_value
rho = rho / max_value
theta = theta / (2 * PI)
phi = phi / PI
spher = torch.cat([rho, theta, phi], dim=-1)
if pseudo is not None and self.cat:
pseudo = pseudo.view(-1, 1) if pseudo.dim() == 1 else pseudo
data.edge_attr = torch.cat([pseudo, spher.type_as(pos)], dim=-1)
else:
data.edge_attr = spher
return data
After Change
rho = torch.norm(cart, p=2, dim=-1).view(-1, 1)
theta = torch.atan2(cart[..., 1], cart[..., 0]).view(-1, 1)
theta = theta + (theta < 0).type_as(theta) + (2 * PI)
phi = torch.acos(cart[..., 2] / rho.view(-1)).view(-1, 1)
if self.norm:
if self.max_value is None:
max_value = rho.max().item()
else:
max_value = self.max_value
rho = rho / max_value
theta = theta / (2 * PI)
phi = phi / PI
spher = torch.cat([rho, theta, phi], dim=-1)
if pseudo is not None and self.cat:
pseudo = pseudo.view(-1, 1) if pseudo.dim() == 1 else pseudo
data.edge_attr = torch.cat([pseudo, spher.type_as(pos)], dim=-1)
else:
data.edge_attr = spher
return data
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 7
Instances
Project Name: rusty1s/pytorch_geometric
Commit Name: c762d68aa5b3f8f370e66e59aeda3e661c281566
Time: 2018-12-15
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/transforms/spherical.py
Class Name: Spherical
Method Name: __call__
Project Name: rusty1s/pytorch_geometric
Commit Name: c762d68aa5b3f8f370e66e59aeda3e661c281566
Time: 2018-12-15
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/transforms/polar.py
Class Name: Polar
Method Name: __call__
Project Name: rusty1s/pytorch_geometric
Commit Name: b68184c5922cd4261b473dd4c8a6a11662a0578b
Time: 2018-12-29
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/transforms/spherical.py
Class Name: Spherical
Method Name: __call__
Project Name: rusty1s/pytorch_geometric
Commit Name: b68184c5922cd4261b473dd4c8a6a11662a0578b
Time: 2018-12-29
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/transforms/polar.py
Class Name: Polar
Method Name: __call__