MCPcopy Create free account
hub / github.com/Newmu/dcgan_code / transform

Function transform

faces/train_uncond_dcgan.py:28–30  ·  view source on GitHub ↗
(X)

Source from the content-addressed store, hash-verified

26from load import faces
27
28def transform(X):
29 X = [center_crop(x, npx) for x in X]
30 return floatX(X).transpose(0, 3, 1, 2)/127.5 - 1.
31
32def inverse_transform(X):
33 X = (X.reshape(-1, nc, npx, npx).transpose(0, 2, 3, 1)+1.)/2.

Callers 1

Calls 2

center_cropFunction · 0.90
floatXFunction · 0.90

Tested by

no test coverage detected