MCPcopy
hub / github.com/google-deepmind/alphafold / norm

Method norm

alphafold/model/geometry/vector.py:87–93  ·  view source on GitHub ↗

Compute Norm of Vec3Array, clipped to epsilon.

(self, epsilon: float = 1e-6)

Source from the content-addressed store, hash-verified

85 return self.x * other.x + self.y * other.y + self.z * other.z
86
87 def norm(self, epsilon: float = 1e-6) -> Float:
88 """Compute Norm of Vec3Array, clipped to epsilon."""
89 # To avoid NaN on the backward pass, we must use maximum before the sqrt
90 norm2 = self.dot(self)
91 if epsilon:
92 norm2 = jnp.maximum(norm2, epsilon**2)
93 return jnp.sqrt(norm2)
94
95 def norm2(self):
96 return self.dot(self)

Callers 9

normalizedMethod · 0.95
__call__Method · 0.80
test_randomMethod · 0.80
__init__Method · 0.80
normFunction · 0.80
dihedral_angleFunction · 0.80
_check_residue_distancesFunction · 0.80
_get_atom_positionsFunction · 0.80

Calls 1

dotMethod · 0.95

Tested by 1

test_randomMethod · 0.64