le-liang / MARLspectrumSharingV2X

Spectrum sharing in vehicular networks based on multi-agent reinforcement learning, IEEE Journal on Selected Areas in Communications
226 stars 93 forks source link

关于代码中action的选取次数问题 #10

Closed bxz52278 closed 2 years ago

bxz52278 commented 3 years ago

梁老师,您好 最近我在学习您的V2X资源分配的代码,有些问题想请教下您。 您在代码中设置了4个V2V链路,而每个V2V链路会有16个action(4个子频段的选择×4个功率等级的选择)。而在每个i_step中,每个v2v会进行随机的action的选取,同时计算对应的reward,更新fastfading,以及计算loss 的值。 我想请教您的是,每个V2V会有16个action进行选择,那么4个V2V链路的话将会有16的4次方,也就是6万多种的action选取的可能性。但是您在代码中设置的n_step_per_episode的值为100,并不能将6万多种的action遍历。所以想请教下您这一块是如何考虑的呢,如何能训练通过得到能够让reward最大的action呢?

le-liang commented 3 years ago

梁老师,您好 最近我在学习您的V2X资源分配的代码,有些问题想请教下您。 您在代码中设置了4个V2V链路,而每个V2V链路会有16个action(4个子频段的选择×4个功率等级的选择)。而在每个i_step中,每个v2v会进行随机的action的选取,同时计算对应的reward,更新fastfading,以及计算loss 的值。 我想请教您的是,每个V2V会有16个action进行选择,那么4个V2V链路的话将会有16的4次方,也就是6万多种的action选取的可能性。但是您在代码中设置的n_step_per_episode的值为100,并不能将6万多种的action遍历。所以想请教下您这一块是如何考虑的呢,如何能训练通过得到能够让reward最大的action呢?

RL本质是一个 sequential decision making的过程,当前时刻采取的action 会影响下一个时刻的状态,如此继续,RL的目标是学习一种 state 到 action的mapping策略,最大化 expected sum rewards,也就是所有时刻 rewards的和的平均值。因而使用RL解决你的问题很关键的一步就是如何设计 reward,使得 expected sum rewards maximization 能够近似达成原问题的优化目标。关于你说的问题,n_step_per_episode = 100指的是每个 episode长度,即上述expected sum rewards表达式的求和范围,而每个 time step,每个 agent有16个动作选项,4个agent有六万多,如果从 100 time steps 来看,,共有(16^4)^100种选项,显然这是不可能通过暴力搜索得到最优解的,而RL可以通过几千个 episode(每个episode都是100 time steps)的学习,总结出了一些经验,知道如何 learn a policy that maps a state to an action for each agent,这也正是RL的精妙之处,可能需要你做进一步的阅读。

bxz52278 commented 3 years ago

明白了!谢谢老师的耐心解答!

18120226 commented 3 years ago

您好: 请问Training network中的y为什么不用layer_3_b

le-liang commented 3 years ago

您好: 请问Training network中的y为什么不用layer_3_b

抱歉,这是个bug,应该用layer_3_b,但这里修改的话,上传的 trained model 就无法使用了,因而没做修正。从实验结果来看,这个问题影响应该不是很大。

18120226 commented 3 years ago

您好: 感谢回复!还有Environment_marl.py中act_for_training的lambdda为何设置为0

le-liang commented 3 years ago

您好: 感谢回复!还有Environment_marl.py中act_for_training的lambdda为何设置为0

你好,这个问题之前跟另一位研究人员讨论过,请参看这个 Issue: "关于reward design的中lambdda_c 和lambdda_d取值问题 #1"

nian-wwn commented 3 years ago

老师,您好,我最近在阅读您的“Spectrum Sharing in Vehicular Networks Based on Multi-Agent Reinforcement Learning”这篇论文和学习代码,想向您请教一下,论文仿真结果中的,在时间T内的V2V有效载荷的变化的图6和图7,是根据那些数据得出的? image

le-liang commented 3 years ago

老师,您好,我最近在阅读您的“Spectrum Sharing in Vehicular Networks Based on Multi-Agent Reinforcement Learning”这篇论文和学习代码,想向您请教一下,论文仿真结果中的,在时间T内的V2V有效载荷的变化的图6和图7,是根据那些数据得出的? image

你好,谢谢提问。这是我写在 Readme里的总结,可以回答你的问题。原则上选择任意一个 test episode 都可以看到类似有意思的现象,但并不完全一致,我也忘记当时具体选的是哪一个了: Figures 6-7 show performance of an arbitrary episode (but with failed random baseline and successful MARL transmission). In fact, most of such episodes exhibit some interesting observations demonstrating multi-agent cooperation. Interpretation is up to the readers.

nian-wwn commented 3 years ago

老师,您好,我最近在阅读您的“Spectrum Sharing in Vehicular Networks Based on Multi-Agent Reinforcement Learning”这篇论文和学习代码,想向您请教一下,论文仿真结果中的,在时间T内的V2V有效载荷的变化的图6和图7,是根据那些数据得出的? image

你好,谢谢提问。这是我写在 Readme里的总结,可以回答你的问题。原则上选择任意一个 test episode 都可以看到类似有意思的现象,但并不完全一致,我也忘记当时具体选的是哪一个了: Figures 6-7 show performance of an arbitrary episode (but with failed random baseline and successful MARL transmission). In fact, most of such episodes exhibit some interesting observations demonstrating multi-agent cooperation. Interpretation is up to the readers.

老师,您好,我最近在阅读您的“Spectrum Sharing in Vehicular Networks Based on Multi-Agent Reinforcement Learning”这篇论文和学习代码,想向您请教一下,论文仿真结果中的,在时间T内的V2V有效载荷的变化的图6和图7,是根据那些数据得出的? image

你好,谢谢提问。这是我写在 Readme里的总结,可以回答你的问题。原则上选择任意一个 test episode 都可以看到类似有意思的现象,但并不完全一致,我也忘记当时具体选的是哪一个了: Figures 6-7 show performance of an arbitrary episode (but with failed random baseline and successful MARL transmission). In fact, most of such episodes exhibit some interesting observations demonstrating multi-agent cooperation. Interpretation is up to the readers.

明白了,谢谢您的回复,麻烦您了

le-liang commented 2 years ago

你好,我们假定每个V2I已经被分配好不同的channel,所以V2V动作空间里的channel选择实际上就是选择某个V2I来共享频谱。

梁乐


Dr. Le Liang, Professor School of Information Science and Engineering Southeast University (SEU), Nanjing, China E-mail: @.*** Homepage: www.liang-seu.net

On Dec 16, 2021, at 3:43 PM, wubmu @.***> wrote:

 老师你好,我看到你的动作空间有信道选择的,为啥在环境里没有体现每个链路属于哪个subchannel。是每个V2V链路分配一个专属subchannel吗?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.