diff options
Diffstat (limited to 'buch/papers')
-rw-r--r-- | buch/papers/multiplikation/code/MM.py | 22 | ||||
-rw-r--r-- | buch/papers/multiplikation/code/c_meas_4096.pdf | bin | 22360 -> 22207 bytes | |||
-rwxr-xr-x | buch/papers/multiplikation/code/helper_class.py | 4 | ||||
-rw-r--r-- | buch/papers/multiplikation/code/meas/ci/MM.txt | 11 | ||||
-rw-r--r-- | buch/papers/multiplikation/code/meas/ci/Wino.txt | 11 | ||||
-rw-r--r-- | buch/papers/multiplikation/code/meas/ci/blas.txt | 11 | ||||
-rw-r--r-- | buch/papers/multiplikation/code/meas/ci/dc.txt | 11 | ||||
-rw-r--r-- | buch/papers/multiplikation/code/meas/ci/strassen.txt | 11 | ||||
-rw-r--r-- | buch/papers/multiplikation/code/meas_4096.pdf | bin | 17369 -> 18300 bytes | |||
-rw-r--r-- | buch/papers/multiplikation/images/meas_c.pdf | bin | 23552 -> 24028 bytes | |||
-rw-r--r-- | buch/papers/multiplikation/images/meas_c.tex | 115 | ||||
-rw-r--r-- | buch/papers/multiplikation/images/meas_python.pdf | bin | 21700 -> 26004 bytes | |||
-rw-r--r-- | buch/papers/multiplikation/images/meas_python.tex | 53 | ||||
-rw-r--r-- | buch/papers/multiplikation/images/x.pdf | bin | 0 -> 23603 bytes |
14 files changed, 105 insertions, 144 deletions
diff --git a/buch/papers/multiplikation/code/MM.py b/buch/papers/multiplikation/code/MM.py index 8a6824a..8057850 100644 --- a/buch/papers/multiplikation/code/MM.py +++ b/buch/papers/multiplikation/code/MM.py @@ -291,19 +291,21 @@ def mean_confidence_interval(data, confidence=0.95): n = len(a) m, se = np.mean(a), scipy.stats.sem(a) h = se * scipy.stats.t.ppf((1 + confidence) / 2., n-1) - return m, m-h, m+h + return m, h # test%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if __name__ == '__main__': - A = plot_c_res(10, 4096) - name = ['MM', 'Wino', 'blas', 'strassen', 'dc'] - for i in range(5): - ci_inner = [] - for j in range(11): - ci_inner.append(mean_confidence_interval(A[i][j*10:(j+1)*10])) - np.savetxt('meas/ci/' + name[i]+'.txt',ci_inner) - - # arr = plot(1024) + # A = plot_c_res(10, 4096) + # name = ['MM', 'Wino', 'blas', 'strassen', 'dc'] + # for i in range(5): + # ci_inner = [] + # print(name[i]) + # for j in range(11): + # m,h=mean_confidence_interval(A[i][j*10:(j+1)*10]) + # print("({},{})".format(2**(j+1),m)) + # np.savetxt('meas/ci/' + name[i]+'.txt',ci_inner) + + arr = plot(4096) # n = np.logspace(1,12,12,base=2,dtype=(np.int)) # n=[2048,4096] # n = np.arange(1,50,2) diff --git a/buch/papers/multiplikation/code/c_meas_4096.pdf b/buch/papers/multiplikation/code/c_meas_4096.pdf Binary files differindex b42082f..f637ae4 100644 --- a/buch/papers/multiplikation/code/c_meas_4096.pdf +++ b/buch/papers/multiplikation/code/c_meas_4096.pdf diff --git a/buch/papers/multiplikation/code/helper_class.py b/buch/papers/multiplikation/code/helper_class.py index ad67909..3b74f67 100755 --- a/buch/papers/multiplikation/code/helper_class.py +++ b/buch/papers/multiplikation/code/helper_class.py @@ -101,6 +101,6 @@ if __name__ == '__main__': helper = Helper() # n = np.arange(2,10) - n = np.logspace(1,4,4,base=2,dtype=(np.int)) + n = np.logspace(1,11,11,base=2,dtype=(np.int)) # n=[8192] - C = helper.write_c_matrix(n) + # C = helper.write_c_matrix(n) diff --git a/buch/papers/multiplikation/code/meas/ci/MM.txt b/buch/papers/multiplikation/code/meas/ci/MM.txt index e4ad1ba..e69de29 100644 --- a/buch/papers/multiplikation/code/meas/ci/MM.txt +++ b/buch/papers/multiplikation/code/meas/ci/MM.txt @@ -1,11 +0,0 @@ -0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 -2.999999999999999864e-07 -4.555021440490437016e-08 6.455502144049043430e-07 -1.800000000000000130e-06 1.498379044967867836e-06 2.101620955032132425e-06 -1.199999999999999861e-05 9.737842837259007037e-06 1.426215716274099018e-05 -8.930000000000000221e-05 7.942767152586658090e-05 9.917232847413342352e-05 -6.922999999999999684e-04 6.611729768299406300e-04 7.234270231700593067e-04 -5.684200000000000363e-03 5.587928563282692010e-03 5.780471436717308717e-03 -5.177150000000000502e-02 5.161257221154376407e-02 5.193042778845624596e-02 -5.062468000000001078e-01 5.001729723042721565e-01 5.123206276957280592e-01 -4.504808599999999608e+00 4.404751183933223402e+00 4.604866016066775813e+00 -1.292894618999999921e+02 1.292188312556721144e+02 1.293600925443278697e+02 diff --git a/buch/papers/multiplikation/code/meas/ci/Wino.txt b/buch/papers/multiplikation/code/meas/ci/Wino.txt index 4ec0106..e69de29 100644 --- a/buch/papers/multiplikation/code/meas/ci/Wino.txt +++ b/buch/papers/multiplikation/code/meas/ci/Wino.txt @@ -1,11 +0,0 @@ -9.999999999999999547e-08 -1.262157162740991459e-07 3.262157162740991104e-07 -0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 -2.000000000000000333e-06 1.999999999999999909e-06 2.000000000000000757e-06 -1.199999999999999861e-05 9.737842837259007037e-06 1.426215716274099018e-05 -8.329999999999999189e-05 7.952898408510092581e-05 8.707101591489905797e-05 -6.478999999999999733e-04 6.173195729945008762e-04 6.784804270054990705e-04 -5.287299999999999986e-03 5.226513788941518357e-03 5.348086211058481615e-03 -5.267459999999999504e-02 5.240389179019239174e-02 5.294530820980759833e-02 -5.249752000000000862e-01 5.233835466989910090e-01 5.265668533010091634e-01 -4.671160999999999675e+00 4.572509907501117965e+00 4.769812092498881384e+00 -1.366769777000000090e+02 1.363957928284978891e+02 1.369581625715021289e+02 diff --git a/buch/papers/multiplikation/code/meas/ci/blas.txt b/buch/papers/multiplikation/code/meas/ci/blas.txt index 5d7ff7b..e69de29 100644 --- a/buch/papers/multiplikation/code/meas/ci/blas.txt +++ b/buch/papers/multiplikation/code/meas/ci/blas.txt @@ -1,11 +0,0 @@ -9.999999999999999547e-08 -1.262157162740991459e-07 3.262157162740991104e-07 -0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 -9.999999999999999547e-08 -1.262157162740991459e-07 3.262157162740991104e-07 -3.899999999999999929e-06 1.864058553533107683e-06 5.935941446466892176e-06 -2.100000000000000223e-05 1.871284586667546976e-05 2.328715413332453469e-05 -1.858000000000000168e-04 1.595988766828141249e-04 2.120011233171859087e-04 -1.264900000000000009e-03 1.221091632895032926e-03 1.308708367104967091e-03 -9.648900000000000185e-03 9.575266909835235610e-03 9.722533090164764760e-03 -7.737650000000000083e-02 7.445101996220353235e-02 8.030198003779646931e-02 -7.643868000000000329e-01 7.545731380187049586e-01 7.742004619812951072e-01 -7.632099399999999534e+00 7.613379481172315444e+00 7.650819318827683624e+00 diff --git a/buch/papers/multiplikation/code/meas/ci/dc.txt b/buch/papers/multiplikation/code/meas/ci/dc.txt index df268a9..e69de29 100644 --- a/buch/papers/multiplikation/code/meas/ci/dc.txt +++ b/buch/papers/multiplikation/code/meas/ci/dc.txt @@ -1,11 +0,0 @@ -2.999999999999999864e-07 -3.786471488222973584e-07 9.786471488222972253e-07 -1.100000000000000056e-06 8.737842837259009412e-07 1.326215716274099171e-06 -8.600000000000000670e-06 6.210712693650135778e-06 1.098928730634986641e-05 -7.819999999999998990e-05 7.075203863371232107e-05 8.564796136628765873e-05 -5.940000000000001269e-04 5.439534118129448707e-04 6.440465881870553830e-04 -4.433900000000000167e-03 4.349138038034851966e-03 4.518661961965148369e-03 -3.484430000000000166e-02 3.435947773230259988e-02 3.532912226769740344e-02 -2.948473000000000344e-01 2.887830472415335303e-01 3.009115527584665384e-01 -2.222850699999999957e+00 2.193855611791002858e+00 2.251845788208997057e+00 -1.765923450000000372e+01 1.762601016688562439e+01 1.769245883311438305e+01 -1.416103936000000090e+02 1.414816028568733657e+02 1.417391843431266523e+02 diff --git a/buch/papers/multiplikation/code/meas/ci/strassen.txt b/buch/papers/multiplikation/code/meas/ci/strassen.txt index 983fed9..e69de29 100644 --- a/buch/papers/multiplikation/code/meas/ci/strassen.txt +++ b/buch/papers/multiplikation/code/meas/ci/strassen.txt @@ -1,11 +0,0 @@ -0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 -2.099999999999999799e-06 1.572163328693768390e-06 2.627836671306231420e-06 -1.130000000000000023e-05 7.484018077564905836e-06 1.511598192243509547e-05 -7.069999999999999733e-05 6.500652995675561090e-05 7.639347004324438376e-05 -5.040999999999999474e-04 4.766428619697257881e-04 5.315571380302741610e-04 -3.595999999999999804e-03 3.528938496002300557e-03 3.663061503997699052e-03 -2.544810000000000128e-02 2.513634544137222787e-02 2.575985455862777468e-02 -1.781816999999999984e-01 1.773043765864557864e-01 1.790590234135442105e-01 -1.255500000000000060e+00 1.247847949398645628e+00 1.263152050601354492e+00 -8.830237099999999728e+00 8.790366960647805428e+00 8.870107239352194028e+00 -6.190186909999999898e+01 6.183048085945843297e+01 6.197325734054156499e+01 diff --git a/buch/papers/multiplikation/code/meas_4096.pdf b/buch/papers/multiplikation/code/meas_4096.pdf Binary files differindex 9e8fcea..ecf2cff 100644 --- a/buch/papers/multiplikation/code/meas_4096.pdf +++ b/buch/papers/multiplikation/code/meas_4096.pdf diff --git a/buch/papers/multiplikation/images/meas_c.pdf b/buch/papers/multiplikation/images/meas_c.pdf Binary files differindex e6af618..faf347e 100644 --- a/buch/papers/multiplikation/images/meas_c.pdf +++ b/buch/papers/multiplikation/images/meas_c.pdf diff --git a/buch/papers/multiplikation/images/meas_c.tex b/buch/papers/multiplikation/images/meas_c.tex index 647a322..fe2bd2f 100644 --- a/buch/papers/multiplikation/images/meas_c.tex +++ b/buch/papers/multiplikation/images/meas_c.tex @@ -43,8 +43,8 @@ \begin{tikzpicture} \begin{axis}[ xmode=log, ymode=log, -xmin=60, xmax=10000, -ymin=1e-4, ymax=2e4, +xmin=30, xmax=10000, +ymin=1e-5, ymax=2e4, grid=both, major grid style={black!50}, xlabel = data Input ($n$), @@ -57,35 +57,36 @@ width=12cm, height=8cm, ] \addlegendentry{Winograd} \addplot[ color=purple, + error bars/.cd, y dir=both, y explicit, ] coordinates { -% (2, 0.000001) -% (4, 0.000001) -% (8, 0.000002) -% (16, 0.000011) -% (32, 0.000100) -(64, 0.000654) -(128, 0.005229) -(256, 0.057440) -(512, 0.517850) -(1024,4.539413) -(2048,130.627663) +%(2,1e-07) +%(4,5e-07) +%(8,2.0000000000000003e-06) +%(16,1.1999999999999999e-05) +(32,8.329999999999999e-05) +(64,0.0006479) +(128,0.0052873) +(256,0.052674599999999995) +(512,0.5249752000000001) +(1024,4.671161) +(2048,136.6769777) (4096,1179.261048) (8192,10071.512655) }; \addlegendentry{Strassen} \addplot [ color=black, ]coordinates { - % (2,0.000001 ) - % (4,0.000003 ) - % (8,0.000010 ) - % (16,0.000066 ) - % (32,0.000470 ) - (64,0.003368 ) - (128,0.024232 ) - (256,0.172000 ) - (512,1.209262 ) -(1024,8.457472 ) -(2048,59.267256) +%(2,1e-07) +%(4,2.1e-06) +%(8,1.13e-05) +%(16,7.07e-05) +(32,0.0005041) +(64,0.003596) +(128,0.0254481) +(256,0.1781817) +(512,1.2555) +(1024,8.8302371) +(2048,61.9018691) (4096,414.648901) (8192,3014.235467) }; @@ -93,17 +94,17 @@ width=12cm, height=8cm, \addlegendentry{MM div and conq} \addplot[ color=green, ] coordinates { - % (2,0.000003 ) - % (4,0.000002 ) - % (8,0.000010 ) - % (16,0.000068 ) - % (32,0.000594 ) - (64,0.004264 ) - (128,0.036289 ) - (256,0.324645 ) - (512,2.612010 ) -(1024,19.928951 ) -(2048,159.333884 ) +%(2,3e-07) +%(4,1.1e-06) +%(8,8.6e-06) +%(16,7.819999999999999e-05) +(32,0.0005940000000000001) +(64,0.0044339) +(128,0.0348443) +(256,0.29484730000000003) +(512,2.2228507) +(1024,17.659234500000004) +(2048,141.6103936) (4096,1147.106865) (8192,9606.402522) }; @@ -111,34 +112,34 @@ width=12cm, height=8cm, \addlegendentry{MM} \addplot [ color=red, ]coordinates { - % (2,0.000001 ) - % (4,0.000001 ) - % (8,0.000001 ) - % (16,0.000010 ) - % (32,0.000081 ) - (64,0.000654 ) - (128,0.005556 ) - (256,0.054253 ) - (512,0.487317 ) -(1024,4.162845 ) -(2048,125.909034 ) +%(2,0.0) +%(4,3e-07) +%(8,1.8000000000000001e-06) +%(16,1.1999999999999999e-05) +(32,8.93e-05) +(64,0.0006923) +(128,0.0056842) +(256,0.051771500000000005) +(512,0.5062468000000001) +(1024,4.5048086) +(2048,129.2894619) (4096,1111.312696) (8192,9376.173434) }; \addlegendentry{BLAS} \addplot[ color=blue, ] coordinates { - % (2,0.000001 ) - % (4,0.000001 ) - % (8,0.000001 ) - % (16,0.000003 ) - % (32,0.000022 ) - (64,0.000179 ) - (128,0.001278 ) - (256,0.010165 ) - (512,0.074739 ) -(1024,0.704748 ) -(2048,6.845095 ) +%(2,1e-07) +%(4,0.0) +%(8,1e-07) +%(16,3.9e-06) +(32,2.1000000000000002e-05) +(64,0.00018580000000000002) +(128,0.0012649) +(256,0.0096489) +(512,0.0773765) +(1024,0.7643868) +(2048,7.6320993999999995) (4096,55.845038) (8192,478.429957) }; diff --git a/buch/papers/multiplikation/images/meas_python.pdf b/buch/papers/multiplikation/images/meas_python.pdf Binary files differindex cea2232..cea4f4b 100644 --- a/buch/papers/multiplikation/images/meas_python.pdf +++ b/buch/papers/multiplikation/images/meas_python.pdf diff --git a/buch/papers/multiplikation/images/meas_python.tex b/buch/papers/multiplikation/images/meas_python.tex index ee4db43..c8892be 100644 --- a/buch/papers/multiplikation/images/meas_python.tex +++ b/buch/papers/multiplikation/images/meas_python.tex @@ -43,8 +43,8 @@ \begin{tikzpicture} \begin{axis}[ xmode=log, ymode=log, -xmin=30, xmax=1050, -ymin=0.01, ymax=900, +xmin=30, xmax=4100, +ymin=0.00001, ymax=60000, grid=both, major grid style={black!50}, xlabel = data input ($n$), @@ -68,7 +68,8 @@ width=12cm, height=8cm, (256, 8.29899 ) (512, 68.3699 ) (1024,537.374 ) - +(2046,4884.61) +(4096,43597.1) }; \addlegendentry{Strassen} \addplot [ color=black, @@ -79,10 +80,12 @@ width=12cm, height=8cm, % (16,0.00475407 ) (32,0.0485256 ) (64,0.220414 ) - (128,1.44718 2 ) - (256,9.93866 0 ) - (512,63.961 2 ) -(1024,461.494 2 ) + (128,1.44718 ) + (256,9.93866 ) + (512,63.961 ) +(1024,461.494 ) +(2046,3860.57) +(4096,22904.3) }; \addlegendentry{MM div and conq} @@ -98,6 +101,8 @@ width=12cm, height=8cm, (256,13.27 ) (512,105.397 ) (1024,847.321 ) +(2046,7375.93) +(4096,58466) }; \addlegendentry{MM} @@ -113,25 +118,33 @@ width=12cm, height=8cm, (256, 11.0062 ) (512, 85.4768) (1024,750.757 ) +(2046,6154.18) +(4096,46813.3) }; -% \addlegendentry{NumPy} -% \addplot[ color=blue, -% ] coordinates { + \addlegendentry{NumPy} + \addplot[ color=blue, + ] coordinates { % (2,1.83582e-05 ) % (4,7.86781e-06) % (8,1.00136e-05) % (16,5.4121e-05 ) -% (32,4.26769e-05) -% (64,0.000118494) -% (128,0.000244141 ) -% (256,0.000695705 ) -% (512,0.00221705 ) -% (1024,0.0188088 ) -% }; + (32,4.26769e-05) + (64,0.000118494) + (128,0.000244141 ) + (256,0.000695705 ) + (512,0.00221705 ) + (1024,0.0188088 ) +(2046,0.215739) +(4096,1.49159) + }; + \addplot [ + domain= 1:5000, + samples=100, + color=yellow, + ] + {(x-1000)^3}; + \addlegendentry{$\mathcal{O}\left(n^3\right)$} \end{axis} \end{tikzpicture} \end{document} - - - diff --git a/buch/papers/multiplikation/images/x.pdf b/buch/papers/multiplikation/images/x.pdf Binary files differnew file mode 100644 index 0000000..da4956f --- /dev/null +++ b/buch/papers/multiplikation/images/x.pdf |