MCPcopy Create free account
hub / github.com/YeWR/EfficientZero / Intensity

Class Intensity

core/dataset.py:51–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49
50
51class Intensity(nn.Module):
52 def __init__(self, scale):
53 super().__init__()
54 self.scale = scale
55
56 def forward(self, x):
57 r = torch.randn((x.size(0), 1, 1, 1), device=x.device)
58 noise = 1.0 + (self.scale * r.clamp(-2.0, 2.0))
59 return x * noise

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected