def _main(): """ Process the RLLIB logs/result.json """ config = _argument_parser() ## ======================== PROFILER ======================== ## if config.profiler: profiler = cProfile.Profile() profiler.enable() ## ======================== PROFILER ======================== ## statistics = StatSingleExp(config.input, config.prefix, max_agents=config.max, last=config.last, evaluation=config.evaluation) statistics.additionals_by_agent() logging.info('Done') ## ======================== PROFILER ======================== ## if config.profiler: profiler.disable() results = io.StringIO() pstats.Stats(profiler, stream=results).sort_stats('cumulative').print_stats(50) logging.info('Profiler: \n%s', pformat(results.getvalue()))
def _main(): """ Process the RLLIB logs/result.json """ config = _argument_parser() ## ======================== PROFILER ======================== ## if config.profiler: profiler = cProfile.Profile() profiler.enable() ## ======================== PROFILER ======================== ## statistics = StatSingleExp(config.input, config.prefix) statistics.qvalues_over_timesteps_total() logging.info('Done') ## ======================== PROFILER ======================== ## if config.profiler: profiler.disable() results = io.StringIO() pstats.Stats(profiler, stream=results).sort_stats('cumulative').print_stats(50) logging.info('Profiler: \n%s', pformat(results.getvalue()))