Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some issues regarding attention mechanisms #118

Open
yshichseu opened this issue May 8, 2024 · 1 comment
Open

Some issues regarding attention mechanisms #118

yshichseu opened this issue May 8, 2024 · 1 comment

Comments

@yshichseu
Copy link

Dear author, thank you for providing such a lightweight reinforcement learning library. Currently, I am hoping to integrate your attention mechanism into other reinforcement learning algorithms. I encountered an issue while modifying the network. Through the configuration file of the rlagent, I noticed that due to out being set to None, the last layer of the egoattionnetwork output has a dimension of 64 (if I overlooked it, please forgive me!), but the dimension of the action space is 3. How do these two establish a mapping relationship? I used a linear layer to implement it, but it seems to be ineffective. Therefore, I need to deepen my understanding of how the attention mechanism works. I should set up an attention network between observation and reinforcement learning algorithms for feature extraction. Should the final output of the attention network be the corresponding value of the action? Thank you for your answer! Thank you!

@eleurent
Copy link
Owner

Hi,

This function gets called when instantiating the network with the knowledge of the env and its observation and action spaces, which are used to set the input and output sizes:

https://github.com/eleurent/rl-agents/blob/84df15ea977271e6a4d015f10f9f355f7e866890/rl_agents/agents/common/models.py#L404C5-L404C22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants