MCPcopy Create free account
hub / github.com/tensorpack/tensorpack / VisualizeTestSet

Class VisualizeTestSet

examples/GAN/CycleGAN.py:184–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182
183
184class VisualizeTestSet(Callback):
185 def _setup_graph(self):
186 self.pred = self.trainer.get_predictor(
187 ['inputA', 'inputB'], ['A_recon/viz', 'B_recon/viz'])
188
189 def _before_train(self):
190 global args
191 self.val_ds = get_data(args.data, isTrain=False)
192 self.val_ds.reset_state()
193
194 def _trigger(self):
195 idx = 0
196 for iA, iB in self.val_ds:
197 vizA, vizB = self.pred(iA, iB)
198 self.trainer.monitors.put_image('testA-{}'.format(idx), vizA)
199 self.trainer.monitors.put_image('testB-{}'.format(idx), vizB)
200 idx += 1
201
202
203if __name__ == '__main__':

Callers 1

CycleGAN.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…