baturaysaglam / RIS-MISO-Deep-Reinforcement-Learning

Joint Transmit Beamforming and Phase Shifts Design with Deep Reinforcement Learning
MIT License
130 stars 37 forks source link

transmit power handing #4

Closed MrLiuWinter closed 1 year ago

MrLiuWinter commented 1 year ago

hi i am also confuse of the power, as you can see , the power is equal with Trace{G.G^h}, but when you compute the power in step part of environment , you use "np.real(np.diag(self.G.conjugate().T @ self.G)).reshape(1, -1) 2", its mean P 2, so i think the transmit power will be a wrong value, could you tell me why you use the equation, maybe some knowledge i havent learn thank you

further more, when you normalize the phase , why use sqrt(2) here,torch.sum(torch.abs(Phi_real), dim=1).reshape(-1, 1) * np.sqrt(2) honstly, i dont knowledge this whole sentence. why normalize the phase need use sum of Phi_real, as i know ,the Phi is computed by the angles and the range is complex area which cant be sure

Hawkingfans commented 1 year ago

你好,我最近也在閱讀這篇論文並且研究這位博主的程式碼。 想請問您是否有用他的code試著跑這篇論文圖五(sum rate對ris元件數量作圖)呢? 我將num_ris調大訓練出來結果似乎並沒有變好 如果您有任何建議請不吝指教 謝謝!

MrLiuWinter commented 1 year ago

你好,我最近也在閱讀這篇論文並且研究這位博主的程式碼。 想請問您是否有用他的code試著跑這篇論文圖五(sum rate對ris元件數量作圖)呢? 我將num_ris調大訓練出來結果似乎並沒有變好 如果您有任何建議請不吝指教 謝謝!

可以参考这篇论文,Active RIS vs. Passive RIS: Which Will Prevail in 6G? , chapter III 中的各个lemma, sum rate 取决于CSI和noise,所以 ris的数量造成的影响是有上界的。

此外我的问题,你没有遇到吗,这里phase 的归一化,为什么要用绝对值的和呢,而且还有乘根号2,我在论文里没有看到这个公式

Hawkingfans commented 1 year ago

了解,我之後再好好看您推薦的論文,非常感謝您的建議。

其實我也沒有很了解為何這位博主這樣計算,且事實上我用他的code似乎無法重現這篇論文的模擬圖

baturaysaglam commented 1 year ago

it is clear that trace{G.G^{H}} is complex matrix right? so, if we take directly the trace, how can a power value be complex? powers must be real values. the authors of the paper made a huge mistake there. i don't understand how referees allowed that. anyways, this is just an implementation repo. however, to realize the real value (as neural networks cannot process complex numbers), the real part of the trace should be considered. i consulted a friend who does his ph.d. at KTH. he agreed with me so you don't need to worry about that.

the same thing applies for the use of np.sqrt(2). that friend gave me the formula, he thought it would be much easier to implement the phase computation. nevertheless, the conventional way to compute the phase and my implementation are the same in terms of the operation. so you don't need to worry about that either. it's related to real and imaginary parts as far as I could remember.

MrLiuWinter commented 1 year ago

sorry, I think you still not answer my question. I know why you use the real part of the trace. I also think you should do this when I read your previous version. but, I mean the constraint is trace{G.G^{H}} = power. and in the environment.py, you use power_t = np.real(np.diag(self.G.conjugate().T @ self.G)).reshape(1, -1) ** 2 to compute the real part, its mean power**2. as I know, Actually, in the Shannon formula, just use power to compute the channel gain. that's me confused.

and can you teach me some detail of the np.sqrt(2), I havn't more knowledge of that, when i debug step by step, the value will be bigger than the sum of the phase torch.sum(torch.abs(Phi_real), dim=1).reshape(-1, 1). did not it will influence the exploring of the agent?

youshiyin commented 1 year ago

hi i am also confuse of the power, as you can see , the power is equal with Trace{G.G^h}, but when you compute the power in step part of environment , you use "np.real(np.diag(self.G.conjugate().T @ self.G)).reshape(1, -1) 2", its mean P 2, so i think the transmit power will be a wrong value, could you tell me why you use the equation, maybe some knowledge i havent learn thank you

further more, when you normalize the phase , why use sqrt(2) here,torch.sum(torch.abs(Phi_real), dim=1).reshape(-1, 1) * np.sqrt(2) honstly, i dont knowledge this whole sentence. why normalize the phase need use sum of Phi_real, as i know ,the Phi is computed by the angles and the range is complex area which cant be sure

你好,我也在复现这篇文章,可以加个联系方式吗

MrLiuWinter commented 1 year ago

hi i am also confuse of the power, as you can see , the power is equal with Trace{G.G^h}, but when you compute the power in step part of environment , you use "np.real(np.diag(self.G.conjugate().T @ self.G)).reshape(1, -1) 2", its mean P 2, so i think the transmit power will be a wrong value, could you tell me why you use the equation, maybe some knowledge i havent learn thank you further more, when you normalize the phase , why use sqrt(2) here,torch.sum(torch.abs(Phi_real), dim=1).reshape(-1, 1) * np.sqrt(2) honstly, i dont knowledge this whole sentence. why normalize the phase need use sum of Phi_real, as i know ,the Phi is computed by the angles and the range is complex area which cant be sure

你好,我也在复现这篇文章,可以加个联系方式吗

主页有邮箱的