aboutsummaryrefslogtreecommitdiffstats
path: root/buch/papers/multiplikation/code/MM
diff options
context:
space:
mode:
authorNunigan <michael.schmid2@ost.ch>2021-08-02 22:49:09 +0200
committerNunigan <michael.schmid2@ost.ch>2021-08-02 22:49:09 +0200
commitf96b0b2b66fe215a9e471eec44c58f4de11c7c0b (patch)
tree177ee97fc17d7cb9103583baefa460060c725026 /buch/papers/multiplikation/code/MM
parentMerge branch 'master' of https://github.com/AndreasFMueller/SeminarMatrizen (diff)
downloadSeminarMatrizen-f96b0b2b66fe215a9e471eec44c58f4de11c7c0b.tar.gz
SeminarMatrizen-f96b0b2b66fe215a9e471eec44c58f4de11c7c0b.zip
update
Diffstat (limited to '')
-rwxr-xr-xbuch/papers/multiplikation/code/MMbin26848 -> 26848 bytes
-rwxr-xr-xbuch/papers/multiplikation/code/MM.c2
-rw-r--r--buch/papers/multiplikation/code/MM.py23
3 files changed, 13 insertions, 12 deletions
diff --git a/buch/papers/multiplikation/code/MM b/buch/papers/multiplikation/code/MM
index f07985f..d52dda4 100755
--- a/buch/papers/multiplikation/code/MM
+++ b/buch/papers/multiplikation/code/MM
Binary files differ
diff --git a/buch/papers/multiplikation/code/MM.c b/buch/papers/multiplikation/code/MM.c
index 04c4dab..a897d4f 100755
--- a/buch/papers/multiplikation/code/MM.c
+++ b/buch/papers/multiplikation/code/MM.c
@@ -31,7 +31,7 @@ int main() {
run_algo(strassen, "strassen",0);
run_algo(MM, "MM", 0);
- // run_algo(winograd, "winograd", 0);
+ run_algo(winograd, "winograd", 0);
run_algo_cblas(0);
return 0;
diff --git a/buch/papers/multiplikation/code/MM.py b/buch/papers/multiplikation/code/MM.py
index 352771f..ee6f598 100644
--- a/buch/papers/multiplikation/code/MM.py
+++ b/buch/papers/multiplikation/code/MM.py
@@ -174,7 +174,7 @@ def test_perfomance(n):
plt.plot(n, t_mm_strassen, label='Strassen', lw=5)
plt.plot(n, t_wino, label='Winograd', lw=5)
plt.plot(n, t_np, label='NumPy A@B', lw=5)
- plt.xscale('log', base=2)
+ # plt.xscale('log', base=2)
plt.legend()
plt.xlabel("n")
plt.ylabel("time (s)")
@@ -203,6 +203,7 @@ def plot(num):
plt.plot(n, t_np, label='NumPy A@B', lw=5)
plt.legend()
plt.xlabel("n")
+ # plt.yscale('log', base=10)
plt.ylabel("time (s)")
plt.grid(True)
plt.tight_layout()
@@ -213,7 +214,7 @@ def plot(num):
def plot_c_res(ave, num):
MM = np.loadtxt("meas/MM.txt", delimiter=',')
- # winograd = np.loadtxt("meas/winograd.txt", delimiter=',')
+ winograd = np.loadtxt("meas/winograd.txt", delimiter=',')
blas = np.loadtxt("meas/blas.txt", delimiter=',')
MM_dc = np.loadtxt("meas/MM_dc.txt", delimiter=',')
strassen = np.loadtxt("meas/strassen.txt", delimiter=',')
@@ -233,10 +234,10 @@ def plot_c_res(ave, num):
strassen_t = np.mean(strassen_t.reshape(-1,ave),axis=1)
strassen_n = np.mean(strassen_n.reshape(-1,ave),axis=1)
- # winograd_t = winograd[:,0]
- # winograd_n = winograd[:,1]
- # winograd_t = np.mean(winograd_t.reshape(-1,ave),axis=1)
- # winograd_n = np.mean(winograd_n.reshape(-1,ave),axis=1)
+ winograd_t = winograd[:,0]
+ winograd_n = winograd[:,1]
+ winograd_t = np.mean(winograd_t.reshape(-1,ave),axis=1)
+ winograd_n = np.mean(winograd_n.reshape(-1,ave),axis=1)
blas_t = blas[:,0]
blas_n = blas[:,1]
@@ -256,7 +257,7 @@ def plot_c_res(ave, num):
plt.rc('xtick', labelsize=23)
plt.rc('ytick', labelsize=23)
plt.plot(MM_n, MM_t, label='3 For Loops', lw=5)
- # plt.plot(winograd_n, winograd_t, label='Winograd MM', lw=5)
+ plt.plot(winograd_n, winograd_t, label='Winograd MM', lw=5)
plt.plot(blas_n, blas_t, label='Blas', lw=5)
plt.plot(strassen_n, strassen_t, label='Strassen', lw=5)
plt.plot(MM_dc_n, MM_dc_t, label='Divide and Conquer', lw=5)
@@ -276,11 +277,11 @@ def plot_c_res(ave, num):
# test%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if __name__ == '__main__':
- # plot_c_res(1, 4096)
+ plot_c_res(1, 4096)
- # plot(8)
- n = np.logspace(1,8,8,base=2,dtype=(np.int))
+ # plot(1024)
+ # n = np.logspace(1,10,10,base=2,dtype=(np.int))
# n = np.arange(1,50,2)
# A = np.random.randint(-10, 6, (5,3))
# B = np.random.randint(-10, 6, (3,5))
@@ -291,7 +292,7 @@ if __name__ == '__main__':
# print(C_test)
# print(np.equal(C, C_test))
- t_np = test_perfomance(n)
+ # t_np = test_perfomance(n)
# C = strassen(A, B)
# C_test = A@B