def __init__(self, validation_combinations, test_combinations, caption_size, words, language=None): world_generator = GenericGenerator( entity_counts=[1] ) world_captioner = CaptionerMixer( captioners=( AttributesTypeCaptioner( existing_attribute_ratio=0.0 ), ExistentialCaptioner( restrictor_captioner=AttributesTypeCaptioner( hypernym_ratio=1.0, existing_attribute_ratio=0.0 ), body_captioner=AttributesRelationCaptioner( existing_attribute_ratio=0.0 ) ) ), trivial_acceptance_rate=1.0 ) super(OneshapeDataset, self).__init__( world_generator=world_generator, world_captioner=world_captioner, caption_size=caption_size, words=words, language=language )
def __init__(self, entity_counts, train_entity_counts, validation_entity_counts, test_entity_counts, validation_combinations, test_combinations, caption_size, words, language=None): world_generator = GenericGenerator( entity_counts=entity_counts, train_entity_counts=train_entity_counts, validation_entity_counts=validation_entity_counts, test_entity_counts=test_entity_counts, validation_combinations=validation_combinations, test_combinations=test_combinations) world_captioner = ExistentialCaptioner( restrictor_captioner=AttributesTypeCaptioner(), body_captioner=SpatialRelationCaptioner( # relations=('proximity-rel',) )) super(SpatialDataset, self).__init__(world_generator=world_generator, world_captioner=world_captioner, caption_size=caption_size, words=words, language=language)
def __init__(self, validation_combinations, test_combinations, caption_size, words, language=None): world_generator = GenericGenerator( entity_counts=[2], collision_tolerance=0.0, boundary_tolerance=0.0, validation_combinations=validation_combinations, test_combinations=test_combinations, max_provoke_collision_rate=0.0) world_captioner = ExistentialCaptioner( restrictor_captioner=AttributesTypeCaptioner( trivial_acceptance_rate=1.0), body_captioner=SpatialRelationCaptioner( reference_captioner=AttributesTypeCaptioner(), relations=('x-rel', 'y-rel'))) super(SpatialSimpleDataset, self).__init__(world_generator=world_generator, world_captioner=world_captioner, caption_size=caption_size, words=words, language=language)
def __init__(self, entity_counts, train_entity_counts, validation_entity_counts, test_entity_counts, validation_combinations, test_combinations, shapes_range, colors_range, textures_range, caption_size, words, language=None): world_generator = GenericGenerator( entity_counts=entity_counts, collision_tolerance=0.0, boundary_tolerance=0.0, train_entity_counts=train_entity_counts, validation_entity_counts=validation_entity_counts, test_entity_counts=test_entity_counts, validation_combinations=validation_combinations, test_combinations=test_combinations, shapes_range=shapes_range, colors_range=colors_range, textures_range=textures_range, max_provoke_collision_rate=0.0) world_captioner = RelativeQuantifierCaptioner( restrictor_captioner=AttributesTypeCaptioner(hypernym_ratio=1.0), body_captioner=AttributesRelationCaptioner()) super(QuantificationDataset, self).__init__(world_generator=world_generator, world_captioner=world_captioner, caption_size=caption_size, words=words, language=language)
def __init__(self, entity_counts, train_entity_counts, validation_entity_counts, test_entity_counts, validation_combinations, test_combinations, caption_size, words, language=None): world_generator = GenericGenerator( entity_counts=entity_counts, collision_tolerance=0.0, boundary_tolerance=0.0, train_entity_counts=train_entity_counts, validation_entity_counts=validation_entity_counts, test_entity_counts=test_entity_counts, validation_combinations=validation_combinations, test_combinations=test_combinations, max_provoke_collision_rate=0.0) world_captioner = AttributesTypeCaptioner() super(MultishapeSimpleDataset, self).__init__(world_generator=world_generator, world_captioner=world_captioner, caption_size=caption_size, words=words, language=language)
def __init__(self, entity_counts, train_entity_counts, validation_entity_counts, test_entity_counts, validation_combinations, test_combinations, caption_size, words, language=None): world_generator = GenericGenerator( entity_counts=entity_counts, train_entity_counts=train_entity_counts, validation_entity_counts=validation_entity_counts, test_entity_counts=test_entity_counts, validation_combinations=validation_combinations, test_combinations=test_combinations ) world_captioner = CaptionerMixer( captioners=( AttributesTypeCaptioner(), ExistentialCaptioner( restrictor_captioner=AttributesTypeCaptioner( hypernym_ratio=1.0 ), body_captioner=AttributesRelationCaptioner() ) ) ) super(MultishapeDataset, self).__init__( world_generator=world_generator, world_captioner=world_captioner, caption_size=caption_size, words=words, language=language )
def __init__(self, validation_combinations, test_combinations, caption_size, words, incorrect_caption_modes=None, hypernym_ratio=None, correct_ratio=None, train_correct_ratio=None, validation_correct_ratio=None, test_correct_ratio=None, world_size=None, world_color=None, shapes=None, colors=None, textures=None, rotation=None, size_range=None, distortion_range=None, shade_range=None, noise_range=None, collision_tolerance=None, boundary_tolerance=None, realizer=None, quantifier_tolerance=None, **kwargs): world_generator = GenericGenerator( [2], world_size, world_color, shapes, colors, textures, rotation, size_range, distortion_range, shade_range, noise_range, collision_tolerance, boundary_tolerance, validation_combinations=validation_combinations, test_combinations=test_combinations) world_captioner = SpatialCaptioner( world_generator.shapes, world_generator.colors, world_generator.textures, realizer=realizer, quantifier_tolerance=quantifier_tolerance, incorrect_modes=incorrect_caption_modes, hypernym_ratio=hypernym_ratio) super(SpatialDataset, self).__init__(world_generator=world_generator, world_captioner=world_captioner, caption_size=caption_size, words=words, incorrect_world_ratio=0.0, correct_ratio=correct_ratio, train_correct_ratio=correct_ratio, validation_correct_ratio=validation_correct_ratio, test_correct_ratio=test_correct_ratio)
def __init__(self, entity_counts, train_entity_counts, validation_entity_counts, test_entity_counts, validation_combinations, test_combinations, caption_size, words, language=None): world_generator = GenericGenerator( entity_counts=entity_counts, train_entity_counts=train_entity_counts, validation_entity_counts=validation_entity_counts, test_entity_counts=test_entity_counts, validation_combinations=validation_combinations, test_combinations=test_combinations) verb_captioner = CaptionerMixer( captioners=(SpatialRelationCaptioner(), ComparisonRelationCaptioner())) world_captioner = ExistentialCaptioner( restrictor_captioner=AttributesTypeCaptioner(), body_captioner=verb_captioner, ) super(RelationalDataset, self).__init__(world_generator=world_generator, world_captioner=world_captioner, caption_size=caption_size, words=words, language=language)
def __init__(self, entity_counts, train_entity_counts, validation_entity_counts, test_entity_counts, validation_combinations, test_combinations, shapes_range, colors_range, textures_range, caption_size, words, language=None): world_generator = GenericGenerator( entity_counts=entity_counts, train_entity_counts=train_entity_counts, validation_entity_counts=validation_entity_counts, test_entity_counts=test_entity_counts, validation_combinations=validation_combinations, test_combinations=test_combinations, shapes_range=shapes_range, colors_range=colors_range, textures_range=textures_range) oneshape = CaptionerMixer( captioners=(AttributesTypeCaptioner(), ExistentialCaptioner( restrictor_captioner=AttributesTypeCaptioner( hypernym_ratio=1.0), body_captioner=AttributesRelationCaptioner()))) relational = CaptionerMixer(captioners=(SpatialRelationCaptioner(), ComparisonRelationCaptioner())) counting = AbsoluteQuantifierCaptioner( restrictor_captioner=AttributesTypeCaptioner(), body_captioner=CaptionerMixer( captioners=(AttributesRelationCaptioner(), SpatialRelationCaptioner(), ComparisonRelationCaptioner()))) quantification = RelativeQuantifierCaptioner( restrictor_captioner=AttributesTypeCaptioner(), body_captioner=CaptionerMixer( captioners=(AttributesRelationCaptioner(), SpatialRelationCaptioner(), ComparisonRelationCaptioner()))) world_captioner = CaptionerMixer( captioners=(ConjunctionCaptioner(captioners=(oneshape, relational, counting, quantification)), DisjunctionCaptioner(captioners=(oneshape, relational, counting, quantification)))) super(CombinationDataset, self).__init__(world_generator=world_generator, world_captioner=world_captioner, caption_size=caption_size, words=words, language=language)
def __init__(self, entity_counts, train_entity_counts, validation_entity_counts, test_entity_counts): world_generator = GenericGenerator( entity_counts=entity_counts, train_entity_counts=train_entity_counts, validation_entity_counts=validation_entity_counts, test_entity_counts=test_entity_counts) num_classes = len(world_generator.shapes) * len( world_generator.colors) * len(world_generator.textures) super(MultishapeDataset, self).__init__(world_generator=world_generator, num_classes=num_classes, multi_class=True, class_count=False)
def __init__(self, validation_combinations, test_combinations, caption_size, words, language=None): world_generator = GenericGenerator(entity_counts=[1], collision_tolerance=0.0, boundary_tolerance=0.0) world_captioner = AttributesTypeCaptioner(existing_attribute_ratio=0.0, trivial_acceptance_rate=1.0) super(OneshapeSimpleDataset, self).__init__(world_generator=world_generator, world_captioner=world_captioner, caption_size=caption_size, words=words, language=language)
def __init__(self, entity_counts, train_entity_counts, validation_entity_counts, test_entity_counts, validation_combinations, test_combinations, shapes_range, colors_range, textures_range, caption_size, words, language=None): world_generator = GenericGenerator( entity_counts=entity_counts, train_entity_counts=train_entity_counts, validation_entity_counts=validation_entity_counts, test_entity_counts=test_entity_counts, validation_combinations=validation_combinations, test_combinations=test_combinations, shapes_range=shapes_range, colors_range=colors_range, textures_range=textures_range) body_captioner = CaptionerMixer( captioners=(AttributesRelationCaptioner(), SpatialRelationCaptioner(relations=('x-rel', 'y-rel', 'proximity-rel')), ComparisonRelationCaptioner())) world_captioner = RelativeQuantifierCaptioner( restrictor_captioner=AttributesTypeCaptioner(), body_captioner=body_captioner) super(QuantificationDataset, self).__init__(world_generator=world_generator, world_captioner=world_captioner, caption_size=caption_size, words=words, language=language)
def __init__(self, world_size=None, world_color=None, shapes=None, colors=None, textures=None, rotation=None, size_range=None, distortion_range=None, shade_range=None, noise_range=None, collision_tolerance=None, boundary_tolerance=None, **kwargs): world_generator = GenericGenerator([1], world_size, world_color, shapes, colors, textures, rotation, size_range, distortion_range, shade_range, noise_range, collision_tolerance, boundary_tolerance) num_classes = len(world_generator.shapes) * len( world_generator.colors) * len(world_generator.textures) super(OneShapeDataset, self).__init__(world_generator=world_generator, num_classes=num_classes)
def __init__(self, entity_counts, train_entity_counts, validation_entity_counts, test_entity_counts, shapes_range, colors_range, textures_range, caption_size, words, caption_modes=None, quantifiers=None, correct_ratio=None, train_correct_ratio=None, validation_correct_ratio=None, test_correct_ratio=None, world_size=None, world_color=None, shapes=None, colors=None, textures=None, rotation=None, size_range=None, distortion_range=None, shade_range=None, noise_range=None, collision_tolerance=None, boundary_tolerance=None, realizer=None, quantifier_tolerance=None, **kwargs): world_generator = GenericGenerator( entity_counts, world_size, world_color, shapes, colors, textures, rotation, size_range, distortion_range, shade_range, noise_range, collision_tolerance, boundary_tolerance, train_entity_counts=train_entity_counts, validation_entity_counts=validation_entity_counts, test_entity_counts=test_entity_counts, shapes_range=shapes_range, colors_range=colors_range, textures_range=textures_range) world_captioner = QuantificationCaptioner( world_generator.shapes, world_generator.colors, world_generator.textures, realizer=realizer, quantifier_tolerance=quantifier_tolerance, modes=caption_modes, quantifiers=quantifiers) super(QuantificationDataset, self).__init__(world_generator=world_generator, world_captioner=world_captioner, caption_size=caption_size, words=words, incorrect_world_ratio=0.0, correct_ratio=correct_ratio, train_correct_ratio=correct_ratio, validation_correct_ratio=validation_correct_ratio, test_correct_ratio=test_correct_ratio)
def __init__(self): world_generator = GenericGenerator(entity_counts=[1]) num_classes = len(world_generator.shapes) * len( world_generator.colors) * len(world_generator.textures) super(OneshapeDataset, self).__init__(world_generator=world_generator, num_classes=num_classes)