def get_validation_image_text_data_iter(data_loader: RawParallelDatasetLoader,
                                        validation_source_root: str,
                                        validation_source: str,
                                        validation_target: str,
                                        buckets: List[Tuple[int, int]],
                                        bucket_batch_sizes: List[BucketBatchSize],
                                        source_image_size: tuple,
                                        vocab_target: vocab.Vocab,
                                        max_seq_len_target: int,
                                        batch_size: int,
                                        use_feature_loader: bool = False,
                                        preload_features: bool = False) -> 'ParallelSampleIter':
    """
    Returns a ParallelSampleIter for the validation data.
    """
    logger.info("=================================")
    logger.info("Creating validation data iterator")
    logger.info("=================================")

    validation_source_images = [FileListReader(validation_source, validation_source_root)]
    validation_target_sentences = SequenceReader(validation_target, vocab_target, add_bos=True, limit=None)

    validation_data_statistics = get_data_statistics(source_readers=None,
                                                     target_reader=validation_target_sentences,
                                                     buckets=buckets,
                                                     length_ratio_mean=1.0,
                                                     length_ratio_std=1.0,
                                                     source_vocabs=None,
                                                     target_vocab=vocab_target)
    validation_data_statistics.log(bucket_batch_sizes)

    validation_data = data_loader.load(validation_source_images[0],
                                       validation_target_sentences,
                                       validation_data_statistics.num_sents_per_bucket).fill_up(bucket_batch_sizes)
    return ImageTextSampleIter(data=validation_data,
                               buckets=buckets,
                               batch_size=batch_size,
                               bucket_batch_sizes=bucket_batch_sizes,
                               image_size=source_image_size,
                               use_feature_loader=use_feature_loader,
                               preload_features=preload_features)
Returns a ParallelSampleIter for the validation data.