chz056 / BEAR

24 stars 4 forks source link

The data structure #6

Open mcqueen9 opened 10 months ago

mcqueen9 commented 10 months ago

Dear developer, thank you very much for developing this framework. I encountered some issues while using it. Firstly, when running the QuickStart.ipynb example, I encountered an error as shown in Figure 1. Although I made some modifications and was able to obtain the two types of results from the QuickStart.ipynb, the dimensions of the sample state for the building environment and the zone temperature were different from the examples in QuickStart.ipynb, as shown in Figure 2. The second issue is that I also encountered an error when using the PPO algorithm, as shown in Figure 3. I would like to ask if there is a problem with the way I am using the BEAR environment, and specifically, how should I use it and how should the sample state and actions for the building environment in the BEAR environment be set? Fig1

Fig2 Fig3

Fig2

Fig1

Fig3

Fig4 Fig5
chennnnnyize commented 10 months ago

Hi there,

Thanks for using BEAR for your simulation! It seems there are some version conflicts in gym environment and stable baselines3, which cause the valueError and the TypeError in Fig.1 and 3 respectively. You can simply delete eval_freq=1000 to test if the code can be run, since that keywork just monitors the training procedure. Regarding the state dimensions: yes that can be different based on building types. In BEAR we provided a group of example buildings, but feel free to check the paper and set your own customized buildings based on the heat transfer dynamics. @chz056 Please see if I am missing any point here.

Yize

chz056 commented 10 months ago

Hi,

Thank you for reaching out and using BEAR. I apologize for the inconvenience and the late response.

The issues you encountered are primarily due to the recent updates in the QuickStart.ipynb file that were not synchronized across all platforms. I have now updated the file on GitHub as well, and this should resolve the discrepancies you've been experiencing. Here are more detailed answers to your questions:

  1. Error in step function ("too many values to unpack"): This issue arose due to a switch from using gym to gymnasium, which now returns 5 values instead of 4. This is not a version conflict in gym&stablebaseline3 but an update in the OpenAI gym library structure. The updated QuickStart.ipynb reflects how we handle this change. Please refer to the new code for guidance.
  2. State Dimension Issue: The difference you observed in the state dimensions is not due to building types. Initially, the observation space was structured as 3n+2, which is why you saw the pattern in your results(from your figure2, you can see 0 and -0.07856952 n times). We later updated this to n+4 to streamline the structure. The updated files on GitHub should now reflect this change, and your results should match the examples provided in the QuickStart.ipynb.
  3. PPO Algorithm - "unexpected keyword eval_freq": As you rightly pointed out, the learn() method in Stable Baselines3 does not accept eval_freq as a direct parameter. Specifically, the learn function only can accept the following 6 variables:total_timesteps, callback=None, log_interval=1, tb_log_name='PPO', reset_num_timesteps=True, progress_bar=False. The learn() method in Stable Baselines3 does not directly accept an eval_freq parameter for evaluation frequency. Instead, you typically use a callback to handle evaluation. For a more detailed guide on this, you can refer to the Stable Baselines3 PPO documentation https://stable-baselines3.readthedocs.io/en/master/modules/ppo.html.

Please ensure that you pull the latest changes from the GitHub repository to access the updated QuickStart.ipynb and other relevant files. I hope these updates and explanations resolve the issues you are facing. If you have any more questions or need further assistance, feel free to reach out.

Best, Chi

On Wed, Jan 17, 2024 at 8:07 AM Yize Chen @.***> wrote:

Hi there,

Thanks for using BEAR for your simulation! It seems there are some version conflicts in gym environment and stable baselines3, which cause the valueError and the TypeError in Fig.1 and 3 respectively. You can simply delete eval_freq=1000 to test if the code can be run, since that keywork just monitors the training procedure. Regarding the state dimensions: yes that can be different based on building types. In BEAR we provided a group of example buildings, but feel free to check the paper and set your own customized buildings based on the heat transfer dynamics. @chz056 https://urldefense.com/v3/__https://github.com/chz056__;!!Mih3wA!ARiSB784JmqcKjNGBhSYPi88KrA13xCXRin67FFA5t6t1HL2awm-syyjwss-5D90yjN2MKtd7fnJg7SaTeGAsFxgTw$ Please see if I am missing any point here.

Yize

— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/chz056/BEAR/issues/6*issuecomment-1896125487__;Iw!!Mih3wA!ARiSB784JmqcKjNGBhSYPi88KrA13xCXRin67FFA5t6t1HL2awm-syyjwss-5D90yjN2MKtd7fnJg7SaTeEiX_2G1Q$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AW35WM63GOEGOSLNYSQGMBLYO7ZMFAVCNFSM6AAAAABB54XCVCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJWGEZDKNBYG4__;!!Mih3wA!ARiSB784JmqcKjNGBhSYPi88KrA13xCXRin67FFA5t6t1HL2awm-syyjwss-5D90yjN2MKtd7fnJg7SaTeFIGkDHqA$ . You are receiving this because you were mentioned.Message ID: @.***>