Wrong suming output in simulink r2023A

1 回表示 (過去 30 日間)
Joshi Kumar V
Joshi Kumar V 2024 年 4 月 6 日
回答済み: Steven Lord 2024 年 4 月 6 日
Greetings!
We are training a reinforcement learning agent using the R2023a version in Ubuntu 22.04 LTS. We have built a reward block that should result in a reward value of -150 when the input is under a particular range. We have observed that the input to the summing block in the reward function is of value -150 (-100, -50, 0, 0) while the output of the sum block is of value 106
When we tested with constant values, as shown in the attached image, the sum block resulted in a value of -150, as intended.
This has affected the training of agents drastically.

回答 (1 件)

Steven Lord
Steven Lord 2024 年 4 月 6 日
I don't work with Simulink that much, but I'd check the data types of the various signals in your code.
106 - (-150)
ans = 256
The fact that these two numbers differ by a power of 2 makes me suspicious that there's some conversion with wrapping going on.

カテゴリ

Help Center および File ExchangeReinforcement Learning についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by