MCPcopy
hub / github.com/hojonathanho/diffusion / __init__

Method __init__

diffusion_tf/tpu_utils/tpu_utils.py:214–226  ·  view source on GitHub ↗
(self, dataset, strategy, limit_dataset_size=0)

Source from the content-addressed store, hash-verified

212 """
213
214 def __init__(self, dataset, strategy, limit_dataset_size=0):
215 # distributed dataset iterator
216 if limit_dataset_size > 0:
217 dataset = dataset.take(limit_dataset_size)
218 self.ds_iterator = strategy.experimental_distribute_dataset(dataset).make_initializable_iterator()
219
220 # inception network on the dataset
221 self.inception_real = distributed(
222 lambda x_: run_inception(tfgan.eval.preprocess_image(x_['image'])),
223 args=(next(self.ds_iterator),), reduction='concat', strategy=strategy)
224
225 self.cached_inception_real = None # cached inception features
226 self.real_inception_score = None # saved inception scores for the dataset
227
228 def get(self, sess):
229 # On the first invocation, compute Inception activations for the eval dataset

Callers

nothing calls this directly

Calls 2

distributedFunction · 0.85
run_inceptionFunction · 0.85

Tested by

no test coverage detected