From f7fcff31286da48aca1d1b816c5d1d57326b240e Mon Sep 17 00:00:00 2001 From: peter94135 <84705600+peter94135@users.noreply.github.com> Date: Sat, 15 Apr 2023 13:01:23 +0800 Subject: [PATCH 1/3] Update README.md --- Improvement/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Improvement/README.md b/Improvement/README.md index 2452420..d3da2c9 100644 --- a/Improvement/README.md +++ b/Improvement/README.md @@ -7,7 +7,7 @@ Since the user must convert the codeword into binary, it can be sent back to the Binary codeword = Quantized(codeword*2-1) -2. tanh:- 1 < codeword < 1 +2. tanh:-1 < codeword < 1 Binary codeword = Quantized(codeword) @@ -34,6 +34,6 @@ The following are the simulation results of two different activation functions a From the above results, we can see that in most scenarios, using tanh for the activation function can bring better results. I think that the corresponding domain of tanh is larger than that of sigmoid, which means that the gradient is also stronger. ## Reference -[1] Huang, Tzu-Hao. "5G downlink channel feedback technology based on deep learning" +[1] T.-H. Huang, "5G downlink channel feedback technology based on deep learning," M.S. thesis, Comm. Eng., National Sun Yat-sen Univ., Kaohsiung, TTaiwan, 2023. [2] MathWorks CSI Feedback with Autoencoders. https://www.mathworks.com/help/5g/ug/csi-feedback-with-autoencoders.html From cba32d1c1a53731e3094f96e3ad0a27f20337764 Mon Sep 17 00:00:00 2001 From: peter94135 <84705600+peter94135@users.noreply.github.com> Date: Sat, 15 Apr 2023 13:03:16 +0800 Subject: [PATCH 2/3] Update README.md --- Improvement/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Improvement/README.md b/Improvement/README.md index d3da2c9..06aa4d6 100644 --- a/Improvement/README.md +++ b/Improvement/README.md @@ -34,6 +34,6 @@ The following are the simulation results of two different activation functions a From the above results, we can see that in most scenarios, using tanh for the activation function can bring better results. I think that the corresponding domain of tanh is larger than that of sigmoid, which means that the gradient is also stronger. ## Reference -[1] T.-H. Huang, "5G downlink channel feedback technology based on deep learning," M.S. thesis, Comm. Eng., National Sun Yat-sen Univ., Kaohsiung, TTaiwan, 2023. +[1] T.-H. Huang, "5G downlink channel feedback technology based on deep learning," M.S. thesis, Comm. Eng., National Sun Yat-sen Univ., Kaohsiung, Taiwan, 2023. [2] MathWorks CSI Feedback with Autoencoders. https://www.mathworks.com/help/5g/ug/csi-feedback-with-autoencoders.html From 9959a6e42ac27cf4336e855c8dd88f4080cd5864 Mon Sep 17 00:00:00 2001 From: peter94135 <84705600+peter94135@users.noreply.github.com> Date: Sun, 16 Apr 2023 11:46:51 +0800 Subject: [PATCH 3/3] Add files via upload --- Improvement/plotNetwork.m | 24 ++++++++++++++++++ Improvement/plot_Quantization_Result.m | 35 ++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 Improvement/plotNetwork.m create mode 100644 Improvement/plot_Quantization_Result.m diff --git a/Improvement/plotNetwork.m b/Improvement/plotNetwork.m new file mode 100644 index 0000000..e25e7e4 --- /dev/null +++ b/Improvement/plotNetwork.m @@ -0,0 +1,24 @@ +function plotNetwork(net,encNet,decNet) +%plotNetwork Plot autoencoder network +% plotNetwork(NET,ENC,DEC) plots the full autoencoder network together +% with encoder and decoder networks. +fig = figure; +t1 = tiledlayout(1,2,'TileSpacing','Compact'); +t2 = tiledlayout(t1,1,1,'TileSpacing','Tight'); +t3 = tiledlayout(t1,2,1,'TileSpacing','Tight'); +t3.Layout.Tile = 2; +nexttile(t2) +plot(net) +title("Autoencoder") +nexttile(t3) +plot(encNet) +title("Encoder") +nexttile(t3) +plot(decNet) +title("Decoder") +pos = fig.Position; +pos(3) = pos(3) + 200; +pos(4) = pos(4) + 300; +pos(2) = pos(2) - 300; +fig.Position = pos; +end \ No newline at end of file diff --git a/Improvement/plot_Quantization_Result.m b/Improvement/plot_Quantization_Result.m new file mode 100644 index 0000000..6395207 --- /dev/null +++ b/Improvement/plot_Quantization_Result.m @@ -0,0 +1,35 @@ +clc +clear +close all + +envir = 'Indoor'; %'Indoor' or 'Outdoor' +encoded_dim = 32; %compress rate=1/4->dim.=512, compress rate=1/16->dim.=128, compress rate=1/32->dim.=64, compress rate=1/64->dim.=32 +model_name = "model_CsiNet_"+envir+"_dim"+num2str(encoded_dim); + +load("Sigmoid result\"+model_name+"_Quantization_Result.mat") +rho_all_sigmoid=rho_all; +NMSE_all_sigmoid=NMSE_all; +load("Tanh result\"+model_name+"_Quantization_Result.mat") +rho_all_tanh=rho_all; +NMSE_all_tanh=NMSE_all; + +figure +tiledlayout(2,1) +nexttile +plot(nBitsVec,rho_all_sigmoid,'*-','LineWidth',1.5) +hold on +plot(nBitsVec,rho_all_tanh,'*-','LineWidth',1.5) +legend("Sigmoid","Tanh") +title("Correlation ("+envir+" Codeword-" + encoded_dim + ")") +xlabel("Number of Quantization Bits"); ylabel("\rho") +grid on +nexttile +plot(nBitsVec,NMSE_all_sigmoid,'*-','LineWidth',1.5) +hold on +plot(nBitsVec,NMSE_all_tanh,'*-','LineWidth',1.5) +legend("Sigmoid","Tanh") +title("NMSE ("+envir+" Codeword-" + encoded_dim + ")") +xlabel("Number of Quantization Bits"); ylabel("NMSE (dB)") +grid on +savefig(gcf,"Compare result\"+envir+"_"+num2str(encoded_dim)+"_Quantized.fig") +saveas(gcf,"Compare result\"+envir+"_"+num2str(encoded_dim)+"_Quantized.jpg") \ No newline at end of file