MCPcopy
hub / github.com/yunjey/stargan / denorm

Method denorm

solver.py:123–126  ·  view source on GitHub ↗

Convert the range from [-1, 1] to [0, 1].

(self, x)

Source from the content-addressed store, hash-verified

121 self.d_optimizer.zero_grad()
122
123 def denorm(self, x):
124 """Convert the range from [-1, 1] to [0, 1]."""
125 out = (x + 1) / 2
126 return out.clamp_(0, 1)
127
128 def gradient_penalty(self, y, x):
129 """Compute gradient penalty: (L2_norm(dy/dx) - 1)**2."""

Callers 4

trainMethod · 0.95
train_multiMethod · 0.95
testMethod · 0.95
test_multiMethod · 0.95

Calls

no outgoing calls

Tested by 1

test_multiMethod · 0.76