layers={"0": {"config": {"units": 24, "activation": "relu"}, "weights": [[0.5124973654747009, -0.05630900710821152, 0.20793963968753815, 0.059206463396549225, 0.06825665384531021, 0.0296283271163702, -0.2659875750541687, -0.451324999332428, -0.06799980998039246, -0.5714327692985535, -0.12572431564331055, -0.029415985569357872, -0.28867781162261963, -0.12732166051864624, 0.0065711019560694695, -0.36574044823646545, -0.20871230959892273, -0.9313932061195374, -0.42081108689308167, -0.227577343583107, -0.6059561967849731, -0.746620237827301, -2.483302354812622, -4.988377571105957], [-0.45043838024139404, -0.34014463424682617, -0.5008078813552856, -0.1757413148880005, 0.30722638964653015, 0.1958744078874588, 0.7910961508750916, 0.5814640522003174, 0.6680668592453003, 0.8720927238464355, 0.8208027482032776, 0.5908318758010864, 0.37327295541763306, 0.185007244348526, 0.7784321308135986, 1.4432387351989746, 1.0526732206344604, 0.9008010029792786, 0.8762604594230652, 0.4712308645248413, -0.04601917043328285, 0.4128885567188263, 0.2635999619960785, 1.537596583366394], [-0.3311459422111511, -0.252986878156662, -0.006463481578975916, 0.08667860180139542, 0.38831785321235657, -0.06812576204538345, -0.0700385645031929, 0.577540397644043, 0.04527566581964493, 0.1415342539548874, 0.25737264752388, 0.0607016384601593, 0.0961190015077591, 0.4247259795665741, 0.9492226839065552, 1.3862130641937256, 0.977729082107544, 0.41088318824768066, 0.7800424695014954, 0.433082640171051, -0.2612454295158386, 0.04706550016999245, 0.6166741251945496, 2.1505353450775146], [-0.5760858654975891, -0.5835933685302734, -0.005154864396899939, 0.297992080450058, 0.7094845771789551, 0.42917823791503906, 0.7877620458602905, 0.666671633720398, 0.2092127799987793, -0.0961080938577652, -0.3562759459018707, -0.4977129101753235, -0.46301060914993286, -0.21927045285701752, -0.009061785414814949, 0.7276400327682495, 0.6904632449150085, 1.0929774045944214, 0.5545522570610046, 0.576980471611023, -0.06270010769367218, 0.46401166915893555, 0.33858025074005127, 2.1746726036071777], [0.028165381401777267, -0.31536585092544556, -0.3127865195274353, -0.12858104705810547, 0.39122018218040466, -0.4693896472454071, -0.49244415760040283, -0.1558302640914917, 0.04482399299740791, -0.20053675770759583, -0.742278516292572, -0.7691635489463806, -0.1228005588054657, -0.6111680865287781, -0.3602367639541626, -0.4119997024536133, -0.3962131142616272, -0.6612058877944946, -0.7025036811828613, -0.27842390537261963, -0.32803043723106384, -0.7257083058357239, -2.3426921367645264, -5.3822855949401855], [-0.4735827147960663, -0.2902012765407562, 0.15689446032047272, 0.346182256937027, -0.05354657024145126, 0.4650506377220154, 0.28589746356010437, 0.5707189440727234, -0.12933050096035004, -0.20940622687339783, -0.22375032305717468, 0.20980797708034515, 0.12310227751731873, -0.3769964277744293, 0.34269165992736816, 0.1991879940032959, 0.595299243927002, 0.6466046571731567, 0.7244663834571838, 0.41925016045570374, -0.23052921891212463, 0.47277337312698364, 0.7390440702438354, 2.5641963481903076], [-0.8535923957824707, -0.9555475115776062, -0.8331660032272339, -0.39169079065322876, -0.19475531578063965, -0.050016600638628006, 0.6075313687324524, 0.4687791168689728, 0.5587873458862305, 0.3950946033000946, 0.37993329763412476, 0.6789472103118896, 0.4579143524169922, 0.01960497535765171, 0.9933270812034607, 1.555877447128296, 1.4986560344696045, 0.41556185483932495, 0.46459460258483887, 0.14291080832481384, -0.09376867115497589, -0.27677756547927856, 0.29162120819091797, 1.0325168371200562], [-0.02449236623942852, -0.16456227004528046, 0.023010486736893654, 0.26604560017585754, 0.37033697962760925, 0.9445134997367859, 0.28214117884635925, 0.41841432452201843, -0.05104285478591919, 0.1077795922756195, -0.31857186555862427, -0.5956677198410034, -0.28011205792427063, -0.5896860361099243, -0.24295037984848022, -0.35857489705085754, 0.4087761342525482, 0.845296323299408, 0.697981595993042, 0.07707283645868301, -0.13532137870788574, 0.016801239922642708, 0.9656881093978882, 2.626352548599243], [-0.18975453078746796, -0.17516639828681946, -0.24145939946174622, 0.2106708437204361, -0.09675801545381546, 0.339773029088974, 0.5181767344474792, 0.190903440117836, -0.11923333257436752, -0.4128701984882355, -0.42492666840553284, 0.13461577892303467, -0.5022386312484741, -0.2573932707309723, 0.3149103820323944, 0.017064465209841728, 0.11105352640151978, 0.9947887063026428, 0.7074704170227051, 0.3389703631401062, 0.22980067133903503, -0.10370203852653503, 0.6100974082946777, 2.8409547805786133], [-0.07759841531515121, -0.21689166128635406, -0.5657908320426941, 0.048619214445352554, -0.2858365476131439, -0.43484392762184143, 0.10697360336780548, 0.19652484357357025, 0.3713320195674896, 0.2836884558200836, 0.1817537248134613, 0.14907854795455933, 0.42273959517478943, 0.9324578046798706, 0.5048248767852783, 0.8098607659339905, 0.7745832204818726, 0.48820286989212036, 0.22594217956066132, 0.3311687111854553, -0.28470131754875183, -1.6075356006622314, -2.924663543701172, -5.459266185760498], [-0.1188800036907196, -0.20745494961738586, -0.37383511662483215, 0.26570892333984375, 0.6352947950363159, 0.09817250072956085, 0.047235921025276184, 0.5837810635566711, 0.17194721102714539, 0.06883922219276428, -0.20285870134830475, -0.1085885539650917, -0.3247065544128418, -0.25226378440856934, -0.04939393326640129, -0.26470136642456055, -0.1485239416360855, 0.4710140526294708, 0.7093683481216431, 0.10344085097312927, 0.18410241603851318, 0.13793198764324188, 1.0971256494522095, 2.987415075302124], [0.36904942989349365, 0.4734979271888733, 0.12075381726026535, 0.2831699550151825, -0.23622527718544006, -0.37922075390815735, -0.5483736991882324, 0.04950227960944176, -0.22967912256717682, 0.20448924601078033, 0.28601065278053284, 0.5874040722846985, 0.14062713086605072, 0.04939144104719162, 0.12622441351413727, -0.1971626728773117, -0.6279047131538391, -0.67649906873703, -1.0140366554260254, -1.1252186298370361, -0.9948621988296509, -0.5099448561668396, 0.7794879078865051, 3.700742244720459], [0.6730719208717346, 0.6076413989067078, 0.5439013242721558, 1.143103003501892, 0.4948691129684448, 0.4409479796886444, 0.5448960065841675, -0.132391557097435, 0.22459425032138824, 0.27348852157592773, 0.12680435180664062, 0.24888582527637482, 0.13626328110694885, 0.03881609067320824, 0.3444916009902954, -0.3785708248615265, -0.3684420585632324, -0.504073977470398, -0.6590502858161926, -0.4028807580471039, -0.16520747542381287, -0.7210423350334167, -2.036214828491211, -4.769606113433838], [1.1654762029647827, 0.7345629930496216, 0.7941573262214661, 0.36830419301986694, 0.28821197152137756, 0.40803006291389465, -0.053968943655490875, -0.045290205627679825, 0.2691662311553955, -0.4505297839641571, -0.4296063184738159, -0.6104095578193665, 0.07009049504995346, -0.21327629685401917, -0.027104025706648827, -0.6199579834938049, -0.7741767168045044, -0.7157614827156067, -0.7410141825675964, -0.41999727487564087, -0.7902884483337402, -0.882722795009613, -2.3880398273468018, -4.652960300445557], [-0.1836938112974167, -0.25663989782333374, -0.18679898977279663, 0.1282186657190323, 0.3076139986515045, 0.2529089152812958, 0.5770278573036194, 0.17455090582370758, 0.11488494277000427, 0.419685423374176, -0.10259992629289627, -0.06359801441431046, -0.04659711942076683, 0.20230132341384888, 0.43099409341812134, 0.7418556809425354, 0.8509694933891296, 0.718805730342865, 0.5498213768005371, 0.20782122015953064, -0.011732303537428379, 0.4513634443283081, 0.9532421231269836, 2.4240829944610596], [-0.3143884241580963, -0.03820153698325157, -0.013126557692885399, -0.3300623893737793, -0.20942775905132294, -0.15228310227394104, -0.778187096118927, -0.3590734004974365, -0.09715021401643753, -0.06927338242530823, 0.18232059478759766, -0.04234637692570686, 0.3181951940059662, 0.3364033102989197, 0.3338693380355835, 0.7568320631980896, -0.058604415506124496, -0.32472869753837585, 0.2961346507072449, 0.13239289820194244, 0.31084156036376953, 0.6100135445594788, 1.3071253299713135, 2.6046648025512695], [-0.0834866389632225, 0.11616846174001694, 0.0748249962925911, 0.4791569709777832, 0.5654699206352234, 0.5877906084060669, 0.3097924590110779, -0.10619383305311203, -0.09892243891954422, -0.19299307465553284, -0.5030727386474609, -0.07791648805141449, -0.09987819939851761, -0.7218331098556519, -0.34404686093330383, -0.8031126856803894, -0.6124101281166077, -0.4126390218734741, -0.5518489480018616, -0.7153535485267639, -0.5597663521766663, -0.2122085988521576, 0.800278902053833, 3.7681868076324463], [-0.1228051483631134, -0.1342000961303711, -0.3652670085430145, 0.03440132364630699, 0.3015461266040802, 0.026441924273967743, 0.5590509176254272, 0.705747127532959, 0.4998692274093628, 0.627513587474823, 0.486164927482605, 0.7212326526641846, 0.38149672746658325, 0.7405261993408203, 1.1376324892044067, 0.9122623205184937, 0.9025141000747681, 0.8632790446281433, 0.44261443614959717, 0.5431057214736938, -0.1707044094800949, 0.2175489068031311, 0.9117822647094727, 1.4191722869873047], [-0.2305368185043335, -0.2822669744491577, 0.11352173238992691, 0.14680363237857819, 0.24127978086471558, -0.20205116271972656, -0.35083630681037903, -0.36064910888671875, -0.4188210964202881, -0.19199658930301666, -0.06285199522972107, -0.25363889336586, -0.09138671308755875, -0.36258435249328613, -0.1154545322060585, 0.43324756622314453, 0.4445440173149109, 0.26087093353271484, 0.4205036759376526, 0.39991554617881775, -0.10855259001255035, 0.19097860157489777, 0.8863574266433716, 3.24868106842041], [-0.48846954107284546, -0.11817850917577744, -0.017405042424798012, 0.22398152947425842, 0.10306520015001297, 0.08061709254980087, 0.3151432275772095, 0.23137624561786652, 0.11500885337591171, -0.21206995844841003, -0.36029353737831116, -0.4197738766670227, -0.34490975737571716, -0.28929808735847473, -0.4205312728881836, -0.17571070790290833, -0.4913189113140106, -0.2504012882709503, -0.399786114692688, -0.609773576259613, -0.8117027282714844, -0.3772535026073456, 1.1645559072494507, 3.9508535861968994], [-0.4334447383880615, -0.27136915922164917, -0.24344471096992493, -0.3638414144515991, 0.1610196828842163, -0.08730578422546387, 0.07893338799476624, 0.5044596791267395, 0.9510626196861267, 0.9213916063308716, 0.7236568331718445, 0.32228851318359375, 0.7230533957481384, 0.9886901378631592, 1.0257624387741089, 1.061732292175293, 0.946620523929596, 0.688084602355957, 0.8048222661018372, 0.5787593126296997, 0.18376509845256805, 0.1664961874485016, 0.49308574199676514, 1.1021932363510132], [0.181949183344841, 0.12711955606937408, 0.13452647626399994, 0.007883560843765736, 0.3400586247444153, -0.39826905727386475, -0.3504572808742523, -0.29674944281578064, -0.2955586910247803, 0.18362656235694885, 0.30592864751815796, -0.02721840888261795, 0.08854276686906815, 0.3292371928691864, 0.12448259443044662, 0.13868634402751923, -0.2102448046207428, -0.025253456085920334, 0.22597716748714447, -0.1271021068096161, -0.08752966672182083, 0.69764643907547, 1.4456121921539307, 3.466447114944458], [-0.0615471675992012, -0.06867606937885284, -0.24392011761665344, 0.31663253903388977, 0.18883007764816284, 0.9565639495849609, 1.150693655014038, 0.9950093626976013, 0.6476848125457764, -0.11166710406541824, -0.22103165090084076, -0.1909063160419464, -0.44445347785949707, -0.47826656699180603, -0.465168297290802, 0.5952178239822388, 0.6917408108711243, 0.7893996238708496, 0.4812720715999603, 0.5320203304290771, 0.19898621737957, 0.17028716206550598, 0.8879570364952087, 1.9480472803115845], [-0.3282080888748169, -0.3843316435813904, 0.189277783036232, 0.09040473401546478, 0.7523273229598999, 0.5359841585159302, 0.39615458250045776, 0.5749569535255432, -0.22089773416519165, -0.2750608026981354, -0.313004732131958, -0.04514262452721596, -0.23577122390270233, -0.5195212364196777, 0.20498163998126984, 0.5460197925567627, 0.42433345317840576, 0.8054072856903076, 1.0253338813781738, 0.34520238637924194, 0.13184532523155212, 0.3975212574005127, 0.41473573446273804, 2.366319179534912]], "biases": [0.47060903906822205, -0.5285770893096924, -0.06381656229496002, -0.1337507963180542, 0.22662638127803802, -0.031758930534124374, 0.7580835223197937, -0.35156840085983276, -0.08536481857299805, 0.16317032277584076, -0.18853361904621124, 0.22162562608718872, 0.6329348087310791, -0.0793609768152237, -0.03049585595726967, -0.1792878955602646, 0.40767624974250793, -0.25414612889289856, 0.0874112993478775, 0.3984275162220001, -0.4400308430194855, -0.09061512351036072, -0.22589047253131866, -0.04891132563352585]}, "1": {"config": {"units": 12, "activation": "linear"}, "weights": [[-1.0870006084442139, -0.11697567254304886, 0.38414227962493896, 0.6085609793663025, -1.9571269750595093, 0.6165427565574646, 0.04054202511906624, 0.8412051200866699, 1.2492811679840088, -1.190694808959961, 1.2720869779586792, 3.449755907058716, -0.8787221312522888, -1.105920672416687, 0.991389274597168, 1.3508682250976562, 1.5418089628219604, -0.04096761345863342, 1.3595212697982788, 1.6978954076766968, 0.4814605712890625, 1.6881979703903198, 0.15558205544948578, 0.17783354222774506], [-1.6818004846572876, 0.2674539089202881, 0.5901402831077576, -0.039005380123853683, -1.4714593887329102, 0.9930922985076904, -0.07673534005880356, 0.986603319644928, 1.186890959739685, -1.3333103656768799, 1.0611894130706787, 2.9795174598693848, -0.824815571308136, -1.1523693799972534, 0.523550271987915, 1.5954232215881348, 1.8444843292236328, 0.3200976550579071, 1.0486892461776733, 1.7543706893920898, -0.08695913106203079, 1.3013665676116943, 0.5211836695671082, 0.5563724040985107], [-1.3384252786636353, 0.06198614090681076, 0.7332447171211243, 0.6573634743690491, -1.588235855102539, 0.5696560740470886, -0.11364332586526871, 0.916848361492157, 0.6939926743507385, -1.8080562353134155, 1.4801182746887207, 2.197129726409912, -0.8949949145317078, -1.171160340309143, 0.644345223903656, 0.8923274874687195, 2.050724506378174, 0.1842414140701294, 0.9925578236579895, 1.681244969367981, 0.3182690441608429, 1.3476964235305786, 0.03919287398457527, 1.0606467723846436], [-1.4982355833053589, 0.6455115675926208, -0.058895669877529144, 0.9696561694145203, -1.487015962600708, 1.0578515529632568, -0.11340859532356262, 1.0155807733535767, 1.2669637203216553, -2.113232374191284, 1.1004263162612915, 1.4204938411712646, -1.0415630340576172, -0.943350076675415, 0.7879553437232971, 0.3279293179512024, 1.633438229560852, 0.11267879605293274, 1.246534824371338, 1.686829686164856, 0.09975019097328186, 0.6632471680641174, 0.5461684465408325, 0.675256609916687], [-1.5562422275543213, 0.31421464681625366, 0.28788089752197266, 0.7789918184280396, -1.0236271619796753, 0.7575944662094116, 0.19233053922653198, 1.576671838760376, 1.0281577110290527, -2.1797916889190674, 0.8310934901237488, 0.663434624671936, -1.0263012647628784, -1.5520638227462769, 0.9891080856323242, 0.23620767891407013, 1.600111484527588, 0.04043252021074295, 1.0106067657470703, 1.2004544734954834, 0.1584145575761795, 0.52750563621521, 0.6451387405395508, 0.9388683438301086], [-1.0046299695968628, 0.3852829337120056, 0.5222647190093994, 0.98346346616745, -1.1968533992767334, 0.5961607694625854, 0.6806934475898743, 1.3237836360931396, 1.2721046209335327, -2.020385503768921, 0.6348124146461487, -0.016495583578944206, -1.141405463218689, -1.9033186435699463, 0.8608949780464172, -0.1314372718334198, 1.254844069480896, 0.020889556035399437, 0.22495122253894806, 1.1364738941192627, 0.11840154975652695, 0.273977667093277, 0.8450823426246643, 1.1878390312194824], [-0.9580788612365723, 0.33571159839630127, 0.3423491418361664, 1.335434913635254, -1.2872967720031738, 0.5171977877616882, 1.1587227582931519, 1.1054719686508179, 0.8692523837089539, -2.3785290718078613, 0.8275501132011414, -0.4413147270679474, -1.2147554159164429, -1.4278466701507568, 0.6052550673484802, -0.35134610533714294, 0.5242153406143188, 0.4491434097290039, 0.5767356157302856, 1.0707166194915771, 0.34085094928741455, -0.3178752362728119, 1.0178940296173096, 0.7347964644432068], [-1.2304673194885254, 0.8915618062019348, 0.5709460973739624, 1.072951316833496, -1.0635080337524414, 0.7950056195259094, 1.573177456855774, 0.5706725716590881, 0.2439052313566208, -1.9572638273239136, 0.1920507848262787, 0.02988816797733307, -1.5376942157745361, -1.329377293586731, 0.715063214302063, 0.16885997354984283, 0.206073597073555, 0.27920934557914734, 0.18557697534561157, 0.8523187637329102, 0.5518726706504822, -0.3579968810081482, 0.9430497884750366, 0.2060416042804718], [-1.2916921377182007, 0.7434307336807251, 0.8656293749809265, 0.6042015552520752, -0.8892676830291748, 0.6013134717941284, 1.8434096574783325, -0.23347219824790955, 0.08854400366544724, -1.9159187078475952, -0.13251829147338867, -0.12651467323303223, -1.6942123174667358, -1.4436453580856323, 0.12089548259973526, 0.2157483547925949, -0.10407280176877975, 0.8586121797561646, -0.24194516241550446, 0.883091390132904, 1.0191878080368042, 0.03890696167945862, 0.593977689743042, 0.635360062122345], [-1.1873043775558472, 1.067132830619812, 0.9793083667755127, 0.1566007435321808, -0.919447660446167, 0.27629953622817993, 2.1459648609161377, -0.25091153383255005, 0.08561711013317108, -1.8014302253723145, -0.1743265986442566, 0.4105626344680786, -1.9463810920715332, -1.2386174201965332, 0.7609845399856567, 0.431960791349411, -0.005147584713995457, 1.0678354501724243, 0.056417398154735565, 0.09594099223613739, 0.8734935522079468, -0.24859632551670074, 0.0666753426194191, -0.04725276306271553], [-1.3734147548675537, 1.0086727142333984, 0.71490877866745, 0.27258527278900146, -0.8053406476974487, 0.1023617833852768, 2.3745312690734863, -0.6853972673416138, -0.3395940661430359, -1.9882084131240845, -0.6343898177146912, 0.3810119926929474, -1.8487979173660278, -0.9710056781768799, 0.8510057330131531, 0.3737245500087738, -0.44289320707321167, 0.4626912474632263, 0.26151397824287415, 0.16307955980300903, 1.5040981769561768, 0.00455916253849864, 0.3493972420692444, 0.44941264390945435], [-1.4637080430984497, 1.0611878633499146, 1.0555686950683594, 0.3142684996128082, -0.7139841318130493, 0.18036533892154694, 2.4807050228118896, -0.33138877153396606, 0.0875711664557457, -1.700677514076233, -0.47118622064590454, 0.32000356912612915, -1.995522379875183, -0.9646382927894592, 0.7572317719459534, 0.11611860245466232, -0.4766184091567993, 0.8854584693908691, -0.08819019049406052, 0.1384536623954773, 1.2698644399642944, -0.291640967130661, -0.3237047493457794, 0.12360519170761108]], "biases": [-0.4964740574359894, -0.36336997151374817, -0.3027651906013489, 0.12282179296016693, 0.18807312846183777, 0.03139925003051758, 0.16811123490333557, 0.14027225971221924, 0.16433481872081757, 0.14124421775341034, 0.05739234760403633, 0.1031545102596283]}}
from decimal import *
def normalize(arr, mx, mn):
for i in range(len(arr)):
for j in range(len(arr[i])):
arr[i][j] = Decimal(arr[i][j]) / Decimal(mx - mn)
return arr
def relu(x):
return max(Decimal(0), x)
def custom_predict(input):
for key, layer in layers.items():
# print(layer)
config = layer["config"]
weights = layer["weights"]
biases = layer["biases"]
# print(config)
neurons = config["units"]
output = [0]*neurons
for n in range(neurons):
activation = Decimal(0)
assert len(input) == len(weights[n])
for (i, w) in zip(input, weights[n]):
activation += Decimal(i) * Decimal(w)
activation += Decimal(biases[n])
# print(activation)
if(config["activation"] == 'relu'):
output[n] = relu(activation)
else:
output[n] = activation
input = output
return input
# import sys
# import numpy as np
# file = open("data.txt", "r")
# sys.stdin = file
# total_correct = 0
# total_incorrect = 0
# training_vars = []
# correct_vars = []
# incorrect_vars = []
from statistics import variance, mean
data = []
days = int(input())
for i in range(days):
temps = [Decimal(x) for x in input().split()]
data.append(temps)
TRAINING_MEAN = Decimal(4.9959406249999985)
TRAINING_VAR = Decimal(6.964563233695652)
maximum = Decimal(0)
minimum = Decimal(0)
for row in data:
for item in row[:24]:
maximum = max(item, maximum)
minimum = min(item, minimum)
data = normalize(data, maximum, minimum)
for d in data:
avg = sum(d[:24]) / 24
var = variance(d[:24])
if abs(TRAINING_MEAN - avg) < 17:
# if True:
ans = custom_predict(d[:24])
print(" ".join([format(x, ".1f") for x in ans]))
# truth = d[24:]
# diff = np.abs(np.array(ans) - np.array(truth))
# correct = np.count_nonzero(diff < 0.75)
# incorrect = np.count_nonzero(diff >= 2.05)
else:
print("? " * 12)
# incorrect = 0
# correct = 0
# var = variance(d[:24])
# training_vars.append(var)
# if (incorrect > 4):
# incorrect_vars.append(var)
# else:
# correct_vars.append(var)
# total_correct += correct
# total_incorrect += incorrect
# score = 25 * (total_correct - total_incorrect) / days
# print(mean(correct_vars))
# print(mean(incorrect_vars))
# print(mean(training_vars))
# print(total_correct, total_incorrect, score)
# file.close()