MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / sample

Function sample

examples/GAN/DCGAN.py:122–134  ·  view source on GitHub ↗
(model, model_path, output_name='gen/gen')

Source from the content-addressed store, hash-verified

120
121
122def sample(model, model_path, output_name='gen/gen'):
123 pred = PredictConfig(
124 session_init=SmartInit(model_path),
125 model=model,
126 input_names=['z'],
127 output_names=[output_name, 'z'])
128 pred = SimpleDatasetPredictor(pred, RandomZData((100, args.z_dim)))
129 for o in pred.get_result():
130 o = o[0] + 1
131 o = o * 128.0
132 o = np.clip(o, 0, 255)
133 o = o[:, :, :, ::-1]
134 stack_patches(o, nr_row=10, nr_col=10, viz=True)
135
136
137def get_args(default_batch=128, default_z_dim=100):

Callers 1

DCGAN.pyFile · 0.70

Calls 6

get_resultMethod · 0.95
RandomZDataClass · 0.90
stack_patchesFunction · 0.90
PredictConfigClass · 0.85
SmartInitFunction · 0.85

Tested by

no test coverage detected