1697ad9a5cb50f61583735f8e442f80fc72a473c,torch_geometric/transform/polar.py,Polar,__call__,#Polar#Any#,9
Before Change
phi = torch.acos(direction[:, 2]) / PI
spherical = torch.stack([theta, phi], dim=1)
if data.weight is None:
data.weight = spherical
else:
data.weight = torch.cat(
[spherical, data.weight.unsqueeze(1)], dim=1)
return data
After Change
assert pos.dim() == 2
cart = pos[col] - pos[row]
rho = torch.norm(cart, p=2, dim=-1)
rho /= rho.max()
theta = torch.atan2(cart[..., 1], cart[..., 0]) / (2 * PI)
theta += (theta < 0).type_as(theta)
polar = torch.stack([rho, theta], dim=1)
if pseudo is not None and self.cat:
pseudo = pseudo.view(-1, 1) if pseudo.dim() == 1 else pseudo
data.weight = torch.cat([pseudo, cart.type_as(polar)], dim=-1)
else:
data.weight = polar
return data
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 21
Instances
Project Name: rusty1s/pytorch_geometric
Commit Name: 1697ad9a5cb50f61583735f8e442f80fc72a473c
Time: 2018-05-12
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/transform/polar.py
Class Name: Polar
Method Name: __call__
Project Name: rusty1s/pytorch_geometric
Commit Name: 1697ad9a5cb50f61583735f8e442f80fc72a473c
Time: 2018-05-12
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/transform/spherical.py
Class Name: Spherical
Method Name: __call__
Project Name: rusty1s/pytorch_geometric
Commit Name: 51b53dcbab8ec7ab0b6e8a64284a919db2d2254a
Time: 2018-05-08
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/transform/local_cartesian.py
Class Name: LocalCartesian
Method Name: __call__