(self)
Sets the default model hyperparameters.
Sets the default model hyperparameters.
Sets the default model hyperparameters .
def __init__(self):
    """Sets the default model hyperparameters."""
    # File pattern of sharded TFRecord file containing SequenceExample protos.
    # Must be provided in training and evaluation modes.
    self.input_file_pattern = None

    # Image format ("jpeg" or "png").
    self.image_format = "jpeg"

    # Approximate number of values per input shard. Used to ensure sufficient
    # mixing between shards in training.
    self.values_per_input_shard = 2300
    # Minimum number of shards to keep in the input queue.
    self.input_queue_capacity_factor = 2
    # Number of threads for prefetching SequenceExample protos.
    self.num_input_reader_threads = 1

    # Name of the SequenceExample context feature containing image data.
    self.image_feature_name = "image/data"
    # Name of the SequenceExample feature list containing integer captions.
    self.caption_feature_name = "image/caption_ids"

    # Number of unique words in the vocab (plus 1, for <UNK>).
    # The default value is larger than the expected actual vocab size to allow
    # for differences between tokenizer versions used in preprocessing. There is
    # no harm in using a value greater than the actual vocab size, but using a
    # value less than the actual vocab size will result in an error.
    self.vocab_size = 20000

    # Number of threads for image preprocessing. Should be a multiple of 2.
    self.num_preprocess_threads = 4

    # Batch size.
    self.batch_size = 32

    # File containing an Inception v3 checkpoint to initialize the variables
    # of the Inception model. Must be provided when starting training for the
    # first time.
    self.inception_checkpoint_file = None

    # Dimensions of Inception v3 input images.
    self.image_height = 299
    self.image_width = 299

    # Scale used to initialize model variables.
    self.initializer_scale = 0.08

    # LSTM input and output dimensionality, respectively.
    self.embedding_size = 512
    self.num_lstm_units = 512

    # If < 1.0, the dropout keep probability applied to LSTM variables.
    self.lstm_dropout_keep_prob = 0.7
def __init__ ( self ) : # File pattern of sharded TFRecord file containing SequenceExample protos. # Must be provided in training and evaluation modes. self . input_file_pattern = None # Image format ("jpeg" or "png"). self . image_format = "jpeg" # Approximate number of values per input shard. Used to ensure sufficient # mixing between shards in training. self . values_per_input_shard = 2300 # Minimum number of shards to keep in the input queue. self . input_queue_capacity_factor = 2 # Number of threads for prefetching SequenceExample protos. self . num_input_reader_threads = 1 # Name of the SequenceExample context feature containing image data. self . image_feature_name = "image/data" # Name of the SequenceExample feature list containing integer captions. self . caption_feature_name = "image/caption_ids" # Number of unique words in the vocab (plus 1, for <UNK>). # The default value is larger than the expected actual vocab size to allow # for differences between tokenizer versions used in preprocessing. There is # no harm in using a value greater than the actual vocab size, but using a # value less than the actual vocab size will result in an error. self . vocab_size = 20000 # Number of threads for image preprocessing. Should be a multiple of 2. self . num_preprocess_threads = 4 # Batch size. self . batch_size = 32 # File containing an Inception v3 checkpoint to initialize the variables # of the Inception model. Must be provided when starting training for the # first time. self . inception_checkpoint_file = None # Dimensions of Inception v3 input images. self . image_height = 299 self . image_width = 299 # Scale used to initialize model variables. self . initializer_scale = 0.08 # LSTM input and output dimensionality, respectively. self . embedding_size = 512 self . num_lstm_units = 512 # If < 1.0, the dropout keep probability applied to LSTM variables. self . lstm_dropout_keep_prob = 0.7