MCPcopy Create free account
hub / github.com/dcharatan/flowmap / MappingL2

Class MappingL2

flowmap/loss/mapping/mapping_l2.py:15–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13
14
15class MappingL2(Mapping[MappingL2Cfg]):
16 def forward_undistorted(
17 self,
18 delta: Float[Tensor, "*batch 2"],
19 ) -> Float[Tensor, " *batch"]:
20 # Multiply by 0.5 to match torch.nn.functional.huber_loss.
21 return 0.5 * (delta * delta).sum(dim=-1)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected