class_docstr: Base class inheritted by all data classes.
      
class_docstr_tok: ["Base","class","inheritted","by","all","data","classes","."]
docstr: Returns a dictionary of default hyperparameters.
  
  .. code-block:: python
  
      {
          "num_epochs": 1,
          "batch_size": 64,
          "allow_smaller_final_batch": True,
          "shuffle": True,
          "shuffle_buffer_size": None,
          "shard_and_shuffle": False,
          "num_parallel_calls": 1,
          "prefetch_buffer_size": 0,
          "max_dataset_size": -1,
          "seed": None,
          "name": "data",
      }
  
  Here:
  
      "num_epochs": int
          Number of times the dataset should be repeated. An
          :tf_main:`OutOfRangeError <errors/OutOfRangeError>` signal will
          be raised after the whole repeated dataset has been iterated
          through.
  
          E.g., For training data, set it to 1 (default) so that you
          will get the signal after each epoch of training. Set to -1
          to repeat the dataset indefinitely.
  
      "batch_size": int
          Batch size, i.e., the number of consecutive elements of the
          dataset to combine in a single batch.
  
      "allow_smaller_final_batch": bool
         Whether to allow the final batch to be smaller if there are
         insufficient elements left. If `False`, the final batch is
         discarded if it is smaller than batch size. Note that,
         if `True`, `output_shapes` of the resulting dataset
         will have a a **static** batch_size dimension equal to
         "batch_size".
  
      "shuffle": bool
          Whether to randomly shuffle the elements of the dataset.
  
      "shuffle_buffer_size": int
          The buffer size for data shuffling. The larger, the better
          the resulting data is mixed.
  
          If `None` (default), buffer size is set to the size of the
          whole dataset (i.e., make the shuffling the maximally
          effective).
  
      "shard_and_shuffle": bool
          Whether to first shard the dataset and then shuffle each
          block respectively. Useful when the whole data is too large to
          be loaded efficiently into the memory.
  
          If `True`, :attr:`shuffle_buffer_size` must be specified to
          determine the size of each shard.
  
      "num_parallel_calls": int
          Number of elements from the datasets to process in parallel.
  
      "prefetch_buffer_size": int
          The maximum number of elements that will be buffered when
          prefetching.
  
      max_dataset_size : int
          Maximum number of instances to include in
          the dataset. If set to `-1` or greater than the size of
          dataset, all instances will be included. This constraint is
          imposed after data shuffling and filtering.
  
      seed : int, optional
          The random seed for shuffle.
  
          Note that if a seed is set, the shuffle order will be exact
          the same every time when going through the (repeated) dataset.
  
          For example, consider a dataset with elements [1, 2, 3], with
          "num_epochs"`=2` and some fixed seed, the resulting sequence
          can be: 2 1 3, 1 3 2 | 2 1 3, 1 3 2, ... That is, the orders are
          different **within** every `num_epochs`, but are the same
          **across** the `num_epochs`.
  
      name : str
          Name of the data.
docstr_tok: ["Returns","a","dictionary","of","default","hyperparameters",".","..","code-block",":",":","python","{","``","num_epochs","''",":","1",",","``","batch_size","''",":","64",",","``","allow_smaller_final_batch","''",":","True",",","``","shuffle","''",":","True",",","``","shuffle_buffer_size","''",":","None",",","``","shard_and_shuffle","''",":","False",",","``","num_parallel_calls","''",":","1",",","``","prefetch_buffer_size","''",":","0",",","``","max_dataset_size","''",":","-1",",","``","seed","''",":","None",",","``","name","''",":","``","data","''",",","}","Here",":","``","num_epochs","''",":","int","Number","of","times","the","dataset","should","be","repeated",".","An",":","tf_main",":","`","OutOfRangeError","<","errors\/OutOfRangeError",">","`","signal","will","be","raised","after","the","whole","repeated","dataset","has","been","iterated","through",".","E.g.",",","For","training","data",",","set","it","to","1","(","default",")","so","that","you","will","get","the","signal","after","each","epoch","of","training",".","Set","to","-1","to","repeat","the","dataset","indefinitely",".","``","batch_size","''",":","int","Batch","size",",","i.e.",",","the","number","of","consecutive","elements","of","the","dataset","to","combine","in","a","single","batch",".","``","allow_smaller_final_batch","''",":","bool","Whether","to","allow","the","final","batch","to","be","smaller","if","there","are","insufficient","elements","left",".","If","`","False","`",",","the","final","batch","is","discarded","if","it","is","smaller","than","batch","size",".","Note","that",",","if","`","True","`",",","`","output_shapes","`","of","the","resulting","dataset","will","have","a","a","*","*","static","*","*","batch_size","dimension","equal","to","``","batch_size","''",".","``","shuffle","''",":","bool","Whether","to","randomly","shuffle","the","elements","of","the","dataset",".","``","shuffle_buffer_size","''",":","int","The","buffer","size","for","data","shuffling",".","The","larger",",","the","better","the","resulting","data","is","mixed",".","If","`","None","`","(","default",")",",","buffer","size","is","set","to","the","size","of","the","whole","dataset","(","i.e.",",","make","the","shuffling","the","maximally","effective",")",".","``","shard_and_shuffle","''",":","bool","Whether","to","first","shard","the","dataset","and","then","shuffle","each","block","respectively",".","Useful","when","the","whole","data","is","too","large","to","be","loaded","efficiently","into","the","memory",".","If","`","True","`",",",":","attr",":","`","shuffle_buffer_size","`","must","be","specified","to","determine","the","size","of","each","shard",".","``","num_parallel_calls","''",":","int","Number","of","elements","from","the","datasets","to","process","in","parallel",".","``","prefetch_buffer_size","''",":","int","The","maximum","number","of","elements","that","will","be","buffered","when","prefetching",".","max_dataset_size",":","int","Maximum","number","of","instances","to","include","in","the","dataset",".","If","set","to","`","-1","`","or","greater","than","the","size","of","dataset",",","all","instances","will","be","included",".","This","constraint","is","imposed","after","data","shuffling","and","filtering",".","seed",":","int",",","optional","The","random","seed","for","shuffle",".","Note","that","if","a","seed","is","set",",","the","shuffle","order","will","be","exact","the","same","every","time","when","going","through","the","(","repeated",")","dataset",".","For","example",",","consider","a","dataset","with","elements","[","1",",","2",",","3","]",",","with","``","num_epochs","''","`","=2","`","and","some","fixed","seed",",","the","resulting","sequence","can","be",":","2","1","3",",","1","3","2","|","2","1","3",",","1","3","2",",","...","That","is",",","the","orders","are","different","*","*","within","*","*","every","`","num_epochs","`",",","but","are","the","same","*","*","across","*","*","the","`","num_epochs","`",".","name",":","str","Name","of","the","data","."]
code: def default_hparams():
      """Returns a dictionary of default hyperparameters.
  
      .. code-block:: python
  
          {
              "num_epochs": 1,
              "batch_size": 64,
              "allow_smaller_final_batch": True,
              "shuffle": True,
              "shuffle_buffer_size": None,
              "shard_and_shuffle": False,
              "num_parallel_calls": 1,
              "prefetch_buffer_size": 0,
              "max_dataset_size": -1,
              "seed": None,
              "name": "data",
          }
  
      Here:
  
          "num_epochs": int
              Number of times the dataset should be repeated. An
              :tf_main:`OutOfRangeError <errors/OutOfRangeError>` signal will
              be raised after the whole repeated dataset has been iterated
              through.
  
              E.g., For training data, set it to 1 (default) so that you
              will get the signal after each epoch of training. Set to -1
              to repeat the dataset indefinitely.
  
          "batch_size": int
              Batch size, i.e., the number of consecutive elements of the
              dataset to combine in a single batch.
  
          "allow_smaller_final_batch": bool
             Whether to allow the final batch to be smaller if there are
             insufficient elements left. If `False`, the final batch is
             discarded if it is smaller than batch size. Note that,
             if `True`, `output_shapes` of the resulting dataset
             will have a a **static** batch_size dimension equal to
             "batch_size".
  
          "shuffle": bool
              Whether to randomly shuffle the elements of the dataset.
  
          "shuffle_buffer_size": int
              The buffer size for data shuffling. The larger, the better
              the resulting data is mixed.
  
              If `None` (default), buffer size is set to the size of the
              whole dataset (i.e., make the shuffling the maximally
              effective).
  
          "shard_and_shuffle": bool
              Whether to first shard the dataset and then shuffle each
              block respectively. Useful when the whole data is too large to
              be loaded efficiently into the memory.
  
              If `True`, :attr:`shuffle_buffer_size` must be specified to
              determine the size of each shard.
  
          "num_parallel_calls": int
              Number of elements from the datasets to process in parallel.
  
          "prefetch_buffer_size": int
              The maximum number of elements that will be buffered when
              prefetching.
  
          max_dataset_size : int
              Maximum number of instances to include in
              the dataset. If set to `-1` or greater than the size of
              dataset, all instances will be included. This constraint is
              imposed after data shuffling and filtering.
  
          seed : int, optional
              The random seed for shuffle.
  
              Note that if a seed is set, the shuffle order will be exact
              the same every time when going through the (repeated) dataset.
  
              For example, consider a dataset with elements [1, 2, 3], with
              "num_epochs"`=2` and some fixed seed, the resulting sequence
              can be: 2 1 3, 1 3 2 | 2 1 3, 1 3 2, ... That is, the orders are
              different **within** every `num_epochs`, but are the same
              **across** the `num_epochs`.
  
          name : str
              Name of the data.
      """
      return {
          "name": "data",
          "num_epochs": 1,
          "batch_size": 64,
          "allow_smaller_final_batch": True,
          "shuffle": True,
          "shuffle_buffer_size": None,
          "shard_and_shuffle": False,
          "num_parallel_calls": 1,
          "prefetch_buffer_size": 0,
          "max_dataset_size": -1,
          "seed": None,
      }
  
file_path: texar/texar/tf/data/data/data_base.py
imports: import tensorflow
  from texar.tf.hyperparams import HParams
  from texar.tf.data.data import dataset_utils
  from texar.tf.data.data_utils import count_file_lines
label_desc: Use image node_id 2 for calling the DataBase obj's underlying member method code with example usage: obj.default_hparams() and returns: dict