MCPcopy Create free account
hub / github.com/Zhiyuan-R/Tiger-Diffusion / norm

Function norm

train_generation.py:45–48  ·  view source on GitHub ↗
(v, f)

Source from the content-addressed store, hash-verified

43 return v, f
44
45def norm(v, f):
46 v = (v - v.min())/(v.max() - v.min()) - 0.5
47
48 return v, f
49
50def getGradNorm(net):
51 pNorm = torch.sqrt(sum(torch.sum(p ** 2) for p in net.parameters()))

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected