def _create_train_specification(self): """Returns an EpisodeSpecification or BatchSpecification for training.""" if self.eval_split == 'train': return learning_spec.EpisodeSpecification( learning_spec.Split.TRAIN, self.num_train_classes, self.num_train_examples, self.num_test_examples) else: return learning_spec.BatchSpecification( learning_spec.Split.TRAIN, self.learn_config.batch_size)
def _create_held_out_specification(self, split='test'): """Create an EpisodeSpecification for either validation or testing. Note that testing is done episodically whether or not training was episodic. This is why the different subclasses should not override this method. Args: split: one of 'valid' or 'test' Returns: an EpisodeSpecification. Raises: ValueError: Invalid split. """ split_enum = get_split_enum(split) return learning_spec.EpisodeSpecification(split_enum, self.num_test_classes, self.num_train_examples, self.num_test_examples)
def _create_train_specification(self): """Returns an EpisodeSpecification or BatchSpecification for training.""" return learning_spec.EpisodeSpecification(learning_spec.Split.TRAIN, self.num_train_classes, self.num_train_examples, self.num_test_examples)