
% Any copyright is dedicated to the Public Domain.
% https://creativecommons.org/publicdomain/zero/1.0/

% Written by Francois Fleuret <francois@fleuret.org>

\documentclass[11pt,a4paper,twoside]{article}
\usepackage{amsmath,amssymb,dsfont}
\usepackage[pdftex]{graphicx}

\usepackage{tikz}
\usetikzlibrary{arrows,arrows.meta,calc}
\usetikzlibrary{patterns}

\tikzset{>={Straight Barb[angle'=80,scale=1.2]}}
\tikzset{axes/.style={
    samples=1000,
    smooth,
    scale=0.8,
  }
}

\usepackage{pgfplots}
\usepgfplotslibrary{patchplots,colormaps}
\pgfplotsset{compat = newest}

  \def\nbsamplesgd{31}
  \def\nbsamplesgdlevelcurves{51}

\begin{document}

\begin{figure}
\center

\begin{tikzpicture}[axes,scale=0.95]
\begin{axis} [
    width=8cm, height=8cm,
    view={0}{90},
    domain=0:6,
    xmin=0, xmax=6, ymin=0, ymax=6, clip=true,
    trig format plots=rad,
    xtick style={draw=none},
    ytick style={draw=none},
    ztick style={draw=none},
    xticklabel = \empty,
    yticklabel = \empty,
    zticklabel = \empty,
    zmin=-2,
    xlabel = $w$, ylabel = \empty, zlabel = $\mathcal{L}(w)$,
    ylabel style = { rotate=-90 },
    point meta max=50,
    point meta min=0,
]
\addplot3 [
  samples=\nbsamplesgdlevelcurves,
  samples y=\nbsamplesgdlevelcurves,
  contour gnuplot={
    number=31,%levels={-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9},
    labels=false,
    draw color=black!40,
    handler/.style=smooth,
  },
] {
  y*y + (x-3.1415926)*(x-3.1415926)
  + 18*exp(-0.5*((x-5)*(x-5)+(y-1)*(y-1)))
  + 12*exp(-0.5*((x-1.5)*(x-1.5)+(y-3)*(y-3)))
  - 3 *exp(-1.5*((x-3)*(x-3)+(y-1)*(y-1)))
};
%\immediate\write18{src/gradient.py --fig=2 --filename=src/gradient_field.tex}
%\input{src/gradient_field.tex}
\addplot[blue,very thin,quiver={u=\thisrow{u},v=\thisrow{v}},-stealth]
table
{
x y u v
0.1174235213547945 0.022089432226493955 -0.18484704196453094 0.00582113629207015
0.11588682420551777 0.32586567755788565 -0.18177364766597748 0.029847579076886177
0.11274994350969791 0.6277568936347961 -0.17549988627433777 0.057644009590148926
0.10704087652266026 0.927454736083746 -0.16408175230026245 0.08982724696397781
0.09782464988529682 1.225526325404644 -0.14564929902553558 0.12526299059391022
0.084731949493289 1.5238749012351036 -0.11946389824151993 0.16014476120471954
0.068579426035285 1.8255885541439056 -0.08715885132551193 0.188296377658844
0.0517025925219059 2.133843407034874 -0.05340518429875374 0.20336583256721497
0.0376017764210701 2.450169377028942 -0.025203552097082138 0.2022928148508072
0.029822340235114098 2.773103065788746 -0.009644679725170135 0.18800435960292816
0.030520093627274036 3.0983169451355934 -0.011040186509490013 0.1691555231809616
0.03949661739170551 3.420433260500431 -0.028993234038352966 0.15650181472301483
0.05429024435579777 3.735493890941143 -0.058580487966537476 0.1579594761133194
0.07126650400459766 4.042547337710857 -0.09253300726413727 0.175431028008461
0.08705186657607555 4.343499734997749 -0.12410373240709305 0.20510563254356384
0.09954863227903843 4.641621150076389 -0.1490972638130188 0.2404422014951706
0.10816287435591221 4.9398598819971085 -0.16632574796676636 0.2755431830883026
0.11339609511196613 5.239896818995476 -0.1767921894788742 0.3070487082004547
0.11621841974556446 5.542121157050133 -0.18243683874607086 0.33417943120002747
0.11757604964077473 5.846140414476395 -0.1851520985364914 0.357719361782074
0.423524871468544 0.020973647013306618 -0.16547080874443054 0.008052706718444824
0.421693317592144 0.32344064489006996 -0.16180770099163055 0.03469764441251755
0.4179566204547882 0.6230503469705582 -0.15433430671691895 0.06705710291862488
0.41115594655275345 0.9193350672721863 -0.14073295891284943 0.10606658458709717
0.400176826864481 1.2131547257304192 -0.11877471953630447 0.15000618994235992
0.3845798224210739 1.507394514977932 -0.08758071064949036 0.1931055337190628
0.3653387352824211 1.8067351132631302 -0.04909853637218475 0.2260032594203949
0.3452359545044601 2.1159903407096863 -0.008892974816262722 0.23907196521759033
0.3284405702725053 2.4374791979789734 0.024697793647646904 0.22767317295074463
0.3191752787679434 2.7689836025238037 0.043228376656770706 0.1962432861328125
0.32000790908932686 3.103944294154644 0.041563116014003754 0.1579008251428604
0.33070207946002483 3.4342098459601402 0.020174775272607803 0.1289486438035965
0.34832555148750544 3.7537806630134583 -0.015072168782353401 0.12138593196868896
0.3685488346964121 4.061214596033096 -0.0555187352001667 0.13809651136398315
0.3873533494770527 4.359400525689125 -0.0931277647614479 0.17330405116081238
0.40224023163318634 4.65329534560442 -0.12290152907371521 0.2170938104391098
0.4125020280480385 4.947368249297142 -0.1434251219034195 0.2605264484882355
0.41873613744974136 5.2441665679216385 -0.15589334070682526 0.2985092103481293
0.4220982640981674 5.544280514121056 -0.16261759400367737 0.32986071705818176
0.4237155467271805 5.847115397453308 -0.1658521592617035 0.35576939582824707
0.7298176512122154 0.019753662403672934 -0.14647750556468964 0.010492675937712193
0.727997712790966 0.3207937516272068 -0.14283762872219086 0.039991430938243866
0.7242819145321846 0.6179106496274471 -0.135406032204628 0.07733649760484695
0.7175017185509205 0.9104608818888664 -0.12184564024209976 0.12381495535373688
0.7065367214381695 1.1996287107467651 -0.09991564601659775 0.17705821990966797
0.6909541301429272 1.4893776252865791 -0.06875046342611313 0.2291393131017685
0.6717382427304983 1.7861283421516418 -0.030318688601255417 0.2672168016433716
0.6516717718914151 2.096480503678322 0.009814253076910973 0.2780916392803192
0.6349129863083363 2.4236133992671967 0.043331824243068695 0.2554047703742981
0.6256716549396515 2.7644847482442856 0.06181448698043823 0.20524099469184875
0.6265081968158484 3.110097236931324 0.06014140322804451 0.14559493958950043
0.6371861919760704 3.4492687173187733 0.0387854129076004 0.09883090108633041
0.6547792935743928 3.7737684100866318 0.00359920971095562 0.08141043782234192
0.6749665457755327 4.081617850810289 -0.036775294691324234 0.09729000180959702
0.6937371455132961 4.376779921352863 -0.07431649416685104 0.13854525983333588
0.7085970491170883 4.666055046021938 -0.10403630137443542 0.19157440960407257
0.7188401855528355 4.955574743449688 -0.12452257424592972 0.24411346018314362
0.7250629514455795 5.248833328485489 -0.13696810603141785 0.28917568922042847
0.7284189537167549 5.546640649437904 -0.14368011057376862 0.32514044642448425
0.7300332933664322 5.848181024193764 -0.14690878987312317 0.3536381423473358
1.0363909229636192 0.01868997933343053 -0.12804512679576874 0.012620042078197002
1.0350737795233727 0.3184851221740246 -0.12541083991527557 0.04460868984460831
1.0323136784136295 0.6133765354752541 -0.11989063769578934 0.0864047259092331
1.0271144397556782 0.9025535583496094 -0.10949216037988663 0.13962960243225098
1.018548123538494 1.1875258460640907 -0.0923595279455185 0.20126394927501678
1.0063207559287548 1.4732601344585419 -0.06790479272603989 0.261374294757843
0.9912877790629864 1.7677260488271713 -0.03783883899450302 0.3040213882923126
0.9756566977594048 2.0790842324495316 -0.00657667638733983 0.3128841817378998
0.9626429127529263 2.41126249730587 0.019450893625617027 0.2801065742969513
0.9554850626736879 2.760486051440239 0.03376659378409386 0.21323838829994202
0.956153504550457 3.1155917942523956 0.032429710030555725 0.13460582494735718
0.964459934271872 3.462699916213751 0.01581685058772564 0.07196850329637527
0.97813237644732 3.7915916685014963 -0.011528033763170242 0.04576392099261284
0.9938165657222271 4.099810216575861 -0.04289641231298447 0.06090527027845383
1.0083985887467861 4.392275590449572 -0.07206045836210251 0.10755392163991928
1.0199420563876629 4.677431605756283 -0.09514739364385605 0.1688212901353836
1.0278989672660828 4.962891608476639 -0.1110612154006958 0.22947973012924194
1.0327327959239483 5.252994179725647 -0.12072887271642685 0.2808539867401123
1.0353397130966187 5.5487449169158936 -0.12594270706176758 0.32093191146850586
1.036593720316887 5.849131137132645 -0.12845072150230408 0.351737916469574
1.3433643616735935 0.01820527482777834 -0.1104130819439888 0.013589451089501381
1.343337569385767 0.31735384836792946 -0.11035949736833572 0.04687123745679855
1.342792171984911 0.6107933335006237 -0.10926870256662369 0.0915711298584938
1.340813547372818 0.897551953792572 -0.10531145334243774 0.14963281154632568
1.33668302744627 1.1795571148395538 -0.09705041348934174 0.21720141172409058
1.3304876424372196 1.4626562148332596 -0.084659643471241 0.2825821340084076
1.32308953627944 1.7557951509952545 -0.06986343115568161 0.32788318395614624
1.315735649317503 2.067952573299408 -0.05515565723180771 0.335147500038147
1.3098162673413754 2.4034255892038345 -0.04331689327955246 0.29578039050102234
1.3066397178918123 2.7579806819558144 -0.03696379438042641 0.2182491272687912
1.3070017360150814 3.119117110967636 -0.03768783062696457 0.12755519151687622
1.310790117830038 3.4712625220417976 -0.0452645942568779 0.05484329164028168
1.3169810846447945 3.802940116263926 -0.057646527886390686 0.02306702546775341
1.3240682408213615 4.111388811841607 -0.07182084023952484 0.037748079746961594
1.3306521587073803 4.40213618054986 -0.08498867601156235 0.0878327414393425
1.3358623795211315 4.6846704706549644 -0.09540911763906479 0.15434356033802032
1.3394532352685928 4.96754714846611 -0.10259082913398743 0.22016865015029907
1.3416345156729221 5.255641579627991 -0.10695338994264603 0.2755591869354248
1.342810858041048 5.550083786249161 -0.10930607467889786 0.31825417280197144
1.343376699835062 5.849735647439957 -0.11043775826692581 0.35052889585494995
1.6509489193558693 0.019061933271586895 -0.09400327503681183 0.01187613420188427
1.653587568551302 0.3187377545982599 -0.09928057342767715 0.04410342499613762
1.6570525951683521 0.6117626428604126 -0.1062106266617775 0.08963251113891602
1.6597077511250973 0.8969056010246277 -0.11152093857526779 0.15092551708221436
1.6605658940970898 1.1770962178707123 -0.11323722451925278 0.22212320566177368
1.6605690270662308 1.459395945072174 -0.11324349045753479 0.2891026735305786
1.661427490413189 1.7528700828552246 -0.11496041715145111 0.33373332023620605
1.663658868521452 2.0658551156520844 -0.11942317336797714 0.3393424153327942
1.6663166657090187 2.402229458093643 -0.12473876774311066 0.29817265272140503
1.66807471960783 2.75771264731884 -0.12825487554073334 0.21878519654273987
1.66812065243721 3.119766317307949 -0.1283467411994934 0.1262567788362503
1.6663847714662552 3.472655862569809 -0.12487497925758362 0.05205661058425903
1.6633784733712673 3.8047383688390255 -0.11886238306760788 0.019470520317554474
1.659880306571722 4.113206664100289 -0.1118660494685173 0.03411237522959709
1.6566104516386986 4.403678499162197 -0.1053263396024704 0.08474810421466827
1.654016014188528 4.685800842940807 -0.10013746470212936 0.15208281576633453
1.6522258035838604 4.9682735577225685 -0.09655704349279404 0.2187158316373825
1.6511377096176147 5.256054475903511 -0.09438085556030273 0.27473339438438416
1.6505507454276085 5.550292551517487 -0.09320692718029022 0.3178366422653198
1.6502683646976948 5.849829912185669 -0.0926421657204628 0.3503403663635254
1.9588069841265678 0.02244938537478447 -0.07814048230648041 0.0051012299954891205
1.9657829590141773 0.32460276409983635 -0.09209243208169937 0.03237340599298477
1.9752332754433155 0.6180721893906593 -0.11099306493997574 0.07701341807842255
1.9833145216107368 0.9009987339377403 -0.12715555727481842 0.14273925125598907
1.9877958819270134 1.17901162058115 -0.13611827790737152 0.21829240024089813
1.9911257177591324 1.4619801938533783 -0.1427779495716095 0.28393417596817017
1.9973722398281097 1.7581532001495361 -0.1552709937095642 0.323167085647583
2.007235959172249 2.0728047490119934 -0.1749984323978424 0.3254431486129761
2.0174618661403656 2.4080150723457336 -0.19545024633407593 0.2866014242172241
2.023835204541683 2.759913846850395 -0.20819692313671112 0.21438279747962952
2.023778572678566 3.1174862906336784 -0.20808365941047668 0.13081683218479156
2.0171684622764587 3.466561295092106 -0.1948634386062622 0.06424574553966522
2.0059075579047203 3.7965133357793093 -0.17234162986278534 0.03592058643698692
1.9928633272647858 4.104763498529792 -0.14625316858291626 0.05099870637059212
1.9806910492479801 4.396470379084349 -0.12190861254930496 0.09916434437036514
1.971040040254593 4.6805034428834915 -0.10260659456253052 0.1626776158809662
1.9643828198313713 4.9648649245500565 -0.08929215371608734 0.22553309798240662
1.9603371806442738 5.2541156858205795 -0.08120087534189224 0.2786109745502472
1.9581549726426601 5.549311935901642 -0.07683645933866501 0.3197978734970093
1.957105178385973 5.849387124180794 -0.07473687082529068 0.35122594237327576
2.2640746105462313 0.02893721219152212 -0.05709657445549965 -0.007874423637986183
2.274877931922674 0.33608679194003344 -0.07870321720838547 0.009405350312590599
2.2897686660289764 0.6304722186177969 -0.10848468542098999 0.052213359624147415
2.302200175821781 0.9089371040463448 -0.13334770500659943 0.1268625110387802
2.308284819126129 1.1825374066829681 -0.1455169916152954 0.21124082803726196
2.312060445547104 1.4668133705854416 -0.15306824445724487 0.2742678225040436
2.3204368352890015 1.7684001326560974 -0.16982102394104004 0.30267322063446045
2.334858663380146 2.0864465534687042 -0.19866468012332916 0.29815953969955444
2.3503062948584557 2.4194509238004684 -0.22955994307994843 0.2637297213077545
2.3602065667510033 2.7643708512187004 -0.24936048686504364 0.2054687887430191
2.360574334859848 3.113205172121525 -0.25009602308273315 0.13937906920909882
2.3511970788240433 3.4548441506922245 -0.23134151101112366 0.08768003433942795
2.334898456931114 3.7806386202573776 -0.1987442672252655 0.06767001748085022
2.3159187510609627 4.088447034358978 -0.16078485548496246 0.08363163471221924
2.2981730550527573 4.382533580064774 -0.12529346346855164 0.12703794240951538
2.284091353416443 4.670258745551109 -0.09713006019592285 0.1831670105457306
2.2743741907179356 4.958272233605385 -0.07769573479890823 0.23871847987174988
2.2684679366648197 5.250365629792213 -0.06588322669267654 0.28611108660697937
2.265281841158867 5.547415152192116 -0.059511035680770874 0.3235914409160614
2.2637490406632423 5.848530635237694 -0.05644543468952179 0.3529389202594757
2.5605842787772417 0.03578091040253639 -0.018536988645792007 -0.021561820060014725
2.568993339315057 0.3496815050020814 -0.035355109721422195 -0.017784075811505318
2.582444854080677 0.6456587063148618 -0.06225813925266266 0.021840384230017662
2.594727899879217 0.9186956845223904 -0.08682423084974289 0.107345350086689
2.602081511169672 1.186878852546215 -0.10153145343065262 0.20255793631076813
2.6085487082600594 1.4731573462486267 -0.11446584761142731 0.26157987117767334
2.6207658275961876 1.7820202857255936 -0.13890008628368378 0.27543291449546814
2.639487013220787 2.1046081483364105 -0.1763424575328827 0.26183634996414185
2.6588002368807793 2.4348362013697624 -0.21496890485286713 0.23295916616916656
2.6714284792542458 2.7708501890301704 -0.2402253895998001 0.19251011312007904
2.673101544380188 3.1085803881287575 -0.24357151985168457 0.14862863719463348
2.6637350618839264 3.4407991357147694 -0.22483855485916138 0.11577006429433823
2.6465502083301544 3.7613071389496326 -0.19046884775161743 0.10633298009634018
2.626268833875656 4.0684766955673695 -0.14990609884262085 0.12357231229543686
2.6072134487330914 4.365441396832466 -0.1117953285574913 0.16122230887413025
2.5920613557100296 4.657683439552784 -0.0814911425113678 0.2083176225423813
2.581595778465271 4.950176402926445 -0.060559988021850586 0.2549101412296295
2.5752317998558283 5.2457596361637115 -0.047832030802965164 0.29532307386398315
2.571798037737608 5.545085221529007 -0.040964506566524506 0.32825130224227905
2.5701459106057882 5.847478523850441 -0.037660252302885056 0.3550431430339813
2.8438776955008507 0.0357024222612381 0.04645510017871857 -0.021404843777418137
2.8396048583090305 0.35551955085247755 0.055000774562358856 -0.02946016751229763
2.840353600680828 0.655085051083006 0.05350328981876373 0.0029876946937292814
2.845965903252363 0.9277078434824944 0.04227868467569351 0.08932103216648102
2.856283268891275 1.1957791522145271 0.021643953397870064 0.18475733697414398
2.872577774338424 1.48661058396101 -0.01094505749642849 0.2346733957529068
2.8953853510320187 1.8022639602422714 -0.0565602108836174 0.23494556546211243
2.921668838709593 2.1276449486613274 -0.10912718623876572 0.21576274931430817
2.9454349130392075 2.453504167497158 -0.156659334897995 0.1956232339143753
2.960877276957035 2.779535159468651 -0.1875440627336502 0.1751401722431183
2.964939810335636 3.105493910610676 -0.19566912949085236 0.15480159223079681
2.9580859765410423 3.4278891310095787 -0.18196146190166473 0.14159007370471954
2.9435835480690002 3.7428549230098724 -0.15295660495758057 0.1432374119758606
2.9259287156164646 4.049191996455193 -0.11764694005250931 0.16214171051979065
2.909158792346716 4.348860561847687 -0.08410709351301193 0.19438397884368896
2.895763063803315 4.645459987223148 -0.0573156364262104 0.23276452720165253
2.8864915035665035 4.942299857735634 -0.03877251595258713 0.27066323161125183
2.8808480743318796 5.241276413202286 -0.02748565748333931 0.3042895197868347
2.877801642753184 5.5428168922662735 -0.02139279432594776 0.33278796076774597
2.876335528679192 5.846454098820686 -0.01846056617796421 0.3570919930934906
3.1183702275156975 0.021372451446950436 0.12904895842075348 0.007255097851157188
3.095810145139694 0.34380417643114924 0.17416912317276 -0.006029418669641018
3.0779551044106483 0.6504818904213607 0.20987920463085175 0.012194016017019749
3.0735107511281967 0.9339725971221924 0.218767911195755 0.07679152488708496
3.087599128484726 1.2138942033052444 0.19059115648269653 0.14852723479270935
3.1173681765794754 1.514020413160324 0.13105306029319763 0.17985373735427856
3.1543993912637234 1.833830788731575 0.05699063092470169 0.17181190848350525
3.1902792500332 2.1572980359196663 -0.014769086614251137 0.1564565747976303
3.2192301973700523 2.4757918938994408 -0.07267098128795624 0.15104778110980988
3.237919881939888 2.7909795120358467 -0.11005035042762756 0.1522514671087265
3.245236352086067 3.1054834574460983 -0.12468329071998596 0.15482249855995178
3.2424179166555405 3.4186379089951515 -0.1190464198589325 0.1600925177335739
3.232620406895876 3.7283481806516647 -0.09945140033960342 0.172250896692276
3.219763357192278 4.033628225326538 -0.07373730093240738 0.1932692527770996
3.2072459273040295 4.335344195365906 -0.04870244115591049 0.22141671180725098
3.1971462927758694 4.635452389717102 -0.0285031720995903 0.2527797222137451
3.190124594606459 4.935838237404823 -0.014459775760769844 0.2835864722728729
3.1858415598981082 5.237595051527023 -0.00589370634406805 0.3116522431373596
3.183527111134026 5.540953382849693 -0.0012648088159039617 0.33651497960090637
3.1824126980209257 5.845612317323685 0.0009640174102969468 0.3587755560874939
3.3957631066441536 -0.007867695763707161 0.20584212243556976 0.06573539227247238
3.359545648097992 0.31420078314840794 0.27827703952789307 0.0531773678958416
3.328442230820656 0.631634134799242 0.3404838740825653 0.04988952726125717
3.3166224360466003 0.9370072484016418 0.36412346363067627 0.07072222232818604
3.3323189467191696 1.2403852753341198 0.3327304422855377 0.09554509073495865
3.3701252937316895 1.554500412195921 0.25711774826049805 0.09889373928308487
3.41613283008337 1.8760943748056889 0.16510267555713654 0.08728473633527756
3.458499636501074 2.19327000901103 0.08036906272172928 0.0845126286149025
3.491430484224111 2.5017068944871426 0.01450736727565527 0.09921777993440628
3.513127879239619 2.8055271841585636 -0.028887422755360603 0.1231561228632927
3.5238170959055424 3.1092709079384804 -0.050265856087207794 0.14724759757518768
3.525286838412285 3.414095677435398 -0.05320534110069275 0.16917698085308075
3.520505517721176 3.7190059423446655 -0.04364269971847534 0.19093537330627441
3.512765711173415 4.022970303893089 -0.028163086622953415 0.2145850956439972
3.5047842478379607 4.325881153345108 -0.012200159952044487 0.24034279584884644
3.498200519097736 4.6283800303936005 0.0009672975284047425 0.2669244408607483
3.493578745983541 4.931252270936966 0.01021084375679493 0.29275840520858765
3.4907468408346176 5.234976947307587 0.015874654054641724 0.3168884515762329
3.489213202148676 5.539626806974411 0.018941931426525116 0.33916813135147095
3.4884739508852363 5.84501276910305 0.020420433953404427 0.3599746525287628
3.686312437057495 -0.04554658941924572 0.25632238388061523 0.1410931795835495
3.646377608180046 0.27582237869501114 0.3361920416355133 0.1299341768026352
3.6126232594251633 0.6060931012034416 0.40370073914527893 0.10097159445285797
3.598887398838997 0.9376731216907501 0.4311724603176117 0.06939047574996948
3.6129348278045654 1.2688897531479597 0.4030776023864746 0.038536135107278824
3.64947172999382 1.5991672459058464 0.3300037980079651 0.009560071863234043
3.694974608719349 1.9223528928123415 0.23899804055690765 -0.00523229967802763
3.7376377284526825 2.23216806887649 0.15367180109024048 0.006716508883982897
3.771469373255968 2.529937520623207 0.08600851148366928 0.04275652766227722
3.7946887519210577 2.8226507380604744 0.039569754153490067 0.08890901505947113
3.807756214402616 3.116491124033928 0.01343482919037342 0.1328071653842926
3.8125604952219874 3.413884364068508 0.0038262675516307354 0.16959960758686066
3.8118005378637463 3.714433766901493 0.005346182268112898 0.20007972419261932
3.8082104781642556 4.016850218176842 0.01252630166709423 0.2268252670764923
3.8039254024624825 4.320169746875763 0.021096453070640564 0.2517656087875366
3.800213133916259 4.624025210738182 0.028520990163087845 0.2756340801715851
3.79755343683064 4.928403094410896 0.03384038433432579 0.29845675826072693
3.7959085162729025 5.233343526721001 0.03713022544980049 0.3201552927494049
3.7950137089937925 5.538797438144684 0.0389198400080204 0.3408268690109253
3.79458144120872 5.844637557864189 0.039784375578165054 0.360725075006485
3.995370253920555 -0.08341747336089611 0.26978519558906555 0.21683494746685028
3.9598779529333115 0.23882955312728882 0.34076979756355286 0.20391982793807983
3.93108132481575 0.5818605944514275 0.39836305379867554 0.1494366079568863
3.9192655831575394 0.9371668435633183 0.42199453711509705 0.07040303200483322
3.9298847913742065 1.293352776672691 0.4007561206817627 -0.010389911942183971
3.9591746032238007 1.6389923878014088 0.34217649698257446 -0.07009021192789078
3.9972082376480103 1.9650445878505707 0.2661092281341553 -0.09061568975448608
4.034456349909306 2.269273456186056 0.19161300361156464 -0.06749426573514938
4.065166346728802 2.5577886486425996 0.13019300997257233 -0.012945728376507759
4.087093256413937 2.8405812960118055 0.08633919060230255 0.05304789915680885
4.100379364565015 3.1256677135825157 0.0597669743001461 0.114453986287117
4.1066608894616365 3.4165867790579796 0.047203924506902695 0.16419477760791779
4.1082267221063375 3.7132668793201447 0.04407225921750069 0.20241349935531616
4.107266753911972 4.014048509299755 0.04599219560623169 0.2324286848306656
4.1054133009165525 4.317230716347694 0.049699101597070694 0.2576436698436737
4.103621320798993 4.621688276529312 0.05328306183218956 0.28030794858932495
4.102283814921975 4.926846474409103 0.05595807358622551 0.30156999826431274
4.101441698148847 5.232443675398827 0.05764230713248253 0.32195499539375305
4.100979739800096 5.538338705897331 0.058566223829984665 0.3417443335056305
4.100755658000708 5.84442962706089 0.05901438742876053 0.3611409366130829
4.325206495821476 -0.11484137736260891 0.24169211089611053 0.2796827554702759
4.299465239048004 0.20954330265522003 0.2931746244430542 0.2624923288822174
4.279313772916794 0.5632350444793701 0.33347755670547485 0.18668770790100098
4.271092563867569 0.9363528937101364 0.34991997480392456 0.0720309317111969
4.277956560254097 1.31111516430974 0.33619198203086853 -0.04591468721628189
4.297719046473503 1.6690965369343758 0.2966670095920563 -0.13029851019382477
4.324349001049995 1.998755894601345 0.24340710043907166 -0.15803830325603485
4.35142108052969 2.299770303070545 0.18926294147968292 -0.1284879595041275
4.374429106712341 2.581434803083539 0.14324688911437988 -0.06023803725838661
4.391278874129057 2.856391136534512 0.10954735428094864 0.021428218111395836
4.401869520545006 3.1344913616776466 0.0883660614490509 0.09680669009685516
4.407369896769524 3.4202655479311943 0.07736530900001526 0.15683723986148834
4.409438166767359 3.713829427957535 0.07322876900434494 0.2012884020805359
4.409613940864801 4.01315812766552 0.07287722080945969 0.23420944809913635
4.409011218696833 4.315969750285149 0.07408266514539719 0.26016560196876526
4.408275164663792 4.620599538087845 0.07555477321147919 0.2824854254722595
4.407686240971088 4.926097512245178 0.07673262059688568 0.3030679225921631
4.407304883003235 5.2320044338703156 0.07749533653259277 0.32283347845077515
4.407092995941639 5.5381132662296295 0.0779191106557846 0.34219521284103394
4.406989581882954 5.844327092170715 0.07812593877315521 0.3613460063934326
4.673867501318455 -0.13456476293504238 0.17594949901103973 0.3191295266151428
4.661842875182629 0.19171607494354248 0.19999875128269196 0.2981467843055725
4.652600049972534 0.5521484017372131 0.21848440170288086 0.20886099338531494
4.648864082992077 0.9357549138367176 0.22595633566379547 0.07322689145803452
4.651940248906612 1.3213899098336697 0.21980400383472443 -0.06646417826414108
4.660926923155785 1.6869977861642838 0.20183065533638 -0.16610100865364075
4.673255242407322 2.019415020942688 0.17717401683330536 -0.1993565559387207
4.686014920473099 2.3189508616924286 0.1516546607017517 -0.1668490767478943
4.697007521986961 2.596591543406248 0.1296694576740265 -0.09055151790380478
4.705133106559515 2.8667110395617783 0.11341828852891922 0.000788412056863308
4.710288260132074 3.140453312546015 0.1031079813838005 0.08488278836011887
4.713016550987959 3.42301919311285 0.0976513996720314 0.15132994949817657
4.714106131345034 3.7146265879273415 0.09547223895788193 0.19969408214092255
4.714285913854837 4.0130027160048485 0.09511267393827438 0.23452027142047882
4.714079812169075 4.315504789352417 0.0955248773097992 0.2610955238342285
4.713790513575077 4.620150342583656 0.0961034744977951 0.2833838164806366
4.713551364839077 4.925776332616806 0.09658177196979523 0.30371028184890747
4.7133945897221565 5.231812983751297 0.09689532220363617 0.32321637868881226
4.71330701187253 5.538014248013496 0.09707047790288925 0.34239324927330017
4.7132641561329365 5.844281896948814 0.09715618938207626 0.3614363968372345
5.0324509516358376 -0.13887952826917171 0.09036104381084442 0.3277590572834015
5.036172427237034 0.18781806528568268 0.08291809260845184 0.3059428036212921
5.038957457989454 0.549745462834835 0.07734803110361099 0.2136668711900711
5.040144830942154 0.9356901459395885 0.07497328519821167 0.07335642725229263
5.039463371038437 1.323755819350481 0.07633620500564575 -0.07119599729776382
5.037117585539818 1.6910703927278519 0.08102777600288391 -0.17424622178077698
5.033715937286615 2.0241028517484665 0.08783107250928879 -0.2087322175502777
5.030046794563532 2.3232975378632545 0.09516935795545578 -0.1755424290895462
5.026779919862747 2.600010234862566 0.10170310735702515 -0.09738890081644058
5.0242656618356705 2.8689995645545423 0.10673162341117859 -0.0037886379286646843
5.022531721740961 3.141708206385374 0.11019950360059738 0.0823730006814003
5.021416615694761 3.4235053285956383 0.11242971569299698 0.1503576785326004
5.020716588944197 3.714647814631462 0.11382976919412613 0.19965162873268127
5.020271096378565 4.012812756001949 0.11472075432538986 0.23490019142627716
5.019981652498245 4.315270379185677 0.11529964208602905 0.26156434416770935
5.019794676452875 4.619954690337181 0.11567359417676926 0.28377512097358704
5.019679073244333 4.9256434589624405 0.115904800593853 0.30397602915763855
5.019612688571215 5.231735482811928 0.11603756994009018 0.32337138056755066
5.019577894359827 5.53797459602356 0.11610715836286545 0.34247255325317383
5.0195613987743855 5.84426386654377 0.11614014953374863 0.3614724576473236
5.386976540088654 -0.12721950374543667 0.012889266014099121 0.3044390082359314
5.404958584345877 0.19800660014152527 -0.02307482250034809 0.28556573390960693
5.418522385880351 0.5559707656502724 -0.05020242556929588 0.20121626555919647
5.424127859994769 0.936271820217371 -0.06141337379813194 0.07219307869672775
5.420211084187031 1.3185504954308271 -0.053579822182655334 -0.06078534945845604
5.407889866270125 1.6815331727266312 -0.028937386348843575 -0.15517178177833557
5.390454757260159 2.012649431824684 0.005932831671088934 -0.185825377702713
5.371955532580614 2.3123261779546738 0.04293128103017807 -0.15359970927238464
5.3557025119662285 2.5911161229014397 0.07543732225894928 -0.07960067689418793
5.343424439430237 2.8627246832475066 0.09999346733093262 0.008761124685406685
5.33529444783926 3.13778293505311 0.11625345051288605 0.09022354334592819
5.330516293644905 3.42128886282444 0.12580975890159607 0.15479061007499695
5.327996253967285 3.713492125272751 0.13084983825683594 0.20196300745010376
5.32678797096014 4.012239016592503 0.1332664042711258 0.2360476702451706
5.326251536607742 4.3149896413087845 0.13433927297592163 0.26212581992149353
5.326025255024433 4.61981600522995 0.13479183614253998 0.2840524911880493
5.325931780040264 4.925574436783791 0.134978786110878 0.30411407351493835
5.325893059372902 5.231701746582985 0.13505622744560242 0.3234388530254364
5.325876943767071 5.537958890199661 0.1350884586572647 0.34250396490097046
5.325870327651501 5.844257086515427 0.13510169088840485 0.36148601770401
5.724756962619722 -0.10301919840276241 -0.03109217993915081 0.2560383975505829
5.752009458839893 0.21918539702892303 -0.08559717237949371 0.2432081401348114
5.772565223276615 0.5689016208052635 -0.12670870125293732 0.17535455524921417
5.7810413762927055 0.9373913183808327 -0.1436610072851181 0.06995408236980438
5.775054283440113 1.3075444363057613 -0.13168682157993317 -0.03877323120832443
5.756302792578936 1.66148104891181 -0.09418383985757828 -0.11506753414869308
5.729791354387999 1.9886367246508598 -0.04116096347570419 -0.1377999633550644
5.7016746094450355 2.2893701419234276 0.015072526410222054 -0.10768763720989227
5.676982473582029 2.5725482795387506 0.06445679813623428 -0.04246499016880989
5.6583460830152035 2.849687846377492 0.10172957926988602 0.03483479842543602
5.6460351422429085 3.1297243908047676 0.126351460814476 0.10634063184261322
5.638841539621353 3.4168615490198135 0.14073866605758667 0.16364523768424988
5.635096475481987 3.711312346160412 0.14822879433631897 0.2063225656747818
5.63334883749485 4.011267989873886 0.15172407031059265 0.23798972368240356
5.632613033056259 4.314592868089676 0.15319567918777466 0.2629193663597107
5.632331021130085 4.619664266705513 0.15375970304012299 0.2843559682369232
5.632231272757053 4.925518587231636 0.15395919978618622 0.30422577261924744
5.632198043167591 5.231681391596794 0.15402565896511078 0.323479562997818
5.632187344133854 5.537951439619064 0.15404705703258514 0.3425188660621643
5.63218392431736 5.844254359602928 0.15405389666557312 0.36149147152900696
6.040245126932859 -0.07253393344581127 -0.03049006313085556 0.1950678676366806
6.070197977125645 0.24586515873670578 -0.09039576351642609 0.1898486167192459
6.092789202928543 0.5851865708827972 -0.1355782151222229 0.14278465509414673
6.10210045427084 0.9387853778898716 -0.1542007178068161 0.06716596335172653
6.095510303974152 1.2936495542526245 -0.14102041721343994 -0.010983467102050781
6.074885990470648 1.6361812613904476 -0.09977179020643234 -0.06446795910596848
6.0457298662513494 1.9583459459245205 -0.04145954176783562 -0.07721840590238571
6.014809417538345 2.260415941476822 0.02038135565817356 -0.04977923631668091
5.987656280398369 2.5491340113803744 0.07468762993812561 0.004363546147942543
5.967165518552065 2.8332586213946342 0.11566915363073349 0.06769324839115143
5.953635483980179 3.1195858493447304 0.14272922277450562 0.12661771476268768
5.9457380920648575 3.411313518881798 0.15852400660514832 0.17474129796028137
5.941636726260185 3.7086044996976852 0.1667267382144928 0.21173825860023499
5.939732871949673 4.010083384811878 0.17053444683551788 0.24035893380641937
5.9389398992061615 4.314125895500183 0.17212039232254028 0.2638533115386963
5.938642397522926 4.619497179985046 0.17271539568901062 0.28469014167785645
5.938541367650032 4.925463706254959 0.1729174554347992 0.3043355345726013
5.938510067760944 5.231664568185806 0.17298005521297455 0.3235132098197937
5.9385011196136475 5.537946492433548 0.17299795150756836 0.342528760433197
5.938498705625534 5.844252943992615 0.17300277948379517 0.3614943027496338
};

%% \input{src/gradient_descent.tex}
\end{axis}
\end{tikzpicture}

\medskip

\begin{tikzpicture}[axes,scale=0.9]
\draw[draw=none] (-1,-0.4) rectangle (8,5.7);
\begin{axis} [
    trig format plots=rad,
    xtick style={draw=none},
    ytick style={draw=none},
    ztick style={draw=none},
    xticklabel = \empty,
    yticklabel = \empty,
    zticklabel = \empty,
    zmin=-2,
    xlabel = $w$, ylabel = \empty, zlabel = $\mathcal{L}(w)$,
    zlabel style = { rotate=-90 },
]
\addplot3 [
  surf,
  colormap={bw}{color=(black!50) color=(black!50)},
  color=white,
  very thin,
  domain=0:6,
  samples=\nbsamplesgd,
] {
  y*y + (x-3.1415926)*(x-3.1415926)
  + 18*exp(-0.5*((x-5)*(x-5)+(y-1)*(y-1)))
  + 12*exp(-0.5*((x-1.5)*(x-1.5)+(y-3)*(y-3)))
  - 3 *exp(-1.5*((x-3)*(x-3)+(y-1)*(y-1)))
};
%\immediate\write18{src/gradient.py --fig=1 --filename=src/gradient_descent.tex}
%\input{src/gradient_descent.tex}
\coordinate (w0) at (1.5,5.699999809265137,35.4982795715332);
\addplot3 [mark=*,mark size=1pt,mark options={color=blue},draw=blue,very thin] coordinates{ (1.5,5.699999809265137,35.4982795715332) (1.6641591787338257,5.172316551208496,30.054140090942383) (1.8210809230804443,4.776569843292236,26.911447525024414) (1.990876317024231,4.5078535079956055,25.058387756347656) (2.1896557807922363,4.314462184906006,23.50979232788086) (2.422152280807495,4.14532995223999,21.776744842529297) (2.6811954975128174,3.9646413326263428,19.69647216796875) (2.9470183849334717,3.7513339519500732,17.336345672607422) (3.191185235977173,3.5023460388183594,14.952949523925781) (3.386401891708374,3.2347588539123535,12.895486831665039) (3.5151426792144775,2.979001998901367,11.426831245422363) (3.573427438735962,2.7612271308898926,10.532214164733887) (3.5712339878082275,2.585761070251465,9.962543487548828) (3.526378631591797,2.436687707901001,9.475350379943848) (3.4544310569763184,2.2922539710998535,8.921503067016602) (3.363274335861206,2.1320712566375732,8.170730590820312) (3.2533488273620605,1.9354031085968018,7.016979217529297) (3.1218514442443848,1.6792848110198975,5.148150444030762) (2.976144313812256,1.356011152267456,2.6120076179504395) (2.8581600189208984,1.0409464836120605,0.7751033306121826) (2.8015146255493164,0.8541433811187744,0.20969009399414062) (2.7758946418762207,0.7618569731712341,0.06825542449951172) (2.7620480060577393,0.7107729315757751,0.023403644561767578) (2.7537238597869873,0.679664134979248,0.0063931941986083984) (2.748403549194336,0.659582793712616,-0.0007960796356201172) (2.744871139526367,0.6461406946182251,-0.004046916961669922) (2.7424662113189697,0.636928915977478,-0.0055828094482421875) (2.740800619125366,0.6305162906646729,-0.006330013275146484) (2.739633321762085,0.6260042190551758,-0.006701469421386719) (2.7388083934783936,0.6228057742118835,-0.006887674331665039) (2.7382218837738037,0.6205266118049622,-0.0069828033447265625) (2.7378032207489014,0.6188966035842896,-0.007031679153442383) (2.7375032901763916,0.6177277565002441,-0.007056474685668945) (2.737287998199463,0.6168880462646484,-0.00706934928894043) (2.737133264541626,0.6162839531898499,-0.0070760250091552734) (2.7370219230651855,0.6158490180969238,-0.0070798397064208984) (2.7369415760040283,0.61553555727005,-0.007081270217895508) (2.7368836402893066,0.6153095960617065,-0.007082223892211914) (2.736841917037964,0.6151465773582458,-0.007082700729370117) (2.736811876296997,0.615028977394104,-0.007083415985107422) (2.736790180206299,0.6149441599845886,-0.00708317756652832) (2.7367746829986572,0.6148829460144043,-0.00708317756652832) (2.7367632389068604,0.6148387789726257,-0.00708317756652832) (2.736755132675171,0.6148068904876709,-0.00708317756652832) (2.7367491722106934,0.6147838830947876,-0.007083415985107422) (2.7367448806762695,0.61476731300354,-0.00708317756652832) (2.736741781234741,0.6147552728652954,-0.0070836544036865234) (2.7367396354675293,0.614746630191803,-0.007083415985107422) (2.7367382049560547,0.6147403717041016,-0.007083415985107422) (2.736737012863159,0.6147359013557434,-0.007083415985107422) (2.7367360591888428,0.6147326827049255,-0.007082939147949219) (2.7367355823516846,0.6147302985191345,-0.0070836544036865234) (2.7367351055145264,0.6147286295890808,-0.007083415985107422) (2.7367348670959473,0.6147273778915405,-0.0070836544036865234) (2.736734628677368,0.6147264838218689,-0.007083415985107422) (2.736734390258789,0.6147258877754211,-0.007083415985107422) (2.736734390258789,0.6147254109382629,-0.0070836544036865234) (2.73673415184021,0.6147251129150391,-0.00708317756652832) (2.73673415184021,0.61472487449646,-0.00708317756652832) (2.73673415184021,0.6147246956825256,-0.007083415985107422) (2.73673415184021,0.6147245764732361,-0.00708317756652832) (2.73673415184021,0.6147244572639465,-0.00708317756652832) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) (2.73673415184021,0.6147243976593018,-0.007083415985107422) };
\end{axis}
\end{tikzpicture}
\end{figure}

\begin{figure}
\newcommand{\fillcubexyz}[7]{%
\draw[draw=none,fill=#7] (#1,#2,#3)--++(#4,0,0)--++(0,0,#6)--++(0,#5,0)--++(-#4,0,0)--++(0,0,-#6)--cycle;
}
\newcommand{\cubexyz}[6]{%
\draw (#1,#2,#3)          --++(0,0,#6)--++(0,#5,0)--++(0,0,-#6)--cycle;
\draw (#1,#2,#3)++(#4,0,0)--++(0,0,#6)--++(0,#5,0)--++(0,0,-#6)--cycle;
\draw (#1,#2,#3)--++(#4,0,0);
\draw (#1,#2,#3)++(0,#5,0)--++(#4,0,0);
\draw (#1,#2,#3)++(0,#5,#6)--++(#4,0,0);
\draw (#1,#2,#3)++(0,0,#6)--++(#4,0,0);
}
\center
\begin{tikzpicture}[
    very thin, line join=bevel,
    x={(0:0.15cm)},
    y={(90:0.215cm)},
    z={(50:0.08cm)}
]

\begin{scope}[shift={(0,0,0)}]
  \fillcubexyz{0}{1}{1}{4}{5}{3}{blue}
  \cubexyz{0}{0}{0}{4}{10}{8} % 4x10x8
  \cubexyz{0}{1}{1}{4}{5}{3}  % 4x5x3
  \fillcubexyz{10}{3}{2}{6}{1}{1}{red}
  \cubexyz{10}{2}{1}{6}{6}{6} % 6x6x6
  \cubexyz{10}{3}{2}{6}{1}{1}
  \draw[->,thick] (0,1,1)++(4.8,2.5,1.5)--++(4.6,0,0) node[midway,above] {$\phi$};
  \node[every text node part/.style={align=center}] at (9,-4) {\it 2d convolution};
\end{scope}

\begin{scope}[shift={(24,0,0)}]
  \fillcubexyz{13}{1}{1}{4}{5}{3}{red}
  \cubexyz{13}{0}{0}{4}{10}{8}
  \cubexyz{13}{1}{1}{4}{5}{3}
  \fillcubexyz{0}{3}{2}{6}{1}{1}{blue}
  \cubexyz{0}{2}{1}{6}{6}{6}
  \cubexyz{0}{3}{2}{6}{1}{1}
  \draw[->,thick] (0,1,1)++(6.6,2.5,1.5)--++(5.2,0,0) node[midway,above] {$\psi$};
  \node[every text node part/.style={align=center}] at (9,-4)
       {\it 2d transposed\\ \it convolution};
\end{scope}

\end{tikzpicture}

\end{figure}


\end{document}
