H2SO4T / ARES

Black-box tool that uses Deep Reinforcement Learning to test and explore Android applications
GNU Affero General Public License v3.0
70 stars 21 forks source link

Quick question about SACExploration.py #14

Closed dvalbuena1 closed 2 years ago

dvalbuena1 commented 2 years ago

The ML model checks the dimension only at the beginning, and then it will never use the action_space variable anymore. This means that the output of the ML model is always in the range 0:30. But if you have 3 buttons in Activity Something.Main, it is not useful to generate a value greater than 2 (i.e., 0, 1, 2).
So I'm just using the action_space variable to save the actual action space dimension.

Originally posted by @H2SO4T in https://github.com/H2SO4T/ARES/issues/8#issuecomment-1039062431

dvalbuena1 commented 2 years ago

According to this comment from an old issue. I wanted to clarify if this is the reason for this line is executed model.action_space.high[0] = model.env.envs[0].ACTION_SPACE before saving the model

H2SO4T commented 2 years ago

Hi, thank you for your question. As you already said, you can not change the dimension of the ML model, so when you are saving it and when you are loading it, you must give it the original dimension in the range 0:30 .

dvalbuena1 commented 2 years ago

Oh ok, then I could even initialize the space to 10 or even 100 and it shouldn't affect it as long as it is the same value when saving, right?

H2SO4T commented 2 years ago

exactly!