MCPcopy Create free account
hub / github.com/AMAP-ML/EMF / __init__

Method __init__

tok/utils.py:6–9  ·  view source on GitHub ↗
(self, mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])

Source from the content-addressed store, hash-verified

4
5class ScalingLayer(nn.Module):
6 def __init__(self, mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5]):
7 super().__init__()
8 self.register_buffer('shift', torch.Tensor(mean)[None, :, None, None])
9 self.register_buffer('scale', torch.Tensor(std)[None, :, None, None])
10
11 def forward(self, inp):
12 return (inp - self.shift) / self.scale

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected