UOMOP

X: FLOPs constraint, Y: Avg PSNR 본문

DE/Graph

X: FLOPs constraint, Y: Avg PSNR

Happy PinGu 2024. 9. 4. 18:37
% MATLAB 코드 시작

% 전체 데이터 입력 (dim, snr, FLOPs constraint, Avg. PSNR)
data_proposed = [
    512, 40, 3.0, 0.0;
    512, 40, 3.1, 0.0;
    512, 40, 3.2, 0.0;
    512, 40, 3.3, 25.2;
    512, 40, 3.4, 25.2;
    512, 40, 3.5, 25.2;
    512, 40, 3.6, 25.2;
    512, 40, 3.7, 25.2;
    512, 40, 3.8, 25.2;
    512, 40, 3.9, 27.68;
    512, 40, 4.0, 27.68;
    512, 40, 4.1, 27.68;
    512, 40, 4.2, 27.68;
    512, 40, 4.3, 27.68;
    512, 40, 4.4, 27.68;
    512, 40, 4.5, 28.74;
    512, 40, 4.6, 28.74;
    512, 40, 4.7, 28.74;
    512, 40, 4.8, 28.74;
    512, 40, 4.9, 28.74;
    512, 40, 5.0, 28.74;
    512, 40, 5.1, 28.74;
    512, 40, 5.2, 28.74;
    512, 40, 5.3, 28.74;
    512, 40, 5.4, 28.74;
    512, 40, 5.5, 28.74;
    512, 40, 5.6, 28.74;
    512, 40, 5.7, 28.88;
    512, 40, 5.8, 28.88;
    512, 40, 5.9, 28.88;
    512, 40, 6.0, 28.88;
    512, 20, 3.0, 0.0;
    512, 20, 3.1, 0.0;
    512, 20, 3.2, 0.0;
    512, 20, 3.3, 23.89;
    512, 20, 3.4, 23.89;
    512, 20, 3.5, 23.89;
    512, 20, 3.6, 23.89;
    512, 20, 3.7, 23.89;
    512, 20, 3.8, 23.89;
    512, 20, 3.9, 25.62;
    512, 20, 4.0, 25.62;
    512, 20, 4.1, 25.62;
    512, 20, 4.2, 25.62;
    512, 20, 4.3, 25.62;
    512, 20, 4.4, 25.62;
    512, 20, 4.5, 25.8;
    512, 20, 4.6, 25.8;
    512, 20, 4.7, 25.8;
    512, 20, 4.8, 25.8;
    512, 20, 4.9, 25.8;
    512, 20, 5.0, 25.8;
    512, 20, 5.1, 25.8;
    512, 20, 5.2, 25.8;
    512, 20, 5.3, 25.8;
    512, 20, 5.4, 25.8;
    512, 20, 5.5, 25.8;
    512, 20, 5.6, 25.8;
    512, 20, 5.7, 25.9;
    512, 20, 5.8, 25.9;
    512, 20, 5.9, 25.9;
    512, 20, 6.0, 25.9;
    256, 40, 3.0, 0.0;
    256, 40, 3.1, 0.0;
    256, 40, 3.2, 0.0;
    256, 40, 3.3, 24.51;
    256, 40, 3.4, 24.51;
    256, 40, 3.5, 24.51;
    256, 40, 3.6, 24.51;
    256, 40, 3.7, 24.51;
    256, 40, 3.8, 24.51;
    256, 40, 3.9, 25.65;
    256, 40, 4.0, 25.65;
    256, 40, 4.1, 25.65;
    256, 40, 4.2, 25.65;
    256, 40, 4.3, 25.65;
    256, 40, 4.4, 25.65;
    256, 40, 4.5, 26.36;
    256, 40, 4.6, 26.36;
    256, 40, 4.7, 26.36;
    256, 40, 4.8, 26.36;
    256, 40, 4.9, 26.36;
    256, 40, 5.0, 26.36;
    256, 40, 5.1, 26.36;
    256, 40, 5.2, 26.36;
    256, 40, 5.3, 26.36;
    256, 40, 5.4, 26.36;
    256, 40, 5.5, 26.36;
    256, 40, 5.6, 26.36;
    256, 40, 5.7, 27.2;
    256, 40, 5.8, 27.2;
    256, 40, 5.9, 27.2;
    256, 40, 6.0, 27.2;
    256, 20, 3.0, 0.0;
    256, 20, 3.1, 0.0;
    256, 20, 3.2, 0.0;
    256, 20, 3.3, 23.34;
    256, 20, 3.4, 23.34;
    256, 20, 3.5, 23.34;
    256, 20, 3.6, 23.34;
    256, 20, 3.7, 23.34;
    256, 20, 3.8, 23.34;
    256, 20, 3.9, 24.03;
    256, 20, 4.0, 24.03;
    256, 20, 4.1, 24.03;
    256, 20, 4.2, 24.03;
    256, 20, 4.3, 24.03;
    256, 20, 4.4, 24.03;
    256, 20, 4.5, 24.57;
    256, 20, 4.6, 24.57;
    256, 20, 4.7, 24.57;
    256, 20, 4.8, 24.57;
    256, 20, 4.9, 24.57;
    256, 20, 5.0, 24.57;
    256, 20, 5.1, 24.57;
    256, 20, 5.2, 24.57;
    256, 20, 5.3, 24.57;
    256, 20, 5.4, 24.57;
    256, 20, 5.5, 24.57;
    256, 20, 5.6, 24.57;
    256, 20, 5.7, 25.0;
    256, 20, 5.8, 25.0;
    256, 20, 5.9, 25.0;
    256, 20, 6.0, 25.0;
];

data_topk = [
    512, 40, 3.0, 0.0;
    512, 40, 3.1, 0.0;
    512, 40, 3.2, 0.0;
    512, 40, 3.3, 21.89;
    512, 40, 3.4, 21.89;
    512, 40, 3.5, 21.89;
    512, 40, 3.6, 21.89;
    512, 40, 3.7, 21.89;
    512, 40, 3.8, 21.89;
    512, 40, 3.9, 25.07;
    512, 40, 4.0, 25.07;
    512, 40, 4.1, 25.07;
    512, 40, 4.2, 25.07;
    512, 40, 4.3, 25.07;
    512, 40, 4.4, 25.07;
    512, 40, 4.5, 28.14;
    512, 40, 4.6, 28.14;
    512, 40, 4.7, 28.14;
    512, 40, 4.8, 28.14;
    512, 40, 4.9, 28.14;
    512, 40, 5.0, 28.14;
    512, 40, 5.1, 28.14;
    512, 40, 5.2, 28.14;
    512, 40, 5.3, 28.14;
    512, 40, 5.4, 28.14;
    512, 40, 5.5, 28.14;
    512, 40, 5.6, 28.14;
    512, 40, 5.7, 28.88;
    512, 40, 5.8, 28.88;
    512, 40, 5.9, 28.88;
    512, 40, 6.0, 28.88;
    512, 20, 3.0, 0.0;
    512, 20, 3.1, 0.0;
    512, 20, 3.2, 0.0;
    512, 20, 3.3, 21.38;
    512, 20, 3.4, 21.38;
    512, 20, 3.5, 21.38;
    512, 20, 3.6, 21.38;
    512, 20, 3.7, 21.38;
    512, 20, 3.8, 21.38;
    512, 20, 3.9, 23.78;
    512, 20, 4.0, 23.78;
    512, 20, 4.1, 23.78;
    512, 20, 4.2, 23.78;
    512, 20, 4.3, 23.78;
    512, 20, 4.4, 23.78;
    512, 20, 4.5, 25.47;
    512, 20, 4.6, 25.47;
    512, 20, 4.7, 25.47;
    512, 20, 4.8, 25.47;
    512, 20, 4.9, 25.47;
    512, 20, 5.0, 25.47;
    512, 20, 5.1, 25.47;
    512, 20, 5.2, 25.47;
    512, 20, 5.3, 25.47;
    512, 20, 5.4, 25.47;
    512, 20, 5.5, 25.47;
    512, 20, 5.6, 25.47;
    512, 20, 5.7, 25.9;
    512, 20, 5.8, 25.9;
    512, 20, 5.9, 25.9;
    512, 20, 6.0, 25.9;
    256, 40, 3.0, 0.0;
    256, 40, 3.1, 0.0;
    256, 40, 3.2, 0.0;
    256, 40, 3.3, 21.6;
    256, 40, 3.4, 21.6;
    256, 40, 3.5, 21.6;
    256, 40, 3.6, 21.6;
    256, 40, 3.7, 21.6;
    256, 40, 3.8, 21.6;
    256, 40, 3.9, 23.97;
    256, 40, 4.0, 23.97;
    256, 40, 4.1, 23.97;
    256, 40, 4.2, 23.97;
    256, 40, 4.3, 23.97;
    256, 40, 4.4, 23.97;
    256, 40, 4.5, 25.75;
    256, 40, 4.6, 25.75;
    256, 40, 4.7, 25.75;
    256, 40, 4.8, 25.75;
    256, 40, 4.9, 25.75;
    256, 40, 5.0, 25.75;
    256, 40, 5.1, 25.75;
    256, 40, 5.2, 25.75;
    256, 40, 5.3, 25.75;
    256, 40, 5.4, 25.75;
    256, 40, 5.5, 25.75;
    256, 40, 5.6, 25.75;
    256, 40, 5.7, 27.2;
    256, 40, 5.8, 27.2;
    256, 40, 5.9, 27.2;
    256, 40, 6.0, 27.2;
    256, 20, 3.0, 0.0;
    256, 20, 3.1, 0.0;
    256, 20, 3.2, 0.0;
    256, 20, 3.3, 21.03;
    256, 20, 3.4, 21.03;
    256, 20, 3.5, 21.03;
    256, 20, 3.6, 21.03;
    256, 20, 3.7, 21.03;
    256, 20, 3.8, 21.04;
    256, 20, 3.9, 22.94;
    256, 20, 4.0, 22.94;
    256, 20, 4.1, 22.94;
    256, 20, 4.2, 22.94;
    256, 20, 4.3, 22.94;
    256, 20, 4.4, 22.94;
    256, 20, 4.5, 24.24;
    256, 20, 4.6, 24.24;
    256, 20, 4.7, 24.24;
    256, 20, 4.8, 24.24;
    256, 20, 4.9, 24.24;
    256, 20, 5.0, 24.24;
    256, 20, 5.1, 24.24;
    256, 20, 5.2, 24.24;
    256, 20, 5.3, 24.24;
    256, 20, 5.4, 24.24;
    256, 20, 5.5, 24.24;
    256, 20, 5.6, 24.24;
    256, 20, 5.7, 25.0;
    256, 20, 5.8, 25.0;
    256, 20, 5.9, 25.0;
    256, 20, 6.0, 25.0;
];

data_random = [
    512, 40, 3.0, 0.0;
    512, 40, 3.1, 0.0;
    512, 40, 3.2, 0.0;
    512, 40, 3.3, 21.49;
    512, 40, 3.4, 21.49;
    512, 40, 3.5, 21.49;
    512, 40, 3.6, 21.49;
    512, 40, 3.7, 21.49;
    512, 40, 3.8, 21.49;
    512, 40, 3.9, 23.67;
    512, 40, 4.0, 23.67;
    512, 40, 4.1, 23.67;
    512, 40, 4.2, 23.67;
    512, 40, 4.3, 23.67;
    512, 40, 4.4, 23.67;
    512, 40, 4.5, 26.15;
    512, 40, 4.6, 26.15;
    512, 40, 4.7, 26.15;
    512, 40, 4.8, 26.15;
    512, 40, 4.9, 26.15;
    512, 40, 5.0, 26.15;
    512, 40, 5.1, 26.15;
    512, 40, 5.2, 26.15;
    512, 40, 5.3, 26.15;
    512, 40, 5.4, 26.15;
    512, 40, 5.5, 26.15;
    512, 40, 5.6, 26.15;
    512, 40, 5.7, 28.88;
    512, 40, 5.8, 28.88;
    512, 40, 5.9, 28.88;
    512, 40, 6.0, 28.88;
    512, 20, 3.0, 0.0;
    512, 20, 3.1, 0.0;
    512, 20, 3.2, 0.0;
    512, 20, 3.3, 20.92;
    512, 20, 3.4, 20.92;
    512, 20, 3.5, 20.92;
    512, 20, 3.6, 20.92;
    512, 20, 3.7, 20.92;
    512, 20, 3.8, 20.92;
    512, 20, 3.9, 22.73;
    512, 20, 4.0, 22.73;
    512, 20, 4.1, 22.73;
    512, 20, 4.2, 22.73;
    512, 20, 4.3, 22.73;
    512, 20, 4.4, 22.73;
    512, 20, 4.5, 23.82;
    512, 20, 4.6, 23.82;
    512, 20, 4.7, 23.82;
    512, 20, 4.8, 23.82;
    512, 20, 4.9, 23.82;
    512, 20, 5.0, 23.82;
    512, 20, 5.1, 23.82;
    512, 20, 5.2, 23.82;
    512, 20, 5.3, 23.82;
    512, 20, 5.4, 23.82;
    512, 20, 5.5, 23.82;
    512, 20, 5.6, 23.82;
    512, 20, 5.7, 25.9;
    512, 20, 5.8, 25.9;
    512, 20, 5.9, 25.9;
    512, 20, 6.0, 25.9;
    256, 40, 3.0, 0.0;
    256, 40, 3.1, 0.0;
    256, 40, 3.2, 0.0;
    256, 40, 3.3, 21.26;
    256, 40, 3.4, 21.26;
    256, 40, 3.5, 21.26;
    256, 40, 3.6, 21.26;
    256, 40, 3.7, 21.26;
    256, 40, 3.8, 21.26;
    256, 40, 3.9, 22.73;
    256, 40, 4.0, 22.73;
    256, 40, 4.1, 22.73;
    256, 40, 4.2, 22.73;
    256, 40, 4.3, 22.73;
    256, 40, 4.4, 22.73;
    256, 40, 4.5, 24.28;
    256, 40, 4.6, 24.28;
    256, 40, 4.7, 24.28;
    256, 40, 4.8, 24.28;
    256, 40, 4.9, 24.28;
    256, 40, 5.0, 24.28;
    256, 40, 5.1, 24.28;
    256, 40, 5.2, 24.28;
    256, 40, 5.3, 24.28;
    256, 40, 5.4, 24.28;
    256, 40, 5.5, 24.28;
    256, 40, 5.6, 24.28;
    256, 40, 5.7, 27.2;
    256, 40, 5.8, 27.2;
    256, 40, 5.9, 27.2;
    256, 40, 6.0, 27.2;
    256, 20, 3.0, 0.0;
    256, 20, 3.1, 0.0;
    256, 20, 3.2, 0.0;
    256, 20, 3.3, 20.74;
    256, 20, 3.4, 20.74;
    256, 20, 3.5, 20.74;
    256, 20, 3.6, 20.74;
    256, 20, 3.7, 20.74;
    256, 20, 3.8, 20.74;
    256, 20, 3.9, 21.87;
    256, 20, 4.0, 21.87;
    256, 20, 4.1, 21.87;
    256, 20, 4.2, 21.87;
    256, 20, 4.3, 21.87;
    256, 20, 4.4, 21.87;
    256, 20, 4.5, 23.03;
    256, 20, 4.6, 23.03;
    256, 20, 4.7, 23.03;
    256, 20, 4.8, 23.03;
    256, 20, 4.9, 23.03;
    256, 20, 5.0, 23.03;
    256, 20, 5.1, 23.03;
    256, 20, 5.2, 23.03;
    256, 20, 5.3, 23.03;
    256, 20, 5.4, 23.03;
    256, 20, 5.5, 23.03;
    256, 20, 5.6, 23.03;
    256, 20, 5.7, 25.0;
    256, 20, 5.8, 25.0;
    256, 20, 5.9, 25.0;
    256, 20, 6.0, 25.0;
];

% 사용자 입력
dim_input = input('dim 값을 입력하세요 (예: 512): ');
snr_input = input('snr 값을 입력하세요 (예: 40): ');

% 각 기법에 대한 데이터 선택
selected_data_proposed = data_proposed(data_proposed(:,1) == dim_input & data_proposed(:,2) == snr_input, :);
selected_data_topk = data_topk(data_topk(:,1) == dim_input & data_topk(:,2) == snr_input, :);
selected_data_random = data_random(data_random(:,1) == dim_input & data_random(:,2) == snr_input, :);

% FLOPs constraint와 Avg. PSNR 추출
flops_constraint_proposed = selected_data_proposed(:, 3);
avg_psnr_proposed = selected_data_proposed(:, 4);

flops_constraint_topk = selected_data_topk(:, 3);
avg_psnr_topk = selected_data_topk(:, 4);

flops_constraint_random = selected_data_random(:, 3);
avg_psnr_random = selected_data_random(:, 4);

% 그래프 그리기
figure;

hold on;
plot(flops_constraint_topk,avg_psnr_topk,  'b--s', 'LineWidth', 2, 'DisplayName', 'TopK');
plot(flops_constraint_random,avg_psnr_random,  'g--d', 'LineWidth', 2, 'DisplayName', 'Random');
plot(flops_constraint_proposed,avg_psnr_proposed,  'r-*', 'LineWidth', 2, 'MarkerSize', 8, 'DisplayName', 'Proposed');
xlabel('FLOPs Constraint');
ylabel('Avg. PSNR (dB)');


% 제목 설정
if dim_input == 512
    title(['CR: 1/6, SNR = ' num2str(snr_input),'dB']);
else
    title(['CR: 1/12, SNR = ' num2str(snr_input),'dB']);
end

% 범례 위치 조정 및 그리드 설정
legend('Location', 'southeast');
grid on;
ylim([0, 35])
hold off;


% MATLAB 코드 종료

'DE > Graph' 카테고리의 다른 글

X: Target PSNR, Y: Outage probability  (2) 2024.09.05
Feasibility for target PSNR  (0) 2024.09.04
Random Activate layer  (0) 2024.09.03
TopK Activate layer  (0) 2024.09.03
CBS activated layer  (0) 2024.09.03
Comments