Exemplo n.º 1
0
    def log_diagnostics(self, paths, logger=default_logger):
        super().log_diagnostics(paths)
        MultitaskEnv.log_diagnostics(self, paths)
        xvels = get_stat_in_paths(paths, 'env_infos', 'xvel')
        desired_xvels = get_stat_in_paths(paths, 'env_infos', 'desired_xvel')
        xvel_errors = get_stat_in_paths(paths, 'env_infos', 'xvel_error')

        statistics = OrderedDict()
        for stat, name in [
            (xvels, 'xvels'),
            (desired_xvels, 'desired xvels'),
            (xvel_errors, 'xvel errors'),
        ]:
            statistics.update(
                create_stats_ordered_dict(
                    '{}'.format(name),
                    stat,
                    always_show_all_stats=True,
                ))
            statistics.update(
                create_stats_ordered_dict(
                    'Final {}'.format(name),
                    [s[-1] for s in stat],
                    always_show_all_stats=True,
                ))
        for key, value in statistics.items():
            logger.record_tabular(key, value)
Exemplo n.º 2
0
    def log_diagnostics(self, paths, logger=default_logger):
        super().log_diagnostics(paths)
        MultitaskEnv.log_diagnostics(self, paths)

        statistics = OrderedDict()
        for name_in_env_infos, name_to_log in [
            ('x_pos', 'X Position'),
            ('y_pos', 'Y Position'),
            ('dist_from_origin', 'Distance from Origin'),
            ('desired_x_pos', 'Desired X Position'),
            ('desired_y_pos', 'Desired Y Position'),
            ('desired_dist_from_origin', 'Desired Distance from Origin'),
            ('pos_error', 'Distance to goal'),
        ]:
            stat = get_stat_in_paths(paths, 'env_infos', name_in_env_infos)
            statistics.update(create_stats_ordered_dict(
                name_to_log,
                stat,
                always_show_all_stats=True,
                exclude_max_min=True,
            ))
        for name_in_env_infos, name_to_log in [
            ('dist_from_origin', 'Distance from Origin'),
            ('desired_dist_from_origin', 'Desired Distance from Origin'),
            ('pos_error', 'Distance to goal'),
        ]:
            stat = get_stat_in_paths(paths, 'env_infos', name_in_env_infos)
            statistics.update(create_stats_ordered_dict(
                'Final {}'.format(name_to_log),
                [s[-1] for s in stat],
                always_show_all_stats=True,
            ))
        for key, value in statistics.items():
            logger.record_tabular(key, value)
Exemplo n.º 3
0
    def log_diagnostics(self, paths, logger=default_logger):
        super().log_diagnostics(paths)
        MultitaskEnv.log_diagnostics(self, paths)

        statistics = OrderedDict()
        for stat_name in [
                'pos_error',
                'vel_error',
                'weighted_pos_error',
                'weighted_vel_error',
        ]:
            stat = get_stat_in_paths(paths, 'env_infos', stat_name)
            statistics.update(
                create_stats_ordered_dict(
                    '{}'.format(stat_name),
                    stat,
                    always_show_all_stats=True,
                ))
            statistics.update(
                create_stats_ordered_dict(
                    'Final {}'.format(stat_name),
                    [s[-1] for s in stat],
                    always_show_all_stats=True,
                ))
        weighted_error = (
            get_stat_in_paths(paths, 'env_infos', 'weighted_pos_error') +
            get_stat_in_paths(paths, 'env_infos', 'weighted_vel_error'))
        statistics.update(
            create_stats_ordered_dict(
                "Weighted Error",
                weighted_error,
                always_show_all_stats=True,
            ))
        statistics.update(
            create_stats_ordered_dict(
                "Final Weighted Error",
                [s[-1] for s in weighted_error],
                always_show_all_stats=True,
            ))

        for key, value in statistics.items():
            logger.record_tabular(key, value)
    def log_diagnostics(self, paths, logger=default_logger):
        super().log_diagnostics(paths)
        statistics = OrderedDict()

        euclidean_distances = get_stat_in_paths(paths, 'env_infos', 'distance')
        statistics.update(
            create_stats_ordered_dict('Euclidean distance to goal',
                                      euclidean_distances))
        statistics.update(
            create_stats_ordered_dict(
                'Final Euclidean distance to goal',
                [d[-1] for d in euclidean_distances],
                always_show_all_stats=True,
            ))
        for key, value in statistics.items():
            logger.record_tabular(key, value)