IBM/pytorchpipe

View on GitHub
configs/clevr/clevr_question_glove_lstm.yml

Summary

Maintainability
Test Coverage
# Load config defining CLEVR tasks for training, validation and testing.
default_configs: clevr/default_clevr.yml

# This is unimodal (questino-based) baseline, thus stop streaming images - in all sets.
training:
  task: 
    stream_images: False

validation:
  task: 
    stream_images: False

test:
  task: 
    stream_images: False

# Definition of the pipeline.
pipeline:

  # Questions encoding.
  question_tokenizer:
    priority: 1.1
    type: SentenceTokenizer
    # Lowercase all letters + remove punctuation (reduced vocabulary of 80 words instead of 87)
    preprocessing: all
    streams: 
      inputs: questions
      outputs: tokenized_questions

  # Model 1: Embeddings
  question_embeddings:
    priority: 1.2
    type: SentenceEmbeddings
    embeddings_size: 50
    pretrained_embeddings_file: glove.6B.50d.txt
    data_folder: ~/data/CLEVR_v1.0
    word_mappings_file: questions.all.word.mappings.lowercase.csv
    export_word_mappings_to_globals: True
    globals:
      word_mappings: question_word_mappings
      vocabulary_size: num_question_words
    streams:
      inputs: tokenized_questions
      outputs: embedded_questions      
  
  # Model 2: RNN
  lstm:
    priority: 1.3
    type: RecurrentNeuralNetwork
    cell_type: LSTM
    prediction_mode: Last
    initial_state: Zero
    hidden_size: 50
    streams:
      inputs: embedded_questions
    globals:
      input_size: embeddings_size
      prediction_size: num_answers


#: pipeline