(level_returns, per_level_cap)
return np.mean(
      [human_normalized_score(k, v) for k, v in new_level_returns.items()])
Computes human normalized score.

  Levels that have different training and test versions, will use the returns
  for the training level to calculate the score. E.g.
  'rooms_collect_good_objects_train' will be used for
  'rooms_collect_good_objects_test'. All returns for levels not in DmLab-30
  will be ignored.

  Args:
    level_returns: A dictionary from level to list of episode returns.
    per_level_cap: A percentage cap (e.g. 100.) on the per level human
      normalized score. If None, no cap is applied.

  Returns:
    A float with the human normalized score in percentage.

  Raises:
    ValueError: If a level is missing from `level_returns` or has no returns.
Computes human normalized score.
Computes human normalized score .
def compute_human_normalized_score(level_returns, per_level_cap):
  """Computes human normalized score.

  Levels that have different training and test versions, will use the returns
  for the training level to calculate the score. E.g.
  'rooms_collect_good_objects_train' will be used for
  'rooms_collect_good_objects_test'. All returns for levels not in DmLab-30
  will be ignored.

  Args:
    level_returns: A dictionary from level to list of episode returns.
    per_level_cap: A percentage cap (e.g. 100.) on the per level human
      normalized score. If None, no cap is applied.

  Returns:
    A float with the human normalized score in percentage.

  Raises:
    ValueError: If a level is missing from `level_returns` or has no returns.
  """
  new_level_returns = _transform_level_returns(level_returns)

  def human_normalized_score(level_name, returns):
    score = np.mean(returns)
    human = HUMAN_SCORES[level_name]
    random = RANDOM_SCORES[level_name]
    human_normalized_score = (score - random) / (human - random) * 100
    if per_level_cap is not None:
      human_normalized_score = min(human_normalized_score, per_level_cap)
    return human_normalized_score

  return np.mean(
      [human_normalized_score(k, v) for k, v in new_level_returns.items()])
def compute_human_normalized_score ( level_returns , per_level_cap ) : new_level_returns = _transform_level_returns ( level_returns ) def human_normalized_score ( level_name , returns ) : score = np . mean ( returns ) human = HUMAN_SCORES [ level_name ] random = RANDOM_SCORES [ level_name ] human_normalized_score = ( score - random ) / ( human - random ) * 100 if per_level_cap is not None : human_normalized_score = min ( human_normalized_score , per_level_cap ) return human_normalized_score return np . mean ( [ human_normalized_score ( k , v ) for k , v in new_level_returns . items ( ) ] )