| 37 | |
| 38 | |
| 39 | def do_plot(logs, args): |
| 40 | |
| 41 | fig = plt.figure(num=None, figsize=(25, 15), dpi=100) |
| 42 | |
| 43 | ((ax1, ax2, ax3), (ax4, ax5, ax6)) = fig.subplots(2, 3) |
| 44 | |
| 45 | for i, (name, props) in enumerate(zip(sorted(logs.keys(), key=lambda a: (logs[a]._type, a)), default_cycler)): |
| 46 | l = logs[name] |
| 47 | ax1.semilogy(l.iteration, l.cost, label=name, **props) |
| 48 | ax1.set_xlabel("iterations") |
| 49 | ax1.set_ylabel("cost") |
| 50 | ax2.semilogy(l.cumulative_time, l.cost, label=name, **props) |
| 51 | ax2.set_xlabel("time") |
| 52 | ax2.set_ylabel("cost") |
| 53 | ax3.plot(l.iteration, l.cumulative_time, **props) |
| 54 | ax3.set_xlabel("iterations") |
| 55 | ax3.set_ylabel("time (s)") |
| 56 | |
| 57 | ax4.semilogy(l.iteration, l.linear_solver_iterations, **props) |
| 58 | ax4.set_xlabel("iterations") |
| 59 | ax4.set_ylabel("num cg iterations") |
| 60 | ax5.semilogy(l.iteration, l.trust_region_radius, **props) |
| 61 | ax5.set_xlabel("iterations") |
| 62 | ax5.set_ylabel("tr radius") |
| 63 | ax6.plot(l.iteration, l.resident_memory_peak / 2**20, **props) |
| 64 | ax6.set_xlabel("iterations") |
| 65 | ax6.set_ylabel("peak mem (MB)") |
| 66 | |
| 67 | if not args.no_legend: |
| 68 | ax1.legend() |
| 69 | |
| 70 | |
| 71 | def extract_logs_from_experiment(exp, results_accu): |