(rl_tuner, action, stat_dict)
return stat_dict
Updates stat dict if a motif was just played.

  Args:
    rl_tuner: An RLTuner object.
    action: One-hot encoding of the chosen action.
    stat_dict: A dictionary containing fields for statistics about
      compositions.
  Returns:
    A dictionary of composition statistics with 'notes_in_motif' field
    updated.
Updates stat dict if a motif was just played.
Updates stat dict if a motif was just played .
def add_motif_stat(rl_tuner, action, stat_dict):
  """Updates stat dict if a motif was just played.

  Args:
    rl_tuner: An RLTuner object.
    action: One-hot encoding of the chosen action.
    stat_dict: A dictionary containing fields for statistics about
      compositions.
  Returns:
    A dictionary of composition statistics with 'notes_in_motif' field
    updated.
  """
  composition = rl_tuner.composition + [np.argmax(action)]
  motif, _ = rl_tuner.detect_last_motif(composition=composition)
  if motif is not None:
    stat_dict['notes_in_motif'] += 1
  return stat_dict
def add_motif_stat ( rl_tuner , action , stat_dict ) : composition = rl_tuner . composition + [ np . argmax ( action ) ] motif , _ = rl_tuner . detect_last_motif ( composition = composition ) if motif is not None : stat_dict [ 'notes_in_motif' ] += 1 return stat_dict