diff --git a/as2_Maggioni_Claudio/deliverable/nn_task1_bonus/t1_bonus_0001_16.h5 b/as2_Maggioni_Claudio/deliverable/nn_task1_bonus/t1_bonus_0001_16.h5 new file mode 100644 index 0000000..933f844 Binary files /dev/null and b/as2_Maggioni_Claudio/deliverable/nn_task1_bonus/t1_bonus_0001_16.h5 differ diff --git a/as2_Maggioni_Claudio/deliverable/nn_task1_bonus/t1_bonus_0001_64.h5 b/as2_Maggioni_Claudio/deliverable/nn_task1_bonus/t1_bonus_0001_64.h5 new file mode 100644 index 0000000..9ff2c29 Binary files /dev/null and b/as2_Maggioni_Claudio/deliverable/nn_task1_bonus/t1_bonus_0001_64.h5 differ diff --git a/as2_Maggioni_Claudio/deliverable/nn_task1_bonus/t1_bonus_01_16.h5 b/as2_Maggioni_Claudio/deliverable/nn_task1_bonus/t1_bonus_01_16.h5 new file mode 100644 index 0000000..6171104 Binary files /dev/null and b/as2_Maggioni_Claudio/deliverable/nn_task1_bonus/t1_bonus_01_16.h5 differ diff --git a/as2_Maggioni_Claudio/deliverable/nn_task1_bonus/t1_bonus_01_64.h5 b/as2_Maggioni_Claudio/deliverable/nn_task1_bonus/t1_bonus_01_64.h5 new file mode 100644 index 0000000..5432608 Binary files /dev/null and b/as2_Maggioni_Claudio/deliverable/nn_task1_bonus/t1_bonus_01_64.h5 differ diff --git a/as2_Maggioni_Claudio/deliverable/run_task1_bonus.py b/as2_Maggioni_Claudio/deliverable/run_task1_bonus.py new file mode 100644 index 0000000..8301e12 --- /dev/null +++ b/as2_Maggioni_Claudio/deliverable/run_task1_bonus.py @@ -0,0 +1,63 @@ +from tensorflow.keras.models import load_model +import os +import pickle +import urllib.request as http +from zipfile import ZipFile +from tensorflow.keras import utils + +import tensorflow as tf +import numpy as np +from PIL import Image + +from tensorflow.keras import layers as keras_layers +from tensorflow.keras import backend as K +from tensorflow.keras.datasets import cifar10 +from tensorflow.keras.models import save_model, load_model + + +def load_cifar10(num_classes=3): + """ + Downloads CIFAR-10 dataset, which already contains a training and test set, + and return the first `num_classes` classes. + Example of usage: + + >>> (x_train, y_train), (x_test, y_test) = load_cifar10() + + :param num_classes: int, default is 3 as required by the assignment. + :return: the filtered data. + """ + (x_train_all, y_train_all), (x_test_all, y_test_all) = cifar10.load_data() + + fil_train = tf.where(y_train_all[:, 0] < num_classes)[:, 0] + fil_test = tf.where(y_test_all[:, 0] < num_classes)[:, 0] + + y_train = y_train_all[fil_train] + y_test = y_test_all[fil_test] + + x_train = x_train_all[fil_train] + x_test = x_test_all[fil_test] + + return (x_train, y_train), (x_test, y_test) + +if __name__ == '__main__': + + _, (x_test, y_test) = load_cifar10() + + x_test_n = x_test / 255 + y_test_n = utils.to_categorical(y_test, 3) + + lrs = ["01", "0001"] + nns = [16, 64] + + for lr in lrs: + for nn in nns: + # Load the trained models + model_task1 = load_model('nn_task1_bonus/t1_bonus_%s_%d.h5' % (lr, nn)) + + # Predict on the given samples + y_pred_task1 = model_task1.predict(x_test_n) + + # Evaluate the missclassification error on the test set + assert y_test_n.shape == y_pred_task1.shape + test_loss, test_accuracy = model_task1.evaluate(x_test_n, y_test_n) # evaluate accuracy with proper function + print("Accuracy model task 1 (%d neurons, 0.%s learning rate):" % (nn, lr), test_accuracy) diff --git a/as2_Maggioni_Claudio/report_Maggioni_Claudio.pdf b/as2_Maggioni_Claudio/report_Maggioni_Claudio.pdf index 2a34cdf..0fed4d8 100644 Binary files a/as2_Maggioni_Claudio/report_Maggioni_Claudio.pdf and b/as2_Maggioni_Claudio/report_Maggioni_Claudio.pdf differ diff --git a/as2_Maggioni_Claudio/report_Maggioni_Claudio.tex b/as2_Maggioni_Claudio/report_Maggioni_Claudio.tex index ef3261c..3988c8a 100644 --- a/as2_Maggioni_Claudio/report_Maggioni_Claudio.tex +++ b/as2_Maggioni_Claudio/report_Maggioni_Claudio.tex @@ -103,6 +103,11 @@ The script will download automatically the models. Then, in order to run the models with the \texttt{run\_task*.py}, make sure you first \texttt{cd} in the \texttt{deliverable} directory. +Should the script not work, please download the compressed T1 and T2 models from +\url{https://drive.switch.ch/index.php/s/F0ubFgS6PBy8UM5/download} and uncompress the downloaded \texttt{.tar.gz} +file in the \texttt{deliverable/} directory, and then make sure the directories \texttt{deliverable/nn\_task1} and \texttt{deliverable/nn\_task2} +contain 3 \texttt{.h5} files in total. + \maketitle In this assignment you are asked to: @@ -180,6 +185,60 @@ The training and validation accuracy curves for the network is shown below: \caption{Training and validation accuracy curves during fitting for the CIFAR10 classifier} \end{figure} +\subsection{Bonus} + +A plot of the validation loss and accuracy over training epochs for each of the configurations in the grid search are given below. +The plot is useful to understand that for both learning rates chosen, choosing 64 neurons will lead to overfitting, due to the validation +loss being higher than the training loss. This overfitting cannot be easily avoided with the adopted early stopping procedure, since +our implementation monitors validation loss and not validation accuracy. + +The second observation that can be found from the plots is that a smaller learning rate increases the number of epochs needed to achieve convergence +but it also increases the model accuracy and decreases the model loss. + +By running all the models on the test set, using the script \texttt{run\_task1\_bonus.py} in the \texttt{deliverable/} directory, +we obtain the following loss and accuracy: + +\begin{center} +\begin{tabular}{cccc} +\textbf{Learn rate} & \textbf{\# Neurons} & \textbf{Loss} & \textbf{Accuracy} \\\hline +0.01 & 16 & 0.4597 & 0.8117 \\ +0.01 & 64 & 0.4508 & 0.8290 \\ +0.0001 & 16 & 0.4048 & 0.8437 \\ +0.0001 & 64 & 0.4073 & 0.8343 \\ +\end{tabular} +\end{center} + +We choose the third configuration as the optimal one since it has highest accuracy (and lowest loss too). We then perform a T-test +between this model and the one built in the previous section using the script \texttt{src/t\_test\_bonus.py}. + +The T-test gives a T-score of 1.374106, corresponding to a P-value of 0.169511, which makes us accept the null hypothesis therefore +concluding that there is no significant difference between this optimal model and the one trained in the previous section. + +\begin{figure}[H] +\centering + \resizebox{0.75\textwidth}{!}{% + \includegraphics[width=0.25\textwidth]{./t1_bonus_0001_16.png}} +\caption{Training and validation accuracy curves during fitting for the CIFAR10 classifier (0.0001 learning rate, 16 neurons)} +\end{figure} +\begin{figure}[H] +\centering + \resizebox{0.75\textwidth}{!}{% + \includegraphics[width=0.25\textwidth]{./t1_bonus_0001_64.png}} +\caption{Training and validation accuracy curves during fitting for the CIFAR10 classifier (0.0001 learning rate, 64 neurons)} +\end{figure} +\begin{figure}[H] +\centering + \resizebox{0.75\textwidth}{!}{% + \includegraphics[width=0.25\textwidth]{./t1_bonus_01_16.png}} +\caption{Training and validation accuracy curves during fitting for the CIFAR10 classifier (0.01 learning rate, 16 neurons)} +\end{figure} +\begin{figure}[H] +\centering + \resizebox{\textwidth}{!}{% + \includegraphics{./t1_bonus_01_64.png}} +\caption{Training and validation accuracy curves during fitting for the CIFAR10 classifier (0.01 learning rate, 64 neurons)} +\end{figure} + %---------------------------------------------------------------------------------------- % Task 2 %---------------------------------------------------------------------------------------- diff --git a/as2_Maggioni_Claudio/src/my_civar10.csv b/as2_Maggioni_Claudio/src/t1.csv similarity index 100% rename from as2_Maggioni_Claudio/src/my_civar10.csv rename to as2_Maggioni_Claudio/src/t1.csv diff --git a/as2_Maggioni_Claudio/src/t1_bonus_0001_16.csv b/as2_Maggioni_Claudio/src/t1_bonus_0001_16.csv new file mode 100644 index 0000000..d82bcbd --- /dev/null +++ b/as2_Maggioni_Claudio/src/t1_bonus_0001_16.csv @@ -0,0 +1,208 @@ +epoch,accuracy,loss,val_accuracy,val_loss +0,0.4284999966621399,1.0838768482208252,0.4869999885559082,1.0578199625015259 +1,0.5239166617393494,1.0402600765228271,0.5659999847412109,1.0190595388412476 +2,0.5817499756813049,0.9990922212600708,0.5910000205039978,0.9864984750747681 +3,0.6119999885559082,0.9622434377670288,0.6259999871253967,0.949017345905304 +4,0.6326666474342346,0.9315217137336731,0.6393333077430725,0.9176478385925293 +5,0.6454166769981384,0.9024352431297302,0.652999997138977,0.8911747932434082 +6,0.6585000157356262,0.8730461597442627,0.6690000295639038,0.8625798225402832 +7,0.6735000014305115,0.8446393013000488,0.6773333549499512,0.835181474685669 +8,0.6888333559036255,0.8144475221633911,0.6913333535194397,0.8033531308174133 +9,0.703166663646698,0.7868669629096985,0.7013333439826965,0.7806670069694519 +10,0.706166684627533,0.763378918170929,0.7110000252723694,0.757719099521637 +11,0.7145833373069763,0.7431033253669739,0.715666651725769,0.741998553276062 +12,0.718916654586792,0.7261846661567688,0.7210000157356262,0.7289196252822876 +13,0.7229999899864197,0.7120341658592224,0.7239999771118164,0.7132157683372498 +14,0.7258333563804626,0.6993649005889893,0.7233333587646484,0.70282381772995 +15,0.7294166684150696,0.6884589791297913,0.7303333282470703,0.689950704574585 +16,0.7324166893959045,0.6778770089149475,0.7319999933242798,0.681061863899231 +17,0.7354999780654907,0.6690850257873535,0.737333357334137,0.6833087801933289 +18,0.7399166822433472,0.6607983708381653,0.7369999885559082,0.6706054210662842 +19,0.7423333525657654,0.6530723571777344,0.7403333187103271,0.6624245643615723 +20,0.7432500123977661,0.6457955837249756,0.7486666440963745,0.6517229676246643 +21,0.746833324432373,0.6393903493881226,0.75,0.643888533115387 +22,0.7488333582878113,0.6326268911361694,0.7486666440963745,0.6383176445960999 +23,0.7483333349227905,0.6276751160621643,0.7490000128746033,0.6381990313529968 +24,0.7508333325386047,0.6220626831054688,0.7536666393280029,0.6306868195533752 +25,0.7518333196640015,0.6173197031021118,0.7553333044052124,0.6245272159576416 +26,0.7560833096504211,0.6129053831100464,0.7526666522026062,0.6247814893722534 +27,0.7541666626930237,0.6082961559295654,0.7536666393280029,0.6236191987991333 +28,0.7570000290870667,0.6036962866783142,0.7590000033378601,0.6098343133926392 +29,0.7574166655540466,0.601693332195282,0.7580000162124634,0.6087884306907654 +30,0.7584166526794434,0.5974898934364319,0.7586666941642761,0.6052170991897583 +31,0.7605000138282776,0.5938131213188171,0.7620000243186951,0.6003297567367554 +32,0.762416660785675,0.5905328989028931,0.7639999985694885,0.5992019176483154 +33,0.7612500190734863,0.5880444645881653,0.7643333077430725,0.5923108458518982 +34,0.7616666555404663,0.5853286385536194,0.7639999985694885,0.5930081605911255 +35,0.7638333439826965,0.5823095440864563,0.762666642665863,0.5964158773422241 +36,0.765999972820282,0.5795621275901794,0.7673333287239075,0.5843967795372009 +37,0.7668333053588867,0.5765686631202698,0.7663333415985107,0.5817729234695435 +38,0.765916645526886,0.5750483274459839,0.7703333497047424,0.5850620269775391 +39,0.765999972820282,0.5720317959785461,0.7699999809265137,0.5821769833564758 +40,0.7690833210945129,0.5689754486083984,0.7563333511352539,0.6062623858451843 +41,0.7701666951179504,0.5680242776870728,0.7749999761581421,0.5748355388641357 +42,0.7706666588783264,0.565283477306366,0.7703333497047424,0.5693557858467102 +43,0.7690833210945129,0.5632652044296265,0.762666642665863,0.5945876240730286 +44,0.7721666693687439,0.5612371563911438,0.7743333578109741,0.5655432939529419 +45,0.7735833525657654,0.5595787763595581,0.7726666927337646,0.5788276195526123 +46,0.7735000252723694,0.5573917627334595,0.7706666588783264,0.5659079551696777 +47,0.7726666927337646,0.5553656816482544,0.7746666669845581,0.565401554107666 +48,0.7738333344459534,0.5532978773117065,0.7770000100135803,0.5598950386047363 +49,0.7741666436195374,0.5511548519134521,0.7720000147819519,0.572717547416687 +50,0.7744166851043701,0.5503709316253662,0.7816666960716248,0.5534486770629883 +51,0.7755833268165588,0.5489298701286316,0.7746666669845581,0.5592584013938904 +52,0.778249979019165,0.5472049117088318,0.7793333530426025,0.5620111227035522 +53,0.778083324432373,0.5453718304634094,0.7820000052452087,0.5521920919418335 +54,0.7774166464805603,0.5436322093009949,0.7753333449363708,0.5749772787094116 +55,0.7795833349227905,0.5426769852638245,0.7833333611488342,0.54844069480896 +56,0.781499981880188,0.5414560437202454,0.7863333225250244,0.5461897850036621 +57,0.7798333168029785,0.5391659736633301,0.7873333096504211,0.5434498190879822 +58,0.781000018119812,0.537829577922821,0.7860000133514404,0.5473216772079468 +59,0.78125,0.5362415313720703,0.7833333611488342,0.5422953963279724 +60,0.7825833559036255,0.5345484018325806,0.7896666526794434,0.5397301912307739 +61,0.781083345413208,0.5333306193351746,0.7846666574478149,0.5488216280937195 +62,0.781499981880188,0.5316175818443298,0.7866666913032532,0.5375092029571533 +63,0.7825833559036255,0.5311059355735779,0.7913333177566528,0.5380165576934814 +64,0.7825833559036255,0.5293938517570496,0.7860000133514404,0.5474703907966614 +65,0.784583330154419,0.526911199092865,0.7940000295639038,0.534210741519928 +66,0.7850833535194397,0.526195228099823,0.7796666622161865,0.5485478639602661 +67,0.784500002861023,0.5255493521690369,0.7879999876022339,0.5286822319030762 +68,0.7829166650772095,0.5241622924804688,0.7879999876022339,0.5352179408073425 +69,0.7868333458900452,0.5224430561065674,0.793666660785675,0.5249139666557312 +70,0.7879999876022339,0.5207787752151489,0.7953333258628845,0.5275792479515076 +71,0.7878333330154419,0.5201119184494019,0.7900000214576721,0.5244088768959045 +72,0.7862499952316284,0.518958568572998,0.7946666479110718,0.523970901966095 +73,0.7882500290870667,0.5165284276008606,0.7866666913032532,0.5394734144210815 +74,0.7892500162124634,0.5153293609619141,0.7923333048820496,0.527486264705658 +75,0.7892500162124634,0.5146932005882263,0.7960000038146973,0.5198792815208435 +76,0.7899166941642761,0.5136726498603821,0.7996666431427002,0.5181387662887573 +77,0.7906666398048401,0.5122131109237671,0.7916666865348816,0.5219271183013916 +78,0.793749988079071,0.510484516620636,0.7976666688919067,0.513494074344635 +79,0.7921666502952576,0.5083696842193604,0.7960000038146973,0.5170464515686035 +80,0.7898333072662354,0.5088156461715698,0.7976666688919067,0.5127342939376831 +81,0.7913333177566528,0.5076265335083008,0.7990000247955322,0.5130664110183716 +82,0.7923333048820496,0.5065186619758606,0.7983333468437195,0.5115938186645508 +83,0.793833315372467,0.5060837268829346,0.7946666479110718,0.5189694762229919 +84,0.7951666712760925,0.5030198097229004,0.8016666769981384,0.5069235563278198 +85,0.7958333492279053,0.5018414855003357,0.7986666560173035,0.5069368481636047 +86,0.7948333621025085,0.5011022090911865,0.7950000166893005,0.518936276435852 +87,0.7963333129882812,0.4992195963859558,0.8023333549499512,0.510757327079773 +88,0.7948333621025085,0.49941515922546387,0.8026666641235352,0.5029817819595337 +89,0.7955833077430725,0.49796411395072937,0.8016666769981384,0.5108314156532288 +90,0.796999990940094,0.49605679512023926,0.8050000071525574,0.5015484094619751 +91,0.7985833287239075,0.4947517514228821,0.8066666722297668,0.5003050565719604 +92,0.7985000014305115,0.4942174553871155,0.7979999780654907,0.5157888531684875 +93,0.7991666793823242,0.49348536133766174,0.8046666383743286,0.5041453242301941 +94,0.7982500195503235,0.4924047887325287,0.8069999814033508,0.4955296218395233 +95,0.8004166483879089,0.4904239773750305,0.8040000200271606,0.5005924701690674 +96,0.800083339214325,0.48912033438682556,0.8066666722297668,0.4985409379005432 +97,0.799833357334137,0.4888407289981842,0.7976666688919067,0.5117080211639404 +98,0.8034999966621399,0.48750850558280945,0.8076666593551636,0.49502503871917725 +99,0.8027499914169312,0.4864256680011749,0.8059999942779541,0.49409762024879456 +100,0.8030833601951599,0.4843618869781494,0.8076666593551636,0.49316972494125366 +101,0.8027499914169312,0.48391976952552795,0.8056666851043701,0.49657031893730164 +102,0.8028333187103271,0.48304617404937744,0.8109999895095825,0.4907311201095581 +103,0.8035833239555359,0.48315954208374023,0.8103333115577698,0.4878624975681305 +104,0.8054166436195374,0.48030945658683777,0.8080000281333923,0.4901617467403412 +105,0.8042500019073486,0.4796009957790375,0.8119999766349792,0.48475587368011475 +106,0.8058333396911621,0.47907406091690063,0.8023333549499512,0.5024172067642212 +107,0.8073333501815796,0.47742727398872375,0.8163333535194397,0.4822111427783966 +108,0.8069999814033508,0.4768243134021759,0.8140000104904175,0.4833918809890747 +109,0.8089166879653931,0.47576457262039185,0.7940000295639038,0.5274575352668762 +110,0.8097500205039978,0.4746205508708954,0.8143333196640015,0.4814397692680359 +111,0.8080833554267883,0.4733660817146301,0.8166666626930237,0.4792422950267792 +112,0.8110833168029785,0.47120606899261475,0.8050000071525574,0.49773457646369934 +113,0.8081666827201843,0.4709709584712982,0.8146666884422302,0.4788338541984558 +114,0.809416651725769,0.4698839485645294,0.8103333115577698,0.48417407274246216 +115,0.8108333349227905,0.4692935347557068,0.8103333115577698,0.48160356283187866 +116,0.8082500100135803,0.46925967931747437,0.8183333277702332,0.47494229674339294 +117,0.8088333606719971,0.4674088656902313,0.8180000185966492,0.4744347631931305 +118,0.8110833168029785,0.4659174680709839,0.8199999928474426,0.4724946618080139 +119,0.8117499947547913,0.46476221084594727,0.8193333148956299,0.4741252064704895 +120,0.8131666779518127,0.4641077518463135,0.8166666626930237,0.47541138529777527 +121,0.8112499713897705,0.4629130959510803,0.8143333196640015,0.47737279534339905 +122,0.8129166960716248,0.46172896027565,0.8196666836738586,0.4691659212112427 +123,0.8130833506584167,0.4603128731250763,0.8163333535194397,0.47983890771865845 +124,0.8149999976158142,0.45970287919044495,0.812333345413208,0.4799528419971466 +125,0.8136666417121887,0.4591692388057709,0.8199999928474426,0.4662765562534332 +126,0.8149166703224182,0.458272784948349,0.8223333358764648,0.46743473410606384 +127,0.8163333535194397,0.45662394165992737,0.8106666803359985,0.48275816440582275 +128,0.815833330154419,0.45521605014801025,0.8063333630561829,0.4981910288333893 +129,0.815666675567627,0.4543023407459259,0.8240000009536743,0.46369388699531555 +130,0.8162500262260437,0.4547498822212219,0.8236666917800903,0.4625664949417114 +131,0.8163333535194397,0.45360472798347473,0.8216666579246521,0.46581321954727173 +132,0.8171666860580444,0.4513089656829834,0.8213333487510681,0.46794694662094116 +133,0.8174999952316284,0.4502676725387573,0.8236666917800903,0.46201929450035095 +134,0.8175833225250244,0.450626939535141,0.8233333230018616,0.4603627622127533 +135,0.8180000185966492,0.44978514313697815,0.8223333358764648,0.46608027815818787 +136,0.8181666731834412,0.4481619894504547,0.8253333568572998,0.45728397369384766 +137,0.8199166655540466,0.44881880283355713,0.8243333101272583,0.45805856585502625 +138,0.8180000185966492,0.44711729884147644,0.8196666836738586,0.4678555130958557 +139,0.8193333148956299,0.44647112488746643,0.8253333568572998,0.4564843475818634 +140,0.8205833435058594,0.44517993927001953,0.8256666660308838,0.4554981589317322 +141,0.8193333148956299,0.4448118805885315,0.8259999752044678,0.4561938941478729 +142,0.8237500190734863,0.44255080819129944,0.8253333568572998,0.45700377225875854 +143,0.8211666941642761,0.4421866536140442,0.812333345413208,0.47945523262023926 +144,0.8218333125114441,0.44304102659225464,0.8273333311080933,0.45237383246421814 +145,0.8228333592414856,0.44051310420036316,0.8240000009536743,0.45798397064208984 +146,0.8230833411216736,0.4395943284034729,0.8289999961853027,0.45160120725631714 +147,0.8238333463668823,0.4399288594722748,0.8230000138282776,0.45358365774154663 +148,0.8225833177566528,0.43944698572158813,0.8233333230018616,0.46108153462409973 +149,0.8233333230018616,0.4379068613052368,0.8259999752044678,0.4573875665664673 +150,0.8230833411216736,0.43709826469421387,0.8256666660308838,0.4587935507297516 +151,0.8264999985694885,0.4359411895275116,0.8273333311080933,0.44938838481903076 +152,0.8260833621025085,0.43441638350486755,0.8226666450500488,0.46108269691467285 +153,0.8252500295639038,0.4348291754722595,0.8273333311080933,0.449728399515152 +154,0.8260833621025085,0.43436935544013977,0.8330000042915344,0.44688400626182556 +155,0.825166642665863,0.4338207244873047,0.8256666660308838,0.4547237157821655 +156,0.828249990940094,0.4312988817691803,0.8140000104904175,0.4719071090221405 +157,0.828416645526886,0.4321413040161133,0.8176666498184204,0.471040278673172 +158,0.828166663646698,0.4318599998950958,0.8273333311080933,0.45197200775146484 +159,0.828166663646698,0.430090993642807,0.82833331823349,0.44439029693603516 +160,0.8285833597183228,0.42939189076423645,0.8289999961853027,0.44576922059059143 +161,0.82791668176651,0.4281749129295349,0.8326666951179504,0.4409608840942383 +162,0.8273333311080933,0.42749324440956116,0.8293333053588867,0.44817423820495605 +163,0.8259999752044678,0.4273661673069,0.8336666822433472,0.44242313504219055 +164,0.8308333158493042,0.42598238587379456,0.8339999914169312,0.4399816393852234 +165,0.8295000195503235,0.4251851737499237,0.8343333601951599,0.43797993659973145 +166,0.831416666507721,0.4249284565448761,0.8333333134651184,0.4396743178367615 +167,0.8302500247955322,0.4233575165271759,0.8330000042915344,0.44218865036964417 +168,0.8289999961853027,0.42399221658706665,0.8259999752044678,0.46105313301086426 +169,0.8308333158493042,0.42323893308639526,0.8240000009536743,0.4512389004230499 +170,0.8326666951179504,0.42107221484184265,0.8303333520889282,0.4463028907775879 +171,0.8318333625793457,0.42121410369873047,0.8299999833106995,0.44618427753448486 +172,0.8338333368301392,0.4210498034954071,0.8346666693687439,0.4352149963378906 +173,0.8330000042915344,0.4207684397697449,0.8343333601951599,0.4385925829410553 +174,0.8338333368301392,0.4197690486907959,0.8303333520889282,0.4400194585323334 +175,0.8330833315849304,0.41875529289245605,0.8386666774749756,0.43167558312416077 +176,0.831416666507721,0.4174823462963104,0.8363333344459534,0.432464063167572 +177,0.8331666588783264,0.4170875549316406,0.8330000042915344,0.4378066956996918 +178,0.8335833549499512,0.41703271865844727,0.8339999914169312,0.43457409739494324 +179,0.8335833549499512,0.41658085584640503,0.82833331823349,0.446471631526947 +180,0.8343333601951599,0.41647860407829285,0.8336666822433472,0.4432835578918457 +181,0.8351666927337646,0.41469189524650574,0.8339999914169312,0.4488014876842499 +182,0.8349999785423279,0.41478434205055237,0.8346666693687439,0.4341667592525482 +183,0.8360000252723694,0.4139315187931061,0.8389999866485596,0.42700210213661194 +184,0.8343333601951599,0.41383248567581177,0.8330000042915344,0.44171130657196045 +185,0.8361666798591614,0.4140091836452484,0.8383333086967468,0.4264924228191376 +186,0.8364999890327454,0.41313403844833374,0.8403333425521851,0.42911815643310547 +187,0.8358333110809326,0.4112303555011749,0.8276666402816772,0.43771249055862427 +188,0.8367499709129333,0.4110860228538513,0.8346666693687439,0.4293495714664459 +189,0.8371666669845581,0.4093056619167328,0.8276666402816772,0.43895062804222107 +190,0.8358333110809326,0.40977051854133606,0.8386666774749756,0.42875438928604126 +191,0.8359166383743286,0.40980789065361023,0.8410000205039978,0.4244656562805176 +192,0.8376666903495789,0.40832388401031494,0.8383333086967468,0.42901018261909485 +193,0.8379999995231628,0.4090903699398041,0.8339999914169312,0.4351048469543457 +194,0.840499997138977,0.40731289982795715,0.8383333086967468,0.42468371987342834 +195,0.8369166851043701,0.40723738074302673,0.8429999947547913,0.4221477508544922 +196,0.8379999995231628,0.4069906771183014,0.843999981880188,0.42132091522216797 +197,0.8375833630561829,0.4065573215484619,0.8413333296775818,0.4236030578613281 +198,0.8385000228881836,0.40566837787628174,0.8433333039283752,0.4220002293586731 +199,0.8375833630561829,0.40544015169143677,0.8403333425521851,0.4219377934932709 +200,0.8396666646003723,0.4040237367153168,0.8356666564941406,0.4344198703765869 +201,0.8389166593551636,0.4050865173339844,0.8403333425521851,0.42142143845558167 +202,0.8419166803359985,0.4029446542263031,0.8416666388511658,0.42275139689445496 +203,0.8383333086967468,0.4023597836494446,0.8423333168029785,0.4203735291957855 +204,0.8392500281333923,0.40254902839660645,0.8420000076293945,0.4188210368156433 +205,0.840416669845581,0.40155965089797974,0.8426666855812073,0.41766902804374695 +206,0.8402500152587891,0.4019468128681183,0.840666651725769,0.4243781864643097 diff --git a/as2_Maggioni_Claudio/src/t1_bonus_01_16.csv b/as2_Maggioni_Claudio/src/t1_bonus_01_16.csv new file mode 100644 index 0000000..5e9efc7 --- /dev/null +++ b/as2_Maggioni_Claudio/src/t1_bonus_01_16.csv @@ -0,0 +1,22 @@ +epoch,accuracy,loss,val_accuracy,val_loss +0,0.41100001335144043,1.0990421772003174,0.5046666860580444,0.986140787601471 +1,0.5824166536331177,0.9083436131477356,0.49966666102409363,1.1090927124023438 +2,0.6570833325386047,0.7929704785346985,0.6413333415985107,0.8897007703781128 +3,0.6971666812896729,0.7256202101707458,0.7279999852180481,0.6892613172531128 +4,0.7409999966621399,0.6392995715141296,0.7876666784286499,0.5518867373466492 +5,0.7586666941642761,0.595727801322937,0.7879999876022339,0.5398681163787842 +6,0.765999972820282,0.5687591433525085,0.7883333563804626,0.5295681953430176 +7,0.7902500033378601,0.5268591642379761,0.7873333096504211,0.5313050746917725 +8,0.7881666421890259,0.5140411853790283,0.8033333420753479,0.5078040361404419 +9,0.8003333210945129,0.4939863681793213,0.7733333110809326,0.5571079850196838 +10,0.8050000071525574,0.48484984040260315,0.8253333568572998,0.4746514558792114 +11,0.8144999742507935,0.46468856930732727,0.7986666560173035,0.5026190876960754 +12,0.8208333253860474,0.4587477743625641,0.8146666884422302,0.47092440724372864 +13,0.8224166631698608,0.4552185833454132,0.8080000281333923,0.48748379945755005 +14,0.8230000138282776,0.4415058493614197,0.8006666898727417,0.5011689066886902 +15,0.8287500143051147,0.4330746531486511,0.8096666932106018,0.48085156083106995 +16,0.828166663646698,0.43311864137649536,0.8116666674613953,0.4814765155315399 +17,0.8344166874885559,0.4186524748802185,0.8213333487510681,0.4748263657093048 +18,0.8352500200271606,0.41888558864593506,0.7846666574478149,0.5632604360580444 +19,0.843666672706604,0.39935922622680664,0.8243333101272583,0.4644140601158142 +20,0.8442500233650208,0.4010440409183502,0.8100000023841858,0.4936281442642212 diff --git a/as2_Maggioni_Claudio/src/t1_bonus_01_64.csv b/as2_Maggioni_Claudio/src/t1_bonus_01_64.csv new file mode 100644 index 0000000..4a4b550 --- /dev/null +++ b/as2_Maggioni_Claudio/src/t1_bonus_01_64.csv @@ -0,0 +1,34 @@ +epoch,accuracy,loss,val_accuracy,val_loss +0,0.3686666786670685,1.2228714227676392,0.49000000953674316,1.0355132818222046 +1,0.5740000009536743,0.9258081316947937,0.6809999942779541,0.7483968138694763 +2,0.6480000019073486,0.8203122019767761,0.5013333559036255,1.076539158821106 +3,0.7013333439826965,0.703206479549408,0.7776666879653931,0.5626736879348755 +4,0.7287499904632568,0.6631432175636292,0.7706666588783264,0.559110701084137 +5,0.7475833296775818,0.6060731410980225,0.6549999713897705,0.8372300863265991 +6,0.7550833225250244,0.5816248655319214,0.7929999828338623,0.5178568363189697 +7,0.7753333449363708,0.5454885959625244,0.7696666717529297,0.5542431473731995 +8,0.7870000004768372,0.5182647109031677,0.796999990940094,0.4952922761440277 +9,0.7987499833106995,0.5003635287284851,0.8059999942779541,0.494720458984375 +10,0.8073333501815796,0.48458853363990784,0.8113333582878113,0.47935450077056885 +11,0.8107500076293945,0.4713839888572693,0.7889999747276306,0.5396782755851746 +12,0.8218333125114441,0.4507473409175873,0.8146666884422302,0.4668084383010864 +13,0.8296666741371155,0.4340798258781433,0.8193333148956299,0.4502803683280945 +14,0.8324166536331177,0.42343637347221375,0.8193333148956299,0.48487967252731323 +15,0.8372499942779541,0.4068948030471802,0.7996666431427002,0.49272286891937256 +16,0.8428333401679993,0.4035722315311432,0.8119999766349792,0.47965121269226074 +17,0.8485000133514404,0.39331746101379395,0.8163333535194397,0.4844145178794861 +18,0.8524166941642761,0.3779684603214264,0.8173333406448364,0.4811861515045166 +19,0.8514166474342346,0.38542646169662476,0.815666675567627,0.4602762758731842 +20,0.8569166660308838,0.3612472414970398,0.7670000195503235,0.5996257066726685 +21,0.8636666536331177,0.35209357738494873,0.8176666498184204,0.478706955909729 +22,0.8675833344459534,0.3399489223957062,0.8263333439826965,0.46295085549354553 +23,0.8653333187103271,0.3398178219795227,0.812333345413208,0.48238879442214966 +24,0.8755000233650208,0.32959985733032227,0.7943333387374878,0.5647448897361755 +25,0.878166675567627,0.3222483992576599,0.8169999718666077,0.49329763650894165 +26,0.8794999718666077,0.31432077288627625,0.8263333439826965,0.4871461093425751 +27,0.8855000138282776,0.3000155985355377,0.8109999895095825,0.49287939071655273 +28,0.8869166374206543,0.28836581110954285,0.8046666383743286,0.5498819351196289 +29,0.8915833234786987,0.2824133038520813,0.8206666707992554,0.49784693121910095 +30,0.8934999704360962,0.2731992304325104,0.815666675567627,0.5200576782226562 +31,0.9000833630561829,0.2694721519947052,0.8146666884422302,0.5229155421257019 +32,0.9021666646003723,0.255941778421402,0.7973333597183228,0.6015266180038452 diff --git a/as2_Maggioni_Claudio/src/t1_bouns_0001_64.csv b/as2_Maggioni_Claudio/src/t1_bouns_0001_64.csv new file mode 100644 index 0000000..e00aaf6 --- /dev/null +++ b/as2_Maggioni_Claudio/src/t1_bouns_0001_64.csv @@ -0,0 +1,148 @@ +epoch,accuracy,loss,val_accuracy,val_loss +0,0.42133334279060364,1.092440128326416,0.5216666460037231,1.0831907987594604 +1,0.48258334398269653,1.0691678524017334,0.578000009059906,1.0515673160552979 +2,0.5686666369438171,1.0266000032424927,0.6179999709129333,0.9952982664108276 +3,0.6392499804496765,0.962194561958313,0.6690000295639038,0.9293439388275146 +4,0.6725000143051147,0.8931296467781067,0.6743333339691162,0.8646112680435181 +5,0.6887500286102295,0.8338881731033325,0.6893333196640015,0.8154566884040833 +6,0.6955000162124634,0.7897202372550964,0.6940000057220459,0.7788802981376648 +7,0.7021666765213013,0.7585954070091248,0.7016666531562805,0.7553337216377258 +8,0.7095000147819519,0.7358428835868835,0.7093333601951599,0.7391981482505798 +9,0.7130833268165588,0.7185309529304504,0.7113333344459534,0.7247134447097778 +10,0.7210000157356262,0.7036754488945007,0.7170000076293945,0.7144900560379028 +11,0.7225000262260437,0.6903489828109741,0.7210000157356262,0.7021248936653137 +12,0.7294999957084656,0.6791210174560547,0.7263333201408386,0.6896677017211914 +13,0.7315833568572998,0.6669951677322388,0.731333315372467,0.6810266971588135 +14,0.7365000247955322,0.6564996838569641,0.7366666793823242,0.6689144372940063 +15,0.7398333549499512,0.6476236581802368,0.7396666407585144,0.6566316485404968 +16,0.7418333292007446,0.639543890953064,0.7443333268165588,0.6492511034011841 +17,0.7449166774749756,0.6309488415718079,0.7440000176429749,0.6400158405303955 +18,0.7507500052452087,0.622377872467041,0.7490000128746033,0.6308714151382446 +19,0.7514166831970215,0.6148524284362793,0.750333309173584,0.6255932450294495 +20,0.7551666498184204,0.6085936427116394,0.7566666603088379,0.6217103600502014 +21,0.7580000162124634,0.6017386317253113,0.7593333125114441,0.609600841999054 +22,0.7609999775886536,0.5949487090110779,0.7543333172798157,0.6064338088035583 +23,0.7635833621025085,0.5881058573722839,0.7549999952316284,0.6035630106925964 +24,0.7632499933242798,0.5832110047340393,0.7663333415985107,0.5898523926734924 +25,0.7692499756813049,0.5766729116439819,0.765666663646698,0.5871346592903137 +26,0.7705000042915344,0.5713057518005371,0.7730000019073486,0.5790905952453613 +27,0.7727500200271606,0.5663045048713684,0.7736666798591614,0.5738856792449951 +28,0.7745833396911621,0.5610684156417847,0.7773333191871643,0.5671684145927429 +29,0.7770833373069763,0.5563601851463318,0.7760000228881836,0.5635906457901001 +30,0.7768333554267883,0.5514505505561829,0.7836666703224182,0.5566589832305908 +31,0.778166651725769,0.5458187460899353,0.7583333253860474,0.5909481048583984 +32,0.7806666493415833,0.5436875224113464,0.7850000262260437,0.5474307537078857 +33,0.7822499871253967,0.5379191637039185,0.784333348274231,0.5488753914833069 +34,0.7837499976158142,0.5342518091201782,0.7753333449363708,0.5533681511878967 +35,0.7864166498184204,0.5308119058609009,0.7820000052452087,0.5461623668670654 +36,0.7887499928474426,0.5277165770530701,0.781333327293396,0.5409450531005859 +37,0.7874166369438171,0.5240803360939026,0.7893333435058594,0.5401000380516052 +38,0.7885833382606506,0.5225352644920349,0.7910000085830688,0.5266817808151245 +39,0.7888333201408386,0.5176399946212769,0.7926666736602783,0.5274956822395325 +40,0.7893333435058594,0.5159404277801514,0.793666660785675,0.5229296684265137 +41,0.7930833101272583,0.5116210579872131,0.7756666541099548,0.5420834422111511 +42,0.7921666502952576,0.5109115242958069,0.7956666946411133,0.5163940191268921 +43,0.7943333387374878,0.5071904063224792,0.7950000166893005,0.5143405795097351 +44,0.7944166660308838,0.5054174661636353,0.777999997138977,0.528532087802887 +45,0.796999990940094,0.5010374188423157,0.7983333468437195,0.5131596326828003 +46,0.796750009059906,0.5006341934204102,0.7973333597183228,0.509623646736145 +47,0.7987499833106995,0.4990909695625305,0.7993333339691162,0.5073418617248535 +48,0.7978333234786987,0.497801274061203,0.7986666560173035,0.5058290958404541 +49,0.796999990940094,0.49675676226615906,0.7986666560173035,0.5052936673164368 +50,0.7978333234786987,0.49446648359298706,0.7906666398048401,0.5101428627967834 +51,0.7987499833106995,0.49141305685043335,0.7910000085830688,0.5080826878547668 +52,0.8018333315849304,0.49017277359962463,0.8009999990463257,0.5003789067268372 +53,0.7990833520889282,0.4900963008403778,0.8003333210945129,0.5013912916183472 +54,0.8021666407585144,0.48861438035964966,0.7983333468437195,0.500831127166748 +55,0.8028333187103271,0.4864603281021118,0.7979999780654907,0.5079330205917358 +56,0.8043333292007446,0.48527541756629944,0.8059999942779541,0.49590444564819336 +57,0.8024166822433472,0.4850764274597168,0.800000011920929,0.4999690353870392 +58,0.8036666512489319,0.4833196997642517,0.8016666769981384,0.4955070912837982 +59,0.8026666641235352,0.4804866909980774,0.7950000166893005,0.5002061128616333 +60,0.8040000200271606,0.48245230317115784,0.7979999780654907,0.4973487854003906 +61,0.8060833215713501,0.47835856676101685,0.7910000085830688,0.5042082071304321 +62,0.8060833215713501,0.4784422516822815,0.8046666383743286,0.4913029670715332 +63,0.8070833086967468,0.47728076577186584,0.8006666898727417,0.49307548999786377 +64,0.8063333630561829,0.47460415959358215,0.8066666722297668,0.4880809187889099 +65,0.8078333139419556,0.4747520387172699,0.8066666722297668,0.48889628052711487 +66,0.8077499866485596,0.472565233707428,0.8056666851043701,0.49305960536003113 +67,0.8102499842643738,0.47163158655166626,0.796999990940094,0.49961018562316895 +68,0.8096666932106018,0.4724145233631134,0.7990000247955322,0.4905402958393097 +69,0.8109999895095825,0.4715333580970764,0.8080000281333923,0.48410794138908386 +70,0.8112499713897705,0.4680226147174835,0.7996666431427002,0.4916672706604004 +71,0.8115000128746033,0.4687725007534027,0.7926666736602783,0.49787065386772156 +72,0.809333324432373,0.46770256757736206,0.7903333306312561,0.5011722445487976 +73,0.812583327293396,0.46606460213661194,0.7983333468437195,0.503963053226471 +74,0.8112499713897705,0.46567845344543457,0.800000011920929,0.4879962205886841 +75,0.8104166388511658,0.4644148051738739,0.8100000023841858,0.48002851009368896 +76,0.812583327293396,0.46399056911468506,0.7940000295639038,0.4991711378097534 +77,0.8144999742507935,0.4620969295501709,0.7933333516120911,0.5001674294471741 +78,0.8134999871253967,0.4626724123954773,0.7929999828338623,0.4932369887828827 +79,0.8146666884422302,0.460686594247818,0.8086666464805603,0.4793894588947296 +80,0.812416672706604,0.4595262408256531,0.8076666593551636,0.47897687554359436 +81,0.8136666417121887,0.4590204954147339,0.8090000152587891,0.4824315309524536 +82,0.8130833506584167,0.45829853415489197,0.8023333549499512,0.4803754389286041 +83,0.8135833144187927,0.4585408866405487,0.7993333339691162,0.48915770649909973 +84,0.8139166831970215,0.45737844705581665,0.8063333630561829,0.478768527507782 +85,0.8145833611488342,0.4551144540309906,0.8119999766349792,0.47424080967903137 +86,0.8160833120346069,0.4543878138065338,0.8043333292007446,0.4808327257633209 +87,0.815500020980835,0.4546371400356293,0.7929999828338623,0.49613329768180847 +88,0.8178333044052124,0.452690064907074,0.793666660785675,0.4978523850440979 +89,0.8176666498184204,0.45260632038116455,0.8083333373069763,0.473687082529068 +90,0.8181666731834412,0.45101451873779297,0.8113333582878113,0.4717951714992523 +91,0.8173333406448364,0.44956472516059875,0.7873333096504211,0.5036012530326843 +92,0.8181666731834412,0.4505072832107544,0.809333324432373,0.4718765318393707 +93,0.8172500133514404,0.44963616132736206,0.8133333325386047,0.4736625850200653 +94,0.8174999952316284,0.44907307624816895,0.8086666464805603,0.4760723412036896 +95,0.8183333277702332,0.44802454113960266,0.8143333196640015,0.4659152925014496 +96,0.8210833072662354,0.44540080428123474,0.8140000104904175,0.4660656750202179 +97,0.8184999823570251,0.44517073035240173,0.8090000152587891,0.47440412640571594 +98,0.8190833330154419,0.4435581564903259,0.8116666674613953,0.4662642478942871 +99,0.8191666603088379,0.4437412619590759,0.8113333582878113,0.46899935603141785 +100,0.8198333382606506,0.4438643753528595,0.8119999766349792,0.4680798351764679 +101,0.8211666941642761,0.4421640932559967,0.809333324432373,0.47763219475746155 +102,0.8232499957084656,0.44070789217948914,0.8043333292007446,0.4799812138080597 +103,0.8194166421890259,0.4401479959487915,0.8169999718666077,0.4607376158237457 +104,0.8226666450500488,0.43788206577301025,0.8100000023841858,0.47571948170661926 +105,0.8213333487510681,0.43839383125305176,0.8083333373069763,0.47257283329963684 +106,0.8237500190734863,0.43844300508499146,0.815666675567627,0.4606480002403259 +107,0.8240000009536743,0.4366362988948822,0.8166666626930237,0.4585273563861847 +108,0.8228333592414856,0.4356010854244232,0.815666675567627,0.46260562539100647 +109,0.8233333230018616,0.43673983216285706,0.8176666498184204,0.4602668583393097 +110,0.8244166374206543,0.43422600626945496,0.8046666383743286,0.4769958555698395 +111,0.824999988079071,0.4336869716644287,0.815666675567627,0.4593796730041504 +112,0.8234166502952576,0.4329100251197815,0.8169999718666077,0.45982375741004944 +113,0.8238333463668823,0.433053195476532,0.8153333067893982,0.46611258387565613 +114,0.8245000243186951,0.43201497197151184,0.8146666884422302,0.4649088680744171 +115,0.8239166736602783,0.4307296574115753,0.8216666579246521,0.4549351930618286 +116,0.8255000114440918,0.42951807379722595,0.8183333277702332,0.45752355456352234 +117,0.8259999752044678,0.4283323884010315,0.8140000104904175,0.4559498429298401 +118,0.8255000114440918,0.42872533202171326,0.8186666369438171,0.4583792984485626 +119,0.8254166841506958,0.4287734925746918,0.8213333487510681,0.4525021016597748 +120,0.828083336353302,0.4269919693470001,0.8190000057220459,0.46076494455337524 +121,0.8288333415985107,0.4257391691207886,0.8223333358764648,0.4512419104576111 +122,0.8274999856948853,0.42528149485588074,0.8206666707992554,0.4504532814025879 +123,0.8293333053588867,0.4251134395599365,0.8090000152587891,0.4624386429786682 +124,0.8273333311080933,0.4244207739830017,0.8206666707992554,0.4510117471218109 +125,0.8285833597183228,0.42328396439552307,0.8236666917800903,0.4477689564228058 +126,0.8275833129882812,0.4221431612968445,0.8196666836738586,0.45398926734924316 +127,0.8274166584014893,0.4219974875450134,0.8230000138282776,0.4463694989681244 +128,0.8289999961853027,0.41993024945259094,0.8223333358764648,0.4483242630958557 +129,0.8305833339691162,0.42024698853492737,0.8246666789054871,0.4452638328075409 +130,0.82833331823349,0.4210645258426666,0.8243333101272583,0.44850248098373413 +131,0.8319166898727417,0.4177602529525757,0.8183333277702332,0.4571416974067688 +132,0.8308333158493042,0.4185762405395508,0.8270000219345093,0.4429197311401367 +133,0.8321666717529297,0.41506490111351013,0.8186666369438171,0.4541434645652771 +134,0.831333339214325,0.4172920286655426,0.815666675567627,0.451259046792984 +135,0.8327500224113464,0.4152548909187317,0.8220000267028809,0.45755550265312195 +136,0.8314999938011169,0.4155958592891693,0.8286666870117188,0.44321802258491516 +137,0.8326666951179504,0.4142398238182068,0.8273333311080933,0.44350680708885193 +138,0.8325833082199097,0.41387006640434265,0.8149999976158142,0.46105799078941345 +139,0.8331666588783264,0.41399452090263367,0.82833331823349,0.43895357847213745 +140,0.8357499837875366,0.4125574231147766,0.8109999895095825,0.47140923142433167 +141,0.8305833339691162,0.41198986768722534,0.824999988079071,0.44698140025138855 +142,0.8334166407585144,0.4109375774860382,0.8230000138282776,0.4436701536178589 +143,0.8343333601951599,0.4101341962814331,0.8073333501815796,0.4800421893596649 +144,0.8331666588783264,0.4099189341068268,0.8226666450500488,0.44883304834365845 +145,0.8347499966621399,0.40960660576820374,0.8163333535194397,0.44911980628967285 +146,0.8336666822433472,0.4076492190361023,0.8286666870117188,0.4369546175003052 diff --git a/as2_Maggioni_Claudio/src/my_vgg16_aug.csv b/as2_Maggioni_Claudio/src/t2_aug.csv similarity index 100% rename from as2_Maggioni_Claudio/src/my_vgg16_aug.csv rename to as2_Maggioni_Claudio/src/t2_aug.csv diff --git a/as2_Maggioni_Claudio/src/my_vgg16_noaug.csv b/as2_Maggioni_Claudio/src/t2_noaug.csv similarity index 100% rename from as2_Maggioni_Claudio/src/my_vgg16_noaug.csv rename to as2_Maggioni_Claudio/src/t2_noaug.csv diff --git a/as2_Maggioni_Claudio/src/t_test_bonus.py b/as2_Maggioni_Claudio/src/t_test_bonus.py new file mode 100644 index 0000000..724ca3f --- /dev/null +++ b/as2_Maggioni_Claudio/src/t_test_bonus.py @@ -0,0 +1,22 @@ +import joblib +import numpy as np +from keras import models +import scipy.stats + +# Import the accuracy of both models +e_a = 0.856333315372467 # without augmentation +e_b = 0.843666672706604 # with data augmentation + +# # of data points in both test sets +L = 3000 + +# Compute classification variance for both models +s_a = e_a * (1 - e_a) +s_b = e_b * (1 - e_b) + +# Compute Student's T-test +T = (e_a - e_b) / np.sqrt((s_a / L) + (s_b / L)) +print("T test:\t\t\t %1.06f" % T) +print("P-value:\t\t %1.06f" % (scipy.stats.t.sf(abs(T), df=L) * 2)) +print("No aug variance:\t %1.06f" % s_a) +print("With aug variance:\t %1.06f" % s_b) diff --git a/as2_Maggioni_Claudio/t1_bonus_0001_16.png b/as2_Maggioni_Claudio/t1_bonus_0001_16.png new file mode 100644 index 0000000..910e825 Binary files /dev/null and b/as2_Maggioni_Claudio/t1_bonus_0001_16.png differ diff --git a/as2_Maggioni_Claudio/t1_bonus_0001_64.png b/as2_Maggioni_Claudio/t1_bonus_0001_64.png new file mode 100644 index 0000000..ebf8608 Binary files /dev/null and b/as2_Maggioni_Claudio/t1_bonus_0001_64.png differ diff --git a/as2_Maggioni_Claudio/t1_bonus_01_16.png b/as2_Maggioni_Claudio/t1_bonus_01_16.png new file mode 100644 index 0000000..cb55673 Binary files /dev/null and b/as2_Maggioni_Claudio/t1_bonus_01_16.png differ diff --git a/as2_Maggioni_Claudio/t1_bonus_01_64.png b/as2_Maggioni_Claudio/t1_bonus_01_64.png new file mode 100644 index 0000000..77f64e6 Binary files /dev/null and b/as2_Maggioni_Claudio/t1_bonus_01_64.png differ diff --git a/as2_Maggioni_Claudio/t1_plot.png b/as2_Maggioni_Claudio/t1_plot.png index a02bab6..ef1f3fb 100644 Binary files a/as2_Maggioni_Claudio/t1_plot.png and b/as2_Maggioni_Claudio/t1_plot.png differ diff --git a/as2_Maggioni_Claudio/t2_aug.png b/as2_Maggioni_Claudio/t2_aug.png index 84f2b99..2b486c6 100644 Binary files a/as2_Maggioni_Claudio/t2_aug.png and b/as2_Maggioni_Claudio/t2_aug.png differ diff --git a/as2_Maggioni_Claudio/t2_noaug.png b/as2_Maggioni_Claudio/t2_noaug.png index 04e5d51..93fa351 100644 Binary files a/as2_Maggioni_Claudio/t2_noaug.png and b/as2_Maggioni_Claudio/t2_noaug.png differ