code: def _get_component_dropout(dropout_schedule, data_fraction):
      """Retrieve dropout proportion from schedule when data_fraction
      proportion of data is seen. This value is obtained by using a
      piecewise linear function on the dropout schedule.
      This is a module-internal function called by _get_dropout_proportions().
  
      See help for --trainer.dropout-schedule for how the dropout value
      is obtained from the options.
  
      Arguments:
          dropout_schedule: A list of (data_fraction, dropout_proportion) values
              sorted in descending order of data_fraction.
          data_fraction: The fraction of data seen until this stage of
              training.
      """
      if data_fraction == 0:
          # Dropout at start of the iteration is in the last index of
          # dropout_schedule
          assert dropout_schedule[-1][0] == 0
          return dropout_schedule[-1][1]
      try:
          # Find lower bound of the data_fraction. This is the
          # lower end of the piecewise linear function.
          (
              dropout_schedule_index,
              initial_data_fraction,
              initial_dropout,
          ) = next(
              (i, tup[0], tup[1])
              for i, tup in enumerate(dropout_schedule)
              if tup[0] <= data_fraction
          )
      except StopIteration:
          raise RuntimeError(
              "Could not find data_fraction in dropout schedule "
              "corresponding to data_fraction {0}.\n"
              "Maybe something wrong with the parsed "
              "dropout schedule {1}.".format(
                  data_fraction, dropout_schedule
              )
          )
  
      if dropout_schedule_index == 0:
          assert dropout_schedule[0][0] == 1 and data_fraction == 1
          return dropout_schedule[0][1]
  
      # The upper bound of data_fraction is at the index before the
      # lower bound.
      final_data_fraction, final_dropout = dropout_schedule[
          dropout_schedule_index - 1
      ]
  
      if final_data_fraction == initial_data_fraction:
          assert data_fraction == initial_data_fraction
          return initial_dropout
  
      assert (
          data_fraction >= initial_data_fraction
          and data_fraction < final_data_fraction
      )
  
      return (data_fraction - initial_data_fraction) * (
          final_dropout - initial_dropout
      ) / (
          final_data_fraction - initial_data_fraction
      ) + initial_dropout
  
file_path: espnet/egs2/mini_an4/enh_asr1/steps/libs/nnet3/train/dropout_schedule.py
imports: import logging
label_desc: Use image node_id 3 for calling a global function with example usage: _get_component_dropout(dropout_schedule, data_fraction) and returns: unknown, dropout_schedule, dropout_schedule, initial_dropout