(rl_tuner,
                         action_note,
                         stat_dict,
                         tonic_note=rl_tuner_ops.C_MAJOR_TONIC)
return stat_dict
Updates stat dict based on whether composition started with the tonic.

  Args:
    rl_tuner: An RLTuner object.
    action_note: An integer representing the chosen action.
    stat_dict: A dictionary containing fields for statistics about
      compositions.
    tonic_note: The tonic/1st note of the desired key.
  Returns:
    A dictionary of composition statistics with 'num_starting_tonic' field
    updated.
Updates stat dict based on whether composition started with the tonic.
Updates stat dict based on whether composition started with the tonic .
def add_tonic_start_stat(rl_tuner,
                         action_note,
                         stat_dict,
                         tonic_note=rl_tuner_ops.C_MAJOR_TONIC):
  """Updates stat dict based on whether composition started with the tonic.

  Args:
    rl_tuner: An RLTuner object.
    action_note: An integer representing the chosen action.
    stat_dict: A dictionary containing fields for statistics about
      compositions.
    tonic_note: The tonic/1st note of the desired key.
  Returns:
    A dictionary of composition statistics with 'num_starting_tonic' field
    updated.
  """
  if rl_tuner.beat == 0 and action_note == tonic_note:
    stat_dict['num_starting_tonic'] += 1
  return stat_dict
def add_tonic_start_stat ( rl_tuner , action_note , stat_dict , tonic_note = rl_tuner_ops . C_MAJOR_TONIC ) : if rl_tuner . beat == 0 and action_note == tonic_note : stat_dict [ 'num_starting_tonic' ] += 1 return stat_dict