fhswf / MLPro

MLPro - The Integrative Middleware Framework for Standardized Machine Learning in Python
https://mlpro.readthedocs.io/
Apache License 2.0
13 stars 4 forks source link

RL: Double Pendulum - Extensions for visualization #461

Closed detlefarend closed 1 year ago

detlefarend commented 2 years ago

Description/Motivation In the current version of the DP the visualization shows a 2D representation of the env in a squared matplotlib subplot. Now a further subplot shall be added on the right, that plots two scalar values: spacial distance to goal state (left axis) and reward (right axis). The additional subplot shall use max. 50% of the height of the first one to enable an additional subplot below in inherited classes.

2022-10-13 Double Pendulum

Task list

Related issues

476 #497

detlefarend commented 2 years ago

Hi @laxmikantbaheti I gave this issue a higher priority because it could help us to successfully train an agent...

detlefarend commented 1 year ago

Hi @laxmikantbaheti, I just took a look at the extension. Long story short. Here's my feedback:

  1. The frame rate lowers drastically over the time I think the cause is line 567. You plot the reward data each time again. Every time you add a further plot object to the axes. Instead, hold the data to be plotted in a permanent attribute self._plot_data_reward (or something like that) and plot them once. After that it should be enough to add the next reward to the attribute and call set_data on the plot object. The plot is extended automatically because the attribute is linked to the plot object. You can also take a look at bf.ui.sciui.pool.iis, line 65+

  2. Please reduce the line width to get a finer line

  3. Layout of the subplots Please set both plots to the same size.

That's it for the moment...

Thank you!