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

Update README.md #12

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Improvement/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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, Taiwan, 2023.

[2] MathWorks CSI Feedback with Autoencoders. https://www.mathworks.com/help/5g/ug/csi-feedback-with-autoencoders.html
24 changes: 24 additions & 0 deletions Improvement/plotNetwork.m
Original file line number Diff line number Diff line change
@@ -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
35 changes: 35 additions & 0 deletions Improvement/plot_Quantization_Result.m
Original file line number Diff line number Diff line change
@@ -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")