MCPcopy Create free account
hub / github.com/MiniMax-AI/VTP / ScalingLayer

Class ScalingLayer

vtp/utils/lpips.py:103–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101
102
103class ScalingLayer(nn.Module):
104 def __init__(self):
105 super(ScalingLayer, self).__init__()
106 self.register_buffer(
107 "shift", torch.Tensor([-0.030, -0.088, -0.188])[None, :, None, None]
108 )
109 self.register_buffer(
110 "scale", torch.Tensor([0.458, 0.448, 0.450])[None, :, None, None]
111 )
112
113 def forward(self, inp):
114 return (inp - self.shift) / self.scale
115
116
117class NetLinLayer(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected