-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpiecewise_plots.m
executable file
·67 lines (58 loc) · 1.82 KB
/
piecewise_plots.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
set(0, 'defaultTextInterpreter', 'latex');
load('results_piecewise.mat');
baseline=baseline_80;
baseline_accuracy=100-baseline;
%%%%Sigmoid
figure('Name', 'Accuracy - sigmoid LUT of size (N)');
h1=axes
index=results_sigmf_unrestricted(:,1);
r1=100-results_sigmf_unrestricted(:,2);
r1=(r1/baseline_accuracy)*100;
plot(index,r1,'b--o','LineWidth',5);
grid on;
hold on;
r2=100-results_sigmf_even(:,2);
r2=(r2/baseline_accuracy)*100;
plot(index,r2,'r--x','LineWidth',5);
r3=100-results_sigmf_pow2(:,2);
r3=(r3/baseline_accuracy)*100;
plot(index,r3,'k--s','LineWidth',5);
space=2:32;
plot(space, (100)*ones(size(space)),'g-*','LineWidth',5);
xlabel('Breakpoints') % x-axis label
ylabel('Relative Accuracy \%') % y-axis label
%title('LUT sigmoid with N breakpoints')
legend('Unrestricted spacing','Even Spacing','Power-of-2 spacing','Ideal Sigmoid')
%set(gca,'fontsize',20)
set(h1, 'Xdir', 'reverse')
axis([2 8 80 105]);
set(gca,'FontSize',30)
%%%%%%
%
%%%%Tansig
figure('Name', 'Accuracy - Tansig LUT of size (N)');
h1=axes
index=results_tansig_unrestricted(:,1);
r1=100-results_tansig_unrestricted(:,2);
r1=(r1/baseline_accuracy)*100;
plot(index,r1,'b--o','LineWidth',5);
grid on;
hold on;
r2=100-results_tansig_even(:,2);
r2=(r2/baseline_accuracy)*100;
plot(index,r2,'r--x','LineWidth',5);
r3=100-results_tansig_pow2(:,2);
r3=(r3/baseline_accuracy)*100;
plot(index,r3,'k--s','LineWidth',5);
space=2:64;
plot(space, (100)*ones(size(space)),'g-*','LineWidth',5);
xlabel('Breakpoints') % x-axis label
ylabel('Relative Accuracy \%') % y-axis label
%title('LUT tansig with N breakpoints')
legend('Unrestricted spacing','Even Spacing','Power-of-2 spacing','Ideal Hyperbolic Tangent')
%set(gca,'fontsize',20)
set(h1, 'Xdir', 'reverse')
axis([2 8 50 105]);
set(gca,'FontSize',30)
%%%%%%
%