facebookresearch / mbrl-lib

Library for Model Based RL
MIT License
959 stars 158 forks source link

Training browser #77

Closed a3ahmad closed 3 years ago

a3ahmad commented 3 years ago

Types of changes

Adds a simple browser to chart training results from multiple runs

Motivation and Context / Related issue

Adds a quick and easy way to browse/compare results

How Has This Been Tested (if it applies)

I ran a few different training runs, with different algorithms and use this to compare them

Checklist

luisenp commented 3 years ago

@a3ahmad This looks potentially pretty nice! Would you mind adding some brief instruction on how to run so that I can play around with it before making any suggestions?

Also, probably the best place to put this would be in the diagnostics folder (we might change later this folder to something like "visualizations").

a3ahmad commented 3 years ago

Sure, just run it with 'python training_browser.py' (you will need PyQt5 and PyQtChart installed -- pip and conda provide it)

You'll see a full size window with a (dockable) pane on the left listing all the available experiments in a table. Click on each to chart their results (or shift-click to select/overlay multiple results). The toolbar currently has check-boxes to use a logarithmic axis, and to filter out outliers (I don't like the current implementation as it removes the points, rather than just rescale the Y axis)

a3ahmad commented 3 years ago

Ok, I've moved it to diagnostics. So now you can run it with:

python -m mbrl.diagnostics.training_browser

I run it from the root mbrl_lib folder and it will infer current_working_directory/exp. Alternatively you can run:

python -m mbrl.diagnostics.training_browser --experiments [path to the experiment folder]

luisenp commented 3 years ago

This is awesome @a3ahmad, thanks a lot! A couple of suggestions:

image

Would you be OK with adding this changes?

luisenp commented 3 years ago

BTW, black was updated recently which broke the CI tests. I've already updated master, so you can just rebase and force push here.

a3ahmad commented 3 years ago

Those are great suggestions, I’ll get on them

a3ahmad commented 3 years ago

@luisenp, what kind of rolling window do you use for the mean/std-dev plots?

luisenp commented 3 years ago

@luisenp, what kind of rolling window do you use for the mean/std-dev plots?

@a3ahmad For the plot like the one I showed I usually just plot with no smoothing. Just average/std over multiple runs (in the case of that plot it was 10 seeds), for all time steps. We could add the window as an optional argument, seems like a useful feature.

a3ahmad commented 3 years ago

Ohh, I got you. I need to experiment with multiple runs!

luisenp commented 3 years ago

Hi @a3ahmad, thanks again for working on this! I noticed you added a checkbox labeled "Display As Distribution", but currently appears greyed out for me. Is there anything I need to do to enable it?

a3ahmad commented 3 years ago

Oh! You need you multiselect several runs of the same length.

The graph doesn’t look right to me, though. I need to investigate.

a3ahmad commented 3 years ago

Updated to swap from QtCharts to matplotlib. Simplifies code and works better.