index
int64 0
731k
| package
stringlengths 2
98
⌀ | name
stringlengths 1
76
| docstring
stringlengths 0
281k
⌀ | code
stringlengths 4
8.19k
| signature
stringlengths 2
42.8k
⌀ | embed_func_code
listlengths 768
768
|
---|---|---|---|---|---|---|
36,342 | statistics | __pos__ | Return a copy of the instance. | def __pos__(x1):
"Return a copy of the instance."
return NormalDist(x1._mu, x1._sigma)
| (x1) | [
0.028363950550556183,
-0.002326865680515766,
0.07175837457180023,
0.004274939186871052,
0.04557626321911812,
-0.007476273458451033,
-0.022943977266550064,
-0.029177812859416008,
0.057385917752981186,
0.06483189016580582,
-0.025541407987475395,
-0.018112754449248314,
-0.02926439419388771,
0.06043357029557228,
-0.05551576614379883,
0.04401780292391777,
0.024173429235816002,
0.015411426313221455,
-0.033593446016311646,
0.03698742389678955,
0.02060628868639469,
0.05264127627015114,
0.00046753764036111534,
-0.02542019449174404,
-0.03626014292240143,
-0.004883171059191227,
-0.010961160995066166,
-0.05343782156705856,
0.015021811239421368,
-0.055169444531202316,
0.02985314466059208,
0.002606089459732175,
0.05617378279566765,
-0.01445903442800045,
0.02699596993625164,
-0.05181009694933891,
-0.004961093887686729,
0.04329052194952965,
0.03116917610168457,
0.019134411588311195,
-0.0008701395126990974,
-0.03899610415101051,
0.01190489437431097,
0.022441808134317398,
0.008523903787136078,
0.029091231524944305,
-0.011792338453233242,
-0.005796601064503193,
-0.052260320633649826,
0.018233967944979668,
0.010268512181937695,
0.017394132912158966,
0.050667230039834976,
-0.03056311048567295,
-0.023879053071141243,
0.055411871522665024,
0.060953058302402496,
0.07889264822006226,
-0.04329052194952965,
0.032571788877248764,
0.021091142669320107,
0.060537468641996384,
0.007190555799752474,
-0.09884092211723328,
0.011775022372603416,
-0.051533039659261703,
-0.02351541258394718,
0.03239862620830536,
0.02632063813507557,
0.07563719898462296,
-0.01652832143008709,
0.029108548536896706,
-0.021316254511475563,
0.024311957880854607,
0.0610915869474411,
0.05281443893909454,
0.022407174110412598,
0.04093552008271217,
0.09537768363952637,
-0.056762535125017166,
-0.04342905431985855,
0.0000750820036046207,
-0.0240695308893919,
0.021437468007206917,
0.006303100381046534,
0.02441585436463356,
-0.01753266155719757,
-0.013342139311134815,
0.06344658881425858,
0.04464118927717209,
-0.020398493856191635,
0.07189690321683884,
-0.004722996149212122,
-0.010259853675961494,
0.03148086741566658,
0.034892160445451736,
-0.015896279364824295,
-0.026840124279260635,
0.055446501821279526,
0.013887600041925907,
-0.013567250221967697,
0.10493622720241547,
-0.0209352970123291,
0.054165102541446686,
-0.018407130613923073,
0.012926550582051277,
0.028415899723768234,
-0.04602648317813873,
-0.011047741398215294,
0.01958463340997696,
-0.07203543186187744,
0.04557626321911812,
0.027723250910639763,
0.03799176216125488,
-0.026753542944788933,
-0.09045987576246262,
-0.059637024998664856,
0.023636626079678535,
0.009229539893567562,
0.046095751225948334,
-0.0000516780637553893,
0.05721275508403778,
0.014718778431415558,
0.014666829258203506,
-0.023307617753744125,
-0.0015227441908791661,
0.015376794151961803,
-0.05873658135533333,
-0.012493644841015339,
-0.0449528805911541,
0.030095571652054787,
-0.030286049470305443,
-0.009229539893567562,
0.055723562836647034,
0.03148086741566658,
-0.0077446745708584785,
0.05077112466096878,
0.03740301355719566,
-0.004138574004173279,
0.057662978768348694,
0.007381034083664417,
0.02604357898235321,
0.05523870885372162,
0.0014058597153052688,
-0.055446501821279526,
0.06884925067424774,
-0.01556727197021246,
0.060641366988420486,
0.003264105413109064,
-0.025454828515648842,
-0.01577506586909294,
0.02474486269056797,
0.08907458186149597,
-0.044502656906843185,
-0.051602303981781006,
-0.0417320653796196,
-0.038095660507678986,
-0.08408751338720322,
0.04335978999733925,
0.029714616015553474,
-0.05087502300739288,
0.0056580714881420135,
0.025645306333899498,
-0.05232958495616913,
0.00828147679567337,
-0.018736138939857483,
0.01859760843217373,
-0.05281443893909454,
0.0006596393650397658,
-0.011220904067158699,
0.007991430349647999,
-0.003794414456933737,
0.03471900150179863,
0.0026363928336650133,
-0.043532948940992355,
0.027792515233159065,
-0.005389670375734568,
0.059256069362163544,
-0.018770771101117134,
-0.009662444703280926,
0.030320683494210243,
-0.05039016902446747,
-0.013714438304305077,
-0.07993162423372269,
-0.009108326397836208,
0.039100002497434616,
0.013411404564976692,
0.0642431378364563,
-0.0006217601476237178,
0.031099911779165268,
0.011775022372603416,
-0.0026255701668560505,
0.006026040762662888,
-0.029697299003601074,
0.010554229840636253,
0.03201767057180405,
-0.05118671432137489,
-0.04200912266969681,
-0.025783834978938103,
0.03300469368696213,
-0.026182109490036964,
-0.02826005406677723,
-0.03316054120659828,
-0.016372475773096085,
-0.007818268612027168,
0.020363861694931984,
-0.041939858347177505,
0.006900509353727102,
-0.028710275888442993,
-0.04152426868677139,
0.0033896479289978743,
-0.024658281356096268,
-0.011965501122176647,
-0.015030469745397568,
-0.03329906985163689,
-0.05887511372566223,
-0.0038874889723956585,
-0.052537377923727036,
0.014060761779546738,
0.009194906800985336,
0.07224322855472565,
-0.07134278118610382,
-0.009013086557388306,
0.02668427862226963,
-0.004060651175677776,
0.05208715796470642,
0.008277148008346558,
-0.06074526160955429,
-0.04110868275165558,
-0.024640966206789017,
0.07529088109731674,
-0.049974579364061356,
-0.006917825434356928,
-0.035221170634031296,
0.024675598368048668,
-0.016190655529499054,
-0.002807390410453081,
0.026944022625684738,
-0.0385112501680851,
0.017904959619045258,
-0.06240762025117874,
0.024537067860364914,
0.07646837830543518,
0.060260407626628876,
0.0023658270947635174,
0.010095350444316864,
-0.03892683982849121,
0.025835784152150154,
0.011013109236955643,
0.013446036726236343,
-0.03719521686434746,
-0.007839913479983807,
-0.04599185287952423,
0.04103941470384598,
0.03819955885410309,
-0.020346546545624733,
-0.049385830760002136,
-0.0025671280454844236,
-0.024346590042114258,
-0.00007724652823526412,
-0.022995926439762115,
-0.04211302101612091,
-0.03118649311363697,
-0.006450287997722626,
-0.002556305378675461,
0.03698742389678955,
-0.029645349830389023,
0.006013053935021162,
-0.010969818569719791,
0.04249397665262222,
0.03239862620830536,
0.05298760160803795,
0.010813972912728786,
-0.032970063388347626,
0.0029480846133083105,
0.010675443336367607,
-0.019169043749570847,
-0.048658549785614014,
0.03788786754012108,
0.017567293718457222,
0.032658372074365616,
0.004809577018022537,
-0.01592225395143032,
-0.04093552008271217,
0.00199028174392879,
-0.03146355226635933,
0.019688529893755913,
-0.030130203813314438,
0.011082373559474945,
-0.015099734999239445,
-0.020190700888633728,
0.046130381524562836,
0.021125774830579758,
-0.03899610415101051,
0.031983040273189545,
0.008943822234869003,
-0.030355315655469894,
0.016995860263705254,
-0.022008901461958885,
0.05759371072053909,
-0.011826970614492893,
-0.03309127688407898,
-0.07473675906658173,
0.04363684728741646,
0.013420062139630318,
0.045126043260097504,
0.056139152497053146,
0.0014567261096090078,
0.0481390617787838,
-0.012251217849552631,
-0.01171441562473774,
0.014026129618287086,
-0.06282320618629456,
0.030303366482257843,
0.007844243198633194,
0.004129915963858366,
0.029506821185350418,
-0.030424579977989197,
0.026303322985768318,
0.07799220830202103,
-0.03726448118686676,
0.04540310055017471,
-0.02926439419388771,
-0.01925562508404255,
-0.015385451726615429,
0.02640721946954727,
-0.033281754702329636,
0.02316908910870552,
0.02053702436387539,
0.0610915869474411,
-0.03961948677897453,
-0.009065035730600357,
0.0032835861202329397,
0.038719043135643005,
-0.034822896122932434,
-0.017801063135266304,
0.04027750343084335,
0.003248953726142645,
0.014822674915194511,
-0.07501381635665894,
-0.030944066122174263,
0.02607821114361286,
-0.038061026483774185,
-0.039030734449625015,
0.0043442039750516415,
-0.041662801057100296,
0.017939593642950058,
-0.03475363180041313,
0.04027750343084335,
-0.015368135645985603,
-0.011688441038131714,
0.06905703991651535,
0.018805403262376785,
-0.020779451355338097,
0.07106572389602661,
0.014104052446782589,
-0.015991520136594772,
0.0060390280559659,
-0.0062468224205076694,
-0.012848627753555775,
-0.004839880391955376,
-0.02604357898235321,
-0.0610569529235363,
-0.06136864796280861,
-0.003298737807199359,
-0.0074199954979121685,
-0.03626014292240143,
-0.04155890271067619,
-0.041281841695308685,
0.016043467447161674,
-0.047446414828300476,
-0.021004561334848404,
-0.109092116355896,
-0.02344614826142788,
0.00996547844260931,
-0.020034853368997574,
-0.06161107122898102,
-0.022632285952568054,
-0.03445925563573837,
-0.05167156830430031,
0.06815659999847412,
-0.005259798839688301,
-0.014251240529119968,
0.04200912266969681,
-0.0062468224205076694,
0.03449388965964317,
0.03141160309314728,
0.01585298962891102,
0.042563240975141525,
0.028779540210962296,
-0.0034480902832001448,
-0.03961948677897453,
0.04090088605880737,
0.010987134650349617,
-0.022285960614681244,
0.007342072669416666,
0.013065080158412457,
-0.022389858961105347,
-0.05364561825990677,
-0.03407829999923706,
0.022995926439762115,
0.04955898970365524,
-0.020156066864728928,
0.026424536481499672,
-0.04346368461847305,
-0.05942923203110695,
0.0006975185824558139,
0.0120693976059556,
-0.026926705613732338,
0.07418264448642731,
-0.09399238228797913,
-0.0002228109078714624,
0.03399172052741051,
-0.01993095688521862,
0.05430363118648529,
-0.07979309558868408,
0.04696156084537506,
0.0011298826429992914,
0.035532861948013306,
0.0000700088930898346,
-0.021783791482448578,
-0.010502280667424202,
-0.00006175664020702243,
0.004303078167140484,
0.011541253887116909,
-0.010225221514701843,
-0.03570602461695671,
-0.049662888050079346,
0.00489615835249424,
0.025645306333899498,
-0.029818512499332428,
0.010952502489089966,
-0.010736050084233284,
0.004162383731454611,
0.04138574004173279,
-0.023030558601021767,
0.018164703622460365,
-0.03348954766988754,
-0.002928603906184435,
0.0837411880493164,
0.005748981609940529,
0.03350686654448509,
0.057697609066963196,
0.010493623092770576,
-0.03503069281578064,
0.012164637446403503,
-0.012788021005690098,
-0.04619964584708214,
0.04370611160993576,
-0.05167156830430031,
0.0482083261013031,
0.016424424946308136,
0.07113499194383621,
-0.020104119554162025,
-0.037749335169792175,
-0.03387050703167915,
-0.14601027965545654,
-0.0772302970290184,
-0.0385112501680851,
0.011627834290266037,
-0.03639867156744003,
0.0040476638823747635,
-0.062130559235811234,
-0.010649468749761581,
-0.057974670082330704,
-0.017160363495349884,
0.022978609427809715,
0.006255480460822582,
-0.015376794151961803,
-0.006303100381046534,
0.07252028584480286,
-0.03376660868525505,
0.008943822234869003,
-0.07875411957502365,
-0.020173383876681328,
0.006744663696736097,
-0.021472100168466568,
-0.02379247173666954,
0.017212312668561935,
-0.02410416305065155,
-0.04474508389830589,
-0.04332515597343445,
0.04297883063554764,
0.051913995295763016,
-0.008848583325743675,
0.025195084512233734,
-0.022632285952568054,
0.012796678580343723,
0.006013053935021162,
0.051948629319667816,
0.02219938114285469,
0.039065368473529816,
-0.017801063135266304,
-0.01428587269037962,
-0.032918114215135574,
0.0050606620498001575,
0.03464973345398903,
-0.008662433363497257,
0.01397418137639761,
-0.04606111720204353,
-0.030147520825266838,
0.01698720082640648,
0.0014394099125638604,
0.0023441817611455917,
0.015558614395558834,
0.015818357467651367,
-0.07286661118268967,
-0.03054579347372055,
-0.046719133853912354,
-0.021991586312651634,
0.0037359721027314663,
-0.06174960359930992,
-0.010233880020678043,
0.01713438890874386,
0.0450567752122879,
0.01802617311477661,
-0.05437289923429489,
0.03636404126882553,
-0.012891917489469051,
-0.07930824160575867,
0.014052104204893112,
0.006385351996868849,
-0.040035076439380646,
-0.0901135504245758,
-0.04017360508441925,
0.019099779427051544,
0.0152902128174901,
-0.006878864020109177,
0.044883616268634796,
0.010052059777081013,
-0.0005192157113924623,
-0.06704836338758469,
-0.030008990317583084,
0.0160867590457201,
0.028762223199009895,
0.06943800300359726,
-0.061541806906461716,
-0.0012792350025847554,
-0.04017360508441925,
0.06497041881084442,
0.011532595381140709,
-0.056727901101112366,
0.024848761036992073,
-0.010770682245492935,
0.004584466572850943,
-0.001470795483328402,
-0.008264160715043545,
0.00018547283252701163,
-0.04668449983000755,
0.013108370825648308,
0.0003714867925737053,
-0.09163738042116165,
0.00023349825642071664,
0.017342183738946915,
0.015636537224054337,
0.06479725241661072,
-0.05361098423600197,
0.01601749286055565,
0.04599185287952423,
0.03563676029443741,
0.029645349830389023,
-0.008528233505785465,
0.09364605695009232,
-0.014268556609749794,
-0.06573233008384705,
0.03506532311439514,
-0.016190655529499054,
0.025905048474669456,
0.004357191268354654,
0.011844287626445293,
-0.02062360569834709,
0.012736071832478046,
-0.06874535232782364,
0.02567993849515915,
-0.03636404126882553,
0.03236399590969086,
0.025160452350974083,
-0.01804349012672901,
-0.06074526160955429,
-0.01158454455435276,
0.030459212139248848,
-0.029039282351732254,
0.005272785667330027,
-0.029333658516407013,
-0.04138574004173279,
0.019428787752985954,
-0.006943800020962954,
0.0051255980506539345,
0.04755030944943428,
-0.016640877351164818,
-0.0078096105717122555,
-0.02155868150293827,
-0.006242493633180857,
-0.012008790858089924,
-0.03409561514854431,
-0.04041603207588196,
0.02119504101574421,
-0.06285783648490906,
0.030753588303923607,
0.020814083516597748,
0.06469336152076721,
0.04682302847504616,
0.00635504862293601,
0.044814348220825195,
0.005471921991556883,
-0.025558724999427795,
-0.0014026130083948374,
-0.05049406737089157,
0.024675598368048668,
-0.01492657233029604,
0.008632129989564419,
-0.029350975528359413,
-0.048000533133745193,
0.02472754754126072,
-0.014433060772716999,
-0.01014729868620634,
-0.005484909284859896,
-0.02632063813507557,
-0.012917892076075077,
0.02091798186302185,
-0.029402922838926315,
-0.016978543251752853,
-0.04048529639840126,
-0.03347223252058029,
0.014363795518875122,
-0.029091231524944305,
0.046719133853912354,
-0.01543740089982748,
0.05115208402276039,
0.01956731639802456,
0.024831444025039673,
0.004761957563459873,
0.019220992922782898,
-0.06316953152418137,
-0.016190655529499054,
0.02183574065566063,
-0.06323879957199097,
-0.015021811239421368,
-0.022701550275087357,
0.077368825674057,
0.023584676906466484,
0.004110435023903847,
-0.019030513241887093,
0.05118671432137489,
-0.0769532322883606,
-0.043186627328395844,
-0.005896169226616621,
0.021714527159929276,
0.00442862045019865,
-0.02992240898311138,
0.00019304867601022124,
0.02349809557199478,
0.030753588303923607,
0.04148963838815689,
-0.012848627753555775,
-0.032000355422496796,
-0.05589672550559044,
0.00824684463441372,
0.019775111228227615,
-0.025229716673493385,
-0.015619221143424511,
-0.014649513177573681,
0.009723051451146603,
0.016372475773096085,
0.029679981991648674,
-0.002044395077973604,
0.03622550889849663,
-0.04266713932156563,
-0.035879187285900116,
0.00714293634518981,
-0.0015346490545198321,
0.01189623586833477,
-0.029420239850878716,
-0.020987246185541153,
-0.00048160707228817046,
-0.053195394575595856,
0.0578707717359066,
0.03345491737127304,
-0.020779451355338097,
0.02857174538075924,
0.003116917796432972,
0.03733374923467636,
0.014268556609749794,
-0.05984481796622276,
-0.012147320434451103,
0.009480624459683895,
0.005679716821759939,
0.016485031694173813,
-0.010502280667424202,
0.0322427824139595,
-0.0072598205879330635,
-0.031065279617905617,
0.03923853114247322,
0.03757617622613907,
0.03113454394042492,
0.01795690879225731,
-0.0033420284744352102,
-0.0023896368220448494,
0.01749802939593792,
-0.011489304713904858,
0.02188768796622753,
-0.0022727525793015957,
-0.016978543251752853,
0.05658937245607376,
-0.008160263299942017,
-0.03387050703167915,
0.014268556609749794,
0.012701439671218395,
0.04443339258432388,
0.05232958495616913,
0.0482083261013031,
0.020086802542209625,
0.08651178330183029,
0.010190589353442192,
0.053195394575595856,
0.05433826521039009,
0.004186193458735943,
0.05942923203110695,
0.0026190767530351877,
0.017939593642950058,
-0.032589107751846313,
-0.03799176216125488,
0.03509995713829994,
0.010891895741224289,
0.02278813160955906,
-0.00027841218980029225,
-0.012433038093149662,
-0.04041603207588196,
-0.026874756440520287,
-0.025801151990890503,
-0.036814261227846146,
0.044848982244729996,
0.0225110724568367,
0.011956842616200447,
-0.012346457690000534,
0.002350675407797098,
-0.029299026355147362,
0.006385351996868849,
-0.03591381758451462,
0.034563153982162476,
0.004658060148358345,
0.008783646859228611,
0.00212556472979486,
-0.013428720645606518,
0.005523870699107647,
-0.02540287934243679,
-0.021766474470496178,
0.02245912328362465,
-0.011740390211343765,
-0.022337909787893295,
0.04917803406715393,
0.0128572853282094,
0.02188768796622753,
0.001445903442800045,
0.025143135339021683,
-0.014736094512045383,
0.04412170127034187,
-0.002471888903528452,
0.021731842309236526,
-0.06209592521190643,
-0.024294640868902206,
-0.03496142849326134,
-0.014398427680134773,
0.08207882940769196,
0.008471955545246601,
0.025558724999427795,
0.04051993042230606,
0.051602303981781006
]
|
36,344 | statistics | __repr__ | null | def __repr__(self):
return f'{type(self).__name__}(mu={self._mu!r}, sigma={self._sigma!r})'
| (self) | [
0.04197035729885101,
-0.029322002083063126,
0.1038345918059349,
0.03892902657389641,
0.04697960615158081,
-0.051273249089717865,
-0.0036987941712141037,
-0.06118440628051758,
0.0331147201359272,
0.004302587825804949,
-0.025457723066210747,
0.005528064910322428,
-0.012218991294503212,
0.05578157305717468,
-0.043330010026693344,
0.03942995145916939,
0.0015396734233945608,
-0.04880440607666969,
0.015680741518735886,
0.04708694666624069,
-0.020537924021482468,
0.05005671828985214,
0.01168228592723608,
-0.016789931803941727,
0.009159770794212818,
0.012022199109196663,
-0.0025023885536938906,
-0.032882146537303925,
-0.010188456624746323,
-0.023024659603834152,
-0.0758543536067009,
-0.03692532703280449,
0.03397344797849655,
-0.025046247988939285,
0.023740265518426895,
-0.0455126129090786,
-0.017460813745856285,
0.02161133475601673,
-0.06830469518899918,
-0.021575555205345154,
0.055387988686561584,
-0.0202516820281744,
-0.007795644924044609,
-0.029626134783029556,
-0.03402711823582649,
-0.01236211322247982,
0.06190001592040062,
0.028409602120518684,
-0.04708694666624069,
-0.0662294402718544,
0.03059220314025879,
0.042328160256147385,
0.0010885054944083095,
0.0018449246417731047,
-0.053384289145469666,
0.017988573759794235,
0.053777873516082764,
-0.02055581472814083,
-0.020233791321516037,
0.04254284128546715,
-0.02250584401190281,
0.0522393174469471,
0.032434891909360886,
-0.07055886089801788,
-0.01883835718035698,
-0.03586980700492859,
-0.037998735904693604,
0.04712272807955742,
-0.01069832593202591,
0.059216488152742386,
0.012710971757769585,
-0.03384821489453316,
-0.037748273462057114,
0.02789078652858734,
0.00006726287392666563,
-0.02772977575659752,
-0.04290064796805382,
-0.016870437189936638,
0.0022675800137221813,
-0.0573916919529438,
0.008189229294657707,
-0.002439772943034768,
-0.03910792991518974,
-0.026692144572734833,
-0.007115818094462156,
-0.05878712236881256,
-0.044797006994485855,
-0.024402203038334846,
-0.01980442740023136,
0.00534021807834506,
-0.06855516135692596,
0.022344831377267838,
-0.0007726320764049888,
0.05850088223814964,
-0.02306043915450573,
0.001686149276793003,
-0.004669336602091789,
-0.05653296038508415,
0.08608753234148026,
-0.01577913761138916,
0.037855617702007294,
0.0004746487829834223,
-0.0009699830552563071,
0.017702331766486168,
-0.05517330765724182,
0.0012098232982680202,
-0.01492040790617466,
0.013319237157702446,
0.006851938087493181,
-0.006122913211584091,
-0.031576164066791534,
0.0911683440208435,
0.03781983628869057,
0.017496593296527863,
0.0031822153832763433,
-0.04104006662964821,
-0.031683504581451416,
0.025994427502155304,
0.06737440824508667,
0.030681654810905457,
-0.0223627220839262,
0.03968041390180588,
-0.026065988466143608,
0.005693549290299416,
-0.04887596517801285,
0.04415296018123627,
-0.014777286909520626,
-0.02241639234125614,
-0.008882473222911358,
-0.06884140521287918,
0.018462663516402245,
-0.012317387387156487,
-0.025511393323540688,
0.054243020713329315,
0.053491633385419846,
0.0038396792951971292,
0.03336518257856369,
0.014383702538907528,
0.042829085141420364,
0.1459122896194458,
0.017317691817879677,
-0.008793022483587265,
0.0036026346497237682,
0.01044786348938942,
-0.026441682130098343,
0.024634774774312973,
0.03853544220328331,
0.09474638104438782,
-0.008761714212596416,
-0.06698082387447357,
0.002070788061246276,
0.04672914370894432,
0.07556810975074768,
0.01903514936566353,
-0.001345117692835629,
0.02200491912662983,
0.01605643518269062,
-0.03989509493112564,
0.00809977762401104,
-0.01261257566511631,
-0.05345585197210312,
-0.02280997671186924,
0.00969647616147995,
-0.030932117253541946,
0.026656365022063255,
0.043330010026693344,
0.050164058804512024,
-0.03459960222244263,
-0.0015083656180649996,
-0.0045754131861031055,
-0.043186888098716736,
-0.09796661138534546,
-0.054636601358652115,
0.051631052047014236,
0.0029876597691327333,
0.07023683935403824,
0.0011583890300244093,
0.09589135646820068,
-0.03100367821753025,
-0.03256012499332428,
0.05825041979551315,
-0.05893024429678917,
-0.0556742325425148,
-0.04100428894162178,
0.024634774774312973,
-0.06844782084226608,
0.0061900014989078045,
-0.008104250766336918,
0.014294251799583435,
-0.027819225564599037,
0.006534387357532978,
0.015242431312799454,
-0.01614588499069214,
0.01221004594117403,
0.004669336602091789,
-0.022291161119937897,
-0.010975624434649944,
-0.05170261487364769,
0.03227388113737106,
-0.008730406872928143,
0.002685762941837311,
0.022219600155949593,
-0.019410843029618263,
0.015662850812077522,
0.018659455701708794,
-0.02114618942141533,
0.008090833202004433,
-0.004629083443433046,
0.011914858594536781,
-0.004052125383168459,
0.013596534729003906,
-0.0004103559476789087,
0.02697838842868805,
0.010385247878730297,
0.018874136731028557,
-0.05506596714258194,
0.018731016665697098,
-0.02583341673016548,
-0.05882290378212929,
0.05248977988958359,
0.08401227742433548,
-0.061470650136470795,
0.014428428374230862,
-0.0053536356426775455,
-0.0610770657658577,
-0.00045647905790247023,
0.006704343948513269,
0.0017756001325324178,
-0.025439832359552383,
-0.020609484985470772,
0.036961108446121216,
-0.031880296766757965,
-0.04490434750914574,
0.00886458344757557,
-0.0531696081161499,
0.06479822099208832,
-0.009481794200837612,
0.010107950307428837,
-0.03647807240486145,
0.011109800077974796,
-0.04175567626953125,
0.028821077197790146,
0.02075260691344738,
0.015358717180788517,
0.04336579144001007,
-0.051273249089717865,
0.03817763924598694,
0.07138180732727051,
-0.03191607818007469,
-0.0027528509963303804,
-0.00707109272480011,
-0.009785926900804043,
-0.03370509669184685,
0.01575230062007904,
0.0327211357653141,
-0.017952794209122658,
-0.006838520523160696,
0.009016649797558784,
0.0447254441678524,
0.021414542570710182,
-0.006963751744478941,
-0.029626134783029556,
0.022953098639845848,
0.041934575885534286,
0.013032994233071804,
0.01839110255241394,
-0.0412905290722847,
-0.005384943448007107,
0.007111345883458853,
-0.003358880989253521,
0.13281668722629547,
0.04823191836476326,
-0.052024636417627335,
0.01065360102802515,
-0.03356197476387024,
-0.05742746964097023,
0.0006457236013375223,
0.03234544023871422,
-0.03792717680335045,
-0.01894569769501686,
0.01894569769501686,
-0.045691512525081635,
0.006279452238231897,
0.005407306365668774,
0.009293947368860245,
0.03211287036538124,
0.024187520146369934,
-0.016074324026703835,
0.03778405487537384,
-0.0030704017262905836,
0.02969769574701786,
-0.0027304883114993572,
-0.009607025422155857,
0.002274288795888424,
0.07206163555383682,
-0.06136330962181091,
0.030985787510871887,
0.007531764917075634,
-0.003043566597625613,
0.0242769718170166,
0.010886172764003277,
-0.018051190301775932,
0.056497182697057724,
0.03681798651814461,
-0.026763705536723137,
-0.02597653865814209,
0.05037873983383179,
-0.012576795183122158,
0.012809366919100285,
0.00572932930663228,
-0.006860882975161076,
0.06705238670110703,
0.01459838543087244,
0.05477972328662872,
0.02984081581234932,
0.025457723066210747,
0.0058187805116176605,
-0.03434913977980614,
0.020609484985470772,
0.08909308910369873,
-0.0028020490426570177,
-0.0029720058664679527,
-0.01318506058305502,
0.018239036202430725,
-0.010412083938717842,
-0.048160359263420105,
-0.07131025195121765,
0.014652055688202381,
0.018239036202430725,
0.0045552863739430904,
-0.05467238277196884,
-0.04526215046644211,
0.016127996146678925,
0.04028867930173874,
-0.01755920983850956,
0.008283152244985104,
0.03631706163287163,
0.009732256643474102,
-0.037712495774030685,
-0.07621216028928757,
0.03171928599476814,
0.011217141523957253,
-0.020269570872187614,
0.017872286960482597,
-0.03939417004585266,
0.00964280590415001,
-0.013202951289713383,
-0.012218991294503212,
0.07478094100952148,
0.03764093294739723,
-0.037998735904693604,
0.013498139567673206,
0.011261867359280586,
0.001377543667331338,
0.009848542511463165,
0.01288987323641777,
-0.028803186491131783,
0.03942995145916939,
-0.05545955151319504,
0.05825041979551315,
0.05774949491024017,
-0.022487953305244446,
-0.008095305413007736,
0.005344690755009651,
0.0020830875728279352,
-0.01853422448039055,
-0.00947284884750843,
0.003985037095844746,
0.05799995735287666,
0.008484416641294956,
-0.0387859046459198,
-0.00877960491925478,
-0.06111284717917442,
-0.0339018851518631,
-0.06748174875974655,
0.07578279078006744,
-0.04229237884283066,
0.006632783450186253,
-0.03942995145916939,
-0.0919555127620697,
0.04758787155151367,
-0.008649900555610657,
0.015027749352157116,
0.0383923202753067,
-0.01994754746556282,
0.011002459563314915,
0.008077415637671947,
0.030413301661610603,
0.007402061019092798,
0.032327551394701004,
-0.05173839256167412,
-0.04769521579146385,
0.05170261487364769,
-0.012057979591190815,
-0.015152980573475361,
-0.03717578947544098,
0.00036814631312154233,
-0.03279269486665726,
-0.08980869501829147,
-0.009240277111530304,
-0.012129540555179119,
-0.008985341526567936,
-0.021235641092061996,
-0.011592835187911987,
-0.02261318452656269,
-0.05367053300142288,
0.014553659595549107,
0.028660064563155174,
0.018176421523094177,
-0.003432677825912833,
-0.001441277447156608,
-0.006972696632146835,
-0.044546544551849365,
-0.030967898666858673,
0.08029111474752426,
-0.04204191640019417,
-0.01758604496717453,
-0.06268718093633652,
0.026888936758041382,
0.011825407855212688,
-0.031933967024087906,
0.04297220706939697,
0.025851307436823845,
0.042578622698783875,
-0.010358412750065327,
0.04347313195466995,
-0.04658602178096771,
0.031826626509428024,
0.045798856765031815,
0.04880440607666969,
-0.04637134075164795,
0.012773587368428707,
0.02411595918238163,
0.012737806886434555,
0.0070040044374763966,
-0.07098822295665741,
-0.021432433277368546,
-0.026048099622130394,
-0.0070800380781292915,
0.040217120200395584,
0.016315842047333717,
-0.00939234346151352,
-0.004421110264956951,
-0.0297513660043478,
-0.03003760799765587,
0.0121384859085083,
-0.0349574089050293,
0.018212201073765755,
0.01725507713854313,
-0.015743356198072433,
0.06164955347776413,
0.03356197476387024,
-0.0023346683010458946,
-0.037998735904693604,
0.023829717189073563,
-0.016870437189936638,
-0.03028807044029236,
-0.0953904315829277,
0.0075943805277347565,
-0.02708572894334793,
-0.045941974967718124,
0.03370509669184685,
-0.013900668360292912,
0.05180995538830757,
-0.00720974151045084,
-0.004119213204830885,
0.1079135537147522,
-0.0345638245344162,
-0.06479822099208832,
-0.023042548447847366,
0.037605155259370804,
0.018766796216368675,
-0.008564922958612442,
-0.033329401165246964,
-0.05392099544405937,
0.05470816418528557,
-0.03170139342546463,
0.00006949914677534252,
-0.031236249953508377,
-0.047659434378147125,
-0.05005671828985214,
-0.0635816901922226,
0.002929516602307558,
0.04483278468251228,
0.013095609843730927,
0.04994937777519226,
-0.004392038565129042,
0.02899997867643833,
0.0416841134428978,
0.02950090356171131,
-0.015412388369441032,
0.07563967257738113,
-0.03266746550798416,
0.022774197161197662,
-0.024581104516983032,
0.02925044111907482,
0.005537009797990322,
-0.033132608979940414,
-0.04923376813530922,
0.009240277111530304,
0.003835206851363182,
-0.025904977694153786,
-0.007764337118715048,
-0.024831566959619522,
0.025994427502155304,
-0.0416841134428978,
0.03025229088962078,
0.00017177365953102708,
-0.010483643971383572,
-0.04400983825325966,
0.03558356314897537,
-0.054887063801288605,
0.022344831377267838,
-0.008954034186899662,
-0.014025899581611156,
-0.05198885500431061,
-0.0202516820281744,
0.0057830000296235085,
-0.018462663516402245,
-0.008998759090900421,
0.027157289907336235,
-0.004852710757404566,
-0.09531886875629425,
-0.030681654810905457,
-0.037354692816734314,
0.04143365100026131,
0.0025493502616882324,
0.0028669009916484356,
-0.001626888057217002,
0.07173961400985718,
0.008690154179930687,
-0.022076480090618134,
-0.02266685478389263,
0.013721765950322151,
-0.055745795369148254,
0.08386915177106857,
-0.0362812802195549,
0.009580190293490887,
-0.01994754746556282,
0.014678890816867352,
0.016315842047333717,
-0.019357172772288322,
0.007419951260089874,
-0.006006627343595028,
0.03692532703280449,
-0.032381221652030945,
0.010537315160036087,
-0.00782248005270958,
0.016271116212010384,
-0.04819614067673683,
0.026459572836756706,
-0.044546544551849365,
-0.025243040174245834,
-0.02708572894334793,
0.015215596184134483,
0.05431457981467247,
0.019768645986914635,
0.034438591450452805,
-0.004432291723787785,
0.029483012855052948,
0.0031643251422792673,
0.015045639127492905,
0.09302892535924911,
-0.017988573759794235,
-0.009065847843885422,
0.023239340633153915,
-0.021164080128073692,
0.02703205868601799,
-0.047051168978214264,
-0.012710971757769585,
-0.0038195529486984015,
-0.011387098580598831,
0.06902030855417252,
0.017076173797249794,
-0.03753359243273735,
0.03406289964914322,
0.009982719086110592,
0.04515480995178223,
-0.03191607818007469,
-0.010662546381354332,
0.007563072722405195,
0.008676736615598202,
-0.043830934911966324,
-0.04858972132205963,
-0.0044814893044531345,
0.0007726320764049888,
-0.06139909103512764,
0.0048035127110779285,
-0.007393116131424904,
0.004070015624165535,
-0.03792717680335045,
-0.012549960054457188,
-0.009839598089456558,
-0.025189369916915894,
0.03849966078996658,
-0.026191219687461853,
0.014839902520179749,
-0.03059220314025879,
0.012004309333860874,
0.04197035729885101,
0.004919799044728279,
0.010635710321366787,
0.0010437800083309412,
0.04429607838392258,
0.011467603966593742,
-0.029483012855052948,
0.05742746964097023,
0.014866737648844719,
-0.012746751308441162,
0.020484253764152527,
-0.01914248988032341,
0.016271116212010384,
-0.02497468888759613,
-0.03681798651814461,
0.0007748682983219624,
-0.031933967024087906,
-0.01695094257593155,
-0.012880927883088589,
-0.007138181012123823,
0.04061070457100868,
-0.010233181528747082,
0.03513630852103233,
-0.05653296038508415,
0.003765882458537817,
0.004159466363489628,
-0.004206427838653326,
-0.008095305413007736,
-0.03291792795062065,
0.04139786958694458,
-0.07055886089801788,
0.01386488787829876,
0.02472422644495964,
0.0213072020560503,
-0.09861066192388535,
-0.048160359263420105,
0.0238118264824152,
-0.015018803998827934,
0.03900058940052986,
-0.04651446267962456,
0.04000243917107582,
0.003050275379791856,
-0.012505234219133854,
-0.06286608427762985,
0.02919677086174488,
-0.02708572894334793,
0.012630465440452099,
-0.04161255434155464,
-0.04805301874876022,
0.02511780895292759,
-0.04336579144001007,
-0.03860700502991676,
0.043687812983989716,
0.009687530808150768,
-0.005165788810700178,
-0.006073715165257454,
-0.04175567626953125,
-0.025457723066210747,
0.011270811781287193,
-0.010465754196047783,
-0.012514179572463036,
-0.05359897390007973,
-0.04937689006328583,
0.004799040034413338,
-0.01592225767672062,
0.05993209406733513,
0.0025493502616882324,
-0.03828497976064682,
0.013632315210998058,
0.0020372439175844193,
-0.060969725251197815,
-0.02552928403019905,
0.021074630320072174,
-0.01110085565596819,
-0.06408261507749557,
-0.07900302857160568,
0.02291731722652912,
0.038964807987213135,
0.01019740104675293,
0.038106080144643784,
-0.01703144982457161,
0.05882290378212929,
0.009374452754855156,
-0.0271751806139946,
-0.036853767931461334,
0.04869706556200981,
0.02245217375457287,
-0.02094939909875393,
0.043580472469329834,
-0.022344831377267838,
-0.0331147201359272,
-0.039573073387145996,
-0.07327816635370255,
0.02111040987074375,
-0.014508933760225773,
0.04587041586637497,
0.0242769718170166,
0.031218361109495163,
-0.02789078652858734,
0.02325723133981228,
-0.01336396299302578,
0.019321391358971596,
0.03270324319601059,
0.007603325415402651,
0.018927808851003647,
0.030413301661610603,
0.02527882158756256,
0.052275098860263824,
0.009490739554166794,
0.03753359243273735,
-0.0027103619650006294,
0.042685963213443756,
0.09453170001506805,
0.015877533704042435,
-0.028463272377848625,
0.011950639076530933,
0.015018803998827934,
-0.01858789473772049,
0.06129175052046776,
-0.018319541588425636,
-0.010796722024679184,
-0.016011709347367287,
-0.0007402061019092798,
0.05631827935576439,
0.009848542511463165,
-0.002786395139992237,
0.06343857198953629,
-0.05109434947371483,
-0.030878446996212006,
-0.026262780651450157,
-0.037354692816734314,
0.000007355239176831674,
0.06268718093633652,
-0.047802556306123734,
0.009204496629536152,
0.017908068373799324,
-0.007366280537098646,
0.009302892722189426,
0.020430583506822586,
-0.012057979591190815,
0.03211287036538124,
-0.00209762342274189,
0.040968507528305054,
0.008283152244985104,
0.013632315210998058,
0.03849966078996658,
0.022970987483859062,
0.00435625808313489,
0.03978775441646576,
0.008381548337638378,
0.01261257566511631,
0.06565695255994797,
0.03517208993434906,
-0.039072148501873016,
0.00040364713640883565,
0.06143486872315407,
-0.04290064796805382,
0.040825385600328445,
-0.010456808842718601,
0.0015463822055608034,
-0.05900180712342262,
-0.03864278271794319,
-0.03019862063229084,
0.04558417201042175,
0.05037873983383179,
-0.036102380603551865,
0.05087966471910477,
-0.008403911255300045,
-0.02481367625296116
]
|
36,346 | statistics | __rsub__ | Subtract a NormalDist from a constant or another NormalDist. | def __rsub__(x1, x2):
"Subtract a NormalDist from a constant or another NormalDist."
return -(x1 - x2)
| (x1, x2) | [
-0.012646421790122986,
-0.0012158313766121864,
0.07717423141002655,
0.024778112769126892,
-0.005591049790382385,
-0.054384052753448486,
-0.010063889436423779,
0.014714222401380539,
0.026446552947163582,
-0.009238543920218945,
0.0019380087032914162,
0.010631868615746498,
0.00658057676628232,
0.03102588839828968,
-0.06361372023820877,
0.044231414794921875,
0.005750793963670731,
0.029481694102287292,
-0.012513301335275173,
-0.027760004624724388,
-0.007814157754182816,
0.037948139011859894,
-0.028168240562081337,
0.008315577171742916,
-0.02204471081495285,
0.0010383378248661757,
-0.0030994827393442392,
-0.06663111597299576,
0.02236419916152954,
-0.025346091017127037,
0.01665777899324894,
0.00914092268794775,
-0.007223991211503744,
-0.03489524871110916,
-0.018299594521522522,
-0.06677310913801193,
0.01143946498632431,
0.078523188829422,
-0.013134529814124107,
0.039261594414711,
-0.02914445661008358,
-0.03752215579152107,
0.05335458740592003,
0.030031923204660416,
0.03230384364724159,
-0.02236419916152954,
-0.012566549703478813,
-0.04188849776983261,
-0.05949586629867554,
0.045296378433704376,
0.011341843754053116,
0.009788773953914642,
0.03947458416223526,
0.022701436653733253,
-0.02369540184736252,
0.04636133834719658,
0.03741566091775894,
0.09229668974876404,
-0.04103653132915497,
0.00970890186727047,
0.031824611127376556,
0.0037295850925147533,
-0.10081638395786285,
-0.04348594322800636,
0.03649269416928291,
-0.02066025882959366,
-0.009913019835948944,
0.01117322500795126,
0.026464302092790604,
0.0736953616142273,
-0.05967336148023605,
0.050514690577983856,
0.004517212975770235,
-0.006567264907062054,
0.073127381503582,
0.01539757288992405,
0.05662047117948532,
0.03246358782052994,
0.06002834811806679,
-0.033262308686971664,
0.02539934031665325,
-0.032854072749614716,
0.03622645139694214,
0.014190616086125374,
-0.004779016133397818,
-0.012318058870732784,
-0.01601880043745041,
-0.06613413244485855,
0.01943555288016796,
0.01650690846145153,
-0.06758958101272583,
0.013391895219683647,
-0.009913019835948944,
-0.04657433182001114,
0.05381607264280319,
0.046006351709365845,
-0.04646783322095871,
-0.008967866189777851,
0.013817880302667618,
-0.05605249106884003,
0.08242804557085037,
0.06986149400472641,
-0.007898466661572456,
0.017997855320572853,
0.054774537682533264,
0.02046501636505127,
0.021352484822273254,
-0.05779192969202995,
0.008173582144081593,
0.021654224023222923,
-0.04416041821241379,
0.051544152200222015,
-0.02696128375828266,
0.01489171665161848,
-0.08271203935146332,
-0.04281146451830864,
-0.05953136831521988,
-0.0023761962074786425,
0.012602047994732857,
0.056868962943553925,
0.03354629874229431,
0.005488990806043148,
-0.004477276932448149,
0.03585371375083923,
0.012770667672157288,
0.01691514439880848,
0.00441071717068553,
0.0030062985606491566,
-0.020624760538339615,
-0.012664170935750008,
0.003157168161123991,
-0.006238901522010565,
-0.026144813746213913,
0.014128494076430798,
0.032729826867580414,
0.02204471081495285,
0.07752922177314758,
0.04994671046733856,
0.0629037469625473,
0.0318601094186306,
0.05814691632986069,
0.03262333199381828,
0.0701809823513031,
0.04607734829187393,
-0.018352841958403587,
0.04650333523750305,
0.009291792288422585,
0.03287182375788689,
-0.006727009080350399,
0.030883893370628357,
-0.03594246134161949,
0.04082353785634041,
0.07319837808609009,
-0.05800492316484451,
0.0012402368010953069,
0.022648189216852188,
-0.025860823690891266,
-0.060738325119018555,
-0.014137368649244308,
-0.0290379598736763,
-0.0011703487252816558,
0.03603120893239975,
0.02174297161400318,
-0.028665222227573395,
0.04014906287193298,
-0.04174650460481644,
0.09904145449399948,
-0.04355693981051445,
-0.02548808604478836,
0.00013339756696950644,
0.003088389290496707,
-0.013329772278666496,
-0.013995373621582985,
0.006238901522010565,
-0.037344660609960556,
-0.007330487482249737,
0.0008320014458149672,
0.021565476432442665,
-0.03649269416928291,
0.028895964846014977,
0.10223633795976639,
-0.05867939814925194,
0.006869003642350435,
-0.03354629874229431,
0.029304200783371925,
-0.0017671710811555386,
-0.040681540966033936,
0.05211213231086731,
0.04259847477078438,
0.00018262430967297405,
0.026996782049536705,
-0.028594225645065308,
-0.017891358584165573,
-0.03448701277375221,
-0.003163824090734124,
-0.005653172265738249,
-0.08115009218454361,
-0.042562976479530334,
0.04174650460481644,
0.007636663969606161,
-0.08526794612407684,
0.01785586029291153,
-0.03375928848981857,
-0.015370949171483517,
0.01750974729657173,
-0.014652100391685963,
-0.008834745734930038,
-0.019382305443286896,
-0.04274046793580055,
-0.044976890087127686,
0.010063889436423779,
0.014714222401380539,
0.05413556098937988,
-0.011874324642121792,
-0.007006561383605003,
-0.030014174059033394,
-0.019701793789863586,
-0.01514908205717802,
-0.0018681205110624433,
0.006531766150146723,
0.03674118220806122,
-0.08484195917844772,
0.0534965842962265,
-0.004386311396956444,
-0.009744401089847088,
0.03257008269429207,
0.02403263933956623,
-0.003243696177378297,
0.0013678104151040316,
-0.012034068815410137,
0.03759315237402916,
0.011048979125916958,
0.025133099406957626,
-0.06897402554750443,
-0.020092280581593513,
0.02392614260315895,
-0.03958108276128769,
0.052289627492427826,
0.035658471286296844,
0.033067066222429276,
-0.06066732481122017,
0.01909831538796425,
0.004783453419804573,
0.013542764820158482,
0.01785586029291153,
-0.0017793737351894379,
0.006926689296960831,
0.03521473705768585,
-0.028363483026623726,
0.02339366264641285,
-0.045899856835603714,
-0.037238165736198425,
-0.06205177679657936,
0.048952747136354446,
0.022470694035291672,
-0.0228611808270216,
-0.01410186942666769,
-0.029162205755710602,
0.001526445266790688,
0.030848395079374313,
0.013116779737174511,
-0.04554486647248268,
-0.0363151989877224,
-0.020536014810204506,
-0.025630081072449684,
0.020092280581593513,
-0.021334735676646233,
0.03017391823232174,
0.017500873655080795,
0.03990057110786438,
0.018938571214675903,
-0.012131690047681332,
-0.021973712369799614,
-0.03833862766623497,
-0.01785586029291153,
0.06418170034885406,
0.022506194189190865,
-0.03876461088657379,
0.07426334172487259,
0.018636832013726234,
0.019932536408305168,
-0.028895964846014977,
-0.057507939636707306,
-0.005697546061128378,
-0.012096191756427288,
-0.015299951657652855,
0.013134529814124107,
-0.058324411511421204,
-0.01048987451940775,
0.025754326954483986,
0.00509406765922904,
0.001512023969553411,
0.024920107796788216,
0.0247426126152277,
0.015273327939212322,
-0.0030772960744798183,
-0.014545603655278683,
-0.06222927197813988,
0.01899181865155697,
0.07816819846630096,
-0.026819288730621338,
-0.010285756550729275,
-0.050195202231407166,
-0.02067800983786583,
-0.003689649049192667,
-0.05303509905934334,
0.08285403251647949,
0.0071174949407577515,
0.02204471081495285,
0.035658471286296844,
-0.013720258139073849,
-0.03423852473497391,
-0.06006384640932083,
0.008537444286048412,
-0.0011958633549511433,
0.02862972393631935,
0.04518987983465195,
-0.018619082868099213,
0.019826039671897888,
0.03904860094189644,
-0.01237130630761385,
-0.0031194507610052824,
-0.015796933323144913,
0.04330844804644585,
0.010321254841983318,
-0.027405017986893654,
-0.04082353785634041,
0.03249908611178398,
0.0457223616540432,
0.06411070376634598,
-0.0588923916220665,
0.00775647209957242,
0.019932536408305168,
-0.011111102066934109,
-0.022612689062952995,
-0.016693277284502983,
0.07461832463741302,
0.020092280581593513,
0.0019002913031727076,
-0.005910538136959076,
-0.007268364541232586,
0.03773514926433563,
-0.02465386688709259,
-0.027192026376724243,
0.005768543109297752,
-0.0022386384662240744,
0.0003635846369434148,
-0.028594225645065308,
0.05924737825989723,
-0.02705003134906292,
-0.011350718326866627,
0.024778112769126892,
-0.00345890736207366,
-0.01984378881752491,
0.03237484022974968,
-0.006664886139333248,
-0.045296378433704376,
-0.009611280634999275,
0.012087317183613777,
-0.07696124166250229,
-0.022080209106206894,
-0.011057853698730469,
-0.058856889605522156,
-0.026162562891840935,
-0.06719908863306046,
-0.045296378433704376,
-0.07554129511117935,
-0.03606670722365379,
-0.03759315237402916,
-0.03303156793117523,
-0.03246358782052994,
-0.021867215633392334,
-0.005484553519636393,
-0.022594939917325974,
-0.015291077084839344,
-0.019382305443286896,
-0.035338982939720154,
-0.006247776094824076,
-0.02518634684383869,
0.008630628697574139,
0.039119597524404526,
0.011395092122256756,
-0.07440533488988876,
0.01732337847352028,
-0.014873966574668884,
0.05275110900402069,
-0.028132742270827293,
-0.018228596076369286,
0.05615898594260216,
0.03840962424874306,
0.014119619503617287,
-0.02839898318052292,
0.046538833528757095,
0.00015946694475132972,
-0.056549474596977234,
0.00445287162438035,
0.01143946498632431,
-0.05062118545174599,
-0.03791264072060585,
-0.007139681838452816,
0.0008103693835437298,
0.1312742978334427,
-0.01984378881752491,
0.019240310415625572,
0.013880002312362194,
-0.004992008674889803,
0.046645328402519226,
0.023145170882344246,
-0.016107548028230667,
0.048207271844148636,
-0.08988277614116669,
-0.020305272191762924,
-0.0440894216299057,
0.0008985615568235517,
0.04430241137742996,
-0.06276175379753113,
-0.004264284856617451,
0.02069575898349285,
0.011102227494120598,
-0.013809004798531532,
-0.030528906732797623,
-0.05303509905934334,
0.03359954431653023,
-0.04132051765918732,
-0.004517212975770235,
0.008430947549641132,
-0.0009213029406964779,
-0.0534965842962265,
-0.016995016485452652,
0.03457576036453247,
-0.054561544209718704,
-0.022648189216852188,
-0.029818931594491005,
-0.024600617587566376,
0.0432729497551918,
-0.027972998097538948,
0.02610931359231472,
0.003507717978209257,
0.0028953650034964085,
0.06066732481122017,
0.007250615395605564,
0.03594246134161949,
0.03787714242935181,
-0.0043108765967190266,
-0.06407520174980164,
-0.002231982536613941,
0.01253992598503828,
-0.04284696653485298,
0.030866144225001335,
-0.05949586629867554,
0.03801913931965828,
0.02745826542377472,
0.006789131555706263,
-0.004299783613532782,
-0.04888174682855606,
-0.07539930194616318,
-0.09400063008069992,
-0.03432726860046387,
-0.031806860119104385,
-0.019169313833117485,
-0.06382670998573303,
0.044976890087127686,
-0.0618387833237648,
-0.0019202593248337507,
-0.019062817096710205,
0.0019613048061728477,
0.0866168960928917,
-0.025133099406957626,
-0.006221151910722256,
0.0011703487252816558,
0.0040712603367865086,
-0.0459708534181118,
0.0069444384425878525,
-0.004523869138211012,
0.010924733243882656,
0.03667018562555313,
-0.04607734829187393,
-0.024831360206007957,
0.0005616009584628046,
-0.03301381692290306,
0.02841673232614994,
0.007277239114046097,
-0.020553763955831528,
0.013232151046395302,
0.041604507714509964,
-0.022896679118275642,
-0.0865458995103836,
0.05012420564889908,
0.023056423291563988,
0.025115350261330605,
0.006434144452214241,
0.01403974648565054,
-0.02236419916152954,
0.007365986239165068,
-0.03265883028507233,
-0.014030871912837029,
-0.006469643209129572,
-0.01629391685128212,
0.04071703925728798,
0.0018647925462573767,
-0.01520233042538166,
-0.03445151448249817,
-0.014226115308701992,
-0.010046140290796757,
-0.02392614260315895,
0.054029062390327454,
-0.027227524667978287,
0.029641438275575638,
-0.004086791072040796,
-0.0036874304059892893,
-0.0031837921123951674,
0.00048755283933132887,
0.07355336099863052,
0.04199499636888504,
0.036190953105688095,
0.023517906665802002,
-0.026482051238417625,
0.04700031504034996,
0.034203022718429565,
-0.03217959776520729,
0.0013445143122226,
0.006132405251264572,
-0.05882139131426811,
-0.07213341444730759,
0.012628672644495964,
-0.040468551218509674,
-0.04334394633769989,
-0.03477100282907486,
0.034007780253887177,
-0.024884607642889023,
-0.04085903614759445,
-0.04135601967573166,
0.019382305443286896,
0.005604361649602652,
0.00908767431974411,
0.07245290279388428,
-0.09911245107650757,
-0.012495552189648151,
-0.020624760538339615,
0.033067066222429276,
-0.0012568768579512835,
-0.01879657618701458,
0.04937873035669327,
0.013143404386937618,
-0.04416041821241379,
0.007215116638690233,
-0.008652814663946629,
0.030422409996390343,
-0.0076499758288264275,
0.053212594240903854,
-0.03752215579152107,
-0.047568295150995255,
0.003589808940887451,
0.03019166737794876,
-0.03787714242935181,
0.04625484347343445,
-0.08214405924081802,
0.0345580130815506,
0.020624760538339615,
0.05065668374300003,
-0.006829067599028349,
-0.03485975041985512,
0.12509751319885254,
0.004579335916787386,
-0.012965910136699677,
0.06056082993745804,
0.033067066222429276,
0.033865787088871,
-0.0107561144977808,
-0.008643940091133118,
-0.044657398015260696,
0.03961658105254173,
-0.02944619581103325,
0.038906604051589966,
-0.04959172382950783,
0.05711745470762253,
0.05097617208957672,
-0.04909474030137062,
-0.023979390040040016,
0.019151564687490463,
0.00019246966985519975,
-0.05598149448633194,
-0.021174991503357887,
-0.006154592148959637,
-0.009691152721643448,
0.04174650460481644,
0.007148556411266327,
0.03269432857632637,
0.04629034176468849,
0.003958108369261026,
-0.017421001568436623,
-0.01870783045887947,
0.028363483026623726,
-0.050692182034254074,
-0.02183171734213829,
-0.01509583368897438,
0.016631154343485832,
0.009913019835948944,
-0.01817534863948822,
0.00030284852255135775,
0.04171100631356239,
-0.038267627358436584,
0.08555193245410919,
0.020340770483016968,
-0.030031923204660416,
0.010374503210186958,
-0.01858358457684517,
-0.0801561251282692,
-0.046432334929704666,
-0.017305629327893257,
0.014900591224431992,
-0.021458981558680534,
-0.02745826542377472,
0.017199134454131126,
0.048633258789777756,
-0.012983660213649273,
0.011270846240222454,
-0.05339008569717407,
-0.03904860094189644,
-0.00043596874456852674,
-0.04536737501621246,
0.01106672827154398,
-0.026446552947163582,
-0.005737482104450464,
0.012318058870732784,
0.03445151448249817,
0.06244226172566414,
-0.0004401287587825209,
-0.003953670617192984,
0.0034345018211752176,
-0.028594225645065308,
-0.014643224887549877,
-0.011599209159612656,
-0.0024383189156651497,
-0.004992008674889803,
0.0011392872547730803,
0.003024047939106822,
0.004306439310312271,
0.016409287229180336,
0.03993606939911842,
0.06247776001691818,
-0.01101347990334034,
-0.054384052753448486,
0.03391903638839722,
-0.09833147376775742,
-0.011883199214935303,
-0.023571155965328217,
0.016009926795959473,
-0.011412841267883778,
-0.0004001926863566041,
0.005484553519636393,
0.0607738234102726,
0.02539934031665325,
0.002924207830801606,
-0.027334021404385567,
-0.030049672350287437,
-0.0026357804890722036,
0.008439822122454643,
0.030866144225001335,
0.007436983287334442,
0.02319841831922531,
-0.012974784709513187,
-0.002478254958987236,
0.0037717397790402174,
-0.0035387794487178326,
-0.03445151448249817,
0.05150865390896797,
-0.03663468733429909,
-0.01039225235581398,
-0.042988959699869156,
0.03217959776520729,
-0.03448701277375221,
-0.03915509581565857,
-0.014581102877855301,
-0.002276355866342783,
-0.06180328503251076,
0.012939286418259144,
0.010738365352153778,
0.015015961602330208,
0.015770310536026955,
-0.0072373030707240105,
0.03769965097308159,
-0.003079514717683196,
-0.047355301678180695,
0.0290379598736763,
-0.00882143434137106,
-0.03287182375788689,
0.07156543433666229,
-0.03262333199381828,
-0.0005202782340347767,
0.008031587116420269,
-0.011963071301579475,
-0.04284696653485298,
-0.02380189672112465,
0.029836680740118027,
0.015299951657652855,
-0.010294631123542786,
0.01667552813887596,
0.02328716591000557,
0.045686863362789154,
0.027280772104859352,
-0.02664179541170597,
-0.0010660712141543627,
0.025204095989465714,
-0.03427402302622795,
0.008874681778252125,
0.01920481212437153,
-0.056975457817316055,
0.06233576685190201,
-0.026819288730621338,
0.044124919921159744,
0.05126016214489937,
0.049023743718862534,
-0.026766041293740273,
0.023020925000309944,
0.01353389024734497,
-0.004290908575057983,
0.025772076100111008,
0.006931126583367586,
0.037770647555589676,
-0.06045433506369591,
-0.035338982939720154,
0.11061403900384903,
0.0056664845906198025,
0.006771382410079241,
-0.02236419916152954,
0.04991121217608452,
-0.04416041821241379,
-0.016347164288163185,
-0.005142878275364637,
-0.03059990331530571,
0.034930747002363205,
0.026766041293740273,
0.034717757254838943,
0.01667552813887596,
0.03791264072060585,
-0.044018421322107315,
-0.046325840055942535,
0.005488990806043148,
0.02538159117102623,
0.045686863362789154,
0.019382305443286896,
0.013542764820158482,
-0.05292860418558121,
-0.015157956629991531,
0.029605939984321594,
-0.06979049742221832,
0.05097617208957672,
0.00882143434137106,
-0.05339008569717407,
0.026872538030147552,
0.0046015228144824505,
0.016009926795959473,
-0.02099749818444252,
0.03130987659096718,
-0.0014266051584854722,
0.04018456116318703,
0.0005083528812974691,
-0.005231624934822321,
-0.02589632198214531,
0.017731614410877228,
0.029588188976049423,
-0.028239239007234573,
0.07270139455795288,
-0.004148914013057947,
0.04742630198597908,
-0.00007127479329938069,
0.04984021559357643
]
|
36,347 | statistics | __setstate__ | null | def __setstate__(self, state):
self._mu, self._sigma = state
| (self, state) | [
-0.006308717653155327,
0.009222851134836674,
0.06289859116077423,
0.03437689691781998,
-0.02735424041748047,
-0.024480517953634262,
-0.059126827865839005,
-0.02474992908537388,
0.033191487193107605,
0.023528598248958588,
-0.06580822914838791,
0.02873721905052662,
0.019972367212176323,
0.06706548482179642,
-0.09346780180931091,
0.019505387172102928,
0.026456201449036598,
0.04565625637769699,
-0.014548216946423054,
0.035382699221372604,
-0.04684166610240936,
-0.00015589379472658038,
0.002804124029353261,
0.03353274241089821,
-0.003028633538633585,
0.0016063656657934189,
-0.012922768481075764,
-0.04669798165559769,
0.04095053672790527,
-0.032508980482816696,
0.004198328126221895,
-0.014808648265898228,
0.048601821064949036,
0.008374204859137535,
0.06404807418584824,
-0.059701573103666306,
0.018715113401412964,
0.03714285418391228,
-0.02171456068754196,
0.023313067853450775,
-0.019810719415545464,
-0.05424150079488754,
0.025216909125447273,
0.02589941769838333,
0.014422492124140263,
0.011153632774949074,
0.050505660474300385,
0.048027075827121735,
0.00862116552889347,
-0.0397651270031929,
0.016146725043654442,
0.005037993658334017,
0.02336695045232773,
-0.009142028167843819,
-0.010677672922611237,
0.04626692086458206,
0.0728488489985466,
0.037825364619493484,
0.00926775299012661,
-0.001729845884256065,
-0.002157536568120122,
0.03279634937644005,
0.0002332092699361965,
-0.08851063251495361,
-0.015338490717113018,
-0.02548632025718689,
-0.031125999987125397,
0.06508979946374893,
-0.017287233844399452,
0.07435755431652069,
-0.007759049069136381,
0.017134565860033035,
-0.01383876707404852,
0.006560168229043484,
-0.03495164215564728,
0.009016302414238453,
-0.09346780180931091,
0.02365432307124138,
-0.04130975157022476,
-0.033766232430934906,
0.012958689592778683,
0.03353274241089821,
-0.002950055059045553,
0.036891404539346695,
-0.021534953266382217,
-0.019415583461523056,
-0.009106106124818325,
0.022989775985479355,
0.007579441647976637,
-0.004948189947754145,
-0.03558026999235153,
0.03301187977194786,
0.022091737017035484,
0.05373859778046608,
0.021930089220404625,
0.07521966844797134,
-0.019577231258153915,
-0.014206962659955025,
0.021930089220404625,
-0.01813138835132122,
-0.036316659301519394,
-0.023313067853450775,
0.023115500807762146,
-0.012195357121527195,
-0.011881044134497643,
-0.019846642389893532,
0.013407709077000618,
-0.03568803519010544,
0.02496545948088169,
-0.041453439742326736,
-0.017583586275577545,
0.03371234983205795,
-0.03552638739347458,
0.04752417653799057,
-0.037178777158260345,
-0.023025697097182274,
0.014503315091133118,
-0.02471400797367096,
-0.003724612994119525,
0.03857971727848053,
-0.014296766370534897,
0.03926222398877144,
0.00038531445898115635,
0.03743022680282593,
0.008670557290315628,
0.04935617372393608,
0.038687482476234436,
0.0429980643093586,
0.025719810277223587,
-0.04227963462471962,
-0.05812102556228638,
-0.017655428498983383,
-0.0034798975102603436,
0.06667035073041916,
0.0027345260605216026,
-0.00040636223275214434,
-0.022019894793629646,
-0.03245509788393974,
0.008580753579735756,
0.026276594027876854,
0.00047455698950216174,
0.03667587414383888,
0.00873791053891182,
-0.016353273764252663,
0.05937827751040459,
0.05704338103532791,
0.049823153764009476,
0.013937551528215408,
-0.009173459373414516,
-0.0037672698963433504,
0.005091875791549683,
0.009133047424256802,
0.0429980643093586,
0.01695495843887329,
-0.04870958626270294,
0.0012707238784059882,
0.00414669094607234,
-0.03646034747362137,
0.005491503048688173,
0.05765404552221298,
-0.01674840971827507,
-0.03267062455415726,
-0.01946946606040001,
-0.006259325426071882,
-0.02146311104297638,
0.022792207077145576,
0.0014638020657002926,
-0.016164684668183327,
-0.014242883771657944,
-0.04500966891646385,
-0.062934510409832,
-0.08635534346103668,
-0.04626692086458206,
0.044327158480882645,
-0.007718637585639954,
0.07159159332513809,
0.01233904343098402,
-0.004108524415642023,
-0.037178777158260345,
-0.023762088268995285,
0.043680571019649506,
-0.02773141674697399,
-0.06469466537237167,
0.022019894793629646,
-0.008059891872107983,
-0.018768996000289917,
-0.03382011502981186,
-0.004166896920651197,
0.015589941293001175,
-0.005087385885417461,
0.019577231258153915,
-0.028360042721033096,
-0.030515333637595177,
-0.030102236196398735,
0.016398174688220024,
0.03238325193524361,
-0.004458758980035782,
-0.09274937212467194,
0.06322187930345535,
0.02049322985112667,
0.02967117913067341,
-0.021516991779208183,
-0.016191625967621803,
0.0013672630302608013,
0.046482451260089874,
0.008243989199399948,
-0.02686929889023304,
0.014081236906349659,
0.026186790317296982,
-0.01674840971827507,
-0.009011812508106232,
-0.026456201449036598,
0.029743021354079247,
0.026617849245667458,
0.024282949045300484,
-0.08111079782247543,
0.08980380743741989,
0.018319977447390556,
0.03789720684289932,
0.015913235023617744,
0.07209450006484985,
-0.0262227114289999,
0.00405464181676507,
-0.021373307332396507,
-0.02227134443819523,
0.038112737238407135,
-0.015670765191316605,
-0.03732246160507202,
-0.03890300914645195,
-0.0054510910995304585,
-0.011629593558609486,
0.015985077247023582,
-0.011449985206127167,
-0.03522105515003204,
-0.0024471539072692394,
0.04174080863595009,
0.04684166610240936,
-0.015706686303019524,
-0.10093948245048523,
0.03617297485470772,
-0.04263884946703911,
-0.01853550598025322,
0.03615501523017883,
-0.01225821953266859,
-0.03374827280640602,
0.018149349838495255,
0.037753522396087646,
0.06717325001955032,
-0.061569489538669586,
0.019523348659276962,
-0.05434926599264145,
-0.018023625016212463,
-0.03647830709815025,
0.021732522174715996,
0.03743022680282593,
-0.00017455616034567356,
0.055426910519599915,
0.0457640215754509,
0.011449985206127167,
-0.012312102131545544,
-0.005509463604539633,
-0.08585244417190552,
-0.015185823664069176,
0.027785299345850945,
0.03267062455415726,
0.044901903718709946,
0.058192867785692215,
0.0011343343649059534,
-0.030838627368211746,
-0.007354931905865669,
0.15015196800231934,
0.05675600841641426,
-0.045225199311971664,
0.015230725519359112,
-0.01010292861610651,
-0.04436308145523071,
-0.01541033387184143,
0.0006028080824762583,
-0.036568112671375275,
-0.006061756983399391,
0.09404254704713821,
0.0008155308314599097,
0.024911576882004738,
0.08470295369625092,
-0.031467255204916,
-0.006735285744071007,
0.01955926977097988,
0.016245508566498756,
0.04856589809060097,
-0.02719259262084961,
-0.012527631595730782,
0.029563413932919502,
0.025342633947730064,
0.009662889875471592,
0.06386847048997879,
-0.0728488489985466,
-0.05830063298344612,
0.03972920402884483,
-0.008724439889192581,
0.03333517536520958,
0.043680571019649506,
-0.04572809860110283,
-0.03667587414383888,
0.05442110821604729,
0.026761535555124283,
-0.015562999993562698,
0.09619784355163574,
-0.0031880352180451155,
0.042171869426965714,
0.004750621505081654,
0.0447222962975502,
0.07270516455173492,
-0.07873997837305069,
0.021894168108701706,
0.0425310842692852,
-0.057869575917720795,
0.019505387172102928,
-0.04824260622262955,
-0.035023484379053116,
0.08197291940450668,
-0.035310856997966766,
-0.07816523313522339,
-0.0195951908826828,
-0.018230173736810684,
-0.03793312981724739,
0.014000413939356804,
-0.019505387172102928,
0.03410748764872551,
-0.03836418688297272,
0.01116261351853609,
-0.10790825635194778,
-0.00532536581158638,
0.037214700132608414,
0.029042551293969154,
-0.041812654584646225,
-0.04547664895653725,
-0.018876761198043823,
-0.02764161303639412,
0.017062723636627197,
-0.061533570289611816,
0.009294694289565086,
0.027533847838640213,
-0.06372478604316711,
0.016721468418836594,
0.023869851604104042,
0.01013884972780943,
-0.012779082171618938,
-0.047344569116830826,
0.07852444797754288,
0.02751588635146618,
-0.052589111030101776,
0.05499585345387459,
0.012653356418013573,
0.031808510422706604,
0.04903287813067436,
0.022612599655985832,
-0.034053605049848557,
0.017430920153856277,
-0.02467808686196804,
-0.017430920153856277,
-0.009752693586051464,
-0.013506492599844933,
-0.03516717255115509,
-0.02967117913067341,
0.04130975157022476,
-0.005711522419005632,
-0.0640840008854866,
-0.016613705083727837,
0.023726167157292366,
-0.014997236430644989,
0.02480381168425083,
-0.1125062108039856,
-0.08297871798276901,
0.04756009578704834,
0.01732315495610237,
0.04687758907675743,
-0.08082342892885208,
-0.025791654363274574,
0.02767753414809704,
-0.007534539792686701,
0.038112737238407135,
-0.04601547122001648,
0.041453439742326736,
0.04500966891646385,
0.001539012766443193,
-0.00030000085826031864,
0.03771759942173958,
0.020834483206272125,
0.0469135083258152,
0.0184995848685503,
-0.04260292649269104,
-0.012590494006872177,
0.046410609036684036,
-0.052589111030101776,
0.03040757030248642,
0.003500103484839201,
0.03426913172006607,
-0.020780600607395172,
0.0020026250276714563,
-0.012545592151582241,
-0.027012985199689865,
0.033191487193107605,
-0.05643271282315254,
0.026528045535087585,
0.022415030747652054,
-0.05492401123046875,
-0.0034574465826153755,
0.06710140407085419,
-0.008684027940034866,
-0.05948604270815849,
0.01343464944511652,
-0.017421938478946686,
-0.0240314994007349,
-0.051152247935533524,
0.03317352756857872,
-0.048925116658210754,
0.024606242775917053,
-0.06659850478172302,
0.07220226526260376,
0.02773141674697399,
0.005231071729212999,
0.06174910068511963,
0.03202403709292412,
0.011836142279207706,
-0.0024291931185871363,
0.0018510810332372785,
-0.02390577457845211,
-0.01541033387184143,
0.035472504794597626,
0.05147554352879524,
-0.004678778350353241,
0.018122408539056778,
-0.03369439020752907,
0.029276041314005852,
0.011512848548591137,
-0.05190660059452057,
-0.037537992000579834,
0.0013661404373124242,
-0.0168292336165905,
0.025091184303164482,
0.03793312981724739,
0.018266094848513603,
0.01898452453315258,
-0.02674357406795025,
0.02227134443819523,
-0.018840838223695755,
0.017350096255540848,
0.04856589809060097,
0.016191625967621803,
-0.03883116692304611,
-0.004364464897662401,
0.01593119651079178,
-0.015616882592439651,
-0.04547664895653725,
0.04353688657283783,
0.03390991687774658,
-0.05686377361416817,
-0.053918205201625824,
-0.015185823664069176,
-0.039010774344205856,
-0.02934788540005684,
-0.031000275164842606,
-0.1010831668972969,
0.06300634890794754,
0.005150248296558857,
-0.00335866236127913,
0.024336831644177437,
-0.03520309180021286,
-0.0064164819195866585,
0.007574951276183128,
-0.018517544493079185,
-0.03353274241089821,
0.006165031343698502,
-0.015365432016551495,
-0.048673663288354874,
-0.06085105985403061,
-0.05280464142560959,
-0.02783918008208275,
-0.05100856348872185,
-0.02857557125389576,
-0.010273555293679237,
0.00025678277597762644,
0.031072117388248444,
0.035274937748909,
0.011997789144515991,
-0.013147277757525444,
0.03662199154496193,
-0.01205167081207037,
0.06541309505701065,
0.023995578289031982,
-0.043357279151678085,
-0.026851339265704155,
0.023995578289031982,
0.0016265715239569545,
-0.04044763371348381,
0.023079579696059227,
-0.035310856997966766,
-0.016326332464814186,
0.037825364619493484,
-0.04418347403407097,
-0.02532467432320118,
-0.004867366515100002,
-0.031090078875422478,
-0.014314726926386356,
0.030659019947052002,
-0.017915859818458557,
-0.026635808870196342,
-0.03559822961688042,
-0.018894720822572708,
-0.015625862404704094,
0.03186239302158356,
-0.012635395862162113,
0.010390300303697586,
-0.014233903959393501,
0.007480657193809748,
-0.06304227560758591,
-0.06261121481657028,
0.05923459306359291,
0.009707791730761528,
-0.020600993186235428,
0.02589941769838333,
-0.012267200276255608,
-0.00007956055924296379,
-0.015024176798760891,
-0.007750068791210651,
0.00038110491004772484,
0.028018787503242493,
-0.050146445631980896,
0.02117573842406273,
0.0005388228455558419,
-0.00745820626616478,
-0.045548491179943085,
-0.017287233844399452,
0.07852444797754288,
-0.023815970867872238,
-0.01032743789255619,
0.01837386004626751,
-0.0425310842692852,
-0.06487426906824112,
-0.024821773171424866,
0.005882149562239647,
-0.01687413640320301,
0.004930228926241398,
0.03155705705285072,
0.034125447273254395,
0.02715667150914669,
-0.07945840805768967,
-0.03188035264611244,
-0.019343741238117218,
-0.043967943638563156,
0.00015308742877095938,
-0.07001104950904846,
-0.01042622234672308,
-0.0035203092265874147,
0.036244817078113556,
-0.0369991697371006,
0.049248408526182175,
0.053846362978219986,
0.02857557125389576,
0.014135119505226612,
-0.02821635641157627,
0.001224699430167675,
0.03593948483467102,
-0.014548216946423054,
0.0073908534832298756,
-0.011306299827992916,
-0.019990328699350357,
-0.004083828069269657,
0.02342083305120468,
-0.00576091418042779,
0.03947775438427925,
0.01776319369673729,
-0.007916205562651157,
0.04411163181066513,
-0.0031476235017180443,
0.017942801117897034,
0.05122409388422966,
0.03786128759384155,
-0.02699502557516098,
0.014206962659955025,
0.06753246486186981,
-0.008464008569717407,
-0.05610942095518112,
-0.030659019947052002,
-0.010273555293679237,
0.030263883993029594,
-0.04547664895653725,
0.0458717867732048,
-0.010623790323734283,
-0.0012707238784059882,
-0.041525281965732574,
-0.0016265715239569545,
-0.006012365221977234,
-0.045225199311971664,
-0.040591321885585785,
0.00841461680829525,
0.056324947625398636,
-0.06289859116077423,
0.016146725043654442,
0.020134013146162033,
-0.019684994593262672,
0.01541033387184143,
0.0006471486994996667,
-0.013264022767543793,
-0.018625309690833092,
-0.045548491179943085,
0.02906051278114319,
0.0469135083258152,
0.006331168580800295,
0.010363359935581684,
-0.01093810424208641,
-0.00957308616489172,
-0.0010714717209339142,
0.012303121387958527,
-0.018625309690833092,
-0.004934719298034906,
0.009155497886240482,
0.0007975701009854674,
-0.02837800420820713,
0.012168415822088718,
-0.04174080863595009,
-0.0032082409597933292,
-0.02085244469344616,
-0.020008288323879242,
-0.02699502557516098,
-0.06279082596302032,
0.019325779750943184,
-0.04809892177581787,
-0.020313622429966927,
-0.05395412817597389,
-0.0037897208239883184,
-0.02227134443819523,
0.0089624198153615,
-0.09598231315612793,
0.02606106549501419,
0.022828128188848495,
0.0027390161994844675,
0.052301738411188126,
-0.02651008404791355,
0.025342633947730064,
0.007480657193809748,
0.007911715656518936,
0.05499585345387459,
-0.005927051417529583,
-0.018104447051882744,
0.007292069494724274,
-0.06419176608324051,
0.016883116215467453,
-0.013264022767543793,
-0.02056507207453251,
-0.012545592151582241,
0.03491571918129921,
-0.013147277757525444,
0.021481070667505264,
-0.023402873426675797,
-0.025881458073854446,
0.028198396787047386,
0.011665514670312405,
0.0639762356877327,
-0.013353826478123665,
-0.07306437939405441,
0.046482451260089874,
0.0070495991967618465,
0.02699502557516098,
0.07072947919368744,
0.00532536581158638,
-0.0568278506398201,
0.019864602014422417,
-0.016640646383166313,
-0.009088145568966866,
0.006582619156688452,
-0.010399281047284603,
-0.012240258976817131,
-0.024660125374794006,
-0.006443423219025135,
-0.03401768207550049,
0.057546280324459076,
-0.052589111030101776,
0.046195078641176224,
0.03410748764872551,
0.0028175944462418556,
0.06455098092556,
0.039944734424352646,
-0.04328543692827225,
0.05007460340857506,
0.04238739609718323,
-0.0253605954349041,
0.019972367212176323,
0.02097816951572895,
-0.0016366743948310614,
-0.03577783703804016,
-0.059701573103666306,
-0.015904255211353302,
-0.00377625017426908,
-0.031808510422706604,
0.008971400558948517,
-0.026851339265704155,
-0.047991156578063965,
0.019972367212176323,
-0.028521690517663956,
0.028629453852772713,
0.022899970412254333,
-0.017511742189526558,
0.0011696945875883102,
-0.013326885178685188,
-0.013264022767543793,
-0.005424150265753269,
-0.020960209891200066,
0.02203785441815853,
-0.038795243948698044,
0.04579994082450867,
-0.031000275164842606,
-0.0038525834679603577,
0.014341668225824833,
0.06677811592817307,
0.039369989186525345,
-0.03696324676275253,
-0.017942801117897034,
-0.0002497668319847435,
0.026186790317296982,
-0.04051947966217995,
-0.038112737238407135,
-0.015589941293001175,
-0.00023433181922882795,
-0.012635395862162113,
-0.022953853011131287,
-0.017269272357225418,
0.01853550598025322,
0.032293450087308884,
-0.03610113263130188,
-0.04016026481986046,
0.03249101713299751,
-0.04411163181066513,
-0.016308370977640152,
-0.048027075827121735,
-0.03448466211557388,
0.041453439742326736,
0.06469466537237167,
0.014233903959393501,
0.0546366386115551,
0.029725059866905212,
-0.008455028757452965,
0.01869715377688408,
-0.041166067123413086,
-0.0033227410167455673,
0.026114948093891144,
-0.042782533913850784,
-0.009528184309601784,
-0.014530256390571594,
0.005190660245716572,
0.04957170411944389,
0.03662199154496193,
0.030766785144805908,
-0.008019479922950268,
0.07191488891839981,
-0.038471952080726624,
0.02674357406795025,
0.023887813091278076,
-0.008270930498838425,
-0.022756285965442657,
-0.03735838457942009,
-0.01622754894196987,
0.050469741225242615,
0.030048353597521782,
0.031467255204916,
0.06878972053527832,
-0.017709311097860336,
-0.01784401759505272
]
|
36,348 | statistics | __sub__ | Subtract a constant or another NormalDist instance.
If *other* is a constant, translate by the constant mu,
leaving sigma unchanged.
If *other* is a NormalDist, subtract the means and add the variances.
Mathematically, this works only if the two distributions are
independent or if they are jointly normally distributed.
| def __sub__(x1, x2):
"""Subtract a constant or another NormalDist instance.
If *other* is a constant, translate by the constant mu,
leaving sigma unchanged.
If *other* is a NormalDist, subtract the means and add the variances.
Mathematically, this works only if the two distributions are
independent or if they are jointly normally distributed.
"""
if isinstance(x2, NormalDist):
return NormalDist(x1._mu - x2._mu, hypot(x1._sigma, x2._sigma))
return NormalDist(x1._mu - x2, x1._sigma)
| (x1, x2) | [
0.028133729472756386,
-0.014672571793198586,
0.06158321723341942,
0.010098128579556942,
-0.012774087488651276,
-0.04382786527276039,
-0.0024205674417316914,
-0.018433379009366035,
0.045925240963697433,
0.031966861337423325,
-0.007652699947357178,
-0.0005483568529598415,
0.009257371537387371,
0.001927865669131279,
-0.0878727063536644,
0.057026851922273636,
0.01627272367477417,
0.03619776666164398,
0.023034943267703056,
-0.013560602441430092,
-0.023920902982354164,
0.0037178650964051485,
-0.03648706153035164,
-0.008041436783969402,
-0.006350882351398468,
0.023703932762145996,
-0.024083629250526428,
-0.08997007459402084,
0.010694795288145542,
-0.02204049937427044,
0.02569282054901123,
0.004183446057140827,
0.015522369183599949,
-0.02070252038538456,
0.010712875984609127,
-0.07333573698997498,
0.01789095439016819,
0.07123836129903793,
-0.051928065717220306,
0.07076826691627502,
-0.007006311323493719,
-0.062089476734399796,
0.0629211962223053,
0.012358228676021099,
0.031153224408626556,
0.005704493261873722,
-0.0054830037988722324,
0.01105641108006239,
-0.058364834636449814,
0.04147736355662346,
0.008253886364400387,
0.007806386798620224,
0.031406354159116745,
-0.0038195697125047445,
-0.04350241273641586,
0.050770893692970276,
0.07651796191930771,
0.07499916851520538,
-0.05489331856369972,
0.026199083775281906,
0.03894605115056038,
0.013397875241935253,
-0.07955553382635117,
-0.07716886699199677,
0.00005657313886331394,
-0.038150493055582047,
-0.024372922256588936,
0.0031392795499414206,
0.00707411440089345,
0.07948321104049683,
-0.04766099900007248,
0.01985272206366062,
-0.014202470891177654,
0.037137970328330994,
0.06440382450819016,
0.026651104912161827,
0.03297938406467438,
0.016254642978310585,
0.05275978520512581,
-0.04180281609296799,
0.03977776691317558,
-0.043285444378852844,
-0.008624543435871601,
0.0058220187202095985,
0.022058580070734024,
0.006839063949882984,
-0.030411910265684128,
-0.04860119894146919,
0.057099178433418274,
0.01820736937224865,
-0.07192543894052505,
0.01740277372300625,
0.029435547068715096,
-0.015802621841430664,
0.040862616151571274,
0.049613725394010544,
-0.04852887615561485,
-0.014301915653049946,
0.01189716812223196,
-0.02505999244749546,
0.08758340775966644,
0.055833522230386734,
0.01578454114496708,
0.03001413308084011,
0.042164433747529984,
-0.0008763539372012019,
0.02840494178235531,
-0.023523125797510147,
0.011101612821221352,
0.023505045101046562,
-0.02896544709801674,
0.05254281312227249,
-0.038295142352581024,
0.02930898219347,
-0.05633978173136711,
-0.05178342014551163,
-0.03422696143388748,
0.02091948874294758,
-0.014211511239409447,
0.03135211393237114,
-0.019635751843452454,
0.035167161375284195,
0.012177420780062675,
0.028802718967199326,
-0.002610415918752551,
0.009844996966421604,
0.015368682332336903,
-0.03015878051519394,
-0.009917320683598518,
-0.01743893511593342,
0.01402166299521923,
-0.03652322292327881,
-0.03970544412732124,
0.0031166784465312958,
0.05395311862230301,
-0.025819387286901474,
0.08027876913547516,
0.0499030165374279,
0.06382523477077484,
0.04556362330913544,
0.042128272354602814,
0.02625332586467266,
0.04111574590206146,
0.02334231697022915,
-0.05413392558693886,
0.039452314376831055,
0.03406423330307007,
0.004994821734726429,
-0.012294946238398552,
-0.00952858291566372,
-0.06469311565160751,
0.05619513615965843,
0.0466846339404583,
-0.05001150071620941,
-0.018478581681847572,
-0.0012758267112076283,
-0.017692066729068756,
-0.07174462825059891,
-0.0022781812585890293,
-0.009727472439408302,
0.006432245951145887,
0.058400996029376984,
0.011607876047492027,
-0.014555046334862709,
0.023667771369218826,
-0.023577367886900902,
0.10306058079004288,
-0.010513987392187119,
-0.005433281417936087,
-0.015685096383094788,
-0.014898581430315971,
-0.02147999405860901,
0.0013481498463079333,
0.02867615409195423,
-0.016815146431326866,
0.00971843209117651,
0.014211511239409447,
-0.005641210824251175,
-0.02088332735002041,
0.004899897612631321,
0.09734704345464706,
-0.044442612677812576,
-0.00979075487703085,
-0.042092110961675644,
-0.011870047077536583,
-0.022474437952041626,
-0.027916761115193367,
0.07304644584655762,
0.0225648432970047,
-0.00629211962223053,
0.04013938456773758,
-0.045780595391988754,
-0.030701203271746635,
-0.026126760989427567,
0.01902100443840027,
0.03290706127882004,
-0.0776028111577034,
-0.04502119868993759,
0.01711348071694374,
0.02741049788892269,
-0.05218119919300079,
0.01988888345658779,
-0.02502383105456829,
-0.03413655608892441,
0.05131331831216812,
-0.004133723676204681,
-0.01102024968713522,
-0.004705529194325209,
-0.057171501219272614,
-0.07644563913345337,
0.00938393734395504,
0.007865149527788162,
0.05626745894551277,
0.0032568047754466534,
0.011372825130820274,
-0.021064136177301407,
0.00624691741541028,
-0.05033695697784424,
-0.0005277334712445736,
-0.0029381306376308203,
0.06407836824655533,
-0.08541371673345566,
0.01887635886669159,
0.057135339826345444,
0.008118280209600925,
0.04559978470206261,
0.03317827358841896,
-0.029146254062652588,
0.012141259387135506,
-0.019165651872754097,
0.049613725394010544,
0.02874847687780857,
0.01676090434193611,
-0.06147472932934761,
-0.00658141216263175,
0.03285282105207443,
-0.029218578711152077,
0.01609191484749317,
0.0035167161840945482,
0.03435352444648743,
-0.063282810151577,
0.007164518348872662,
0.0020838126074522734,
0.04122423008084297,
-0.009872118942439556,
-0.03455241397023201,
-0.004990301560610533,
0.03746342286467552,
-0.022510599344968796,
0.02397514507174492,
-0.028513425961136818,
-0.021046055480837822,
-0.0459614023566246,
0.03236463665962219,
-0.0042512486688792706,
-0.021425751969218254,
-0.005826538894325495,
-0.046901602298021317,
-0.003121198620647192,
0.016119036823511124,
-0.007227801252156496,
-0.05004766210913658,
-0.05391695350408554,
0.006689897272735834,
-0.030321506783366203,
0.017231006175279617,
-0.0011549113551154733,
0.016245601698756218,
0.007571336347609758,
0.03623392805457115,
0.011381865479052067,
0.015603733249008656,
0.011029290035367012,
-0.05507412552833557,
-0.02204049937427044,
0.02844110317528248,
-0.0042037866078317165,
-0.016968833282589912,
0.07040664553642273,
0.006264998111873865,
0.003778887912631035,
-0.03525756672024727,
-0.06031756103038788,
-0.022402115166187286,
0.013741410337388515,
-0.03158716484904289,
0.015468127094209194,
-0.06451230496168137,
-0.006391563918441534,
0.021498074755072594,
-0.010007724165916443,
-0.017312368378043175,
0.011996612884104252,
0.006368963047862053,
-0.03229231387376785,
0.0064548468217253685,
-0.028133729472756386,
-0.020395146682858467,
0.01988888345658779,
0.06556098908185959,
-0.01198757253587246,
0.010794239118695259,
-0.04263453558087349,
0.005270554218441248,
-0.005609569139778614,
-0.04151352494955063,
0.09416482597589493,
-0.03178605064749718,
0.025674739852547646,
0.03500443324446678,
0.0005398814682848752,
-0.010866562835872173,
-0.03549261763691902,
0.035094838589429855,
0.0011888127774000168,
0.03348564729094505,
0.043249282985925674,
-0.0217873677611351,
0.016878429800271988,
0.05532725900411606,
0.011119694449007511,
-0.0035257565323263407,
-0.011888127774000168,
0.03417271748185158,
0.022311711683869362,
-0.016046712175011635,
-0.055797357112169266,
0.04516584798693657,
0.048420391976833344,
0.05185574293136597,
-0.08881290256977081,
0.010315097868442535,
0.02994181029498577,
0.007978154346346855,
-0.04606988653540611,
-0.024137873202562332,
0.053012914955616,
0.017032116651535034,
0.003984556999057531,
-0.013171865604817867,
-0.03363029286265373,
0.023577367886900902,
-0.03384726494550705,
-0.01869555003941059,
-0.003541577374562621,
-0.03458857536315918,
0.004536021500825882,
-0.03053847700357437,
0.06284887343645096,
-0.008014315739274025,
-0.02218514494597912,
0.043393928557634354,
0.024662215262651443,
-0.0225648432970047,
0.05413392558693886,
-0.026000194251537323,
-0.030665041878819466,
-0.029652517288923264,
0.0008752238936722279,
-0.07854300737380981,
0.004294190555810928,
0.010730956681072712,
-0.02952595241367817,
-0.053410694003105164,
-0.04176665470004082,
-0.047010090202093124,
-0.053302209824323654,
-0.03786120191216469,
-0.04267069697380066,
-0.031334031373262405,
-0.028477264568209648,
-0.0217873677611351,
-0.01835201494395733,
-0.02144383266568184,
-0.00002860439599317033,
-0.02797100320458412,
-0.05688220635056496,
-0.01215934008359909,
-0.04122423008084297,
0.014527925290167332,
0.05160261318087578,
-0.00006886243500048295,
-0.06899634748697281,
0.039524637162685394,
-0.001220454229041934,
0.034914031624794006,
-0.021588478237390518,
-0.016073834151029587,
0.06263190507888794,
0.04057332128286362,
0.0287123154848814,
-0.03093625418841839,
0.03771655634045601,
0.004601564258337021,
-0.05250665172934532,
-0.0009848386980593204,
-0.012087017297744751,
-0.06302967667579651,
-0.029471708461642265,
0.0037178650964051485,
-0.00677578104659915,
0.11499390751123428,
-0.007937472313642502,
0.04881816729903221,
0.0043122717179358006,
-0.016679540276527405,
0.016363127157092094,
0.03551069647073746,
-0.025114236399531364,
0.07018967717885971,
-0.0851244181394577,
-0.03545645624399185,
-0.04993917793035507,
0.008742067962884903,
0.05890725553035736,
-0.04921594634652138,
0.0028884082566946745,
-0.018288731575012207,
0.007422169670462608,
-0.017194844782352448,
-0.03346756845712662,
-0.06064301356673241,
0.04017554596066475,
-0.07156381756067276,
0.016842268407344818,
-0.009302573278546333,
-0.03131595253944397,
-0.05753311514854431,
-0.00580845819786191,
0.012963935732841492,
-0.025927871465682983,
0.005460402462631464,
-0.027157366275787354,
-0.00472813006490469,
0.04664847254753113,
-0.024174034595489502,
0.02301686257123947,
0.009058482013642788,
0.018080802634358406,
0.04845655336976051,
-0.010712875984609127,
0.031225547194480896,
0.04773332178592682,
-0.0014204730978235602,
-0.07225088775157928,
0.013226107694208622,
0.01711348071694374,
-0.012502875179052353,
0.0379696860909462,
-0.07941088825464249,
0.045852918177843094,
0.01785479299724102,
0.026126760989427567,
-0.02892928570508957,
-0.01830681413412094,
-0.07608401775360107,
-0.0574246309697628,
-0.07065977901220322,
-0.0211907010525465,
0.013271309435367584,
-0.06628422439098358,
0.00903136096894741,
-0.06588644534349442,
0.007200679741799831,
-0.025964032858610153,
0.01789095439016819,
0.1008908823132515,
-0.030104536563158035,
0.014645450748503208,
0.02312534675002098,
0.01841529831290245,
-0.027012720704078674,
0.01954534836113453,
-0.007878709584474564,
-0.013651006855070591,
0.029489791020751,
-0.04104342311620712,
-0.02155231684446335,
-0.009980603121221066,
-0.017321409657597542,
0.04625069350004196,
0.012873532250523567,
0.010604390874505043,
0.021136458963155746,
0.02516847848892212,
-0.025331204757094383,
-0.05113251134753227,
0.029399385675787926,
0.043249282985925674,
0.04371938109397888,
0.0005412940517999232,
0.02278181165456772,
-0.008172523230314255,
0.0004686883185058832,
-0.0442979671061039,
-0.01873171143233776,
0.007792826276272535,
-0.011571713723242283,
0.054676350206136703,
-0.008583861403167248,
-0.022094741463661194,
-0.02316150814294815,
-0.01873171143233776,
-0.017809590324759483,
-0.012466713786125183,
0.042092110961675644,
-0.021046055480837822,
0.0355830192565918,
-0.003738206112757325,
0.004088521469384432,
-0.004402675665915012,
-0.01764686405658722,
0.03992241248488426,
0.027464739978313446,
0.0478779673576355,
-0.019491106271743774,
-0.05232584476470947,
0.05134947970509529,
0.04382786527276039,
-0.05095170438289642,
0.022763730958104134,
-0.007105755619704723,
-0.05138564109802246,
-0.06950260698795319,
0.01996120624244213,
-0.03898221254348755,
-0.04860119894146919,
-0.03363029286265373,
0.02055787295103073,
-0.03410039469599724,
-0.04556362330913544,
-0.046937763690948486,
-0.00654525076970458,
0.012765047140419483,
-0.0022985220421105623,
0.05521877482533455,
-0.08736643940210342,
-0.025638578459620476,
-0.031080901622772217,
0.040717970579862595,
-0.0005277334712445736,
-0.02081100456416607,
0.05431473255157471,
0.03872907906770706,
-0.009591866284608841,
0.04060948267579079,
-0.04614220932126045,
0.024137873202562332,
-0.003094077343121171,
0.029290901497006416,
-0.021805448457598686,
-0.033196356147527695,
-0.0024770700838416815,
0.04621453210711479,
-0.025819387286901474,
0.027681710198521614,
-0.08874057978391647,
0.027247769758105278,
0.023523125797510147,
0.0565929152071476,
0.004298711195588112,
-0.02401130646467209,
0.12468522042036057,
0.04516584798693657,
-0.016245601698756218,
0.04635917767882347,
0.010152370668947697,
0.038295142352581024,
0.000049863465392263606,
-0.002956211334094405,
-0.02091948874294758,
0.025114236399531364,
-0.0355830192565918,
0.039596959948539734,
-0.05984745919704437,
0.06595876812934875,
0.053374532610177994,
-0.0005469442694447935,
-0.05048160254955292,
0.021606560796499252,
-0.018469540402293205,
-0.04762483760714531,
-0.022311711683869362,
0.00654525076970458,
0.0012859971029683948,
0.032780494540929794,
-0.009682269766926765,
0.0013797912979498506,
0.05283210799098015,
0.022221306338906288,
-0.025331204757094383,
-0.01152651198208332,
0.02647029608488083,
-0.028278376907110214,
-0.007083154749125242,
-0.011662118136882782,
0.00822676531970501,
-0.013678127899765968,
-0.01729428768157959,
-0.025421610102057457,
0.026162922382354736,
-0.024083629250526428,
0.06820078939199448,
0.019454944878816605,
0.013144743628799915,
0.01735757105052471,
-0.02055787295103073,
-0.08244846016168594,
-0.030321506783366203,
-0.012593279592692852,
0.00815444253385067,
-0.003781147999688983,
-0.02741049788892269,
0.036252010613679886,
0.05438705533742905,
-0.017420854419469833,
0.014157269150018692,
-0.07536078989505768,
-0.033341001719236374,
-0.004556362517178059,
-0.030809689313173294,
0.018785955384373665,
-0.028206052258610725,
-0.001656653592363,
-0.02572898380458355,
0.001611451618373394,
0.024174034595489502,
-0.04107958450913429,
-0.019310297444462776,
-0.0046286857686936855,
-0.013623884879052639,
-0.01961767114698887,
0.00591242266818881,
-0.01652585342526436,
-0.0201781764626503,
0.008574821054935455,
-0.004294190555810928,
-0.0019210852915421128,
-0.0031822214368730783,
0.05106018856167793,
0.06020907312631607,
-0.02323383279144764,
-0.0352214053273201,
0.05250665172934532,
-0.09156119078397751,
-0.023920902982354164,
-0.028169890865683556,
0.02032282203435898,
-0.014564086683094501,
-0.0007706942269578576,
0.015486207790672779,
0.02684999257326126,
0.011544592678546906,
0.03551069647073746,
-0.03854827210307121,
-0.02807948738336563,
0.01422055158764124,
0.00594858406111598,
0.05666523799300194,
-0.0004664282314479351,
0.03887372836470604,
-0.014654491096735,
-0.011535552330315113,
0.025602417066693306,
0.05272362381219864,
-0.032527364790439606,
0.018333934247493744,
-0.03451625257730484,
-0.01630888506770134,
-0.030972415581345558,
0.04024786874651909,
-0.0129548953846097,
-0.04610604792833328,
-0.047154735773801804,
-0.029128173366189003,
-0.05771392583847046,
0.04426180571317673,
0.0037743677385151386,
0.005134948063641787,
0.0026036356575787067,
0.03229231387376785,
0.0372464545071125,
0.02569282054901123,
-0.06465695053339005,
-0.0068119424395263195,
-0.010315097868442535,
-0.010884643532335758,
0.027880597859621048,
-0.03198494017124176,
-0.005645730998367071,
0.0028115648310631514,
-0.03269009292125702,
-0.02274565026164055,
-0.021642722189426422,
0.013777571730315685,
0.008461816236376762,
0.0021832569036632776,
0.013063380494713783,
-0.008918356150388718,
0.03782504051923752,
0.026560699567198753,
-0.010541108436882496,
-0.007548735477030277,
0.03478746488690376,
-0.04169433191418648,
0.0205940343439579,
-0.009347775019705296,
-0.052036549896001816,
0.09886582940816879,
-0.010405502282083035,
0.024264438077807426,
0.040754131972789764,
0.06125776097178459,
-0.040898777544498444,
0.041911300271749496,
0.04028403013944626,
-0.022293630987405777,
0.03426312282681465,
0.01785479299724102,
0.05858180299401283,
-0.02654261887073517,
-0.04733554273843765,
0.10862946510314941,
0.00025030612596310675,
-0.003806009190157056,
-0.0013978721108287573,
0.05279594659805298,
-0.04635917767882347,
-0.007801866624504328,
-0.009799795225262642,
-0.008543179370462894,
0.07076826691627502,
0.004097561817616224,
0.028477264568209648,
-0.0004144459089729935,
0.03800584748387337,
-0.057135339826345444,
-0.03937998786568642,
0.007874189876019955,
0.02844110317528248,
0.026831911876797676,
0.01735757105052471,
0.03681251406669617,
-0.02505999244749546,
-0.026379892602562904,
-0.022130902856588364,
-0.06436765938997269,
0.04093493893742561,
0.027844436466693878,
-0.01398550160229206,
0.017872873693704605,
-0.004226387944072485,
-0.0009452869999222457,
-0.024445246905088425,
0.05369998514652252,
-0.003738206112757325,
0.0364147387444973,
-0.02967059798538685,
-0.008678785525262356,
-0.04932443052530289,
0.006802902091294527,
0.03721029311418533,
0.010215654037892818,
0.06982806324958801,
0.01694171316921711,
0.030213022604584694,
-0.004588003735989332,
0.04024786874651909
]
|
36,349 | statistics | __truediv__ | Divide both mu and sigma by a constant.
Used for rescaling, perhaps to change measurement units.
Sigma is scaled with the absolute value of the constant.
| def __truediv__(x1, x2):
"""Divide both mu and sigma by a constant.
Used for rescaling, perhaps to change measurement units.
Sigma is scaled with the absolute value of the constant.
"""
return NormalDist(x1._mu / x2, x1._sigma / fabs(x2))
| (x1, x2) | [
-0.02910461463034153,
0.014525191858410835,
0.05994465947151184,
0.020481694489717484,
0.05596763268113136,
-0.010728937573730946,
-0.004180398769676685,
-0.04819434881210327,
-0.02688109502196312,
0.08886849880218506,
0.043928083032369614,
0.0034957174211740494,
0.022343667224049568,
0.039517197757959366,
-0.07194805145263672,
0.026772629469633102,
0.02474796213209629,
0.014805391430854797,
0.014046140015125275,
-0.015094629488885403,
-0.039517197757959366,
0.02078901045024395,
-0.022650983184576035,
0.0028946436941623688,
-0.03360588848590851,
-0.0020495252683758736,
-0.034401293843984604,
-0.0697426125407219,
0.01908973418176174,
-0.0378902330994606,
0.03467245399951935,
0.033135876059532166,
0.007023070007562637,
-0.037058670073747635,
0.015790609642863274,
-0.05159290134906769,
0.016378125175833702,
0.005603994242846966,
-0.04360269010066986,
0.05332833155989647,
-0.02030092105269432,
-0.03349742293357849,
0.049965936690568924,
0.0072490377351641655,
-0.018493181094527245,
0.006928163580596447,
-0.007759724278002977,
0.011253181844949722,
-0.04045722261071205,
0.03418436646461487,
0.003095754887908697,
-0.0039160167798399925,
0.014715003781020641,
0.00721740210428834,
-0.05260523408651352,
0.04519350081682205,
0.05336448550224304,
0.03049657493829727,
-0.040240295231342316,
0.030189258977770805,
0.06478940695524216,
0.03745637461543083,
-0.027387261390686035,
-0.02171095833182335,
-0.012581870891153812,
0.024259870871901512,
-0.013015728443861008,
0.03886641189455986,
-0.014371533878147602,
0.08076982945203781,
-0.04428962990641594,
0.006250261329114437,
-0.02136748842895031,
0.0011202339082956314,
0.0809144452214241,
0.04110800847411156,
0.009214955382049084,
0.025706063956022263,
0.02962885983288288,
-0.024350259453058243,
0.053834497928619385,
-0.021927887573838234,
0.027007635682821274,
-0.009825067594647408,
0.008708788082003593,
0.006842296104878187,
-0.05517222732305527,
-0.04913437366485596,
0.0337505079805851,
0.006331609562039375,
-0.08937466889619827,
-0.018068362027406693,
0.05018286406993866,
0.026573779061436653,
0.033479347825050354,
0.055859167128801346,
-0.07635893672704697,
-0.021692881360650063,
-0.0015851620119065046,
-0.04201187938451767,
0.10072727501392365,
0.09638869762420654,
0.024838348850607872,
-0.004867339972406626,
0.02644723653793335,
0.005405142903327942,
0.0018348561134189367,
-0.03731175512075424,
0.021873654797673225,
0.0014360235072672367,
-0.04418116807937622,
0.0013004429638385773,
-0.028291132301092148,
0.02991809882223606,
-0.06363245099782944,
-0.06533172726631165,
-0.038794100284576416,
0.0304604209959507,
0.04761587455868721,
0.017489885911345482,
0.003671972081065178,
0.03244893252849579,
0.0073213474825024605,
0.026899171993136406,
-0.017372382804751396,
-0.015392906963825226,
0.03235854580998421,
-0.00032934764749370515,
-0.03901103138923645,
0.009716602973639965,
0.018357601016759872,
0.009246590547263622,
0.012563792988657951,
0.003509275382384658,
0.021060172468423843,
-0.03011694923043251,
0.08142061531543732,
0.04663969203829765,
0.12119089066982269,
0.04678431153297424,
0.014244991354644299,
0.011171833612024784,
0.02310291863977909,
0.006693157367408276,
0.0026822343934327364,
0.062367033213377,
0.029375776648521423,
0.01196723897010088,
-0.005504568573087454,
-0.0011529992334544659,
-0.015194055624306202,
0.05202675983309746,
0.12422789633274078,
-0.06583788990974426,
0.006607289891690016,
-0.029646936804056168,
-0.00233198469504714,
-0.057847682386636734,
-0.013332082889974117,
-0.022343667224049568,
0.005296678282320499,
0.009016103111207485,
0.03266586363315582,
0.017634503543376923,
0.02214481495320797,
0.002661897335201502,
0.08062520623207092,
0.000692025467287749,
0.0018969972152262926,
0.007375579327344894,
-0.012916302308440208,
-0.011903968639671803,
-0.05918540805578232,
0.02422371692955494,
0.02330176904797554,
-0.0372394435107708,
0.007059224881231785,
-0.0016970159485936165,
-0.007533756550401449,
0.0014348936965689063,
0.05864308774471283,
-0.033045489341020584,
-0.013928636908531189,
-0.029900019988417625,
-0.02151210606098175,
-0.012862070463597775,
0.008306565694510937,
0.06627175211906433,
0.02315714955329895,
-0.036281343549489975,
0.042662665247917175,
-0.053834497928619385,
-0.037058670073747635,
-0.015980422496795654,
0.05535300076007843,
0.0631624385714531,
-0.010313156992197037,
-0.044506561011075974,
0.025489134714007378,
0.001471048453822732,
-0.0246033426374197,
0.007813956588506699,
-0.031111206859350204,
-0.019505515694618225,
0.062294721603393555,
-0.03510631248354912,
-0.019613979384303093,
-0.011081446893513203,
-0.044361941516399384,
-0.02659185603260994,
-0.00006154083530418575,
0.010267963632941246,
-0.03817946836352348,
0.023265615105628967,
-0.039806436747312546,
-0.009034181013703346,
0.014696926809847355,
-0.03566671162843704,
0.006693157367408276,
-0.026067610830068588,
0.0874946191906929,
-0.0644640102982521,
0.03640788421034813,
0.03060503862798214,
0.020481694489717484,
0.01972244493663311,
0.02557952143251896,
0.008862446062266827,
-0.012148013338446617,
-0.01179550401866436,
0.05904079228639603,
0.031490832567214966,
-0.010349311865866184,
-0.008207139559090137,
-0.008012807928025723,
-0.017462769523262978,
-0.03658865764737129,
0.015935229137539864,
0.01580868661403656,
0.014190759509801865,
-0.04226496443152428,
-0.025633754208683968,
0.03152698650956154,
0.03264778479933739,
-0.031834304332733154,
-0.0355944000184536,
-0.024187562987208366,
0.03662481531500816,
-0.035178620368242264,
0.02659185603260994,
-0.06540403515100479,
-0.019162043929100037,
-0.041361093521118164,
0.02595914714038372,
0.00612823897972703,
0.018493181094527245,
0.040637996047735214,
0.014751158654689789,
0.006792583502829075,
0.0014168162597343326,
0.016179272904992104,
-0.06547634303569794,
-0.05119519680738449,
0.013142270036041737,
-0.04204803332686424,
0.0034369658678770065,
0.002013370394706726,
0.025073355063796043,
-0.011759349144995213,
0.04371115565299988,
0.03548593819141388,
0.022343667224049568,
-0.020246688276529312,
-0.0728880763053894,
-0.00799924973398447,
0.028309209272265434,
0.003599662333726883,
-0.005558800883591175,
0.026085689663887024,
0.035070158541202545,
-0.03223200514912605,
-0.06511479616165161,
-0.028688834980130196,
-0.00149590487126261,
-0.045229654759168625,
-0.019107813015580177,
0.023428311571478844,
-0.0697426125407219,
0.011922045610845089,
0.02939385361969471,
-0.06247549504041672,
-0.004239150322973728,
-0.035757098346948624,
0.015438100323081017,
-0.00420751515775919,
0.005757652223110199,
-0.05773921683430672,
-0.013711708597838879,
0.03143659979104996,
0.05119519680738449,
-0.06948953121900558,
0.023482544347643852,
-0.05021901801228523,
0.025398747995495796,
0.029556550085544586,
-0.000033595013519516215,
0.10043803602457047,
-0.017480846494436264,
0.03132813423871994,
-0.009214955382049084,
-0.0605231374502182,
0.01764354296028614,
-0.043638844043016434,
0.03796254098415375,
0.043783463537693024,
0.045952752232551575,
0.012798799201846123,
0.0089483130723238,
0.009870260953903198,
0.0397341251373291,
0.00954486709088087,
0.04472348839044571,
0.03181622549891472,
0.024494877085089684,
0.01225647795945406,
-0.02644723653793335,
-0.02402486465871334,
0.014019024558365345,
0.031743913888931274,
0.0382879339158535,
-0.08452992886304855,
0.042373426258563995,
0.03221392631530762,
0.03631749749183655,
-0.05791999027132988,
-0.016070809215307236,
0.07021262496709824,
0.046386610716581345,
0.01981283165514469,
0.008243294432759285,
-0.030351955443620682,
-0.01165088452398777,
-0.00949967373162508,
-0.03273817151784897,
-0.023844091221690178,
-0.055136073380708694,
-0.01165088452398777,
-0.05669073015451431,
0.061173923313617706,
-0.006164393853396177,
-0.01610696315765381,
0.007660298608243465,
0.03696828335523605,
-0.01977667585015297,
0.033479347825050354,
-0.02514566481113434,
-0.04128878191113472,
-0.04602506384253502,
-0.007063744124025106,
0.0010422751074656844,
-0.0066976770758628845,
0.03528708592057228,
-0.04678431153297424,
-0.0524967722594738,
-0.012401096522808075,
-0.039083339273929596,
-0.016215428709983826,
-0.024729883298277855,
-0.049387458711862564,
0.030062716454267502,
-0.017959898337721825,
-0.009915454313158989,
-0.014715003781020641,
-0.02335600182414055,
0.027676500380039215,
-0.004218813497573137,
-0.024205639958381653,
0.006123719271272421,
-0.06435554474592209,
0.008347239345312119,
0.040348757058382034,
0.02044554054737091,
-0.050255171954631805,
-0.007506640627980232,
-0.01992129534482956,
0.011931084096431732,
0.00877657812088728,
-0.007023070007562637,
0.03716713562607765,
0.0372394435107708,
-0.0008038794039748609,
-0.04714586213231087,
0.044687334448099136,
-0.0368417426943779,
-0.04819434881210327,
0.0037510606925934553,
-0.000026445259209140204,
-0.056835345923900604,
-0.02886960841715336,
-0.024675652384757996,
-0.02798381634056568,
0.08778385818004608,
-0.01334112137556076,
0.028562292456626892,
0.022199047729372978,
-0.022976376116275787,
0.00899350643157959,
0.043349605053663254,
-0.0070095122791826725,
0.02919500134885311,
-0.07462351024150848,
-0.034491680562496185,
-0.024675652384757996,
0.007425292395055294,
0.032702017575502396,
-0.0648617148399353,
-0.01508559100329876,
-0.048953600227832794,
-0.01706506684422493,
0.018339522182941437,
-0.022777525708079338,
-0.05018286406993866,
-0.009870260953903198,
-0.033479347825050354,
0.008216178975999355,
-0.006507864221930504,
-0.001424725167453289,
-0.038215626031160355,
-0.00185180373955518,
0.0035205737221986055,
0.0047859917394816875,
0.06497018039226532,
-0.03610057011246681,
0.014109411276876926,
0.016134079545736313,
-0.018981270492076874,
0.03279240429401398,
0.024187562987208366,
0.041650332510471344,
0.023844091221690178,
-0.012943418696522713,
0.025507211685180664,
0.030659271404147148,
-0.0189451165497303,
-0.014597500674426556,
-0.014489036984741688,
-0.012355903163552284,
-0.009725641459226608,
0.030966587364673615,
-0.05705227702856064,
-0.0028110358398407698,
0.007298750337213278,
0.031075051054358482,
-0.025489134714007378,
-0.023862168192863464,
-0.035702865570783615,
-0.08351758867502213,
-0.0838068276643753,
-0.017028911039233208,
0.017227763310074806,
-0.038794100284576416,
0.03962566331028938,
-0.036715202033519745,
0.0019998124334961176,
-0.03606441244482994,
0.02397063374519348,
0.048122040927410126,
-0.029900019988417625,
0.03658865764737129,
0.007059224881231785,
0.015175977721810341,
0.00918783899396658,
0.005368988029658794,
-0.0006807271274738014,
-0.024549109861254692,
0.02456718683242798,
-0.018637800589203835,
0.0017851432785391808,
0.029502317309379578,
-0.05047210305929184,
-0.0002187647914979607,
0.016070809215307236,
0.04027644917368889,
0.04779664799571037,
0.04718201607465744,
0.008613881655037403,
-0.06182470917701721,
0.01633293181657791,
0.0630178153514862,
-0.01726391725242138,
0.022415976971387863,
-0.017571233212947845,
0.004550985526293516,
0.017381420359015465,
-0.033135876059532166,
-0.04613352566957474,
0.011578574776649475,
0.005246965680271387,
-0.0017941819969564676,
-0.01251859962940216,
0.0009869131026789546,
-0.03243085741996765,
0.010891634039580822,
-0.008374355733394623,
0.023988710716366768,
0.06930875778198242,
-0.01696564070880413,
-0.002219000831246376,
-0.03161737322807312,
-0.030243491753935814,
-0.005052633583545685,
-0.0269714817404747,
-0.0012597688473761082,
0.020481694489717484,
0.07371964305639267,
-0.005554281175136566,
-0.08706076443195343,
0.035757098346948624,
0.055389154702425,
-0.04230111837387085,
-0.011777426116168499,
-0.022072507068514824,
-0.02745957113802433,
-0.08004672825336456,
0.008690710179507732,
-0.019885141402482986,
-0.06688638031482697,
-0.017327189445495605,
0.040493376553058624,
-0.010810285806655884,
-0.04956823214888573,
-0.0903870016336441,
-0.005129462573677301,
-0.013738824054598808,
-0.03930027037858963,
0.046820469200611115,
-0.10043803602457047,
-0.025398747995495796,
-0.009888337925076485,
0.00763770192861557,
-0.0021014977246522903,
-0.022940222173929214,
0.04132493957877159,
0.036859821528196335,
0.011596652679145336,
-0.007899824529886246,
-0.05961926653981209,
0.04649507626891136,
-0.025633754208683968,
0.0085370521992445,
-0.050652876496315,
-0.02905038371682167,
0.018872806802392006,
0.006905566900968552,
-0.039661817252635956,
0.00584803894162178,
-0.042084187269210815,
0.04530196636915207,
0.0006954150157980621,
0.030062716454267502,
0.007434330880641937,
-0.03461822122335434,
0.10535509139299393,
-0.01228359341621399,
-0.03221392631530762,
0.01036738883703947,
0.01160569116473198,
0.01599849946796894,
-0.012355903163552284,
-0.008374355733394623,
-0.06384938210248947,
0.031834304332733154,
0.036769431084394455,
0.037347909063100815,
-0.07679279893636703,
0.02639300562441349,
0.02266906015574932,
-0.027622267603874207,
-0.04345807060599327,
-0.04356653615832329,
-0.019451282918453217,
-0.016504667699337006,
0.002901422791182995,
0.014705965295433998,
-0.008405990898609161,
-0.018529335036873817,
0.017173530533909798,
0.04931515082716942,
0.0357932522892952,
0.04479580000042915,
-0.09400248527526855,
-0.0572330504655838,
-0.005558800883591175,
-0.025687986984848976,
0.012916302308440208,
-0.030008485540747643,
0.007190286181867123,
-0.01293438021093607,
-0.01711929775774479,
-0.012229361571371555,
0.04573582485318184,
-0.004141984507441521,
0.04067414999008179,
0.024277949705719948,
-0.01358516700565815,
0.0042007360607385635,
0.008690710179507732,
-0.0693449079990387,
-0.052677545696496964,
-0.046531230211257935,
0.04906206578016281,
0.01280783861875534,
-0.01919819973409176,
0.033190108835697174,
0.03282855823636055,
0.025019122287631035,
0.009038700722157955,
-0.07021262496709824,
0.01065662782639265,
0.008482820354402065,
-0.06497018039226532,
0.015456177294254303,
0.01097298227250576,
-0.02127709984779358,
-0.0009535828721709549,
0.005061672069132328,
0.0543406680226326,
-0.0372394435107708,
-0.0035183141008019447,
-0.029954252764582634,
0.009996802546083927,
-0.020463617518544197,
0.012337826192378998,
-0.036534424871206284,
-0.014470959082245827,
0.050652876496315,
-0.019794752821326256,
0.009255629032850266,
0.0005897752125747502,
0.060703910887241364,
0.06110161542892456,
-0.0189451165497303,
-0.04389192909002304,
0.05882386118173599,
-0.004650411196053028,
-0.00915620382875204,
-0.032955102622509,
0.010168537497520447,
0.0030934952665120363,
0.0025602118112146854,
0.016658324748277664,
0.019306663423776627,
0.06309013068675995,
-0.009770834818482399,
-0.051556747406721115,
-0.05274985358119011,
-0.018185865134000778,
-0.0034211480524390936,
0.021982118487358093,
-0.0037262041587382555,
0.02823689952492714,
-0.01508559100329876,
-0.020192457363009453,
0.054702214896678925,
0.05003824457526207,
-0.006042371038347483,
0.02503719925880432,
-0.044687334448099136,
-0.10239039361476898,
-0.0547383688390255,
0.06677791476249695,
-0.0015659548807889223,
0.012798799201846123,
-0.019306663423776627,
-0.0069643184542655945,
-0.021114403381943703,
0.02107824943959713,
-0.00034149340353906155,
-0.013639398850500584,
0.019125889986753464,
0.006598251406103373,
0.024241793900728226,
0.0017354304436594248,
-0.0619693286716938,
-0.0019128149142488837,
-0.07780513167381287,
-0.03875794634222984,
0.035359397530555725,
-0.03252124413847923,
0.012410135939717293,
-0.01297957357019186,
-0.049676697701215744,
-0.05918540805578232,
-0.0016586014535278082,
0.01036738883703947,
-0.022108661010861397,
0.034835152328014374,
0.053581416606903076,
0.026790708303451538,
0.024766039103269577,
0.004293382633477449,
-0.04320498928427696,
0.00149590487126261,
0.011126640252768993,
-0.027929583564400673,
0.023139072582125664,
0.03317203000187874,
-0.03402166813611984,
0.060414671897888184,
-0.03984259068965912,
0.06008927896618843,
-0.0005716977757401764,
0.07133342325687408,
-0.026844939216971397,
0.05893232673406601,
0.04215649887919426,
-0.046531230211257935,
0.062294721603393555,
0.04707355052232742,
0.036136724054813385,
-0.035757098346948624,
-0.05896848067641258,
0.06880258768796921,
0.011397801339626312,
-0.02069862373173237,
0.02281367965042591,
0.05173752084374428,
0.0059610228054225445,
-0.015844842419028282,
-0.005133981816470623,
-0.008152907714247704,
0.07310500741004944,
-0.02142171934247017,
-0.011732232756912708,
-0.0006372283678501844,
-0.0008428588043898344,
-0.06182470917701721,
-0.028291132301092148,
0.03282855823636055,
0.024097174406051636,
0.056871503591537476,
-0.0028652679175138474,
0.04071030765771866,
-0.07534660398960114,
0.021837500855326653,
-0.00899350643157959,
-0.04183110594749451,
0.02093362994492054,
0.03103889711201191,
0.010792207904160023,
0.02668224275112152,
0.0033307611010968685,
-0.05904079228639603,
-0.044687334448099136,
0.0955209881067276,
-0.0074614472687244415,
0.04917053133249283,
-0.009083894081413746,
-0.026465315371751785,
-0.029936175793409348,
0.02688109502196312,
-0.010602395050227642,
0.0015354491770267487,
0.0711888000369072,
0.005052633583545685,
0.030351955443620682,
0.017227763310074806,
0.06706715375185013
]
|
36,350 | statistics | cdf | Cumulative distribution function. P(X <= x) | def cdf(self, x):
"Cumulative distribution function. P(X <= x)"
if not self._sigma:
raise StatisticsError('cdf() not defined when sigma is zero')
return 0.5 * (1.0 + erf((x - self._mu) / (self._sigma * sqrt(2.0))))
| (self, x) | [
-0.04483775421977043,
0.046572960913181305,
0.03820926323533058,
0.004750129766762257,
0.08481693267822266,
0.011079298332333565,
-0.004676383454352617,
-0.046156514436006546,
0.024466421455144882,
0.036369942128658295,
0.000855674094054848,
0.0006257591303437948,
0.019451674073934555,
0.01870553381741047,
-0.03317716345191002,
0.004550580866634846,
0.03256984055042267,
0.023060904815793037,
0.011912197805941105,
0.017595000565052032,
0.011495747603476048,
0.037098731845617294,
-0.037827517837285995,
-0.03859100863337517,
-0.02857886254787445,
0.004017004743218422,
0.00020930937898810953,
0.0036048931069672108,
-0.004750129766762257,
-0.040638554841279984,
-0.00825524888932705,
-0.00409508915618062,
-0.00046606583055108786,
-0.03907686844468117,
0.029862916097044945,
0.0332639217376709,
0.01858406886458397,
-0.03036612644791603,
-0.03768870234489441,
0.018757591024041176,
-0.013959742151200771,
-0.0019271644996479154,
-0.07641852647066116,
0.008081727661192417,
-0.010584764182567596,
0.0012623632792383432,
0.012554224580526352,
0.10078083723783493,
-0.05007807910442352,
-0.0024618252646178007,
-0.000846998009365052,
-0.015313203446567059,
0.001919573056511581,
-0.06194689869880676,
0.024986984208226204,
0.026357797905802727,
0.05216033011674881,
0.004815199878066778,
0.006910462863743305,
0.017976747825741768,
0.0665278434753418,
0.049453407526016235,
0.019035223871469498,
-0.061495743691921234,
-0.01613742671906948,
0.009144541807472706,
0.037827517837285995,
0.010090230032801628,
0.011027242057025433,
0.03768870234489441,
-0.008407078683376312,
0.00799062941223383,
-0.013985770754516125,
-0.005149227567017078,
0.04980044811964035,
-0.033281274139881134,
-0.011339579708874226,
-0.008220544084906578,
-0.003435710445046425,
-0.011487072333693504,
0.019746657460927963,
-0.028440047055482864,
0.016640637069940567,
-0.02370293065905571,
0.015304528176784515,
-0.018896406516432762,
0.0073182363994419575,
-0.008602289482951164,
0.0001361053145956248,
0.13222278654575348,
-0.007977615110576153,
-0.01008155383169651,
0.02358146570622921,
0.011756028980016708,
0.03432239964604378,
0.05295852571725845,
0.006021169014275074,
0.06802012026309967,
0.08224882185459137,
0.038764528930187225,
0.06357799470424652,
0.11806350201368332,
0.059135861694812775,
-0.0021343049593269825,
-0.025629010051488876,
0.029082072898745537,
0.011903521604835987,
0.019659897312521935,
0.027919484302401543,
-0.044421304017305374,
-0.04400485381484032,
0.021048063412308693,
0.09106367826461792,
-0.01763838157057762,
-0.025472842156887054,
-0.0764879360795021,
-0.05896234139800072,
0.048273466527462006,
-0.006862744688987732,
0.00020442910317797214,
-0.028145061805844307,
-0.017551621422171593,
0.015070274472236633,
0.021742146462202072,
-0.024900224059820175,
0.01979871466755867,
-0.016120076179504395,
-0.034617383033037186,
-0.000860012078192085,
0.02394586056470871,
0.04053444042801857,
-0.041332636028528214,
0.08252645283937454,
-0.03147665783762932,
0.08384521305561066,
-0.04226964712142944,
0.03987506404519081,
-0.025871939957141876,
0.016657989472150803,
0.03699461743235588,
0.034044764935970306,
0.012189830653369427,
-0.01849730871617794,
-0.0034053442068398,
0.06559083610773087,
0.08648272603750229,
0.05830296501517296,
0.02991497330367565,
-0.003728526644408703,
-0.02703452855348587,
0.0036287521943449974,
0.051813289523124695,
0.05507547780871391,
-0.01174735277891159,
-0.007656601723283529,
0.02467464655637741,
-0.017612352967262268,
-0.0034682455006986856,
-0.013794897124171257,
-0.02797154150903225,
-0.026409855112433434,
0.04296373203396797,
-0.030834631994366646,
0.02781537175178528,
0.013968418352305889,
-0.06069754809141159,
-0.04771820083260536,
-0.0320492759346962,
-0.03800103813409805,
-0.029498523101210594,
-0.024934928864240646,
0.030105846002697945,
0.033801838755607605,
0.009621724486351013,
0.007938573136925697,
-0.006867082789540291,
-0.010871073231101036,
0.020839838311076164,
-0.007535137236118317,
-0.023928508162498474,
0.03248307853937149,
-0.030175253748893738,
0.010324482806026936,
0.017655733972787857,
-0.008489501662552357,
-0.0017937704687938094,
0.012779801152646542,
0.005053791217505932,
0.04476834833621979,
-0.007743362337350845,
-0.014254727400839329,
-0.026271037757396698,
0.034530624747276306,
-0.0576435849070549,
0.03577997162938118,
0.0025572616141289473,
-0.0165104977786541,
-0.05122331902384758,
0.0271212887018919,
-0.03938920423388481,
0.019937532022595406,
0.010740933008491993,
-0.0015042077284306288,
-0.02528196945786476,
-0.006168661639094353,
0.005348776467144489,
-0.0005747873801738024,
0.03841748833656311,
-0.018184971064329147,
0.014827345497906208,
-0.005348776467144489,
-0.008832205086946487,
-0.007400658912956715,
-0.020197812467813492,
-0.057296544313430786,
-0.03524205833673477,
0.09203539043664932,
-0.0937706008553505,
-0.01780322566628456,
0.016684018075466156,
0.05549192801117897,
-0.042547281831502914,
0.06687488406896591,
0.024813463911414146,
-0.0013502081856131554,
-0.028804440051317215,
0.012918617576360703,
0.013265659101307392,
-0.006290126126259565,
-0.03907686844468117,
0.015530104748904705,
0.026774248108267784,
-0.011009889654815197,
-0.028266526758670807,
0.006854068487882614,
-0.06305743008852005,
0.004459482617676258,
0.06472323089838028,
-0.07218462228775024,
0.0453583188354969,
-0.04410896822810173,
0.019486377015709877,
0.09002254903316498,
0.06253686547279358,
0.03800103813409805,
-0.01772514171898365,
0.024119380861520767,
0.049453407526016235,
-0.009665104560554028,
0.05313204601407051,
-0.04875932261347771,
-0.06340447068214417,
-0.10584764182567596,
-0.045670654624700546,
0.006164323538541794,
-0.017490889877080917,
0.04265139251947403,
0.06732603907585144,
0.029619988054037094,
0.01946902461349964,
-0.01006420236080885,
-0.026531318202614784,
-0.020024292171001434,
0.022939439862966537,
-0.044733643531799316,
0.016041990369558334,
-0.02391115576028824,
-0.03106020949780941,
0.02382439561188221,
0.0354502834379673,
0.05878882110118866,
0.04851639270782471,
0.08016657084226608,
-0.062016308307647705,
-0.028613567352294922,
-0.06191219389438629,
-0.0003383654111530632,
0.014376192353665829,
0.02549019455909729,
0.006546069402247667,
0.03322921693325043,
-0.04084677994251251,
-0.014506332576274872,
0.0011734338477253914,
-0.030799929052591324,
-0.014358839951455593,
-0.026479262858629227,
-0.001023772289045155,
0.02004164271056652,
0.06795071810483932,
-0.0595870167016983,
-0.00591705646365881,
-0.005348776467144489,
0.01638035662472248,
0.05198680981993675,
-0.04275550693273544,
0.06264097988605499,
-0.035103242844343185,
-0.030019085854291916,
0.07155994325876236,
0.044456008821725845,
0.00908381026238203,
-0.06212041899561882,
0.002615824807435274,
0.00584331015124917,
0.030869336798787117,
0.04865521192550659,
-0.015434668399393559,
-0.022175949066877365,
0.011842789128422737,
-0.012319971807301044,
0.020701022818684578,
-0.03675168752670288,
-0.003121203975751996,
0.026479262858629227,
-0.030799929052591324,
-0.009205274283885956,
-0.043518997728824615,
0.02824917435646057,
0.017699113115668297,
0.00014383241068571806,
0.00764358788728714,
0.043484292924404144,
0.048481691628694534,
-0.05851118639111519,
0.03440915793180466,
0.00841575488448143,
0.0424431674182415,
-0.028925905004143715,
0.016944298520684242,
-0.06271038949489594,
0.030522296205163002,
0.00030339014483615756,
0.0844004824757576,
0.003325090976431966,
0.011252818629145622,
0.05094568431377411,
-0.020111052319407463,
0.02719069831073284,
-0.07794550806283951,
-0.012024986557662487,
0.008767134509980679,
-0.019607841968536377,
-0.02988026849925518,
-0.07336456328630447,
-0.029463818296790123,
0.017490889877080917,
-0.027936836704611778,
0.06073225289583206,
-0.03427034243941307,
0.04820405691862106,
0.009075134061276913,
-0.008337670937180519,
0.011044594459235668,
0.026444558054208755,
0.010376539081335068,
0.008875585161149502,
-0.0030084154568612576,
0.010341835208237171,
0.012684364803135395,
0.07218462228775024,
0.03395800665020943,
-0.005270692054182291,
-0.03557175025343895,
-0.00841575488448143,
0.03706402704119682,
-0.04862050712108612,
0.04733645170927048,
0.012345999479293823,
0.025507546961307526,
0.0029954013880342245,
0.027624499052762985,
-0.03626583144068718,
-0.0013415321009233594,
-0.007968938909471035,
-0.022228004410862923,
-0.029255593195557594,
-0.04813464730978012,
-0.02252298966050148,
0.006324830465018749,
-0.01720457896590233,
-0.03515530005097389,
-0.046850595623254776,
-0.03135519474744797,
-0.0795418992638588,
0.010654172860085964,
-0.03114696964621544,
-0.006572097539901733,
0.01244143582880497,
-0.0025030365213751793,
0.029342355206608772,
-0.08863438665866852,
0.027867428958415985,
-0.013022730126976967,
-0.013031406328082085,
-0.028891200199723244,
0.09744923561811447,
-0.033888597041368484,
0.004572270903736353,
0.01304875873029232,
-0.009092485532164574,
0.05528370290994644,
0.012432759627699852,
0.0005026678554713726,
-0.00045196726568974555,
-0.06979003548622131,
-0.00619035167619586,
-0.04692000523209572,
0.022505637258291245,
0.0448724590241909,
0.007526461500674486,
0.02040603756904602,
-0.02451847866177559,
0.04501127451658249,
0.010159638710319996,
-0.06892243027687073,
-0.07857018709182739,
-0.1084851548075676,
0.009396146982908249,
-0.0034508933313190937,
-0.010593440383672714,
-0.038035742938518524,
-0.0003329429018776864,
-0.026652783155441284,
-0.00674995593726635,
0.0039736246690154076,
0.03524205833673477,
0.005262015853077173,
0.007695644162595272,
0.03786222264170647,
-0.038972754031419754,
-0.019364912062883377,
-0.06364740431308746,
0.047787606716156006,
-0.015356584452092648,
-0.032743360847234726,
-0.04379663243889809,
0.026149572804570198,
0.0171178188174963,
0.024501126259565353,
-0.040881481021642685,
0.03463473543524742,
0.04948811233043671,
-0.06402914971113205,
-0.03886864334344864,
0.045670654624700546,
0.009613048285245895,
-0.05382612720131874,
-0.005244663916528225,
-0.03293423354625702,
0.03291688114404678,
0.008424431085586548,
0.004481172654777765,
0.008342009037733078,
-0.06271038949489594,
-0.0034118511248379946,
-0.06402914971113205,
-0.011235467158257961,
0.0030648098327219486,
0.007656601723283529,
-0.04004858434200287,
0.015174387022852898,
-0.025229914113879204,
-0.07190699130296707,
-0.04289432242512703,
0.0024184451904147863,
0.008918965235352516,
0.029706748202443123,
0.01286656130105257,
-0.04181849583983421,
0.033923301845788956,
0.040916185826063156,
-0.04331077262759209,
-0.04549713432788849,
-0.06236334890127182,
-0.011712648905813694,
-0.062016308307647705,
0.013899009674787521,
0.08932846784591675,
-0.010315806604921818,
-0.01739545166492462,
0.012710393406450748,
0.04619121551513672,
0.007686967961490154,
0.02606281265616417,
-0.028526807203888893,
-0.02130834572017193,
-0.013092138804495335,
0.035224705934524536,
0.014610445126891136,
0.0010877579916268587,
-0.0008524205768480897,
0.007873502559959888,
-0.04102030023932457,
-0.017352072522044182,
-0.036647576838731766,
0.059656426310539246,
0.034131526947021484,
0.016857538372278214,
-0.023963211104273796,
-0.015157035551965237,
0.0424431674182415,
-0.015963906422257423,
-0.015720978379249573,
-0.04927988722920418,
-0.026132220402359962,
0.002344698878005147,
-0.002531233476474881,
-0.031494010239839554,
-0.05233385041356087,
0.03893804922699928,
-0.04126322641968727,
-0.00937011931091547,
-0.008320318534970284,
0.00494100246578455,
-0.04868991672992706,
-0.05358320102095604,
-0.0003424322931095958,
-0.02200242690742016,
-0.012276590801775455,
0.009361443109810352,
-0.0009391808998771012,
0.0011452367762103677,
0.0316154770553112,
-0.007162068039178848,
0.02467464655637741,
0.03623112663626671,
0.003466076450422406,
-0.03196251764893532,
0.03348949924111366,
-0.013812249526381493,
-0.04178379103541374,
0.0160246379673481,
0.05479784309864044,
-0.04622592031955719,
-0.011209438554942608,
-0.07315633445978165,
-0.03834807872772217,
-0.07031060010194778,
0.019087279215455055,
0.021603330969810486,
-0.013734165579080582,
0.09710219502449036,
0.03135519474744797,
0.02024986781179905,
-0.0530279316008091,
0.01719590462744236,
-0.022245356813073158,
0.026618078351020813,
0.020319277420639992,
0.007292208261787891,
-0.04056914523243904,
-0.029203537851572037,
-0.01642373576760292,
0.020753078162670135,
0.011426339857280254,
-0.01585111767053604,
0.04889814183115959,
-0.013326391577720642,
-0.016085371375083923,
-0.02191566675901413,
-0.029654690995812416,
0.08898142725229263,
-0.03935449942946434,
-0.002314332639798522,
0.014384867623448372,
0.027537738904356956,
-0.014619121327996254,
-0.0174822136759758,
-0.05188269540667534,
-0.04237376153469086,
0.016111399978399277,
-0.033888597041368484,
0.04809994623064995,
-0.0028175427578389645,
0.017699113115668297,
-0.011443691328167915,
-0.050147488713264465,
-0.05458961799740791,
-0.023060904815793037,
-0.02691306360065937,
-0.10695817321538925,
0.012406731955707073,
-0.02028457261621952,
-0.03938920423388481,
0.002052966970950365,
-0.06045462191104889,
0.017352072522044182,
0.007192433811724186,
0.010411243885755539,
-0.027555091306567192,
-0.0015280669322237372,
-0.05948290601372719,
-0.03550234064459801,
-0.009925385005772114,
-0.00764358788728714,
0.00013868101814296097,
-0.019087279215455055,
-0.01369946077466011,
0.004233905579894781,
-0.0207357257604599,
0.0419573113322258,
0.0038695121183991432,
0.02988026849925518,
-0.02361617051064968,
-0.0158077385276556,
0.01678813062608242,
-0.028873847797513008,
0.019868122413754463,
-0.057053614407777786,
-0.014627796597778797,
0.036612872034311295,
-0.047058820724487305,
0.110914446413517,
-0.03505118563771248,
-0.01215512678027153,
0.02333853766322136,
-0.05268089100718498,
-0.008155474439263344,
0.03354155644774437,
-0.01589449867606163,
-0.020215164870023727,
0.021325696259737015,
0.00044925601105205715,
0.031320489943027496,
0.025889292359352112,
0.04900225251913071,
-0.037341658025979996,
-0.01290994230657816,
0.018809646368026733,
0.02646191045641899,
0.06722193211317062,
-0.038278672844171524,
0.004160159267485142,
-0.015070274472236633,
0.024691998958587646,
-0.03406211733818054,
0.03609231114387512,
-0.04383133351802826,
-0.009465555660426617,
0.018115563318133354,
0.06121811270713806,
0.006450633052736521,
-0.005383480340242386,
-0.03466944023966789,
0.004116779193282127,
-0.020718375220894814,
0.001609404687769711,
0.035710565745830536,
-0.06618080288171768,
0.016154779121279716,
-0.04011799022555351,
0.024501126259565353,
0.02004164271056652,
0.010072877630591393,
-0.05236855521798134,
-0.013421827927231789,
0.04084677994251251,
0.01804615557193756,
-0.04379663243889809,
0.06264097988605499,
-0.009908033534884453,
0.009075134061276913,
0.005583029240369797,
-0.0052142976783216,
-0.045393019914627075,
0.026618078351020813,
-0.048724617809057236,
-0.13083462417125702,
-0.03699461743235588,
0.04213083162903786,
0.03170223534107208,
-0.05007807910442352,
-0.03239632025361061,
-0.02439701370894909,
-0.04761408641934395,
-0.010176990181207657,
0.05542251840233803,
-0.01613742671906948,
0.023026200011372566,
0.07176817208528519,
0.01853201352059841,
0.019295504316687584,
-0.03097344934940338,
0.03192781284451485,
-0.05163976922631264,
0.009283359162509441,
-0.028492102399468422,
-0.056047193706035614,
0.013577996753156185,
-0.03532882034778595,
-0.005179593805223703,
0.006641505751758814,
-0.018063507974147797,
0.028561512008309364,
0.03309040144085884,
-0.020596910268068314,
0.08662154525518417,
0.03048759140074253,
0.01014228630810976,
-0.019000519067049026,
0.057504769414663315,
0.03914627432823181,
0.08606627583503723,
-0.048273466527462006,
-0.009569668211042881,
0.05903175100684166,
0.00801231898367405,
0.026566023007035255,
0.020839838311076164,
0.026531318202614784,
-0.011660592630505562,
-0.019156688824295998,
0.03489501774311066,
-0.022575046867132187,
0.0549713671207428,
-0.04605240002274513,
0.012198506854474545,
0.04973103851079941,
0.004624327179044485,
0.017109142616391182,
0.009144541807472706,
-0.010879749432206154,
0.02297414466738701,
-0.0004286504117771983,
-0.0354502834379673,
0.03813985362648964,
0.010827693156898022,
-0.0018230520654469728,
-0.03463473543524742,
0.03859100863337517,
-0.011009889654815197,
-0.01983341947197914,
-0.012719068676233292,
0.03362831473350525,
-0.011643240228295326,
-0.06073225289583206,
0.018670829012989998,
-0.04646885022521019,
-0.027208048850297928,
-0.015660244971513748,
0.0020692346151918173,
0.013716813176870346,
-0.04868991672992706,
0.03524205833673477,
0.01687489077448845,
-0.03980565443634987,
-0.01276244968175888,
0.032673951238393784,
-0.006615477614104748,
0.002717768307775259,
0.002234079409390688,
-0.028752384707331657,
-0.019781362265348434,
-0.009161894209682941,
-0.026236332952976227,
-0.03800103813409805,
0.006780322175472975,
0.019729306921362877,
0.02988026849925518,
0.00841575488448143,
-0.02024986781179905,
0.026253685355186462,
0.02309560775756836,
0.034010060131549835,
0.00708398362621665,
0.043033137917518616,
0.033437442034482956
]
|
36,351 | statistics | inv_cdf | Inverse cumulative distribution function. x : P(X <= x) = p
Finds the value of the random variable such that the probability of
the variable being less than or equal to that value equals the given
probability.
This function is also called the percent point function or quantile
function.
| def inv_cdf(self, p):
"""Inverse cumulative distribution function. x : P(X <= x) = p
Finds the value of the random variable such that the probability of
the variable being less than or equal to that value equals the given
probability.
This function is also called the percent point function or quantile
function.
"""
if p <= 0.0 or p >= 1.0:
raise StatisticsError('p must be in the range 0.0 < p < 1.0')
if self._sigma <= 0.0:
raise StatisticsError('cdf() not defined when sigma at or below zero')
return _normal_dist_inv_cdf(p, self._mu, self._sigma)
| (self, p) | [
-0.022704442963004112,
-0.012354397214949131,
0.06113266572356224,
0.0036588020157068968,
0.07374624907970428,
-0.012328478507697582,
0.015913845971226692,
-0.08210922032594681,
0.018592070788145065,
0.02766348235309124,
-0.012535825371742249,
-0.0012905161129310727,
-0.006306789815425873,
0.015119017101824284,
-0.08314595371484756,
0.06458844244480133,
0.026436680927872658,
-0.006820836570113897,
-0.037806183099746704,
-0.05346084386110306,
0.010920249857008457,
0.05097268521785736,
-0.013503442518413067,
-0.02121846005320549,
-0.012164329178631306,
-0.005835940595716238,
-0.0029201300349086523,
-0.026436680927872658,
-0.007874848321080208,
-0.04879554733633995,
0.005714988335967064,
0.008933179080486298,
0.039810530841350555,
-0.012751811183989048,
0.03414306044578552,
0.01400452945381403,
0.02403491735458374,
-0.013995890505611897,
-0.06883904337882996,
0.00025661831023171544,
-0.02510620839893818,
-0.012147050350904465,
-0.028147289529442787,
0.021875057369470596,
0.006833795923739672,
0.01596568152308464,
0.016622278839349747,
0.027559807524085045,
0.0024125631898641586,
0.008129711262881756,
0.00958113744854927,
0.018367445096373558,
0.04758602753281593,
-0.03205231577157974,
-0.03625108301639557,
0.04499419406056404,
0.030065245926380157,
0.023879406973719597,
-0.01257038302719593,
0.014937588945031166,
-0.004872643388807774,
-0.01765037328004837,
0.009157804772257805,
-0.07692556083202362,
0.030790958553552628,
0.02087288349866867,
-0.033970270305871964,
0.030047966167330742,
-0.02203056775033474,
0.0323287770152092,
-0.027214230969548225,
0.02655763365328312,
-0.019369620829820633,
0.009831680916249752,
0.027507971972227097,
0.014894391410052776,
0.0331408865749836,
0.025849198922514915,
0.00249679759144783,
-0.0021695790346711874,
0.019870707765221596,
-0.035456255078315735,
0.07478297501802444,
0.01848839782178402,
-0.016820985823869705,
-0.027438856661319733,
0.039603184908628464,
-0.027818990871310234,
0.026315728202462196,
0.1170816645026207,
-0.005706348922103643,
0.031050141900777817,
-0.0053046150133013725,
0.0005189062794670463,
0.07395359128713608,
0.010643787682056427,
0.013926774263381958,
0.07989752292633057,
0.051974859088659286,
0.02740429900586605,
0.04620371758937836,
0.08915900439023972,
0.06959931552410126,
-0.012432151474058628,
0.026626748964190483,
0.017641732469201088,
0.010211816057562828,
0.016216225922107697,
0.04046712815761566,
-0.027801712974905968,
-0.04986683651804924,
0.03632019832730293,
0.0265921913087368,
-0.028959397226572037,
0.001294835819862783,
-0.08197098970413208,
-0.06286055594682693,
0.013460244983434677,
0.01001310907304287,
0.01168052013963461,
-0.0435427688062191,
0.028285520151257515,
-0.024190427735447884,
0.00420092698186636,
-0.03452319651842117,
-0.044683173298835754,
-0.006285191513597965,
-0.06199660897254944,
-0.026626748964190483,
-0.003784073982387781,
0.019732477143406868,
-0.07125809043645859,
0.05473948270082474,
0.02484702505171299,
0.0209592767059803,
-0.047620583325624466,
0.06372449547052383,
0.0025810322258621454,
0.03132660314440727,
0.038186319172382355,
0.02019900642335415,
0.014289630576968193,
-0.008673995733261108,
0.036216527223587036,
0.11894778907299042,
0.036562103778123856,
0.06838979572057724,
0.03967230021953583,
-0.003036762587726116,
-0.025970151647925377,
-0.019628804177045822,
-0.012026098556816578,
0.03001340851187706,
-0.024656957015395164,
0.04565079137682915,
-0.028354637324810028,
-0.0009006614563986659,
-0.06410463154315948,
-0.0531843826174736,
-0.039983320981264114,
-0.008250663988292217,
0.02693776786327362,
0.0008769030100665987,
0.0004138830990996212,
0.014436501078307629,
-0.015689220279455185,
0.0073219239711761475,
-0.058471716940402985,
-0.008108112961053848,
-0.03315816447138786,
-0.03701135516166687,
-0.01724431850016117,
0.012648137286305428,
-0.035456255078315735,
-0.04855364188551903,
-0.044717732816934586,
-0.006090804003179073,
0.019801592454314232,
-0.0053391726687550545,
0.04482140764594078,
0.006902911234647036,
-0.018471119925379753,
-0.01445377990603447,
-0.017460305243730545,
0.025365391746163368,
-0.006505497265607119,
0.021253017708659172,
-0.00040065395296551287,
0.039430394768714905,
-0.007671821396797895,
-0.03977597504854202,
-0.02400035969913006,
0.038877472281455994,
-0.032380614429712296,
0.01848839782178402,
-0.005857539363205433,
-0.08342241495847702,
-0.024052197113633156,
0.007922365330159664,
0.0010982885723933578,
0.03352101892232895,
0.011792832985520363,
-0.006838115397840738,
-0.000980576267465949,
-0.06731850653886795,
0.03828999027609825,
-0.034937888383865356,
0.0035400099586695433,
0.05809158459305763,
0.034989725798368454,
-0.0032505886629223824,
-0.05373730510473251,
0.01947329379618168,
-0.057573217898607254,
-0.04810439422726631,
0.011879228055477142,
0.036181967705488205,
-0.053391728550195694,
-0.0009703169343993068,
0.06870081275701523,
0.02676497958600521,
-0.007231209892779589,
0.029356811195611954,
0.0021037033293396235,
0.022445261478424072,
0.018419282510876656,
-0.03863556683063507,
0.008233385160565376,
-0.04074358940124512,
-0.019663361832499504,
0.0008380255312658846,
0.05204397812485695,
0.015913845971226692,
-0.048173509538173676,
0.003395299194380641,
-0.02928769588470459,
-0.03787529841065407,
0.034350406378507614,
-0.08432091772556305,
0.05981947109103203,
-0.04188399761915207,
0.05909375846385956,
0.05442846193909645,
0.03163762390613556,
0.015300445258617401,
-0.023343762382864952,
-0.014142760075628757,
0.06413918733596802,
0.023844849318265915,
0.04627283290028572,
-0.043957460671663284,
-0.07291685789823532,
-0.10754372924566269,
-0.011179433204233646,
0.05083445459604263,
-0.0125099066644907,
0.007447195705026388,
0.043058961629867554,
0.021028392016887665,
0.0286483783274889,
-0.04786248877644539,
-0.055050499737262726,
0.0011911625042557716,
0.00188339757733047,
-0.026834094896912575,
-0.03828999027609825,
-0.04174576699733734,
-0.0189549271017313,
0.0475514680147171,
-0.0008931019110605121,
0.031015584245324135,
0.04810439422726631,
0.05149105191230774,
-0.03448863700032234,
0.030877351760864258,
-0.05294247716665268,
0.03132660314440727,
-0.018799418583512306,
0.00958113744854927,
0.037460602819919586,
0.051249146461486816,
-0.00420092698186636,
-0.022358866408467293,
0.00016360936569981277,
-0.01625942252576351,
0.019196832552552223,
-0.03535258024930954,
-0.07575059682130814,
0.042160458862781525,
0.03530074656009674,
-0.00653141550719738,
0.027784433215856552,
-0.050143301486968994,
0.003069160506129265,
0.03666577488183975,
-0.013088748790323734,
0.034350406378507614,
-0.05442846193909645,
-0.007680460810661316,
0.05225132405757904,
0.08328418433666229,
-0.022600769996643066,
-0.04133107140660286,
0.0017440866213291883,
0.006656687241047621,
0.04285161569714546,
0.02023356407880783,
0.030773678794503212,
-0.023585665971040726,
-0.01625078357756138,
-0.020043496042490005,
0.02510620839893818,
-0.04945214465260506,
0.00613832101225853,
0.014643847942352295,
-0.08238568156957626,
0.007766854949295521,
-0.03478237986564636,
0.03974141553044319,
0.011386780068278313,
-0.012164329178631306,
0.037253256887197495,
0.08286949247121811,
0.017779964953660965,
-0.07388447970151901,
-0.030600890517234802,
-0.0014427861897274852,
0.044683173298835754,
0.016959218308329582,
0.001545379520393908,
-0.04665296524763107,
0.02203056775033474,
0.01709744893014431,
0.04565079137682915,
0.025175323709845543,
0.04717133194208145,
0.022773560136556625,
-0.02438049577176571,
0.04751691222190857,
-0.03594006225466728,
-0.018626628443598747,
0.013598475605249405,
-0.031101977452635765,
-0.03177585452795029,
-0.04184943810105324,
-0.04914112389087677,
0.02804361656308174,
-0.0036134449765086174,
0.041814882308244705,
-0.01712336763739586,
0.04174576699733734,
-0.015663301572203636,
0.027801712974905968,
0.00956385862082243,
0.0411582849919796,
0.049763165414333344,
0.02429410070180893,
-0.0004902881337329745,
0.0036955196410417557,
0.03378020226955414,
0.06642000377178192,
0.02336104027926922,
-0.028510145843029022,
-0.06127089634537697,
-0.06265320628881454,
0.008622159250080585,
-0.02813001163303852,
-0.006181518081575632,
-0.006475259084254503,
0.04022522643208504,
-0.009296035394072533,
-0.056501924991607666,
-0.01964608207345009,
-0.02728334628045559,
-0.011006643995642662,
-0.04737867787480354,
-0.06071797385811806,
-0.021978730335831642,
-0.0007505511748604476,
0.03884291648864746,
0.021166624501347542,
-0.03732237219810486,
-0.03479965776205063,
-0.006237674504518509,
-0.04302440211176872,
0.02557273767888546,
0.03419489786028862,
0.0193868987262249,
-0.007075699977576733,
-0.02876932919025421,
-0.04133107140660286,
-0.04229868948459625,
0.03739148750901222,
-0.0127258924767375,
0.03288170322775841,
-0.027352461591362953,
0.07264039665460587,
-0.04302440211176872,
-0.013209701515734196,
-0.014108202420175076,
0.018090983852744102,
0.06876993179321289,
-0.028371915221214294,
-0.01874758116900921,
-0.0038294310215860605,
-0.05608723312616348,
-0.0034428162034600973,
-0.04537433013319969,
0.04084726423025131,
-0.0033326633274555206,
0.002900691470131278,
0.06330980360507965,
-0.017192482948303223,
0.007196652237325907,
0.018678465858101845,
-0.0483117401599884,
-0.060821644961833954,
-0.08577234297990799,
-0.003892066888511181,
-0.019265947863459587,
0.012147050350904465,
-0.05826437100768089,
-0.01793547347187996,
-0.04641106352210045,
0.004079974722117186,
-0.03350374102592468,
-0.019801592454314232,
-0.0265921913087368,
-0.009572497569024563,
0.07174189388751984,
-0.06075252965092659,
-0.02728334628045559,
-0.037460602819919586,
0.017054250463843346,
0.03251884505152702,
0.010064945556223392,
-0.01295915711671114,
0.033279117196798325,
-0.014125481247901917,
0.04844997078180313,
0.007978521287441254,
0.052147649228572845,
0.028631098568439484,
-0.02365478128194809,
-0.05114547535777092,
0.040363457053899765,
0.001535660121589899,
-0.004159889649599791,
0.04464861750602722,
-0.06109810620546341,
0.0805886834859848,
0.036562103778123856,
0.0395340695977211,
0.015075819566845894,
-0.014522896148264408,
-0.003963342402130365,
-0.0571930818259716,
0.03479965776205063,
-0.016760509461164474,
0.002509756712242961,
-0.007602705620229244,
0.0670420378446579,
-0.07132720202207565,
-0.06911550462245941,
0.038704682141542435,
0.01477343961596489,
0.034937888383865356,
-0.0021458205301314592,
0.050143301486968994,
-0.006565973162651062,
0.03488605096936226,
0.01701105386018753,
-0.04157297685742378,
-0.021529480814933777,
0.0010388924274593592,
-0.017175203189253807,
-0.0524241104722023,
0.022047845646739006,
0.037633392959833145,
0.014142760075628757,
0.011326303705573082,
-0.012129771523177624,
-0.001001634867861867,
-0.015023983083665371,
0.023810291662812233,
-0.07042869925498962,
-0.038739241659641266,
0.050661664456129074,
0.01680370792746544,
0.0008412653114646673,
0.05587988719344139,
-0.003416897961869836,
0.032639797776937485,
-0.026885932311415672,
0.00288125267252326,
-0.0337974838912487,
0.04371555894613266,
0.015231329947710037,
0.05874818190932274,
-0.06057974323630333,
-0.018367445096373558,
0.059197429567575455,
-0.0034600950311869383,
-0.0034233774058520794,
-0.021166624501347542,
0.005088629201054573,
0.06348259001970291,
0.03288170322775841,
-0.00021882077271584421,
0.013218340463936329,
0.07865344732999802,
-0.010375965386629105,
0.008013078942894936,
-0.03013436123728752,
0.0029330893885344267,
0.006090804003179073,
-0.05308070778846741,
0.019317783415317535,
-0.007391039282083511,
-0.013356572017073631,
0.051594726741313934,
0.00996991153806448,
-0.006064885761588812,
0.01779724285006523,
-0.02928769588470459,
0.018833976238965988,
-0.020423632115125656,
-0.012751811183989048,
-0.024656957015395164,
0.026142939925193787,
-0.03901570290327072,
-0.05753865838050842,
0.04129651561379433,
0.025434507057070732,
-0.022186078131198883,
-0.006337027996778488,
-0.07118897140026093,
-0.030600890517234802,
-0.050661664456129074,
-0.009641612879931927,
-0.0077193379402160645,
0.026955047622323036,
0.07291685789823532,
0.01921411044895649,
0.04717133194208145,
-0.031654901802539825,
-0.027957221493124962,
0.0058618588373064995,
0.007637263275682926,
0.04554712027311325,
0.043266307562589645,
-0.06538327038288116,
-0.020302679389715195,
-0.05508505925536156,
0.03590550646185875,
0.06486490368843079,
-0.03502428159117699,
0.03773706778883934,
-0.01930050551891327,
-0.020008938387036324,
-0.019179552793502808,
-0.04112372547388077,
0.05501594394445419,
-0.049417588859796524,
-0.044717732816934586,
0.012363036163151264,
0.009926714934408665,
-0.00819882657378912,
-0.025002533569931984,
-0.04565079137682915,
-0.015507792122662067,
0.023620223626494408,
-0.04457950219511986,
0.03099830448627472,
-0.015982961282134056,
0.025261716917157173,
0.017512140795588493,
-0.05843716114759445,
0.041434746235609055,
0.0402943417429924,
-0.02591831423342228,
-0.09973367303609848,
-0.0014741041231900454,
0.0008050876786001027,
-0.06203116849064827,
0.03732237219810486,
-0.04060535877943039,
0.026021989062428474,
0.036942239850759506,
0.03193136304616928,
-0.026246612891554832,
-0.040156107395887375,
-0.004859684035181999,
-0.052320439368486404,
-0.011991539970040321,
-0.018453840166330338,
0.04171120747923851,
-0.004321879241615534,
-0.013434326276183128,
-0.00626359274610877,
-0.022047845646739006,
0.04844997078180313,
-0.0346614271402359,
-0.0181428212672472,
-0.006794918328523636,
-0.050730783492326736,
0.00030589010566473007,
-0.04554712027311325,
0.03205231577157974,
-0.00005298405449138954,
-0.017175203189253807,
0.0105055570602417,
-0.06400095671415329,
0.07851521670818329,
0.034212175756692886,
0.007589746732264757,
0.0019125556573271751,
-0.0628259927034378,
-0.004682575352489948,
0.013598475605249405,
-0.06583251804113388,
0.007948283106088638,
0.027093278244137764,
-0.008777669630944729,
0.013909495435655117,
-0.024743352085351944,
0.039257608354091644,
-0.05601811781525612,
-0.03206959366798401,
0.03329639509320259,
-0.008254983462393284,
0.021028392016887665,
-0.030462659895420074,
0.03939583897590637,
-0.07319331914186478,
0.0024125631898641586,
-0.0028121371287852526,
0.013356572017073631,
-0.02949504181742668,
0.045063309371471405,
0.012665416114032269,
0.03632019832730293,
-0.03022075444459915,
-0.02890755981206894,
-0.015179493464529514,
0.03530074656009674,
-0.047033101320266724,
-0.006535734981298447,
0.006859714165329933,
-0.11473174393177032,
0.023706618696451187,
0.011110317893326283,
0.027853548526763916,
0.016734592616558075,
-0.05045431852340698,
-0.03220782428979874,
-0.008233385160565376,
0.05511961504817009,
0.029788782820105553,
-0.0021695790346711874,
0.016760509461164474,
0.016319898888468742,
-0.030773678794503212,
0.00011703739437507465,
0.0201471708714962,
-0.00022044066281523556,
0.04844997078180313,
-0.03300265595316887,
-0.11583758890628815,
-0.014505617320537567,
0.027421576902270317,
0.06341347843408585,
-0.03822087496519089,
-0.03759883716702461,
-0.0025983110535889864,
0.0015140615869313478,
-0.015386839397251606,
0.00691587058827281,
-0.03683856502175331,
0.058920968323946,
0.04316263273358345,
0.01223344448953867,
0.03257068246603012,
-0.005732267163693905,
0.02714511565864086,
0.031274765729904175,
0.011006643995642662,
-0.03428129106760025,
-0.061547357589006424,
-0.01779724285006523,
-0.03676944971084595,
-0.022687165066599846,
-0.01874758116900921,
-0.004855364561080933,
0.09399709105491638,
-0.01942145824432373,
-0.010358686558902264,
0.04001787677407265,
-0.021201182156801224,
0.05494682863354683,
-0.032639797776937485,
0.024363216012716293,
0.046307388693094254,
0.03160306438803673,
-0.07858432829380035,
-0.023240089416503906,
0.04316263273358345,
0.009399709291756153,
-0.0030993984546512365,
0.03770250827074051,
0.004373715724796057,
0.013762624934315681,
-0.014151399955153465,
0.013201061636209488,
0.030289871618151665,
0.09890428930521011,
-0.023983079940080643,
0.03333095461130142,
-0.01030685007572174,
0.0033499421551823616,
0.007283046375960112,
0.0069417888298630714,
-0.0127258924767375,
-0.0013779903529211879,
-0.013054191134870052,
-0.027076000347733498,
0.02142580784857273,
-0.010954807512462139,
-0.007706379052251577,
-0.014928949065506458,
-0.019576966762542725,
-0.016190307214856148,
-0.00476033054292202,
-0.04914112389087677,
0.001593976397998631,
-0.014522896148264408,
-0.05563798174262047,
0.022514376789331436,
-0.06427741795778275,
-0.028631098568439484,
0.004125331994146109,
0.06002681702375412,
0.0229636263102293,
-0.006306789815425873,
0.03022075444459915,
0.007356481626629829,
-0.029996130615472794,
-0.03732237219810486,
0.03732237219810486,
-0.016302620992064476,
-0.009943993762135506,
0.013702149502933025,
-0.010255013592541218,
0.013408408500254154,
-0.009779844433069229,
-0.03378020226955414,
0.0017980830743908882,
0.0500396266579628,
-0.0021922574378550053,
-0.0012451590737327933,
-0.07056692987680435,
-0.000006850804766145302,
-0.011041202582418919,
0.03894658759236336,
0.01793547347187996,
0.02949504181742668,
0.038739241659641266,
0.0185229554772377
]
|
36,352 | statistics | overlap | Compute the overlapping coefficient (OVL) between two normal distributions.
Measures the agreement between two normal probability distributions.
Returns a value between 0.0 and 1.0 giving the overlapping area in
the two underlying probability density functions.
>>> N1 = NormalDist(2.4, 1.6)
>>> N2 = NormalDist(3.2, 2.0)
>>> N1.overlap(N2)
0.8035050657330205
| def overlap(self, other):
"""Compute the overlapping coefficient (OVL) between two normal distributions.
Measures the agreement between two normal probability distributions.
Returns a value between 0.0 and 1.0 giving the overlapping area in
the two underlying probability density functions.
>>> N1 = NormalDist(2.4, 1.6)
>>> N2 = NormalDist(3.2, 2.0)
>>> N1.overlap(N2)
0.8035050657330205
"""
# See: "The overlapping coefficient as a measure of agreement between
# probability distributions and point estimation of the overlap of two
# normal densities" -- Henry F. Inman and Edwin L. Bradley Jr
# http://dx.doi.org/10.1080/03610928908830127
if not isinstance(other, NormalDist):
raise TypeError('Expected another NormalDist instance')
X, Y = self, other
if (Y._sigma, Y._mu) < (X._sigma, X._mu): # sort to assure commutativity
X, Y = Y, X
X_var, Y_var = X.variance, Y.variance
if not X_var or not Y_var:
raise StatisticsError('overlap() not defined when sigma is zero')
dv = Y_var - X_var
dm = fabs(Y._mu - X._mu)
if not dv:
return 1.0 - erf(dm / (2.0 * X._sigma * sqrt(2.0)))
a = X._mu * Y_var - Y._mu * X_var
b = X._sigma * Y._sigma * sqrt(dm**2.0 + dv * log(Y_var / X_var))
x1 = (a + b) / dv
x2 = (a - b) / dv
return 1.0 - (fabs(Y.cdf(x1) - X.cdf(x1)) + fabs(Y.cdf(x2) - X.cdf(x2)))
| (self, other) | [
-0.012472033500671387,
-0.031084425747394562,
0.046353328973054886,
0.026183072477579117,
0.012900219298899174,
-0.03130307421088219,
-0.0234499741345644,
-0.03983033820986748,
-0.015496661886572838,
0.03939304128289223,
-0.02805979922413826,
-0.03715190291404724,
0.04372955486178398,
0.024761861190199852,
-0.06420956552028656,
0.030865779146552086,
-0.011205698363482952,
-0.008969114162027836,
0.009538508951663971,
-0.023213105276226997,
-0.01669011451303959,
0.005425198003649712,
-0.0260373055934906,
-0.04846692457795143,
-0.03534805774688721,
-0.004482279531657696,
-0.07047747075557709,
-0.06271547079086304,
-0.04526009038090706,
0.0028105350211262703,
0.02263004519045353,
-0.06763504445552826,
0.02370506338775158,
-0.014321429654955864,
0.0443490594625473,
-0.04037695750594139,
0.07178935408592224,
0.06344429403543472,
-0.08075391501188278,
0.018111323937773705,
-0.047628775238990784,
-0.06512060016393661,
0.048576246947050095,
-0.013191749341785908,
0.030300937592983246,
0.01163388416171074,
-0.05867048725485802,
0.06380870938301086,
-0.0391743928194046,
0.023650402203202248,
-0.0001449111005058512,
-0.03512940928339958,
0.02306734025478363,
-0.03332556411623955,
-0.05076272785663605,
0.10057798027992249,
0.05888913571834564,
0.03443702682852745,
-0.023923711851239204,
-0.019878726452589035,
0.02621951326727867,
-0.025545349344611168,
0.016343921422958374,
-0.05757724866271019,
-0.016717445105314255,
-0.019988050684332848,
-0.05028899013996124,
0.024506771937012672,
0.03862777352333069,
0.060638315975666046,
-0.006103917025029659,
0.03102976456284523,
-0.013164418749511242,
-0.0016284704906865954,
0.019168121740221977,
0.059508636593818665,
0.007579789496958256,
0.005958152003586292,
0.08104544132947922,
-0.022393176332116127,
0.024288123473525047,
-0.04190749302506447,
0.022484280169010162,
-0.020243139937520027,
0.01889481209218502,
-0.009401854127645493,
-0.04956016317009926,
0.016599010676145554,
0.07871320098638535,
-0.005511746276170015,
-0.0017275451682507992,
0.06377226859331131,
0.04413041099905968,
0.001968968892470002,
0.020953746512532234,
0.037388771772384644,
-0.011460787616670132,
-0.0023219939321279526,
0.0400489866733551,
-0.03130307421088219,
0.018275311216711998,
0.05145511031150818,
0.06869184225797653,
0.07463177293539047,
0.0033571545500308275,
-0.013200859539210796,
0.001960997236892581,
0.03348955139517784,
-0.026693249121308327,
0.05152799189090729,
-0.03939304128289223,
-0.008946338668465614,
0.00862747710198164,
-0.011998296715319157,
-0.029881862923502922,
-0.06446465104818344,
-0.03197723627090454,
0.057431481778621674,
0.02426990307867527,
-0.001045979093760252,
-0.0026829903945326805,
0.04536941275000572,
0.021281717345118523,
-0.03002762794494629,
0.025235597044229507,
-0.02938990667462349,
0.013793030753731728,
-0.019386770203709602,
-0.034109052270650864,
-0.026383498683571815,
0.06486550718545914,
-0.007197156082838774,
0.026529263705015182,
0.04055916145443916,
0.0826488584280014,
-0.05622892081737518,
0.03133951500058174,
0.01718207076191902,
0.053240735083818436,
0.04507788270711899,
0.0357489138841629,
-0.017546484246850014,
0.025508908554911613,
-0.01257224753499031,
-0.03658706322312355,
0.05378735437989235,
0.042818523943424225,
-0.0169998649507761,
0.033034034073352814,
0.005971817299723625,
-0.044968560338020325,
0.0035188626497983932,
0.025381363928318024,
-0.03647773712873459,
-0.005762279964983463,
-0.04467703029513359,
0.03680570796132088,
-0.06643248349428177,
0.002345908433198929,
-0.04125154763460159,
-0.05353226512670517,
0.02547246590256691,
0.01638036221265793,
-0.005958152003586292,
0.05218393728137016,
-0.003903773846104741,
0.019350329414010048,
-0.020006271079182625,
0.004855802748352289,
-0.05688486248254776,
-0.02326776832342148,
-0.019058797508478165,
0.015587764792144299,
-0.019678300246596336,
-0.001077295863069594,
-0.02478008158504963,
-0.0031407843343913555,
-0.01304598432034254,
-0.022520720958709717,
-0.03287005051970482,
0.08279462903738022,
-0.010331107303500175,
-0.00888256635516882,
-0.030865779146552086,
-0.046790625900030136,
0.054953474551439285,
0.02906193397939205,
0.01612527295947075,
0.02204698510468006,
0.010467762127518654,
0.0034983644727617502,
-0.08534551411867142,
-0.015769971534609795,
-0.0021227055694907904,
0.03084755688905716,
0.019131680950522423,
-0.053058527410030365,
-0.007438579574227333,
0.005160998553037643,
0.011360574513673782,
-0.01064996886998415,
0.023231327533721924,
-0.044968560338020325,
0.025745775550603867,
0.055390771478414536,
0.030428482219576836,
-0.01699075475335121,
0.02299445867538452,
-0.027148766443133354,
-0.07623519003391266,
-0.015414668247103691,
-0.06603162735700607,
0.0018083993345499039,
-0.010750182904303074,
0.03979389742016792,
0.01198007632046938,
0.010148901492357254,
-0.0658494234085083,
-0.06311632692813873,
-0.008818794041872025,
0.06348074227571487,
-0.02887972816824913,
0.011406125500798225,
0.04821183532476425,
0.029535671696066856,
0.05666621774435043,
0.010823065415024757,
-0.00426590908318758,
0.05130934715270996,
-0.005607404746115208,
0.04168884456157684,
0.019077017903327942,
0.001022064476273954,
-0.047118596732616425,
-0.021664351224899292,
0.002310605952516198,
-0.024488551542162895,
0.008121853694319725,
-0.07211732864379883,
0.0234499741345644,
-0.04369311407208443,
0.018676163628697395,
0.026128409430384636,
0.03090221993625164,
-0.010759293101727962,
-0.06220529228448868,
-0.006190465297549963,
0.02672969177365303,
0.04726436361670494,
0.06942067295312881,
-0.060201022773981094,
-0.05560941994190216,
-0.05061696097254753,
-0.01146989781409502,
0.02767716534435749,
-0.09700673073530197,
-0.04139731451869011,
-0.008386053144931793,
0.03228699043393135,
0.032323431223630905,
0.004051816649734974,
0.018858371302485466,
-0.049961019307374954,
0.023413533344864845,
-0.05655689164996147,
0.008964559063315392,
-0.030628910288214684,
-0.009857370518147945,
-0.013783920556306839,
0.03483787924051285,
0.016161715611815453,
0.027440296486020088,
0.02793225459754467,
-0.04008542746305466,
0.0018220648635178804,
0.03906507045030594,
0.044786352664232254,
-0.027094103395938873,
0.06501127034425735,
0.013893244788050652,
0.05437041446566582,
-0.03512940928339958,
-0.08017085492610931,
-0.006185910198837519,
0.01484982855618,
-0.02882506512105465,
-0.025108054280281067,
-0.055645860731601715,
0.04653553664684296,
0.011706766672432423,
-0.012153172865509987,
-0.0005520287086255848,
0.0251627154648304,
0.013629045337438583,
-0.024233462288975716,
-0.012991322204470634,
0.03760741651058197,
-0.018676163628697395,
-0.0023185776080936193,
-0.01365637592971325,
0.01699075475335121,
0.00881423894315958,
-0.0052748778834939,
-0.012371820397675037,
0.0009150182013399899,
-0.0033571545500308275,
0.06031034514307976,
0.02009737491607666,
0.0174371600151062,
0.024816522374749184,
-0.023158444091677666,
0.01732783578336239,
-0.01592484675347805,
0.025581790134310722,
-0.01365637592971325,
0.04157951846718788,
0.007420359179377556,
-0.005233881063759327,
0.008495377376675606,
0.03450990840792656,
-0.031321294605731964,
0.038154035806655884,
0.02009737491607666,
0.005324984434992075,
0.03609510511159897,
-0.017610257491469383,
0.03465567156672478,
0.08104544132947922,
0.042745642364025116,
0.06428244709968567,
-0.09576772898435593,
-0.017364278435707092,
0.009720715694129467,
0.08082679659128189,
-0.001404128735885024,
0.006058365572243929,
0.042490553110837936,
-0.024543212726712227,
0.04638976976275444,
-0.032578520476818085,
-0.028296666219830513,
0.031084425747394562,
-0.017172960564494133,
-0.04008542746305466,
-0.002569111529737711,
-0.06574010103940964,
0.05560941994190216,
0.006960287690162659,
0.016407694667577744,
-0.04070492833852768,
-0.001229893765412271,
0.07240885496139526,
0.0529492050409317,
-0.03199545666575432,
0.0367874875664711,
0.01940499059855938,
-0.008048971183598042,
-0.02514449506998062,
0.0460253581404686,
-0.00995758455246687,
-0.002049822825938463,
0.0355120450258255,
-0.03266962245106697,
-0.06435532867908478,
-0.06595874577760696,
0.040413398295640945,
-0.0486491322517395,
-0.013847692869603634,
-0.03939304128289223,
-0.043000731617212296,
-0.04974237084388733,
-0.05378735437989235,
-0.039976101368665695,
-0.018539508804678917,
-0.000625195971224457,
0.003496086923405528,
-0.04493211954832077,
-0.042745642364025116,
-0.026019085198640823,
-0.022903354838490486,
0.014458084478974342,
0.008272174745798111,
-0.04835760220885277,
0.02015203796327114,
-0.028223784640431404,
-0.013756589964032173,
-0.01413011271506548,
-0.0071424939669668674,
0.03924727812409401,
0.028278445824980736,
0.05881625413894653,
-0.03620442748069763,
0.03715190291404724,
-0.003252385649830103,
-0.0507991686463356,
0.00875502172857523,
0.005356870591640472,
-0.013091536238789558,
-0.006855519022792578,
-0.0007652672356925905,
0.03647773712873459,
0.031175529584288597,
0.011579222045838833,
0.00021637020108755678,
-0.01210762094706297,
-0.047045715153217316,
0.00019857659935951233,
-0.008217512629926205,
-0.010367549024522305,
0.07160715013742447,
-0.07361141592264175,
0.0005007831496186554,
-0.013127977028489113,
0.008331391029059887,
-0.023814387619495392,
-0.040413398295640945,
-0.04128798842430115,
-0.017364278435707092,
0.027841150760650635,
0.00353252817876637,
0.02623773366212845,
-0.03449168801307678,
0.03210478276014328,
0.0035484712570905685,
0.01707274839282036,
-0.07856743782758713,
-0.016261927783489227,
-0.010331107303500175,
0.0015658369520679116,
-0.0632985308766365,
0.01566975750029087,
0.01630748063325882,
-0.045478738844394684,
0.00935630314052105,
-0.0005153027013875544,
0.019058797508478165,
0.03514762967824936,
0.01424854714423418,
0.064501091837883,
0.0019484705990180373,
0.005589183885604143,
0.04303717240691185,
0.035366278141736984,
0.001790178706869483,
-0.09394565969705582,
-0.04511432349681854,
0.031011544167995453,
-0.05692130699753761,
0.017901787534356117,
-0.05560941994190216,
0.06781725585460663,
0.021974101662635803,
0.020880863070487976,
0.041178666055202484,
-0.046681299805641174,
-0.003215944394469261,
-0.03174037113785744,
-0.08541840314865112,
-0.0464990958571434,
0.010668189264833927,
-0.04147019609808922,
0.033143360167741776,
-0.032013680785894394,
0.031084425747394562,
-0.0395752489566803,
0.018676163628697395,
0.060638315975666046,
0.010686410591006279,
0.0327242836356163,
0.00931986141949892,
0.03680570796132088,
-0.025563569739460945,
-0.01902235671877861,
-0.018156876787543297,
-0.021190613508224487,
0.03381752222776413,
-0.011870752088725567,
0.01725495420396328,
0.017546484246850014,
-0.011934524402022362,
-0.001489538000896573,
0.004655375611037016,
0.0033571545500308275,
-0.009584060870110989,
0.03797183185815811,
-0.026656808331608772,
-0.013009542599320412,
0.00862747710198164,
-0.007197156082838774,
0.0292623620480299,
0.046426210552453995,
-0.005949041806161404,
-0.03279716521501541,
-0.030792895704507828,
-0.027841150760650635,
-0.014959151856601238,
0.0585247240960598,
-0.03261496126651764,
0.023923711851239204,
-0.06581298261880875,
-0.0077711064368486404,
-0.0017537374515086412,
-0.035548485815525055,
-0.02255716174840927,
0.006618650630116463,
0.02705766260623932,
-0.03840912505984306,
0.0006138081080280244,
-0.02862463891506195,
0.05338649824261665,
0.031558163464069366,
-0.07798437774181366,
0.039210833609104156,
0.004846692550927401,
0.05437041446566582,
-0.00513366749510169,
-0.008080857805907726,
0.023869048804044724,
0.008545484393835068,
-0.037261225283145905,
-0.004796585533767939,
-0.0014177941484376788,
-0.017036305740475655,
-0.0391743928194046,
-0.036113325506448746,
0.008563704788684845,
-0.005288543179631233,
0.016972534358501434,
-0.03401795029640198,
-0.054880592972040176,
-0.06858251988887787,
-0.02647460252046585,
-0.002241139765828848,
0.019040577113628387,
-0.04741012677550316,
0.046681299805641174,
-0.10021356493234634,
-0.0005053383065387607,
-0.05498991534113884,
0.04165240377187729,
0.01933210715651512,
0.027221648022532463,
0.06439176946878433,
0.016562569886446,
0.05717639625072479,
0.0363866351544857,
-0.02357751876115799,
-0.03090221993625164,
-0.001770819304510951,
0.06326209008693695,
0.04329226166009903,
-0.007702779024839401,
-0.007534238044172525,
0.029426347464323044,
0.0004819930763915181,
0.029553892090916634,
-0.056593332439661026,
-0.04157951846718788,
0.025873320177197456,
0.06311632692813873,
0.012790895067155361,
0.004352457355707884,
0.03121197037398815,
-0.025563569739460945,
-0.06082052364945412,
0.025563569739460945,
0.01422121562063694,
0.02250250056385994,
-0.03015517257153988,
0.04194393381476402,
-0.04708215594291687,
0.04030407592654228,
-0.08017085492610931,
-0.022575384005904198,
-0.02421524189412594,
0.059180665761232376,
0.04252699390053749,
-0.026711471378803253,
-0.06049255281686783,
-0.024288123473525047,
-0.043000731617212296,
-0.06471974402666092,
0.04008542746305466,
-0.02938990667462349,
-0.018293531611561775,
0.034218378365039825,
-0.08760488033294678,
0.018302641808986664,
0.08301327377557755,
0.005935376044362783,
-0.09562196582555771,
-0.03407261148095131,
-0.038700658828020096,
-0.03913795202970505,
-0.02040712535381317,
0.06650536507368088,
0.0051473332569003105,
0.0025941648054867983,
0.023231327533721924,
-0.03695147484540939,
0.03549382463097572,
0.007188045885413885,
-0.015241572633385658,
-0.01567886769771576,
0.03430948033928871,
0.004384343512356281,
0.003748898394405842,
-0.06686978042125702,
0.0008449825691059232,
-0.012153172865509987,
0.0032911046873778105,
-0.021955881267786026,
-0.01794733852148056,
-0.008108188398182392,
0.03374464064836502,
-0.02705766260623932,
-0.0008039860986173153,
-0.06563077867031097,
0.040741369128227234,
0.04653553664684296,
0.038154035806655884,
0.04362023249268532,
0.02918947860598564,
-0.016972534358501434,
-0.0037238451186567545,
-0.00970249529927969,
0.032633181661367416,
-0.04915931075811386,
0.02099018730223179,
0.02762250229716301,
0.013200859539210796,
0.025691114366054535,
-0.028278445824980736,
-0.03753453493118286,
0.004327403847128153,
-0.012763564474880695,
0.014485415071249008,
-0.011160147376358509,
0.00574861466884613,
0.04296428710222244,
-0.018730826675891876,
-0.019550755620002747,
-0.049961019307374954,
0.05480771139264107,
-0.04413041099905968,
0.01064996886998415,
-0.0619502030313015,
0.028405990451574326,
0.05378735437989235,
-0.03822692111134529,
0.023595739156007767,
-0.02035246416926384,
0.009078438393771648,
0.019423210993409157,
-0.03121197037398815,
-0.04157951846718788,
-0.012526695616543293,
-0.019259225577116013,
0.07109697163105011,
-0.0015339507954195142,
0.018676163628697395,
0.0005264059291221201,
-0.03565780818462372,
0.006609539967030287,
0.02938990667462349,
-0.03126663342118263,
0.017409829422831535,
-0.0481753945350647,
-0.028223784640431404,
0.008545484393835068,
0.039976101368665695,
0.006062920670956373,
-0.05389667674899101,
0.023231327533721924,
-0.03379930183291435,
-0.05458906292915344,
0.010158011689782143,
0.01402989961206913,
-0.019058797508478165,
0.017901787534356117,
0.06574010103940964,
0.048940662294626236,
-0.009251534007489681,
-0.07255461812019348,
0.03358065336942673,
0.012262496165931225,
0.04821183532476425,
-0.022848693653941154,
0.015278013423085213,
-0.0072745936922729015,
-0.0049651265144348145,
-0.035858236253261566,
0.008103633299469948,
-0.014786056242883205,
0.022028764709830284,
0.01295488141477108,
-0.022921575233340263,
-0.018047552555799484,
-0.02478008158504963,
0.01712740957736969,
-0.0013130254810675979,
0.007848544046282768,
-0.02703944221138954,
0.061330702155828476,
-0.06803590059280396,
0.02780470997095108,
-0.00944740604609251,
0.01580641232430935,
0.07521483302116394,
0.01304598432034254,
-0.011715876869857311,
0.015833742916584015,
0.08512686938047409,
-0.0030291827861219645,
0.005985483061522245,
0.018985915929079056,
0.020115595310926437,
0.03110264614224434,
0.04398464411497116,
-0.010613528080284595,
-0.019168121740221977,
0.02408769726753235,
0.0301369521766901,
-0.046098239719867706,
0.015050255693495274,
0.00018733103934209794,
0.05841539800167084,
-0.04165240377187729,
-0.043328702449798584,
-0.010914168320596218,
-0.009775377810001373,
0.0191499013453722,
0.0003387901815585792,
0.033781081438064575,
-0.025636451318860054,
0.04843048378825188,
-0.06796301901340485,
-0.06384515017271042,
0.016088832169771194,
0.04697282984852791,
-0.007748330943286419,
0.014694953337311745,
0.054006002843379974,
-0.06351718306541443,
0.022138087078928947,
-0.006618650630116463,
-0.03297937288880348,
0.0033047699835151434,
0.03002762794494629,
-0.0007128828437998891,
0.01519602071493864,
0.053422942757606506,
0.04551517963409424,
0.010112459771335125,
0.029808981344103813,
0.023814387619495392,
0.033908627927303314,
-0.023030899465084076,
0.002348185982555151,
-0.04726436361670494,
-0.026255954056978226,
0.014685842208564281,
0.0034846989437937737,
0.06420956552028656,
0.03474677726626396,
0.043948203325271606,
-0.01055886596441269,
0.059945933520793915
]
|
36,353 | statistics | pdf | Probability density function. P(x <= X < x+dx) / dx | def pdf(self, x):
"Probability density function. P(x <= X < x+dx) / dx"
variance = self._sigma ** 2.0
if not variance:
raise StatisticsError('pdf() not defined when sigma is zero')
return exp((x - self._mu)**2.0 / (-2.0*variance)) / sqrt(tau*variance)
| (self, x) | [
0.025646956637501717,
0.06666458398103714,
0.03334979712963104,
-0.00837246235460043,
0.07814881950616837,
0.00538761168718338,
0.008814500644803047,
-0.06655954569578171,
-0.027485135942697525,
0.1081898957490921,
0.030723828822374344,
-0.009768602438271046,
0.004884301219135523,
0.02471911534667015,
-0.06144765764474869,
0.011405455879867077,
-0.00044614108628593385,
0.07097116857767105,
0.01301604975014925,
0.04257569834589958,
-0.018049156293272972,
0.0605023093521595,
-0.03998474404215813,
-0.03366491571068764,
-0.06228796765208244,
-0.030898895114660263,
0.019834814593195915,
-0.019029516726732254,
-0.009462239220738411,
-0.0063898563385009766,
0.02305600233376026,
-0.0026894293259829283,
0.02155044674873352,
-0.0015974640846252441,
0.03573067486286163,
0.06880036741495132,
-0.010530132800340652,
0.006976322736591101,
-0.05241432785987854,
0.0027988445945084095,
-0.020955227315425873,
0.027415109798312187,
-0.03333229199051857,
0.006030973978340626,
0.016990015283226967,
-0.0015099317533895373,
0.00009854220115812495,
0.07380721718072891,
-0.06922052800655365,
0.0445014089345932,
-0.0019815119449049234,
-0.012735946103930473,
0.03282460570335388,
-0.049543268978595734,
0.014539111405611038,
0.025541918352246284,
0.027677705511450768,
-0.016666145995259285,
0.019904840737581253,
-0.02023746259510517,
0.10454855114221573,
0.04425631836056709,
0.0055407932959496975,
-0.09089351445436478,
0.013042309321463108,
0.0048055220395326614,
0.06288319081068039,
-0.023861298337578773,
-0.01623723842203617,
0.0369386225938797,
-0.01881944015622139,
-0.013690047897398472,
-0.03893435746431351,
0.0011236956343054771,
0.07366716861724854,
0.03280709683895111,
0.022968469187617302,
-0.011457975022494793,
0.005024352576583624,
-0.005352598614990711,
0.04117518290877342,
-0.0020274664275348186,
-0.026102125644683838,
-0.015020539052784443,
0.002709124004468322,
0.004280328284949064,
0.025121763348579407,
-0.022390756756067276,
0.019764788448810577,
0.0930643156170845,
-0.0063767265528440475,
-0.031529124826192856,
0.08830256015062332,
0.02806284837424755,
0.012359557673335075,
0.00003901340824086219,
0.018714401870965958,
0.03322725370526314,
0.069500632584095,
0.004901807755231857,
0.04170037806034088,
0.08872272074222565,
0.06372349709272385,
0.019064530730247498,
-0.021340370178222656,
0.031196504831314087,
0.05153900384902954,
-0.0013261140557006001,
0.04730244353413582,
0.0003673620230983943,
-0.05171407014131546,
0.014031424187123775,
0.03683358430862427,
0.008245540782809258,
-0.03228190541267395,
-0.07002582401037216,
-0.08501134812831879,
0.002499046502634883,
-0.01151924766600132,
0.01450409833341837,
-0.026942435652017593,
0.024509038776159286,
-0.04380115121603012,
-0.0025296828243881464,
-0.01757648214697838,
-0.03308720141649246,
-0.010889015160501003,
-0.044291332364082336,
0.0032124347053468227,
0.03963461518287659,
0.016429807990789413,
0.013436204753816128,
0.04576187580823898,
0.008284930139780045,
0.052729442715644836,
-0.024649089202284813,
0.06074739992618561,
-0.004135900177061558,
0.04737246781587601,
-0.007593424990773201,
0.017874091863632202,
-0.015466953627765179,
0.004033049568533897,
-0.033034682273864746,
0.07261677831411362,
0.06582427024841309,
0.0768183246254921,
0.057386159896850586,
-0.014215242117643356,
-0.02111278474330902,
-0.010757717303931713,
0.031634166836738586,
0.03641342744231224,
-0.055880606174468994,
0.0032890252768993378,
0.007173269987106323,
-0.015283135697245598,
-0.01733139157295227,
-0.00014784748782403767,
-0.014066437259316444,
0.009260915219783783,
0.019327126443386078,
-0.043486036360263824,
0.028430484235286713,
0.0046304576098918915,
0.0030570647213608027,
-0.058261483907699585,
0.03711368516087532,
0.05195916071534157,
-0.04282078891992569,
0.021235330030322075,
0.022845923900604248,
-0.01565077155828476,
-0.0005623949109576643,
0.011431715451180935,
0.010845249518752098,
0.024771634489297867,
0.045691847801208496,
-0.015134330838918686,
0.014372800476849079,
0.06789003312587738,
-0.03095141425728798,
0.017734039574861526,
-0.02235574461519718,
-0.014057683758437634,
0.016009652987122536,
-0.012788466177880764,
0.044536422938108444,
-0.010503873229026794,
0.009304680861532688,
-0.034785326570272446,
-0.03770890459418297,
0.03588823229074478,
-0.039179448038339615,
-0.0002455006761010736,
0.04282078891992569,
-0.005483897402882576,
-0.039109423756599426,
0.03350735455751419,
-0.04733745753765106,
0.023791274055838585,
-0.021690499037504196,
-0.04611200466752052,
-0.026049606502056122,
-0.07097116857767105,
-0.0075627886690199375,
-0.040159810334444046,
0.011195378378033638,
-0.03261452540755272,
-0.02461407706141472,
-0.014355293475091457,
-0.01750645600259304,
-0.01674492470920086,
-0.024579063057899475,
-0.052204251289367676,
-0.043661098927259445,
0.08066974580287933,
-0.07744856178760529,
-0.007746606599539518,
0.030093597248196602,
0.046287067234516144,
-0.04590192809700966,
0.02013242430984974,
0.05027854070067406,
0.030478740110993385,
0.006188531871885061,
0.029498377814888954,
0.009287174791097641,
-0.014670410193502903,
-0.026959942653775215,
0.022058134898543358,
0.04352105036377907,
-0.006906296592205763,
0.006166649051010609,
0.02365122176706791,
-0.02664482593536377,
-0.04688228666782379,
0.009033330716192722,
-0.033892497420310974,
0.020692629739642143,
-0.012114467099308968,
0.03599327430129051,
0.05409494787454605,
0.019589724019169807,
0.008980811573565006,
0.006582427304238081,
-0.010652678087353706,
0.055180348455905914,
-0.0011083774734288454,
-0.0160009004175663,
-0.03383997827768326,
-0.02858804166316986,
-0.05941690877079964,
-0.027310071513056755,
0.015073058195412159,
0.026347216218709946,
0.04548177123069763,
0.08045966923236847,
0.04579688981175423,
0.035310521721839905,
0.003941140603274107,
-0.026662331074476242,
-0.04142027348279953,
0.03068881668150425,
-0.019764788448810577,
-0.0030592530965805054,
-0.0162810031324625,
-0.00853439699858427,
0.018101675435900688,
0.03802402317523956,
0.06382853537797928,
0.04299585521221161,
0.05346471443772316,
-0.1099405437707901,
-0.0012145104119554162,
-0.02709999307990074,
0.022583328187465668,
0.06732983142137527,
0.032754577696323395,
0.05829649791121483,
0.02127034403383732,
-0.0633733719587326,
0.01916956901550293,
0.03672854229807854,
0.0013031368143856525,
0.01565077155828476,
0.013392438180744648,
0.01028504315763712,
0.019117049872875214,
0.0773785337805748,
-0.03383997827768326,
0.005864662583917379,
-0.03823409974575043,
0.033122215420007706,
-0.01173807866871357,
-0.03767389431595802,
0.034242626279592514,
-0.025979580357670784,
-0.015466953627765179,
0.020640110597014427,
0.03588823229074478,
0.07527776062488556,
0.003787959460169077,
0.013576256111264229,
-0.05451510474085808,
0.07044597715139389,
0.053429704159498215,
-0.032316915690898895,
0.02664482593536377,
-0.029971051961183548,
-0.007243296131491661,
0.021392889320850372,
-0.021865563467144966,
0.0328771248459816,
0.011029067449271679,
-0.038304124027490616,
0.018784426152706146,
-0.04485153779387474,
-0.008923916146159172,
0.024158908054232597,
0.002211284125223756,
0.09222400933504105,
0.07835889607667923,
-0.004422568250447512,
-0.02478914149105549,
0.016946248710155487,
-0.008678825572133064,
0.034347664564847946,
-0.039004381746053696,
-0.0014245877973735332,
-0.037953995168209076,
-0.012972284108400345,
0.00875322800129652,
0.05010347440838814,
-0.08249042183160782,
0.007125127594918013,
0.03359488770365715,
0.0010919651249423623,
0.011729325167834759,
-0.03282460570335388,
-0.05164404585957527,
-0.02330109290778637,
0.003308720188215375,
-0.005974078085273504,
-0.009742342866957188,
-0.06603435426950455,
-0.01943216659128666,
-0.029078222811222076,
0.04926316812634468,
-0.005405118223279715,
0.050173502415418625,
0.03334979712963104,
0.0029826622921973467,
-0.02611963264644146,
0.010678937658667564,
-0.07751858234405518,
-0.0005224582855589688,
0.02356368862092495,
-0.05920683220028877,
0.011422961950302124,
0.01811918243765831,
0.051924146711826324,
-0.08235036581754684,
-0.016491081565618515,
0.0286580678075552,
-0.014215242117643356,
-0.049123115837574005,
0.012744699604809284,
0.011729325167834759,
0.033822473138570786,
0.03025115467607975,
-0.014600384049117565,
-0.08298060297966003,
0.023441143333911896,
0.02120031788945198,
-0.006761868484318256,
-0.00205482030287385,
-0.015983393415808678,
0.006057233549654484,
0.006976322736591101,
-0.03201930597424507,
-0.03250948712229729,
-0.020184943452477455,
-0.0047048600390553474,
-0.0410001203417778,
-0.006394233088940382,
-0.013121088966727257,
-0.013873865827918053,
0.02858804166316986,
-0.032491981983184814,
0.014005164615809917,
-0.03991471976041794,
0.03201930597424507,
0.009541017934679985,
-0.007313321810215712,
-0.02762518636882305,
0.0555654913187027,
-0.04905308783054352,
-0.03802402317523956,
0.014889240264892578,
-0.007444620132446289,
0.016596119850873947,
-0.08935295045375824,
0.012639661319553852,
-0.007300192024558783,
-0.07702840864658356,
0.008586916141211987,
-0.012289531528949738,
0.004954326897859573,
0.08515139669179916,
0.009689822793006897,
-0.00927842129021883,
-0.05462014302611351,
0.03851420432329178,
0.02594456821680069,
-0.029760975390672684,
-0.04544675722718239,
-0.052554380148649216,
-0.005882169120013714,
-0.016254743561148643,
-0.02013242430984974,
-0.04033487290143967,
-0.015659524127840996,
-0.015160590410232544,
-0.02253080904483795,
-0.0020405962131917477,
-0.017305132001638412,
0.0033743693493306637,
0.017016274854540825,
0.04996342584490776,
-0.0032583889551460743,
-0.05402492359280586,
-0.00444882782176137,
0.02074515074491501,
-0.003989283461123705,
-0.01028504315763712,
-0.015528226271271706,
0.03383997827768326,
0.01151924766600132,
-0.014031424187123775,
-0.004153406713157892,
0.036098312586545944,
0.044116269797086716,
-0.02478914149105549,
-0.027677705511450768,
0.057386159896850586,
0.04425631836056709,
-0.06967569142580032,
0.007173269987106323,
-0.04387117922306061,
0.0231260284781456,
-0.02135787531733513,
0.0948149636387825,
-0.008683201856911182,
-0.05794636905193329,
-0.03998474404215813,
-0.025104258209466934,
-0.07114623486995697,
0.009068343788385391,
0.023178547620773315,
0.0008403098909184337,
0.035923246294260025,
-0.03392751142382622,
-0.05941690877079964,
-0.05311458557844162,
-0.005195040721446276,
0.011440468952059746,
0.037953995168209076,
0.0471273772418499,
-0.02583952806890011,
0.03485535457730293,
0.069500632584095,
-0.017103808000683784,
-0.04597195237874985,
-0.08228034526109695,
-0.029515884816646576,
-0.027642693370580673,
0.015624511986970901,
0.06848525255918503,
0.012455843389034271,
0.004229997284710407,
-0.018311752006411552,
0.06873034685850143,
0.02338862419128418,
0.03704366087913513,
-0.04166536405682564,
-0.04723241925239563,
0.04845786839723587,
0.0369386225938797,
0.03886433318257332,
0.040860068053007126,
-0.00339625240303576,
0.048247791826725006,
-0.02743261680006981,
-0.07261677831411362,
-0.04772259667515755,
0.05269443243741989,
-0.01135293673723936,
0.01613219827413559,
-0.04548177123069763,
-0.002286780858412385,
-0.02426394820213318,
-0.005146897863596678,
-0.025279322639107704,
-0.034680288285017014,
0.0021248459815979004,
0.004068062640726566,
0.03896937146782875,
-0.040054772049188614,
-0.018521830439567566,
-0.004155594855546951,
-0.03648345544934273,
-0.02876310609281063,
-0.02498171292245388,
0.01846931129693985,
-0.007418360561132431,
-0.049193140119314194,
-0.007575918920338154,
-0.01358500961214304,
-0.03175671026110649,
-0.008867019787430763,
0.02911323495209217,
-0.015790823847055435,
-0.041105158627033234,
-0.0009387836907990277,
0.019397152587771416,
-0.024509038776159286,
0.005488273687660694,
0.007252049166709185,
0.002201436785981059,
0.005269443150609732,
-0.054129961878061295,
0.03173920512199402,
-0.01208820752799511,
-0.023108521476387978,
0.009514758363366127,
-0.057911355048418045,
-0.07947930693626404,
-0.06757491827011108,
0.042085520923137665,
0.02270587347447872,
-0.016814950853586197,
0.007912917993962765,
-0.02806284837424755,
0.07639817148447037,
-0.04527169466018677,
-0.01783907786011696,
-0.021340370178222656,
0.06060735136270523,
-0.007484009955078363,
0.01579957641661167,
-0.048843011260032654,
-0.02752014808356762,
0.005952194798737764,
-0.003293402027338743,
0.02137538231909275,
0.012385817244648933,
0.07667827606201172,
-0.018311752006411552,
-0.01693749614059925,
-0.04702233895659447,
-0.054935257881879807,
0.07765863835811615,
-0.0178128182888031,
-0.026872409507632256,
0.003656660905107856,
-0.023336105048656464,
-0.029620923101902008,
-0.003956458996981382,
-0.018871959298849106,
-0.02349366433918476,
0.005448884330689907,
-0.02093772031366825,
0.01450409833341837,
-0.019099542871117592,
-0.0031467853114008904,
0.00024591098190285265,
-0.039459552615880966,
-0.07541780918836594,
0.009024578146636486,
0.00023961960687302053,
-0.07352711260318756,
-0.05847156047821045,
0.009234655648469925,
-0.023248573765158653,
0.003801089245826006,
-0.04597195237874985,
0.017874091863632202,
0.028185393661260605,
-0.018154194578528404,
-0.07282685488462448,
-0.025034232065081596,
-0.06736484169960022,
-0.025979580357670784,
0.0053788586519658566,
0.0005957665853202343,
0.015633264556527138,
-0.03035619482398033,
-0.0024793518241494894,
-0.02235574461519718,
-0.010941535234451294,
0.06403861194849014,
0.025191789492964745,
0.00725642591714859,
0.042435649782419205,
0.0036872972268611193,
0.027747731655836105,
0.0002734015870373696,
0.007785995956510305,
-0.07933925837278366,
-0.019922345876693726,
0.013716308400034904,
-0.043135907500982285,
0.06585928797721863,
-0.01305981632322073,
-0.007856021635234356,
0.004936820361763239,
-0.043836165219545364,
0.00950600579380989,
0.056230735033750534,
-0.040579963475465775,
0.020867696031928062,
0.019589724019169807,
-0.020622605457901955,
0.031249023973941803,
0.0010859473841264844,
0.04282078891992569,
-0.06967569142580032,
-0.0010936063481494784,
-0.043135907500982285,
-0.0024924816098064184,
0.07520773261785507,
-0.044466398656368256,
0.026399735361337662,
-0.006258558016270399,
0.0346277691423893,
-0.03455774486064911,
-0.026137137785553932,
-0.02030748873949051,
0.012158233672380447,
-0.018924478441476822,
0.05903176963329315,
0.003899563103914261,
-0.0033765577245503664,
0.03247447684407234,
0.059136807918548584,
-0.03567815572023392,
-0.010687691159546375,
0.02832544595003128,
-0.043135907500982285,
0.019589724019169807,
-0.047197405248880386,
-0.009260915219783783,
0.009961172938346863,
0.04397621750831604,
-0.006065987050533295,
0.005864662583917379,
0.029655935242772102,
-0.017917856574058533,
-0.0021445408929139376,
0.047267429530620575,
-0.07041096687316895,
-0.0642486959695816,
-0.0010372574906796217,
0.00889765564352274,
-0.01376882754266262,
-0.03088138811290264,
-0.038829319179058075,
-0.12051443755626678,
-0.05507531017065048,
0.014250255189836025,
0.04632208123803139,
-0.008565033785998821,
-0.061342619359493256,
0.0030833245255053043,
-0.0427507646381855,
0.022583328187465668,
0.007413983810693026,
-0.020167436450719833,
0.02515677735209465,
0.030268661677837372,
-0.01881944015622139,
0.02946336567401886,
-0.017742792144417763,
-0.0066524529829621315,
-0.02601459249854088,
0.04614701867103577,
-0.03131904825568199,
-0.06561419367790222,
0.029883520677685738,
-0.04019482061266899,
-0.055355411022901535,
0.026347216218709946,
-0.009532265365123749,
0.007659074384719133,
-0.011300417594611645,
0.015283135697245598,
0.06852027028799057,
0.0171563271433115,
-0.024859167635440826,
-0.024736622348427773,
0.03532802686095238,
0.06176277622580528,
0.05476019158959389,
-0.0564408116042614,
-0.03210683912038803,
0.01560700498521328,
0.00797856692224741,
0.021655485033988953,
-0.009409720078110695,
0.014197735115885735,
-0.041105158627033234,
0.038829319179058075,
-0.018714401870965958,
0.01509056519716978,
0.0564408116042614,
-0.0054926504381000996,
0.03405005484819412,
0.0726868063211441,
-0.007558412384241819,
0.010854002088308334,
-0.03728875145316124,
0.030478740110993385,
0.011212884448468685,
-0.037253737449645996,
-0.016867469996213913,
-0.009689822793006897,
-0.005855909548699856,
0.018504323437809944,
-0.03121400997042656,
0.011396702378988266,
0.026487266644835472,
-0.031441595405340195,
-0.041105158627033234,
-0.00725642591714859,
-0.020990239456295967,
-0.044466398656368256,
0.017235105857253075,
-0.040054772049188614,
-0.019379645586013794,
-0.013173608109354973,
0.06466884911060333,
0.00062968535348773,
-0.0561256967484951,
0.055180348455905914,
0.003954270854592323,
-0.03704366087913513,
-0.008214903995394707,
0.04072001576423645,
-0.011851870454847813,
0.029305806383490562,
-0.005877792369574308,
-0.0392494723200798,
0.029830999672412872,
0.03025115467607975,
0.0034006289206445217,
0.02620716392993927,
-0.027485135942697525,
0.022128159180283546,
0.0006318736122921109,
-0.05108383670449257,
-0.011930649168789387,
-0.00048498352407477796,
0.029235780239105225,
-0.0034487717784941196,
0.011895637027919292,
0.03313972055912018,
0.026417242363095284
]
|
36,354 | statistics | quantiles | Divide into *n* continuous intervals with equal probability.
Returns a list of (n - 1) cut points separating the intervals.
Set *n* to 4 for quartiles (the default). Set *n* to 10 for deciles.
Set *n* to 100 for percentiles which gives the 99 cuts points that
separate the normal distribution in to 100 equal sized groups.
| def quantiles(self, n=4):
"""Divide into *n* continuous intervals with equal probability.
Returns a list of (n - 1) cut points separating the intervals.
Set *n* to 4 for quartiles (the default). Set *n* to 10 for deciles.
Set *n* to 100 for percentiles which gives the 99 cuts points that
separate the normal distribution in to 100 equal sized groups.
"""
return [self.inv_cdf(i / n) for i in range(1, n)]
| (self, n=4) | [
-0.05668744817376137,
0.02051415480673313,
-0.07193630188703537,
-0.05443089082837105,
0.033438071608543396,
0.03853242099285126,
0.04578075557947159,
-0.0718679204583168,
-0.03463473170995712,
0.06694452464580536,
0.014419740997254848,
0.061371512711048126,
0.02003549039363861,
0.0014317170716822147,
-0.0317627489566803,
-0.015539471991360188,
0.02436055801808834,
-0.00832532811909914,
-0.01151356939226389,
0.006872241850942373,
0.014787286520004272,
0.0601748526096344,
-0.021386006847023964,
-0.00651324400678277,
-0.0037502439226955175,
0.05774734541773796,
0.048379216343164444,
-0.01625746674835682,
-0.039626508951187134,
0.02680516242980957,
-0.037848614156246185,
0.025232410058379173,
0.04102830961346626,
-0.0003942564071621746,
0.008393708616495132,
-0.00865868292748928,
0.02747187204658985,
0.008474909700453281,
-0.06291007250547409,
0.07884273678064346,
-0.0006223695236258209,
-0.010855406522750854,
-0.017419936135411263,
-0.01683870144188404,
-0.008786896243691444,
0.02106119878590107,
0.056106213480234146,
0.04516533017158508,
0.00950489193201065,
0.00780392624437809,
0.01274441834539175,
0.0035942508839070797,
0.01976196840405464,
-0.019420066848397255,
-0.02502726949751377,
0.05162728950381279,
0.032292697578668594,
-0.011205856688320637,
0.013163249008357525,
0.006325197871774435,
-0.02596750110387802,
0.03441249579191208,
0.05248204618692398,
-0.04068640619516373,
-0.02465117536485195,
-0.003198926104232669,
-0.04926816001534462,
0.00894075259566307,
-0.04581494629383087,
0.034361209720373154,
0.012017875909805298,
-0.006893610581755638,
0.010120316408574581,
0.0061884368769824505,
-0.030771231278777122,
0.06701290607452393,
0.01321453507989645,
-0.002174286637455225,
0.055251456797122955,
-0.0014210325898602605,
0.03651519492268562,
0.011180214583873749,
0.04506275802850723,
-0.037096429616212845,
0.007838116958737373,
-0.0060174851678311825,
0.01832597889006138,
-0.026070071384310722,
0.02020644210278988,
0.033540643751621246,
-0.059491049498319626,
0.02285618707537651,
0.0284121036529541,
-0.001134689198806882,
-0.0380195677280426,
-0.012436706572771072,
-0.04413962364196777,
0.027488967403769493,
-0.05357613414525986,
-0.052140142768621445,
0.037575092166662216,
-0.008209935389459133,
-0.0028377913404256105,
0.011769996024668217,
-0.03637843579053879,
0.013684650883078575,
-0.02707868441939354,
0.015573662705719471,
-0.06923527270555496,
0.017625078558921814,
-0.06294426321983337,
0.0748082846403122,
0.048276644200086594,
-0.00860312394797802,
-0.025916215032339096,
-0.010795573703944683,
-0.020462868735194206,
0.026292309165000916,
0.057405441999435425,
-0.060516756027936935,
-0.038395658135414124,
0.00006086800931370817,
-0.03495953977108002,
0.022804902866482735,
-0.021505672484636307,
0.04003679007291794,
0.05921752750873566,
0.004949039779603481,
-0.053165849298238754,
0.006077318452298641,
0.09210855513811111,
-0.013462414033710957,
0.008107365109026432,
0.0030301115475594997,
0.01235977839678526,
-0.05395222827792168,
-0.0066243624314665794,
-0.004564399365335703,
0.06390158832073212,
-0.008124460466206074,
0.005709772929549217,
-0.019488446414470673,
-0.032873932272195816,
0.04690903425216675,
0.0098724365234375,
0.009812603704631329,
0.046874843537807465,
-0.00917153712362051,
-0.009667295031249523,
-0.06396996974945068,
-0.030583186075091362,
0.04560980573296547,
0.022821996361017227,
-0.09833118319511414,
0.04550723358988762,
-0.01976196840405464,
0.020428679883480072,
-0.017984075471758842,
-0.03764347359538078,
-0.009940817020833492,
-0.008492005057632923,
0.04431057348847389,
-0.023061329498887062,
0.017915695905685425,
-0.04078897833824158,
0.01861659623682499,
-0.00505161052569747,
-0.03507920354604721,
-0.03299359977245331,
-0.02312970906496048,
0.010299814864993095,
0.0584995299577713,
0.035489488393068314,
-0.002542900387197733,
-0.014445384033024311,
-0.014377003535628319,
-0.017830219119787216,
0.0074192858301103115,
-0.0293523371219635,
0.009351035580039024,
-0.003602798329666257,
-0.11241757124662399,
0.023095518350601196,
-0.013120511546730995,
-0.0264290701597929,
0.006410673260688782,
0.04352419823408127,
0.025813644751906395,
-0.02143729105591774,
-0.024685366079211235,
-0.0196423027664423,
-0.03750671446323395,
-0.04068640619516373,
-0.012872631661593914,
0.01851402409374714,
-0.01853111945092678,
-0.048379216343164444,
0.017556697130203247,
0.003985302057117224,
0.01411202922463417,
-0.0252836961299181,
0.06913270056247711,
0.0010497478069737554,
-0.055148884654045105,
0.031369563192129135,
0.023728039115667343,
-0.03490825369954109,
-0.004147705622017384,
0.06537177413702011,
0.04496018961071968,
0.012752966023981571,
-0.028548864647746086,
0.001673185732215643,
0.02916429005563259,
-0.009812603704631329,
0.018582405522465706,
0.013804316520690918,
-0.058807242661714554,
0.030993469059467316,
-0.000035058368666796014,
0.04807150363922119,
-0.017462674528360367,
0.024787936359643936,
0.06198693811893463,
0.00982969906181097,
0.05395222827792168,
0.049028828740119934,
0.011761448346078396,
0.005008872598409653,
-0.037848614156246185,
-0.039831649512052536,
0.01983034983277321,
0.030446425080299377,
-0.03248074650764465,
0.005487536545842886,
0.01010322105139494,
0.007761188317090273,
-0.0014787286054342985,
-0.025129839777946472,
0.052516236901283264,
-0.054875362664461136,
0.023180995136499405,
-0.012299945577979088,
0.06048256531357765,
0.008466362953186035,
-0.01353934220969677,
-0.06557691097259521,
0.05791829526424408,
0.019112354144454002,
0.04663551226258278,
-0.005008872598409653,
-0.054396700114011765,
-0.059012383222579956,
-0.03369449824094772,
0.02352289669215679,
0.039182037115097046,
-0.053370993584394455,
-0.022411713376641273,
0.021659528836607933,
-0.02058253437280655,
0.053097471594810486,
-0.08513373881578445,
-0.020086776465177536,
0.01147083193063736,
0.021044103428721428,
0.012052065692842007,
-0.013530794531106949,
-0.013889792375266552,
0.04817407205700874,
0.0178644098341465,
0.06516662985086441,
0.07535532861948013,
0.030600281432271004,
-0.04243011027574539,
-0.01882173679769039,
-0.0033698773477226496,
0.048755306750535965,
-0.027112875133752823,
-0.005696951877325773,
-0.04099411889910698,
0.020257728174328804,
-0.031198609620332718,
0.0021924502216279507,
0.01721479557454586,
0.034754395484924316,
0.02622392773628235,
-0.002525805262848735,
-0.00415839022025466,
0.040857359766960144,
0.028754007071256638,
-0.056755829602479935,
0.03253202885389328,
-0.06366226077079773,
-0.016795964911580086,
0.06092704087495804,
-0.007752641104161739,
-0.018855927512049675,
-0.04205401614308357,
0.0007137216161936522,
0.07111573964357376,
0.02519821934401989,
-0.053644515573978424,
-0.03911365568637848,
0.024309273809194565,
0.025882024317979813,
0.05070415139198303,
0.015094999223947525,
-0.03716481104493141,
-0.01636858657002449,
-0.012274302542209625,
0.026668401435017586,
0.04834502562880516,
-0.029865190386772156,
-0.012633300386369228,
0.06944041699171066,
-0.058704674243927,
-0.01747976988554001,
0.008923657238483429,
-0.039455559104681015,
0.005312311463057995,
-0.01124004740267992,
-0.0031369561329483986,
0.014188957400619984,
0.036822907626628876,
0.021386006847023964,
0.048105694353580475,
-0.04752445966005325,
-0.011658878065645695,
-0.03525015711784363,
-0.022445904091000557,
-0.044891808182001114,
0.0327029824256897,
0.012334135361015797,
0.05443089082837105,
-0.04663551226258278,
0.01626601442694664,
0.057781536132097244,
-0.018770450726151466,
-0.014539407566189766,
-0.07097897678613663,
-0.045473042875528336,
-0.024206701666116714,
-0.023539992049336433,
0.009402320720255375,
-0.016582274809479713,
-0.009145894087851048,
0.03535272553563118,
-0.03702804818749428,
0.01439409889280796,
0.061645034700632095,
0.024018656462430954,
-0.027523158118128777,
0.05545659735798836,
0.04201982542872429,
0.04119925945997238,
0.05227690562605858,
0.03819051757454872,
-0.008675778284668922,
-0.007299620192497969,
-0.0012564919888973236,
0.09299749881029129,
0.00435284711420536,
0.047250937670469284,
-0.006444863509386778,
0.03819051757454872,
0.008145828731358051,
0.011530664749443531,
0.029830999672412872,
-0.035865578800439835,
0.08882629126310349,
-0.02877110242843628,
-0.018069550395011902,
-0.03417316451668739,
0.048379216343164444,
0.007654344197362661,
-0.041506972163915634,
-0.061918556690216064,
-0.030343852937221527,
-0.05904657393693924,
0.00763724884018302,
-0.04212239757180214,
-0.061645034700632095,
-0.01015450619161129,
0.030890898779034615,
-0.037369951605796814,
0.020086776465177536,
0.026736781001091003,
0.017642173916101456,
0.030036142095923424,
-0.02943781204521656,
-0.00059031619457528,
-0.013727388344705105,
0.007654344197362661,
0.027813775464892387,
-0.024890508502721786,
-0.015351425856351852,
0.01645406149327755,
-0.033985115587711334,
-0.00894075259566307,
0.022736521437764168,
-0.02680516242980957,
0.034737300127744675,
0.015770256519317627,
0.038805942982435226,
0.023369040340185165,
-0.03798537701368332,
-0.011675973422825336,
-0.048105694353580475,
0.0177618395537138,
-0.05313166230916977,
-0.02584783546626568,
0.04947330430150032,
-0.01710367575287819,
-0.019334590062499046,
0.043763529509305954,
0.006470506079494953,
-0.021779194474220276,
-0.0710473582148552,
-0.019744873046875,
-0.007056014612317085,
0.013855601660907269,
-0.08595430850982666,
-0.03289102762937546,
0.04916559159755707,
-0.015265950001776218,
-0.0910828486084938,
0.07781703025102615,
-0.03224141150712967,
-0.009009133093059063,
0.04280620440840721,
-0.041336022317409515,
0.014915499836206436,
-0.10250239074230194,
0.004192580468952656,
0.04147278144955635,
-0.04082316905260086,
-0.053644515573978424,
0.003628441132605076,
-0.026497449725866318,
0.012992298230528831,
-0.07685969769954681,
0.05805505812168121,
0.05897819623351097,
-0.04639618098735809,
0.06687614321708679,
0.027232540771365166,
-0.023950275033712387,
-0.0135820796713233,
-0.02208690717816353,
-0.05935428664088249,
-0.017522506415843964,
-0.00008166930638253689,
0.013744483701884747,
-0.0022330512292683125,
0.0584995299577713,
-0.040481265634298325,
-0.0265316404402256,
-0.01270168088376522,
0.01626601442694664,
0.0008285795338451862,
0.07391934096813202,
0.053644515573978424,
-0.04865273833274841,
-0.007709903176873922,
-0.0023762229830026627,
0.02745477668941021,
-0.030207091942429543,
-0.0019905141089111567,
0.023933179676532745,
-0.0750134289264679,
0.0549437440931797,
0.08554402738809586,
-0.016001040115952492,
-0.004457554779946804,
0.023642564192414284,
0.03716481104493141,
-0.0034532160498201847,
0.032771363854408264,
0.051764048635959625,
-0.03261750563979149,
0.024565700441598892,
-0.004752445966005325,
0.04270363226532936,
0.0021806973963975906,
-0.07508180290460587,
-0.028275342658162117,
-0.03754090145230293,
-0.009034775197505951,
-0.0012906822375953197,
-0.010778478346765041,
0.03338678553700447,
-0.03094218298792839,
0.018941402435302734,
-0.0017714827554300427,
0.0020086776930838823,
-0.01038529071956873,
0.0908777043223381,
0.02745477668941021,
0.018206311389803886,
-0.013847053982317448,
0.028189867734909058,
0.017419936135411263,
0.03417316451668739,
-0.006038854364305735,
-0.0026497449725866318,
0.014077838510274887,
0.01844564452767372,
-0.0035408285912126303,
-0.055524978786706924,
-0.060038093477487564,
0.048003122210502625,
-0.027437681332230568,
-0.026480354368686676,
-0.013804316520690918,
0.07405609637498856,
-0.03791699558496475,
-0.01955682784318924,
-0.03350645303726196,
-0.01870207116007805,
0.03901108354330063,
0.01673613116145134,
-0.002237325068563223,
0.0208902470767498,
0.03432701900601387,
0.0008590302313677967,
-0.021215055137872696,
0.010205792263150215,
0.03468601778149605,
0.009026228450238705,
0.055354028940200806,
-0.0020524838473647833,
0.04766121879220009,
0.03104475326836109,
-0.022411713376641273,
0.006154246628284454,
0.08212500065565109,
-0.07665456086397171,
0.01438555121421814,
0.10352809727191925,
0.03514758497476578,
-0.024428939446806908,
-0.01241961121559143,
0.07050031423568726,
-0.0064405896700918674,
-0.017830219119787216,
0.057986676692962646,
-0.01637713424861431,
0.006816682871431112,
0.1090669259428978,
-0.0025151208974421024,
0.09874146431684494,
0.02020644210278988,
-0.0015513829421252012,
-0.08068900555372238,
0.03514758497476578,
0.0038592254277318716,
0.02314680442214012,
-0.020565440878272057,
-0.026941923424601555,
-0.024309273809194565,
-0.03413897380232811,
0.028548864647746086,
0.05921752750873566,
0.005226835608482361,
-0.013197439722716808,
0.014402646571397781,
0.0355236791074276,
-0.008795443922281265,
-0.02389899082481861,
-0.026959018781781197,
-0.03111313469707966,
0.06530339270830154,
-0.0067995875142514706,
0.014556501992046833,
0.016197634860873222,
-0.058260198682546616,
0.024975983425974846,
-0.12199083715677261,
-0.04947330430150032,
-0.05774734541773796,
-0.03887432441115379,
-0.01156485453248024,
0.02049705944955349,
-0.03244655579328537,
-0.047900550067424774,
0.02369384840130806,
-0.05528564751148224,
0.008444993756711483,
0.028531769290566444,
0.027865059673786163,
0.04072059690952301,
0.0029873738531023264,
-0.03733576089143753,
-0.03282264620065689,
0.034361209720373154,
-0.041336022317409515,
-0.052413664758205414,
-0.05053320154547691,
-0.08725354075431824,
-0.0299848560243845,
0.02463408000767231,
0.06270493566989899,
-0.04065221548080444,
0.051764048635959625,
0.031266991049051285,
-0.02595040574669838,
0.0013611996546387672,
-0.020736390724778175,
-0.00550463143736124,
-0.0016432693228125572,
-0.01066736038774252,
0.062499791383743286,
0.026070071384310722,
0.023095518350601196,
-0.01494969055056572,
0.0016005313955247402,
0.015642043203115463,
-0.04752445966005325,
0.02605297602713108,
-0.028429199010133743,
-0.0336432121694088,
0.0014990291092544794,
0.02283909171819687,
0.012906822375953197,
0.028258247300982475,
-0.09580110013484955,
0.030634470283985138,
-0.013693198561668396,
0.001119730994105339,
-0.02454860508441925,
0.00646195886656642,
0.039626508951187134,
0.0007099820650182664,
-0.06814118474721909,
-0.032685887068510056,
0.019676493480801582,
-0.05066996067762375,
-0.007303894031792879,
-0.018582405522465706,
-0.01523176021873951,
0.022497190162539482,
0.047729600220918655,
0.012120446190237999,
-0.037951186299324036,
0.01609506458044052,
-0.05419155955314636,
-0.01179563906043768,
-0.0065816245041787624,
0.021215055137872696,
-0.054020605981349945,
-0.0015439038397744298,
-0.0013750893995165825,
0.04653294011950493,
0.0019306811736896634,
-0.045849137008190155,
0.03535272553563118,
-0.02482212707400322,
0.019043972715735435,
0.014787286520004272,
-0.05172986164689064,
0.004859290551394224,
-0.03159179911017418,
0.0063422927632927895,
-0.011419545859098434,
-0.01100071519613266,
0.04130183160305023,
-0.011915304698050022,
-0.024206701666116714,
-0.09655328840017319,
-0.030155807733535767,
0.04581494629383087,
0.028890768066048622,
0.03273717314004898,
-0.03272007778286934,
-0.03966069966554642,
0.037096429616212845,
-0.035865578800439835,
0.015257402323186398,
-0.056653257459402084,
-0.010530599392950535,
0.017984075471758842,
-0.04865273833274841,
-0.027899250388145447,
-0.016710488125681877,
0.030514804646372795,
0.03160889446735382,
-0.013197439722716808,
-0.03538691624999046,
-0.047353506088256836,
0.04017355293035507,
-0.005282395053654909,
0.004957587458193302,
-0.03294231370091438,
-0.013402581214904785,
0.006573077291250229,
0.0037181905936449766,
0.006675648037344217,
0.04201982542872429,
0.04550723358988762,
-0.007171406410634518,
-0.00432506762444973,
-0.01348805706948042,
0.03169436752796173,
0.02613845281302929,
-0.012633300386369228,
-0.03702804818749428,
-0.008432172238826752,
-0.02906171977519989,
0.003895552596077323,
0.033540643751621246,
-0.015530924312770367,
0.009034775197505951,
-0.058807242661714554,
-0.008068900555372238,
-0.06773090362548828,
0.048379216343164444,
0.002966004889458418,
0.03545529767870903,
-0.0218304805457592,
-0.0008040053071454167,
0.04390029236674309,
-0.02359127812087536,
0.004859290551394224,
-0.00013008325186092407,
-0.02791634574532509,
0.01569332927465439,
0.03282264620065689,
0.048003122210502625,
-0.046874843537807465,
-0.044720858335494995,
-0.015453996136784554,
0.012257207185029984,
-0.020941533148288727,
-0.0359339602291584,
0.0177618395537138,
-0.04007098078727722,
-0.007171406410634518,
-0.04003679007291794,
-0.004175485111773014,
-0.019898729398846626,
0.011368260718882084,
-0.027335111051797867,
0.06301264464855194,
-0.018753357231616974,
0.011137476190924644,
-0.026651306077837944,
0.018496928736567497,
-0.003156188176944852,
0.007902223616838455,
-0.05904657393693924,
0.004820826463401318,
0.04550723358988762,
-0.01443683635443449,
-0.014906952157616615,
-0.025044362992048264,
-0.010205792263150215,
0.025146935135126114,
0.0029766892548650503,
-0.00662863627076149,
0.005530274007469416,
-0.0007521856459788978,
0.03716481104493141,
-0.001200932776555419,
0.023198090493679047,
-0.02736930176615715,
0.005812343675643206,
0.04174630343914032,
-0.021933050826191902
]
|
36,355 | statistics | samples | Generate *n* samples for a given mean and standard deviation. | def samples(self, n, *, seed=None):
"Generate *n* samples for a given mean and standard deviation."
gauss = random.gauss if seed is None else random.Random(seed).gauss
mu, sigma = self._mu, self._sigma
return [gauss(mu, sigma) for i in range(n)]
| (self, n, *, seed=None) | [
-0.04502192512154579,
-0.010315990075469017,
0.04041657596826553,
-0.07972786575555801,
0.037984948605298996,
0.057806383818387985,
-0.018135879188776016,
-0.01514239888638258,
0.05791691318154335,
0.06373807787895203,
-0.04218503087759018,
0.07316984236240387,
-0.011522592045366764,
0.031961146742105484,
-0.018402988091111183,
0.024868903681635857,
-0.02013460174202919,
0.023063605651259422,
-0.024721533060073853,
-0.02737421542406082,
-0.018651677295565605,
0.07958049327135086,
-0.037800733000040054,
-0.04023236036300659,
0.008888330310583115,
0.05600108578801155,
-0.007419222965836525,
-0.0679750069975853,
-0.010398886166512966,
0.023026762530207634,
-0.017159543931484222,
-0.02741105854511261,
0.04675354063510895,
0.030395327135920525,
-0.00039721166831441224,
-0.08075946569442749,
-0.01294104102998972,
0.03595859184861183,
-0.051801007241010666,
0.07670675218105316,
0.05500633269548416,
-0.07685412466526031,
0.03360065072774887,
0.030137427151203156,
-0.011780492030084133,
0.009192284196615219,
0.040158674120903015,
0.06263279169797897,
-0.07449617981910706,
-0.03761652112007141,
0.006194199435412884,
0.02505311742424965,
-0.009487026371061802,
-0.05224312096834183,
-0.036234915256500244,
-0.02667420171201229,
-0.026397880166769028,
-0.03085586242377758,
0.027079472318291664,
0.025679446756839752,
0.046606168150901794,
0.026729466393589973,
0.02300834096968174,
-0.04973780736327171,
-0.028884772211313248,
-0.033011168241500854,
-0.08525428920984268,
0.025182068347930908,
0.042774513363838196,
0.03325064480304718,
0.05099046230316162,
0.044911399483680725,
0.004091855604201555,
0.037155985832214355,
0.011080478318035603,
0.1024230420589447,
0.0016728943446651101,
0.02096356451511383,
0.00393297104164958,
0.004407322499901056,
0.0026987367309629917,
0.007902785204350948,
-0.02849792130291462,
-0.015133189037442207,
-0.00807318277657032,
0.03485330939292908,
-0.014995028264820576,
-0.0046813408844172955,
0.03181377425789833,
-0.010380464605987072,
-0.002240504138171673,
0.05047466605901718,
0.020724086090922356,
-0.017113490030169487,
0.007317905314266682,
0.013797636143863201,
-0.02074250765144825,
0.004656011238694191,
0.022860970348119736,
0.0009936047717928886,
0.022510962560772896,
-0.024168889969587326,
0.05555897206068039,
0.017251649871468544,
-0.03232957422733307,
0.04236924275755882,
-0.00785212591290474,
0.025771552696824074,
0.0021288241259753704,
0.09151756763458252,
-0.0122041841968894,
0.03354538977146149,
0.07534357160329819,
-0.01917668804526329,
-0.012756826356053352,
-0.04951675236225128,
0.03461382910609245,
0.07390669733285904,
-0.025163646787405014,
-0.019287217408418655,
-0.019287217408418655,
0.03037690557539463,
-0.00027847991441376507,
0.021626735106110573,
-0.037340197712183,
0.013429207727313042,
-0.019360901787877083,
-0.043032415211200714,
-0.015741094946861267,
0.01257261261343956,
0.03402434661984444,
0.0007650642073713243,
0.036198072135448456,
0.04365874081850052,
0.0026250509545207024,
-0.059169571846723557,
0.03546121343970299,
-0.020631980150938034,
0.0976334735751152,
-0.0341532938182354,
0.016837168484926224,
-0.02157147228717804,
0.04314294457435608,
0.03629017993807793,
-0.029732156544923782,
0.02249254286289215,
0.035755958408117294,
-0.012038392014801502,
-0.0421113446354866,
-0.02195832133293152,
-0.03151903301477432,
0.05172732099890709,
0.045832470059394836,
-0.048300936818122864,
-0.03468751534819603,
-0.021497786045074463,
0.0004251316131558269,
-0.08164369314908981,
-0.07224877178668976,
-0.04520614072680473,
-0.04557456821203232,
0.03979024663567543,
-0.009698872454464436,
0.02801896445453167,
-0.04428507015109062,
0.04365874081850052,
-0.012655508704483509,
0.003281313693150878,
0.0053053661249578,
-0.08974911272525787,
-0.03142692521214485,
-0.007465276401489973,
0.043511372059583664,
-0.006208015140146017,
0.02483206056058407,
-0.04719565436244011,
-0.01335552241653204,
-0.019931966438889503,
-0.043290313333272934,
-0.013475261628627777,
0.016837168484926224,
-0.08289634436368942,
0.02462942525744438,
-0.0803910344839096,
-0.043474528938531876,
-0.02658209577202797,
-0.002182937227189541,
0.018402988091111183,
-0.012471294961869717,
-0.018845103681087494,
0.00018579719471745193,
-0.020060915499925613,
-0.04093237221240997,
0.014479228295385838,
0.01943458802998066,
0.006249463651329279,
-0.03094797022640705,
-0.013373943977057934,
-0.03220062702894211,
0.005788928363472223,
0.03634544089436531,
0.050400979816913605,
-0.025329438969492912,
-0.040637630969285965,
0.01688322238624096,
-0.026637358590960503,
-0.052095748484134674,
-0.038979705423116684,
0.024518897756934166,
0.02709789387881756,
0.046606168150901794,
-0.01939774490892887,
0.061380140483379364,
0.02444521151483059,
0.004504034761339426,
-0.02492416836321354,
0.09387550503015518,
-0.04981149360537529,
-0.021976742893457413,
-0.03794810548424721,
0.023045184090733528,
-0.0654328465461731,
-0.007497514132410288,
0.06440125405788422,
-0.02702420949935913,
0.07095927000045776,
0.019839858636260033,
-0.008598193526268005,
-0.04520614072680473,
-0.04192712903022766,
0.0018640164053067565,
0.016800325363874435,
0.0061297244392335415,
-0.023726776242256165,
-0.02510838210582733,
-0.034448038786649704,
0.06690656393766403,
-0.027079472318291664,
0.0013597303768619895,
0.008275819011032581,
-0.0749751403927803,
0.025513652712106705,
0.017159543931484222,
0.016127943992614746,
0.004844830837100744,
0.014598967507481575,
-0.025476809591054916,
0.019139844924211502,
-0.0175463929772377,
0.0021956018172204494,
0.012830512598156929,
-0.011826545000076294,
-0.010426518507301807,
0.01819114200770855,
0.025292595848441124,
0.021903056651353836,
0.019360901787877083,
0.020466186106204987,
-0.02030039392411709,
0.007594226393848658,
0.01394500769674778,
-0.07906468957662582,
-0.031095340847969055,
0.0635170191526413,
0.0067284200340509415,
0.0012607153039425611,
-0.03772704675793648,
-0.0051948376931250095,
0.01235155574977398,
-0.0062034097500145435,
0.09800190478563309,
0.07655937969684601,
0.013208150863647461,
-0.03277168795466423,
0.008496875874698162,
-0.009809400886297226,
0.04760092496871948,
0.020908299833536148,
-0.02335834875702858,
0.03455856442451477,
0.04030604660511017,
0.013512104749679565,
0.02801896445453167,
0.039237603545188904,
0.056627415120601654,
-0.001755790668539703,
-0.02523733302950859,
0.027079472318291664,
0.031132183969020844,
0.01102521363645792,
0.04387979954481125,
-0.013023937121033669,
-0.03461382910609245,
-0.06108539551496506,
-0.00818371120840311,
-0.04925885051488876,
-0.013005515560507774,
0.011706806719303131,
-0.010269936174154282,
0.035719115287065506,
0.05975905433297157,
-0.0019480641931295395,
0.01921353116631508,
0.04737986624240875,
0.019453009590506554,
-0.019968809559941292,
0.02361624874174595,
-0.05762217193841934,
0.003361907321959734,
0.0018778324592858553,
-0.031574297696352005,
0.01969248801469803,
0.006806711200624704,
-0.028700556606054306,
0.02875582128763199,
-0.05986958369612694,
-0.009468604810535908,
-0.03372960165143013,
-0.02208727039396763,
0.007690938655287027,
-0.03054269775748253,
-0.02683999575674534,
0.037634942680597305,
0.004004354123026133,
0.03485330939292908,
0.055190544575452805,
-0.05032729357481003,
-0.0015163123607635498,
-0.0803910344839096,
-0.015225295908749104,
-0.03474278002977371,
-0.04959043487906456,
0.0003592174907680601,
0.09335970878601074,
-0.07062768936157227,
-0.0003065437776967883,
0.01969248801469803,
-0.009726504795253277,
0.008805434219539165,
-0.05909588560461998,
-0.004121790640056133,
0.03417171537876129,
-0.04141132906079292,
0.00472969701513648,
-0.008298845030367374,
0.018135879188776016,
0.03975340351462364,
-0.05931694060564041,
-0.018900366500020027,
0.023855727165937424,
0.06709077954292297,
0.03054269775748253,
-0.003520792117342353,
0.041558701545000076,
0.06768026202917099,
0.03277168795466423,
0.007046189624816179,
0.036198072135448456,
-0.011135742999613285,
-0.002410902176052332,
0.015262138098478317,
0.02671104483306408,
0.06602233648300171,
-0.030100584030151367,
0.053311560302972794,
0.018992474302649498,
0.016966119408607483,
0.005687610246241093,
-0.041595544666051865,
0.052979975938797,
-0.036769136786460876,
-0.06079065427184105,
-0.047564081847667694,
0.03960603103041649,
0.054895803332328796,
-0.10168618708848953,
-0.03931128978729248,
-0.03181377425789833,
-0.0053468141704797745,
0.015345035120844841,
-0.0539378896355629,
-0.021681999787688255,
0.03909023106098175,
0.0018651677528396249,
-0.03209009766578674,
-0.02932688593864441,
-0.014691074378788471,
0.06451177597045898,
-0.03172167018055916,
-0.038942862302064896,
-0.0022831035312265158,
-0.018458252772688866,
-0.010942317545413971,
-0.015897676348686218,
-0.0013677896931767464,
0.020908299833536148,
0.01869773119688034,
-0.006060644052922726,
-0.08061209321022034,
0.024389946833252907,
-0.03402434661984444,
0.031666405498981476,
-0.06167488172650337,
0.02052145078778267,
-0.04428507015109062,
-0.09321233630180359,
-0.029732156544923782,
-0.05618530139327049,
-0.014239749871194363,
-0.024868903681635857,
0.0007495211320929229,
0.056369516998529434,
-0.021424099802970886,
0.002217477187514305,
0.09726504981517792,
-0.014046325348317623,
-0.04247977212071419,
-0.01876220665872097,
-0.03162956237792969,
0.02836897224187851,
0.021258307620882988,
-0.06631707400083542,
-0.02392941154539585,
0.024371525272727013,
0.07287509739398956,
-0.03794810548424721,
-0.023339927196502686,
-0.0027401847764849663,
-0.012342344969511032,
0.028037386015057564,
0.032440103590488434,
0.05069572106003761,
-0.05309050530195236,
0.0272821094840765,
0.02645314484834671,
-0.039937619119882584,
-0.06429072469472885,
-0.023210976272821426,
-0.021331993862986565,
-0.026526831090450287,
0.0024937984999269247,
0.022474121302366257,
0.05695899948477745,
-0.012508138082921505,
0.03321380168199539,
0.03220062702894211,
-0.005922483280301094,
0.010905475355684757,
0.03938497602939606,
-0.08378057181835175,
0.016450319439172745,
-0.006631707772612572,
0.05714321509003639,
-0.0491483211517334,
0.02923477813601494,
0.000712102628313005,
-0.025789974257349968,
-0.0043474528938531876,
-0.03256905451416969,
0.014387121424078941,
0.046348270028829575,
-0.023468876257538795,
-0.04907463863492012,
-0.041595544666051865,
0.023634670302271843,
-0.00886990875005722,
0.029861105605959892,
0.014083168469369411,
0.009883086197078228,
-0.00807318277657032,
0.040858689695596695,
0.06149066612124443,
-0.0046030497178435326,
-0.037063878029584885,
-0.005125757306814194,
-0.014368699863553047,
-0.05795375630259514,
-0.0005336452159099281,
0.034061186015605927,
0.010076511651277542,
0.04321662709116936,
0.01806219294667244,
0.02153462916612625,
0.03579280152916908,
-0.04745355248451233,
-0.05500633269548416,
-0.011651542037725449,
0.014875289052724838,
0.042074501514434814,
-0.053274717181921005,
0.041300803422927856,
-0.06458546221256256,
0.03238483890891075,
-0.009533080272376537,
-0.04866936430335045,
-0.03662176430225372,
0.034411195665597916,
0.007736992556601763,
0.04771145433187485,
0.04487455636262894,
0.023303084075450897,
0.012066023424267769,
0.023524140939116478,
0.0007898179464973509,
-0.025955766439437866,
0.048264093697071075,
0.02278728410601616,
-0.013788425363600254,
-0.03328748792409897,
-0.005204048473387957,
0.04885357990860939,
0.012001548893749714,
0.023689933121204376,
-0.0012699259677901864,
0.06200646609067917,
-0.0692276582121849,
-0.0185043066740036,
0.017564814537763596,
-0.031574297696352005,
0.041300803422927856,
0.05618530139327049,
0.020466186106204987,
-0.06440125405788422,
0.015004239045083523,
0.02763211540877819,
-0.04270083084702492,
-0.02514522522687912,
0.005388262681663036,
0.007948838174343109,
0.053532619029283524,
0.05688531696796417,
-0.004554693587124348,
-0.0038684962783008814,
-0.008588982746005058,
-0.02683999575674534,
-0.00043146396637894213,
-0.0036428337916731834,
-0.032661162316799164,
0.03089270554482937,
0.014009482227265835,
0.037671785801649094,
-0.025476809591054916,
0.041595544666051865,
0.024518897756934166,
-0.021074093878269196,
0.02658209577202797,
-0.015188452787697315,
-0.0526483915746212,
0.0472324974834919,
-0.009242942556738853,
0.10249672830104828,
-0.0491483211517334,
-0.010463360697031021,
-0.029437413439154625,
0.04911148175597191,
-0.05029045045375824,
-0.008105420507490635,
-0.03107691928744316,
-0.04494824260473251,
0.008238975889980793,
-0.049000952392816544,
-0.009049518033862114,
0.005577081814408302,
0.0363822840154171,
-0.012241027317941189,
0.04461665451526642,
-0.007106059230864048,
0.028387393802404404,
-0.05832218378782272,
-0.0657275915145874,
-0.03037690557539463,
0.05791691318154335,
-0.007810677867382765,
0.03398750349879265,
-0.015833202749490738,
0.009625187143683434,
0.015160820446908474,
-0.05530107393860817,
-0.03172167018055916,
-0.02030039392411709,
-0.00481719896197319,
-0.021516207605600357,
-0.01494897436350584,
-0.008694905787706375,
-0.00785212591290474,
0.026434723287820816,
-0.06565390527248383,
-0.009818611666560173,
0.0032698004506528378,
0.03743230551481247,
0.016459530219435692,
-0.005738269537687302,
-0.019139844924211502,
-0.02667420171201229,
0.0002377513301325962,
0.03805863484740257,
0.028424236923456192,
-0.09004385024309158,
-0.06027485430240631,
-0.03199798986315727,
0.023174135014414787,
0.07342774420976639,
0.0005615651607513428,
0.0347796231508255,
0.029271621257066727,
0.024813639000058174,
0.0354243703186512,
-0.07958049327135086,
-0.02100040763616562,
0.038942862302064896,
-0.025513652712106705,
0.008386347442865372,
-0.056332673877477646,
-0.0131620978936553,
0.00747448718175292,
-0.010509414598345757,
0.0028391999658197165,
-0.022032007575035095,
0.041079744696617126,
-0.02435310371220112,
0.015308191999793053,
0.030800597742199898,
0.016772694885730743,
0.02737421542406082,
-0.010905475355684757,
-0.09873875975608826,
-0.04572194069623947,
0.005148784257471561,
-0.050622034817934036,
-0.06344334036111832,
-0.000902649131603539,
-0.04284819960594177,
0.03439277410507202,
-0.06171172484755516,
-0.004377387464046478,
0.030690070241689682,
-0.013033147901296616,
0.011531802825629711,
-0.03011900559067726,
0.034705936908721924,
0.03938497602939606,
0.0449850857257843,
0.01749112829566002,
-0.009726504795253277,
-0.030690070241689682,
-0.01586083509027958,
-0.04093237221240997,
0.03273484483361244,
-0.010113353841006756,
-0.025384703651070595,
0.009201494045555592,
-0.005692215636372566,
-0.005747479852288961,
0.021810950711369514,
0.015308191999793053,
-0.022253064438700676,
0.004573115147650242,
-0.02619524486362934,
0.03724808990955353,
-0.05117467790842056,
0.024334682151675224,
0.05596424639225006,
-0.009505447931587696,
-0.0025674840435385704,
-0.004517850931733847,
0.015814781188964844,
-0.01652400568127632,
0.0046030497178435326,
-0.007060005329549313,
0.06469599157571793,
0.03229273110628128,
0.013281837105751038,
0.02715315856039524,
0.0062540690414607525,
-0.002165667014196515,
0.01703980378806591,
-0.033453281968832016,
-0.022197799757122993,
-0.017343757674098015,
-0.0143594890832901,
0.04380611330270767,
-0.035019099712371826,
0.029824262484908104,
-0.06602233648300171,
-0.007907390594482422,
0.013300258666276932,
0.010039668530225754,
-0.05128520727157593,
-0.033969081938266754,
0.044248227030038834,
-0.0328637957572937,
-0.029437413439154625,
0.008192921988666058,
0.004101066384464502,
0.02833212912082672,
0.0234504546970129,
0.058985356241464615,
-0.010205461643636227,
-0.007953443564474583,
0.01605425961315632,
0.01120021753013134,
-0.016791116446256638,
-0.007345537189394236,
0.05415894463658333,
-0.03107691928744316,
0.024776797741651535,
-0.009662029333412647,
0.013502893969416618,
0.027926858514547348,
0.06804869323968887,
-0.011246271431446075,
-0.01808982528746128,
-0.007870547473430634,
0.04192712903022766,
-0.04579562693834305,
-0.029824262484908104,
0.03461382910609245,
0.05194837599992752,
-0.029584785923361778,
0.011273902840912342,
0.010822578333318233,
-0.024426789954304695,
-0.02846107818186283,
0.008653457276523113,
-0.030837440863251686,
0.026379460468888283,
0.005259312689304352,
0.014387121424078941,
-0.02000565081834793,
-0.0424429289996624,
0.0008761683129705489,
-0.014663442969322205,
0.03011900559067726,
-0.04984833672642708,
-0.0005195413250476122,
0.00677447346970439,
-0.012121288105845451,
-0.003976721782237291,
-0.031169027090072632,
-0.06370123475790024,
-0.00011901958350790665,
0.06786447763442993,
0.019710909575223923,
-0.0071014538407325745,
0.011237060651183128,
0.011080478318035603,
0.062338054180145264,
-0.043290313333272934,
0.02754000760614872,
-0.01523450668901205,
0.032974325120449066,
0.005498791113495827,
-0.0319058820605278,
0.05334840342402458,
-0.011301535181701183,
0.032145362347364426,
-0.016643743962049484,
-0.06804869323968887,
-0.0004285856266506016,
-0.05316419154405594,
0.001309071434661746,
0.007152112666517496,
0.03743230551481247,
0.022253064438700676,
-0.021037250757217407,
0.017638500779867172,
0.0443587563931942,
-0.0386112779378891
]
|
36,356 | statistics | zscore | Compute the Standard Score. (x - mean) / stdev
Describes *x* in terms of the number of standard deviations
above or below the mean of the normal distribution.
| def zscore(self, x):
"""Compute the Standard Score. (x - mean) / stdev
Describes *x* in terms of the number of standard deviations
above or below the mean of the normal distribution.
"""
# https://www.statisticshowto.com/probability-and-statistics/z-score/
if not self._sigma:
raise StatisticsError('zscore() not defined when sigma is zero')
return (x - self._mu) / self._sigma
| (self, x) | [
-0.008326975628733635,
0.050006791949272156,
0.04127088189125061,
0.011935481801629066,
0.11547219008207321,
-0.012259034439921379,
-0.048353083431720734,
0.0010498595656827092,
0.03386513143777847,
0.05367371812462807,
-0.024571994319558144,
0.019592884927988052,
-0.031923819333314896,
-0.02401476539671421,
-0.021731924265623093,
0.08541778475046158,
0.019341232255101204,
0.0178403090685606,
0.0157102569937706,
0.016474200412631035,
0.0022581249941140413,
0.011396228335797787,
-0.025776326656341553,
-0.03665127605199814,
0.004884739872068167,
-0.006569907534867525,
0.010146956890821457,
-0.028760196641087532,
0.026836859062314034,
-0.006475538015365601,
-0.028850072994828224,
0.0034040389582514763,
0.005347599275410175,
0.00029771297704428434,
0.022271178662776947,
0.00040106993401423097,
-0.00909990631043911,
-0.021462297067046165,
-0.05388941988348961,
-0.012744362466037273,
-0.002911970019340515,
0.000643172359559685,
-0.045477062463760376,
0.05921005830168724,
0.02011416293680668,
-0.004812839441001415,
-0.010425571352243423,
0.04935969039797783,
-0.025722401216626167,
-0.0437874011695385,
0.007351825479418039,
0.0027951316442340612,
0.023008158430457115,
-0.03440438583493233,
-0.003516383469104767,
-0.004228647798299789,
0.05223570764064789,
0.0108210239559412,
-0.002653577597811818,
-0.015898996964097023,
0.07865913957357407,
0.05593858286738396,
-0.043823350220918655,
-0.04482995718717575,
-0.006134010851383209,
-0.012402835302054882,
-0.029227551072835922,
0.007756265811622143,
0.015773171558976173,
0.05529148131608963,
-0.019413134083151817,
0.011710792779922485,
0.014263260178267956,
-0.01059633493423462,
0.06808976829051971,
0.0721161961555481,
0.017211180180311203,
-0.03742420673370361,
-0.039077918976545334,
-0.02888602390885353,
0.03828701376914978,
0.0005976728280074894,
0.028220944106578827,
-0.003246756736189127,
-0.011378252878785133,
-0.02318790927529335,
0.024895545095205307,
-0.026818884536623955,
0.01928730681538582,
0.10741933435201645,
-0.012214096263051033,
0.03377525508403778,
0.03607607260346413,
0.01123445201665163,
-0.021606098860502243,
0.017085354775190353,
-0.029245525598526,
-0.04749027639627457,
0.053098514676094055,
-0.02676495909690857,
0.049898941069841385,
0.12970848381519318,
0.049431588500738144,
0.020725317299365997,
-0.009072943590581417,
0.041091132909059525,
0.03462008759379387,
-0.013921733014285564,
0.007167580537497997,
0.03440438583493233,
-0.02902982383966446,
0.003464705077931285,
-0.023511461913585663,
-0.02092304453253746,
-0.02782549150288105,
-0.09526815265417099,
0.0017817841144278646,
0.05784394592046738,
-0.013526280410587788,
0.01260056160390377,
-0.006169961299747229,
0.029694903641939163,
0.009499852545559406,
0.010937863029539585,
-0.06629225611686707,
0.015099103562533855,
0.0062508489936590195,
-0.015898996964097023,
-0.021803824231028557,
0.06600465625524521,
0.024643894284963608,
-0.02023998834192753,
0.01058734767138958,
-0.03210357204079628,
0.021965600550174713,
-0.009490865282714367,
0.1231655478477478,
-0.011396228335797787,
0.05187620595097542,
-0.02401476539671421,
0.08124756067991257,
0.04184608906507492,
-0.014496937394142151,
-0.04533326253294945,
-0.0188019797205925,
0.023044107481837273,
0.07139719277620316,
0.036813054233789444,
0.04249319061636925,
-0.026567231863737106,
0.011755730956792831,
0.03853866457939148,
0.044901859015226364,
-0.05122910067439079,
-0.012924113310873508,
-0.013175765052437782,
0.00796747300773859,
-0.06755051016807556,
0.00704175466671586,
-0.025848226621747017,
-0.05302661284804344,
0.04745432734489441,
-0.0342605859041214,
-0.04033617675304413,
0.006003691349178553,
-0.02699863538146019,
-0.031833942979574203,
0.02593810297548771,
-0.0015065399929881096,
-0.04267294332385063,
-0.018819954246282578,
0.01797512359917164,
-0.07923434674739838,
0.03961717337369919,
0.03958122059702873,
-0.035375043749809265,
-0.03986882418394089,
0.05885055288672447,
-0.013364504091441631,
-0.025830252096056938,
0.07164884358644485,
-0.04022832587361336,
-0.023098032921552658,
-0.02352943643927574,
-0.041558485478162766,
-0.05352991819381714,
0.0067676338367164135,
0.04472210630774498,
-0.023133983835577965,
0.005271204747259617,
-0.023223860189318657,
-0.04669937118887901,
0.0006948508671484888,
-0.03154634311795235,
0.008048361167311668,
0.010425571352243423,
-0.009580740705132484,
-0.03275067359209061,
0.06089971959590912,
-0.08239796757698059,
-0.03582442179322243,
0.0171302929520607,
-0.014200347475707531,
-0.044182851910591125,
-0.005617226008325815,
-0.03914981707930565,
-0.03767585754394531,
-0.055471230298280716,
-0.06722696125507355,
-0.010362658649682999,
-0.035968221724033356,
-0.007446194998919964,
-0.006740671116858721,
-0.012681449763476849,
0.017435869202017784,
-0.048568785190582275,
0.07700543105602264,
-0.06463854014873505,
0.03976097330451012,
0.017534732818603516,
0.01782233454287052,
-0.06859306991100311,
0.01916148141026497,
0.06424309313297272,
0.014685675501823425,
0.040839482098817825,
0.04421880468726158,
0.005985715892165899,
-0.015719246119260788,
-0.006911435164511204,
0.017058392986655235,
0.01355324313044548,
-0.02521909773349762,
-0.06808976829051971,
-0.02973085455596447,
-0.03577049449086189,
-0.00379050406627357,
0.004507262259721756,
-0.05184025689959526,
-0.02996453084051609,
-0.012294984422624111,
-0.0038376888260245323,
0.05212785676121712,
0.006237367633730173,
-0.03814321011304855,
-0.013508304953575134,
-0.02721433714032173,
0.02938932739198208,
-0.0044128927402198315,
0.0342605859041214,
0.010614310391247272,
-0.05112124979496002,
-0.021624073386192322,
-0.02424844168126583,
-0.006372181233018637,
0.0007982078241184354,
0.012807275168597698,
0.055830731987953186,
0.026117853820323944,
0.010021131485700607,
-0.03832296282052994,
-0.05521957948803902,
-0.017301056534051895,
-0.0004976862110197544,
-0.028274869546294212,
0.031923819333314896,
-0.0050734784454107285,
0.010910900309681892,
0.03161824122071266,
0.049431588500738144,
0.1463894098997116,
0.00597672862932086,
0.00704175466671586,
-0.0865681916475296,
-0.02401476539671421,
0.002370469504967332,
0.0130139896646142,
-0.012654487043619156,
0.07786823809146881,
0.04267294332385063,
0.04878448322415352,
-0.010551397688686848,
-0.03472793847322464,
0.02877817302942276,
0.053601816296577454,
-0.01141420379281044,
-0.00013593687617685646,
-0.09800036996603012,
-0.017328018322587013,
0.037028755992650986,
-0.021498247981071472,
-0.01481150183826685,
-0.020401764661073685,
-0.025398848578333855,
0.03528516739606857,
-0.04177418723702431,
-0.008057349361479282,
-0.03379323333501816,
0.04188203811645508,
0.0767897292971611,
0.01177370548248291,
0.00802589301019907,
0.06780216842889786,
0.037388257682323456,
-0.02592012844979763,
0.05478817597031593,
0.018748054280877113,
-0.03485376387834549,
0.00815621204674244,
-0.008969586342573166,
0.0011650127125903964,
0.03079138696193695,
-0.03803536295890808,
-0.010434559546411037,
-0.0078551284968853,
0.04209773987531662,
0.04601631686091423,
-0.045836564153432846,
-0.012106245383620262,
0.036561399698257446,
-0.017301056534051895,
-0.03582442179322243,
0.07930624485015869,
0.019538959488272667,
0.004594890866428614,
-0.011719780042767525,
-0.07714922726154327,
-0.014838464558124542,
0.013157790526747704,
-0.013040952384471893,
-0.029802754521369934,
-0.055003877729177475,
-0.006003691349178553,
0.0404440276324749,
-0.02329576015472412,
0.03577049449086189,
0.021803824231028557,
0.010146956890821457,
-0.0026243680622428656,
-0.01950300857424736,
-0.04432665556669235,
0.03302030265331268,
-0.007922535762190819,
-0.012034345418214798,
-0.05187620595097542,
-0.011782693676650524,
-0.015171004459261894,
-0.057628244161605835,
-0.021030893549323082,
0.049647290259599686,
-0.0062553430907428265,
-0.023727163672447205,
0.03485376387834549,
0.004376942757517099,
0.025129223242402077,
-0.044290702790021896,
0.03487173840403557,
-0.035482894629240036,
0.028760196641087532,
-0.021498247981071472,
0.007419232279062271,
0.0021918416023254395,
-0.03746015578508377,
-0.008969586342573166,
-0.01290613878518343,
-0.023942863568663597,
-0.02130052074790001,
-0.017912210896611214,
-0.008619071915745735,
-0.011584967374801636,
-0.05054604634642601,
-0.03307422623038292,
-0.08513018488883972,
-0.048568785190582275,
0.030593659728765488,
-0.0029928579460829496,
0.009230226278305054,
-0.028149044141173363,
0.0364355742931366,
-0.011360278353095055,
0.021911675110459328,
-0.0009751504403539002,
-0.016698889434337616,
-0.0354289673268795,
-0.010245820507407188,
0.016339387744665146,
-0.08958801627159119,
0.010039106011390686,
0.009544790722429752,
-0.027915365993976593,
0.04968323931097984,
-0.006062110420316458,
0.05043819546699524,
-0.03614797443151474,
-0.008048361167311668,
0.04432665556669235,
0.019215406849980354,
-0.041342783719301224,
-0.008861735463142395,
0.04601631686091423,
-0.047885727137327194,
0.023870963603258133,
-0.041198983788490295,
-0.008726922795176506,
-0.015782158821821213,
-0.07664592564105988,
-0.02115672081708908,
0.022990182042121887,
-0.01028177049010992,
0.0844830796122551,
-0.025776326656341553,
-0.028490571305155754,
-0.03864651545882225,
-0.02068936638534069,
0.024194516241550446,
-0.022271178662776947,
0.0354289673268795,
0.030036430805921555,
-0.033703356981277466,
-0.0012548882514238358,
0.020473666489124298,
-0.058814603835344315,
0.0371006540954113,
0.007288912311196327,
0.03614797443151474,
-0.04141468554735184,
-0.05723279342055321,
-0.04497375711798668,
-0.005585769657045603,
0.01218713354319334,
-0.001870536245405674,
-0.016923578456044197,
-0.024679845198988914,
-0.01663597673177719,
0.0013750969665125012,
0.008942623622715473,
-0.0054689315147697926,
0.012663474306464195,
-0.01035367138683796,
0.022145351395010948,
0.08944421261548996,
0.07301495224237442,
0.03129468858242035,
0.0033928046468645334,
-0.013292604126036167,
0.05557908117771149,
0.04695102199912071,
-0.03055771067738533,
0.037532057613134384,
-0.026711033657193184,
-0.03922171890735626,
-0.016096722334623337,
0.05015059560537338,
0.03231927007436752,
-0.0656810998916626,
-0.023403611034154892,
-0.10497472435235977,
-0.04533326253294945,
-0.016222549602389336,
0.014173384755849838,
-0.025308974087238312,
0.010155945084989071,
-0.05802369862794876,
-0.0432840958237648,
-0.06891662627458572,
0.031438492238521576,
-0.005392536986619234,
0.024428192526102066,
0.04504565894603729,
-0.05266711115837097,
0.05043819546699524,
0.019323257729411125,
-0.01973668485879898,
-0.032427120953798294,
-0.013804894872009754,
0.01356223039329052,
-0.017984110862016678,
-0.02343956008553505,
0.0654294490814209,
0.0559026338160038,
0.007369800470769405,
0.008735910058021545,
-0.024931496009230614,
0.00037270295433700085,
0.036813054233789444,
-0.012142196297645569,
-0.08671199530363083,
0.010838999412953854,
0.06485424190759659,
-0.043248146772384644,
0.031312666833400726,
0.01759764552116394,
0.03440438583493233,
0.026351530104875565,
-0.07865913957357407,
-0.02070734277367592,
0.06783811748027802,
0.010785073973238468,
0.013508304953575134,
-0.04554896429181099,
-0.0325888991355896,
0.008295519277453423,
-0.06949182599782944,
-0.01914350688457489,
-0.03778370842337608,
0.04885638505220413,
-0.031815968453884125,
-0.012996014207601547,
0.04432665556669235,
-0.022918282076716423,
-0.017516758292913437,
-0.004979109391570091,
0.042744845151901245,
0.005127403885126114,
0.0035433461889624596,
-0.03843081369996071,
-0.023008158430457115,
0.030288083478808403,
0.015521518886089325,
0.025992028415203094,
0.004893727134913206,
-0.030413908883929253,
-0.05852700024843216,
-0.02710648626089096,
0.019718710333108902,
0.03821511194109917,
-0.0233137346804142,
0.01302297692745924,
0.041198983788490295,
0.03497958928346634,
0.017525745555758476,
-0.021012919023633003,
0.0007706834003329277,
0.027322188019752502,
-0.0054689315147697926,
0.023098032921552658,
-0.02068936638534069,
-0.04698697105050087,
-0.05011464282870293,
0.005725076887756586,
0.03314612805843353,
-0.021426348015666008,
0.04874853417277336,
-0.017175231128931046,
0.0401923768222332,
0.0014750835252925754,
-0.035249218344688416,
0.02721433714032173,
-0.0157102569937706,
-0.017525745555758476,
0.046088214963674545,
-0.007661896292120218,
0.016348375007510185,
-0.006668770685791969,
0.043967150151729584,
0.0440390519797802,
-0.04296054318547249,
0.04533326253294945,
0.019467059522867203,
-0.005059997085481882,
0.0024670856073498726,
0.002552467631176114,
0.1005168929696083,
-0.03332587704062462,
-0.06499804556369781,
0.012780312448740005,
-0.01988048665225506,
-0.014973278157413006,
-0.021102795377373695,
-0.01988048665225506,
-0.017444856464862823,
0.016015835106372833,
0.06341623514890671,
0.05029439553618431,
-0.0018222280777990818,
0.049072086811065674,
0.04055187851190567,
-0.028580445796251297,
-0.04684317111968994,
0.02901184931397438,
0.008066336624324322,
-0.08225416392087936,
0.008623565547168255,
-0.028490571305155754,
-0.04238533973693848,
0.009010030888020992,
-0.038466762751340866,
0.01770549640059471,
0.014002621173858643,
0.03456616401672363,
-0.07078603655099869,
0.007828166708350182,
-0.03212154656648636,
-0.04249319061636925,
-0.025902152061462402,
-0.029515152797102928,
0.03724445402622223,
-0.03778370842337608,
0.008641541004180908,
0.0203478392213583,
0.006390156224370003,
0.054536525160074234,
0.00940098986029625,
-0.005450956057757139,
0.06586085259914398,
-0.00019210913160350174,
0.012007382698357105,
-0.03666925057768822,
-0.025722401216626167,
-0.017768409103155136,
0.0008493245695717633,
0.008021398447453976,
-0.08671199530363083,
0.027268262580037117,
0.032067619264125824,
0.000018975692000822164,
0.021480271592736244,
-0.004552199970930815,
0.0035613214131444693,
0.025614550337195396,
0.019053630530834198,
0.014443011954426765,
0.028993874788284302,
-0.0075765145011246204,
0.03857461363077164,
0.009054968133568764,
0.018622227013111115,
-0.028580445796251297,
-0.030755436047911644,
-0.07075008749961853,
0.012582586146891117,
0.02746598795056343,
-0.0025839239824563265,
-0.06715506315231323,
-0.03720850497484207,
0.012411822564899921,
0.000018062892195302993,
0.008637046441435814,
-0.03670520335435867,
0.005747545510530472,
0.02807714231312275,
0.04860473424196243,
0.05478817597031593,
0.027142437174916267,
-0.025129223242402077,
0.05327826738357544,
0.0021884713787585497,
0.04447045549750328,
0.035357069224119186,
-0.026081904768943787,
-0.02210940234363079,
-0.034296534955501556,
-0.006817065645009279,
0.02807714231312275,
-0.0008824662072584033,
0.016743827611207962,
-0.0052622174844145775,
0.01057836040854454,
0.004790370352566242,
-0.07585502415895462,
-0.02759181521832943,
-0.06765836477279663,
-0.08369217813014984,
0.018109936267137527,
0.002386197680607438,
-0.015171004459261894,
0.028023216873407364,
-0.021552173420786858,
-0.09505245089530945,
-0.02617177926003933,
0.03589631989598274,
0.06697531044483185,
0.0024086665362119675,
-0.03115088865160942,
0.003035549074411392,
-0.039904773235321045,
-0.02911970019340515,
0.03591429814696312,
-0.0378556102514267,
-0.033361829817295074,
0.037747759371995926,
0.04813738167285919,
0.013409442268311977,
-0.023978814482688904,
0.02841866947710514,
-0.042636994272470474,
-0.03424261137843132,
0.009463902562856674,
-0.033487655222415924,
0.044901859015226364,
-0.07024678587913513,
-0.020653417333960533,
-0.0023187908809632063,
0.006300280801951885,
-0.0041859569028019905,
-0.005172341596335173,
0.012996014207601547,
0.10145159810781479,
0.027196362614631653,
-0.006012678612023592,
-0.016357362270355225,
0.012843226082623005,
0.004406152293086052,
0.06995917856693268,
-0.03724445402622223,
-0.002178360242396593,
0.002896241843700409,
-0.02329576015472412,
0.05493197590112686,
-0.04148658365011215,
0.024949470534920692,
-0.045477062463760376,
0.010919887572526932,
0.0008751638233661652,
-0.02487757056951523,
0.04669937118887901,
0.046555571258068085,
0.037172555923461914,
0.049647290259599686,
0.013993633911013603,
-0.009958218783140182,
-0.01420933473855257,
0.00951782800257206,
-0.008668503724038601,
-0.021372422575950623,
-0.010416584089398384,
0.02557860128581524,
0.007091186009347439,
0.0067676338367164135,
-0.01616862416267395,
-0.008951611816883087,
-0.01651015132665634,
0.007477651350200176,
-0.00048195800627581775,
0.028149044141173363,
0.039904773235321045,
-0.025650501251220703,
-0.015269867144525051,
0.028634371235966682,
0.009239213541150093,
0.06161872297525406,
0.023817038163542747,
-0.0008279791218228638,
-0.07930624485015869,
0.040372125804424286,
0.023727163672447205,
-0.027196362614631653,
0.029047800227999687,
0.023385634645819664,
0.012411822564899921,
0.03600417077541351,
-0.04292459413409233,
0.0026311087422072887,
-0.003013079985976219,
0.007936016656458378,
0.02877817302942276,
-0.0003595024754758924,
-0.04367955029010773,
0.029551103711128235,
-0.003909589257091284,
0.024338316172361374,
-0.04677126929163933,
-0.018586277961730957,
0.026423431932926178,
0.038466762751340866,
0.017337007448077202,
-0.03505149111151695,
0.010308733209967613
]
|
36,357 | statistics | StatisticsError | null | class StatisticsError(ValueError):
pass
| null | [
-0.008610793389379978,
-0.018073653802275658,
0.006632195319980383,
0.0294946301728487,
0.011371818371117115,
-0.03676997125148773,
-0.02729891799390316,
0.0035393554717302322,
0.0294946301728487,
-0.007267149165272713,
0.027954354882240295,
0.040702588856220245,
0.027659408748149872,
-0.051222339272499084,
-0.03234577924013138,
0.07045939564704895,
-0.0067755719646811485,
0.053024791181087494,
0.004629018250852823,
-0.007975839078426361,
-0.04279998689889908,
0.013436442241072655,
-0.05810442194342613,
-0.013125110417604446,
0.011674957349896431,
0.06587134301662445,
0.021744096651673317,
-0.03785144165158272,
0.04106307774782181,
-0.026725411415100098,
-0.09058128297328949,
-0.021268906071782112,
0.004522509872913361,
0.008250303566455841,
-0.006583037320524454,
-0.05925143510103226,
-0.005882540252059698,
-0.004485641606152058,
-0.10133043676614761,
0.03690106049180031,
-0.08664866536855698,
-0.03185420110821724,
-0.05626919865608215,
0.018303057178854942,
0.06980396062135696,
-0.011502905748784542,
-0.02041683904826641,
0.010855662636458874,
-0.09982293844223022,
-0.0684930831193924,
-0.041587427258491516,
-0.008446934632956982,
0.03023199550807476,
0.03873628005385399,
0.01435405295342207,
0.08671420812606812,
0.02069539949297905,
0.03496752306818962,
-0.04099753499031067,
-0.028445931151509285,
0.005022279918193817,
0.04397977143526077,
-0.0035106802824884653,
-0.03831024840474129,
0.021727710962295532,
-0.03195251524448395,
-0.05820273607969284,
0.008479706011712551,
-0.030330311506986618,
0.034869205206632614,
0.025791415944695473,
0.02179325371980667,
-0.03277181088924408,
0.030854659155011177,
0.06941069662570953,
-0.004151778761297464,
-0.02500489167869091,
0.004715044517070055,
0.0018249802524223924,
0.0007793546537868679,
0.023284371942281723,
0.002693433314561844,
0.0181883554905653,
0.0076440246775746346,
0.03686828911304474,
-0.056105341762304306,
-0.016467835754156113,
-0.043422650545835495,
-0.03631116822361946,
0.03151009604334831,
-0.06282356381416321,
-0.016369519755244255,
-0.0038220123387873173,
0.015443716198205948,
-0.009544789791107178,
0.06302019208669662,
-0.0217604823410511,
-0.062135353684425354,
-0.008881160989403725,
-0.09189216047525406,
0.04463520646095276,
0.020613469183444977,
0.059415291994810104,
0.03167395666241646,
0.013018601574003696,
-0.01889294944703579,
0.05453229323029518,
-0.04647042974829674,
0.010036366991698742,
0.04191514477133751,
-0.043455421924591064,
0.016492413356900215,
-0.034803662449121475,
0.012100990861654282,
-0.0032321198377758265,
-0.03132985159754753,
-0.0029535593930631876,
0.04086644947528839,
-0.05427011847496033,
0.04909217357635498,
0.018319442868232727,
0.011404590681195259,
-0.02479187585413456,
0.055777620524168015,
0.0275774784386158,
0.04581499099731445,
0.030854659155011177,
-0.011945324949920177,
0.02906859666109085,
0.002248965436592698,
0.007701375521719456,
-0.04312770441174507,
0.015296243131160736,
0.01511599775403738,
0.011502905748784542,
0.017647620290517807,
0.03427931293845177,
0.017991723492741585,
0.011478327214717865,
-0.03463980555534363,
0.07327777147293091,
0.05309033393859863,
0.01681193895637989,
-0.009438281878829002,
0.06649400293827057,
0.03598344698548317,
-0.026315763592720032,
0.021465536206960678,
-0.017778707668185234,
-0.014222965575754642,
-0.026758182793855667,
-0.01617288962006569,
0.042537812143564224,
-0.050763536244630814,
-0.014812858775258064,
-0.04647042974829674,
0.021514693275094032,
-0.05063244700431824,
-0.02231760323047638,
-0.06265970319509506,
-0.033820509910583496,
-0.040702588856220245,
0.005382769741117954,
-0.027446391060948372,
-0.0018270284635946155,
0.04142357036471367,
0.008520671166479588,
-0.008213435299694538,
-0.05997241288423538,
-0.005665426608175039,
0.0004152802866883576,
-0.023349914699792862,
0.011420976370573044,
0.03654056787490845,
-0.04964929446578026,
-0.0011162897571921349,
0.014927559532225132,
0.0693451538681984,
0.005431927740573883,
0.02054792456328869,
0.04951820522546768,
-0.011625800281763077,
-0.06790319085121155,
-0.023644860833883286,
-0.031772270798683167,
-0.011273503303527832,
-0.010151068679988384,
0.007975839078426361,
0.0042931074276566505,
-0.005309033207595348,
0.0066444845870137215,
-0.022088199853897095,
-0.0009759854874573648,
0.007033649832010269,
0.03899845480918884,
-0.05548267439007759,
-0.04945266246795654,
0.008463320322334766,
0.05443397909402847,
0.042079005390405655,
-0.06003795936703682,
0.052631527185440063,
0.021350834518671036,
-0.029232455417513847,
0.00946286041289568,
0.015951678156852722,
-0.05469615384936333,
-0.035328011959791183,
-0.05191054940223694,
-0.009929859079420567,
-0.02072817087173462,
-0.015779627487063408,
0.026922043412923813,
0.09765999764204025,
0.05672800540924072,
0.002402583369985223,
0.09438281506299973,
-0.042046234011650085,
0.007156544364988804,
0.01225665770471096,
0.08927041292190552,
-0.06089002639055252,
0.05459783598780632,
0.004960833117365837,
0.012551603838801384,
0.017074113711714745,
0.006152907386422157,
-0.04132525250315666,
0.015247085131704807,
-0.004317685961723328,
0.04371759667992592,
-0.015582996420562267,
-0.017926180735230446,
-0.013436442241072655,
-0.01342005655169487,
0.036638885736465454,
0.015599382109940052,
-0.01571408286690712,
0.018778247758746147,
-0.012387744151055813,
-0.08153626322746277,
-0.023038582876324654,
-0.06265970319509506,
0.03647502511739731,
0.04279998689889908,
-0.036114536225795746,
0.007660410832613707,
0.05653137341141701,
-0.04679814726114273,
0.017401831224560738,
0.003418509615585208,
0.0031829620711505413,
-0.023104127496480942,
-0.038474105298519135,
0.04850228130817413,
-0.07288450747728348,
-0.043062157928943634,
-0.0275774784386158,
0.07983212918043137,
0.0035885132383555174,
0.032329391688108444,
0.011224345304071903,
0.0047273337841033936,
0.03447594493627548,
-0.0648554116487503,
-0.011715922504663467,
-0.02203904278576374,
0.042079005390405655,
0.07596505433320999,
0.05495832860469818,
0.06098834052681923,
0.07727593183517456,
-0.03817915916442871,
-0.02274363674223423,
-0.03513137996196747,
0.04509401321411133,
-0.006603519897907972,
0.03401713818311691,
0.04460243508219719,
0.003969485405832529,
0.04961652308702469,
-0.03768758103251457,
-0.042996615171432495,
-0.0031174186151474714,
-0.023431845009326935,
0.03876905143260956,
0.0163203626871109,
-0.06750993430614471,
0.0011736404849216342,
0.03493475168943405,
0.02959294617176056,
-0.05102571099996567,
-0.0041251517832279205,
-0.02475910261273384,
-0.004219370894134045,
0.010470593348145485,
0.0030621159821748734,
-0.03542632609605789,
0.05328696593642235,
0.028019897639751434,
0.014050913974642754,
-0.014272123575210571,
0.003582368604838848,
0.013567529618740082,
-0.03129708021879196,
-0.062069810926914215,
0.07386766374111176,
-0.03601622208952904,
0.0007947164122015238,
0.0010589391458779573,
0.01846691593527794,
0.04866613820195198,
-0.010831083171069622,
0.00985612254589796,
0.043914224952459335,
0.019826944917440414,
0.027561092749238014,
-0.045683905482292175,
-0.02210458740592003,
0.07609614729881287,
-0.04093199223279953,
-0.021416379138827324,
0.06701835244894028,
-0.05925143510103226,
-0.026364922523498535,
0.03311591595411301,
-0.006718221120536327,
-0.007984032854437828,
0.006972202565521002,
-0.01663169451057911,
-0.05223826691508293,
-0.07281896471977234,
0.054794467985630035,
0.000009729131306812633,
-0.04279998689889908,
0.007242570165544748,
0.03873628005385399,
0.004260335583239794,
0.03965388983488083,
-0.0041558751836419106,
0.010921206325292587,
0.0020185387693345547,
0.02051515318453312,
0.034803662449121475,
0.03965388983488083,
-0.04227563738822937,
-0.018778247758746147,
-0.04719140753149986,
0.03193613141775131,
0.04240672290325165,
-0.05810442194342613,
0.07707929611206055,
-0.039850521832704544,
0.037490952759981155,
0.07537516206502914,
0.008594407700002193,
-0.005169752985239029,
-0.04021101072430611,
0.00796355027705431,
-0.04765021428465843,
0.030117293819785118,
0.02567671425640583,
-0.0063249594531953335,
-0.01720520108938217,
-0.02054792456328869,
0.004465159028768539,
-0.016033608466386795,
-0.02493934892117977,
0.022579777985811234,
0.002812230959534645,
-0.005382769741117954,
-0.02323521487414837,
-0.033247001469135284,
0.004297203850001097,
0.01409187912940979,
0.0627252459526062,
0.00723028089851141,
0.030379468575119972,
-0.05410626158118248,
0.01687748357653618,
0.010003595612943172,
-0.03732709214091301,
-0.05230380967259407,
-0.030330311506986618,
0.012002675794064999,
0.006435564253479242,
-0.06089002639055252,
-0.0181883554905653,
0.013354512862861156,
0.0355246439576149,
-0.031034905463457108,
-0.045290641486644745,
0.005939890630543232,
-0.013125110417604446,
-0.03762203827500343,
0.03513137996196747,
0.010568909347057343,
-0.0018823308637365699,
-0.01601722277700901,
-0.01262534037232399,
-0.053942400962114334,
0.004821552895009518,
-0.0322146899998188,
0.0793733298778534,
0.0018598003080114722,
-0.047977931797504425,
-0.010634453035891056,
-0.014222965575754642,
-0.007910296320915222,
0.0030744054820388556,
0.015951678156852722,
-0.01237955130636692,
-0.00895489752292633,
-0.002294026780873537,
-0.036671657115221024,
0.0019417298026382923,
-0.03490198031067848,
-0.03355833515524864,
-0.00785704143345356,
-0.00692304503172636,
0.01181423757225275,
-0.03441040217876434,
0.06868971884250641,
0.01871270313858986,
-0.02338268794119358,
-0.013477407395839691,
-0.05656414479017258,
-0.0313626229763031,
-0.018876563757658005,
-0.004825649317353964,
-0.015509259887039661,
0.014812858775258064,
-0.0747852697968483,
-0.06092279776930809,
-0.003961292561143637,
-0.04030932858586311,
-0.09156443923711777,
0.02238314598798752,
0.0013415960129350424,
0.03411545604467392,
0.06416720896959305,
0.01446056179702282,
0.07786582410335541,
0.06764101982116699,
0.01126531045883894,
-0.07039385288953781,
0.0075457096099853516,
-0.03601622208952904,
-0.04030932858586311,
-0.03545910120010376,
0.004645404405891895,
-0.039784979075193405,
0.03817915916442871,
0.010126489214599133,
0.03195251524448395,
-0.035196926444768906,
-0.09949521720409393,
-0.01999080553650856,
0.03372219204902649,
0.00183010078035295,
-0.03041223995387554,
0.048043474555015564,
-0.07950441539287567,
-0.03824470192193985,
-0.04997701197862625,
0.020613469183444977,
0.06960732489824295,
0.016033608466386795,
0.03778589889407158,
0.017713163048028946,
0.029232455417513847,
-0.0025971659924834967,
0.0018413661746308208,
-0.05417180433869362,
-0.0355246439576149,
0.052074406296014786,
0.004948543384671211,
0.017172429710626602,
0.028134599328041077,
0.015353593043982983,
0.07373657822608948,
-0.007623542565852404,
0.022547006607055664,
0.018319442868232727,
0.02531622350215912,
-0.0029883794486522675,
-0.0610211119055748,
-0.0368027426302433,
0.015968065708875656,
0.01564854010939598,
-0.01435405295342207,
-0.019269824028015137,
0.010872048325836658,
-0.01008552499115467,
-0.005317226517945528,
-0.005431927740573883,
0.005427831318229437,
0.031772270798683167,
0.013542951084673405,
-0.0250704362988472,
0.04502846673130989,
-0.012723655439913273,
-0.04227563738822937,
-0.07222907245159149,
0.038408562541007996,
-0.01418200135231018,
0.038408562541007996,
0.024873804301023483,
0.019876103848218918,
-0.04279998689889908,
-0.04411085695028305,
0.07065602391958237,
0.027430005371570587,
0.057088494300842285,
0.013411863707005978,
-0.04365205392241478,
-0.03041223995387554,
0.0026422273367643356,
-0.01931898295879364,
0.051189567893743515,
0.003006813582032919,
0.010568909347057343,
-0.000009769136340764817,
0.01115880161523819,
-0.028265686705708504,
-0.014067299664020538,
-0.004964929539710283,
-0.04221009090542793,
0.004497930873185396,
0.053811315447092056,
0.006718221120536327,
0.023923421278595924,
0.032607950270175934,
0.03762203827500343,
0.009684070013463497,
0.0014573214575648308,
0.021350834518671036,
-0.010577102191746235,
-0.03454148769378662,
0.006578940898180008,
-0.010732768103480339,
0.026741797104477882,
0.021006731316447258,
-0.006070978008210659,
0.009446474723517895,
-0.02274363674223423,
-0.04050595685839653,
0.032083604484796524,
-0.05541713163256645,
-0.01977778784930706,
0.024103667587041855,
0.007820173166692257,
0.005349998362362385,
0.01822112686932087,
-0.0038383982609957457,
0.03549187257885933,
0.015378172509372234,
0.03965388983488083,
0.07622723281383514,
0.009831543080508709,
-0.025267066434025764,
-0.05915311723947525,
0.08383028954267502,
-0.02497212029993534,
-0.057481758296489716,
-0.012240271084010601,
-0.03853964805603027,
0.02372679114341736,
-0.07943887263536453,
0.005522049963474274,
0.011166994459927082,
0.0023001714143902063,
-0.023988965898752213,
-0.03781867027282715,
0.006615809164941311,
0.039391715079545975,
0.01889294944703579,
0.026741797104477882,
-0.026905657723546028,
0.003103080904111266,
-0.011093257926404476,
-0.010101910680532455,
-0.02320244163274765,
-0.027364462614059448,
0.0202693659812212,
0.04689646139740944,
-0.08284714072942734,
-0.04535618796944618,
-0.011085065081715584,
0.07347439974546432,
-0.026037203148007393,
0.008930318057537079,
-0.03742540627717972,
-0.0535491406917572,
0.04270166903734207,
0.048961084336042404,
0.029461858794093132,
-0.07013167440891266,
-0.03175588324666023,
0.026217449456453323,
-0.03942449018359184,
0.023579318076372147,
0.030068136751651764,
-0.002943318337202072,
0.048895541578531265,
-0.012617147527635098,
-0.004833842162042856,
0.033214230090379715,
-0.017598463222384453,
-0.015165155753493309,
-0.001331354840658605,
0.0032730845268815756,
-0.0064765289425849915,
0.010036366991698742,
0.008119216188788414,
-0.007615349721163511,
0.013338127173483372,
-0.010142875835299492,
0.007611253298819065,
0.048829998821020126,
0.034312084317207336,
0.008700915612280369,
-0.019237052649259567,
0.02133444882929325,
0.003004765370860696,
0.0439470000565052,
-0.003176817437633872,
-0.013960791751742363,
-0.06652677804231644,
-0.08173289895057678,
-0.051648374646902084,
0.04125970974564552,
0.03268988057971001,
-0.11430807411670685,
-0.059448063373565674,
0.02567671425640583,
0.04647042974829674,
0.03673719987273216,
0.03201805800199509,
0.024808261543512344,
-0.012248463928699493,
0.012707269750535488,
-0.0029125947039574385,
0.02549646981060505,
-0.019679471850395203,
-0.00762763898819685,
-0.030805502086877823,
0.0006800150731578469,
0.07039385288953781,
-0.00442419433966279,
0.016336748376488686,
0.05328696593642235,
-0.026922043412923813,
-0.018237512558698654,
0.02316967025399208,
-0.0011009280569851398,
0.005690005607903004,
-0.027102287858724594,
0.029265226796269417,
-0.009815157391130924,
-0.02652878127992153,
-0.010765539482235909,
0.019335368648171425,
-0.004858421161770821,
0.029937049373984337,
0.030805502086877823,
-0.005497471429407597,
-0.0029638006817549467,
0.026250220835208893,
-0.0161073449999094,
-0.014370439574122429,
0.010241190902888775,
0.016336748376488686,
0.001849559135735035,
-0.016516992822289467,
0.043029386550188065,
-0.019663086161017418,
-0.05325419455766678,
-0.03598344698548317,
-0.011740501038730145,
0.03295205533504486,
0.06649400293827057,
-0.05066521838307381,
-0.02797074057161808,
-0.01647602766752243,
0.03142816573381424,
-0.0171232707798481,
0.016762781888246536,
-0.025152364745736122,
-0.02179325371980667,
-0.01206002663820982,
-0.0034287506714463234,
0.0060218204744160175,
0.012240271084010601,
-0.056170884519815445,
0.002920787548646331,
-0.035295240581035614,
0.012977637350559235,
0.03673719987273216,
0.01705772802233696,
-0.002205952536314726,
0.009528404101729393,
-0.029855119064450264,
0.03362387791275978,
0.009913472458720207,
-0.01776232197880745,
-0.03627839311957359,
-0.008139698766171932,
0.055318817496299744,
-0.045651134103536606,
0.03023199550807476,
0.013485600240528584,
0.009421895258128643,
-0.0026422273367643356,
-0.05063244700431824,
0.0063782138749957085,
0.010011788457632065,
0.012100990861654282,
-0.018204741179943085,
0.024496927857398987,
0.010069139301776886,
-0.010847469791769981,
0.03401713818311691,
0.049321576952934265,
-0.07786582410335541,
0.0005622413591481745,
0.052631527185440063,
-0.06308573484420776,
0.0307235736399889,
0.009487438946962357,
0.011224345304071903,
0.016795553267002106,
-0.052533213049173355,
0.09031911194324493,
-0.01361668761819601,
0.04103030636906624,
-0.05548267439007759,
0.016099151223897934,
0.07059048116207123,
0.08920487016439438,
0.06082447990775108,
-0.0008295364677906036,
0.017467375844717026,
-0.08232279121875763,
-0.04145634174346924,
-0.016164695844054222,
-0.003301759948953986,
0.07000058889389038,
-0.0060423025861382484,
0.0050837271846830845,
0.01720520108938217,
-0.04057150334119797,
0.0039059901610016823,
0.057580072432756424,
0.014862015843391418,
-0.025611169636249542,
0.014993103221058846,
-0.028445931151509285,
0.009962630458176136,
-0.022120973095297813,
0.025660328567028046,
-0.02472633123397827,
0.0005253730923868716,
0.02076094225049019,
-0.045683905482292175,
0.035295240581035614,
-0.022137358784675598,
-0.0006912804092280567
]
|
36,358 | statistics | _coerce | Coerce types T and S to a common type, or raise TypeError.
Coercion rules are currently an implementation detail. See the CoerceTest
test class in test_statistics for details.
| def _coerce(T, S):
"""Coerce types T and S to a common type, or raise TypeError.
Coercion rules are currently an implementation detail. See the CoerceTest
test class in test_statistics for details.
"""
# See http://bugs.python.org/issue24068.
assert T is not bool, "initial type T is bool"
# If the types are the same, no need to coerce anything. Put this
# first, so that the usual case (no coercion needed) happens as soon
# as possible.
if T is S: return T
# Mixed int & other coerce to the other type.
if S is int or S is bool: return T
if T is int: return S
# If one is a (strict) subclass of the other, coerce to the subclass.
if issubclass(S, T): return S
if issubclass(T, S): return T
# Ints coerce to the other type.
if issubclass(T, int): return S
if issubclass(S, int): return T
# Mixed fraction & float coerces to float (or float subclass).
if issubclass(T, Fraction) and issubclass(S, float):
return S
if issubclass(T, float) and issubclass(S, Fraction):
return T
# Any other combination is disallowed.
msg = "don't know how to coerce %s and %s"
raise TypeError(msg % (T.__name__, S.__name__))
| (T, S) | [
-0.01669488474726677,
0.005361365154385567,
-0.005460901185870171,
0.027037568390369415,
-0.0346565879881382,
0.024413440376520157,
-0.004687235690653324,
0.024594414979219437,
0.02231413684785366,
-0.007157535757869482,
0.0032394409645348787,
0.03570624068379402,
0.01376309897750616,
0.016794418916106224,
0.0013742740266025066,
0.005451852455735207,
-0.03858373314142227,
0.05266353487968445,
0.06486120820045471,
0.010505560785531998,
0.011030386202037334,
-0.01873084530234337,
-0.02924545481801033,
0.002246344229206443,
-0.0038728511426597834,
0.0390542633831501,
0.018658455461263657,
0.013527832925319672,
-0.04614846035838127,
0.03637584298849106,
-0.01020695362240076,
0.0030539422295987606,
-0.0028164132963865995,
0.032358214259147644,
-0.017246855422854424,
0.003375171683728695,
-0.044230129569768906,
0.03355264291167259,
-0.05762223154306412,
0.03825797885656357,
-0.11314516514539719,
-0.006343150977045298,
0.01412504818290472,
0.016821565106511116,
-0.0014953005593270063,
-0.032358214259147644,
-0.024956362321972847,
0.03861992806196213,
-0.05816515535116196,
-0.011799527332186699,
-0.016550105065107346,
-0.05563151463866234,
0.03416795656085014,
-0.009790712036192417,
0.00024332567409146577,
0.023997198790311813,
-0.00746519211679697,
0.05613824352622032,
-0.07926676422357559,
0.015274235047399998,
0.013021104969084263,
0.050528038293123245,
-0.012441986240446568,
-0.05472664535045624,
-0.013346858322620392,
-0.03988674655556679,
0.0014941694680601358,
-0.05693453177809715,
-0.040900204330682755,
0.005831898655742407,
-0.04763244837522507,
-0.01945474185049534,
-0.04100878909230232,
0.01512040663510561,
0.07108672708272934,
-0.00625718804076314,
0.01873084530234337,
0.06120552495121956,
0.013057298958301544,
0.03952479735016823,
0.026078402996063232,
0.0000036627866393246222,
-0.025861235335469246,
-0.005320645868778229,
-0.06283429265022278,
0.019852885976433754,
-0.02609650045633316,
0.05657258257269859,
0.04365101456642151,
-0.0027236640453338623,
0.019997665658593178,
-0.07861525565385818,
0.024431537836790085,
-0.06728626042604446,
0.019635716453194618,
0.07803613692522049,
-0.0020133396610617638,
-0.013835488818585873,
-0.013663563877344131,
-0.01445080153644085,
-0.042239412665367126,
0.03152573108673096,
-0.021626435220241547,
-0.050274673849344254,
-0.00020204090105835348,
-0.02329139970242977,
0.019472839310765266,
-0.009464958682656288,
-0.029571209102869034,
0.03507282957434654,
-0.06710528582334518,
-0.034873757511377335,
-0.08541989326477051,
-0.011310896836221218,
-0.05255495011806488,
-0.05479903146624565,
0.006867976393550634,
-0.014179340563714504,
-0.033444058150053024,
-0.013781196437776089,
-0.01426077913492918,
0.05715170130133629,
0.044049158692359924,
0.0213368758559227,
0.008668671362102032,
0.07032663375139236,
0.015382819809019566,
-0.004755101166665554,
-0.01417029183357954,
0.06471642851829529,
-0.010143612511456013,
-0.03644823282957077,
-0.02124638855457306,
0.05099857226014137,
-0.028955895453691483,
0.02582504041492939,
-0.10083890706300735,
0.015681426972150803,
0.022730378434062004,
-0.0439043790102005,
0.0351090244948864,
0.012776789255440235,
0.06464403867721558,
-0.007985493168234825,
-0.00016725988825783134,
0.05266353487968445,
0.012070989236235619,
-0.014912286773324013,
-0.03876470401883125,
0.08332058787345886,
-0.02106541395187378,
0.03610438108444214,
0.0723535418510437,
-0.028919700533151627,
-0.009736419655382633,
0.017002539709210396,
0.05128813162446022,
-0.06924078613519669,
0.022983742877840996,
-0.011229458265006542,
0.004619370214641094,
-0.029462624341249466,
-0.0030471556819975376,
-0.005397560074925423,
0.036683499813079834,
-0.010415073484182358,
-0.0004134132759645581,
-0.01836889609694481,
0.01071368157863617,
0.023961003869771957,
-0.00940161757171154,
0.019726203754544258,
0.025969820097088814,
0.0038457049522548914,
0.014658922329545021,
-0.009207069873809814,
-0.012369596399366856,
-0.028684435412287712,
0.010722730308771133,
0.006080738268792629,
0.012912520207464695,
-0.032539188861846924,
-0.04708952456712723,
0.03255728632211685,
0.02142736315727234,
0.06276190280914307,
-0.013446394354104996,
-0.006153128109872341,
-0.0029702414758503437,
0.00623456621542573,
0.02817770652472973,
0.010496512055397034,
-0.04122595861554146,
0.0027304505929350853,
0.0006735639180988073,
0.0029838145710527897,
-0.013735952787101269,
-0.014821799471974373,
0.020920634269714355,
0.08498555421829224,
-0.04951458051800728,
0.03807700425386429,
0.028865408152341843,
0.0073113637045025826,
0.007198254577815533,
-0.06540413200855255,
-0.04679996520280838,
0.008062407374382019,
0.009781663306057453,
-0.030367495492100716,
0.010614145547151566,
-0.04263755679130554,
-0.04155170917510986,
0.005754984449595213,
0.0289016030728817,
-0.056283023208379745,
0.05613824352622032,
-0.08556467294692993,
-0.013573076575994492,
0.027327127754688263,
0.056029658764600754,
-0.019382352009415627,
-0.02023293264210224,
0.08831547945737839,
0.04886307567358017,
0.016884906217455864,
-0.06138649955391884,
-0.0010236361995339394,
0.051794860512018204,
0.027580490335822105,
0.04006772115826607,
-0.007433521561324596,
0.0090849120169878,
0.02016054280102253,
0.02779765985906124,
-0.017409732565283775,
0.045496951788663864,
-0.006809160113334656,
-0.0429995059967041,
0.027689075097441673,
-0.02303803525865078,
-0.03472897782921791,
-0.0702180489897728,
0.0013652252964675426,
0.024431537836790085,
-0.06645378470420837,
0.027146153151988983,
0.010478414595127106,
-0.030819931998848915,
0.023146620020270348,
-0.01368166133761406,
-0.0502384789288044,
0.05248256027698517,
-0.08165562897920609,
0.00623456621542573,
-0.03861992806196213,
-0.05639160796999931,
-0.029806476086378098,
-0.020486297085881233,
-0.022296039387583733,
-0.011048483662307262,
0.06743104010820389,
0.03977816179394722,
0.04122595861554146,
-0.10409644991159439,
-0.08621618151664734,
-0.03147143870592117,
-0.003915832377970219,
0.014197438023984432,
0.05005750432610512,
0.015093260444700718,
-0.025354506447911263,
0.0029996498487889767,
0.023816224187612534,
-0.03894567862153053,
-0.006895122583955526,
0.03143524378538132,
0.021481655538082123,
0.0581289604306221,
-0.024630609899759293,
-0.03031320311129093,
0.03876470401883125,
-0.013600222766399384,
-0.04166029393672943,
-0.038149394094944,
-0.004171459004282951,
0.004637467674911022,
-0.05067281797528267,
-0.009026095271110535,
-0.011138970963656902,
0.027019470930099487,
-0.02358095720410347,
0.04640182480216026,
-0.006121457554399967,
-0.021644532680511475,
0.054400891065597534,
-0.03977816179394722,
-0.04191365838050842,
0.04032108560204506,
-0.08969088643789291,
0.00008843707473715767,
-0.026078402996063232,
-0.02023293264210224,
0.061422694474458694,
0.06449925899505615,
-0.03771505504846573,
-0.009537348523736,
-0.037208326160907745,
-0.014061707071959972,
0.09302081912755966,
0.013708806596696377,
-0.019382352009415627,
-0.03462039306759834,
0.03959718719124794,
0.044954027980566025,
0.038656122982501984,
0.04625704512000084,
-0.019382352009415627,
-0.02052249200642109,
0.040357280522584915,
-0.02611459791660309,
0.00240695895627141,
0.01943664439022541,
-0.026223182678222656,
-0.05393035709857941,
-0.01502087153494358,
-0.06232756748795509,
0.0006447211490012705,
0.019581424072384834,
0.05038325861096382,
-0.03286494314670563,
0.011618553660809994,
0.06348580121994019,
0.023816224187612534,
0.012215768918395042,
-0.024684902280569077,
0.006103360094130039,
0.014432704076170921,
0.009302081540226936,
0.0087772561237216,
0.05823754519224167,
0.02582504041492939,
0.03481946513056755,
-0.01853177323937416,
-0.02032341994345188,
0.05085379257798195,
-0.04379579424858093,
0.000896388606633991,
0.03912665322422981,
-0.018061239272356033,
-0.01891181990504265,
-0.05707931146025658,
-0.01454128883779049,
-0.02881111577153206,
-0.03058466501533985,
0.01997956819832325,
-0.023092327639460564,
-0.014315071515738964,
0.02727283537387848,
-0.07343938946723938,
0.04763244837522507,
-0.004221226554363966,
0.05309787392616272,
-0.001684192568063736,
-0.033697422593832016,
0.04546075686812401,
-0.009591640904545784,
-0.05624682828783989,
-0.027290932834148407,
0.012885374017059803,
0.015238040126860142,
0.027381420135498047,
-0.015238040126860142,
-0.0717744305729866,
-0.057260286062955856,
0.032249629497528076,
-0.029317844659090042,
0.03753408044576645,
-0.03121807612478733,
-0.03159812092781067,
-0.0009241002844646573,
-0.042782336473464966,
-0.052156805992126465,
0.028756823390722275,
0.013962171040475368,
-0.07854286581277847,
-0.015219942666590214,
0.018224116414785385,
0.03637584298849106,
0.0484287366271019,
-0.036574915051460266,
0.012432937510311604,
0.041081178933382034,
-0.0578032061457634,
-0.045858900994062424,
0.03764266520738602,
0.03880089893937111,
0.059974901378154755,
-0.039018068462610245,
-0.022802768275141716,
0.001684192568063736,
0.018694650381803513,
0.021029219031333923,
0.03277445584535599,
-0.039380017668008804,
0.08730202913284302,
0.024522025138139725,
-0.027743367478251457,
0.0029114249628037214,
0.0411897636950016,
0.0484287366271019,
0.012776789255440235,
0.0390542633831501,
-0.011437579058110714,
-0.03310021013021469,
-0.02466680482029915,
-0.058527104556560516,
0.023870516568422318,
0.01952713169157505,
0.009944540448486805,
0.025662163272500038,
-0.03628535568714142,
-0.0011497526429593563,
0.01350068673491478,
0.008514842949807644,
-0.013962171040475368,
0.042709946632385254,
0.0478496178984642,
-0.00852841604501009,
-0.0040538255125284195,
0.002370764035731554,
0.001988455653190613,
-0.023888614028692245,
-0.038149394094944,
0.001785990665666759,
0.016188155859708786,
-0.03311830759048462,
0.017753584310412407,
-0.015292332507669926,
0.01637817919254303,
0.012460083700716496,
-0.019074697047472,
-0.015961937606334686,
0.004151099361479282,
0.04578651115298271,
-0.05038325861096382,
0.01574476808309555,
0.01789836399257183,
-0.07514055073261261,
-0.031362853944301605,
0.03183338791131973,
-0.03570624068379402,
-0.007600922603160143,
0.030132228508591652,
0.005836423020809889,
0.02448583021759987,
-0.01412504818290472,
0.02555357851088047,
-0.03328118473291397,
0.019219476729631424,
-0.0201424453407526,
-0.03717213124036789,
-0.030349398031830788,
-0.05320645868778229,
-0.010605096817016602,
0.02825009636580944,
0.017102075740695,
-0.014342217706143856,
0.03825797885656357,
-0.006800111383199692,
0.033896494656801224,
-0.028032926842570305,
0.06395633518695831,
0.0014251730171963573,
-0.027417613193392754,
0.027309030294418335,
-0.0175545122474432,
-0.03822178393602371,
-0.016351033002138138,
0.02303803525865078,
0.0038502293173223734,
0.030439885333180428,
0.02169882506132126,
-0.020287225022912025,
-0.020468199625611305,
-0.02016054280102253,
0.0314895361661911,
0.03174290060997009,
0.013111591339111328,
0.057187896221876144,
0.05393035709857941,
0.031109491363167763,
-0.02906448021531105,
-0.033335477113723755,
-0.003311830572783947,
-0.018748942762613297,
-0.042963311076164246,
-0.015554745681583881,
0.0177807305008173,
0.018025046214461327,
0.05353221297264099,
-0.036393940448760986,
-0.03764266520738602,
0.03205055743455887,
0.03617677092552185,
0.0148398969322443,
-0.019744301214814186,
0.05639160796999931,
-0.010568901896476746,
0.018522724509239197,
-0.04372340440750122,
0.029915060847997665,
0.0213368758559227,
0.030439885333180428,
0.042420387268066406,
-0.0484287366271019,
0.00746519211679697,
-0.012360547669231892,
-0.005786655005067587,
-0.03507282957434654,
-0.034602295607328415,
-0.004402201157063246,
-0.06395633518695831,
0.029987450689077377,
-0.02052249200642109,
-0.010360781103372574,
-0.00625718804076314,
-0.005062757525593042,
0.02680230140686035,
-0.07789135724306107,
-0.041624099016189575,
-0.017617853358387947,
-0.03977816179394722,
0.030258910730481148,
-0.00848317239433527,
-0.02781575731933117,
0.000848882831633091,
0.03411366418004036,
0.06862547248601913,
-0.012387693859636784,
-0.007438045926392078,
0.038475148379802704,
0.035941507667303085,
0.0599387064576149,
0.0337517149746418,
-0.011102776043117046,
-0.02763478271663189,
-0.0022881943732500076,
-0.03250299394130707,
0.0008115568780340254,
-0.08498555421829224,
-0.019690008834004402,
0.03096471168100834,
0.07079716771841049,
-0.046293240040540695,
-0.05526956543326378,
-0.020214835181832314,
0.04527978226542473,
0.003372909501194954,
0.005031086970120668,
0.0011565391905605793,
-0.06109694018959999,
0.05067281797528267,
-0.06308765709400177,
-0.04321667551994324,
-0.02942642942070961,
0.015636183321475983,
0.042782336473464966,
0.016278643161058426,
-0.050093699246644974,
0.06605564057826996,
-0.005089903715997934,
-0.019183281809091568,
0.005736886989325285,
0.026440352201461792,
0.019382352009415627,
-0.04379579424858093,
-0.025589773431420326,
-0.006723197177052498,
0.011699991300702095,
-0.02005195803940296,
-0.001282655750401318,
-0.007288741879165173,
-0.005207536742091179,
0.05208441987633705,
0.0014817274641245604,
-0.016206253319978714,
0.025137336924672127,
-0.031272366642951965,
-0.011148019693791866,
0.009455909952521324,
0.026386059820652008,
0.030349398031830788,
-0.016522958874702454,
0.026585131883621216,
-0.035326194018125534,
0.037208326160907745,
0.02745380811393261,
0.022006481885910034,
-0.03840275853872299,
-0.06229137256741524,
-0.0006860059220343828,
0.0001384171046083793,
-0.04560553655028343,
0.0036488953046500683,
-0.014876091852784157,
-0.0125596197322011,
0.022169357165694237,
0.0049451240338385105,
-0.0633048266172409,
0.0638839453458786,
-0.01025219727307558,
0.04698093980550766,
-0.038656122982501984,
0.02329139970242977,
-0.0073973266407847404,
-0.04770483821630478,
-0.04759625345468521,
-0.04535217210650444,
-0.00831577181816101,
0.027689075097441673,
0.012351499870419502,
-0.033606935292482376,
0.0148398969322443,
-0.041081178933382034,
-0.0006102228653617203,
0.011591407470405102,
0.00172038737218827,
-0.022567501291632652,
-0.06855308264493942,
0.008062407374382019,
0.009098485112190247,
0.07586444914340973,
-0.02473919279873371,
-0.08491316437721252,
0.014767507091164589,
0.04813917726278305,
0.03141714632511139,
0.07586444914340973,
0.08614379167556763,
0.06276190280914307,
0.031978167593479156,
0.03069324977695942,
0.03214104473590851,
-0.0049722702242434025,
-0.07709507644176483,
0.004302665125578642,
-0.012288158759474754,
0.02727283537387848,
0.04379579424858093,
0.017020637169480324,
0.09063195437192917,
0.004768674261868,
-0.05838232487440109,
-0.03709974139928818,
0.03159812092781067,
0.04535217210650444,
-0.04517119750380516,
-0.007786421570926905,
0.014903238043189049,
-0.0015167912933975458,
0.034511808305978775,
0.016432471573352814,
0.04643801972270012,
0.059251002967357635,
0.022621793672442436,
-0.050093699246644974,
0.02068536914885044,
0.04379579424858093,
-0.04839254170656204,
0.0016163272084668279,
-0.03291923552751541,
-0.051613885909318924,
0.021626435220241547,
-0.04111737385392189,
-0.02187979966402054,
0.04614846035838127,
0.01571762189269066,
-0.036954961717128754,
-0.009184448048472404,
0.005017513874918222,
-0.013491638004779816,
-0.035398583859205246,
-0.009302081540226936,
-0.03988674655556679,
-0.08245191723108292,
0.03250299394130707,
0.006021921522915363,
-0.03709974139928818,
-0.04079161956906319,
0.059974901378154755,
-0.0008251299150288105,
-0.0049496483989059925,
-0.01803409308195114,
0.004549242556095123,
-0.02251320891082287,
-0.07847047597169876,
0.023363789543509483,
0.030982809141278267,
0.028738725930452347,
0.05353221297264099,
-0.04462827369570732,
-0.02591552771627903,
0.045677926391363144,
0.023056132718920708,
-0.03449371084570885,
-0.04050206020474434,
0.008899413980543613,
0.07695029675960541,
-0.04173268377780914,
-0.043687209486961365,
0.026060305535793304,
0.013292565941810608,
-0.019273769110441208,
-0.0420946329832077,
-0.03861992806196213,
0.038004614412784576,
0.03941621258854866,
-0.0217893123626709,
0.025336408987641335,
-0.004546980373561382,
-0.07231734693050385,
0.05802037566900253,
0.05320645868778229,
0.07535772025585175,
0.03655681759119034,
0.049550775438547134,
-0.015048016794025898,
0.01818792149424553,
-0.027851952239871025,
0.06797396391630173,
0.009962637908756733,
0.02204267494380474,
0.02428675815463066,
-0.017979802563786507,
0.02752619795501232,
0.013790245167911053,
0.02206077240407467,
-0.00032207780168391764,
0.01916518434882164,
-0.032539188861846924,
-0.04636562988162041,
0.010387927293777466,
-0.022169357165694237,
-0.06073499098420143,
0.003915832377970219,
0.06442686915397644,
0.042709946632385254,
0.00344077474437654,
0.013075396418571472,
0.013509735465049744,
-0.001970358192920685,
0.02168072760105133,
-0.027689075097441673,
0.07912198454141617,
-0.02385241910815239,
-0.05657258257269859,
-0.014459850266575813,
-0.005727838259190321,
0.01854987069964409,
0.014984676614403725,
-0.02942642942070961,
-0.043506234884262085,
0.0349823422729969,
0.008220760151743889,
0.008202662691473961,
0.009917394258081913,
0.08165562897920609
]
|
36,359 | statistics | _convert | Convert value to given numeric type T. | def _convert(value, T):
"""Convert value to given numeric type T."""
if type(value) is T:
# This covers the cases where T is Fraction, or where value is
# a NAN or INF (Decimal or float).
return value
if issubclass(T, int) and value.denominator != 1:
T = float
try:
# FIXME: what do we do if this overflows?
return T(value)
except TypeError:
if issubclass(T, Decimal):
return T(value.numerator) / T(value.denominator)
else:
raise
| (value, T) | [
0.019828034564852715,
-0.036155927926301956,
0.015558226965367794,
0.005030310247093439,
-0.007536302786320448,
0.02508741244673729,
0.02391458861529827,
-0.042514827102422714,
-0.005286865402013063,
-0.006867426913231611,
0.05028477683663368,
0.01249789260327816,
0.005836626049131155,
-0.04453061521053314,
0.023548081517219543,
0.02811109647154808,
-0.03522133454680443,
0.06828027963638306,
0.06069358065724373,
0.0010611526668071747,
0.001551928580738604,
-0.007884484715759754,
-0.001067452016286552,
-0.03282071277499199,
-0.017693130299448967,
-0.03533128648996353,
0.05142094939947128,
0.009313861839473248,
-0.0652749165892601,
0.01896674372255802,
-0.020909231156110764,
0.034213438630104065,
0.005470118951052427,
-0.0027419314719736576,
-0.012250500731170177,
0.02829434908926487,
-0.07388783246278763,
0.00702777411788702,
-0.10350161045789719,
0.016886815428733826,
-0.04390755295753479,
-0.018032150343060493,
-0.038923054933547974,
0.028789134696125984,
-0.017848895862698555,
-0.005630465690046549,
-0.01636454276740551,
-0.000901378458365798,
-0.02197210118174553,
0.02994363196194172,
-0.029540473595261574,
0.014431217685341835,
0.011352557688951492,
0.02287004515528679,
-0.03848324716091156,
0.04804908484220505,
-0.012617007829248905,
0.01786722242832184,
-0.028880760073661804,
0.026608416810631752,
0.016676073893904686,
0.06465185433626175,
-0.02820272371172905,
-0.028129421174526215,
-0.024885833263397217,
-0.002929766196757555,
0.022155355662107468,
0.011664088815450668,
-0.05512266978621483,
0.00752255879342556,
-0.053839895874261856,
-0.044640567153692245,
-0.05721176043152809,
-0.0014431218151003122,
0.06608123332262039,
0.023456456139683723,
0.030163535848259926,
0.04643645137548447,
0.00843882653862238,
0.03729210048913956,
0.048085734248161316,
0.01624542847275734,
0.043504394590854645,
-0.022430235520005226,
-0.0001244835730176419,
0.009391744621098042,
-0.04101214557886124,
0.03793348744511604,
0.033938560634851456,
0.04929520934820175,
-0.015979710966348648,
-0.1092924252152443,
-0.007087331265211105,
-0.014751911163330078,
-0.012644495815038681,
0.03457994759082794,
-0.004666093736886978,
-0.025582196190953255,
-0.035954348742961884,
-0.007279747631400824,
0.014513681642711163,
0.06003386527299881,
-0.022888369858264923,
-0.012039759196341038,
0.026351861655712128,
-0.04885539785027504,
0.06153654679656029,
0.022558514028787613,
0.03626587986946106,
0.050871189683675766,
-0.08664228022098541,
-0.033077266067266464,
-0.04771922528743744,
-0.04709616303443909,
-0.04016917943954468,
-0.04079224169254303,
-0.025105737149715424,
0.02583875134587288,
0.005263958591967821,
-0.01417466253042221,
-0.036522433161735535,
0.062232907861471176,
0.010546242818236351,
0.030291812494397163,
-0.04174515977501869,
0.03665071353316307,
0.061573196202516556,
-0.05230056494474411,
0.006510082632303238,
0.044493965804576874,
-0.0032000653445720673,
0.000814905681181699,
-0.014092198573052883,
0.03606430068612099,
0.017015093937516212,
0.03851989656686783,
-0.12512552738189697,
0.01462363451719284,
0.04027913138270378,
0.018481122329831123,
0.016199614852666855,
0.002851883415132761,
0.040389083325862885,
-0.04823233559727669,
0.10819289833307266,
0.04115875065326691,
0.04211166873574257,
0.036998894065618515,
-0.05607558786869049,
0.052410516887903214,
-0.07953204214572906,
0.03465324640274048,
0.11251768469810486,
-0.020102916285395622,
0.03245420381426811,
-0.0000886202760739252,
0.05596563592553139,
-0.0597040094435215,
0.03348042443394661,
-0.015631528571248055,
0.02649846486747265,
0.03452496975660324,
-0.006830776575952768,
-0.010729496367275715,
0.0007788276416249573,
-0.013762342743575573,
-0.033846933394670486,
0.01483437605202198,
-0.02928391844034195,
0.002812942024320364,
0.020854255184531212,
-0.0014121977146714926,
0.02547224424779415,
0.02910066582262516,
0.04016917943954468,
-0.05131099745631218,
0.01690514013171196,
0.013826481066644192,
-0.01075698435306549,
0.06798706948757172,
-0.016584446653723717,
-0.014229638502001762,
-0.029467172920703888,
0.027249803766608238,
0.00983155332505703,
0.0012152001727372408,
-0.008805333636701107,
-0.00688575254753232,
-0.03665071353316307,
-0.00198944634757936,
0.03943616524338722,
0.040682289749383926,
-0.024830857291817665,
0.012387940660119057,
0.01582394540309906,
-0.009235979057848454,
0.014770236797630787,
-0.002668629866093397,
0.03950946778059006,
0.0694897472858429,
-0.04016917943954468,
-0.0028106514364480972,
0.06780381500720978,
0.003204646520316601,
-0.007252259645611048,
-0.019974637776613235,
-0.024537650868296623,
0.011902318336069584,
-0.01705174334347248,
-0.010949400253593922,
-0.05233721807599068,
-0.007545465137809515,
-0.040535688400268555,
0.003561991034075618,
0.013258394785225391,
-0.02481253258883953,
0.03696224465966225,
-0.06747396290302277,
0.023218225687742233,
0.023694684728980064,
-0.002721315249800682,
-0.003884975565597415,
-0.02814774587750435,
0.021239086985588074,
0.04988161846995354,
0.0067116618156433105,
-0.03278406336903572,
0.008159364573657513,
0.0695997029542923,
0.035019755363464355,
0.057468317449092865,
-0.003060334362089634,
-0.0496983639895916,
0.030071908608078957,
0.020872579887509346,
-0.027341431006789207,
0.03870315104722977,
-0.02895406261086464,
-0.08378352969884872,
-0.01759234257042408,
-0.04885539785027504,
0.004666093736886978,
-0.04181846231222153,
0.04288133233785629,
-0.010518753901124,
-0.033700328320264816,
-0.001191148185171187,
0.0013618030352517962,
-0.04042573645710945,
0.05178745463490486,
-0.00610692473128438,
-0.017784757539629936,
0.06600793451070786,
-0.0332605205476284,
-0.027927841991186142,
-0.02631521038711071,
-0.02202707715332508,
-0.0330955944955349,
0.00579081242904067,
0.005667116492986679,
-0.031629566103219986,
-0.02604033052921295,
0.01876516453921795,
0.044493965804576874,
-0.0675472617149353,
-0.0676572173833847,
-0.015347485430538654,
-0.018783489242196083,
0.003532212460413575,
0.03687061741948128,
0.07689319550991058,
0.007435513194650412,
0.014889352023601532,
-0.03626587986946106,
0.00709649408236146,
-0.04126870259642601,
0.047132816165685654,
0.03767693042755127,
-0.009286373853683472,
-0.008182271383702755,
-0.036998894065618515,
-0.05673530325293541,
-0.036614060401916504,
-0.004902032669633627,
-0.07212860137224197,
0.0386665016412735,
0.024537650868296623,
-0.039362866431474686,
0.02913731522858143,
0.012946863658726215,
0.02343812957406044,
-0.009794902987778187,
-0.04911195486783981,
0.022705115377902985,
-0.0387764535844326,
-0.02023119293153286,
-0.06934314966201782,
-0.07344802469015121,
0.06029042229056358,
-0.001526731182821095,
-0.0007307235500775278,
-0.0017088394379243255,
-0.03278406336903572,
0.09118697047233582,
0.05908094719052315,
-0.004434735979884863,
0.04211166873574257,
-0.04804908484220505,
-0.04588669165968895,
0.04552018269896507,
-0.0037589885760098696,
-0.006148156709969044,
-0.05167750269174576,
0.011526648886501789,
0.07557376474142075,
-0.011774040758609772,
0.005167750176042318,
0.012800261378288269,
-0.017308298498392105,
0.0141288498416543,
-0.018114615231752396,
0.08429663628339767,
0.02325487695634365,
-0.030218511819839478,
-0.008819077163934708,
-0.0006826195167377591,
-0.037713583558797836,
0.03239922970533371,
-0.005502188112586737,
-0.007389699574559927,
-0.02867918275296688,
-0.001113265403546393,
0.05065128207206726,
-0.02079927921295166,
-0.02415281906723976,
-0.027927841991186142,
0.054206401109695435,
0.02329152822494507,
-0.02457430213689804,
0.02178884856402874,
0.01597054861485958,
0.022760091349482536,
0.012488730251789093,
-0.008988587185740471,
0.015979710966348648,
0.0399126261472702,
0.023841287940740585,
-0.03375530615448952,
0.06817032396793365,
-0.016923466697335243,
-0.05787147581577301,
-0.011086840182542801,
0.024262771010398865,
-0.000028364931495161727,
-0.02862420678138733,
-0.019021719694137573,
0.0049478462897241116,
-0.02778123877942562,
-0.0021864441223442554,
-0.06080353260040283,
0.030804922804236412,
0.051897406578063965,
0.03833664581179619,
-0.047792527824640274,
-0.01455033291131258,
0.024867508560419083,
-0.005525094922631979,
-0.06014381721615791,
0.026022005826234818,
0.019278274849057198,
0.05145759880542755,
0.023713011294603348,
-0.0051402621902525425,
-0.005877858027815819,
-0.01530167181044817,
0.004952427465468645,
-0.0025999099016189575,
0.04064564034342766,
-0.03285736218094826,
0.02858755551278591,
0.036339182406663895,
-0.009313861839473248,
-0.0287708081305027,
0.03027348779141903,
0.03793348744511604,
-0.05277702584862709,
0.0519707091152668,
-0.014321265742182732,
0.011380045674741268,
-0.018261216580867767,
-0.059777311980724335,
0.005822882056236267,
0.013075141236186028,
-0.0132767204195261,
-0.0011888574808835983,
0.03602765128016472,
-0.01648365706205368,
-0.0005832617171108723,
-0.013643227517604828,
0.0176839679479599,
-0.010051458142697811,
-0.01740908809006214,
0.024061191827058792,
0.06421204656362534,
-0.016556959599256516,
0.01618129014968872,
0.05046803131699562,
-0.00301910238340497,
0.015558226965367794,
0.009016075171530247,
0.00579081242904067,
-0.03881310299038887,
0.01313011720776558,
0.04060898721218109,
0.00854419730603695,
0.0029847424011677504,
-0.044164106249809265,
-0.025875402614474297,
-0.03714549541473389,
-0.0017832862213253975,
0.014440380036830902,
-0.005804556421935558,
-0.03269243612885475,
0.0409388467669487,
0.027854541316628456,
-0.03793348744511604,
0.08671558648347855,
0.02457430213689804,
-0.038739804178476334,
0.030530042946338654,
0.021110810339450836,
-0.03012688457965851,
-0.021660570055246353,
-0.04885539785027504,
0.03932621330022812,
0.017720619216561317,
-0.02999860793352127,
0.04181846231222153,
0.0023387735709547997,
0.023126598447561264,
0.019369902089238167,
0.044970422983169556,
-0.003697140607982874,
-0.02400621585547924,
0.0463998019695282,
-0.05842123553156853,
0.00932302512228489,
0.041708510369062424,
-0.045813389122486115,
-0.10203558206558228,
-0.008516709320247173,
-0.037566978484392166,
0.038886405527591705,
0.022998321801424026,
0.02924726903438568,
-0.013139280490577221,
-0.030951526015996933,
0.015869759023189545,
0.023456456139683723,
0.018096288666129112,
-0.03135468438267708,
0.0083151301369071,
-0.000936883850954473,
-0.0642486959695816,
0.02385961264371872,
0.016208777204155922,
0.04046238586306572,
0.00015490652003791183,
0.031208081170916557,
-0.02145899273455143,
0.0004756002454087138,
-0.003768151393160224,
0.02838597632944584,
0.0019470690749585629,
-0.01608966290950775,
0.01591557078063488,
0.015659017488360405,
-0.02352975681424141,
0.04262477904558182,
-0.013240070082247257,
0.011691576801240444,
0.0039995089173316956,
0.039875973016023636,
0.02221033163368702,
-0.040389083325862885,
0.05358334258198738,
0.015530738979578018,
0.041855111718177795,
0.028495928272604942,
0.021000858396291733,
-0.03155626356601715,
0.025783775374293327,
-0.00016421236796304584,
-0.033700328320264816,
-0.0431012362241745,
0.02004794031381607,
-0.02151396870613098,
-0.04049903526902199,
-0.01377150509506464,
0.013872294686734676,
0.0632224753499031,
-0.013249232433736324,
-0.05849453806877136,
-0.006450525484979153,
0.006844520568847656,
0.023749660700559616,
-0.0259853545576334,
0.0632224753499031,
-0.03714549541473389,
0.0052731214091181755,
-0.037566978484392166,
0.047279417514801025,
-0.0070598432794213295,
0.03225262463092804,
0.026351861655712128,
0.01026219967752695,
-0.020927555859088898,
-0.0254172682762146,
-0.011233443394303322,
-0.02013956569135189,
-0.029027363285422325,
0.003907882142812014,
-0.02395123988389969,
0.005832044407725334,
-0.024629278108477592,
-0.037420377135276794,
-0.0741443932056427,
0.0031725773587822914,
0.04955176264047623,
0.013991408981382847,
-0.005657953675836325,
-0.034268416464328766,
0.03296731412410736,
0.012891887687146664,
-0.03230760246515274,
-0.1264449506998062,
-0.0025632590986788273,
-0.03371865674853325,
0.026516789570450783,
-0.040389083325862885,
-0.050101522356271744,
0.013194256462156773,
0.04475051909685135,
0.01639203168451786,
0.05252046883106232,
-0.05182410776615143,
-0.011325069703161716,
0.022485211491584778,
-0.020872579887509346,
-0.020029613748192787,
0.00035476742777973413,
-0.06138994172215462,
0.014275452122092247,
0.04075559228658676,
-0.04174515977501869,
-0.001435104408301413,
-0.03283903747797012,
0.04141530394554138,
0.010033132508397102,
-0.04354104399681091,
-0.007412606384605169,
-0.05677195265889168,
0.03414013981819153,
-0.003933079540729523,
-0.03192276880145073,
-0.022192006930708885,
-0.017702294513583183,
0.03637583181262016,
0.04456726461648941,
-0.06992955505847931,
0.03714549541473389,
-0.0630025714635849,
0.05776152014732361,
-0.013624901883304119,
0.009249723516404629,
0.05475616455078125,
-0.0154666006565094,
-0.08473644405603409,
-0.01909502036869526,
-0.018985068425536156,
-0.05655204877257347,
-0.026370186358690262,
-0.010582893155515194,
-0.0014786272076889873,
0.02626023441553116,
-0.015145906247198582,
0.015054279938340187,
0.022998321801424026,
-0.002282652072608471,
0.013945596292614937,
0.015713993459939957,
-0.014513681642711163,
0.006844520568847656,
0.0027694194577634335,
0.0531068816781044,
-0.07421769201755524,
-0.03056669421494007,
0.012314639054238796,
0.011453347280621529,
0.013661553151905537,
-0.020102916285395622,
0.022760091349482536,
-0.0007627929444424808,
0.02028616890311241,
0.006409293040633202,
0.00762792956084013,
0.012864399701356888,
-0.05446295812726021,
0.015622366219758987,
-0.07102908194065094,
0.0796053484082222,
0.031116453930735588,
-0.01249789260327816,
0.0034337134566158056,
0.03381028026342392,
0.0018646050011739135,
-0.04240487515926361,
-0.0717620924115181,
-0.06351568549871445,
0.020304493606090546,
0.006116087548434734,
0.025215689092874527,
-0.05101779103279114,
0.03573444485664368,
0.019076695665717125,
-0.013734853826463223,
0.06281931698322296,
-0.06707080453634262,
-0.0342867411673069,
-0.04148860648274422,
0.012562031857669353,
0.0007610749453306198,
-0.024885833263397217,
0.01714337058365345,
-0.08231750130653381,
0.02646181359887123,
0.019828034564852715,
0.03560616821050644,
0.05717511102557182,
0.02895406261086464,
0.023804636672139168,
-0.0032504599075764418,
0.01146251056343317,
0.006844520568847656,
0.048745445907115936,
-0.07491405308246613,
-0.019937986508011818,
-0.0652749165892601,
0.004638605751097202,
0.08055826276540756,
0.03465324640274048,
0.03293066471815109,
0.020835930481553078,
-0.0166302602738142,
-0.01553990226238966,
0.056955207139253616,
0.024885833263397217,
-0.026956599205732346,
-0.04115875065326691,
0.07887233048677444,
-0.04570343717932701,
-0.02037779614329338,
0.004329365212470293,
0.05446295812726021,
0.06021711975336075,
-0.003145089140161872,
-0.06564142554998398,
0.018416982144117355,
-0.018416982144117355,
-0.07117567956447601,
0.0065009198151528835,
-0.027341431006789207,
-0.03089655004441738,
-0.0032321347389370203,
-0.05076123774051666,
-0.008507546968758106,
0.037713583558797836,
0.03069497086107731,
-0.014779399149119854,
0.0058549512177705765,
0.00037423812318593264,
0.01618129014968872,
-0.02352975681424141,
0.04024248197674751,
-0.016520308330655098,
-0.09741759300231934,
-0.016465332359075546,
0.01263533253222704,
-0.0038964287377893925,
0.008667893707752228,
0.006065692752599716,
0.004542397800832987,
-0.07297156751155853,
-0.01585143245756626,
-0.07421769201755524,
-0.0013400416355580091,
-0.062086306512355804,
0.012415428645908833,
0.023071622475981712,
0.020634351298213005,
0.03895970806479454,
-0.07297156751155853,
0.02900903858244419,
0.04181846231222153,
0.06622783839702606,
-0.06798706948757172,
-0.0017443448305130005,
-0.018930092453956604,
0.029650425538420677,
-0.06608123332262039,
-0.018856791779398918,
-0.016474494710564613,
-0.018664374947547913,
0.03399353474378586,
-0.02721315436065197,
0.0320143960416317,
-0.0033879000693559647,
0.06234285980463028,
-0.015814783051609993,
-0.00833345577120781,
0.04262477904558182,
-0.0820975974202156,
0.06351568549871445,
0.07091912627220154,
0.03107980452477932,
0.03782353550195694,
0.04181846231222153,
-0.014660284854471684,
-0.017583178356289864,
-0.011535811237990856,
-0.012928538955748081,
0.016162963584065437,
0.02338315360248089,
-0.035386260598897934,
0.005726673640310764,
-0.02074430324137211,
-0.01558571495115757,
0.013707365840673447,
-0.023328177630901337,
-0.025197364389896393,
-0.03177616745233536,
-0.05398649722337723,
-0.046106595546007156,
-0.010078946128487587,
-0.02626023441553116,
-0.05226391553878784,
0.07212860137224197,
0.03529463708400726,
0.011160141788423061,
0.028129421174526215,
0.018746839836239815,
-0.06762056052684784,
-0.016602773219347,
0.007701230701059103,
0.10452783107757568,
-0.03348042443394661,
0.0007547755958512425,
-0.005740417633205652,
0.002746512647718191,
0.011920643970370293,
0.018985068425536156,
-0.028001144528388977,
-0.0006740295211784542,
0.010069782845675945,
-0.021330714225769043,
-0.024885833263397217,
0.006510082632303238,
0.038739804178476334
]
|
36,360 | statistics | _exact_ratio | Return Real number x to exact (numerator, denominator) pair.
>>> _exact_ratio(0.25)
(1, 4)
x is expected to be an int, Fraction, Decimal or float.
| def _exact_ratio(x):
"""Return Real number x to exact (numerator, denominator) pair.
>>> _exact_ratio(0.25)
(1, 4)
x is expected to be an int, Fraction, Decimal or float.
"""
try:
return x.as_integer_ratio()
except AttributeError:
pass
except (OverflowError, ValueError):
# float NAN or INF.
assert not _isfinite(x)
return (x, None)
try:
# x may be an Integral ABC.
return (x.numerator, x.denominator)
except AttributeError:
msg = f"can't convert type '{type(x).__name__}' to numerator/denominator"
raise TypeError(msg)
| (x) | [
0.03452116623520851,
-0.043169550597667694,
0.02873145416378975,
0.03213290870189667,
0.06484479457139969,
-0.014501423574984074,
0.06589417904615402,
-0.061009105294942856,
-0.0010358159197494388,
0.05102185159921646,
0.05579836294054985,
0.018744196742773056,
0.014139565639197826,
0.029726561158895493,
-0.007020027842372656,
-0.06451912224292755,
-0.0008107860339805484,
0.03774169459939003,
-0.017070608213543892,
0.051926493644714355,
0.01664542593061924,
0.0724799782037735,
-0.026560310274362564,
0.013768662698566914,
-0.01821950450539589,
0.0004280091088730842,
0.055002279579639435,
0.004174926318228245,
0.015623180195689201,
0.008485549129545689,
0.0023656408302485943,
0.04186686500906944,
-0.014609980396926403,
0.012493115849792957,
-0.06198612228035927,
0.013035901822149754,
-0.013081134296953678,
0.038284480571746826,
-0.12194584310054779,
0.002738805953413248,
-0.03799499571323395,
0.01968502625823021,
0.002077285898849368,
0.02087915502488613,
-0.04534069448709488,
0.01119947712868452,
0.03788643702864647,
-0.01743246614933014,
-0.04689668118953705,
-0.0008611067896708846,
0.02433488890528679,
-0.004781037103384733,
-0.04968297854065895,
0.03345368802547455,
-0.012592626735568047,
0.02578231878578663,
-0.026578404009342194,
0.055255576968193054,
0.005812329705804586,
-0.0041296943090856075,
0.035534366965293884,
0.012402651831507683,
-0.009372098371386528,
-0.06238416209816933,
0.0008893769118003547,
0.0036253558937460184,
0.005889224354177713,
0.012438837438821793,
-0.04349522292613983,
-0.01425716932862997,
-0.05905507877469063,
-0.0019178426591679454,
-0.022181840613484383,
-0.02733830362558365,
0.0394786074757576,
0.06260127574205399,
0.04924875125288963,
0.06169663369655609,
0.056522078812122345,
0.01669970527291298,
0.036891330033540726,
0.02417205460369587,
0.042735323309898376,
-0.05156463757157326,
-0.08539827167987823,
-0.023611174896359444,
-0.01807476207613945,
-0.03658375144004822,
0.023593083024024963,
0.01820141263306141,
-0.0630355030298233,
-0.03737983852624893,
-0.0055635529570281506,
0.009132368490099907,
-0.007531150709837675,
0.044218938797712326,
-0.02840578183531761,
-0.032169096171855927,
0.00007809611270204186,
-0.004658909980207682,
-0.08474693447351456,
0.06893377751111984,
-0.06614747643470764,
-0.00015590952534694225,
-0.0067034028470516205,
-0.02281508967280388,
0.06129859387874603,
-0.026071803644299507,
0.010367205366492271,
0.04490646719932556,
-0.05749909207224846,
0.000015628056644345634,
-0.048959266394376755,
0.053410109132528305,
0.017531976103782654,
-0.025239532813429832,
-0.04939349368214607,
0.034141216427087784,
0.032169096171855927,
-0.03292899578809738,
-0.01140754483640194,
0.06647314876317978,
-0.05843992158770561,
0.056630633771419525,
0.0812007337808609,
-0.01422098372131586,
0.018744196742773056,
-0.018101900815963745,
-0.06640077382326126,
0.06028539314866066,
0.03799499571323395,
0.01741437241435051,
-0.029672281816601753,
0.003892225446179509,
-0.007341175805777311,
0.11304415762424469,
-0.02134956791996956,
0.02129529044032097,
0.06524283438920975,
-0.0009894530521705747,
-0.03562483191490173,
0.00714667746797204,
0.0120046092197299,
0.004731281660497189,
0.04537687823176384,
0.023357875645160675,
0.02131338231265545,
0.027754439041018486,
-0.006097292061895132,
0.04389326646924019,
0.00721452571451664,
0.017613394185900688,
0.11724169552326202,
-0.030034139752388,
-0.004921256564557552,
-0.05778857693076134,
0.00020085896539967507,
0.006314406171441078,
0.006499858107417822,
0.015297508798539639,
0.005283113569021225,
0.0006287267315201461,
0.06839098781347275,
-0.038356851786375046,
0.03294708952307701,
-0.00489864032715559,
-0.050623808056116104,
-0.06231179088354111,
0.03491920977830887,
-0.02106008306145668,
0.005328345578163862,
0.00982442032545805,
-0.06064724922180176,
-0.04168593883514404,
0.008458409458398819,
-0.0039397189393639565,
-0.02267034724354744,
-0.005210742354393005,
0.013081134296953678,
0.007508534938097,
0.0838061049580574,
-0.09372098743915558,
-0.0037972379941493273,
0.03043218143284321,
0.024986231699585915,
0.021620960906147957,
0.01982976868748665,
0.004649863578379154,
-0.009408284910023212,
-0.008815743960440159,
0.05702867731451988,
0.011099966242909431,
-0.03352605924010277,
-0.022000910714268684,
-0.0038763941265642643,
-0.031210174784064293,
0.014935651794075966,
-0.06444674730300903,
0.055255576968193054,
0.023755919188261032,
-0.05398907884955406,
-0.06585799157619476,
0.000140360978548415,
0.047765135765075684,
-0.03312801569700241,
-0.008399607613682747,
-0.026325102895498276,
-0.03817592188715935,
0.007531150709837675,
-0.008128214627504349,
-0.03763313964009285,
0.026813611388206482,
-0.09278015792369843,
-0.021874262019991875,
-0.05315680801868439,
0.03813973814249039,
0.04563017934560776,
-0.030938781797885895,
0.037198908627033234,
-0.008318189531564713,
0.029002847149968147,
-0.0026257254648953676,
0.010647645220160484,
0.025764225050807,
0.03008841723203659,
-0.01206793449819088,
-0.01944981887936592,
0.038248296827077866,
-0.01214935164898634,
-0.020155441015958786,
0.023448340594768524,
0.014067194424569607,
0.006210372317582369,
-0.04215634986758232,
-0.018997497856616974,
-0.060068279504776,
-0.005450472701340914,
0.023755919188261032,
0.0022084591910243034,
-0.026831703260540962,
-0.002770468359813094,
0.026506032794713974,
-0.029057124629616737,
-0.003035076428204775,
0.004593323450535536,
-0.08033227175474167,
-0.0243710745126009,
0.005979688372462988,
-0.025130975991487503,
-0.028080111369490623,
-0.0242806114256382,
-0.008245818316936493,
0.02565566822886467,
-0.05268639326095581,
0.020282089710235596,
0.03149966150522232,
-0.06940419226884842,
0.031210174784064293,
0.018943218514323235,
-0.0027501138392835855,
0.008218679577112198,
0.05388052016496658,
0.026831703260540962,
-0.010855712927877903,
-0.030450275167822838,
-0.006594845559448004,
-0.04798224940896034,
0.009842513129115105,
0.03520869463682175,
0.03781406581401825,
0.028025832027196884,
0.008974055759608746,
0.028062017634510994,
-0.035262975841760635,
-0.01196842361241579,
0.002047884976491332,
0.06506190448999405,
0.028170574456453323,
0.04772895202040672,
0.023810196667909622,
-0.06513427942991257,
-0.04161356762051582,
0.05246927961707115,
0.019847862422466278,
0.0023034466430544853,
0.04099841043353081,
0.025130975991487503,
-0.04396563768386841,
0.009281634353101254,
0.035534366965293884,
-0.0007604652782902122,
0.0035167986061424017,
-0.06716067343950272,
0.036855146288871765,
-0.03189770132303238,
0.03944242373108864,
-0.004186234436929226,
-0.0704173892736435,
0.03660184517502785,
0.03564292564988136,
-0.020607762038707733,
0.02694026008248329,
0.017043469473719597,
0.044472236186265945,
0.0007627269369550049,
0.021801890805363655,
0.025130975991487503,
-0.02243513986468315,
-0.012312187813222408,
0.012755462899804115,
0.00320243532769382,
0.024389168247580528,
-0.020625853911042213,
0.021367661654949188,
0.028188668191432953,
-0.0025782317388802767,
0.005531890317797661,
0.06176900491118431,
-0.05301206558942795,
-0.012393605895340443,
-0.012294095009565353,
0.11405735462903976,
-0.0003677938075270504,
0.06039394810795784,
-0.0067622046917676926,
0.016138825565576553,
-0.016138825565576553,
0.04060036689043045,
0.0010273349471390247,
0.04678812250494957,
-0.032386209815740585,
-0.002632510382682085,
-0.028134388849139214,
0.01509848702698946,
-0.030794039368629456,
-0.0004330977099016309,
0.04186686500906944,
0.0037158201448619366,
0.030703574419021606,
0.046064406633377075,
0.005789713468402624,
-0.04385707899928093,
0.012131258845329285,
-0.03410503268241882,
-0.035371530801057816,
-0.005482134874910116,
-0.006766727659851313,
-0.03609524667263031,
0.04639007896184921,
-0.07649659365415573,
-0.06574943661689758,
-0.055110834538936615,
0.026053711771965027,
-0.05388052016496658,
-0.01950409822165966,
0.006508904509246349,
-0.026379382237792015,
-0.007761834654957056,
-0.023321690037846565,
0.05438712239265442,
0.03202435374259949,
0.027464954182505608,
-0.04349522292613983,
-0.03803117945790291,
-0.03781406581401825,
0.021657146513462067,
-0.026017524302005768,
-0.0026076326612383127,
0.0028541479259729385,
0.034267865121364594,
-0.03734365105628967,
0.024552004411816597,
-0.06980223208665848,
-0.029020939022302628,
0.009059997275471687,
0.05923600494861603,
0.058331362903118134,
0.011498008854687214,
0.015415112487971783,
0.004249559249728918,
0.028912382200360298,
-0.06929563730955124,
0.018508991226553917,
-0.0014067194424569607,
-0.06697975099086761,
-0.02404540404677391,
0.026650775223970413,
-0.006015874445438385,
-0.012194584123790264,
0.02397303283214569,
-0.005943502765148878,
-0.028242945671081543,
-0.007255234755575657,
-0.018300922587513924,
-0.06390396505594254,
0.007712079212069511,
0.03589622303843498,
-0.016636379063129425,
-0.04700523614883423,
-0.012484069913625717,
0.014239076524972916,
0.017667673528194427,
-0.017694812268018723,
-0.009005718864500523,
0.03227765113115311,
0.0732036903500557,
0.04483409598469734,
0.026506032794713974,
0.04049180820584297,
-0.06716067343950272,
-0.007657800801098347,
-0.023683546110987663,
0.021693332120776176,
0.06730542331933975,
0.015478436835110188,
0.018508991226553917,
0.000793258601333946,
-0.033996473997831345,
-0.06922326236963272,
0.003245405852794647,
0.016763029620051384,
-0.013225876726210117,
-0.050370506942272186,
0.04570255056023598,
0.01567745953798294,
-0.006346068810671568,
0.06035776436328888,
0.017106793820858,
0.04794606566429138,
0.04483409598469734,
-0.03495539724826813,
0.02268843911588192,
-0.05912744998931885,
-0.06028539314866066,
0.02719356119632721,
-0.01963074691593647,
0.020680133253335953,
0.08214156329631805,
-0.021693332120776176,
0.01425716932862997,
-0.004127432592213154,
0.07077924907207489,
-0.004704142455011606,
-0.03737983852624893,
0.017839554697275162,
-0.03766932338476181,
0.03799499571323395,
0.01062955241650343,
0.010783341713249683,
-0.05482134968042374,
-0.008897161111235619,
-0.07591761648654938,
0.016256429255008698,
-0.041360266506671906,
-0.0003839077544398606,
-0.04570255056023598,
-0.011534195393323898,
-0.008603152818977833,
-0.009435423649847507,
-0.01122661679983139,
-0.0002335109020350501,
0.003666064701974392,
-0.0019789061043411493,
-0.07258853316307068,
-0.032530952244997025,
-0.0005416548228822649,
0.020680133253335953,
0.016799215227365494,
0.003804022679105401,
-0.020354460924863815,
0.02712118998169899,
0.07342080771923065,
-0.0018296398920938373,
0.009408284910023212,
0.015315601602196693,
0.027356397360563278,
0.0301246028393507,
-0.0011907359585165977,
0.03363461792469025,
-0.038465410470962524,
-0.007409024052321911,
0.03640282526612282,
0.006662693805992603,
-0.011588473804295063,
-0.0032702835742384195,
-0.006359638646245003,
-0.07067069411277771,
0.023249318823218346,
-0.0303959958255291,
-0.022091375663876534,
-0.0038424700032919645,
0.05127514898777008,
-0.034086938947439194,
0.004294791258871555,
-0.038501594215631485,
-0.011543241329491138,
-0.015243230387568474,
-0.005102185066789389,
0.017920972779393196,
0.004041491542011499,
0.050370506942272186,
-0.10486618429422379,
-0.023249318823218346,
0.035570550709962845,
0.00872527901083231,
0.06922326236963272,
-0.04335048049688339,
0.01137135922908783,
0.026144174858927727,
0.017975252121686935,
-0.04848885163664818,
0.0286409892141819,
-0.017133932560682297,
0.013063041493296623,
0.02889428846538067,
-0.014763769693672657,
0.03164440393447876,
-0.058331362903118134,
-0.01050290185958147,
-0.04237346723675728,
-0.01803857646882534,
0.030884502455592155,
-0.0013320863945409656,
0.013560594990849495,
-0.021819982677698135,
-0.0008667608490213752,
-0.0686081051826477,
-0.026795517653226852,
0.011280895210802555,
-0.020625853911042213,
-0.00640487065538764,
-0.042988624423742294,
-0.0013128627324476838,
0.0017753613647073507,
-0.044653166085481644,
0.020372554659843445,
-0.03126445412635803,
0.002001522108912468,
0.04389326646924019,
0.0391167514026165,
-0.02728402428328991,
-0.020680133253335953,
-0.023032203316688538,
0.014863280579447746,
0.07439781725406647,
-0.04530450701713562,
0.03312801569700241,
0.05322917923331261,
-0.009851559065282345,
-0.01365105900913477,
0.02581850439310074,
-0.06954893469810486,
0.041432637721300125,
-0.032169096171855927,
-0.04660719260573387,
0.003957812208682299,
-0.00217227335087955,
0.012257909402251244,
0.00023492441687267274,
-0.06227560713887215,
0.0240092184394598,
-0.04537687823176384,
0.06705211848020554,
0.009733956307172775,
-0.01946791261434555,
-0.06057487800717354,
0.05739053711295128,
0.04852503538131714,
0.03358033671975136,
0.008865498937666416,
-0.017224397510290146,
0.035371530801057816,
0.08221393078565598,
0.011597519740462303,
-0.005825899075716734,
-0.03868252411484718,
-0.026361288502812386,
-0.05000865086913109,
-0.04816317930817604,
-0.011995562352240086,
-0.006531520746648312,
-0.04367615282535553,
-0.018617548048496246,
-0.009643491357564926,
-0.011823680251836777,
-0.011353266425430775,
0.03309183195233345,
0.036692310124635696,
0.002300054067745805,
0.008806697092950344,
-0.04827173799276352,
-0.007485918700695038,
0.032585229724645615,
0.005902793724089861,
0.04023851081728935,
-0.010014395229518414,
-0.04125170782208443,
-0.008033227175474167,
0.024642467498779297,
-0.06086436286568642,
0.02093343250453472,
0.04031088203191757,
-0.020064976066350937,
-0.0005925410077907145,
-0.009715862572193146,
0.017694812268018723,
0.012927345000207424,
-0.03918912261724472,
-0.009670631028711796,
-0.041577380150556564,
0.015170859172940254,
0.033906009048223495,
-0.0033042076975107193,
-0.0003101228503510356,
0.0019845599308609962,
0.0049031637609004974,
-0.05760765075683594,
0.03019697405397892,
-0.09335912764072418,
0.05634114891290665,
-0.021874262019991875,
0.023701639845967293,
-0.012520255520939827,
0.008232248947024345,
-0.003478351281955838,
0.03774169459939003,
0.02706691063940525,
-0.0422649085521698,
0.01273737009614706,
-0.04378470778465271,
0.06035776436328888,
0.007725649047642946,
-0.0178938340395689,
-0.018300922587513924,
-0.009842513129115105,
0.02855052426457405,
0.009923931211233139,
-0.012719277292490005,
-0.0197393037378788,
0.10175421833992004,
0.025203347206115723,
-0.014935651794075966,
-0.0056585404090583324,
0.03748839348554611,
0.08445744961500168,
-0.01730581559240818,
-0.06281839311122894,
-0.06719686090946198,
-0.019124148413538933,
-0.02281508967280388,
-0.0028586711268872023,
0.027573511004447937,
0.0286409892141819,
-0.01574983075261116,
0.006563182920217514,
0.010475763119757175,
-0.003512275405228138,
-0.05753527954220772,
-0.061009105294942856,
0.051781751215457916,
-0.03171677514910698,
0.009240925312042236,
-0.01941363327205181,
0.04982772096991539,
0.038248296827077866,
0.041577380150556564,
-0.07541102170944214,
-0.03220527991652489,
-0.0745425596833229,
-0.04664338007569313,
0.05268639326095581,
0.044472236186265945,
0.03343559429049492,
0.011724170297384262,
-0.026759332045912743,
0.01281878724694252,
0.005798759870231152,
0.016998236998915672,
-0.026433661580085754,
-0.011063780635595322,
0.008661954663693905,
-0.03131873160600662,
-0.00805584341287613,
-0.04251820966601372,
-0.0034014566335827112,
-0.09068138897418976,
-0.03444879502058029,
0.009408284910023212,
-0.014582840725779533,
0.0197393037378788,
-0.009987255558371544,
-0.00784777570515871,
-0.012375513091683388,
-0.0480184368789196,
-0.016600193455815315,
-0.038537781685590744,
-0.04935730621218681,
0.084891676902771,
0.02706691063940525,
-0.020698225125670433,
0.022000910714268684,
-0.063216432929039,
0.026053711771965027,
0.032567139714956284,
0.02701263129711151,
0.0035823851358145475,
0.00393745768815279,
0.02120482549071312,
-0.014130519703030586,
-0.05301206558942795,
-0.03135491907596588,
0.011190430261194706,
-0.05000865086913109,
-0.027754439041018486,
0.026759332045912743,
0.05865703523159027,
0.049140192568302155,
0.031192081049084663,
-0.043024808168411255,
0.018726104870438576,
-0.0452321358025074,
-0.04479790851473808,
0.07570050656795502,
0.02419014647603035,
-0.00717381713911891,
0.05554506555199623,
0.07190100848674774,
0.01748674362897873,
-0.01961265504360199,
0.0032838531769812107,
0.00011088941391790286,
0.050261951982975006,
-0.03785025328397751,
-0.0062601277604699135,
0.015478436835110188,
-0.01066573802381754,
-0.00015025550965219736,
-0.059634048491716385,
0.023737825453281403,
-0.005803283303976059,
0.02281508967280388,
-0.04349522292613983,
0.02241704799234867,
-0.04787369444966316,
-0.00030870933551341295,
-0.019902139902114868,
0.018870847299695015,
0.0704173892736435,
-0.03654756769537926,
-0.026596495881676674,
0.016364987939596176,
-0.023176947608590126,
0.026307011023163795,
-0.012646905146539211,
0.013877219520509243,
-0.023195039480924606,
-0.011751309037208557,
0.026632681488990784,
0.03430405259132385,
0.027446860447525978,
0.0005970642087049782,
0.0017007283167913556,
0.03213290870189667,
0.019250797107815742,
-0.05232453718781471,
-0.02133147604763508,
0.004557137843221426,
0.04975534975528717
]
|
36,361 | statistics | _fail_neg | Iterate over values, failing if any are less than zero. | def _fail_neg(values, errmsg='negative value'):
"""Iterate over values, failing if any are less than zero."""
for x in values:
if x < 0:
raise StatisticsError(errmsg)
yield x
| (values, errmsg='negative value') | [
0.04549821466207504,
-0.010158071294426918,
0.0041977521032094955,
0.020262865349650383,
-0.016027376055717468,
-0.01817619986832142,
-0.004271007142961025,
0.005993617232888937,
0.0826142430305481,
-0.013150440528988838,
-0.033990468829870224,
0.07121305167675018,
0.048765845596790314,
-0.04631512239575386,
-0.04983137920498848,
0.08133560419082642,
-0.016027376055717468,
0.0640384703874588,
0.04777134954929352,
0.0215770211070776,
-0.007383248303085566,
0.011960595846176147,
-0.05398695170879364,
0.004073439631611109,
-0.027295377105474472,
0.02498672343790531,
-0.011800765991210938,
-0.004477453883737326,
0.021843405440449715,
-0.024329645559191704,
-0.04592442885041237,
0.0003704388509504497,
-0.0042044115252792835,
-0.021843405440449715,
0.00978513527661562,
-0.019374921917915344,
-0.06517503410577774,
0.00985617097467184,
-0.07188788801431656,
0.01130351796746254,
0.038927432149648666,
-0.017785504460334778,
0.017137305811047554,
0.026549505069851875,
-0.016595659777522087,
-0.015352539718151093,
0.013345787301659584,
-0.015698837116360664,
-0.047948937863111496,
-0.033102527260780334,
-0.014873050153255463,
0.044361647218465805,
0.05142967402935028,
0.02068907953798771,
-0.007329971995204687,
0.1020069271326065,
0.00022975532920099795,
0.009128057397902012,
-0.004324283916503191,
-0.020014241337776184,
-0.0240277461707592,
0.006366553250700235,
-0.031273361295461655,
-0.01385191548615694,
0.040774356573820114,
-0.004217730835080147,
-0.018948709592223167,
-0.06893991678953171,
-0.0008280071197077632,
0.042372655123472214,
-0.0023419505450874567,
-0.013727603480219841,
-0.012884057126939297,
0.06311500817537308,
0.03935364633798599,
-0.02244720607995987,
-0.017892057076096535,
0.027597278356552124,
-0.010024880059063435,
-0.07366377860307693,
-0.0011443368857726455,
0.022482724860310555,
0.030243348330259323,
0.0005668962839990854,
-0.021825646981596947,
-0.01861129142343998,
0.04311852529644966,
-0.011392312124371529,
0.03818156197667122,
0.10690837353467941,
-0.01907302252948284,
0.01194283738732338,
0.032072510570287704,
-0.05260176211595535,
0.011196965351700783,
0.1103891134262085,
-0.031184569001197815,
-0.006601858418434858,
-0.02868056856095791,
-0.030687320977449417,
0.11188085377216339,
0.0730244591832161,
0.0774286538362503,
-0.002088886685669422,
0.03145094960927963,
-0.028130043298006058,
0.0335642546415329,
-0.07046718150377274,
0.07828108221292496,
0.025182072073221207,
-0.054342128336429596,
-0.007436525076627731,
-0.0042843264527618885,
-0.03910502418875694,
-0.077925905585289,
-0.03132664039731026,
0.020298384130001068,
0.016249362379312515,
-0.025270866230130196,
0.006379872560501099,
0.029834894463419914,
0.0020311702974140644,
-0.012528879567980766,
0.02658502198755741,
0.02660278044641018,
0.0022686950396746397,
0.005722794681787491,
-0.010708595626056194,
-0.003409702330827713,
0.042195066809654236,
0.004595106467604637,
-0.038536738604307175,
0.038856398314237595,
0.012404567562043667,
-0.03985089436173439,
-0.03718706592917442,
0.042124029248952866,
0.011614298447966576,
0.04503648355603218,
-0.05661526322364807,
0.028929192572832108,
-0.03244544938206673,
-0.024098780006170273,
0.06830059736967087,
0.049085505306720734,
0.02450723573565483,
-0.0453561432659626,
0.06684437394142151,
0.058746326714754105,
0.012946213595569134,
-0.01381639763712883,
0.038927432149648666,
0.013949588872492313,
0.01210266724228859,
0.03594394400715828,
-0.009243489243090153,
0.003365305019542575,
-0.009252369403839111,
-0.04574683681130409,
-0.02340618520975113,
0.003070063889026642,
0.004226610064506531,
0.02418757602572441,
0.04223058372735977,
0.00629107840359211,
-0.008968227542936802,
-0.05800045654177666,
0.03839466720819473,
-0.014349163509905338,
0.02244720607995987,
0.019747858867049217,
-0.04542717710137367,
-0.013727603480219841,
0.0034008228685706854,
-0.007609673775732517,
-0.02804124914109707,
-0.005434212740510702,
0.03216130658984184,
-0.015698837116360664,
0.019197333604097366,
-0.007760624401271343,
0.017270496115088463,
-0.05309901013970375,
-0.009190212935209274,
0.011880680918693542,
-0.020511489361524582,
-0.01608065329492092,
-0.010513248853385448,
-0.033582016825675964,
-0.015245986171066761,
-0.016684453934431076,
-0.00793377310037613,
0.01593858189880848,
0.025288624688982964,
0.009474354796111584,
-0.011614298447966576,
-0.015885304659605026,
0.028396425768733025,
0.048446185886859894,
-0.031042497605085373,
-0.06172981858253479,
-0.009918326511979103,
0.025768114253878593,
-0.04194644093513489,
-0.005816028453409672,
0.0029390922281891108,
-0.0512520857155323,
-0.0367608517408371,
-0.03539342060685158,
0.016276000067591667,
-0.02836090885102749,
0.023441702127456665,
0.002630532020702958,
0.0501510389149189,
0.017190581187605858,
0.029888171702623367,
0.04933412745594978,
-0.043083008378744125,
-0.05054173246026039,
0.016977475956082344,
0.02418757602572441,
-0.08083835989236832,
0.011667574755847454,
-0.03050973080098629,
0.09184885770082474,
0.036139290779829025,
0.05693492293357849,
-0.05711251124739647,
-0.013665447011590004,
0.09753169119358063,
-0.02012079581618309,
0.035588767379522324,
-0.025821391493082047,
-0.02708227001130581,
-0.027100028470158577,
0.00896378792822361,
0.003607269609346986,
0.006717291194945574,
-0.007165702525526285,
0.009900568053126335,
-0.057538725435733795,
-0.010388936847448349,
-0.049795858561992645,
0.023512737825512886,
0.04610201716423035,
-0.038607772439718246,
-0.017004113644361496,
0.04706099256873131,
-0.02795245498418808,
0.059065986424684525,
0.02386791631579399,
-0.03189492225646973,
-0.0383591502904892,
-0.02235841192305088,
0.05455523729324341,
-0.10548765957355499,
-0.03843018412590027,
-0.062404654920101166,
0.05668630078434944,
-0.026727093383669853,
0.019588029012084007,
-0.00581158883869648,
-0.061054982244968414,
0.029923688620328903,
-0.039566751569509506,
-0.003900290932506323,
-0.006557461339980364,
-0.014873050153255463,
0.06947268545627594,
0.08325356245040894,
0.04478786140680313,
-0.022305134683847427,
-0.041022978723049164,
-0.0019723440054804087,
0.0075475177727639675,
0.12892936170101166,
0.02676261030137539,
-0.025359660387039185,
0.0010705266613513231,
0.03164630010724068,
0.04137815907597542,
0.024134298786520958,
-0.025430696085095406,
0.016799887642264366,
-0.02203875221312046,
0.015317021869122982,
-0.025892427191138268,
-0.06410950422286987,
-0.000469777500256896,
0.014340284280478954,
0.03297821432352066,
0.018504738807678223,
0.011401192285120487,
-0.06418053805828094,
0.032143548130989075,
-0.027028994634747505,
0.0362636037170887,
-0.0405612513422966,
0.030065760016441345,
-0.0014695461140945554,
0.03184164687991142,
-0.06996992975473404,
0.01537029817700386,
-0.0018402624409645796,
0.030687320977449417,
-0.004777134861797094,
0.014429078437387943,
0.02100873738527298,
-0.009385560639202595,
0.014766496606171131,
-0.00008490957407047972,
0.007849418558180332,
0.03082939051091671,
-0.014526751823723316,
0.04617305099964142,
0.0023663688916713,
0.05157174542546272,
-0.030491972342133522,
-0.01010479498654604,
0.016160568222403526,
0.001558340503834188,
-0.02269583009183407,
0.062084995210170746,
-0.025590525940060616,
-0.05192692205309868,
0.044041987508535385,
-0.04073883965611458,
-0.04368681088089943,
-0.02468482404947281,
-0.014997362159192562,
0.02237617038190365,
-0.03704499453306198,
0.0331202857196331,
-0.011046014726161957,
0.022500483319163322,
0.04702547565102577,
0.011507744900882244,
0.03903398662805557,
0.03242768719792366,
0.0007480922504328191,
0.02091994322836399,
-0.0076229930855333805,
-0.002074457472190261,
-0.014118297956883907,
-0.00708578759804368,
0.009873929433524609,
-0.030243348330259323,
-0.039744339883327484,
0.007076907902956009,
0.058746326714754105,
0.03871432691812515,
0.04720306396484375,
0.002903574611991644,
0.03226785734295845,
0.05000896751880646,
0.044610269367694855,
-0.012431206181645393,
-0.03910502418875694,
-0.01822059601545334,
0.035340141505002975,
0.0016793227987363935,
0.00879063829779625,
0.034860651940107346,
0.017749985679984093,
-0.0650329664349556,
-0.05292142182588577,
0.00768514908850193,
-0.05373832955956459,
-0.03418581560254097,
-0.0017436986090615392,
-0.020706837996840477,
-0.0021965496707707644,
0.011800765991210938,
-0.05135864019393921,
0.007871617563068867,
-0.0248268935829401,
-0.006237801630049944,
0.009518751874566078,
-0.029089022427797318,
0.04968930780887604,
0.021292880177497864,
-0.06204947829246521,
-0.03377736359834671,
-0.0022009895183146,
0.015254865400493145,
-0.040703319013118744,
-0.0004786569334100932,
-0.005602922290563583,
-0.021044256165623665,
0.018327148631215096,
0.014855291694402695,
-0.05942116677761078,
0.017865419387817383,
0.010166950523853302,
-0.0009811773197725415,
-0.012182582169771194,
0.06204947829246521,
0.009279007092118263,
-0.03743568807840347,
-0.03596170246601105,
-0.043970949947834015,
0.025537248700857162,
-0.05238865315914154,
0.014553390443325043,
0.0036716454196721315,
-0.04258576035499573,
-0.0052077872678637505,
0.013931830413639545,
0.029497476294636726,
0.10847115516662598,
-0.031593021005392075,
-0.01573435589671135,
0.026815887540578842,
-0.04894343391060829,
-0.014118297956883907,
-0.03743568807840347,
-0.07934661209583282,
0.0512520857155323,
-0.028787121176719666,
-0.02516431361436844,
0.051074497401714325,
-0.10456420481204987,
0.06432261317968369,
-0.025111036375164986,
-0.003221014281734824,
-0.06325708329677582,
-0.02164805680513382,
-0.08183285593986511,
-0.03874984383583069,
0.023601531982421875,
-0.0480554923415184,
-0.040063999593257904,
-0.017749985679984093,
-0.06592091172933578,
0.05111001431941986,
-0.014659943990409374,
-0.07806797325611115,
0.0065530212596058846,
-0.040596768260002136,
0.05238865315914154,
0.07444516569375992,
0.0173592921346426,
0.05693492293357849,
0.017572397366166115,
0.05540766194462776,
0.01608065329492092,
0.003609489416703582,
0.004000184591859579,
0.015245986171066761,
0.03539342060685158,
-0.022979972884058952,
-0.015876425430178642,
0.027277618646621704,
-0.023352907970547676,
0.0007486472022719681,
0.02979937754571438,
-0.05164278298616409,
-0.00010648382158251479,
0.010770752094686031,
0.02873384580016136,
0.03839466720819473,
0.000524164002854377,
-0.09433509409427643,
-0.08822604268789291,
0.011205844581127167,
0.020831149071455002,
0.020706837996840477,
0.013985106721520424,
0.041022978723049164,
0.00978513527661562,
-0.018344908952713013,
-0.03260527923703194,
0.013754241168498993,
-0.047167547047138214,
-0.0341680571436882,
-0.011330156587064266,
-0.0335642546415329,
0.00937668140977621,
0.017616795375943184,
0.017954213544726372,
0.03560652583837509,
-0.014508993364870548,
0.021115291863679886,
0.001796975266188383,
0.015903064981102943,
-0.02946195751428604,
-0.03423909470438957,
-0.046670299023389816,
0.011489986442029476,
-0.010850667022168636,
0.017137305811047554,
-0.0985972210764885,
0.017181701958179474,
-0.0013130460865795612,
-0.012191461399197578,
-0.06609849631786346,
0.02020958997309208,
0.020724596455693245,
0.033830638974905014,
-0.05572732165455818,
0.01822059601545334,
0.00860861036926508,
-0.021186327561736107,
-0.07163926213979721,
0.016888681799173355,
0.022180823609232903,
0.04514303803443909,
-0.022713588550686836,
-0.004626184701919556,
-0.05320556089282036,
0.002848078031092882,
0.04176885262131691,
-0.005336539354175329,
0.03129111975431442,
-0.017829900607466698,
-0.03372408449649811,
0.00322323408909142,
0.005887064151465893,
0.016595659777522087,
0.03864329308271408,
0.025022242218255997,
-0.05192692205309868,
-0.060024965554475784,
0.051074497401714325,
-0.030136795714497566,
-0.0229266956448555,
-0.04347370192408562,
-0.026300881057977676,
0.016045134514570236,
-0.011791886761784554,
-0.026460710912942886,
-0.03771983087062836,
0.03340442478656769,
-0.0014684362104162574,
-0.04862377420067787,
-0.02523534744977951,
0.07359273731708527,
-0.016640057787299156,
-0.04347370192408562,
0.04599546268582344,
0.027774866670370102,
0.02923109382390976,
0.02683364599943161,
-0.034629788249731064,
-0.005465290974825621,
-0.0031322198919951916,
-0.08240113407373428,
0.034629788249731064,
-0.01605401560664177,
-0.023352907970547676,
0.0191795751452446,
0.002121074590831995,
-0.0025372980162501335,
-0.013905191794037819,
0.008333347737789154,
0.04137815907597542,
0.03114905022084713,
0.07515551894903183,
0.01417157519608736,
0.03743568807840347,
0.016480227932333946,
-0.03548221290111542,
0.03999296575784683,
-0.09447716921567917,
-0.004781574476510286,
0.005673957522958517,
-0.00812912080436945,
0.008342226967215538,
-0.021932199597358704,
0.03903398662805557,
0.0025439574383199215,
-0.02963954769074917,
-0.017909815534949303,
-0.008080284111201763,
0.005851546302437782,
0.009687460958957672,
-0.01181852538138628,
-0.03409702330827713,
0.0049591632559895515,
-0.02722434140741825,
-0.02012079581618309,
-0.013603291474282742,
-0.003875872353091836,
-0.020156312733888626,
0.011072652414441109,
0.02955075353384018,
-0.020884426310658455,
-0.00134856381919235,
0.05942116677761078,
0.0858108401298523,
0.023601531982421875,
-0.04681237041950226,
-0.07032510638237,
-0.059847377240657806,
-0.010131432674825191,
0.025768114253878593,
0.025892427191138268,
-0.02131063863635063,
-0.05995393171906471,
0.06062876805663109,
-0.015903064981102943,
0.030882667750120163,
0.0330670066177845,
0.012644312344491482,
-0.020387178286910057,
-0.0043686809949576855,
0.006854922045022249,
-0.016204964369535446,
-0.028130043298006058,
0.03807500749826431,
-0.03019007109105587,
0.04208851233124733,
0.02354825660586357,
0.005940340459346771,
0.004395319148898125,
-0.006419830024242401,
-0.0070325108245015144,
0.0314687117934227,
0.011933958157896996,
-0.004936964716762304,
-0.015467972494661808,
-0.022802384570240974,
-0.041058499366045,
0.01561892218887806,
-0.002286453964188695,
0.002205429133027792,
0.0421595461666584,
-0.012910695746541023,
-0.06481985747814178,
0.004113397095352411,
-0.04549821466207504,
-0.007041390519589186,
-0.0017059610690921545,
-0.05089690908789635,
-0.08865226060152054,
0.03704499453306198,
0.048197560012340546,
0.001315266010351479,
0.013114922679960728,
0.015503489412367344,
0.010717475786805153,
0.010966099798679352,
-0.001044443342834711,
-0.00718346145004034,
-0.04574683681130409,
0.023814639076590538,
-0.04255024343729019,
0.03162854164838791,
0.029213333502411842,
-0.024240851402282715,
0.0528503842651844,
0.08055421710014343,
-0.003378624329343438,
-0.062404654920101166,
0.016524624079465866,
0.04912102222442627,
-0.0038825320079922676,
0.020671319216489792,
0.03935364633798599,
0.013558894395828247,
0.02690468169748783,
-0.03235665336251259,
0.020955462008714676,
0.00017037411453202367,
0.0357663556933403,
0.015903064981102943,
0.017226099967956543,
0.02674485184252262,
0.005731673911213875,
-0.03985089436173439,
0.015396936796605587,
0.025448454543948174,
-0.021683575585484505,
0.041094016283750534,
0.00004522961171460338,
0.009234610013663769,
-0.041022978723049164,
0.01010479498654604,
-0.03921157494187355,
-0.014784255996346474,
-0.027508482336997986,
0.023264113813638687,
-0.03928261250257492,
0.016684453934431076,
-0.035251349210739136,
-0.022624794393777847,
-0.03507376089692116,
0.04162678122520447,
-0.01568995788693428,
-0.057538725435733795,
-0.006215603090822697,
-0.0389629527926445,
-0.009323404170572758,
0.0037227021530270576,
-0.04080987349152565,
0.015343660488724709,
0.002308652503415942,
0.018504738807678223,
0.09504544734954834,
0.06481985747814178,
-0.0005410904414020479,
-0.002256485866382718,
-0.00009933865658240393,
0.0624401718378067,
0.008968227542936802,
-0.04262127727270126,
-0.00590926269069314,
0.013452340848743916,
0.01788317784667015,
-0.0538448803126812,
-0.0008552004001103342,
0.05100346356630325,
-0.06375432759523392,
-0.06446468085050583,
-0.06890439987182617,
-0.04809100925922394,
0.018051886931061745,
0.019996482878923416,
0.003090042620897293,
-0.008439901284873486,
0.005105673801153898,
0.02891143411397934,
-0.03153974562883377,
0.041804369539022446,
-0.05317004397511482,
-0.00499024149030447,
-0.015290383249521255,
-0.01436692290008068,
0.0655302181839943,
-0.02754400111734867,
0.0035539930686354637,
-0.027916936203837395,
0.005425333511084318,
0.0003754335339181125,
0.004941404331475496,
0.0008202376193366945,
-0.03010127693414688,
0.024453958496451378,
0.03386615589261055,
0.03864329308271408,
0.04063228517770767,
0.053134527057409286,
-0.0007064698729664087,
-0.022500483319163322,
-0.05665078014135361,
0.008320028893649578,
-0.02372584491968155,
0.08218803256750107,
0.0026371916756033897,
-0.015077277086675167,
0.004111177287995815,
-0.05899495258927345,
-0.005598482675850391,
0.07856522500514984,
0.05121656879782677,
-0.029905930161476135,
0.029888171702623367,
-0.043331634253263474,
-0.012271376326680183,
-0.014109418727457523,
0.016915319487452507,
0.016702212393283844,
-0.02012079581618309,
0.04503648355603218,
-0.033741846680641174,
0.05029310658574104,
-0.015903064981102943,
0.042372655123472214
]
|
36,362 | statistics | _find_lteq | Locate the leftmost value exactly equal to x | def _find_lteq(a, x):
'Locate the leftmost value exactly equal to x'
i = bisect_left(a, x)
if i != len(a) and a[i] == x:
return i
raise ValueError
| (a, x) | [
-0.015028679743409157,
0.03333008289337158,
-0.02285737358033657,
0.034087974578142166,
0.039720501750707626,
0.00936170481145382,
0.016630591824650764,
0.007333478890359402,
0.00044596209772862494,
-0.09556345641613007,
0.011127252131700516,
0.02790425345301628,
-0.019343504682183266,
-0.06225060299038887,
-0.025665024295449257,
0.005658362526446581,
-0.008771753869950771,
0.04140853509306908,
-0.02921334281563759,
0.031021950766444206,
0.026974111795425415,
0.0641108825802803,
0.014391360804438591,
-0.022237278521060944,
0.005757405422627926,
0.035379838198423386,
0.03806691616773605,
0.009645914658904076,
0.002243536524474621,
0.0018958098953589797,
-0.04278652369976044,
-0.0042459252290427685,
-0.005244966130703688,
-0.04685158655047417,
0.02306407131254673,
0.010748305357992649,
0.031228650361299515,
-0.0039724805392324924,
0.05277693644165993,
-0.04068509116768837,
-0.04543915018439293,
-0.036172181367874146,
0.004306212067604065,
-0.011566485278308392,
-0.025389425456523895,
-0.008948308415710926,
0.009792326018214226,
0.023391343653202057,
-0.005826305132359266,
0.08364386111497879,
0.015020067803561687,
-0.011669835075736046,
-0.001554542570374906,
-0.007953573949635029,
-0.03503534197807312,
0.06590227037668228,
0.00519759813323617,
-0.013366482220590115,
-0.029041094705462456,
0.007867448963224888,
0.032331038266420364,
0.0782008096575737,
0.01039519626647234,
0.0014608824858441949,
0.03882480785250664,
-0.018843984231352806,
-0.0175348948687315,
-0.007109555881470442,
-0.09273858368396759,
0.034690845757722855,
-0.0050813304260373116,
-0.034604720771312714,
-0.01851671189069748,
-0.043992262333631516,
0.024132011458277702,
0.043303269892930984,
0.01889565773308277,
0.0014005954144522548,
0.026009520515799522,
0.020342545583844185,
0.0691060945391655,
-0.016044946387410164,
0.07826971262693405,
-0.016561690717935562,
0.004840182140469551,
0.006666016299277544,
0.03810136392712593,
0.06304294615983963,
0.07268886268138885,
-0.005042574368417263,
-0.02029087208211422,
0.05312143266201019,
0.01597604714334011,
0.004866019822657108,
-0.022530101239681244,
0.03947935253381729,
0.02740473300218582,
0.007152618374675512,
0.01509757898747921,
-0.008616730570793152,
0.019774125888943672,
0.09666584432125092,
-0.03531093895435333,
-0.03157314658164978,
0.02147938497364521,
0.044198960065841675,
0.01593298465013504,
-0.021134888753294945,
-0.023408569395542145,
-0.012522464618086815,
-0.04516355320811272,
-0.03134922310709953,
-0.08371276408433914,
0.02495880424976349,
-0.05146784707903862,
0.059425726532936096,
0.02127268724143505,
0.0032447308767586946,
0.05549846217036247,
-0.0315386988222599,
0.030935827642679214,
-0.02929946593940258,
-0.059460174292325974,
0.011876532807946205,
0.013220070861279964,
-0.05067550390958786,
0.05611855536699295,
0.012806674465537071,
-0.02888607047498226,
0.01958465203642845,
0.09308307617902756,
-0.017879392951726913,
-0.036585576832294464,
0.012160742655396461,
0.008199027739465237,
0.026991337537765503,
0.02020474709570408,
-0.0026655453257262707,
-0.062388401478528976,
-0.07048407942056656,
-0.00205191015265882,
0.00999902468174696,
0.018465036526322365,
0.013461219146847725,
0.0578065887093544,
-0.012014331296086311,
-0.048642970621585846,
0.047575030475854874,
0.035379838198423386,
0.012522464618086815,
-0.044887956231832504,
0.0033566923812031746,
-0.00915500707924366,
-0.023494692519307137,
-0.015269828028976917,
-0.0435788668692112,
-0.0059684100560843945,
-0.04829847440123558,
0.006515298970043659,
-0.04771282896399498,
0.06197500228881836,
-0.003765782341361046,
-0.011661222204566002,
-0.04285542294383049,
-0.009688977152109146,
-0.01663920283317566,
-0.07730511575937271,
0.06231950223445892,
-0.012505239807069302,
0.048953019082546234,
0.022805698215961456,
0.03968605026602745,
-0.07634052634239197,
-0.01939517818391323,
-0.057841040194034576,
-0.05157119408249855,
-0.04788507893681526,
0.04147743433713913,
-0.003122003749012947,
-0.006571279373019934,
-0.007075106259435415,
0.023804740980267525,
0.03453582152724266,
-0.05425827205181122,
0.0007643526187166572,
0.0017612407682463527,
-0.018930107355117798,
0.026285117492079735,
-0.005559319630265236,
0.07675392180681229,
-0.06593672186136246,
-0.031039176508784294,
0.024097561836242676,
-0.09818163514137268,
-0.025716697797179222,
0.05832333490252495,
-0.01464112102985382,
0.0374123714864254,
-0.006562666967511177,
-0.005882285535335541,
-0.026698514819145203,
-0.02304684743285179,
-0.020015273243188858,
0.0006270921439863741,
-0.007634914014488459,
-0.0289032943546772,
-0.008358357474207878,
-0.05394822359085083,
-0.056773100048303604,
-0.026354018598794937,
-0.033795151859521866,
-0.0063301315531134605,
-0.07213766127824783,
-0.0022693737410008907,
-0.020428670570254326,
-0.003035879461094737,
-0.007824387401342392,
-0.012109068222343922,
0.058667831122875214,
-0.023511918261647224,
0.06342189013957977,
-0.012462177313864231,
0.0792343020439148,
-0.023477468639612198,
0.07017403095960617,
0.003655974054709077,
0.02366694062948227,
0.015864085406064987,
0.05195014178752899,
-0.0027193729765713215,
0.04998650774359703,
0.025268852710723877,
0.05832333490252495,
-0.04133963584899902,
0.0027882722206413746,
-0.03810136392712593,
-0.003089707111939788,
-0.007243048865348101,
-0.005094248801469803,
0.006795202381908894,
-0.008246395736932755,
0.057841040194034576,
0.017087049782276154,
0.032020993530750275,
-0.005705730989575386,
-0.012643038295209408,
-0.01860283687710762,
-0.0051071676425635815,
0.0059684100560843945,
0.03947935253381729,
-0.055085062980651855,
-0.04178748279809952,
-0.01979134976863861,
-0.023391343653202057,
0.07003623247146606,
-0.015898535028100014,
0.008595199324190617,
-0.0020949721802026033,
0.011153088882565498,
0.005072718020528555,
0.0005764941452071071,
-0.0009403690346516669,
0.004702383652329445,
-0.05391377583146095,
-0.08012999594211578,
0.01889565773308277,
-0.01941240392625332,
0.008922471664845943,
0.035999931395053864,
0.05632525309920311,
0.018551161512732506,
-0.030143484473228455,
0.026388468220829964,
-0.006054534111171961,
-0.01612245850265026,
-0.03730902075767517,
-0.007105249911546707,
0.008289458230137825,
0.054878365248441696,
-0.022133929654955864,
-0.029919560998678207,
0.020928191021084785,
-0.02106598950922489,
0.05753099173307419,
-0.04936641454696655,
0.004291140474379063,
0.007161230780184269,
-0.09074050188064575,
-0.019067907705903053,
0.014425810426473618,
-0.014511934481561184,
-0.0018398291431367397,
-0.0419597290456295,
-0.010507157072424889,
0.010601893998682499,
-0.009542565792798996,
0.026991337537765503,
0.027473632246255875,
0.07916539907455444,
0.026646839454770088,
-0.0007148312288336456,
-0.02830042503774166,
-0.08254147320985794,
-0.044887956231832504,
0.004368652123957872,
0.019050681963562965,
-0.02020474709570408,
-0.0021477232221513987,
-0.0046377903781831264,
-0.0040413797833025455,
-0.017190398648381233,
-0.008616730570793152,
0.040202796459198,
-0.08584864437580109,
0.03248606249690056,
0.005150229670107365,
0.004939225036650896,
-0.000294706376735121,
-0.05253578722476959,
0.0390315055847168,
0.033020034432411194,
0.047264982014894485,
-0.004409560933709145,
-0.006045921705663204,
-0.013590404763817787,
0.01504590455442667,
-0.06056256592273712,
-0.013719591312110424,
-0.009861225262284279,
-0.006416256073862314,
0.01918848045170307,
-0.00936170481145382,
0.008242090232670307,
-0.028644923120737076,
0.03048798069357872,
0.04065064340829849,
0.03910040482878685,
0.04323437064886093,
0.00044973002513870597,
-0.009421992115676403,
-0.0051071676425635815,
0.020135847851634026,
-0.007949267514050007,
0.013874615542590618,
0.051226697862148285,
-0.011575098149478436,
0.005649750120937824,
-0.010713855735957623,
0.02296072244644165,
-0.004224393982440233,
-0.007807162590324879,
0.015476525761187077,
-0.020738717168569565,
-0.03296836093068123,
0.01609661988914013,
0.029178893193602562,
0.021617185324430466,
-0.02773200534284115,
0.011988494545221329,
0.0906715989112854,
0.0038605190347880125,
-0.04998650774359703,
-0.02652626670897007,
-0.00044623122084885836,
-0.08295486867427826,
-0.00378516037017107,
-0.04888411983847618,
0.0024200910702347755,
-0.023529142141342163,
0.026388468220829964,
-0.006209557875990868,
-0.03472529351711273,
0.014933943748474121,
0.00440525496378541,
0.02613009512424469,
0.021823883056640625,
0.02258177660405636,
0.03761906921863556,
-0.06524772197008133,
-0.031814295798540115,
0.05074440315365791,
-0.039548251777887344,
-0.017216235399246216,
0.014684183523058891,
-0.03527648746967316,
0.038755908608436584,
-0.013452606275677681,
-0.02394253946840763,
0.05763434246182442,
0.031245874240994453,
0.019532978534698486,
-0.05315588042140007,
-0.0006297834916040301,
-0.009938737377524376,
0.007187067996710539,
0.023477468639612198,
0.029833437874913216,
-0.03296836093068123,
0.030040135607123375,
-0.04847072437405586,
0.019929150119423866,
0.026698514819145203,
-0.012953085824847221,
0.00737223494797945,
0.06187165528535843,
0.052019041031599045,
0.01781049370765686,
-0.009396154433488846,
-0.04047839343547821,
0.009585628286004066,
-0.09322088211774826,
-0.011626772582530975,
-0.008797591552138329,
-0.05232908949255943,
-0.021203787997364998,
-0.08826012164354324,
-0.010136823169887066,
0.05377597734332085,
-0.026664065197110176,
-0.04764392971992493,
-0.034208547323942184,
-0.11395959556102753,
-0.020170297473669052,
-0.027990378439426422,
0.0019162644166499376,
0.008168884553015232,
-0.019136806949973106,
-0.030746353790163994,
-0.03333008289337158,
0.060424767434597015,
-0.03772241622209549,
-0.006721997167915106,
0.005378458648920059,
-0.030419081449508667,
0.0008101061685010791,
0.01911958120763302,
-0.00737223494797945,
0.019825799390673637,
0.02066981792449951,
0.009568403474986553,
0.07572042942047119,
0.040926240384578705,
0.020032498985528946,
0.07082857936620712,
0.035689886659383774,
0.01429662387818098,
0.01659614033997059,
0.028851620852947235,
-0.007156924344599247,
0.030419081449508667,
-0.03724012151360512,
-0.09108499437570572,
0.010515769943594933,
0.01803441531956196,
-0.03882480785250664,
-0.06769365072250366,
-0.12381220608949661,
0.0011895911302417517,
0.040133897215127945,
0.013013373129069805,
0.0187061857432127,
0.02564779855310917,
0.028644923120737076,
-0.04140853509306908,
-0.02642291784286499,
0.018861208111047745,
-0.038549210876226425,
-0.011299500241875648,
0.003813150804489851,
-0.052501335740089417,
0.024614308029413223,
0.0020389913115650415,
-0.0849529504776001,
-0.038962606340646744,
0.029936786741018295,
0.022409526631236076,
0.004521522670984268,
0.004179178737103939,
0.10610506683588028,
-0.03196932002902031,
0.007798550184816122,
-0.016174132004380226,
0.0297817625105381,
0.004745445679873228,
0.01409853808581829,
-0.056153006851673126,
-0.1260169893503189,
-0.010636343620717525,
-0.040443941950798035,
-0.03679227456450462,
0.01770714484155178,
0.0022037040907889605,
0.00040155427996069193,
0.05074440315365791,
0.02297794818878174,
-0.03978940099477768,
0.04843627288937569,
0.012048780918121338,
0.04926306754350662,
0.008801897056400776,
0.018654510378837585,
0.02535497583448887,
-0.04464680701494217,
0.02416646108031273,
0.027749231085181236,
0.05542956292629242,
-0.0006120203761383891,
0.028937745839357376,
0.006670322269201279,
-0.02364971674978733,
0.00015959898883011192,
-0.009378929622471333,
0.0447501540184021,
-0.017302360385656357,
-0.017043987289071083,
-0.012789449654519558,
0.02177220769226551,
-0.027766454964876175,
0.05708314850926399,
-0.0048100389540195465,
-0.036757826805114746,
0.015752123668789864,
-0.0048315697349607944,
-0.06328409165143967,
0.01415021251887083,
0.008422951214015484,
-0.016949251294136047,
-0.023029621690511703,
-0.024528183043003082,
0.06452427804470062,
-0.005602381657809019,
-0.023684166371822357,
0.027542531490325928,
-0.008633955381810665,
0.009611465036869049,
0.06686685979366302,
-0.023770291358232498,
0.00232750759460032,
0.07847640663385391,
-0.020445894449949265,
0.0029023869428783655,
-0.04316547140479088,
0.051640093326568604,
-0.006622954271733761,
0.006575585808604956,
0.011480361223220825,
-0.08639983832836151,
0.10286679118871689,
-0.03501811623573303,
-0.003864825237542391,
0.0349147655069828,
-0.009964575059711933,
0.09563235938549042,
-0.00480142654851079,
-0.0362410806119442,
-0.027680331841111183,
-0.04543915018439293,
0.039548251777887344,
0.04760948196053505,
0.006747834384441376,
0.014916718937456608,
0.030126258730888367,
0.056187454611063004,
-0.04847072437405586,
-0.04237312823534012,
-0.04733388125896454,
0.035999931395053864,
-0.09577015787363052,
0.04891856759786606,
0.039238203316926956,
0.03009180910885334,
0.02910999394953251,
-0.08219697326421738,
0.0069502261467278,
-0.023890864104032516,
0.03689562529325485,
-0.02733583375811577,
-0.05935682728886604,
-0.02049756981432438,
-0.03851475939154625,
0.0010830123210325837,
-0.02792147919535637,
0.03851475939154625,
-0.0037743947468698025,
0.029747312888503075,
0.008668405003845692,
0.021754983812570572,
0.009189456701278687,
-0.07957880198955536,
0.03057410567998886,
-0.006536829750984907,
-0.01941240392625332,
-0.016673652455210686,
0.0037787011824548244,
0.03620662912726402,
0.04733388125896454,
0.003976786974817514,
0.011583710089325905,
0.012005719356238842,
-0.009775101207196712,
0.0053009469993412495,
0.032623860985040665,
-0.0504688061773777,
-0.03029850870370865,
0.047368332743644714,
0.012462177313864231,
0.028541574254631996,
-0.0003302326367702335,
0.0032964053098112345,
-0.015123416669666767,
0.04688603803515434,
0.010662181302905083,
0.010067923925817013,
-0.021703308448195457,
-0.06080371513962746,
-0.01415021251887083,
0.0020895893685519695,
0.04333771765232086,
0.003666739445179701,
0.012281316332519054,
-0.02433871105313301,
0.01143729966133833,
0.0532592311501503,
-0.01930905506014824,
0.04144298657774925,
-0.013220070861279964,
0.0872955322265625,
-0.015622937120497227,
0.01129088830202818,
0.04444010928273201,
0.01941240392625332,
0.017250685021281242,
0.04512910172343254,
-0.050124309957027435,
-0.055670708417892456,
0.005188985727727413,
0.01941240392625332,
-0.02346024289727211,
-0.08819122612476349,
0.01732819713652134,
-0.0724821612238884,
0.060631465166807175,
0.023976989090442657,
-0.012953085824847221,
0.06493768095970154,
-0.0077942437492311,
0.03157314658164978,
0.05136449635028839,
-0.04633484035730362,
-0.028265975415706635,
0.011867919936776161,
-0.013065047562122345,
0.0024200910702347755,
-0.005598075687885284,
0.004521522670984268,
0.027542531490325928,
0.03501811623573303,
0.026061195880174637,
-0.02106598950922489,
-0.038445860147476196,
0.03978940099477768,
-0.025578899309039116,
-0.060424767434597015,
0.011893757618963718,
-0.03028128296136856,
-0.032313816249370575,
-0.0021477232221513987,
0.0015233225421980023,
-0.04946976527571678,
0.005219128914177418,
0.01415021251887083,
-0.036585576832294464,
0.012703325599431992,
-0.0029712864197790623,
0.019843025133013725,
-0.04971091076731682,
-0.013452606275677681,
-0.020463120192289352,
-0.035087015479803085,
-0.04027169570326805,
0.030332958325743675,
-0.009318643249571323,
0.0046076467260718346,
0.011428686790168285,
0.0305913295596838,
0.025596125051379204,
-0.00482726376503706,
0.046472638845443726,
0.02364971674978733,
0.0035375531297177076,
-0.0018398291431367397,
-0.0023770290426909924,
-0.02821430191397667,
0.008384195156395435,
-0.04154633358120918,
-0.010188497602939606,
-0.033312857151031494,
0.09446106851100922,
0.05859893187880516,
-0.03455304726958275,
0.05877118185162544,
-0.023098520934581757,
0.011066964827477932,
0.012031556107103825,
-0.029712863266468048,
-0.0028464060742408037,
-0.016088008880615234,
0.02544110082089901,
-0.03207266703248024,
-0.01862006075680256,
-0.008776060305535793,
-0.03138367459177971,
-0.0441645123064518,
-0.05139894783496857,
-0.051226697862148285,
0.05088220164179802,
-0.004306212067604065,
0.01651863008737564,
-0.02683631330728531,
0.050227656960487366,
-0.007484196685254574,
-0.010576057247817516,
0.00048391058226116,
-0.024683207273483276,
-0.012221029959619045,
-0.004525828640908003,
0.07558263093233109,
-0.01862006075680256,
-0.06497212499380112,
-0.018688960000872612,
-0.010472707450389862,
0.0034815724939107895,
0.023976989090442657,
0.03405352309346199,
0.06287069618701935,
0.033106159418821335,
-0.02304684743285179,
0.0006577738677151501,
-0.0032705680932849646,
0.008487544022500515,
0.03899705782532692,
0.025475550442934036,
-0.005451664328575134,
-0.017999965697526932,
-0.0016040640184655786,
0.017190398648381233,
-0.025957847014069557,
0.048849668353796005,
-0.04364776611328125,
-0.020032498985528946,
-0.023305220529437065,
0.004762670490890741,
0.013280358165502548,
0.02008417248725891,
-0.05363817885518074,
0.012996148318052292,
-0.0009812780190259218,
0.030332958325743675,
0.008048309944570065,
0.06324964016675949,
-0.014425810426473618,
-0.010334908962249756,
-0.022840147837996483,
0.0368267260491848,
-0.05177789181470871,
0.01647556759417057,
-0.04729943349957466,
0.06535107642412186
]
|
36,363 | statistics | _find_rteq | Locate the rightmost value exactly equal to x | def _find_rteq(a, l, x):
'Locate the rightmost value exactly equal to x'
i = bisect_right(a, x, lo=l)
if i != (len(a) + 1) and a[i - 1] == x:
return i - 1
raise ValueError
| (a, l, x) | [
-0.013452798128128052,
0.03475959226489067,
-0.011702628806233406,
0.05851314216852188,
0.03608310595154762,
-0.0007597130606882274,
0.0009186215465888381,
-0.016178186982870102,
-0.02025320939719677,
-0.07843547314405441,
0.01764972321689129,
0.039078421890735626,
-0.014410602860152721,
-0.048412661999464035,
-0.01731884479522705,
0.02397993952035904,
0.0027515108231455088,
0.035491008311510086,
-0.03789422661066055,
0.026574719697237015,
0.017519114539027214,
0.06951918452978134,
0.00687442347407341,
-0.00457133911550045,
0.012512409128248692,
0.01277362834662199,
0.059662509709596634,
0.00595144834369421,
-0.01768455281853676,
0.005803423933684826,
-0.043083783239126205,
-0.02415408566594124,
-0.007862703874707222,
-0.01990491710603237,
0.0024445781018584967,
0.0007422984344884753,
0.03120701014995575,
0.009334239177405834,
0.03326193615794182,
-0.03695383667945862,
-0.05165177956223488,
-0.017275309190154076,
0.015481602400541306,
-0.02023579552769661,
-0.03421974182128906,
-0.010640336200594902,
-0.010910263285040855,
0.002816815860569477,
-0.01269526220858097,
0.07258415967226028,
0.020636331290006638,
-0.028734132647514343,
-0.03115476667881012,
-0.025982622057199478,
-0.01721435785293579,
0.028351010754704475,
0.0026165475137531757,
0.012059628032147884,
-0.006112533621490002,
-0.001631532795727253,
0.05287080630660057,
0.06788221001625061,
-0.011336921714246273,
0.03157271817326546,
0.03542134910821915,
-0.0021202308125793934,
-0.017971893772482872,
-0.005755533929914236,
-0.06464309245347977,
0.03470734879374504,
-0.013313481584191322,
-0.022447453811764717,
-0.02387545257806778,
-0.050572074949741364,
0.04263100400567055,
0.02168121002614498,
0.016900895163416862,
-0.01856399141252041,
-0.004667119588702917,
0.026365743950009346,
0.07216621190309525,
-0.0006356338271871209,
0.10713478177785873,
-0.020897550508379936,
-0.015220383182168007,
0.004863034468144178,
0.06234436109662056,
0.0367448590695858,
0.061264652758836746,
-0.025251207873225212,
-0.026365743950009346,
0.0100656533613801,
0.007070338353514671,
-0.031816523522138596,
-0.006804765202105045,
0.014515090733766556,
0.02040994167327881,
0.005698936525732279,
-0.006517423782497644,
-0.026243841275572777,
-0.0042839981615543365,
0.10546297580003738,
-0.024502377957105637,
-0.024328231811523438,
0.02190759964287281,
0.04517354071140289,
-0.0035765287466347218,
0.0032129983883351088,
-0.028368426486849785,
-0.0012767097214236856,
-0.06471274793148041,
-0.0030170839745551348,
-0.06324992328882217,
0.03111993707716465,
-0.07018094509840012,
0.0583738274872303,
-0.00249029160477221,
0.023091794922947884,
0.048273343592882156,
-0.01854657754302025,
0.06530484557151794,
-0.030423352494835854,
-0.06861362606287003,
0.020793063566088676,
0.017884820699691772,
-0.04022778570652008,
0.0481688566505909,
0.041098516434431076,
-0.0518607571721077,
0.03517754375934601,
0.10009927302598953,
-0.0024293402675539255,
-0.022900233045220375,
0.007479581981897354,
0.024519793689250946,
0.05370670557022095,
0.010561970993876457,
0.003258711891248822,
-0.07836581766605377,
-0.06499138474464417,
0.02593037858605385,
0.02201208658516407,
0.01999199017882347,
0.0000833317099022679,
0.050258610397577286,
0.023509744554758072,
-0.06735977530479431,
0.058095190674066544,
0.050258610397577286,
0.019121259450912476,
-0.04391968622803688,
-0.0020298922900110483,
0.008759557269513607,
-0.007893179543316364,
0.0011635146802291274,
-0.04259617626667023,
0.02749769389629364,
-0.03343608230352402,
-0.015168138779699802,
-0.053846023976802826,
0.04047159105539322,
-0.006256204564124346,
-0.02384062297642231,
-0.05165177956223488,
-0.007853996008634567,
-0.022482281550765038,
-0.0687529444694519,
0.0515124648809433,
0.0021626788657158613,
0.039252568036317825,
-0.002877766964957118,
0.009656409732997417,
-0.08031625300645828,
-0.02371872030198574,
-0.09076502919197083,
-0.032199643552303314,
-0.06746426224708557,
0.033610228449106216,
-0.018738137558102608,
-0.023422671481966972,
-0.00917750783264637,
-0.00678299693390727,
0.06060289964079857,
-0.057537924498319626,
-0.0181112103164196,
-0.005119900219142437,
-0.025982622057199478,
0.00138228596188128,
0.0011363043449819088,
0.07122582197189331,
-0.07091235369443893,
-0.027985304594039917,
0.02357940375804901,
-0.11033906787633896,
-0.01816345565021038,
0.03439388796687126,
0.008772618137300014,
0.06300611793994904,
0.019608868286013603,
-0.0005915530491620302,
-0.013330896385014057,
-0.014959163963794708,
-0.02373613603413105,
0.010631629265844822,
-0.04071539640426636,
-0.030144717544317245,
-0.0003861149016302079,
-0.02589554898440838,
-0.03813803195953369,
0.002668791450560093,
-0.012068335898220539,
0.00687007000669837,
-0.07669401168823242,
0.008193581365048885,
-0.011119239032268524,
0.007897532545030117,
-0.04907441511750221,
-0.013330896385014057,
0.05283597484230995,
-0.013461505994200706,
0.06474757939577103,
-0.019678527489304543,
0.08651585876941681,
-0.0063955215737223625,
0.0472981259226799,
-0.0062257288955152035,
0.02169862389564514,
0.03702349588274956,
0.06965850293636322,
-0.004958814941346645,
0.03334900736808777,
0.020671160891652107,
0.07509186863899231,
-0.039287395775318146,
0.004849973134696484,
-0.04548700153827667,
-0.03789422661066055,
0.018651064485311508,
-0.0006802588468417525,
0.017153406515717506,
-0.027863401919603348,
0.05105968192219734,
0.0008816154440864921,
0.02185535617172718,
0.007984605617821217,
-0.01682252809405327,
0.013513749465346336,
0.01010048296302557,
0.00295177916996181,
0.015916967764496803,
-0.04231753945350647,
-0.034132666885852814,
-0.00461052218452096,
-0.015525138936936855,
0.07550981640815735,
-0.018964527174830437,
0.02377096377313137,
0.014549920335412025,
0.019086429849267006,
0.004710656125098467,
0.020479600876569748,
0.003189053386449814,
0.03470734879374504,
-0.06035909429192543,
-0.11486687511205673,
0.0031564009841531515,
-0.02034028246998787,
-0.012521116062998772,
0.05001480504870415,
0.037824567407369614,
0.05527402460575104,
-0.017292723059654236,
-0.013844627887010574,
-0.00023332878481596708,
-0.017066333442926407,
0.004325357731431723,
0.028908278793096542,
0.02765442617237568,
0.04374554008245468,
-0.028455499559640884,
-0.026365743950009346,
0.03467252105474472,
0.009699946269392967,
0.06297128647565842,
-0.05903558060526848,
-0.0037310835905373096,
-0.008419971913099289,
-0.08581927418708801,
-0.013191578909754753,
0.0362224206328392,
-0.004715010058134794,
-0.0012603835202753544,
-0.02175086736679077,
0.01193772628903389,
0.033610228449106216,
-0.014872090891003609,
0.026505060493946075,
0.020705990493297577,
0.08554064482450485,
0.029709352180361748,
-0.023370428010821342,
-0.0165264792740345,
-0.022760916501283646,
-0.04569597914814949,
0.0028059317264705896,
0.0006106003420427442,
0.001689218683168292,
-0.030109887942671776,
0.006817826069891453,
0.019016772508621216,
-0.01830277219414711,
0.015995334833860397,
0.05638856068253517,
-0.05339324474334717,
-0.0020973740611225367,
0.00017645914340391755,
-0.015028822235763073,
-0.0037136690225452185,
-0.045138709247112274,
0.01630008965730667,
0.030719399452209473,
0.04573080688714981,
0.03866047039628029,
-0.04193441942334175,
0.00770597206428647,
-0.005154729355126619,
-0.09013810753822327,
-0.010718702338635921,
0.0049892901442945,
0.0020298922900110483,
0.009839263744652271,
-0.024746183305978775,
0.021280672401189804,
-0.026052281260490417,
0.02189018577337265,
0.026313500478863716,
0.04252651706337929,
0.04081988334655762,
0.0005735942395403981,
-0.015333577990531921,
0.007719032932072878,
0.01733626052737236,
-0.007453459780663252,
0.0023357367608696222,
0.04639256373047829,
0.02028803899884224,
0.02586071938276291,
-0.014889504760503769,
0.03141598403453827,
0.014863383024930954,
-0.003613534849137068,
-0.012982604093849659,
-0.012677847407758236,
-0.03249569237232208,
-0.02169862389564514,
0.0362224206328392,
0.01269526220858097,
0.00024679789203219116,
0.030614912509918213,
0.0666283592581749,
-0.00909043475985527,
-0.05321909859776497,
-0.04903958737850189,
0.011180189438164234,
-0.06784738600254059,
-0.0047454857267439365,
-0.05879177898168564,
0.02363164722919464,
-0.01475889515131712,
0.03273949772119522,
-0.007305435370653868,
-0.04980583116412163,
0.016308797523379326,
0.02014872245490551,
0.02584330551326275,
0.037302128970623016,
0.031816523522138596,
0.020601501688361168,
-0.03298330307006836,
-0.05426397547125816,
0.02568657323718071,
-0.03528203070163727,
-0.01807638257741928,
0.00414903461933136,
-0.04914407432079315,
0.03505564108490944,
-0.04217822477221489,
-0.0026383157819509506,
0.046880174428224564,
0.03900876268744469,
0.0007776718703098595,
-0.042909637093544006,
0.027010085061192513,
-0.014732773415744305,
-0.020967209711670876,
0.03171203285455704,
0.02182052657008171,
-0.01852916181087494,
0.00016625525313429534,
-0.02936105988919735,
-0.015159431844949722,
0.046706028282642365,
-0.03268725425004959,
-0.023335598409175873,
0.06063772737979889,
0.05321909859776497,
0.016012748703360558,
-0.0041185589507222176,
-0.04886544123291969,
-0.01479372475296259,
-0.10351254045963287,
-0.02718423120677471,
0.014967870898544788,
-0.030057644471526146,
-0.0402626134455204,
-0.0692753791809082,
-0.002877766964957118,
0.06917089223861694,
-0.02586071938276291,
-0.023248525336384773,
-0.03799871355295181,
-0.095641128718853,
-0.02190759964287281,
0.007340264972299337,
-0.004553924780339003,
0.024467550218105316,
-0.0109015554189682,
0.008872752077877522,
-0.05273148790001869,
0.06572280079126358,
-0.03792905434966087,
-0.01856399141252041,
-0.00930811744183302,
-0.024659110233187675,
0.008041203953325748,
0.017362382262945175,
-0.009726068936288357,
0.007814813405275345,
0.01851174794137478,
0.0015901729930192232,
0.05659753456711769,
0.04524319991469383,
-0.008977239951491356,
0.06561831384897232,
0.02533828094601631,
-0.0033349008299410343,
0.03247827664017677,
0.005816485267132521,
-0.035508424043655396,
-0.008885812945663929,
-0.032147400081157684,
-0.06742943078279495,
-0.005616216920316219,
0.03879978507757187,
-0.022325551137328148,
-0.09717361629009247,
-0.12566393613815308,
-0.012190238572657108,
0.04771607369184494,
-0.0018111211247742176,
0.017606187611818314,
0.01854657754302025,
0.07035508751869202,
-0.03834700584411621,
-0.03136374056339264,
0.0010318165877833962,
-0.03315744921565056,
-0.022412624210119247,
0.005341936368495226,
-0.06217021495103836,
0.0029713704716414213,
0.0032108216546475887,
-0.09006844460964203,
-0.023161452263593674,
0.0076842037960886955,
0.018807796761393547,
0.039182908833026886,
0.006347631104290485,
0.07655469328165054,
-0.03138115629553795,
-0.0017218712018802762,
-0.02784598618745804,
0.005337582901120186,
0.00552914384752512,
0.022969892248511314,
-0.05475158244371414,
-0.12434042990207672,
-0.01805896684527397,
-0.021507063880562782,
-0.022935062646865845,
0.00032870107679627836,
0.013365725055336952,
0.0003199937636964023,
0.03810320049524307,
0.01832018606364727,
-0.04600944370031357,
0.0327046662569046,
0.015298749320209026,
0.034010764211416245,
-0.0036418335512280464,
0.03834700584411621,
-0.0068570091389119625,
-0.021576721221208572,
0.023318184539675713,
0.026278670877218246,
0.033732131123542786,
-0.013069677166640759,
0.021419990807771683,
0.0027406266890466213,
-0.010622921399772167,
-0.005912265740334988,
0.0073184967041015625,
0.04994514584541321,
-0.01814603991806507,
-0.021611550822854042,
-0.009203629568219185,
0.023405257612466812,
-0.013931700959801674,
0.055622316896915436,
0.011572019197046757,
-0.059697337448596954,
-0.005389826837927103,
-0.014349651522934437,
-0.06290163099765778,
0.010762238875031471,
-0.004815143998712301,
-0.006534838583320379,
0.0005346834659576416,
-0.03310520574450493,
0.05506504699587822,
-0.004802083130925894,
-0.025216378271579742,
-0.005968863144516945,
-0.03244344890117645,
-0.012146702036261559,
0.06753391772508621,
-0.02758476696908474,
0.006199606694281101,
0.08024659752845764,
-0.0325305201113224,
-0.008480923250317574,
-0.02937847375869751,
0.04984065890312195,
-0.012616896070539951,
0.0038660468999296427,
0.022342965006828308,
-0.05137314647436142,
0.06655870378017426,
-0.028925694525241852,
0.021245842799544334,
0.03664037212729454,
-0.008803093805909157,
0.11013009399175644,
-0.00387475430034101,
-0.031990669667720795,
-0.014985285699367523,
-0.026696622371673584,
0.034167494624853134,
0.056179583072662354,
-0.015229090116918087,
0.014340944588184357,
0.03733695670962334,
0.06408582627773285,
-0.04148164018988609,
-0.015098480507731438,
-0.05137314647436142,
0.033888861536979675,
-0.08463507890701294,
0.04238719865679741,
0.03536910563707352,
0.012764920480549335,
0.025982622057199478,
-0.05684133991599083,
-0.00636939937248826,
-0.01014401949942112,
0.024693939834833145,
0.0021975080017000437,
-0.0648868978023529,
-0.02754993923008442,
-0.018790381029248238,
0.004168625921010971,
-0.021524477750062943,
0.04015812650322914,
-0.01202479936182499,
0.02568657323718071,
0.028838621452450752,
0.03298330307006836,
0.0443028099834919,
-0.0889539122581482,
0.01457604207098484,
-0.01374014001339674,
0.007640667259693146,
-0.024728769436478615,
-0.028594816103577614,
0.04001881182193756,
0.034184910356998444,
0.004436376038938761,
0.016883479431271553,
0.00829806923866272,
-0.011328213848173618,
0.01564704068005085,
-0.003650540951639414,
-0.054124657064676285,
-0.0439545176923275,
0.012538530863821507,
0.005585741251707077,
0.019678527489304543,
-0.019103845581412315,
-0.004832558799535036,
-0.011545897461473942,
0.055726803839206696,
0.0012505878694355488,
0.020566673949360847,
-0.0200442336499691,
-0.046636369079351425,
-0.009708654135465622,
-0.011258555576205254,
0.03866047039628029,
-0.005986277479678392,
0.023387841880321503,
-0.031903594732284546,
0.023231111466884613,
0.04583529382944107,
-0.022969892248511314,
0.008903227746486664,
0.004754193127155304,
0.06283196806907654,
-0.020810477435588837,
0.02758476696908474,
0.03977500647306442,
0.01659613847732544,
0.02389286644756794,
0.03796388581395149,
-0.0312940813601017,
-0.052278708666563034,
0.0013920816127210855,
0.02572140283882618,
-0.00884227640926838,
-0.07885342836380005,
0.030353693291544914,
-0.056109923869371414,
0.07634571939706802,
0.0037746201269328594,
0.007653728127479553,
0.05973216891288757,
0.024450134485960007,
0.03103286400437355,
0.04743744060397148,
-0.030545253306627274,
-0.015977919101715088,
0.0033675532322376966,
0.023004721850156784,
0.002781986491754651,
-0.0002919670951087028,
0.021245842799544334,
0.002860352396965027,
0.04973617196083069,
0.020444771274924278,
-0.023387841880321503,
-0.01854657754302025,
0.03273949772119522,
-0.024310817942023277,
-0.08191840350627899,
0.0037746201269328594,
-0.06753391772508621,
-0.04346690699458122,
-0.007257545366883278,
0.009160093031823635,
-0.04802953824400902,
-0.01387945655733347,
0.02568657323718071,
-0.057572752237319946,
0.018999356776475906,
0.011432701721787453,
0.013330896385014057,
-0.0691012367606163,
-0.021454818546772003,
-0.007449106313288212,
-0.0034110897686332464,
-0.03841666504740715,
0.03827734664082527,
0.0011863714316859841,
0.005350643768906593,
0.0074882893823087215,
0.0506417341530323,
0.04952719807624817,
-0.0062257288955152035,
0.07202689349651337,
0.0035656446125358343,
-0.009604166261851788,
-0.028142035007476807,
-0.03509047254920006,
-0.02540794014930725,
-0.0019069015979766846,
-0.026156768202781677,
-0.01628267578780651,
-0.04719363525509834,
0.09557146579027176,
0.06422513723373413,
-0.028089791536331177,
0.05638856068253517,
-0.03998398035764694,
0.024624280631542206,
0.01295648142695427,
-0.03117218054831028,
0.014610870741307735,
-0.019069015979766846,
0.014567334204912186,
-0.03451578691601753,
-0.03310520574450493,
0.005659753456711769,
-0.02551242709159851,
-0.01838984526693821,
-0.06109050661325455,
-0.04590495303273201,
0.05067656189203262,
-0.009316825307905674,
0.009760897606611252,
-0.031816523522138596,
0.025129305198788643,
-0.032164815813302994,
-0.02182052657008171,
0.008576703257858753,
-0.01805896684527397,
0.002842937596142292,
0.0044059003703296185,
0.07376835495233536,
-0.002010300988331437,
-0.07098201662302017,
-0.0024097489658743143,
-0.021437404677271843,
0.004386309068650007,
0.03359281271696091,
0.010657751001417637,
0.03733695670962334,
0.04371071234345436,
-0.016099821776151657,
-0.006574021186679602,
0.0036331263836473227,
0.001476977951824665,
0.04423315078020096,
0.044685930013656616,
-0.000052822098950855434,
-0.012094457633793354,
-0.0053071072325110435,
0.040889542549848557,
-0.0508158802986145,
0.03484666720032692,
-0.029831254854798317,
-0.05464709550142288,
0.017588771879673004,
-0.004366717301309109,
0.032077740877866745,
0.019121259450912476,
-0.04552183300256729,
0.014271286316215992,
0.003487278940156102,
0.03347091004252434,
0.012233775109052658,
0.08567996323108673,
0.005616216920316219,
-0.03866047039628029,
-0.03153788670897484,
0.04628807678818703,
-0.059314217418432236,
0.003894345834851265,
-0.0724448412656784,
0.041516467928886414
]
|
36,364 | statistics | _isfinite | null | def _isfinite(x):
try:
return x.is_finite() # Likely a Decimal.
except AttributeError:
return math.isfinite(x) # Coerces to float first.
| (x) | [
0.019057264551520348,
-0.028354361653327942,
0.06397541612386703,
0.05357407033443451,
-0.003962842281907797,
-0.0027895739767700434,
0.008041453547775745,
-0.028140634298324585,
0.006416242569684982,
-0.007912327535450459,
0.035353899002075195,
-0.0021717713680118322,
0.010143095627427101,
-0.08036110550165176,
0.001775486976839602,
0.057812973856925964,
0.003876016242429614,
0.060555797070264816,
0.02981482446193695,
0.025380002334713936,
-0.05688682571053505,
0.045986782759428024,
-0.04099983721971512,
-0.021782275289297104,
0.0011248461669310927,
-0.030509434640407562,
0.0295654758810997,
0.031043751165270805,
-0.003116842359304428,
0.01895040273666382,
-0.0007018461474217474,
0.007280053570866585,
0.00005423166658147238,
-0.013286653906106949,
0.03968185558915138,
0.02801596000790596,
-0.015869179740548134,
-0.005859663709998131,
-0.03772269934415817,
-0.008931979537010193,
0.021087665110826492,
0.0017365264939144254,
-0.06696758419275284,
0.07302316278219223,
-0.020482107996940613,
-0.018914781510829926,
0.047732215374708176,
0.028835244476795197,
-0.036654066294431686,
0.01798863336443901,
0.016154149547219276,
0.006060032173991203,
0.031649310141801834,
0.0313287191092968,
-0.018024254590272903,
0.06757314503192902,
0.026323961094021797,
-0.008776137605309486,
-0.07184766978025436,
0.002310916082933545,
-0.019466906785964966,
0.03316320478916168,
0.04983385652303696,
-0.07195453345775604,
0.006336095277220011,
0.06675385683774948,
-0.025077223777770996,
-0.013340085744857788,
-0.06198063865303993,
-0.03718838095664978,
-0.0666469931602478,
-0.01765913888812065,
-0.06892674416303635,
0.06137508153915405,
0.0001559812662890181,
-0.02646644413471222,
-0.000034420932934153825,
0.06921171396970749,
-0.07822383940219879,
-0.01355381216853857,
-0.04694855213165283,
-0.014016885310411453,
-0.038221392780542374,
-0.0011042527621611953,
-0.008963148109614849,
0.025397812947630882,
0.005089358426630497,
0.04986947774887085,
0.03800766542553902,
0.11534097790718079,
-0.008776137605309486,
0.008931979537010193,
0.014399811625480652,
-0.03207676112651825,
0.012039916589856148,
0.0691760927438736,
0.02251250669360161,
-0.04737600311636925,
-0.009332716464996338,
-0.03872008994221687,
0.03351941332221031,
0.02630615048110485,
0.005227390211075544,
0.00032726844074204564,
-0.0007508251001127064,
0.00909227505326271,
0.04566619545221329,
-0.0706365555524826,
0.018255790695548058,
-0.01806878112256527,
-0.030687540769577026,
-0.05371655151247978,
-0.0008393211173824966,
0.018914781510829926,
0.0011966448510065675,
-0.06336986273527145,
0.01388330664485693,
0.06044893339276314,
-0.022423455491662025,
-0.009644401259720325,
-0.0278200451284647,
0.0385776050388813,
-0.05649499595165253,
0.006937200669199228,
0.06746628135442734,
-0.03556762635707855,
0.03790080547332764,
-0.023830486461520195,
0.006296021863818169,
0.05222046747803688,
0.052291709929704666,
-0.0061223688535392284,
0.0460936464369297,
0.04263840615749359,
-0.0380789078772068,
0.0426027849316597,
-0.04751848801970482,
-0.0006267079734243453,
-0.02044648677110672,
-0.010125285014510155,
-0.04954889044165611,
-0.011817285791039467,
-0.03864884749054909,
0.02450728602707386,
0.03412497043609619,
0.08442190289497375,
-0.012413938529789448,
0.019520338624715805,
-0.040572382509708405,
-0.023937350139021873,
-0.030295709148049355,
0.012494085356593132,
0.004022953100502491,
0.02320711873471737,
-0.02149730734527111,
-0.0313287191092968,
0.012057727202773094,
0.06005709990859032,
-0.041569773107767105,
-0.006612158380448818,
-0.03398248925805092,
0.036760929971933365,
0.03683217242360115,
0.004443726968020201,
-0.032753560692071915,
-0.051401183009147644,
-0.0431014783680439,
-0.036511581391096115,
0.013990169391036034,
0.08157221972942352,
-0.009377242997288704,
0.04602240398526192,
-0.018104402348399162,
0.022779665887355804,
0.036458149552345276,
-0.0018578607123345137,
0.01117610651999712,
0.024578528478741646,
0.0008476698421873152,
0.040821731090545654,
-0.015147854574024677,
-0.020161516964435577,
-0.07077904045581818,
-0.019306613132357597,
0.0156643595546484,
0.03606631979346275,
-0.021087665110826492,
-0.046485479921102524,
-0.016483644023537636,
-0.011790569871664047,
0.008237369358539581,
0.0421040877699852,
0.03362627699971199,
-0.017668044194579124,
-0.011291874572634697,
-0.0043235057964921,
0.01738307625055313,
0.01450667530298233,
0.02710762433707714,
-0.028603708371520042,
-0.0023688003420829773,
-0.08078855276107788,
0.014818359166383743,
-0.041712258011102676,
-0.05076000466942787,
0.02140825428068638,
-0.11619588732719421,
-0.031756170094013214,
-0.01738307625055313,
-0.0009712303872220218,
-0.051650531589984894,
-0.008108243346214294,
-0.022939959540963173,
0.06319175660610199,
0.00433686375617981,
0.0440988689661026,
0.025219708681106567,
-0.01147888507694006,
0.005979884881526232,
-0.006313832011073828,
0.01135421171784401,
-0.013464759103953838,
0.06240808963775635,
0.006153537426143885,
0.03693903610110283,
0.02124796062707901,
0.022583749145269394,
0.07444800436496735,
0.02240564487874508,
-0.022138485684990883,
0.0070663271471858025,
0.022565938532352448,
-0.029494235292077065,
0.014640253968536854,
0.008575769141316414,
-0.02917364425957203,
0.055497605353593826,
0.0005844079423695803,
0.026288339868187904,
-0.02320711873471737,
-0.02279747650027275,
-0.008878548629581928,
-0.050938110798597336,
-0.041819121688604355,
0.010632885619997978,
-0.02099861204624176,
0.01375863328576088,
0.04285212978720665,
-0.004924611188471317,
0.035549815744161606,
0.007391368970274925,
0.00286304228939116,
0.02000122331082821,
-0.046236131340265274,
0.07045844942331314,
-0.07227512449026108,
-0.060306448489427567,
0.03893381357192993,
0.05439335107803345,
0.023438654839992523,
0.0070173479616642,
-0.013313369825482368,
0.007511590141803026,
0.06144632026553154,
-0.06693196296691895,
0.021586360409855843,
-0.023474276065826416,
-0.060555797070264816,
0.07077904045581818,
0.015824655070900917,
0.1132749617099762,
-0.07006661593914032,
0.014301854185760021,
-0.012912632897496223,
0.007048516534268856,
-0.008103790692985058,
-0.04221095144748688,
-0.03243297338485718,
0.014132654294371605,
0.033359117805957794,
0.03779394179582596,
-0.03278918191790581,
0.006955011282116175,
0.04146290943026543,
-0.015495159663259983,
0.0656852275133133,
-0.032094571739435196,
-0.06290678679943085,
0.004982495214790106,
0.020535539835691452,
-0.025344381108880043,
0.01859419047832489,
0.03556762635707855,
-0.005418853368610144,
-0.03136434033513069,
-0.005338705610483885,
0.0070440638810396194,
-0.04149853065609932,
0.00683924276381731,
-0.006794716697186232,
0.02776661328971386,
-0.01763242296874523,
-0.0255581084638834,
0.01456010714173317,
0.07808135449886322,
0.00026924509438686073,
-0.00044164544669911265,
0.045131877064704895,
0.012583138421177864,
0.03640471771359444,
-0.026537686586380005,
-0.017329644411802292,
0.007565021980553865,
-0.03629785776138306,
-0.010757558979094028,
0.022334402427077293,
-0.008776137605309486,
-0.04213970899581909,
-0.033893436193466187,
-0.018825728446245193,
-0.0009411750943399966,
0.05428649112582207,
-0.01798863336443901,
0.025077223777770996,
-0.03932564705610275,
0.06639765202999115,
-0.0033461530692875385,
0.022690612822771072,
-0.05517701432108879,
0.015317054465413094,
0.04787470027804375,
-0.03599507734179497,
0.05759924650192261,
0.029529856517910957,
-0.008077074773609638,
0.019377853721380234,
0.006576537620276213,
-0.02491692826151848,
0.04677044600248337,
-0.043172720819711685,
0.0034218477085232735,
0.0005782856023870409,
0.0076050953939557076,
-0.02274404466152191,
-0.004701979458332062,
0.023438654839992523,
-0.0022085055243223906,
-0.038506362587213516,
0.1007363498210907,
0.05225608870387077,
-0.06269305944442749,
0.006532011087983847,
0.00954644288867712,
-0.03237954154610634,
0.0034641476813703775,
0.0220494344830513,
0.005285274237394333,
-0.016171960160136223,
-0.006180253345519304,
0.053395964205265045,
0.029583286494016647,
0.01290372759103775,
-0.017881769686937332,
0.010534927248954773,
-0.007671885192394257,
-0.02530875988304615,
-0.0007452592835761607,
0.02199600264430046,
-0.002731689717620611,
0.026234908029437065,
-0.032753560692071915,
-0.02384829707443714,
-0.04270964488387108,
-0.04199722409248352,
-0.030847834423184395,
0.0032348372042179108,
0.030687540769577026,
0.004902347922325134,
-0.006612158380448818,
0.04121356084942818,
0.020873939618468285,
-0.05275478586554527,
-0.038221392780542374,
-0.040109310299158096,
0.03978871926665306,
-0.011104864068329334,
0.033305685967206955,
-0.031043751165270805,
0.02149730734527111,
-0.008669274859130383,
0.02790909819304943,
-0.02710762433707714,
0.04516749829053879,
0.03854198381304741,
-0.027784423902630806,
-0.02144387550652027,
0.06593457609415054,
-0.06205188110470772,
-0.008103790692985058,
-0.00700399000197649,
0.03364408761262894,
0.023385223001241684,
0.02464977093040943,
0.036262236535549164,
0.04530998319387436,
0.004209963604807854,
-0.004454858135432005,
-0.0656852275133133,
0.02119452878832817,
0.03588821366429329,
0.10493963211774826,
-0.04018055275082588,
-0.07459048926830292,
-0.003795868717133999,
0.008433285169303417,
0.023278361186385155,
-0.06009272113442421,
-0.0466279610991478,
0.02765974961221218,
-0.03328787535429001,
0.04495377466082573,
-0.017668044194579124,
0.01099800132215023,
-0.014622443355619907,
-0.034249644726514816,
-0.02370581217110157,
-0.026573307812213898,
-0.06304927170276642,
-0.01713372766971588,
0.04869398474693298,
-0.10066510736942291,
-0.029903877526521683,
-0.00909227505326271,
-0.039966825395822525,
0.029992928728461266,
-0.018086591735482216,
-0.04174787923693657,
-0.04516749829053879,
-0.07006661593914032,
0.043778277933597565,
-0.0020203818567097187,
0.045381225645542145,
-0.0028185159899294376,
-0.0023175950627774,
0.0370815210044384,
-0.0303135197609663,
0.06906922906637192,
0.017774907872080803,
0.01923537068068981,
0.008695990778505802,
-0.062265604734420776,
-0.06084076315164566,
-0.010107474401593208,
-0.03414278104901314,
-0.027446024119853973,
-0.0019758555572479963,
-0.02776661328971386,
0.01551297027617693,
0.03042038157582283,
0.01773928664624691,
-0.0867016538977623,
0.016652842983603477,
-0.05503453314304352,
-0.06547150015830994,
0.0009133461280725896,
-0.011487790383398533,
0.008669274859130383,
0.006407337263226509,
0.011140485294163227,
0.009078917093575,
-0.010107474401593208,
0.047732215374708176,
-0.016483644023537636,
-0.02260155975818634,
-0.00030138753936626017,
0.0003300513490103185,
-0.05877474322915077,
0.046378616243600845,
0.06621954590082169,
0.00560141121968627,
0.009332716464996338,
0.019520338624715805,
0.011256253346800804,
-0.00424113217741251,
0.026145854964852333,
-0.008362042717635632,
-0.03932564705610275,
0.028140634298324585,
0.02710762433707714,
-0.038114529103040695,
0.03636910021305084,
-0.021087665110826492,
0.026876086369156837,
-0.03889819234609604,
0.06475908309221268,
-0.013767538592219353,
-0.002357668709009886,
0.050190068781375885,
0.07858005166053772,
-0.028674950823187828,
-0.019377853721380234,
0.05246981605887413,
-0.019573770463466644,
-0.0006845921743661165,
-0.004982495214790106,
-0.027428213506937027,
0.02741040289402008,
-0.0006428487249650061,
-0.037758320569992065,
-0.0375802144408226,
-0.006269305944442749,
0.03528265655040741,
0.0008187277126125991,
0.01964501291513443,
0.024667581543326378,
0.009867032989859581,
0.013812064193189144,
-0.08328203111886978,
-0.008224011398851871,
-0.03341254964470863,
0.01478273794054985,
-0.037259623408317566,
-0.02420450747013092,
0.018380464985966682,
-0.02936956100165844,
0.056958068162202835,
-0.0591309517621994,
0.0023888370487838984,
-0.0245607178658247,
0.00621587410569191,
0.03346598148345947,
0.00879840087145567,
0.057207416743040085,
0.03889819234609604,
-0.05603192001581192,
-0.07056531310081482,
-0.024578528478741646,
-0.03341254964470863,
-0.026038991287350655,
-0.007538306061178446,
-0.04213970899581909,
-0.037259623408317566,
0.00842883251607418,
0.01895040273666382,
0.05368093028664589,
-0.06347671896219254,
0.02986825630068779,
0.050938110798597336,
-0.0034307530149817467,
-0.0029053424950689077,
-0.024721013382077217,
-0.03567448630928993,
0.028906486928462982,
-0.02621709741652012,
0.05759924650192261,
-0.0005064869183115661,
0.007199905812740326,
0.0852055698633194,
-0.025575919076800346,
-0.028140634298324585,
-0.019306613132357597,
-0.01964501291513443,
0.09631933271884918,
-0.06757314503192902,
-0.05891722813248634,
-0.06682509928941727,
-0.028746193274855614,
-0.023296169936656952,
0.009225853718817234,
0.04545246809720993,
0.047589730471372604,
-0.024275749921798706,
-0.0185407605022192,
0.03426745533943176,
0.03378657251596451,
0.026929518207907677,
-0.04053676128387451,
0.003599952906370163,
-0.03847074136137962,
-0.06689634174108505,
0.008286348544061184,
-0.05752800405025482,
-0.03471272066235542,
0.00044526319834403694,
-0.020410865545272827,
0.000289699382847175,
-0.04541684687137604,
-0.012823579832911491,
-0.005988790187984705,
0.05845415219664574,
0.021924760192632675,
-0.0014704817440360785,
0.040572382509708405,
-0.04915705695748329,
0.0026426371186971664,
0.024596339091658592,
-0.0036422531120479107,
0.01740979216992855,
0.08962257951498032,
-0.028906486928462982,
-0.04042989760637283,
0.04484691098332405,
-0.014284043572843075,
-0.012369411997497082,
-0.017578991129994392,
0.03193427622318268,
-0.02044648677110672,
0.026288339868187904,
0.01859419047832489,
-0.04035865515470505,
-0.004000689834356308,
0.05517701432108879,
0.002589205512776971,
0.028479034081101418,
0.004009595140814781,
0.03975309804081917,
0.008005832321941853,
-0.023688001558184624,
-0.013001685962080956,
0.041712258011102676,
-0.045630574226379395,
-0.028888676315546036,
0.0026938423980027437,
-0.01468478050082922,
0.04039427638053894,
-0.01608290709555149,
0.03526484593749046,
-0.06735941767692566,
-0.027374781668186188,
-0.012618758715689182,
-0.023029012605547905,
0.023367412388324738,
-0.03668968752026558,
0.011728232726454735,
-0.04602240398526192,
-0.0004486026882659644,
-0.010802085511386395,
0.028389981016516685,
0.002029287163168192,
0.024774445220828056,
-0.0411066971719265,
0.009163516573607922,
-0.023777054622769356,
-0.02600337192416191,
0.010312295518815517,
-0.05097373202443123,
-0.017757097259163857,
-0.014729307033121586,
0.07608657330274582,
0.0021996002178639174,
-0.008370948024094105,
0.03141777217388153,
-0.005093811079859734,
-0.05407276377081871,
0.01613633893430233,
0.027535077184438705,
0.018879160284996033,
0.030153224244713783,
-0.0012100028106942773,
-0.02525532804429531,
0.03371533006429672,
-0.08983630686998367,
-0.0526123009622097,
0.039574991911649704,
0.08883891254663467,
-0.009804695844650269,
-0.06379730999469757,
-0.0020526633597910404,
0.01738307625055313,
-0.03437431901693344,
0.0086470115929842,
0.06319175660610199,
-0.005815137643367052,
0.007061874493956566,
-0.043172720819711685,
-0.04288775101304054,
-0.024026403203606606,
0.014417622238397598,
-0.0187901072204113,
0.0069461059756577015,
0.06639765202999115,
-0.014257327653467655,
0.01829141192138195,
0.026947328820824623,
-0.01022324338555336,
-0.06757314503192902,
-0.0014014659682288766,
0.0014905185671523213,
0.02169322408735752,
0.018665432929992676,
-0.015477349050343037,
-0.011496695689857006,
0.00005329243867890909,
0.034053727984428406,
0.04270964488387108,
-0.04299461469054222,
0.0008031434845179319,
0.11135142296552658,
0.03312758356332779,
-0.01773928664624691,
0.01558421179652214,
0.01864762231707573,
0.012405033223330975,
0.06333424150943756,
0.026947328820824623,
-0.024489475414156914,
-0.0021795632783323526,
0.028176255524158478,
-0.03943251073360443,
-0.013990169391036034,
-0.027784423902630806,
0.03506892919540405,
-0.029654528945684433,
0.009964990429580212,
-0.008931979537010193,
0.0681786984205246,
0.009127895347774029,
0.029654528945684433,
0.032557643949985504,
0.001558421179652214,
0.012013201601803303,
-0.031239666044712067,
-0.015984948724508286,
0.04338644817471504,
-0.050332553684711456,
-0.007538306061178446,
-0.04481128975749016,
-0.025985561311244965,
0.02169322408735752,
-0.07134897261857986,
0.012663285247981548,
0.026573307812213898,
-0.0034129424020648003,
0.025130655616521835,
-0.025700591504573822,
-0.01704467460513115,
-0.055960677564144135,
0.06532901525497437,
-0.08449314534664154,
-0.02301120199263096,
-0.028906486928462982,
-0.05845415219664574,
0.015789033845067024,
-0.004138721618801355,
0.020125897601246834,
-0.012369411997497082,
0.02726791799068451,
0.04042989760637283,
-0.03524703532457352,
0.025469055399298668,
0.005681558512151241,
-0.02334960177540779,
0.002526868600398302,
0.003326116129755974,
0.03207676112651825,
0.014097033068537712,
-0.03533608838915825,
0.012859201058745384,
0.0009812487987801433,
-0.020125897601246834,
-0.009288190864026546,
-0.005516811273992062,
0.06643327325582504,
0.023919539526104927,
-0.05667310208082199,
0.01245846413075924,
-0.04922829940915108,
0.03854198381304741
]
|
36,365 | statistics | _ss | Return sum of square deviations of sequence data.
If ``c`` is None, the mean is calculated in one pass, and the deviations
from the mean are calculated in a second pass. Otherwise, deviations are
calculated from ``c`` as given. Use the second case with care, as it can
lead to garbage results.
| def _ss(data, c=None):
"""Return sum of square deviations of sequence data.
If ``c`` is None, the mean is calculated in one pass, and the deviations
from the mean are calculated in a second pass. Otherwise, deviations are
calculated from ``c`` as given. Use the second case with care, as it can
lead to garbage results.
"""
if c is not None:
T, total, count = _sum((x-c)**2 for x in data)
return (T, total)
T, total, count = _sum(data)
mean_n, mean_d = (total / count).as_integer_ratio()
partials = Counter()
for n, d in map(_exact_ratio, data):
diff_n = n * mean_d - d * mean_n
diff_d = d * mean_d
partials[diff_d * diff_d] += diff_n * diff_n
if None in partials:
# The sum will be a NAN or INF. We can ignore all the finite
# partials, and just look at this special one.
total = partials[None]
assert not _isfinite(total)
else:
total = sum(Fraction(n, d) for d, n in partials.items())
return (T, total)
| (data, c=None) | [
-0.04437950626015663,
0.004310141783207655,
0.057033464312553406,
0.030184589326381683,
0.07280559092760086,
0.013170633465051651,
0.029785754159092903,
-0.055365607142448425,
0.02206284925341606,
0.06348734349012375,
-0.016941441223025322,
0.027646545320749283,
0.009970885701477528,
-0.006254464387893677,
-0.036130864173173904,
0.0788968950510025,
-0.007228891830891371,
-0.003664300311356783,
-0.025525467470288277,
-0.029640723019838333,
-0.03176180273294449,
-0.003265464911237359,
-0.055111803114414215,
0.058810096234083176,
-0.06301599740982056,
0.03161676973104477,
0.04013734683394432,
-0.06210955232381821,
-0.025144759565591812,
-0.025144759565591812,
0.055981989949941635,
0.025869915261864662,
-0.013515082187950611,
-0.034644294530153275,
0.005778581369668245,
0.01702302135527134,
0.018636491149663925,
-0.03933967649936676,
-0.08607593178749084,
-0.0014582419535145164,
-0.020159317180514336,
0.011656871065497398,
-0.033302757889032364,
0.030438393354415894,
0.04307422414422035,
0.051776088774204254,
0.018962811678647995,
0.03966599702835083,
-0.08157996833324432,
-0.028407959267497063,
0.03016646020114422,
-0.04314674064517021,
-0.055148061364889145,
0.022588588297367096,
0.04122507944703102,
0.06417624652385712,
-0.031888704746961594,
0.027537772431969643,
-0.0048812017776072025,
-0.028208540752530098,
0.0774465873837471,
0.014077077619731426,
0.030329620465636253,
-0.007419245317578316,
-0.051268480718135834,
-0.006775669753551483,
0.026232494041323662,
-0.029568208381533623,
0.0027193324640393257,
0.005547438282519579,
-0.04336428642272949,
0.017086472362279892,
0.009698952548205853,
-0.04332802817225456,
0.04249409958720207,
0.009753338992595673,
0.058483775705099106,
-0.026087462902069092,
-0.017304018139839172,
-0.04162391275167465,
0.057794876396656036,
0.012363897636532784,
0.03763556107878685,
0.005674340296536684,
0.011058618314564228,
0.020014286041259766,
0.030800972133874893,
0.04448827728629112,
-0.09383509308099747,
0.08041972666978836,
0.008479785174131393,
-0.03448113426566124,
0.03930341824889183,
0.028897438198328018,
-0.022806134074926376,
0.06722189486026764,
-0.0926748514175415,
-0.033230241388082504,
0.0034490199759602547,
-0.024292701855301857,
0.061094336211681366,
0.09572049975395203,
0.04786024987697601,
0.006739411968737841,
0.009970885701477528,
-0.019687967374920845,
0.03187057748436928,
0.003723219269886613,
0.03850574791431427,
0.03585892915725708,
-0.027990994974970818,
0.00631338357925415,
0.013252213597297668,
0.021392080932855606,
-0.07102896273136139,
-0.074183389544487,
0.0005265873624011874,
0.06120310723781586,
-0.057359784841537476,
0.01858210377395153,
-0.036130864173173904,
0.0026876069605350494,
-0.02467340975999832,
0.030347749590873718,
0.013678241521120071,
0.004001950845122337,
0.03221502527594566,
-0.0037050903774797916,
-0.017503436654806137,
0.06907103955745697,
0.04557600989937782,
-0.005873757880181074,
0.0763588547706604,
0.027320226654410362,
-0.011085812002420425,
0.04927430301904678,
0.052827563136816025,
0.010405978187918663,
0.04912927374243736,
-0.04311048239469528,
0.013279406353831291,
0.048621661961078644,
-0.03647531196475029,
0.03223315253853798,
0.056525856256484985,
0.03720046579837799,
0.03836071491241455,
0.04572104290127754,
-0.016053125262260437,
0.055728185921907425,
-0.03408230096101761,
0.04078998416662216,
0.07425590604543686,
0.0018106221687048674,
0.07095644623041153,
-0.04343680292367935,
0.024836570024490356,
-0.03883206471800804,
-0.050325777381658554,
-0.026903262361884117,
-0.005497583653777838,
0.009934627451002598,
-0.02097511664032936,
0.01811075396835804,
-0.0010667714523151517,
-0.013107182458043098,
-0.058955125510692596,
0.027175195515155792,
-0.022987423464655876,
-0.06609790772199631,
-0.033484045416116714,
0.003931701648980379,
-0.04564852640032768,
0.02249794267117977,
0.03923090174794197,
-0.059100158512592316,
-0.04597484692931175,
-0.006943361833691597,
-0.007636792026460171,
-0.07262430340051651,
0.035659510642290115,
-0.01847333088517189,
0.002608292968943715,
0.04448827728629112,
-0.015019779093563557,
0.04031863436102867,
0.012545187026262283,
-0.030655940994620323,
0.008262238465249538,
-0.01970609463751316,
-0.04231281206011772,
-0.022443557158112526,
-0.04307422414422035,
0.03375598043203354,
0.03016646020114422,
0.00905537698417902,
-0.0476064458489418,
-0.01014310959726572,
0.0126267671585083,
-0.060514211654663086,
-0.08477065712213516,
-0.023059938102960587,
0.016606057062745094,
0.007247020956128836,
0.016433831304311752,
-0.04742515832185745,
-0.03357468917965889,
0.04100753366947174,
-0.03254134580492973,
0.02050376683473587,
-0.014403397217392921,
0.020703183487057686,
0.006988684181123972,
0.006181948818266392,
0.024473991245031357,
0.01905345544219017,
0.056235793977975845,
-0.0828852504491806,
0.008783443830907345,
-0.03245069831609726,
0.034317974001169205,
-0.052211180329322815,
0.030565295368433,
0.024909084662795067,
0.006943361833691597,
-0.0037912025582045317,
0.03575015813112259,
0.052537500858306885,
-0.013877660036087036,
0.014484977349638939,
0.03016646020114422,
-0.023712579160928726,
0.027519643306732178,
0.007754629477858543,
-0.008547767996788025,
-0.030873486772179604,
-0.06181949004530907,
0.028661763295531273,
0.025543594732880592,
-0.028806794434785843,
-0.09144208580255508,
-0.035079386085271835,
-0.03799813613295555,
0.0223529115319252,
-0.017503436654806137,
-0.04586607217788696,
-0.024020768702030182,
0.02206284925341606,
-0.033048953860998154,
0.016932375729084015,
0.00279411394149065,
-0.0356413833796978,
0.029894527047872543,
-0.06243587285280228,
-0.019941771402955055,
-0.01879965141415596,
0.016352253034710884,
0.10028897970914841,
0.04873043671250343,
-0.025869915261864662,
0.031272321939468384,
0.013877660036087036,
0.029368789866566658,
0.03778059035539627,
-0.057178497314453125,
-0.004427979700267315,
-0.004944652784615755,
-0.008697331883013248,
-0.04452453553676605,
0.04593858867883682,
0.04267539083957672,
0.018926553428173065,
0.032142508774995804,
-0.04854914918541908,
-0.0034626165870577097,
0.015400486066937447,
0.048621661961078644,
0.06479262560606003,
0.0662066787481308,
-0.013460695743560791,
0.005406939424574375,
0.02021370455622673,
-0.013651048764586449,
0.0033742382656782866,
0.027574030682444572,
-0.02344064600765705,
-0.009989013895392418,
-0.085060715675354,
0.02246168628334999,
0.022153494879603386,
0.004958249628543854,
-0.08274021744728088,
-0.028988083824515343,
-0.005556502379477024,
0.02213536575436592,
0.04597484692931175,
-0.04655497148633003,
-0.028679892420768738,
0.012372962199151516,
0.03556886687874794,
-0.017630338668823242,
-0.00959924329072237,
0.0890490710735321,
0.061094336211681366,
-0.01666044257581234,
0.010351591743528843,
-0.005257376004010439,
-0.053588975220918655,
-0.0113577451556921,
-0.022516071796417236,
-0.034571778029203415,
0.02188156172633171,
-0.011058618314564228,
0.04456079378724098,
0.003841056954115629,
0.032650116831064224,
-0.013351921923458576,
0.010551009327173233,
0.03400978446006775,
0.028009124100208282,
0.022008463740348816,
-0.02347690239548683,
0.09601056575775146,
0.04840411618351936,
0.024292701855301857,
0.04013734683394432,
-0.03221502527594566,
-0.0403548926115036,
0.04394441097974777,
-0.03513377532362938,
-0.02079382911324501,
-0.04793276637792587,
-0.0007415845757350326,
0.050543323159217834,
-0.03803439438343048,
0.006970555521547794,
0.01778443343937397,
-0.027936607599258423,
-0.01610751263797283,
-0.08157996833324432,
0.025380436331033707,
0.06472010910511017,
0.013787015341222286,
0.017766304314136505,
-0.022080978378653526,
-0.02449212037026882,
0.01141213160008192,
-0.06464759260416031,
-0.009880241006612778,
-0.000605617999099195,
-0.013089053332805634,
-0.053045108914375305,
0.028353571891784668,
0.026359396055340767,
0.04902049899101257,
0.08368292450904846,
0.01081387884914875,
-0.0374542698264122,
0.02228039689362049,
-0.06279844790697098,
0.03727298229932785,
0.08455310761928558,
0.013125310651957989,
-0.02180904522538185,
0.052428729832172394,
0.006793798878788948,
-0.033085212111473083,
-0.011965062469244003,
-0.021355824545025826,
-0.00022689429169986397,
-0.00970801617950201,
-0.024945342913269997,
-0.027501514181494713,
-0.024020768702030182,
0.03756304457783699,
0.007722903974354267,
-0.02307806722819805,
-0.01019749604165554,
-0.030800972133874893,
0.04209526628255844,
-0.026576941832900047,
-0.020304348319768906,
-0.04166017100214958,
0.035913314670324326,
0.020485637709498405,
0.0006571720005013049,
-0.08223260939121246,
0.019724223762750626,
-0.057867392897605896,
0.033484045416116714,
-0.00999807845801115,
-0.004165110643953085,
0.033085212111473083,
-0.03988354280591011,
-0.028317315503954887,
0.031816188246011734,
0.057396043092012405,
-0.006417624652385712,
-0.08861397951841354,
0.056235793977975845,
-0.012073835358023643,
-0.032758891582489014,
-0.021065762266516685,
-0.0051032803021371365,
-0.03767181932926178,
-0.01560896821320057,
-0.04082624241709709,
-0.03665659949183464,
-0.005597292445600033,
0.031743671745061874,
-0.033302757889032364,
-0.024473991245031357,
0.025525467470288277,
0.011330551467835903,
-0.024455862119793892,
-0.006503736600279808,
-0.06533649563789368,
0.016433831304311752,
-0.029967043548822403,
0.02260671742260456,
0.06950613856315613,
-0.07095644623041153,
0.01963357999920845,
0.025471080094575882,
0.04938307777047157,
-0.04673625901341438,
-0.013397243805229664,
-0.07233424484729767,
-0.003580454271286726,
-0.000527437194250524,
-0.024600893259048462,
0.019615450873970985,
-0.07262430340051651,
-0.024691538885235786,
-0.017322147265076637,
-0.01052381657063961,
-0.01778443343937397,
0.07193540781736374,
0.03774433210492134,
-0.021355824545025826,
0.015980610623955727,
0.052283696830272675,
-0.0008412934839725494,
-0.010850136168301105,
-0.02195407636463642,
-0.006385898683220148,
-0.005402407143265009,
-0.011638742871582508,
-0.04630116745829582,
-0.056779660284519196,
0.013370051048696041,
-0.052392471581697464,
0.02496347203850746,
0.0236219335347414,
-0.008012966252863407,
-0.025144759565591812,
0.012998408637940884,
-0.028426088392734528,
-0.01756688766181469,
0.03792562335729599,
0.009100698865950108,
-0.0018355493666604161,
-0.004151514265686274,
-0.04608361795544624,
-0.006680493243038654,
-0.017149923369288445,
-0.008303028531372547,
0.02478218264877796,
0.02318684011697769,
0.015046972781419754,
0.03192496299743652,
0.020920731127262115,
-0.007831676863133907,
-0.0011058618547394872,
0.01622534915804863,
-0.008067352697253227,
-0.03879581019282341,
-0.028698021546006203,
0.009291051886975765,
0.01589903049170971,
0.03850574791431427,
0.002590164076536894,
-0.004767896141856909,
0.028208540752530098,
-0.0034286249428987503,
0.018192334100604057,
-0.022479813545942307,
-0.024619022384285927,
0.056743402034044266,
-0.0035441964864730835,
0.005298166070133448,
0.02365819178521633,
0.036348409950733185,
-0.033085212111473083,
-0.08730869740247726,
-0.03720046579837799,
0.052682533860206604,
0.005021700635552406,
0.015264519490301609,
-0.014974457211792469,
0.01161154918372631,
-0.021645884960889816,
0.014557492919266224,
-0.0374542698264122,
0.02133769541978836,
0.04118882119655609,
-0.03132670745253563,
0.0072243595495820045,
-0.04604736343026161,
0.01032439898699522,
-0.04503214359283447,
-0.0012724209809675813,
0.03132670745253563,
-0.014693459495902061,
0.03774433210492134,
-0.06319728493690491,
0.028172284364700317,
-0.011729386635124683,
0.018563976511359215,
-0.03288579359650612,
0.015835579484701157,
-0.009227600879967213,
-0.052791304886341095,
0.06928858906030655,
-0.004944652784615755,
-0.0033765044063329697,
-0.049854427576065063,
-0.031290452927351,
-0.028589248657226562,
-0.006825524382293224,
0.009553921408951283,
0.030220847576856613,
-0.0061502233147621155,
0.0048086862079799175,
-0.01213728729635477,
-0.009789596311748028,
0.02199033461511135,
-0.07846180349588394,
0.019325388595461845,
0.008525107055902481,
0.008869555778801441,
0.013234084472060204,
0.08390046656131744,
0.048331599682569504,
0.0338284932076931,
0.04764270409941673,
-0.02028621919453144,
-0.012264189310371876,
0.0013913917355239391,
-0.012064771726727486,
-0.010786685161292553,
-0.032650116831064224,
0.006852717604488134,
0.052102409303188324,
-0.0071971663273870945,
0.020775699988007545,
-0.013442566618323326,
-0.001219167374074459,
-0.01582651399075985,
-0.0461561344563961,
-0.027356483042240143,
-0.026141848415136337,
0.027791576460003853,
-0.04786024987697601,
0.011774709448218346,
-0.016053125262260437,
0.04387189447879791,
-0.025869915261864662,
-0.06559029966592789,
-0.035877060145139694,
-0.07461848109960556,
0.056960947811603546,
0.04492337256669998,
0.011167392134666443,
0.015889964997768402,
-0.031199807301163673,
0.0031023051124066114,
-0.04637368023395538,
-0.019289130344986916,
-0.04927430301904678,
-0.0005920213297940791,
-0.04260287433862686,
0.0005076086963526905,
-0.015536452643573284,
0.04129759594798088,
0.008380075916647911,
-0.0639224424958229,
-0.010587267577648163,
-0.051377251744270325,
0.005125941708683968,
-0.02213536575436592,
-0.04307422414422035,
-0.06334231793880463,
-0.029695110395550728,
0.008579493500292301,
-0.03089161589741707,
0.006091304589062929,
0.015436743386089802,
-0.028462344780564308,
0.025289790704846382,
-0.0738208070397377,
0.032323796302080154,
0.013614790514111519,
0.004795089364051819,
0.02438334748148918,
0.01792946457862854,
0.031054776161909103,
-0.028281057253479958,
0.006476543378084898,
-0.04825908690690994,
0.0032881260849535465,
0.0468812920153141,
-0.04296545311808586,
0.03517003357410431,
0.011829095892608166,
-0.004876669496297836,
-0.025144759565591812,
-0.020014286041259766,
0.006181948818266392,
0.03607647493481636,
0.0017143124714493752,
0.03741801530122757,
-0.016134705394506454,
-0.01579025760293007,
-0.01204664260149002,
0.07084767520427704,
0.02054002322256565,
0.033266499638557434,
-0.03513377532362938,
-0.056127019226551056,
0.013741693459451199,
0.03205186501145363,
0.050289519131183624,
-0.0027963800821453333,
0.02467340975999832,
0.027229581028223038,
0.0025539062917232513,
0.025779271498322487,
-0.027990994974970818,
0.06384992599487305,
0.050905901938676834,
0.012572379782795906,
0.02083008550107479,
-0.019869254902005196,
0.005542906001210213,
0.011783774010837078,
0.003333448199555278,
-0.04097127541899681,
0.03836071491241455,
0.06033292040228844,
-0.016461025923490524,
0.08339285850524902,
-0.0036325748078525066,
-0.02054002322256565,
0.058520033955574036,
0.03981102630496025,
0.012490800581872463,
-0.04227655380964279,
-0.029350660741329193,
-0.020195575430989265,
0.02438334748148918,
0.005076087079942226,
-0.01734934002161026,
0.01184722501784563,
0.0008152332156896591,
0.03622150793671608,
0.009662694297730923,
0.04673625901341438,
-0.04383563995361328,
-0.028806794434785843,
-0.04630116745829582,
0.07621382176876068,
-0.02021370455622673,
-0.0056108892895281315,
-0.03966599702835083,
0.01905345544219017,
0.005792178213596344,
-0.035441964864730835,
-0.021392080932855606,
-0.02246168628334999,
0.004695380572229624,
-0.006045982241630554,
0.029187500476837158,
-0.036167122423648834,
-0.025924302637577057,
-0.014920070767402649,
-0.0035283337347209454,
-0.03578641265630722,
0.009843983687460423,
-0.04111630469560623,
-0.03163490071892738,
-0.01912597194314003,
-0.031163549050688744,
-0.04100753366947174,
-0.020485637709498405,
-0.004931055940687656,
-0.006258996669203043,
0.07614130526781082,
0.07182662934064865,
-0.011094876565039158,
0.01582651399075985,
-0.03908587247133255,
0.02028621919453144,
0.019325388595461845,
-0.004151514265686274,
0.0062227388843894005,
-0.0015352898044511676,
-0.019107842817902565,
0.03966599702835083,
-0.009417954832315445,
0.006549058947712183,
-0.025960559025406837,
-0.06888975203037262,
0.06200077757239342,
-0.0378168486058712,
-0.032142508774995804,
0.017041150480508804,
0.005325359292328358,
0.024220187216997147,
0.019724223762750626,
-0.005715130362659693,
0.0034875439014285803,
0.06827337294816971,
0.019361646845936775,
-0.0457935556769371,
0.04140636697411537,
0.07483603060245514,
-0.00045350531581789255,
0.06287096440792084,
-0.0006333778146654367,
-0.021500855684280396,
-0.013850466348230839,
0.0017675660783424973,
0.03919464349746704,
-0.007038538809865713,
0.04191397503018379,
-0.01066884770989418,
-0.04224029555916786,
0.003915838431566954,
-0.03904961422085762,
0.0035895188339054585,
0.005452261306345463,
0.0314173549413681,
-0.02510850317776203,
-0.07302314043045044,
-0.016542606055736542,
0.01017936784774065,
0.01843707449734211,
0.04318299889564514,
-0.061058077961206436,
0.012681153602898121,
-0.02434708923101425,
-0.03810691088438034,
0.021500855684280396,
-0.0032337394077330828,
-0.01571774110198021,
0.034825582057237625,
-0.09456025063991547,
-0.0024995196145027876,
-0.026649458333849907,
0.0069025722332298756,
-0.035478223115205765,
0.0662066787481308,
0.07287810742855072,
0.008448059670627117,
0.006594380829483271,
-0.03473493829369545,
0.04644619673490524
]
|
36,366 | statistics | _sum | _sum(data) -> (type, sum, count)
Return a high-precision sum of the given numeric data as a fraction,
together with the type to be converted to and the count of items.
Examples
--------
>>> _sum([3, 2.25, 4.5, -0.5, 0.25])
(<class 'float'>, Fraction(19, 2), 5)
Some sources of round-off error will be avoided:
# Built-in sum returns zero.
>>> _sum([1e50, 1, -1e50] * 1000)
(<class 'float'>, Fraction(1000, 1), 3000)
Fractions and Decimals are also supported:
>>> from fractions import Fraction as F
>>> _sum([F(2, 3), F(7, 5), F(1, 4), F(5, 6)])
(<class 'fractions.Fraction'>, Fraction(63, 20), 4)
>>> from decimal import Decimal as D
>>> data = [D("0.1375"), D("0.2108"), D("0.3061"), D("0.0419")]
>>> _sum(data)
(<class 'decimal.Decimal'>, Fraction(6963, 10000), 4)
Mixed types are currently treated as an error, except that int is
allowed.
| def _sum(data):
"""_sum(data) -> (type, sum, count)
Return a high-precision sum of the given numeric data as a fraction,
together with the type to be converted to and the count of items.
Examples
--------
>>> _sum([3, 2.25, 4.5, -0.5, 0.25])
(<class 'float'>, Fraction(19, 2), 5)
Some sources of round-off error will be avoided:
# Built-in sum returns zero.
>>> _sum([1e50, 1, -1e50] * 1000)
(<class 'float'>, Fraction(1000, 1), 3000)
Fractions and Decimals are also supported:
>>> from fractions import Fraction as F
>>> _sum([F(2, 3), F(7, 5), F(1, 4), F(5, 6)])
(<class 'fractions.Fraction'>, Fraction(63, 20), 4)
>>> from decimal import Decimal as D
>>> data = [D("0.1375"), D("0.2108"), D("0.3061"), D("0.0419")]
>>> _sum(data)
(<class 'decimal.Decimal'>, Fraction(6963, 10000), 4)
Mixed types are currently treated as an error, except that int is
allowed.
"""
count = 0
partials = {}
partials_get = partials.get
T = int
for typ, values in groupby(data, type):
T = _coerce(T, typ) # or raise TypeError
for n, d in map(_exact_ratio, values):
count += 1
partials[d] = partials_get(d, 0) + n
if None in partials:
# The sum will be a NAN or INF. We can ignore all the finite
# partials, and just look at this special one.
total = partials[None]
assert not _isfinite(total)
else:
# Sum all the partial sums using builtin sum.
total = sum(Fraction(n, d) for d, n in partials.items())
return (T, total, count)
| (data) | [
-0.05759010091423988,
-0.054069824516773224,
0.029368577525019646,
0.03761551156640053,
0.034213900566101074,
0.00446708919480443,
0.03595425933599472,
-0.03591470420360565,
-0.025630759075284004,
0.023732183501124382,
0.01933184079825878,
0.008845183067023754,
0.04093801602721214,
-0.03207800164818764,
-0.02946746163070202,
0.06989128142595291,
-0.04216418042778969,
0.03239443153142929,
-0.0336008183658123,
0.011104684323072433,
-0.028379736468195915,
0.014496409334242344,
-0.007930505089461803,
0.07883040606975555,
-0.03917787969112396,
-0.007737680803984404,
0.08385371416807175,
-0.038327477872371674,
-0.027766656130552292,
0.0007014590664766729,
0.00794533733278513,
-0.014051430858671665,
-0.008241989649832249,
-0.041768644005060196,
-0.048413656651973724,
0.03482697904109955,
-0.002954162424430251,
0.040858909487724304,
-0.08385371416807175,
0.019124185666441917,
0.0019096991745755076,
-0.01632576435804367,
-0.048888299614191055,
0.01087725069373846,
0.02707446739077568,
0.03583559766411781,
0.04817633330821991,
0.0240288358181715,
-0.04706883057951927,
-0.014348083175718784,
-0.014951275661587715,
-0.0009505234193056822,
-0.05126151815056801,
0.039494309574365616,
0.014229422435164452,
0.0686255693435669,
-0.01823422871530056,
-0.015534692443907261,
-0.03371948003768921,
0.05205259099602699,
0.030298087745904922,
0.007544856984168291,
0.004358316771686077,
-0.042757485061883926,
-0.08654336631298065,
0.02102275937795639,
-0.008607860654592514,
-0.03650800883769989,
-0.025749418884515762,
-0.033185504376888275,
-0.0345698818564415,
0.04457695409655571,
0.01970760151743889,
0.028458844870328903,
0.08678068965673447,
0.0157423485070467,
0.10157375037670135,
0.037299081683158875,
0.0325724221765995,
-0.008212324231863022,
0.05458402261137962,
-0.0022533214651048183,
-0.016750967130064964,
-0.006308805663138628,
-0.0157720148563385,
0.030832063406705856,
-0.01666197180747986,
0.036231134086847305,
-0.007688238751143217,
-0.0030975444242358208,
-0.014773285016417503,
-0.029922328889369965,
0.028043530881404877,
0.007005938328802586,
-0.0201426912099123,
-0.02307954989373684,
-0.08049165457487106,
0.0058539388701319695,
-0.04453739896416664,
-0.008607860654592514,
-0.010560821741819382,
0.06087305396795273,
0.009369268082082272,
-0.01955927535891533,
0.02054811641573906,
-0.06067528575658798,
0.0250572320073843,
-0.011608993634581566,
0.016375206410884857,
0.05280410870909691,
-0.003196428529918194,
-0.04975847899913788,
-0.0024325489066541195,
0.013210915960371494,
-0.023969506844878197,
-0.016058778390288353,
-0.004177853465080261,
0.03423367440700531,
-0.02634272351861,
0.03791216388344765,
-0.02462214045226574,
0.056996796280145645,
-0.0366859994828701,
0.05695724114775658,
0.052922770380973816,
-0.026263616979122162,
0.0733719989657402,
-0.01636531949043274,
-0.030258534476161003,
0.06542172282934189,
0.05023312196135521,
0.054030273109674454,
0.012083637528121471,
-0.010471826419234276,
-0.019213180989027023,
0.05668036639690399,
0.015287482179701328,
0.015544580295681953,
0.0027638105675578117,
0.014812838286161423,
-0.0006977509474381804,
-0.011885869316756725,
-0.043864987790584564,
0.061545465141534805,
0.07590343803167343,
0.03330416604876518,
0.03573671355843544,
0.025294553488492966,
-0.03761551156640053,
0.04414186254143715,
-0.03207800164818764,
-0.011094796471297741,
0.07226449996232986,
0.02098320610821247,
0.08780907839536667,
-0.026758037507534027,
0.03579604625701904,
-0.021141421049833298,
-0.08701800554990768,
-0.05929090827703476,
0.004711827263236046,
0.0325130932033062,
0.015386366285383701,
0.036488234996795654,
-0.02905214950442314,
0.009789525531232357,
-0.04259927198290825,
-0.0159994475543499,
-0.06494707614183426,
-0.04323212802410126,
-0.006392857059836388,
-0.04821588844060898,
-0.03654756397008896,
0.021457849070429802,
0.029665229842066765,
-0.003856479888781905,
-0.021180974319577217,
-0.015910452231764793,
-0.059014029800891876,
-0.028814826160669327,
0.051973484456539154,
-0.04366721957921982,
-0.02913125604391098,
0.040048059076070786,
-0.006531294900923967,
0.008978676050901413,
-0.03277019038796425,
-0.027647994458675385,
-0.004264377057552338,
0.006353303324431181,
-0.030654070898890495,
-0.02557142823934555,
-0.020429454743862152,
0.006061595398932695,
0.031939566135406494,
-0.019618606194853783,
-0.0475434772670269,
0.0136855598539114,
0.0641164481639862,
-0.02847862057387829,
-0.06917931884527206,
-0.0639977902173996,
0.06099171191453934,
0.020271239802241325,
-0.03075295500457287,
-0.05664081126451492,
-0.029289470985531807,
0.07198762893676758,
-0.016315877437591553,
-0.016859740018844604,
-0.002510420046746731,
-0.006758728064596653,
-0.02311910316348076,
0.046871062368154526,
0.00445720087736845,
-0.018956081941723824,
0.031761571764945984,
-0.11059197783470154,
0.012538503855466843,
0.002454797737300396,
0.02282245084643364,
0.003629046492278576,
0.03097050078213215,
0.015336924232542515,
0.02226869948208332,
-0.03731885924935341,
-0.02209070883691311,
0.04062158986926079,
0.0490860678255558,
0.006289029028266668,
0.05027267709374428,
-0.011490332894027233,
0.01981637440621853,
0.007782178930938244,
-0.004892291035503149,
0.00570561271160841,
-0.029408130794763565,
0.030179427936673164,
0.04002828523516655,
-0.022980665788054466,
-0.042797040194272995,
-0.026184510439634323,
-0.06431421637535095,
0.029803667217493057,
-0.05830206722021103,
-0.03694310039281845,
0.003124737646430731,
0.021734725683927536,
0.003228565910831094,
0.029843222349882126,
-0.011084907688200474,
0.0025363771710544825,
0.03690354526042938,
-0.04157087579369545,
0.0010531157022342086,
-0.0032508147414773703,
-0.00011503002315293998,
0.052013035863637924,
0.035380732268095016,
-0.006432410795241594,
0.07886996120214462,
-0.030812285840511322,
0.052527233958244324,
0.05367428809404373,
-0.08954944461584091,
-0.017235498875379562,
0.04196641221642494,
-0.03654756397008896,
-0.044418737292289734,
0.06573814898729324,
0.08559408038854599,
-0.02201160043478012,
0.08080808818340302,
-0.05177571624517441,
-0.0011748666875064373,
-0.021418295800685883,
0.10236482322216034,
0.05462357774376869,
0.05612661689519882,
-0.015821456909179688,
0.008924290537834167,
0.003760067978873849,
-0.004983758553862572,
-0.021734725683927536,
-0.02201160043478012,
0.053990717977285385,
-0.021635841578245163,
-0.011253010481595993,
-0.020488785579800606,
0.0009146779193542898,
0.07151298224925995,
-0.0350840799510479,
-0.020864544436335564,
0.022842226549983025,
-0.009606590494513512,
0.0639977902173996,
-0.03464898839592934,
-0.0291708093136549,
0.024997901171445847,
0.015346812084317207,
-0.029368577525019646,
0.02667893096804619,
0.11193680018186569,
0.0006872445228509605,
-0.015188598074018955,
-0.0294279083609581,
0.036705777049064636,
-0.010461937636137009,
-0.03188023343682289,
0.002454797737300396,
-0.01896597072482109,
0.009374212473630905,
0.0346292108297348,
0.0325724221765995,
0.01977681927382946,
-0.016563087701797485,
-0.006303861271589994,
0.009641199372708797,
-0.0017415962647646666,
-0.011055242270231247,
0.02278289757668972,
0.004427535459399223,
0.04564490169286728,
0.0075399125926196575,
0.044814273715019226,
0.061110373586416245,
-0.0248001329600811,
0.0005979397683404386,
0.0465150810778141,
-0.019124185666441917,
-0.051498837769031525,
-0.022466467693448067,
0.01789802312850952,
0.0841701477766037,
-0.057985637336969376,
-0.009636255912482738,
0.05683857947587967,
-0.02252579852938652,
-0.05126151815056801,
-0.04311346635222435,
-0.010442161001265049,
0.0265998225659132,
0.014802949503064156,
0.02209070883691311,
0.030436526983976364,
-0.033225059509277344,
-0.013131808489561081,
-0.033956799656152725,
0.0733719989657402,
0.06807181239128113,
-0.012053972110152245,
-0.042361948639154434,
0.00024890981148928404,
-0.004407758824527264,
0.026263616979122162,
-0.015603911131620407,
0.004761269316077232,
-0.036310240626335144,
0.04623820632696152,
-0.01647409051656723,
0.014249199070036411,
0.05221080407500267,
0.020963428542017937,
0.020043807104229927,
0.055414650589227676,
-0.0016167550347745419,
-0.04457695409655571,
0.025512097403407097,
-0.033225059509277344,
0.003938059322535992,
0.032117556780576706,
-0.03727930411696434,
-0.07281824946403503,
-0.022387361153960228,
0.0004112960596103221,
0.004667329601943493,
0.0537138432264328,
0.021991824731230736,
-0.04040404409170151,
0.00048082394641824067,
-0.031425368040800095,
-0.03385791555047035,
-0.033620595932006836,
0.0366859994828701,
0.035202741622924805,
-0.0009054075344465673,
0.011470555327832699,
-0.03037719614803791,
-0.030574964359402657,
0.005656170658767223,
-0.03951408714056015,
-0.003732874756678939,
0.01168810110539198,
-0.0033348663710057735,
-0.10418428480625153,
-0.017660699784755707,
0.05118241161108017,
-0.05414893478155136,
-0.06380002200603485,
0.038248371332883835,
0.013270245864987373,
-0.06336493045091629,
0.005055449437350035,
0.0031395701225847006,
0.024444149807095528,
0.005473235156387091,
-0.018906639888882637,
-0.09223908931016922,
0.03638935089111328,
-0.02642183192074299,
0.024424372240900993,
-0.03458965942263603,
0.0015895619289949536,
0.02741067297756672,
0.028735719621181488,
0.01705750823020935,
0.0004622831766027957,
-0.017304718494415283,
-0.009220941923558712,
-0.022980665788054466,
0.0713152140378952,
-0.05778786912560463,
-0.01820456236600876,
0.04655463621020317,
0.01578190177679062,
-0.03994917497038841,
0.0350840799510479,
-0.0444582924246788,
-0.019895480945706367,
0.02337620221078396,
-0.015623687766492367,
-0.013794331811368465,
-0.06289029121398926,
-0.027094243094325066,
0.01563357561826706,
-0.02517589181661606,
-0.04054247960448265,
0.01128267589956522,
0.0014721370534971356,
0.008157938718795776,
0.011628770269453526,
0.030832063406705856,
-0.0180562362074852,
-0.038030825555324554,
0.017858467996120453,
-0.07958192378282547,
-0.015821456909179688,
-0.01632576435804367,
-0.048413656651973724,
-0.012736272066831589,
0.021655617281794548,
-0.04999580234289169,
0.01643453724682331,
0.041254445910453796,
-0.011065131053328514,
-0.008138161152601242,
0.014812838286161423,
-0.01610822044312954,
0.016968511044979095,
-0.005898436531424522,
-0.00436573289334774,
0.024187050759792328,
0.02909170277416706,
-0.02986299805343151,
-0.015969783067703247,
-0.022031378000974655,
0.007989834994077682,
-0.05434670299291611,
-0.002511656144633889,
0.009497817605733871,
-0.010372942313551903,
0.011144238524138927,
-0.023395977914333344,
-0.02183360978960991,
0.006026986055076122,
0.06016108766198158,
0.00785139761865139,
-0.02025146409869194,
-0.046910617500543594,
-0.018619876354932785,
0.0439440943300724,
-0.011964975856244564,
0.018797867000102997,
0.008983620442450047,
-0.026402054354548454,
0.03435233607888222,
0.010511379688978195,
0.04036448895931244,
0.06095216050744057,
-0.020745884627103806,
-0.004296514205634594,
-0.004884874448180199,
-0.010580598376691341,
0.00041376816807314754,
-0.04089846462011337,
0.008177715353667736,
0.011717765592038631,
-0.0014399996725842357,
-0.0036834327038377523,
-0.027173351496458054,
0.025373660027980804,
-0.0020456649363040924,
0.03638935089111328,
-0.021161196753382683,
0.012073748745024204,
-0.00789095088839531,
0.014535962603986263,
0.03500497341156006,
-0.004719243850558996,
-0.013912992551922798,
-0.0702868178486824,
0.059528227895498276,
-0.045328471809625626,
-0.012765937484800816,
0.048413656651973724,
0.01153977494686842,
0.05288321524858475,
-0.004326179623603821,
-0.044339630752801895,
-0.06850690394639969,
-0.0060170977376401424,
0.009557148441672325,
-0.021596288308501244,
0.04726659879088402,
-0.014387636445462704,
0.021457849070429802,
-0.08227156847715378,
-0.03144514560699463,
-0.022506020963191986,
0.04145221412181854,
0.018006794154644012,
0.05414893478155136,
-0.005735277663916349,
-0.03336349502205849,
-0.001574729336425662,
-0.04710838571190834,
-0.008845183067023754,
-0.08464478701353073,
0.012024306692183018,
0.029071925207972527,
-0.0090429512783885,
0.012152856215834618,
0.03937564790248871,
0.0036834327038377523,
0.05367428809404373,
0.03227576985955238,
0.0026377334725111723,
-0.013032924383878708,
0.04062158986926079,
-0.03587515279650688,
0.011935311369597912,
-0.04513070359826088,
0.0060517070814967155,
0.07202717661857605,
-0.006580736953765154,
-0.0028355016838759184,
-0.02594718709588051,
0.0038045658729970455,
-0.014387636445462704,
-0.0727391466498375,
-0.021418295800685883,
-0.040858909487724304,
-0.04544713348150253,
-0.011599104851484299,
-0.05054955184459686,
-0.030298087745904922,
0.021378742530941963,
-0.015406142920255661,
-0.018431996926665306,
-0.034431442618370056,
-0.02758866362273693,
0.020024029538035393,
0.008904512971639633,
-0.03480720520019531,
0.050905536860227585,
-0.0025610981974750757,
-0.042282842099666595,
-0.05078687518835068,
-0.02300044149160385,
-0.06882333755493164,
-0.06376046687364578,
-0.005404016003012657,
-0.0016266434686258435,
-0.028814826160669327,
-0.023435531184077263,
0.045921776443719864,
-0.043311234563589096,
-0.0010642401175573468,
-0.026975583285093307,
0.014763396233320236,
-0.014931499026715755,
-0.042282842099666595,
0.038208816200494766,
-0.013369129970669746,
0.001443707849830389,
-0.028201745823025703,
-0.03733863681554794,
0.026995358988642693,
0.01252861600369215,
0.005883603822439909,
0.00447697751224041,
0.019361507147550583,
-0.018501214683055878,
0.01966804824769497,
-0.005685835611075163,
0.03393702208995819,
-0.033956799656152725,
0.028419289737939835,
0.02561098150908947,
-0.07084056735038757,
0.028735719621181488,
0.0265998225659132,
0.009576925076544285,
0.016226880252361298,
0.012044083327054977,
-0.020162468776106834,
-0.05153839290142059,
-0.022506020963191986,
-0.0032112612389028072,
0.05778786912560463,
-0.0372001975774765,
0.02462214045226574,
-0.007950281724333763,
0.021991824731230736,
0.0028330294881016016,
0.02018224447965622,
0.011342006735503674,
-0.00037019734736531973,
-0.010501491837203503,
-0.08393282443284988,
-0.02806330844759941,
0.03862413018941879,
0.023277318105101585,
-0.010521268472075462,
0.015247927978634834,
0.00889462511986494,
0.031939566135406494,
-0.012607722543179989,
-0.005468290764838457,
-0.0010345749324187636,
0.07246226817369461,
-0.00455114059150219,
-0.00572538934648037,
-0.038802120834589005,
0.04101712629199028,
0.024819908663630486,
-0.04983758553862572,
-0.0717107504606247,
0.04168953746557236,
0.011935311369597912,
-0.0037872609682381153,
0.046871062368154526,
-0.010768478736281395,
-0.026362501084804535,
0.046910617500543594,
0.11446823179721832,
0.04971892759203911,
-0.006452187430113554,
-0.05719456449151039,
0.032196663320064545,
-0.039711855351924896,
0.0028602227102965117,
0.003559827571734786,
0.03929654136300087,
0.005799552425742149,
0.0547422394156456,
-0.0531996451318264,
-0.0023151240311563015,
0.048967406153678894,
-0.04829499498009682,
-0.011055242270231247,
0.08693890273571014,
0.002726729027926922,
0.060517068952322006,
-0.008904512971639633,
0.06929797679185867,
0.007614075671881437,
0.002516600303351879,
-0.02638227865099907,
-0.013922881335020065,
0.008573251776397228,
-0.03128692880272865,
-0.01452607475221157,
0.0012768409214913845,
-0.0111145731061697,
0.05810429900884628,
-0.023969506844878197,
0.0003070042293984443,
0.03419412299990654,
-0.028083084151148796,
0.010214727371931076,
-0.05438625440001488,
-0.03225599229335785,
-0.008375483565032482,
-0.027470003813505173,
0.0020382485818117857,
-0.06474930793046951,
0.028597282245755196,
0.04097757115960121,
-0.013794331811368465,
0.02839951403439045,
-0.01595989428460598,
0.03381836414337158,
0.005329852923750877,
-0.0021791583858430386,
-0.017947465181350708,
-0.01629609987139702,
0.01819467544555664,
-0.004776102025061846,
-0.026797590777277946,
-0.02131941169500351,
0.01529737003147602,
-0.06902110576629639,
0.024127719923853874,
0.03607292100787163,
0.004004806280136108,
0.06494707614183426,
0.028340183198451996,
-0.047820352017879486,
0.007970058359205723,
-0.016533421352505684,
-0.00037236043135635555,
0.0758243277668953,
0.020014142617583275,
-0.0002799656067509204,
-0.004870041739195585,
0.08860015124082565,
-0.0439440943300724,
-0.03033764287829399,
0.05466312915086746,
0.03150447458028793,
0.022110484540462494,
0.028735719621181488,
-0.02351463958621025,
0.046475525945425034,
-0.030614517629146576,
0.024721024557948112,
0.018135344609618187,
-0.007040548138320446,
-0.005572119262069464,
-0.011223345063626766,
-0.017047619447112083,
-0.04406275600194931,
-0.02557142823934555,
-0.02810286171734333,
-0.09390034526586533,
0.08401193469762802,
0.03484675660729408,
-0.025116560980677605,
-0.018609987571835518,
-0.015465473756194115,
-0.024938570335507393,
-0.028518173843622208,
0.0248001329600811,
-0.0048873466439545155,
0.007955226115882397,
0.04036448895931244,
-0.09089426696300507,
0.02729201130568981,
-0.006417578086256981,
0.003868840401992202,
-0.0470292791724205,
0.05711545795202255,
0.021517179906368256,
0.0024053556844592094,
-0.000696514907758683,
-0.04983758553862572,
0.026322947815060616
]
|
36,367 | statistics | correlation | Pearson's correlation coefficient
Return the Pearson's correlation coefficient for two inputs. Pearson's
correlation coefficient *r* takes values between -1 and +1. It measures the
strength and direction of the linear relationship, where +1 means very
strong, positive linear relationship, -1 very strong, negative linear
relationship, and 0 no linear relationship.
>>> x = [1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> y = [9, 8, 7, 6, 5, 4, 3, 2, 1]
>>> correlation(x, x)
1.0
>>> correlation(x, y)
-1.0
| def correlation(x, y, /):
"""Pearson's correlation coefficient
Return the Pearson's correlation coefficient for two inputs. Pearson's
correlation coefficient *r* takes values between -1 and +1. It measures the
strength and direction of the linear relationship, where +1 means very
strong, positive linear relationship, -1 very strong, negative linear
relationship, and 0 no linear relationship.
>>> x = [1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> y = [9, 8, 7, 6, 5, 4, 3, 2, 1]
>>> correlation(x, x)
1.0
>>> correlation(x, y)
-1.0
"""
n = len(x)
if len(y) != n:
raise StatisticsError('correlation requires that both inputs have same number of data points')
if n < 2:
raise StatisticsError('correlation requires at least two data points')
xbar = fsum(x) / n
ybar = fsum(y) / n
sxy = fsum((xi - xbar) * (yi - ybar) for xi, yi in zip(x, y))
sxx = fsum((xi - xbar) ** 2.0 for xi in x)
syy = fsum((yi - ybar) ** 2.0 for yi in y)
try:
return sxy / sqrt(sxx * syy)
except ZeroDivisionError:
raise StatisticsError('at least one of the inputs is constant')
| (x, y, /) | [
-0.04565609246492386,
0.00034943255013786256,
0.08930613845586777,
-0.01149760838598013,
0.05223146080970764,
-0.023422429338097572,
-0.036480292677879333,
0.017023518681526184,
0.06701675057411194,
0.0012108244700357318,
0.0071929702535271645,
0.005238005425781012,
0.014172334223985672,
0.004072456620633602,
-0.0630418136715889,
0.019726106896996498,
-0.04729064553976059,
-0.012026980519294739,
-0.04517315328121185,
-0.02119349129498005,
0.006533576175570488,
-0.0009560056496411562,
-0.032876841723918915,
0.009412622079253197,
-0.03168807551264763,
-0.011739076115190983,
-0.01177622564136982,
0.0021616059821099043,
-0.02191789634525776,
-0.004446268081665039,
-0.003786873770877719,
-0.02919909544289112,
-0.04428157955408096,
-0.00024248413683380932,
0.0013420067261904478,
0.007634114474058151,
0.03765048831701279,
0.010847500525414944,
-0.052454352378845215,
-0.01991185173392296,
-0.07173467427492142,
0.0010523608652874827,
0.004606472793966532,
0.02141638472676277,
-0.014274493791162968,
0.023515300825238228,
-0.09643874317407608,
0.03339692950248718,
-0.07496663182973862,
-0.0009438161505386233,
-0.010476010851562023,
-0.07570961117744446,
-0.024016812443733215,
-0.022382257506251335,
0.0008451392059214413,
0.07140032947063446,
0.010736053809523582,
0.058435339480638504,
-0.008795020170509815,
-0.02934769168496132,
0.04201549291610718,
0.005261223763227463,
-0.04677056148648262,
0.016893496736884117,
0.021806448698043823,
0.004801505245268345,
0.010661755688488483,
0.007996316999197006,
0.055166229605674744,
0.016271252185106277,
-0.017933668568730354,
0.0619644932448864,
-0.01324361003935337,
-0.049408137798309326,
0.05798955261707306,
0.0015242688823491335,
0.04298136383295059,
0.01941034011542797,
0.037297572940588,
-0.025447048246860504,
-0.06660811603069305,
-0.018453754484653473,
0.06356189399957657,
-0.025874260812997818,
-0.01123756542801857,
-0.0016612557228654623,
-0.01705138012766838,
0.0021418705582618713,
0.00015585156506858766,
0.007276555523276329,
-0.06345044821500778,
-0.020153319463133812,
0.01829587109386921,
0.03064790554344654,
-0.0068307677283883095,
0.004573967773467302,
0.0006930605741217732,
-0.011989831924438477,
0.08358519524335861,
-0.0012688697315752506,
-0.02247513085603714,
0.06917139142751694,
0.011014671064913273,
0.04714205116033554,
0.04112391546368599,
-0.02009759657084942,
0.023255258798599243,
-0.0082470728084445,
0.010318128392100334,
0.04517315328121185,
-0.06047853082418442,
-0.03129801154136658,
0.06515930593013763,
-0.047030601650476456,
-0.04677056148648262,
-0.018184423446655273,
-0.07853293418884277,
0.0413096621632576,
0.01819371059536934,
0.003610416082665324,
0.03911787271499634,
0.020264767110347748,
0.01895526424050331,
0.0076016089878976345,
0.05204571411013603,
0.012324173003435135,
-0.00752266775816679,
-0.01384728029370308,
-0.027657411992549896,
0.03410276025533676,
0.009853765368461609,
-0.0019979183562099934,
0.04246127977967262,
0.023701045662164688,
0.01105182059109211,
0.039786554872989655,
-0.027601689100265503,
0.017357859760522842,
0.036331698298454285,
-0.03042501024901867,
0.06623662263154984,
0.007606252562254667,
0.020190468057990074,
0.014720281586050987,
0.015444686636328697,
0.09837048500776291,
0.048665158450603485,
-0.008562838658690453,
0.018017252907156944,
0.0278988815844059,
-0.027081603184342384,
0.01469242013990879,
0.07377786934375763,
-0.0565778911113739,
0.0006826124154031277,
-0.030202116817235947,
0.009394046850502491,
-0.051711373031139374,
-0.0014778326731175184,
0.007230119314044714,
0.019521785899996758,
-0.013030002824962139,
0.033266909420490265,
-0.0413096621632576,
0.0493338406085968,
-0.008038109168410301,
0.03311831131577492,
-0.02156498096883297,
-0.012277736328542233,
-0.056057803332805634,
-0.05798955261707306,
-0.07444654405117035,
-0.047922179102897644,
-0.043575748801231384,
0.020246190950274467,
-0.005186925642192364,
-0.02971918135881424,
-0.015518984757363796,
-0.0016693820944055915,
0.03642456978559494,
0.02841896563768387,
-0.04391008988022804,
-0.025967134162783623,
-0.03605308011174202,
-0.0011225956259295344,
0.06497355550527573,
0.04710490256547928,
-0.03267252445220947,
0.05854678526520729,
0.033638399094343185,
-0.009078281000256538,
-0.025651367381215096,
-0.002259121974930167,
0.052454352378845215,
0.047550689429044724,
-0.04862800985574722,
0.03283969312906265,
-0.009723744355142117,
0.029050499200820923,
-0.035811614245176315,
0.02485266514122486,
0.03534724935889244,
0.04788503050804138,
0.03822629526257515,
0.03493861109018326,
0.006189947947859764,
0.002112847985699773,
0.0482565201818943,
-0.049742478877305984,
-0.022066490724682808,
0.04075242578983307,
-0.03937791287899017,
-0.018017252907156944,
-0.016364123672246933,
-0.03659174218773842,
0.08091046661138535,
0.06894849985837936,
-0.1150132268667221,
0.0015521306777372956,
0.00742979533970356,
0.08551694452762604,
-0.029459137469530106,
0.0024727287236601114,
-0.001891115098260343,
0.01432093046605587,
-0.007518024183809757,
-0.01277924794703722,
-0.0034386019688099623,
0.019800404086709023,
-0.07336922734975815,
0.0016357158310711384,
-0.022419406101107597,
-0.0007952202577143908,
-0.022530853748321533,
-0.04625047370791435,
-0.08871175348758698,
0.02752739191055298,
0.0507083535194397,
-0.01097752247005701,
0.030202116817235947,
-0.03791052848100662,
0.026022857055068016,
0.016299113631248474,
0.02247513085603714,
-0.01792438142001629,
-0.020041871815919876,
0.01833301968872547,
0.014098036102950573,
-0.0007290486246347427,
0.006241027731448412,
-0.05620640143752098,
-0.030369287356734276,
-0.01432093046605587,
-0.05037401244044304,
0.04587898403406143,
-0.07192041724920273,
0.018843818455934525,
-0.01466455776244402,
0.04729064553976059,
-0.01224058773368597,
-0.018992414698004723,
0.01655915565788746,
-0.03315545991063118,
0.026338623836636543,
-0.05182282254099846,
-0.06426772475242615,
-0.06300466507673264,
0.00801953487098217,
0.004936170298606157,
0.03694465756416321,
0.02739736996591091,
0.023069513961672783,
-0.006510357838124037,
-0.02100774645805359,
-0.003944756928831339,
0.03666603937745094,
0.04387294128537178,
-0.004648265428841114,
0.06935713440179825,
0.02063625678420067,
0.025094132870435715,
-0.010671042837202549,
-0.04171830043196678,
-0.017246412113308907,
-0.009547286666929722,
0.02737879566848278,
-0.009547286666929722,
-0.06931998580694199,
0.037594761699438095,
0.013661535456776619,
0.016503432765603065,
-0.003457176499068737,
-0.02176930010318756,
0.02719305083155632,
0.01532395277172327,
0.049185242503881454,
0.018221572041511536,
-0.05152563005685806,
0.015472548082470894,
-0.03642456978559494,
0.006533576175570488,
0.039043571799993515,
0.02592998556792736,
-0.05323448404669762,
-0.003879746189340949,
-0.060627128928899765,
0.08715149760246277,
-0.02516843192279339,
-0.04060383141040802,
0.043798644095659256,
-0.01903885044157505,
-0.009918776340782642,
-0.02154640667140484,
-0.024741217494010925,
-0.020989172160625458,
0.03315545991063118,
0.02756454050540924,
0.0024077179841697216,
0.028548987582325935,
0.026598665863275528,
0.02847469039261341,
-0.011265426874160767,
0.06831696629524231,
0.02084057591855526,
-0.004606472793966532,
0.01721855066716671,
-0.04220123589038849,
0.008883249014616013,
0.03259822726249695,
0.025707092136144638,
0.0034084185026586056,
-0.008521046489477158,
-0.040120892226696014,
0.02860471047461033,
0.03967510536313057,
0.007350853644311428,
0.03659174218773842,
-0.015732591971755028,
0.03967510536313057,
-0.0020838254131376743,
-0.02864186093211174,
-0.007908088155090809,
0.016754187643527985,
-0.025075558573007584,
-0.03911787271499634,
0.009134004823863506,
0.03120514005422592,
-0.021156340837478638,
0.036313124001026154,
-0.05093124508857727,
-0.005289085209369659,
-0.00661251787096262,
0.014868877828121185,
-0.0028093913570046425,
-0.034139908850193024,
0.06958003342151642,
-0.060069892555475235,
-0.0044671641662716866,
0.04138395935297012,
0.013754407875239849,
-0.03967510536313057,
0.029626308009028435,
-0.004996537230908871,
-0.024964110925793648,
-0.060255639255046844,
0.061184361577034,
-0.05204571411013603,
0.06653381884098053,
-0.050856947898864746,
-0.023961089551448822,
-0.026561517268419266,
-0.04201549291610718,
-0.049408137798309326,
-0.012184863910079002,
-0.04391008988022804,
0.059029720723629,
0.0322081632912159,
-0.025131281465291977,
-0.015518984757363796,
-0.03293256834149361,
0.03150233253836632,
-0.024165408685803413,
-0.05345737561583519,
-0.025131281465291977,
-0.05434895306825638,
-0.004741137847304344,
-0.014153759926557541,
-0.0235895998775959,
-0.05015111714601517,
0.040529534220695496,
0.0005282119964249432,
-0.07414935529232025,
0.04799647629261017,
-0.03696323186159134,
-0.0525658018887043,
-0.019503211602568626,
0.06958003342151642,
0.0485537126660347,
-0.05709797516465187,
0.015008185990154743,
-0.0033573387190699577,
0.0058463201858103275,
-0.02284662052989006,
-0.003094973973929882,
-0.003185524605214596,
0.013011428527534008,
0.02121206559240818,
-0.021509256213903427,
0.01466455776244402,
0.026505794376134872,
-0.05817529559135437,
-0.019633233547210693,
0.08945473283529282,
0.011980544775724411,
-0.04859086126089096,
0.0402323417365551,
-0.07764136046171188,
0.017534317448735237,
0.0026422208175063133,
0.041569702327251434,
0.03956365957856178,
-0.08774588257074356,
0.028344668447971344,
0.024908388033509254,
0.023125236853957176,
-0.00412353640422225,
0.011376873590052128,
-0.0696914792060852,
0.01564900577068329,
-0.028140349313616753,
-0.03893212601542473,
0.024165408685803413,
-0.0619644932448864,
-0.046510517597198486,
0.006816837005317211,
-0.02626432664692402,
0.009760892949998379,
0.06408198177814484,
-0.005159064196050167,
-0.013169311918318272,
0.03495718538761139,
0.01610408164560795,
0.019800404086709023,
-0.06144440546631813,
-0.12994711101055145,
-0.002353155519813299,
0.029663456603884697,
-0.06073857471346855,
-0.03202241659164429,
-0.03321118280291557,
0.007090810686349869,
0.015723304823040962,
0.03226388618350029,
0.04082672297954559,
-0.01620624028146267,
0.009477632120251656,
-0.02957058511674404,
-0.0420897901058197,
-0.017729349434375763,
-0.025967134162783623,
-0.011339724995195866,
0.024053961038589478,
-0.006784331519156694,
-0.05494333431124687,
-0.03603450581431389,
0.010020935907959938,
0.050299711525440216,
0.022698024287819862,
0.015704728662967682,
0.012138428166508675,
0.03259822726249695,
0.011664777994155884,
-0.04569324105978012,
0.01693064533174038,
0.029403414577245712,
0.03956365957856178,
-0.03367554768919945,
0.056280698627233505,
0.038337744772434235,
-0.036721762269735336,
-0.06634806841611862,
0.000020714907805086114,
-0.017162825912237167,
0.002322971820831299,
0.04621332511305809,
-0.0434643030166626,
-0.010949661023914814,
-0.03661031648516655,
0.03246820345520973,
0.009844478219747543,
0.06790832430124283,
0.04443017393350601,
-0.00843281764537096,
0.007476231548935175,
-0.03609022870659828,
-0.03009067103266716,
0.013615099713206291,
-0.016958506777882576,
-0.011033245362341404,
0.04602758213877678,
0.005446968600153923,
0.0002291337150381878,
-0.043390002101659775,
-0.0005076059023849666,
0.04528460279107094,
0.007847720757126808,
-0.03374984487891197,
-0.01158119272440672,
-0.051934268325567245,
0.0195775106549263,
-0.04914809390902519,
0.01142331026494503,
0.0493338406085968,
0.026598665863275528,
-0.023998238146305084,
-0.0017610936192795634,
-0.01684706099331379,
0.043390002101659775,
0.013642961159348488,
-0.015695441514253616,
-0.01095894817262888,
0.06248457729816437,
-0.03516150638461113,
0.020952021703124046,
0.009268669411540031,
0.01495246309787035,
-0.022920917719602585,
-0.06430487334728241,
0.00453217513859272,
0.00048496827366761863,
-0.06070142611861229,
-0.016382697969675064,
-0.05438610166311264,
0.007132603321224451,
-0.0346042700111866,
0.035588718950748444,
-0.06850270926952362,
-0.05468329042196274,
-0.01214771531522274,
0.013382918201386929,
-0.008567482233047485,
0.016076218336820602,
-0.0009536838624626398,
0.006728608161211014,
0.034158483147621155,
-0.009226877242326736,
-0.03150233253836632,
-0.018082264810800552,
-0.013884429819881916,
0.024332579225301743,
0.04420728236436844,
-0.021843597292900085,
-0.013791557401418686,
0.03192954510450363,
-0.03882068023085594,
-0.002054802607744932,
-0.04691915586590767,
0.0009304657578468323,
-0.018360881134867668,
0.018899541348218918,
0.005693080369383097,
-0.04182974621653557,
0.01895526424050331,
-0.06534504890441895,
-0.01432093046605587,
0.0863342210650444,
0.05839819088578224,
0.00497796293348074,
-0.016503432765603065,
-0.03863493353128433,
-0.04435587674379349,
0.05914117023348808,
-0.010011648759245872,
0.03265395015478134,
0.004806148819625378,
0.04695630446076393,
0.04528460279107094,
-0.11575620621442795,
-0.054126057773828506,
-0.013642961159348488,
0.004936170298606157,
-0.04220123589038849,
0.023979663848876953,
-0.036851782351732254,
0.00742979533970356,
0.033954162150621414,
-0.08195064216852188,
0.018184423446655273,
0.05925261601805687,
-0.0043348209001123905,
-0.07838433980941772,
-0.016902783885598183,
-0.01819371059536934,
-0.06029278784990311,
-0.0134107805788517,
0.04951958358287811,
-0.01478529255837202,
-0.008024178445339203,
0.06917139142751694,
0.02410968579351902,
-0.05044830963015556,
0.002145353239029646,
-0.013095013797283173,
-0.025428473949432373,
-0.03701895475387573,
0.01610408164560795,
-0.02084057591855526,
-0.06014419347047806,
0.007949881255626678,
-0.06029278784990311,
-0.03609022870659828,
-0.04064098000526428,
-0.013670822605490685,
-0.008321370929479599,
0.034715719521045685,
0.004395188298076391,
-0.00044549748417921364,
-0.005275154486298561,
0.0028558275662362576,
0.02594855986535549,
0.005563058890402317,
0.0012479734141379595,
0.004267488606274128,
0.015351814217865467,
-0.015816176310181618,
0.1091436892747879,
0.007587678264826536,
-0.04327855631709099,
-0.026171453297138214,
-0.0028929763939231634,
-0.0034548547118902206,
-0.03389843925833702,
0.018611636012792587,
-0.00152775167953223,
-0.017729349434375763,
0.0215835552662611,
0.0474763922393322,
0.032895419746637344,
-0.03661031648516655,
0.06798262894153595,
-0.035793039947748184,
0.03120514005422592,
-0.018815957009792328,
-0.005465542897582054,
-0.02284662052989006,
0.021787874400615692,
-0.0493338406085968,
-0.010206680744886398,
0.09168367087841034,
-0.0485537126660347,
-0.01694921962916851,
0.04769928380846977,
-0.01168335322290659,
0.04134681075811386,
0.04242413118481636,
-0.054980482906103134,
-0.030034946277737617,
0.003654530504718423,
0.027100177481770515,
-0.007689837832003832,
0.025149855762720108,
0.031037969514727592,
0.044132981449365616,
0.024165408685803413,
-0.011757650412619114,
-0.005920617841184139,
0.01676347479224205,
-0.06798262894153595,
-0.030592180788517,
-0.01149760838598013,
0.08269362151622772,
0.019094573333859444,
0.0032853626180440187,
0.03711182624101639,
-0.0016484857769683003,
0.020914873108267784,
-0.01804511435329914,
-0.0018795060459524393,
0.005052260588854551,
0.020060446113348007,
0.03114941529929638,
0.030406435951590538,
0.016178378835320473,
-0.01088465005159378,
0.022698024287819862,
-0.0015997277805581689,
0.026858709752559662,
0.01887167990207672,
-0.029793478548526764,
-0.0020188146736472845,
0.016726326197385788,
0.015101058408617973,
-0.005925261415541172,
-0.0268215611577034,
0.021657852455973625,
0.02338528074324131,
-0.08678000420331955,
-0.02576281502842903,
0.045024558901786804,
0.00698400754481554,
0.028586136177182198,
0.034362804144620895,
0.010392425581812859,
0.07957310974597931,
-0.026710113510489464,
-0.00806132797151804,
0.0021093653049319983,
-0.018221572041511536,
0.034307077527046204,
-0.03495718538761139,
0.0060599264688789845,
-0.02063625678420067,
0.052640099078416824,
0.001362903043627739,
-0.013995876535773277,
0.04220123589038849,
-0.007476231548935175,
0.022010767832398415,
0.024759791791439056,
-0.012927843257784843,
0.020357638597488403,
0.009584436193108559,
0.03818914666771889,
0.031223714351654053,
0.08098476380109787,
-0.018249433487653732,
0.13559375703334808,
-0.02069197967648506,
-0.02845611609518528,
-0.019893277436494827,
-0.00969588290899992,
-0.011952683329582214,
0.023478152230381966,
0.06211308762431145,
0.018342306837439537,
0.01097752247005701,
0.0034386019688099623,
-0.039080724120140076,
0.03237533196806908,
0.009068993851542473,
0.01994900032877922,
-0.001771541777998209,
0.020450511947274208,
-0.04182974621653557,
0.004917595535516739,
0.01856520026922226,
-0.026710113510489464,
-0.014515962451696396,
0.013382918201386929,
-0.011831948533654213,
-0.013865855522453785,
-0.015091771259903908,
0.00783379003405571,
0.015546846203505993,
-0.056466441601514816,
-0.03157662972807884,
0.00421640882268548,
-0.022029342129826546,
-0.0123334601521492,
-0.008488540537655354,
-0.010188106447458267,
0.010736053809523582,
0.00043592002475634217,
0.06085002049803734,
0.030146393924951553,
0.05527767539024353,
0.03859778493642807,
0.09012341499328613
]
|
36,368 | statistics | covariance | Covariance
Return the sample covariance of two inputs *x* and *y*. Covariance
is a measure of the joint variability of two inputs.
>>> x = [1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> y = [1, 2, 3, 1, 2, 3, 1, 2, 3]
>>> covariance(x, y)
0.75
>>> z = [9, 8, 7, 6, 5, 4, 3, 2, 1]
>>> covariance(x, z)
-7.5
>>> covariance(z, x)
-7.5
| def covariance(x, y, /):
"""Covariance
Return the sample covariance of two inputs *x* and *y*. Covariance
is a measure of the joint variability of two inputs.
>>> x = [1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> y = [1, 2, 3, 1, 2, 3, 1, 2, 3]
>>> covariance(x, y)
0.75
>>> z = [9, 8, 7, 6, 5, 4, 3, 2, 1]
>>> covariance(x, z)
-7.5
>>> covariance(z, x)
-7.5
"""
n = len(x)
if len(y) != n:
raise StatisticsError('covariance requires that both inputs have same number of data points')
if n < 2:
raise StatisticsError('covariance requires at least two data points')
xbar = fsum(x) / n
ybar = fsum(y) / n
sxy = fsum((xi - xbar) * (yi - ybar) for xi, yi in zip(x, y))
return sxy / (n - 1)
| (x, y, /) | [
-0.04742714762687683,
-0.0110991932451725,
0.09609565138816833,
-0.02838691882789135,
0.024279486387968063,
-0.008657553233206272,
-0.009008967317640781,
0.023950891569256783,
0.06097254529595375,
0.027565430849790573,
-0.005079524125903845,
-0.0019053920404985547,
-0.014713733457028866,
0.01290646381676197,
-0.036346208304166794,
0.06319968402385712,
0.01729685254395008,
-0.008821850642561913,
0.017260340973734856,
0.02431599609553814,
-0.04019806534051895,
-0.03358966484665871,
-0.022691279649734497,
-0.038664624094963074,
-0.04669693484902382,
-0.009077424183487892,
-0.015462199226021767,
-0.027127305045723915,
0.015589985996484756,
-0.0025580173823982477,
-0.050092414021492004,
-0.03165460750460625,
-0.03753279894590378,
0.03618191182613373,
0.019496610388159752,
0.04658740386366844,
0.024498548358678818,
-0.016101133078336716,
-0.049070119857788086,
0.0051160347647964954,
-0.04107431694865227,
-0.011975445784628391,
0.024936676025390625,
0.03568901866674423,
-0.020153798162937164,
0.03406430035829544,
-0.057065919041633606,
0.04728110507130623,
-0.10485817492008209,
0.02871551178395748,
-0.006571890786290169,
-0.03877415508031845,
0.0024119752924889326,
-0.024078678339719772,
-0.00023746090300846845,
0.022344429045915604,
0.03431987389922142,
0.028624236583709717,
-0.00880815926939249,
0.04717157408595085,
0.05443716421723366,
-0.00453414861112833,
-0.008598224259912968,
-0.009693538770079613,
-0.0015893479576334357,
0.026470117270946503,
-0.015005817636847496,
0.012495720759034157,
0.0318736732006073,
0.01135476678609848,
0.014704606495797634,
0.048412930220365524,
-0.024169955402612686,
0.016867853701114655,
0.08872053027153015,
-0.006466923281550407,
0.004175889305770397,
0.033133283257484436,
-0.008274192921817303,
-0.03935832530260086,
-0.008981584571301937,
-0.05352440103888512,
-0.013107271865010262,
-0.017899274826049805,
0.057577066123485565,
0.06382036209106445,
-0.020336352288722992,
-0.01755242608487606,
0.005134289618581533,
0.0633092150092125,
-0.04406818002462387,
-0.010807109996676445,
0.03076010011136532,
0.03565250709652901,
-0.020281584933400154,
0.017588935792446136,
-0.011373022571206093,
-0.016438854858279228,
0.0539260171353817,
0.014759371988475323,
0.01747940480709076,
0.05553247779607773,
0.021194348111748695,
0.022234898060560226,
-0.003667023964226246,
-0.02082924358546734,
0.020792732015252113,
0.030102912336587906,
0.011263490654528141,
-0.0054811397567391396,
-0.020336352288722992,
-0.00931930635124445,
0.05684685707092285,
-0.013572780415415764,
-0.0482303760945797,
-0.031581588089466095,
-0.07053829729557037,
0.04684297740459442,
-0.047901783138513565,
0.01794491335749626,
-0.00472354656085372,
0.04903360828757286,
0.01973392814397812,
0.025520842522382736,
0.019113250076770782,
-0.021011795848608017,
-0.0032722540199756622,
-0.008967893198132515,
-0.007425324060022831,
0.05323231592774391,
0.03696688637137413,
-0.059256549924612045,
0.01611938886344433,
-0.0026743945199996233,
0.06433150917291641,
0.028204364702105522,
0.019076738506555557,
-0.014366883784532547,
0.05903748795390129,
-0.03510485216975212,
0.03888368979096413,
0.015982473269104958,
0.002767952624708414,
0.011309129185974598,
-0.0022864704951643944,
0.0799580067396164,
0.07550372183322906,
-0.07535768300294876,
0.0017924376297742128,
0.03400953486561775,
-0.057905662804841995,
0.06268853694200516,
0.03295073285698891,
-0.0943431481719017,
-0.01702302321791649,
-0.05115121975541115,
0.0020343197975307703,
-0.037569310516119,
0.00411427766084671,
0.0018312300089746714,
-0.027273347601294518,
0.03943134471774101,
-0.006768134888261557,
0.05023845657706261,
0.02573990635573864,
-0.011528192088007927,
0.03946785628795624,
-0.002178079914301634,
-0.015106221660971642,
-0.05023845657706261,
-0.06049790605902672,
-0.05023845657706261,
-0.057065919041633606,
-0.035323914140462875,
0.041001297533512115,
-0.04750016704201698,
-0.03707641735672951,
-0.02510097250342369,
0.010852747596800327,
-0.022855576127767563,
0.05830727890133858,
-0.046222299337387085,
-0.020299840718507767,
0.002936813747510314,
-0.015717772766947746,
0.020537158474326134,
-0.0023868742864578962,
-0.001657805172726512,
0.07167012244462967,
-0.006439540535211563,
-0.0263970959931612,
-0.030869632959365845,
-0.029299680143594742,
0.030011635273694992,
0.05775962024927139,
-0.02535654604434967,
0.033443622291088104,
0.02528352476656437,
-0.012075849808752537,
-0.049325693398714066,
0.03676607832312584,
-0.008119023405015469,
0.04614927992224693,
-0.02059192582964897,
0.028204364702105522,
0.006498869974166155,
-0.007407068740576506,
-0.005106906872242689,
-0.04779225215315819,
-0.02250872738659382,
0.018611229956150055,
0.005339661613106728,
0.04830339923501015,
-0.03775186091661453,
0.010597174055874348,
0.0388471782207489,
0.06334573030471802,
-0.09631471335887909,
0.00342742376960814,
0.030358485877513885,
0.13523490726947784,
-0.08945073932409286,
-0.012404444627463818,
0.08178353309631348,
0.0016749193891882896,
-0.03220226615667343,
-0.007083037868142128,
-0.024078678339719772,
0.026816966012120247,
-0.07659903913736343,
-0.004741801880300045,
0.02606850117444992,
0.01774410530924797,
-0.03572553023695946,
-0.025776416063308716,
-0.022198386490345,
0.005782351363450289,
-0.016420599073171616,
-0.025520842522382736,
0.02838691882789135,
-0.04527302831411362,
0.006521689239889383,
0.000135202964884229,
0.04797480255365372,
-0.02696300856769085,
-0.00018996871949639171,
0.015589985996484756,
0.057321492582559586,
-0.006950687617063522,
0.029062362387776375,
-0.03386349231004715,
-0.0312347374856472,
-0.03722245991230011,
-0.02059192582964897,
0.02754717692732811,
-0.022307919338345528,
0.036802589893341064,
-0.005608926527202129,
0.04702553153038025,
0.0012094104895368218,
-0.02444378286600113,
-0.007699152920395136,
-0.029171893373131752,
0.06933344900608063,
-0.07937383651733398,
-0.021577708423137665,
-0.03143554553389549,
-0.019368823617696762,
-0.04855897277593613,
0.03658352792263031,
-0.047317616641521454,
0.0721447616815567,
0.038153477013111115,
-0.07309403270483017,
0.00810076855123043,
0.018802911043167114,
-0.0018677405314520001,
0.004915226716548204,
0.08937771618366241,
0.012276657857000828,
0.03128950297832489,
-0.020427627488970757,
-0.06568239629268646,
0.01325331348925829,
0.009976495988667011,
-0.016867853701114655,
-0.009693538770079613,
-0.09427012503147125,
0.03139903396368027,
0.04779225215315819,
-0.020865753293037415,
-0.035524722188711166,
-0.021522942930459976,
0.03662003576755524,
-0.015078838914632797,
0.05684685707092285,
-0.010715832933783531,
0.01161034032702446,
0.04903360828757286,
0.002900303341448307,
-0.004474818706512451,
0.08711406588554382,
0.012203636579215527,
-0.010405493900179863,
-0.014321246184408665,
-0.03961389884352684,
0.06827464699745178,
-0.06710630655288696,
-0.02606850117444992,
0.03121648170053959,
-0.0263240747153759,
-0.033772218972444534,
-0.030413251370191574,
0.019971245899796486,
-0.021760260686278343,
0.02123085968196392,
-0.018017934635281563,
-0.012760421261191368,
0.02709079533815384,
0.013499759137630463,
0.03316979482769966,
-0.05096866562962532,
0.05436414107680321,
0.029902104288339615,
0.0262510534375906,
0.046039748936891556,
-0.06637609750032425,
0.04147593304514885,
0.010989662259817123,
0.04439677298069,
-0.04136640205979347,
-0.0003026378690265119,
-0.032549116760492325,
0.06973506510257721,
0.007589621469378471,
0.015626495704054832,
0.014549436047673225,
0.010095154866576195,
0.06728886067867279,
0.017707595601677895,
-0.03793441504240036,
-0.01967916265130043,
-0.029390957206487656,
-0.037386756390333176,
-0.01173812709748745,
-0.003918033558875322,
0.01851995475590229,
-0.06137416139245033,
0.037897903472185135,
0.061191607266664505,
-0.008894871920347214,
0.002086803549900651,
0.06378385424613953,
-0.015005817636847496,
-0.035579487681388855,
0.03211098909378052,
0.020208565518260002,
-0.0510781966149807,
0.006978070363402367,
-0.02000775747001171,
-0.008721446618437767,
0.10704880207777023,
-0.001819820492528379,
-0.033443622291088104,
0.0013931039720773697,
0.03826300799846649,
-0.024754121899604797,
0.03928530216217041,
-0.04625881090760231,
-0.01883942075073719,
-0.024681102484464645,
-0.031326014548540115,
-0.04662391543388367,
-0.02174200676381588,
-0.013508887030184269,
-0.02884329855442047,
-0.002261369489133358,
-0.009620518423616886,
0.01438513956964016,
0.03775186091661453,
-0.03778837248682976,
-0.020792732015252113,
-0.058745402842760086,
-0.01922278106212616,
-0.07324007153511047,
0.02670743502676487,
-0.07247335463762283,
-0.031526822596788406,
-0.020664945244789124,
0.03576204180717468,
0.02566688507795334,
-0.03245783969759941,
0.028478194028139114,
-0.03284119814634323,
-0.02278255484998226,
-0.0414029136300087,
0.05575154349207878,
0.0025466077495366335,
-0.008990712463855743,
0.05133377015590668,
-0.02179677225649357,
0.019186271354556084,
-0.017497660592198372,
0.02665266953408718,
-0.010880130343139172,
-0.024991441518068314,
0.006626656744629145,
-0.006768134888261557,
0.009296487085521221,
0.002971042413264513,
0.03572553023695946,
-0.04903360828757286,
0.00957487989217043,
0.039832960814237595,
0.016438854858279228,
0.012568741105496883,
-0.07145106047391891,
-0.009428838267922401,
0.015626495704054832,
0.03289596736431122,
0.048668503761291504,
-0.07871665060520172,
0.0496542863547802,
-0.019916480407118797,
0.02922665886580944,
-0.01532528456300497,
-0.04271729290485382,
-0.03954087570309639,
0.03696688637137413,
-0.05509435385465622,
0.015507836826145649,
0.009045477956533432,
-0.03607238084077835,
0.0007878282340243459,
-0.006448667962104082,
0.008817287161946297,
0.018036190420389175,
0.03083312138915062,
0.001889418694190681,
0.04483490064740181,
0.00881272368133068,
0.05374346300959587,
0.0033407113514840603,
-0.010980534367263317,
-0.13297125697135925,
0.009967368096113205,
0.03240307420492172,
-0.041001297533512115,
-0.03724071383476257,
-0.05410856753587723,
0.013107271865010262,
0.022034090012311935,
0.02291034162044525,
-0.017315106466412544,
0.003981926944106817,
-0.013600163161754608,
-0.03083312138915062,
-0.022289663553237915,
-0.006243296433240175,
-0.017826253548264503,
-0.03373570740222931,
-0.0012242428492754698,
-0.01715993694961071,
-0.058416809886693954,
-0.03225703164935112,
0.020372861996293068,
0.04863199219107628,
-0.00020665516785811633,
0.05213700234889984,
0.000379366974812001,
-0.0010742074809968472,
0.0527941919863224,
-0.04173150658607483,
0.0040640756487846375,
0.045053962618112564,
0.0065992739982903,
-0.046039748936891556,
0.037715353071689606,
0.04279031231999397,
0.017634574323892593,
-0.015224880538880825,
0.03994249179959297,
-0.045382559299468994,
0.03205622360110283,
0.04987335205078125,
-0.020628435537219048,
-0.023567531257867813,
-0.003945416305214167,
0.042169634252786636,
0.02458982542157173,
0.030979163944721222,
0.026360584422945976,
-0.01973392814397812,
-0.03488578647375107,
-0.04417771100997925,
-0.03103392943739891,
0.007927343249320984,
-0.026670923456549644,
0.0015688107814639807,
0.00554959662258625,
0.021559452638030052,
0.027784494683146477,
-0.022727789357304573,
-0.047135062515735626,
-0.0353604257106781,
-0.00023803138174116611,
-0.017981424927711487,
-0.005056704860180616,
-0.03972342982888222,
-0.00906829722225666,
-0.024151699617505074,
0.04833991080522537,
0.01286995317786932,
0.012605251744389534,
0.020537158474326134,
-0.021815026178956032,
-0.04173150658607483,
0.04914313927292824,
0.031179971992969513,
0.006941559724509716,
0.0016327041666954756,
0.012532231397926807,
0.006206785794347525,
0.06378385424613953,
0.02542956732213497,
0.005252948962152004,
-0.044104691594839096,
-0.02754717692732811,
0.007283845916390419,
0.003799374448135495,
-0.10661067813634872,
-0.022819066420197487,
-0.03304200619459152,
0.05443716421723366,
-0.06086301431059837,
-0.01541656069457531,
-0.03159984201192856,
-0.014275607652962208,
-0.023823104798793793,
0.0009321588440798223,
0.010944023728370667,
0.043447501957416534,
0.025009695440530777,
0.0540720596909523,
-0.0056317453272640705,
0.000492321327328682,
-0.03525089472532272,
-0.015690390020608902,
0.013043378479778767,
0.05502133071422577,
0.003194669261574745,
-0.03505008667707443,
0.010880130343139172,
0.03424685448408127,
0.005147981457412243,
-0.01962439715862274,
-0.04180452972650528,
-0.009054604917764664,
-0.020884009078145027,
0.030358485877513885,
-0.0201355442404747,
0.00414394261315465,
0.05922003835439682,
-0.013554525561630726,
0.008497820235788822,
0.0702827200293541,
0.039139263331890106,
-0.008452181704342365,
0.02225315384566784,
-0.06283458322286606,
-0.018875930458307266,
0.025849437341094017,
0.006590146105736494,
0.0624694749712944,
-0.026141522452235222,
0.06809209287166595,
0.01813659444451332,
-0.048485949635505676,
-0.05702941119670868,
0.01927754655480385,
-0.03446591645479202,
-0.031307756900787354,
0.033133283257484436,
-0.010816236957907677,
-0.019496610388159752,
0.008689500391483307,
-0.07316705584526062,
-0.03024895302951336,
0.03837254270911217,
0.06283458322286606,
-0.06455057114362717,
0.012103232555091381,
-0.03134426847100258,
-0.03231179714202881,
0.0035209818743169308,
-0.006841156166046858,
0.01889418624341488,
-0.02385961450636387,
0.016438854858279228,
-0.06301712989807129,
-0.039650410413742065,
-0.00089907122310251,
0.03928530216217041,
-0.004308239556849003,
-0.020537158474326134,
0.026689179241657257,
-0.03349838778376579,
-0.05754055827856064,
0.022234898060560226,
-0.04779225215315819,
-0.03572553023695946,
0.014987562783062458,
-0.05155283212661743,
0.011729000136256218,
-0.003251716960221529,
0.03282294422388077,
-0.020245075225830078,
-0.020737966522574425,
-0.02510097250342369,
0.058745402842760086,
-0.017050405964255333,
0.004378978628665209,
0.0027451335918158293,
0.0060607437044382095,
-0.037715353071689606,
0.053962528705596924,
-0.023311957716941833,
-0.07429888099431992,
-0.05451018363237381,
-0.009693538770079613,
0.015051456168293953,
-0.016146771609783173,
0.05239257588982582,
0.012203636579215527,
-0.004988247994333506,
-0.004620860796421766,
0.010953151620924473,
0.029135383665561676,
-0.017725851386785507,
0.058489829301834106,
0.00802774727344513,
0.02296510711312294,
0.042425207793712616,
0.03767884150147438,
-0.024169955402612686,
-0.030887886881828308,
-0.062104370445013046,
0.03610888868570328,
0.05509435385465622,
-0.06853021681308746,
0.015535220503807068,
-0.0015699517680332065,
0.010852747596800327,
0.03767884150147438,
0.022983362898230553,
-0.023129405453801155,
0.015964219346642494,
0.019697418436408043,
0.01028683502227068,
-0.022052345797419548,
0.0860917717218399,
0.02754717692732811,
-0.04038061946630478,
0.03543344512581825,
0.07123199850320816,
0.00894051045179367,
-0.010551536455750465,
-0.04720808193087578,
-0.06582844257354736,
-0.0022716380190104246,
0.08382812142372131,
0.027182070538401604,
-0.00816009845584631,
-0.02044588327407837,
-0.04381260648369789,
-0.08404718339443207,
0.01838303916156292,
0.006380210630595684,
0.002774798311293125,
0.03526914864778519,
0.04771922901272774,
0.0015003535663709044,
0.05140679329633713,
-0.028350407257676125,
0.025466077029705048,
0.003194669261574745,
-0.0036989706568419933,
-0.0470985509455204,
-0.03271341323852539,
-0.00010860449401661754,
0.013435865752398968,
-0.011263490654528141,
-0.0067635709419846535,
-0.01677657663822174,
-0.0068867942318320274,
-0.01332633476704359,
-0.030413251370191574,
0.015836432576179504,
-0.035524722188711166,
0.014312118291854858,
-0.019715672358870506,
0.016922619193792343,
-0.02090226486325264,
0.07247335463762283,
-0.04611276835203171,
0.013791843317449093,
0.012550486251711845,
-0.026816966012120247,
0.06097254529595375,
-0.04249822720885277,
-0.00334527506493032,
-0.061447180807590485,
0.04019806534051895,
0.00061098049627617,
-0.02174200676381588,
0.03517787158489227,
-0.025393055751919746,
0.033060263842344284,
0.01973392814397812,
0.04439677298069,
0.006649476010352373,
0.0025534534361213446,
0.023585787042975426,
0.020208565518260002,
-0.00844761822372675,
0.010889258235692978,
0.12362457066774368,
-0.01677657663822174,
0.009976495988667011,
-0.020080778747797012,
0.011710744351148605,
0.006489742547273636,
0.04081874340772629,
0.035579487681388855,
-0.01594596356153488,
0.01631106808781624,
-0.06305364519357681,
-0.06334573030471802,
0.032877709716558456,
-0.021066561341285706,
0.007302101235836744,
0.01620153710246086,
0.052429087460041046,
-0.021395156159996986,
-0.027054283767938614,
-0.011820276267826557,
-0.03090614266693592,
-0.011537319980561733,
0.033060263842344284,
-0.0005661980831064284,
-0.016630535945296288,
0.009821325540542603,
-0.03342536836862564,
0.00045409941230900586,
-0.008251374587416649,
-0.024790633469820023,
0.013171165250241756,
-0.06699677556753159,
-0.029390957206487656,
-0.0024211029522120953,
-0.01904022879898548,
0.033206306397914886,
0.06794605404138565,
0.045966725796461105,
0.031307756900787354,
0.053378358483314514,
0.04173150658607483,
0.04326494783163071
]
|
36,369 | statistics | fmean | Convert data to floats and compute the arithmetic mean.
This runs faster than the mean() function and it always returns a float.
If the input dataset is empty, it raises a StatisticsError.
>>> fmean([3.5, 4.0, 5.25])
4.25
| def fmean(data):
"""Convert data to floats and compute the arithmetic mean.
This runs faster than the mean() function and it always returns a float.
If the input dataset is empty, it raises a StatisticsError.
>>> fmean([3.5, 4.0, 5.25])
4.25
"""
try:
n = len(data)
except TypeError:
# Handle iterators that do not define __len__().
n = 0
def count(iterable):
nonlocal n
for n, x in enumerate(iterable, start=1):
yield x
total = fsum(count(data))
else:
total = fsum(data)
try:
return total / n
except ZeroDivisionError:
raise StatisticsError('fmean requires at least one data point') from None
| (data) | [
-0.05061815306544304,
-0.021027397364377975,
0.03853511065244675,
0.03643055632710457,
0.10348600149154663,
0.024674082174897194,
0.018197135999798775,
-0.010740482248365879,
0.008667678572237492,
0.05787523463368416,
-0.009561206214129925,
-0.03145945444703102,
-0.01572972722351551,
-0.03791825845837593,
-0.01635565049946308,
0.05475468933582306,
-0.05246870964765549,
0.07692507654428482,
-0.021571679040789604,
0.008690356276929379,
-0.05856465920805931,
0.0029300472233444452,
-0.04154679924249649,
-0.04648161679506302,
0.010141773149371147,
0.021281395107507706,
0.025871500372886658,
-0.013343960978090763,
0.010141773149371147,
-0.00020297153969295323,
0.023295234888792038,
-0.024420084431767464,
-0.03282015770673752,
-0.020065834745764732,
0.04317964240908623,
-0.021099967882037163,
-0.017181143164634705,
-0.016446363180875778,
-0.054609548300504684,
-0.037029266357421875,
-0.008064433000981808,
-0.03311043977737427,
-0.05018272623419762,
0.08178732544183731,
0.02556307427585125,
0.03893424943089485,
0.07946505397558212,
0.061540063470602036,
-0.041728224605321884,
-0.027558771893382072,
-0.03762797266244888,
0.01647357828915119,
-0.02964518405497074,
0.03849882259964943,
0.009778918698430061,
0.08650442957878113,
-0.009075889363884926,
-0.07561880350112915,
-0.04328849911689758,
0.018142707645893097,
0.07547365874052048,
-0.018995413556694984,
0.035251278430223465,
-0.05007386952638626,
-0.02169867791235447,
0.01017805840820074,
-0.02222481556236744,
0.029862895607948303,
-0.04778788983821869,
-0.018178991973400116,
-0.04989244416356087,
0.056641530245542526,
0.04778788983821869,
0.01836041919887066,
0.04459477216005325,
0.08229532092809677,
0.05235985293984413,
0.032148875296115875,
0.013380246236920357,
0.03586813062429428,
0.03791825845837593,
-0.011139621958136559,
-0.007193583529442549,
0.013461888767778873,
-0.03868025168776512,
-0.003528756555169821,
-0.06328175961971283,
0.024347512051463127,
-0.02971775457262993,
0.01635565049946308,
0.026760492473840714,
0.01433273870497942,
0.017063215374946594,
0.015022161416709423,
-0.049674730747938156,
-0.026161784306168556,
-0.06981313973665237,
-0.015203588642179966,
0.0022723739966750145,
0.019249411299824715,
0.028193766251206398,
0.09332608431577682,
0.0675271525979042,
0.015285230241715908,
0.033437009900808334,
-0.03387243300676346,
0.03973252698779106,
-0.03379986435174942,
0.02218853123486042,
0.08897183835506439,
-0.04637276008725166,
-0.059725791215896606,
0.016845503821969032,
0.012037686072289944,
-0.03301972523331642,
-0.03407200425863266,
0.019303839653730392,
0.08302102982997894,
-0.0208822563290596,
0.01914055645465851,
0.032656870782375336,
0.05881865695118904,
-0.04593733325600624,
0.01798849366605282,
0.020265404134988785,
-0.02735920250415802,
0.05392012372612953,
-0.058963797986507416,
-0.03096960112452507,
0.007678900845348835,
0.05185185745358467,
0.033364437520504,
0.05206957086920738,
-0.028320765122771263,
0.0121465427801013,
0.013108105398714542,
0.03207630664110184,
-0.0025422468315809965,
0.017471427097916603,
-0.06564031541347504,
0.029772182926535606,
-0.010159916244447231,
0.01316253375262022,
0.033709149807691574,
0.029119044542312622,
0.01083119586110115,
0.03871653601527214,
-0.011874401941895485,
-0.016128866001963615,
-0.01600186713039875,
0.0034357751719653606,
0.012309826910495758,
0.054645832628011703,
-0.03145945444703102,
0.052758991718292236,
0.012128399685025215,
-0.00426353607326746,
-0.10043802857398987,
-0.10065574198961258,
-0.03795454278588295,
-0.0489853098988533,
0.041909653693437576,
0.010377628728747368,
0.009479564614593983,
-0.023639947175979614,
0.018124563619494438,
-0.07075655460357666,
0.016401007771492004,
-0.06172148883342743,
-0.02966332621872425,
0.04278050363063812,
0.0009581617196090519,
0.010921909473836422,
0.036521270871162415,
0.044050492346286774,
-0.0017995297675952315,
-0.056931816041469574,
-0.011030766181647778,
-0.0005930397310294211,
0.016754789277911186,
0.01421481091529131,
-0.015666227787733078,
-0.006676516029983759,
-0.055371541529893875,
-0.01914055645465851,
-0.018351348116993904,
0.0002873067860491574,
-0.021480964496731758,
0.0038077007047832012,
0.0009558938909322023,
-0.015448515303432941,
-0.06306404620409012,
-0.012944821268320084,
-0.004274875391274691,
0.017534926533699036,
-0.04187336936593056,
-0.027540629729628563,
-0.00614130636677146,
0.057439811527729034,
-0.05341212823987007,
-0.04281678795814514,
-0.0013538994826376438,
0.05685924366116524,
-0.01621958054602146,
-0.031169170513749123,
-0.004739782307296991,
-0.02706891857087612,
0.02763134241104126,
-0.010595341213047504,
0.013924527913331985,
-0.017843352630734444,
-0.010568127036094666,
-0.0599072203040123,
0.0614674910902977,
0.027232203632593155,
0.015693441033363342,
0.07384081929922104,
-0.08628671616315842,
0.017843352630734444,
0.06429775059223175,
-0.01688178814947605,
-0.05392012372612953,
0.009624705649912357,
0.01859627477824688,
0.04354249686002731,
0.0027508880011737347,
0.011729259975254536,
0.009071353822946548,
0.006798979360610247,
0.009851490147411823,
0.025726359337568283,
-0.008812819607555866,
-0.019557837396860123,
-0.007520152255892754,
0.004844102542847395,
-0.03363657742738724,
0.05156157165765762,
0.0005782987573184073,
-0.00011700628965627402,
-0.0037011122331023216,
-0.04183708131313324,
-0.04680818319320679,
-0.0032112591434270144,
-0.017226500436663628,
-0.055589254945516586,
-0.03196744993329048,
-0.027322916314005852,
0.023295234888792038,
-0.01149340532720089,
0.04666304215788841,
-0.048695024102926254,
0.05936293676495552,
0.013017392717301846,
-0.010286915116012096,
0.0037011122331023216,
-0.02706891857087612,
0.04640904441475868,
0.07634451240301132,
0.034688856452703476,
0.016600577160716057,
0.018777702003717422,
-0.04408677667379379,
0.06901485472917557,
0.04615504667162895,
-0.054645832628011703,
0.010450199246406555,
-0.0059099867939949036,
-0.028738047927618027,
0.03661198168992996,
0.05050929635763168,
0.05007386952638626,
0.014396238140761852,
0.08222274482250214,
-0.06589431315660477,
0.03969624266028404,
-0.01859627477824688,
0.06487832218408585,
0.0041478765197098255,
0.05221471190452576,
0.007170904893428087,
0.017280928790569305,
-0.021535392850637436,
-0.053049273788928986,
0.031169170513749123,
-0.045538194477558136,
0.024438226595520973,
-0.007093798369169235,
-0.05286784842610359,
0.01764378324151039,
0.02656092308461666,
0.044993914663791656,
-0.014532308094203472,
-0.060778070241212845,
-0.027449915185570717,
-0.04074852168560028,
0.004939352162182331,
-0.0033495973329991102,
-0.011148693040013313,
0.0361039862036705,
0.0121465427801013,
0.0038008971605449915,
0.015194517560303211,
0.027195917442440987,
0.007384081836789846,
0.01816992089152336,
-0.011801830492913723,
0.007524687796831131,
-0.004889459349215031,
-0.045792192220687866,
-0.01188347302377224,
-0.005769380833953619,
-0.019213126972317696,
-0.034979138523340225,
-0.012736179865896702,
0.03621284291148186,
0.0056287748739123344,
0.015457586385309696,
0.002412979956716299,
0.030643032863736153,
-0.03463442623615265,
0.015720656141638756,
0.02425679937005043,
0.08512558043003082,
0.022061532363295555,
0.0020739382598549128,
0.05286784842610359,
0.001297203591093421,
0.003837182419374585,
0.005792059004306793,
-0.01674571819603443,
-0.018260635435581207,
-0.07061141729354858,
-0.008962497115135193,
0.05497240275144577,
-0.07130084186792374,
-0.0005760309286415577,
0.025363504886627197,
0.02500065043568611,
0.0005564708262681961,
0.0008997648837976158,
-0.050727009773254395,
0.07311511039733887,
0.0485861711204052,
0.017244642600417137,
-0.0489853098988533,
-0.018705131486058235,
0.016909003257751465,
-0.04267164692282677,
0.049928728491067886,
0.029536327347159386,
0.00017745835066307336,
-0.03673898056149483,
0.009452350437641144,
-0.017888709902763367,
0.05003758519887924,
-0.018015708774328232,
0.0042658038437366486,
-0.04107508808374405,
0.00037787857581861317,
0.0024810151662677526,
0.024601509794592857,
0.03485213965177536,
0.0398050993680954,
-0.00992406066507101,
0.0008481715340167284,
0.020954826846718788,
-0.008681285195052624,
0.014496022835373878,
-0.027722056955099106,
0.03554156422615051,
0.010667911730706692,
-0.024111658334732056,
-0.0417645126581192,
-0.05595210939645767,
0.034489285200834274,
-0.012944821268320084,
0.06578545272350311,
-0.0057829879224300385,
-0.012064900249242783,
0.02267838455736637,
-0.012210042215883732,
0.0013947206316515803,
-0.016319364309310913,
0.003644416341558099,
0.04524791240692139,
0.03283829987049103,
-0.03965995833277702,
-0.023023094981908798,
-0.03940596058964729,
0.010549983941018581,
-0.042744219303131104,
-0.017652854323387146,
-0.004345178138464689,
-0.04441334679722786,
-0.0985511839389801,
0.016636861488223076,
0.045538194477558136,
-0.04434077441692352,
-0.04386906698346138,
0.008703963831067085,
-0.022369958460330963,
-0.02425679937005043,
-0.01906798593699932,
-0.00992406066507101,
-0.01482259202748537,
0.009007854387164116,
-0.0809890404343605,
-0.12155614048242569,
0.013253247365355492,
0.030588604509830475,
0.04437706246972084,
0.04412306472659111,
0.025363504886627197,
0.07634451240301132,
0.044231921434402466,
0.057439811527729034,
-0.06317290663719177,
-0.049203019589185715,
-0.037555404007434845,
0.023585518822073936,
0.004551551770418882,
-0.07133712619543076,
-0.0417645126581192,
0.04662675783038139,
0.021571679040789604,
-0.05907265469431877,
0.0104411281645298,
-0.03387243300676346,
-0.017770782113075256,
-0.01017805840820074,
-0.012464039959013462,
-0.016346579417586327,
-0.07322396337985992,
-0.009978489018976688,
0.00810979027301073,
-0.011076122522354126,
-0.03485213965177536,
-0.004503927193582058,
-0.020247260108590126,
-0.02681492082774639,
0.00587370153516531,
0.04317964240908623,
0.0417645126581192,
-0.012364255264401436,
-0.044739916920661926,
-0.041728224605321884,
-0.009543064050376415,
0.02500065043568611,
-0.011357334442436695,
-0.023694375529885292,
-0.05312184616923332,
-0.03973252698779106,
-0.0015092464163899422,
0.012881321832537651,
0.02039240300655365,
-0.006844336166977882,
-0.014405309222638607,
0.00017136354290414602,
0.034725140780210495,
0.041655655950307846,
-0.027177775278687477,
0.04241764917969704,
-0.034688856452703476,
-0.05402898043394089,
0.01099447999149561,
-0.014768163673579693,
0.057439811527729034,
0.025744501501321793,
0.01881398633122444,
0.00594173651188612,
0.05598839372396469,
-0.004313428420573473,
0.001847154344432056,
-0.0291734728962183,
0.02890133298933506,
0.06676515936851501,
-0.024129800498485565,
0.01656429097056389,
0.03604955971240997,
0.009760776534676552,
0.004535676911473274,
-0.00016782003513071686,
0.02398465946316719,
0.03940596058964729,
0.00799186248332262,
0.027268487960100174,
0.020301688462495804,
-0.016283079981803894,
0.07438509911298752,
-0.022369958460330963,
0.025599360466003418,
-0.007411296013742685,
0.03207630664110184,
-0.009742633439600468,
-0.012164684943854809,
-0.02144468016922474,
0.07736050337553024,
0.06959542632102966,
0.022333672270178795,
-0.005914522334933281,
0.030860744416713715,
-0.015040304511785507,
-0.019757408648729324,
-0.026252496987581253,
-0.007583651691675186,
0.035251278430223465,
-0.011910687200725079,
0.014359952881932259,
-0.00753829488530755,
-0.007452116813510656,
-0.03412643074989319,
0.051489003002643585,
0.015874868258833885,
0.010359485633671284,
0.04027681052684784,
-0.038861677050590515,
-0.00810979027301073,
0.014668378978967667,
-0.021535392850637436,
0.0077696144580841064,
-0.020700829103589058,
-0.014668378978967667,
-0.06295519322156906,
0.05297670513391495,
-0.03773682937026024,
0.013407460413873196,
-0.028538478538393974,
-0.0052160280756652355,
0.003086528042331338,
0.020083976909518242,
-0.034670714288949966,
0.020573830232024193,
0.022623956203460693,
-0.023893944919109344,
-0.021335823461413383,
-0.04132908582687378,
0.04372392222285271,
-0.057439811527729034,
-0.008558821864426136,
0.024619653820991516,
0.006232019979506731,
-0.0032044555991888046,
0.03222144767642021,
0.013253247365355492,
0.051779285073280334,
-0.029246043413877487,
-0.02714148908853531,
-0.006046057213097811,
0.01598372496664524,
-0.03271130099892616,
0.04158308357000351,
-0.04209107905626297,
0.002535443287342787,
0.03633984178304672,
-0.003698844462633133,
-0.037029266357421875,
-0.021118110045790672,
0.03643055632710457,
-0.029481898993253708,
-0.05058186873793602,
-0.02144468016922474,
-0.028792476281523705,
0.0028279945254325867,
0.0013675065711140633,
-0.042453933507204056,
-0.0470258966088295,
-0.0027463522274047136,
-0.021045539528131485,
-0.03973252698779106,
-0.021009255200624466,
-0.042236220091581345,
0.06281004846096039,
0.039079390466213226,
-0.020573830232024193,
0.022841667756438255,
0.011729259975254536,
-0.01771635375916958,
-0.06567659974098206,
-0.010749554261565208,
-0.07612679898738861,
-0.06629344820976257,
-0.07460281252861023,
-0.034235287457704544,
0.003032099921256304,
-0.018061064183712006,
0.021317681297659874,
-0.09252780675888062,
0.003748736809939146,
-0.05333955958485603,
0.043760210275650024,
-0.03951481729745865,
-0.06959542632102966,
0.004442695528268814,
0.005919058341532946,
0.011175907216966152,
-0.01072234008461237,
-0.0009524921188130975,
-0.031405024230480194,
0.018705131486058235,
0.025363504886627197,
-0.02554493211209774,
0.03243916109204292,
0.0017564408481121063,
-0.017589354887604713,
0.025127649307250977,
0.009062281809747219,
-0.059217795729637146,
0.0028665477875620127,
0.005624239332973957,
-0.044776201248168945,
-0.001789324451237917,
0.06865200400352478,
-0.007275225594639778,
0.0301531795412302,
0.009193817153573036,
0.04361506924033165,
-0.0247829370200634,
-0.034997280687093735,
0.04288936033844948,
0.0583469457924366,
0.0242930855602026,
-0.021353965625166893,
0.009252780117094517,
-0.008871783502399921,
0.015548299998044968,
-0.06306404620409012,
0.02583521418273449,
-0.02320452220737934,
-0.0638260468840599,
-0.0718088373541832,
-0.04397791996598244,
-0.012518467381596565,
-0.01740792766213417,
-0.02737734466791153,
-0.0008804882527329028,
0.007497473619878292,
-0.0032611514907330275,
0.03022575005888939,
-0.04655418545007706,
-0.033709149807691574,
0.03530570864677429,
0.013552602380514145,
0.011257549747824669,
-0.061576347798109055,
0.07282482832670212,
0.0013595691416412592,
-0.05011015757918358,
-0.021099967882037163,
0.09383407980203629,
0.02090039849281311,
-0.017126714810729027,
0.010531841777265072,
-0.017344428226351738,
0.0661483108997345,
0.08512558043003082,
0.061576347798109055,
0.005578882526606321,
-0.03438042849302292,
-0.00941606517881155,
-0.013126248493790627,
-0.05500868707895279,
0.00483503146097064,
-0.014341809786856174,
0.0532669872045517,
0.00038808383396826684,
0.019213126972317696,
-0.05261385068297386,
0.041655655950307846,
-0.013788457028567791,
-0.012699894607067108,
-0.029518185183405876,
0.12460411339998245,
-0.003821307560428977,
0.037301406264305115,
0.04637276008725166,
0.028484050184488297,
0.0028506729286164045,
-0.03171345219016075,
-0.07032113522291183,
0.014949590899050236,
0.0260529275983572,
-0.0012450432404875755,
0.027994196861982346,
-0.007452116813510656,
-0.01108519360423088,
0.01730814203619957,
-0.006753622554242611,
-0.0052523138001561165,
0.03929710388183594,
0.022859809920191765,
-0.024129800498485565,
-0.014514165930449963,
0.011819973587989807,
-0.030606746673583984,
-0.04673561453819275,
0.004220447037369013,
-0.031386882066726685,
0.04383277893066406,
0.04648161679506302,
0.020029548555612564,
0.007334189489483833,
0.051996998488903046,
0.0005111140781082213,
0.03231216222047806,
0.018959129229187965,
-0.0227328110486269,
-0.03311043977737427,
0.021589821204543114,
-0.04746131971478462,
0.013597958721220493,
-0.011819973587989807,
-0.015194517560303211,
-0.040167953819036484,
0.08650442957878113,
0.016500791534781456,
0.0027622270863503218,
0.030098751187324524,
-0.04183708131313324,
0.0023698911536484957,
0.030026180669665337,
0.0083910021930933,
0.010640697553753853,
0.03505171090364456,
0.048150744289159775,
-0.03517870977520943,
-0.03643055632710457,
0.026016641408205032,
-0.010522769764065742,
-0.03817225620150566,
0.0349247120320797,
0.04564705118536949,
-0.008744784630835056,
0.01934012584388256,
0.020301688462495804,
0.02866547740995884,
-0.0019730194471776485,
-0.006227483972907066,
0.01330767571926117,
-0.03666641190648079,
0.0006383964791893959,
0.041691940277814865,
-0.016718504950404167,
-0.014577665366232395,
0.003764611668884754,
0.0077424002811312675,
-0.08178732544183731,
0.030824460089206696,
-0.010395770892500877,
-0.005179742816835642,
0.02866547740995884,
-0.04328849911689758,
-0.04698961228132248,
-0.03817225620150566,
0.054645832628011703,
0.018487418070435524,
0.014867948368191719,
-0.044558487832546234,
-0.05130757391452789,
0.029209759086370468,
-0.010232486762106419,
-0.003544631414115429,
-0.033201154321432114,
0.019485266879200935,
0.0074339741840958595,
-0.056133534759283066,
0.0027690306305885315,
-0.03274758532643318,
0.011157765053212643
]
|
36,370 | statistics | geometric_mean | Convert data to floats and compute the geometric mean.
Raises a StatisticsError if the input dataset is empty,
if it contains a zero, or if it contains a negative value.
No special efforts are made to achieve exact results.
(However, this may change in the future.)
>>> round(geometric_mean([54, 24, 36]), 9)
36.0
| def geometric_mean(data):
"""Convert data to floats and compute the geometric mean.
Raises a StatisticsError if the input dataset is empty,
if it contains a zero, or if it contains a negative value.
No special efforts are made to achieve exact results.
(However, this may change in the future.)
>>> round(geometric_mean([54, 24, 36]), 9)
36.0
"""
try:
return exp(fmean(map(log, data)))
except ValueError:
raise StatisticsError('geometric mean requires a non-empty dataset '
'containing positive numbers') from None
| (data) | [
-0.031271450221538544,
-0.007947871461510658,
0.05273156985640526,
0.05949202552437782,
0.1144077479839325,
-0.013425575569272041,
0.011406105011701584,
-0.025811079889535904,
0.03147946298122406,
0.03640246391296387,
0.04409898445010185,
-0.0034690680913627148,
-0.013754931278526783,
-0.02695515751838684,
-0.04590177536010742,
-0.0027410187758505344,
-0.059041328728199005,
0.023748274892568588,
0.0014940177788957953,
-0.021685468032956123,
-0.0310114324092865,
-0.0013174224877730012,
0.0008390984730795026,
-0.05356362462043762,
-0.005798392463475466,
0.013538249768316746,
0.007332496345043182,
0.037719886749982834,
-0.019362643361091614,
-0.008121216669678688,
-0.007271825801581144,
-0.08923804014921188,
-0.003573075169697404,
-0.02799522876739502,
0.044931042939424515,
-0.028671273961663246,
-0.01731717213988304,
-0.006608780473470688,
-0.08265092968940735,
-0.027336517348885536,
-0.03966135159134865,
-0.011354101821780205,
-0.08480040729045868,
0.03733852878212929,
0.008437571115791798,
0.02224017307162285,
0.07675719261169434,
0.05793192237615585,
-0.03281421959400177,
-0.025707073509693146,
-0.03983469679951668,
0.0032090505119413137,
-0.039592012763023376,
0.037442535161972046,
-0.030162042006850243,
0.09131818264722824,
0.022292176261544228,
-0.05307826027274132,
-0.013867605477571487,
0.01345157716423273,
0.04136013239622116,
-0.004134279675781727,
0.006452769972383976,
-0.08278960734605789,
0.02776988036930561,
0.04246954247355461,
-0.02572440728545189,
0.02107875980436802,
-0.02626177854835987,
0.021945485845208168,
-0.05976938083767891,
0.013104886747896671,
0.03440899774432182,
-0.01661512441933155,
0.033264920115470886,
0.09804397076368332,
0.04281623288989067,
0.03688783198595047,
0.027839217334985733,
0.05966537073254585,
-0.005473370663821697,
-0.01138877123594284,
0.01156211644411087,
0.01547971460968256,
-0.03889863193035126,
-0.013928276486694813,
-0.03609044477343559,
0.03466901183128357,
-0.033074237406253815,
-0.032848890870809555,
0.01846124976873398,
0.017464514821767807,
0.012836202047765255,
-0.01492501050233841,
0.004054107703268528,
0.011830801144242287,
-0.060913458466529846,
0.019674664363265038,
0.03409697487950325,
0.0009463557507842779,
0.014708328992128372,
0.10074815154075623,
0.040562745183706284,
0.0035925765987485647,
0.008927270770072937,
-0.02735385112464428,
0.049229998141527176,
-0.011180756613612175,
0.04583243653178215,
0.06698053330183029,
-0.10372968763113022,
-0.04870996251702309,
0.05127546936273575,
-0.02607109770178795,
0.0017106991726905107,
-0.04108278080821037,
0.010149354115128517,
0.07550910860300064,
-0.017923880368471146,
-0.0026846816763281822,
0.016693130135536194,
0.04233086481690407,
-0.004147280938923359,
0.059908054769039154,
0.050096724182367325,
-0.025343049317598343,
0.04118678718805313,
-0.06954604387283325,
-0.06392966210842133,
-0.014586986973881721,
0.09568648040294647,
0.04059741646051407,
0.0810561552643776,
-0.020697401836514473,
0.007575179450213909,
0.03378495201468468,
0.008355231955647469,
-0.01870393194258213,
0.06143349036574364,
-0.04822459816932678,
0.028844619169831276,
-0.08729657530784607,
0.015999749302864075,
0.04160281643271446,
0.027509862557053566,
0.030352720990777016,
0.03945333883166313,
-0.0007069228449836373,
0.020922750234603882,
-0.051552824676036835,
0.0405280776321888,
-0.0000037961553971399553,
0.07259691506624222,
-0.03432232514023781,
0.026209773495793343,
-0.01929330639541149,
-0.005035674199461937,
-0.034703683108091354,
-0.08701922744512558,
-0.013902273960411549,
-0.0174818504601717,
0.046560484915971756,
0.023852281272411346,
0.022205503657460213,
-0.011258762329816818,
0.012428841553628445,
-0.07127948850393295,
-0.020489387214183807,
-0.022864215075969696,
-0.018738601356744766,
0.013893607072532177,
0.034582339227199554,
-0.02300289086997509,
0.024025626480579376,
0.06146816164255142,
0.00460231164470315,
-0.05321693420410156,
0.04368295520544052,
0.0018937948625534773,
0.024771010503172874,
0.004342293832451105,
-0.014032282866537571,
-0.012983545660972595,
0.030768750235438347,
-0.014829670079052448,
0.006145082414150238,
0.02712850272655487,
-0.036610476672649384,
-0.04396031051874161,
-0.030162042006850243,
-0.060532096773386,
-0.06455370038747787,
-0.019535988569259644,
-0.0008900185930542648,
0.05761989951133728,
0.02340158447623253,
0.0014160125283524394,
0.014873006381094456,
-0.023314911872148514,
0.03368094563484192,
-0.04337093606591225,
-0.011501445434987545,
0.05020073056221008,
-0.04739253968000412,
-0.036333125084638596,
-0.02770054154098034,
-0.019969351589679718,
0.002435498172417283,
0.02258686162531376,
0.02468433789908886,
-0.0062707578763365746,
0.02196281962096691,
-0.1025509387254715,
0.0798080712556839,
0.031098105013370514,
0.02626177854835987,
0.038135915994644165,
-0.062230877578258514,
0.0024983356706798077,
0.04624846577644348,
-0.030994098633527756,
-0.03142746165394783,
0.03078608401119709,
0.01684047281742096,
0.0600467324256897,
0.007601181045174599,
0.04420299082994461,
0.00004543536851997487,
0.022569527849555016,
0.04600578173995018,
0.04049340635538101,
-0.04427232965826988,
-0.02823791094124317,
-0.03463434427976608,
-0.006296759471297264,
-0.04285090044140816,
0.012758197262883186,
-0.015445045195519924,
0.04212285205721855,
0.026521794497966766,
-0.03056073561310768,
-0.027336517348885536,
-0.055089063942432404,
0.006530775222927332,
-0.02927798219025135,
-0.04281623288989067,
-0.03141012787818909,
0.013148223049938679,
0.02480567991733551,
0.033264920115470886,
-0.024701671674847603,
0.0370611771941185,
0.005928401369601488,
-0.024424320086836815,
0.006361763924360275,
-0.02690315432846546,
0.02426830865442753,
0.07148750871419907,
0.036159779876470566,
-0.02822057716548443,
0.02584574930369854,
-0.014985681511461735,
0.029173973947763443,
0.026556463912129402,
-0.005278357304632664,
-0.012862203642725945,
0.027665872126817703,
-0.03031805157661438,
0.05200352147221565,
0.06895666569471359,
0.013642257079482079,
0.01547971460968256,
0.03543173149228096,
-0.03692249953746796,
0.07225022464990616,
-0.01010601781308651,
0.09637986123561859,
0.0003215009346604347,
0.0355704091489315,
0.0050660097040236,
-0.020541390404105186,
-0.008810263127088547,
-0.0030357055366039276,
0.0261924397200346,
-0.06243889406323433,
0.025516394525766373,
-0.0390373095870018,
-0.06292425841093063,
0.02364426665008068,
0.013390906155109406,
0.005321693606674671,
0.032606206834316254,
-0.10705791413784027,
0.027925889939069748,
0.0033715616445988417,
-0.010842734016478062,
0.02718050591647625,
0.01944931596517563,
0.020576059818267822,
0.004857995547354221,
0.07890667766332626,
0.023800278082489967,
0.03440899774432182,
-0.033074237406253815,
-0.003859094576910138,
0.014370306394994259,
0.020749405026435852,
-0.01720449887216091,
-0.03154880180954933,
0.013763598166406155,
-0.01835724338889122,
-0.005391031503677368,
-0.032155510038137436,
0.00421011820435524,
0.015289034694433212,
-0.0030985430348664522,
0.05186484381556511,
-0.013234895654022694,
0.04676849767565727,
-0.047080520540475845,
-0.0029707010835409164,
0.05470770224928856,
0.07509308308362961,
0.009568647481501102,
0.004758322145789862,
0.00941263698041439,
-0.03375028446316719,
0.01910262554883957,
0.01788921095430851,
-0.026417788118124008,
-0.05453435704112053,
-0.03054339997470379,
-0.003872095374390483,
0.023020224645733833,
-0.04430700093507767,
-0.003512404393404722,
0.03834392875432968,
0.034825023263692856,
-0.008268559351563454,
-0.0035470733419060707,
-0.06406833976507187,
0.04014671593904495,
0.06056676805019379,
0.026157770305871964,
-0.0284112561494112,
-0.02979801781475544,
0.015471047721803188,
-0.05796658992767334,
-0.00031175027834251523,
-0.013668258674442768,
0.003414897946640849,
-0.02816857397556305,
0.003971769008785486,
-0.07211154699325562,
0.03141012787818909,
-0.03713051229715347,
0.02097475342452526,
-0.020177366212010384,
0.007744190748780966,
0.04285090044140816,
0.05176083743572235,
-0.006205753423273563,
0.007722522597759962,
-0.00845057237893343,
-0.038135915994644165,
0.026383118703961372,
0.00842023640871048,
0.0504087470471859,
0.003908931277692318,
0.01533237099647522,
0.03806657716631889,
-0.03146212920546532,
-0.054638367146253586,
-0.03402763605117798,
0.01661512441933155,
0.010409370996057987,
0.061017464846372604,
-0.045277733355760574,
-0.06354830414056778,
-0.0368184931576252,
-0.01644177921116352,
-0.007410501595586538,
0.01823590137064457,
-0.0007025892264209688,
0.02579374611377716,
0.03303956985473633,
-0.005217686761170626,
0.004766989499330521,
-0.02962467260658741,
0.007380166091024876,
-0.03647180274128914,
-0.017048487439751625,
0.01944931596517563,
0.003118044463917613,
-0.074607715010643,
0.01666712760925293,
0.0602894127368927,
-0.036506470292806625,
-0.06743123382329941,
-0.00543003436177969,
-0.038482606410980225,
0.0007513425080105662,
-0.02276020683348179,
-0.044411007314920425,
-0.006019407417625189,
-0.0030942093580961227,
-0.06382565200328827,
-0.09506243467330933,
0.05006205663084984,
-0.0016142759704962373,
0.003206883789971471,
0.07509308308362961,
0.03239819407463074,
0.06628715246915817,
0.04198417440056801,
0.008901269175112247,
-0.05186484381556511,
-0.02858460135757923,
-0.09131818264722824,
0.01934530958533287,
-0.027856552973389626,
-0.04454968124628067,
-0.03227685019373894,
0.05876397714018822,
0.01530636940151453,
-0.031046101823449135,
-0.028896622359752655,
-0.05914533883333206,
-0.02589775249361992,
0.032380860298871994,
-0.018669264391064644,
0.010946741327643394,
-0.057585231959819794,
0.020125363022089005,
0.03636779636144638,
-0.011449441313743591,
-0.016537118703126907,
0.021217435598373413,
-0.049229998141527176,
-0.02440698631107807,
0.029884690418839455,
0.021408116444945335,
-0.0009447305928915739,
0.012056149542331696,
0.0011094084475189447,
-0.04087476804852486,
0.009091949090361595,
0.024823013693094254,
0.016069088131189346,
0.0020736404694616795,
-0.025308379903435707,
-0.04697651416063309,
0.022465521469712257,
0.007874200120568275,
0.01969200000166893,
-0.013806934468448162,
-0.024424320086836815,
0.03454767167568207,
0.0332302488386631,
0.02886195294559002,
-0.032328855246305466,
0.04208818078041077,
-0.01638977602124214,
-0.028913957998156548,
0.004706318490207195,
0.009317297488451004,
0.0429895780980587,
0.013668258674442768,
0.006643449887633324,
0.009247959591448307,
0.09714257717132568,
0.012758197262883186,
-0.010773396119475365,
-0.05200352147221565,
-0.03758120909333229,
0.06070544198155403,
-0.0023813277948647738,
0.019882678985595703,
0.05661449953913689,
-0.013858938589692116,
0.0024918352719396353,
-0.012446176260709763,
0.05668383836746216,
0.007033476140350103,
0.014240297488868237,
0.06022007763385773,
-0.0017063654959201813,
-0.026209773495793343,
0.0714181661605835,
-0.06978872418403625,
-0.009169953875243664,
0.03390629589557648,
0.004515639040619135,
-0.0037875897251069546,
-0.007388833444565535,
-0.03515437990427017,
0.04292023926973343,
0.012940209358930588,
0.014708328992128372,
-0.01086006872355938,
0.025585731491446495,
0.006379098631441593,
-0.003378062043339014,
-0.021286774426698685,
0.047947246581315994,
-0.01759452372789383,
0.01998668536543846,
0.043128252029418945,
-0.008125550113618374,
0.01277553103864193,
-0.04773923009634018,
0.06767391413450241,
0.035986434668302536,
0.005997739266604185,
0.004688984248787165,
-0.05540108308196068,
0.024250974878668785,
-0.002598009305074811,
-0.028549931943416595,
0.024840347468852997,
-0.011310765519738197,
-0.03201683238148689,
-0.06999673694372177,
0.07273559272289276,
-0.03674915432929993,
-0.016077755019068718,
-0.0425042100250721,
0.014274965971708298,
-0.023678936064243317,
0.04181082919239998,
-0.034929029643535614,
0.01677980273962021,
-0.011900139041244984,
-0.005209019407629967,
-0.06313227117061615,
-0.010175355710089207,
0.03858661279082298,
-0.036506470292806625,
0.026209773495793343,
0.019605327397584915,
-0.011406105011701584,
-0.025533728301525116,
0.041845500469207764,
0.005425700452178717,
0.037199851125478745,
-0.04642180725932121,
0.005976071115583181,
0.024146968498826027,
0.011302098631858826,
-0.04902198538184166,
0.07356764376163483,
-0.02846325933933258,
-0.029347319155931473,
0.030595405027270317,
0.0052826907485723495,
-0.02109609544277191,
-0.023037560284137726,
0.02822057716548443,
-0.04292023926973343,
-0.039869364351034164,
-0.008836264722049236,
-0.03782389312982559,
0.022517524659633636,
0.016970481723546982,
-0.041741494089365005,
-0.029936693608760834,
-0.054742373526096344,
-0.0062794252298772335,
-0.023904284462332726,
0.00683846278116107,
-0.027839217334985733,
0.03201683238148689,
0.035813089460134506,
-0.041672155261039734,
0.03205150365829468,
0.027787214145064354,
-0.03851727396249771,
-0.05529707670211792,
-0.014786334708333015,
-0.06833262741565704,
-0.028705943375825882,
-0.0847310721874237,
-0.04569375887513161,
0.012836202047765255,
0.015817737206816673,
0.02473634108901024,
-0.06431102007627487,
0.05252355709671974,
-0.014144957065582275,
0.02399095706641674,
0.016857808455824852,
-0.0025828415527939796,
0.02967667579650879,
-0.004801658447831869,
-0.0006126664811745286,
0.012298832647502422,
0.01677980273962021,
-0.017819872125983238,
0.00535636255517602,
-0.007917536422610283,
-0.014977013692259789,
0.05141414701938629,
-0.0014495981158688664,
-0.0291566401720047,
-0.0037984238006174564,
-0.0019338809652253985,
-0.00018986701616086066,
0.007267491891980171,
-0.017559856176376343,
-0.05522773787379265,
-0.006227421574294567,
0.028133904561400414,
-0.06292425841093063,
0.03588242828845978,
-0.026851151138544083,
0.047773901373147964,
-0.03851727396249771,
-0.013425575569272041,
0.021234771236777306,
0.004056274425238371,
0.012376837432384491,
-0.05124080181121826,
-0.005421367008239031,
-0.030300717800855637,
0.0012740863021463156,
-0.05924934521317482,
0.014439644291996956,
0.01689247600734234,
-0.05425700545310974,
-0.017091823741793633,
-0.025811079889535904,
-0.03222484886646271,
-0.023089563474059105,
-0.030751414597034454,
-0.03251953423023224,
-0.03378495201468468,
-0.022153500467538834,
-0.002161396201699972,
-0.04538173973560333,
-0.012818867340683937,
0.000028727205062750727,
0.008316230028867722,
-0.010218692012131214,
-0.07287426292896271,
0.07543977349996567,
0.03577842190861702,
-0.020524056628346443,
0.0365758091211319,
0.036437131464481354,
0.003924098797142506,
0.007856865413486958,
0.009793995879590511,
0.05148348584771156,
0.02352292649447918,
0.03485969454050064,
0.07010074704885483,
-0.010426705703139305,
-0.040458738803863525,
-0.01823590137064457,
0.014569653198122978,
-0.036679815500974655,
0.008927270770072937,
-0.025395052507519722,
0.07530109584331512,
-0.015315036289393902,
0.005486371461302042,
-0.052939582616090775,
0.015653058886528015,
0.007835197262465954,
-0.006149416323751211,
-0.002715017180889845,
0.04947268217802048,
0.04111744835972786,
0.008437571115791798,
0.03577842190861702,
0.017993217334151268,
0.05664916709065437,
0.013832936063408852,
-0.07273559272289276,
0.018027886748313904,
0.009169953875243664,
0.03591709956526756,
0.007718189153820276,
-0.004476636182516813,
-0.014647657983005047,
-0.012038814835250378,
-0.0006283758557401597,
0.01771586574614048,
0.052939582616090775,
0.017507851123809814,
-0.028185907751321793,
-0.010140686295926571,
0.04409898445010185,
-0.008168886415660381,
-0.03716518357396126,
0.014569653198122978,
-0.05827861279249191,
0.0410134419798851,
0.017854541540145874,
0.01801055297255516,
0.009126617573201656,
0.04607512056827545,
-0.01870393194258213,
0.0444803461432457,
0.02660846710205078,
-0.05148348584771156,
-0.006344429682940245,
0.03550107032060623,
-0.024354981258511543,
-0.034703683108091354,
-0.01690114475786686,
-0.006695453077554703,
-0.03428765386343002,
0.014569653198122978,
0.016875142231583595,
-0.0022383180912584066,
0.0412561260163784,
0.00923062488436699,
-0.03135812282562256,
-0.009724657982587814,
-0.018391910940408707,
-0.0029880355577915907,
0.07474639266729355,
0.029191309586167336,
0.00543003436177969,
-0.029260646551847458,
0.025863084942102432,
-0.06857530772686005,
-0.029988696798682213,
0.013295566663146019,
-0.003159213811159134,
-0.002858026884496212,
0.032848890870809555,
0.02794322557747364,
0.02265620045363903,
-0.01689247600734234,
-0.03626378998160362,
-0.02752719633281231,
-0.02357492968440056,
0.0031722148414701223,
0.01345157716423273,
-0.015384375117719173,
0.015063686296343803,
-0.0314968004822731,
0.011319433338940144,
-0.08369100093841553,
0.025308379903435707,
-0.005655382759869099,
-0.011865469627082348,
0.05709986388683319,
-0.035639744251966476,
-0.038829296827316284,
0.003070374485105276,
0.015540385618805885,
-0.0011375769972801208,
0.06108679994940758,
-0.08369100093841553,
0.00854157842695713,
0.038135915994644165,
0.002665180480107665,
-0.020298708230257034,
-0.0447230264544487,
-0.0548463799059391,
-0.018911946564912796,
-0.07828263193368912,
-0.007726856507360935,
-0.06080944836139679,
0.011579450219869614
]
|
36,372 | statistics | harmonic_mean | Return the harmonic mean of data.
The harmonic mean is the reciprocal of the arithmetic mean of the
reciprocals of the data. It can be used for averaging ratios or
rates, for example speeds.
Suppose a car travels 40 km/hr for 5 km and then speeds-up to
60 km/hr for another 5 km. What is the average speed?
>>> harmonic_mean([40, 60])
48.0
Suppose a car travels 40 km/hr for 5 km, and when traffic clears,
speeds-up to 60 km/hr for the remaining 30 km of the journey. What
is the average speed?
>>> harmonic_mean([40, 60], weights=[5, 30])
56.0
If ``data`` is empty, or any element is less than zero,
``harmonic_mean`` will raise ``StatisticsError``.
| def harmonic_mean(data, weights=None):
"""Return the harmonic mean of data.
The harmonic mean is the reciprocal of the arithmetic mean of the
reciprocals of the data. It can be used for averaging ratios or
rates, for example speeds.
Suppose a car travels 40 km/hr for 5 km and then speeds-up to
60 km/hr for another 5 km. What is the average speed?
>>> harmonic_mean([40, 60])
48.0
Suppose a car travels 40 km/hr for 5 km, and when traffic clears,
speeds-up to 60 km/hr for the remaining 30 km of the journey. What
is the average speed?
>>> harmonic_mean([40, 60], weights=[5, 30])
56.0
If ``data`` is empty, or any element is less than zero,
``harmonic_mean`` will raise ``StatisticsError``.
"""
if iter(data) is data:
data = list(data)
errmsg = 'harmonic mean does not support negative values'
n = len(data)
if n < 1:
raise StatisticsError('harmonic_mean requires at least one data point')
elif n == 1 and weights is None:
x = data[0]
if isinstance(x, (numbers.Real, Decimal)):
if x < 0:
raise StatisticsError(errmsg)
return x
else:
raise TypeError('unsupported type')
if weights is None:
weights = repeat(1, n)
sum_weights = n
else:
if iter(weights) is weights:
weights = list(weights)
if len(weights) != n:
raise StatisticsError('Number of weights does not match data size')
_, sum_weights, _ = _sum(w for w in _fail_neg(weights, errmsg))
try:
data = _fail_neg(data, errmsg)
T, total, count = _sum(w / x if w else 0 for w, x in zip(weights, data))
except ZeroDivisionError:
return 0
if total <= 0:
raise StatisticsError('Weighted sum must be positive')
return _convert(sum_weights / total, T)
| (data, weights=None) | [
-0.0116587458178401,
0.011391046456992626,
0.012941853143274784,
0.011289505288004875,
0.09976858645677567,
-0.014704973436892033,
0.008400204591453075,
0.019329700618982315,
0.013200321234762669,
0.07672802358865738,
0.013200321234762669,
0.01293262280523777,
0.0432748980820179,
-0.05881989374756813,
-0.04024713486433029,
0.04715191572904587,
-0.028080683201551437,
0.08965141326189041,
-0.030591513961553574,
-0.02191437967121601,
-0.0031431533861905336,
-0.05826603248715401,
-0.039287108927965164,
0.012877237051725388,
-0.031071525067090988,
0.02440674789249897,
-0.009074066765606403,
0.006475542206317186,
-0.03528086096048355,
-0.020622041076421738,
0.028874550014734268,
-0.04083791747689247,
-0.00776326609775424,
-0.02163744904100895,
0.041908711194992065,
-0.01464958768337965,
0.0031062294729053974,
0.004606266040354967,
-0.12576305866241455,
0.005953991319984198,
0.027526823803782463,
-0.029649952426552773,
0.012258759699761868,
0.04600727558135986,
0.005566289182752371,
0.06812473386526108,
0.055201344192028046,
0.06387847661972046,
0.004620112478733063,
-0.04416107386350632,
-0.005003198981285095,
-0.010458716191351414,
-0.003066997742280364,
0.006835551001131535,
0.003747783601284027,
0.07658032327890396,
-0.0015935003757476807,
-0.03216078132390976,
0.013920338824391365,
-0.0444195419549942,
0.03792092204093933,
-0.004050098825246096,
0.06675855070352554,
-0.04814886301755905,
-0.028819162398576736,
0.015960387885570526,
-0.013892645947635174,
0.014677280560135841,
-0.027139121666550636,
-0.020345110446214676,
0.00177581247407943,
-0.010957189835608006,
0.02067742682993412,
0.006240151822566986,
0.02361288294196129,
0.048481181263923645,
0.015517300926148891,
0.005981684196740389,
0.027711443603038788,
0.04323797672986984,
0.021895917132496834,
-0.00016385014168918133,
-0.022468239068984985,
-0.0012450303183868527,
-0.03075767122209072,
-0.03895479440689087,
-0.05372438579797745,
0.0197912510484457,
0.0018935076659545302,
-0.016338858753442764,
-0.014289578422904015,
0.0150188272818923,
0.03755168244242668,
0.03568702191114426,
-0.009729467332363129,
-0.0026677572168409824,
-0.061478421092033386,
-0.06797704100608826,
0.03349004685878754,
-0.013883414678275585,
-0.03764399513602257,
0.04069022089242935,
0.07931269705295563,
0.036868590861558914,
0.004555495455861092,
-0.036868590861558914,
0.008058657869696617,
-0.04390260577201843,
0.016625020653009415,
0.045194946229457855,
-0.07229714840650558,
-0.06373078376054764,
-0.029188403859734535,
-0.03710859641432762,
0.006392463576048613,
-0.040505602955818176,
0.037145521491765976,
0.10700568556785583,
-0.02112051472067833,
0.007310947403311729,
0.0023469801526516676,
0.02287440374493599,
-0.02512676641345024,
-0.0024300592485815287,
0.03596395254135132,
-0.025736011564731598,
0.041613321751356125,
-0.10479024052619934,
-0.050031986087560654,
0.020418958738446236,
0.004333951510488987,
0.04486263170838356,
0.013828028924763203,
0.009729467332363129,
-0.020954355597496033,
0.03164384886622429,
0.020068181678652763,
-0.001238107099197805,
0.06373078376054764,
-0.059890687465667725,
0.04069022089242935,
-0.0365547351539135,
0.017428116872906685,
0.02339133806526661,
0.029243789613246918,
0.013043394312262535,
0.03055459074676037,
-0.010449484921991825,
0.015729613602161407,
0.012988008558750153,
-0.02520061284303665,
-0.0030393048655241728,
0.08182352781295776,
-0.02017895318567753,
0.036942437291145325,
-0.008520207367837429,
-0.015554225072264671,
-0.02300363779067993,
-0.08189737796783447,
-0.031145373359322548,
-0.00515089463442564,
0.027009887620806694,
0.019606631249189377,
-0.00005935240551480092,
-0.04667190462350845,
0.018545066937804222,
-0.04357029125094414,
0.01563730463385582,
-0.009738698601722717,
-0.00781865231692791,
0.016911180689930916,
-0.013597254641354084,
-0.013495713472366333,
0.029613029211759567,
0.014280348084867,
0.015960387885570526,
-0.04309028014540672,
-0.008704827167093754,
0.011363353580236435,
-0.006429387256503105,
0.04659805819392204,
0.005390900652855635,
-0.06779242306947708,
-0.004597035236656666,
-0.01789889670908451,
0.022985175251960754,
0.03195770084857941,
-0.01608962193131447,
-0.02865300513803959,
0.004453954752534628,
0.014280348084867,
-0.05139817297458649,
-0.013043394312262535,
0.023502111434936523,
0.03747783601284027,
-0.025108303874731064,
0.03603779897093773,
-0.02878223918378353,
0.007389410864561796,
-0.006738625466823578,
0.0008330972050316632,
-0.050031986087560654,
0.044013381004333496,
0.0007904038648121059,
0.03038843162357807,
-0.024517519399523735,
-0.03142230212688446,
0.008312510326504707,
-0.07672802358865738,
-0.009517154656350613,
0.00887560099363327,
-0.022671321406960487,
-0.03075767122209072,
0.05612444505095482,
0.034376222640275955,
0.019422011449933052,
0.04268411546945572,
-0.051250480115413666,
0.04637651517987251,
-0.016274241730570793,
-0.07226022332906723,
0.003791630733758211,
0.014188038185238838,
0.06797704100608826,
0.04910888895392418,
0.00151157530490309,
0.03391467034816742,
-0.017261959612369537,
0.010421792045235634,
0.04611804708838463,
0.025957554578781128,
-0.009438691660761833,
-0.02747143805027008,
-0.026585262268781662,
-0.024535981938242912,
0.0019050464034080505,
0.0004684729501605034,
-0.0238898117095232,
0.032419249415397644,
0.0031062294729053974,
-0.007749419659376144,
-0.025902168825268745,
-0.03441314399242401,
-0.03607472404837608,
-0.05737986043095589,
-0.07717110961675644,
-0.00786019116640091,
0.015397298149764538,
-0.0036577812861651182,
-0.006914014462381601,
-0.046524208039045334,
0.021951302886009216,
0.044973403215408325,
-0.0259390939027071,
0.0049062734469771385,
0.0033462352585047483,
0.017695816233754158,
0.032253094017505646,
0.0034200833179056644,
-0.045785728842020035,
0.011575666256248951,
-0.028394537046551704,
0.04150255024433136,
0.045268796384334564,
-0.04002559185028076,
-0.005427824333310127,
-0.011806441470980644,
-0.004606266040354967,
0.009217147715389729,
0.05342899262905121,
0.025754474103450775,
-0.0018531220266595483,
0.028911473229527473,
-0.06742317974567413,
0.036425501108169556,
0.025477543473243713,
0.08248816430568695,
-0.009729467332363129,
-0.008667903020977974,
0.03192077577114105,
-0.02184053137898445,
-0.02097281813621521,
-0.010458716191351414,
-0.00034443146432749927,
-0.014935748651623726,
0.044013381004333496,
-0.03033304587006569,
-0.07872191816568375,
0.04345951974391937,
0.006955553777515888,
0.035927027463912964,
-0.026400642469525337,
-0.049588900059461594,
-0.012941853143274784,
-0.012286452576518059,
-0.006401694379746914,
-0.04881349578499794,
-0.06594622135162354,
0.04977351799607277,
-0.0005801102961413562,
0.01121565792709589,
0.025976017117500305,
0.08197122812271118,
-0.007389410864561796,
-0.049588900059461594,
-0.013708026148378849,
0.03387774899601936,
0.019532782956957817,
0.008847908116877079,
-0.03352697193622589,
-0.013237245380878448,
0.0037962463684380054,
-0.027083735913038254,
0.014935748651623726,
0.05320744961500168,
-0.022542087361216545,
0.05416747182607651,
0.015988081693649292,
-0.004470109008252621,
0.05032737925648689,
-0.016985028982162476,
0.021674374118447304,
0.04043175280094147,
-0.0017273497069254518,
0.029613029211759567,
-0.006341692991554737,
0.007647878490388393,
-0.008390973322093487,
0.033951595425605774,
-0.02361288294196129,
-0.06051839515566826,
-0.062143050134181976,
-0.007407872471958399,
0.03046227991580963,
-0.01041256170719862,
-0.018443526700139046,
0.03190231695771217,
0.016061929985880852,
-0.021822070702910423,
-0.0023839042987674475,
-0.025736011564731598,
0.02813606895506382,
0.052136655896902084,
0.055939823389053345,
-0.025828320533037186,
-0.0713002011179924,
0.028006834909319878,
-0.03221616894006729,
0.005704754497855902,
0.012628000229597092,
-0.004271642304956913,
-0.0027785291895270348,
-0.014271116815507412,
-0.010384867899119854,
0.0593368299305439,
-0.03149615228176117,
-0.0036070109345018864,
-0.017123494297266006,
-0.0018369677709415555,
-0.005049353931099176,
-0.009258686564862728,
0.06771857291460037,
0.011603359133005142,
0.03461622819304466,
-0.025994479656219482,
0.01336647942662239,
0.0018935076659545302,
0.03858555480837822,
-0.03535470739006996,
-0.00833097193390131,
-0.018545066937804222,
-0.05324437469244003,
-0.05501672253012657,
-0.0018127365037798882,
0.0533551461994648,
0.05582905188202858,
0.030351508408784866,
-0.01067102886736393,
0.004285488743335009,
-0.012683385983109474,
-0.0013084934325888753,
0.01164951454848051,
-0.006424771621823311,
-0.026696033775806427,
0.015129598788917065,
0.0006836705142632127,
-0.0017838896019384265,
-0.013560330495238304,
-0.08256200700998306,
0.0014850361039862037,
-0.042056407779455185,
-0.023908274248242378,
-0.00023164025333244354,
-0.007177097722887993,
-0.07414334267377853,
0.06890013813972473,
0.045268796384334564,
-0.014021879993379116,
-0.08773136883974075,
0.017058877274394035,
0.03129306808114052,
-0.10486409068107605,
-0.03443160653114319,
0.006932476535439491,
-0.051693566143512726,
-0.0037339371629059315,
-0.04024713486433029,
-0.03603779897093773,
0.030093040317296982,
0.013929570093750954,
0.010560257360339165,
0.031016139313578606,
0.017880436033010483,
0.05298590660095215,
0.014520353637635708,
0.021600525826215744,
0.004435492679476738,
-0.025329846888780594,
-0.04962582513689995,
0.047595005482435226,
0.04637651517987251,
-0.0679401159286499,
0.026769882068037987,
0.0630292296409607,
0.09002065658569336,
-0.06594622135162354,
-0.003997020423412323,
-0.0805681124329567,
-0.028745315968990326,
-0.031533077359199524,
-0.009812546893954277,
0.021951302886009216,
-0.07480797916650772,
-0.029576104134321213,
0.022098999470472336,
0.014963441528379917,
-0.0005685715586878359,
0.03513316437602043,
0.0014815744943916798,
-0.027231432497501373,
0.018821997568011284,
0.012738771736621857,
0.012628000229597092,
-0.005741678178310394,
-0.023557497188448906,
-0.053170524537563324,
0.029834572225809097,
-0.010431023314595222,
-0.012831081636250019,
-0.031976163387298584,
0.010329482145607471,
-0.06768164783716202,
0.0466349832713604,
0.02376057766377926,
-0.0064340028911828995,
0.005630906205624342,
0.014594201929867268,
0.016311166808009148,
0.02542215771973133,
0.0027508363127708435,
-0.012295683845877647,
0.0600753091275692,
-0.0037800921127200127,
-0.08293125033378601,
-0.025459080934524536,
0.04331182315945625,
0.02228361926972866,
-0.021434368565678596,
0.038917869329452515,
0.015757307410240173,
0.10508563369512558,
0.027009887620806694,
0.00774480402469635,
0.003459315048530698,
0.042942583560943604,
0.022782092913985252,
-0.028893010690808296,
-0.006526312790811062,
0.019625093787908554,
-0.043164126574993134,
0.02302209846675396,
0.013495713472366333,
0.033859286457300186,
-0.007154020480811596,
0.02819145657122135,
0.03378543630242348,
-0.018148133531212807,
-0.032622333616018295,
0.08618056029081345,
-0.049810443073511124,
0.03483777120709419,
0.06613083928823471,
0.03387774899601936,
-0.016172701492905617,
-0.02922532707452774,
-0.007038632873445749,
0.04523187130689621,
0.03984097018837929,
0.09903010725975037,
0.003251617541536689,
0.037016287446022034,
-0.04763193055987358,
-0.02008664235472679,
-0.06140457093715668,
-0.007310947403311729,
0.04822271317243576,
-0.027748368680477142,
0.003126999130472541,
-0.02154514007270336,
0.011335660703480244,
-0.04574880748987198,
0.0604814738035202,
0.0036554737016558647,
0.04416107386350632,
0.026068327948451042,
-0.027600672096014023,
-0.04689345136284828,
0.06668470054864883,
0.005090893246233463,
-0.017197342589497566,
-0.006914014462381601,
0.011834134347736835,
-0.0663893073797226,
0.04984736815094948,
-0.03950865566730499,
0.015766538679599762,
-0.09245763719081879,
-0.03456084057688713,
0.009821777231991291,
0.046154968440532684,
-0.02462829276919365,
0.03140384331345558,
-0.014271116815507412,
0.052579741925001144,
-0.016680406406521797,
-0.02643756754696369,
-0.007970963604748249,
-0.04729961231350899,
-0.027508361265063286,
0.00009721390233607963,
-0.0010482947109267116,
-0.02784067764878273,
0.022855941206216812,
-0.06738625466823578,
0.05084431543946266,
0.016975797712802887,
-0.033434659242630005,
0.03457930311560631,
-0.02630833350121975,
-0.029705338180065155,
0.0157757680863142,
-0.081306591629982,
-0.01629270426928997,
0.047964245080947876,
0.014012648724019527,
-0.04844425618648529,
-0.01871122419834137,
-0.030997678637504578,
-0.022486701607704163,
0.014889593236148357,
-0.0060186078771948814,
-0.07491874694824219,
0.011991061270236969,
-0.02564370073378086,
-0.028560696169734,
0.0009744468261487782,
-0.004248565062880516,
-0.015988081693649292,
-0.06328769773244858,
-0.01162182167172432,
-0.04988429322838783,
0.06273383647203445,
0.03814246878027916,
-0.03304695710539818,
-0.006563236936926842,
0.05139817297458649,
0.0003822208382189274,
-0.04947812855243683,
-0.01457573939114809,
-0.04903503879904747,
-0.029114555567502975,
-0.061626117676496506,
-0.010440254583954811,
-0.008109427988529205,
0.011501818895339966,
-0.013200321234762669,
-0.05283821001648903,
0.022098999470472336,
-0.0499950647354126,
0.06354616582393646,
-0.024203665554523468,
-0.08197122812271118,
0.010966421104967594,
0.02754528634250164,
0.01607116125524044,
0.015286525711417198,
-0.028837624937295914,
-0.042204104363918304,
0.04430877044796944,
0.037957847118377686,
-0.025828320533037186,
0.026862192898988724,
-0.002052742289379239,
0.014714204706251621,
0.04752115532755852,
0.03659166023135185,
0.013311093673110008,
-0.02542215771973133,
-0.024572905153036118,
-0.12007676810026169,
-0.0425364188849926,
0.04083791747689247,
0.00497089046984911,
0.032123859971761703,
0.04478878155350685,
0.03500393033027649,
-0.0016488863620907068,
-0.051102783530950546,
0.06317692250013351,
0.03574240952730179,
0.03158846125006676,
-0.037810150533914566,
0.0008440589881502092,
-0.018305061385035515,
0.012960315681993961,
-0.02682526782155037,
0.02643756754696369,
-0.012877237051725388,
-0.05822911113500595,
-0.04338567331433296,
-0.008806368336081505,
-0.010458716191351414,
0.005460132844746113,
-0.02477598749101162,
-0.04988429322838783,
0.04560111090540886,
0.010089476592838764,
-0.01336647942662239,
0.01037563756108284,
0.008210969157516956,
0.023132871836423874,
0.009609464555978775,
0.004417030606418848,
-0.04523187130689621,
0.07606338709592819,
0.04283181205391884,
-0.03936095908284187,
-0.01667117513716221,
-0.010311020538210869,
0.026289870962500572,
-0.029539180919528008,
-0.017298882827162743,
-0.04674575477838516,
0.004571649711579084,
0.05656753107905388,
0.0604814738035202,
0.04637651517987251,
-0.07443873584270477,
-0.01776966266334057,
-0.008100197650492191,
-0.0417979396879673,
0.016468092799186707,
0.005100124049931765,
0.019698942080140114,
0.06742317974567413,
0.042794886976480484,
-0.06487542390823364,
0.010698721744120121,
0.03317619115114212,
-0.04752115532755852,
0.0090556051582098,
0.049293506890535355,
-0.001153874211013317,
0.04379183426499367,
-0.0019304315792396665,
0.05867219716310501,
-0.01804659329354763,
-0.0212682094424963,
-0.04947812855243683,
-0.033286962658166885,
0.05180433765053749,
0.003145461203530431,
0.02112051472067833,
-0.019643554463982582,
0.005418593529611826,
-0.013412633910775185,
0.01249876618385315,
0.004442415665835142,
0.0022165924310684204,
-0.02521907538175583,
-0.05136125162243843,
-0.00219351495616138,
0.0025362155865877867,
-0.005086277611553669,
-0.012120295315980911,
-0.03253002464771271,
-0.06051839515566826,
-0.0008688673260621727,
0.06576160341501236,
-0.009083298034965992,
0.03814246878027916,
0.05091816186904907,
-0.01198183000087738,
0.013615716248750687,
0.03747783601284027,
-0.05918913334608078,
-0.025034455582499504,
0.026068327948451042,
0.015517300926148891,
-0.011834134347736835,
-0.04165024682879448,
0.02243131585419178,
-0.026769882068037987,
0.039434805512428284,
0.011427970603108406,
-0.009914087131619453,
0.02915147878229618,
-0.011298736557364464,
0.0074171037413179874,
0.038327086716890335,
-0.0038839406333863735,
-0.008958679623901844,
0.055792126804590225,
0.026936041191220284,
-0.05224742740392685,
-0.026566801592707634,
0.05069661885499954,
-0.03179154172539711,
0.004313182085752487,
0.002355057280510664,
-0.00495242839679122,
-0.055939823389053345,
0.0233174916356802,
0.06350924074649811,
0.06291845440864563,
0.020289724692702293,
0.010126400738954544,
-0.002753143897280097,
0.029391484335064888,
0.07067248970270157,
0.014123421162366867,
-0.006609391886740923,
0.002649295376613736,
-0.03976712375879288,
0.031385380774736404,
-0.0663893073797226,
0.036351654678583145,
0.048111941665410995,
0.0337669774889946,
0.00865867268294096,
-0.019551245495676994,
-0.05365053564310074,
0.013052625581622124,
0.04353336617350578,
0.029133016243577003,
0.03478238359093666,
-0.06044454872608185,
-0.06461695581674576,
0.02411135658621788,
-0.015249602496623993,
0.0007950193830765784,
-0.039065565913915634,
0.01710503175854683,
0.04264719411730766,
-0.050031986087560654,
0.022098999470472336,
-0.016458861529827118,
0.03537316992878914
]
|
36,373 | operator | itemgetter | itemgetter(item, ...) --> itemgetter object
Return a callable object that fetches the given item(s) from its operand.
After f = itemgetter(2), the call f(r) returns r[2].
After g = itemgetter(2, 5, 3), the call g(r) returns (r[2], r[5], r[3]) | class itemgetter:
"""
Return a callable object that fetches the given item(s) from its operand.
After f = itemgetter(2), the call f(r) returns r[2].
After g = itemgetter(2, 5, 3), the call g(r) returns (r[2], r[5], r[3])
"""
__slots__ = ('_items', '_call')
def __init__(self, item, *items):
if not items:
self._items = (item,)
def func(obj):
return obj[item]
self._call = func
else:
self._items = items = (item,) + items
def func(obj):
return tuple(obj[i] for i in items)
self._call = func
def __call__(self, obj):
return self._call(obj)
def __repr__(self):
return '%s.%s(%s)' % (self.__class__.__module__,
self.__class__.__name__,
', '.join(map(repr, self._items)))
def __reduce__(self):
return self.__class__, self._items
| null | [
0.04770814999938011,
-0.056032322347164154,
-0.037990499287843704,
-0.030143043026328087,
0.03868723660707474,
0.0007970075239427388,
0.040080711245536804,
-0.050458427518606186,
0.07598099857568741,
-0.04385776072740555,
0.01710672676563263,
0.06956368684768677,
0.0362669937312603,
0.01863771490752697,
-0.037990499287843704,
0.039934031665325165,
-0.02016870304942131,
0.027924485504627228,
0.004554001148790121,
0.07942801713943481,
0.01326550543308258,
0.015584906563162804,
0.03536856919527054,
0.014567303471267223,
0.02752111107110977,
0.03423178941011429,
0.07759449630975723,
0.0023996171075850725,
0.06784018129110336,
-0.03173820301890373,
0.009025494568049908,
0.0023320061154663563,
-0.03967733681201935,
-0.017638446763157845,
-0.02983134426176548,
-0.017748458310961723,
0.000013769293218501844,
0.037880491465330124,
-0.018197670578956604,
0.0011682950425893068,
0.01753760315477848,
-0.09248267114162445,
0.06358642131090164,
-0.04283098876476288,
-0.0040176971815526485,
-0.013137158937752247,
0.001215851865708828,
-0.026292653754353523,
0.02574259787797928,
-0.06149620562791824,
0.04041074588894844,
-0.005083429627120495,
0.018958579748868942,
-0.002298773732036352,
-0.027484441176056862,
0.03080310858786106,
0.015300710685551167,
0.028419535607099533,
-0.010918602347373962,
0.036908723413944244,
-0.00042944439337588847,
0.028034497052431107,
-0.004260638263076544,
0.00025368446949869394,
0.003559317672625184,
-0.04869825020432472,
-0.059002622961997986,
-0.011826193891465664,
-0.06703343242406845,
0.02110379748046398,
0.027392765507102013,
0.018811898306012154,
-0.013522198423743248,
-0.060176074504852295,
-0.024184107780456543,
-0.0017555938102304935,
-0.02009536139667034,
-0.06083614006638527,
0.12511929869651794,
-0.022772299125790596,
-0.051815230399370193,
-0.013201332651078701,
-0.03265496343374252,
-0.05346539616584778,
-0.021800532937049866,
-0.01800515130162239,
0.015694918110966682,
-0.03201323002576828,
-0.018518535420298576,
0.035790279507637024,
-0.06747347861528397,
0.022808969020843506,
-0.02240559458732605,
0.01652916893362999,
-0.09086917340755463,
-0.0331316776573658,
0.021635517477989197,
-0.04404111206531525,
0.0025165039114654064,
0.03324168920516968,
0.04059409722685814,
-0.00874129869043827,
-0.0797213762998581,
-0.015557403676211834,
0.0035157715901732445,
-0.013723884709179401,
0.01497067790478468,
-0.0050100889056921005,
0.011679512448608875,
-0.019636981189250946,
0.006797769572585821,
0.048478227108716965,
-0.04070410877466202,
0.04554459825158119,
-0.014558136463165283,
0.03802717104554176,
-0.04180422052741051,
-0.03159152343869209,
-0.0006136556621640921,
-0.04132750630378723,
-0.02577926777303219,
-0.009144673123955727,
-0.03425012528896332,
0.03716541826725006,
0.013421354815363884,
-0.02143383026123047,
0.02541256509721279,
-0.0169050395488739,
0.020957116037607193,
0.024312453344464302,
0.04121749475598335,
-0.02997802570462227,
-0.06211960315704346,
0.027337759733200073,
0.029556317254900932,
0.01921527273952961,
0.02334068901836872,
0.03705540671944618,
-0.06905030459165573,
0.03945731744170189,
0.010056848637759686,
-0.05119183287024498,
-0.02258894592523575,
0.05889261141419411,
-0.032544951885938644,
-0.04242761433124542,
0.050458427518606186,
0.07942801713943481,
0.036798715591430664,
0.004317936021834612,
-0.045361243188381195,
0.05452883616089821,
0.03599196672439575,
0.03861389681696892,
0.008942985907196999,
-0.010240199975669384,
-0.04470117762684822,
-0.03813718259334564,
-0.010432719253003597,
-0.0049596671015024185,
0.015282375738024712,
-0.004547125659883022,
-0.019416959956288338,
-0.013604706153273582,
0.033773407340049744,
0.03505687043070793,
0.016373319551348686,
-0.035716939717531204,
-0.002663185354322195,
-0.009007158689200878,
0.007723696064203978,
-0.041914232075214386,
-0.04928497597575188,
-0.033645063638687134,
-0.02445913478732109,
0.040044043213129044,
-0.05331871658563614,
0.03188488632440567,
0.007063629571348429,
-0.06193625181913376,
-0.0061789569444954395,
-0.02665935829281807,
-0.027906149625778198,
-0.04792816936969757,
0.018564373254776,
0.05012839287519455,
0.032416604459285736,
0.013082154095172882,
0.03434180095791817,
0.06061611697077751,
-0.038870591670274734,
-0.025229213759303093,
0.0034263874404132366,
-0.006481487303972244,
-0.014127259142696857,
0.011331143788993359,
-0.07070046663284302,
0.05570228770375252,
0.03832053393125534,
0.09028244763612747,
-0.054785531014204025,
0.02970299869775772,
-0.010423552244901657,
0.07077381014823914,
-0.04165753722190857,
0.019801998510956764,
0.04275764897465706,
-0.023890744894742966,
-0.04580128937959671,
0.028492875397205353,
-0.008580866269767284,
0.00554639333859086,
-0.00004225687007419765,
0.01178035605698824,
-0.0025256716180592775,
0.003928313031792641,
0.025339223444461823,
0.01548406295478344,
0.043124351650476456,
0.01287129893898964,
0.057095762342214584,
-0.0847085490822792,
0.037770479917526245,
0.004996337462216616,
0.041914232075214386,
-0.05240195617079735,
-0.012541266158223152,
-0.000315135985147208,
-0.03624865785241127,
-0.02015036717057228,
0.03718375414609909,
-0.020627081394195557,
0.0793546736240387,
-0.018298514187335968,
-0.024770833551883698,
-0.029299624264240265,
0.055885639041662216,
-0.04510455206036568,
-0.00005808529022033326,
0.022148901596665382,
-0.019380290061235428,
0.03824719414114952,
0.015704084187746048,
0.015979113057255745,
-0.04195090010762215,
0.023909078910946846,
0.05570228770375252,
0.033571720123291016,
-0.05826921388506889,
-0.010936937294900417,
-0.004922996740788221,
0.07238730788230896,
0.03434180095791817,
0.018463529646396637,
-0.015621576458215714,
0.008988823741674423,
-0.037807147949934006,
-0.03960399702191353,
-0.022662287577986717,
-0.05082513019442558,
0.014677315019071102,
-0.02469749189913273,
0.01392557192593813,
-0.02027871273458004,
-0.013678046874701977,
0.01118446234613657,
0.06285300850868225,
0.013017980381846428,
-0.03698206692934036,
0.07202060520648956,
0.0858086571097374,
0.023157337680459023,
0.024770833551883698,
-0.0024752498138695955,
-0.03419511765241623,
0.015282375738024712,
0.013824728317558765,
0.02438579499721527,
-0.013146326877176762,
-0.06035942584276199,
0.01651083305478096,
0.011514495126903057,
-0.105977363884449,
-0.013476360589265823,
0.011056115850806236,
0.011459490284323692,
0.036578692495822906,
0.01563074439764023,
0.06197291985154152,
0.008722963742911816,
0.05423547327518463,
-0.018362686038017273,
-0.0038480968214571476,
-0.012137891724705696,
0.07048044353723526,
0.032343264669179916,
-0.05243862420320511,
-0.017803464084863663,
0.04895494133234024,
0.025999290868639946,
-0.01750093325972557,
-0.019820334389805794,
-0.06567662954330444,
-0.01867438480257988,
0.0277227982878685,
0.012733785435557365,
0.04594797268509865,
0.019912010058760643,
-0.04275764897465706,
0.013943907804787159,
0.0018312265165150166,
-0.011982042342424393,
0.004936748184263706,
-0.007150721736252308,
-0.002890083473175764,
-0.024129102006554604,
-0.06516324728727341,
0.05878259986639023,
0.028254518285393715,
0.0531720332801342,
-0.0028488291427493095,
-0.003006970277056098,
-0.032471612095832825,
0.0723506361246109,
0.005945183336734772,
0.021745529025793076,
-0.07590766251087189,
0.0007454398437403142,
0.009130921214818954,
0.04184088855981827,
-0.03931063413619995,
0.0079758046194911,
-0.018032653257250786,
0.008645039051771164,
0.04143751412630081,
0.04396777227520943,
0.060249414294958115,
0.045397914946079254,
0.011798691004514694,
-0.0465346984565258,
-0.00038618480903096497,
-0.01632748171687126,
-0.026347659528255463,
0.030216382816433907,
-0.010744418017566204,
-0.022607281804084778,
0.031188147142529488,
0.02038872428238392,
0.05929598584771156,
-0.0406307689845562,
0.010396049357950687,
-0.05742579698562622,
-0.026420999318361282,
-0.016740022227168083,
0.008539611473679543,
0.036835383623838425,
-0.03956732526421547,
-0.05779249966144562,
0.020022021606564522,
0.008874229155480862,
0.09394948184490204,
-0.034690167754888535,
-0.00634397380053997,
-0.008127070032060146,
0.004592963494360447,
-0.06648337841033936,
-0.029519645497202873,
0.014814828522503376,
0.00384351285174489,
-0.07986806333065033,
0.01011185348033905,
-0.013439689762890339,
0.03425012528896332,
0.02123214304447174,
-0.008466270752251148,
0.014393119141459465,
0.034433476626873016,
0.017546771094202995,
-0.05856257677078247,
-0.03280164301395416,
0.0074486685916781425,
-0.044407814741134644,
0.04506788030266762,
0.03810051083564758,
0.02356071211397648,
0.021965550258755684,
-0.00768244219943881,
0.03102313168346882,
0.038980599492788315,
0.025247547775506973,
-0.05867258831858635,
-0.022863974794745445,
-0.03080310858786106,
-0.0331316776573658,
-0.02233225479722023,
-0.03945731744170189,
0.037917159497737885,
-0.06630002707242966,
-0.04613132402300835,
-0.05027507245540619,
0.026292653754353523,
-0.025889279320836067,
-0.007700777146965265,
0.03511187806725502,
0.026402665302157402,
-0.04613132402300835,
-0.005592231173068285,
0.04657136648893356,
-0.005138435401022434,
-0.004024572670459747,
-0.010350211523473263,
-0.035680267959833145,
-0.016281643882393837,
-0.029354630038142204,
-0.0021062542218714952,
-0.012046216055750847,
-0.015126526355743408,
0.06560328602790833,
0.009470122866332531,
0.03489185497164726,
0.016987547278404236,
-0.022625617682933807,
-0.010359378531575203,
-0.037660468369722366,
-0.025339223444461823,
-0.0470847524702549,
-0.014090589247643948,
-0.005308035761117935,
0.02649434097111225,
0.03182987868785858,
-0.016428325325250626,
-0.08566197752952576,
-0.026145972311496735,
-0.034653495997190475,
-0.023120667785406113,
-0.04250095784664154,
-0.01272461749613285,
0.02761278674006462,
0.0402640625834465,
0.03720209002494812,
0.02150717005133629,
0.06424648314714432,
0.01584159955382347,
-0.028291188180446625,
-0.03824719414114952,
-0.0165658388286829,
0.009662642143666744,
0.023725727573037148,
0.014173096977174282,
-0.036652032285928726,
0.05188857018947601,
0.055775631219148636,
0.05155853554606438,
0.022148901596665382,
0.08001474291086197,
-0.017931809648871422,
-0.014044750481843948,
-0.012632941827178001,
0.0003575360751710832,
0.02555924654006958,
0.0510818213224411,
-0.004492119885981083,
0.02880457416176796,
-0.028309524059295654,
-0.07000373303890228,
0.012761288322508335,
0.023083996027708054,
0.048368215560913086,
-0.041144151240587234,
-0.020920444279909134,
-0.020040355622768402,
0.014246437698602676,
-0.07510091364383698,
-0.011230300180613995,
0.02981300838291645,
0.03967733681201935,
-0.01325633842498064,
-0.03309500589966774,
-0.027997825294733047,
-0.0896223783493042,
-0.021818868815898895,
-0.04261096566915512,
0.04723143205046654,
-0.031188147142529488,
-0.040044043213129044,
0.035826947540044785,
0.0024087848141789436,
0.03406677022576332,
-0.021067125722765923,
0.022808969020843506,
-0.012541266158223152,
0.03126148879528046,
-0.00748992245644331,
-0.007897880859673023,
-0.006641920190304518,
0.01928861439228058,
-0.02258894592523575,
0.008553363382816315,
0.03296666219830513,
-0.00586267514154315,
0.030711432918906212,
-0.02341403067111969,
0.04719476401805878,
0.02759445272386074,
0.028107836842536926,
-0.01230290811508894,
-0.005573895759880543,
0.019691986963152885,
-0.029354630038142204,
-0.07678774744272232,
-0.02559591643512249,
-0.04121749475598335,
0.019912010058760643,
0.01660250872373581,
-0.048588238656520844,
-0.03643200919032097,
0.0013086737599223852,
0.012999645434319973,
-0.0036487015895545483,
0.0068252719938755035,
0.08932901918888092,
-0.008438768796622753,
-0.026842709630727768,
0.014090589247643948,
-0.031078137457370758,
-0.02334068901836872,
0.00277319666929543,
-0.013907236978411674,
0.0029771754052489996,
0.020938780158758163,
-0.03637700527906418,
-0.004725893493741751,
-0.05837922543287277,
0.009383030235767365,
-0.010249367915093899,
0.06721678376197815,
0.005459301173686981,
0.010909434407949448,
0.010451055131852627,
0.03408510610461235,
0.09387613832950592,
0.06707010418176651,
0.029097937047481537,
-0.06083614006638527,
0.049688346683979034,
-0.024770833551883698,
-0.013201332651078701,
-0.0037770478520542383,
0.0203153844922781,
-0.028236182406544685,
-0.007737447507679462,
-0.037917159497737885,
0.01923360861837864,
-0.029281288385391235,
0.02343236468732357,
0.0022575196344405413,
-0.033553387969732285,
-0.026916049420833588,
-0.02119547314941883,
0.01176202017813921,
0.017730122432112694,
0.03758712857961655,
-0.02346903458237648,
0.017491765320301056,
0.009735982865095139,
0.02577926777303219,
0.06585998088121414,
0.03643200919032097,
-0.007654939312487841,
-0.058195874094963074,
-0.019636981189250946,
0.040080711245536804,
-0.006192708387970924,
0.02011369727551937,
0.012568768113851547,
-0.012101221829652786,
-0.021617181599140167,
-0.04891826957464218,
-0.010432719253003597,
-0.030473075807094574,
0.026164308190345764,
0.014530633576214314,
-0.005317203234881163,
-0.00503759179264307,
0.00010922326328000054,
0.006907780654728413,
-0.007865794003009796,
0.011083618737757206,
-0.06967370212078094,
0.006531909108161926,
0.027942819520831108,
-0.0575358085334301,
-0.05049509555101395,
0.06083614006638527,
0.06791352480649948,
-0.027246084064245224,
-0.05324537307024002,
0.025889279320836067,
-0.08566197752952576,
-0.03843054547905922,
-0.042170923203229904,
-0.0011608463246375322,
0.015181532129645348,
0.0027502775192260742,
0.022607281804084778,
-0.026861043646931648,
-0.015612409450113773,
0.017620110884308815,
-0.004173546098172665,
-0.029226282611489296,
-0.025174207985401154,
-0.018628546968102455,
0.03094979003071785,
0.05119183287024498,
0.013311343267560005,
-0.013678046874701977,
-0.009387614205479622,
0.042170923203229904,
-0.028401199728250504,
-0.013329679146409035,
-0.0751742571592331,
0.018573541194200516,
-0.03810051083564758,
0.03131649270653725,
-0.02656768076121807,
-0.0381738543510437,
0.04701141268014908,
-0.032489944249391556,
0.05001838132739067,
-0.012678779661655426,
0.005477636121213436,
-0.022643951699137688,
0.128712996840477,
-0.03212324157357216,
-0.008379179053008556,
-0.005473052617162466,
0.032691631466150284,
0.07345074415206909,
-0.06211960315704346,
0.04356439784169197,
-0.023047326132655144,
0.016464995220303535,
-0.04352772608399391,
-0.005761831533163786,
0.0046846396289765835,
-0.04910162091255188,
-0.02984968014061451,
-0.0073661599308252335,
0.07436750829219818,
0.006793185602873564,
-0.021727193146944046,
0.030326394364237785,
0.006476903799921274,
0.03511187806725502,
-0.01820683851838112,
-0.01903192140161991,
0.06193625181913376,
-0.09167592227458954,
-0.004900077823549509,
0.00828291941434145,
-0.026420999318361282,
-0.04345438629388809,
0.004964251071214676,
-0.016767526045441628,
-0.00691694812849164,
-0.03126148879528046,
-0.04506788030266762,
0.017189234495162964,
0.04154752567410469,
0.0010812028776854277,
0.034561820328235626,
-0.03170153126120567,
0.008906316012144089,
0.0018656050087884068,
-0.02557758241891861,
-0.0133846839889884,
0.05746246501803398,
0.01712506264448166,
0.0009316565119661391,
-0.018381021916866302,
0.023194007575511932,
-0.0018254967872053385,
-0.013641376979649067,
0.031353164464235306,
-0.0297213327139616,
-0.04693806916475296,
0.025155872106552124,
0.0015160904731601477,
-0.004744228906929493,
-0.0698937177658081,
0.07477088272571564,
0.0027846561279147863,
0.046204663813114166,
-0.05111849308013916,
-0.10363046079874039,
0.006756515242159367,
-0.013054651208221912,
-0.03305833786725998,
0.03646868094801903,
-0.014558136463165283,
-0.018445195630192757,
0.004185005556792021,
0.06508990377187729,
-0.026476005092263222,
-0.012128723785281181,
0.01602495089173317,
-0.018362686038017273,
-0.026989391073584557,
-0.002521087881177664,
-0.026054296642541885,
-0.03274663910269737,
0.004886326380074024,
-0.014191431924700737,
-0.007036126684397459,
0.07759449630975723,
-0.04866157844662666,
-0.025724263861775398,
0.062302954494953156,
-0.05243862420320511,
0.059992723166942596,
0.026329323649406433,
-0.046461354941129684,
0.07539427280426025,
0.039934031665325165,
-0.010084351524710655,
0.008388346992433071,
0.06156954914331436,
-0.03938397392630577,
-0.06252297759056091,
0.007013207767158747,
0.013678046874701977,
0.01287129893898964,
0.025889279320836067,
-0.02038872428238392,
0.05551893636584282,
-0.03494685888290405,
0.008709212765097618,
-0.02860288694500923,
0.02436745911836624,
0.045251235365867615,
-0.00820041075348854,
0.02781447395682335,
0.00219220039434731,
0.02240559458732605,
-0.03949398547410965,
-0.001503485138528049,
-0.016318313777446747,
0.022790633141994476,
-0.03628532961010933,
-0.05232861638069153,
0.008828391321003437,
0.04924830421805382,
0.019728658720850945,
0.010661909356713295,
0.0449945405125618,
-0.052731990814208984,
-0.01500734779983759,
-0.0408141203224659,
-0.015621576458215714,
-0.02346903458237648,
-0.04360106587409973,
0.03195822611451149,
-0.0023067952133715153,
0.025247547775506973,
-0.006596082355827093,
-0.0013510738499462605,
0.00424001133069396,
0.015044018626213074
]
|
36,374 | statistics | linear_regression | Slope and intercept for simple linear regression.
Return the slope and intercept of simple linear regression
parameters estimated using ordinary least squares. Simple linear
regression describes relationship between an independent variable
*x* and a dependent variable *y* in terms of linear function:
y = slope * x + intercept + noise
where *slope* and *intercept* are the regression parameters that are
estimated, and noise represents the variability of the data that was
not explained by the linear regression (it is equal to the
difference between predicted and actual values of the dependent
variable).
The parameters are returned as a named tuple.
>>> x = [1, 2, 3, 4, 5]
>>> noise = NormalDist().samples(5, seed=42)
>>> y = [3 * x[i] + 2 + noise[i] for i in range(5)]
>>> linear_regression(x, y) #doctest: +ELLIPSIS
LinearRegression(slope=3.09078914170..., intercept=1.75684970486...)
| def linear_regression(x, y, /):
"""Slope and intercept for simple linear regression.
Return the slope and intercept of simple linear regression
parameters estimated using ordinary least squares. Simple linear
regression describes relationship between an independent variable
*x* and a dependent variable *y* in terms of linear function:
y = slope * x + intercept + noise
where *slope* and *intercept* are the regression parameters that are
estimated, and noise represents the variability of the data that was
not explained by the linear regression (it is equal to the
difference between predicted and actual values of the dependent
variable).
The parameters are returned as a named tuple.
>>> x = [1, 2, 3, 4, 5]
>>> noise = NormalDist().samples(5, seed=42)
>>> y = [3 * x[i] + 2 + noise[i] for i in range(5)]
>>> linear_regression(x, y) #doctest: +ELLIPSIS
LinearRegression(slope=3.09078914170..., intercept=1.75684970486...)
"""
n = len(x)
if len(y) != n:
raise StatisticsError('linear regression requires that both inputs have same number of data points')
if n < 2:
raise StatisticsError('linear regression requires at least two data points')
xbar = fsum(x) / n
ybar = fsum(y) / n
sxy = fsum((xi - xbar) * (yi - ybar) for xi, yi in zip(x, y))
sxx = fsum((xi - xbar) ** 2.0 for xi in x)
try:
slope = sxy / sxx # equivalent to: covariance(x, y) / variance(x)
except ZeroDivisionError:
raise StatisticsError('x is constant')
intercept = ybar - slope * xbar
return LinearRegression(slope=slope, intercept=intercept)
| (x, y, /) | [
-0.021165328100323677,
-0.021529916673898697,
0.11858724057674408,
-0.025962546467781067,
0.020109940320253372,
-0.024542570114135742,
-0.038972605019807816,
0.02841872349381447,
0.03285135328769684,
0.024139603599905968,
-0.0017761702183634043,
-0.007056708447635174,
0.010621041990816593,
0.000005752914603363024,
-0.03434808552265167,
0.04156310111284256,
-0.04589978605508804,
-0.025617146864533424,
-0.0796722024679184,
-0.0321221761405468,
-0.019275223836302757,
0.04513223096728325,
0.007593996822834015,
0.02383258193731308,
-0.022834761068224907,
0.017999164760112762,
0.008663776330649853,
-0.025329314172267914,
0.05138780549168587,
-0.03348458558320999,
-0.02738252282142639,
-0.03843531385064125,
-0.0472046323120594,
-0.06858103722333908,
-0.03377242013812065,
-0.020301828160881996,
0.000403865851694718,
0.026710912585258484,
-0.042983077466487885,
-0.0023554342333227396,
-0.03125867620110512,
-0.005396870896220207,
0.03379160910844803,
0.038396935909986496,
-0.0319494754076004,
-0.027420900762081146,
-0.06969399005174637,
0.022201526910066605,
-0.05587800219655037,
-0.04854785278439522,
0.01999480649828911,
-0.011858724057674408,
0.023352859541773796,
-0.026557402685284615,
0.019486302509903908,
0.03363809734582901,
0.03402187302708626,
0.055263958871364594,
0.024523381143808365,
-0.04367387667298317,
0.0376293808221817,
-0.006169223226606846,
-0.03849288076162338,
0.011829940602183342,
-0.015821225941181183,
-0.011052791960537434,
-0.035633739084005356,
-0.009757542982697487,
0.029109522700309753,
0.05338344722986221,
-0.0035643333103507757,
0.049584049731492996,
0.013863961212337017,
-0.01228087954223156,
0.02980032190680504,
0.0739922970533371,
0.022470172494649887,
-0.0047444491647183895,
0.02774711139500141,
-0.013393834233283997,
-0.04866298660635948,
-0.0018577228765934706,
-0.0034851792734116316,
0.026557402685284615,
-0.029397355392575264,
-0.05399749055504799,
-0.03574887290596962,
-0.03691939264535904,
0.029627621173858643,
0.023717448115348816,
-0.07944194227457047,
0.036957770586013794,
0.0012964482884854078,
0.01918887346982956,
-0.01694377511739731,
-0.020244263112545013,
0.014689083211123943,
0.02333367057144642,
0.04524736478924751,
-0.005876592826098204,
0.005358492955565453,
0.013345861807465553,
-0.03617102652788162,
0.1000891700387001,
-0.028322778642177582,
-0.051119159907102585,
0.03538428246974945,
0.011945074424147606,
0.03202623128890991,
0.03736073896288872,
-0.05821904540061951,
-0.0199180506169796,
-0.009575248695909977,
-0.008855665102601051,
-0.07103721052408218,
-0.0013420218601822853,
-0.09563735127449036,
0.0347510501742363,
-0.04954567179083824,
-0.03845450282096863,
0.011379002593457699,
0.03945232555270195,
-0.06021468713879585,
0.03828180581331253,
0.05560935661196709,
-0.017711330205202103,
0.020071562379598618,
-0.01591717079281807,
0.011590080335736275,
-0.029474111273884773,
0.01100481953471899,
0.005190590396523476,
0.009138701483607292,
0.06013793125748634,
-0.011906696483492851,
0.024177981540560722,
0.02630794607102871,
0.03632453829050064,
0.044441431760787964,
-0.0411025695502758,
0.04263767972588539,
0.010198886506259441,
-0.003137381048873067,
0.020167507231235504,
0.004396650940179825,
0.04045014828443527,
0.06052171066403389,
0.014871377497911453,
0.008663776330649853,
0.03285135328769684,
-0.017816869542002678,
-0.050466738641262054,
0.003161367028951645,
-0.09249037504196167,
-0.015888387337327003,
-0.010544286109507084,
-0.014305305667221546,
-0.03799397125840187,
0.049814317375421524,
-0.0039049359038472176,
-0.025310125201940536,
0.022585304453969002,
0.017922408878803253,
-0.015792444348335266,
0.03617102652788162,
0.06846590340137482,
-0.022374227643013,
-0.035844817757606506,
-0.0010272044455632567,
-0.040565282106399536,
-0.012866140343248844,
-0.006231586914509535,
0.007205422502011061,
0.019025769084692,
0.013249917887151241,
-0.03998961299657822,
0.008841273374855518,
0.016838237643241882,
0.0009732356993481517,
0.031220298260450363,
0.05073538422584534,
-0.002911911578848958,
-0.07326312363147736,
-0.01664634793996811,
-0.018555641174316406,
0.00009496993880020455,
-0.023563938215374947,
-0.03455916419625282,
-0.014123011380434036,
0.003895341418683529,
0.011887507513165474,
-0.0286873672157526,
0.019515085965394974,
-0.01735633611679077,
-0.041524723172187805,
0.029339788481593132,
-0.024312304332852364,
-0.01293330080807209,
0.044134411960840225,
-0.03146975487470627,
0.004881170112639666,
0.04555438831448555,
0.04409603402018547,
0.01933279074728489,
-0.005890984553843737,
0.02406284771859646,
-0.036573994904756546,
-0.007747508119791746,
-0.08658020198345184,
0.005344101693481207,
0.06098224222660065,
-0.014880971983075142,
-0.03235244378447533,
0.04897000640630722,
0.026614967733621597,
0.036075085401535034,
0.050543494522571564,
-0.03853125870227814,
-0.0061212508007884026,
-0.024177981540560722,
0.07717765122652054,
-0.08911313116550446,
-0.022143961861729622,
0.007454877719283104,
0.04789543151855469,
-0.0366123728454113,
0.07422256469726562,
-0.012069801799952984,
-0.008994785137474537,
-0.05434289202094078,
0.04083392396569252,
-0.0388190932571888,
0.05361371487379074,
-0.037015337496995926,
-0.03812829405069351,
-0.023352859541773796,
-0.004082432948052883,
-0.04858623072504997,
0.029224654659628868,
-0.019217656925320625,
-0.04816407337784767,
0.029704377055168152,
0.01794159784913063,
-0.0025641133543103933,
0.0038617609534412622,
0.03611345961689949,
-0.03300486505031586,
0.03908773511648178,
-0.019802918657660484,
-0.03887666016817093,
-0.02012912929058075,
0.03350377455353737,
0.015408665873110294,
0.004926743451505899,
0.003648284822702408,
-0.07272583246231079,
0.07199665904045105,
0.020877495408058167,
0.010400369763374329,
-0.017778491601347923,
-0.02245098352432251,
-0.011897101998329163,
-0.06052171066403389,
0.03649723902344704,
-0.016550404950976372,
-0.04524736478924751,
-0.04578465223312378,
-0.002115573501214385,
0.060636844485998154,
0.0520402267575264,
0.06278599798679352,
0.0561082698404789,
-0.004387056455016136,
-0.0327170304954052,
0.045439254492521286,
0.05280778184533119,
0.05157969519495964,
-0.018056729808449745,
0.10216156393289566,
0.013288295827805996,
0.004063243977725506,
-0.032736219465732574,
-0.03480861708521843,
0.003856963710859418,
-0.005771053954958916,
-0.03918367996811867,
-0.006749686319380999,
-0.07149774581193924,
0.017960786819458008,
0.01010294258594513,
0.034041061997413635,
-0.0027655966114252806,
-0.0009024767205119133,
0.011158330366015434,
-0.004077635705471039,
0.0700010135769844,
-0.0013156371423974633,
0.0016586383571848273,
0.03749506175518036,
-0.0254252590239048,
-0.0043918536975979805,
0.03975934907793999,
0.03102841041982174,
-0.05062025040388107,
-0.04781867563724518,
-0.07698576152324677,
0.030836520716547966,
-0.0700010135769844,
-0.059754155576229095,
-0.0022774795070290565,
0.011407786048948765,
0.0315273217856884,
-0.019668595865368843,
-0.06282437592744827,
-0.03603670746088028,
-0.03812829405069351,
0.006999142002314329,
0.0488164946436882,
0.011973857879638672,
0.042752813547849655,
0.03210298717021942,
-0.02041696198284626,
0.03849288076162338,
-0.01882428489625454,
0.05488017946481705,
0.0549185574054718,
0.042752813547849655,
-0.02106938324868679,
0.04236903414130211,
0.04375063255429268,
0.0024249940179288387,
-0.05603151395916939,
-0.008994785137474537,
0.016233786940574646,
-0.008121690712869167,
-0.0007045914535410702,
0.004626917187124491,
-0.011167924851179123,
0.019131308421492577,
-0.014554761350154877,
-0.02404365874826908,
-0.004893162753432989,
-0.016377704218029976,
-0.014948133379220963,
0.01264546811580658,
-0.03350377455353737,
0.049660805612802505,
-0.021491538733243942,
0.056492045521736145,
0.06554919481277466,
-0.016819048672914505,
-0.009546465240418911,
0.04133283346891403,
-0.027190634980797768,
-0.0130100566893816,
0.014468410983681679,
-0.02151072770357132,
0.00871654599905014,
0.04728138446807861,
-0.04524736478924751,
-0.06608648598194122,
0.04252254590392113,
-0.00806412473320961,
-0.012760601006448269,
-0.0015303127001971006,
-0.02753603458404541,
-0.00894201546907425,
0.027574412524700165,
0.03198785334825516,
-0.01518799364566803,
-0.026826046407222748,
-0.01583082042634487,
-0.0902644619345665,
0.039279624819755554,
-0.02325691655278206,
-0.003029443556442857,
0.07326312363147736,
-0.005564773455262184,
-0.032294876873493195,
0.002492154948413372,
-0.03379160910844803,
-0.07184314727783203,
0.013892744667828083,
-0.007901019416749477,
-0.021779371425509453,
0.030491121113300323,
-0.00562713760882616,
-0.039279624819755554,
0.0056319343857467175,
-0.005607948638498783,
0.002267885021865368,
-0.048202451318502426,
0.03960583731532097,
0.015034482814371586,
-0.0260201133787632,
-0.04793380945920944,
0.08343322575092316,
0.007565213833004236,
-0.05488017946481705,
0.050159718841314316,
-0.021625861525535583,
0.02005237340927124,
-0.03406025096774101,
0.0008479083771817386,
-0.038396935909986496,
0.018641991540789604,
-0.0054016681388020515,
-0.005785445682704449,
-0.009575248695909977,
0.02020588517189026,
-0.02849547751247883,
-0.01336505077779293,
0.030606254935264587,
-0.0360175184905529,
0.029512489214539528,
0.046897608786821365,
0.00555997621268034,
0.05699095502495766,
-0.005468829069286585,
0.01398868951946497,
0.05319156125187874,
-0.09778650104999542,
0.003672270802780986,
0.03150813281536102,
0.037379927933216095,
0.013710450381040573,
-0.04367387667298317,
-0.0902644619345665,
0.025847414508461952,
-0.012741412967443466,
-0.0030222476925700903,
-0.020148318260908127,
-0.08067002892494202,
-0.03642048314213753,
-0.0014295711880549788,
-0.028092512860894203,
-0.010496314615011215,
0.034252140671014786,
-0.002362630097195506,
-0.013297890312969685,
0.020282641053199768,
0.0325443297624588,
0.05864119902253151,
0.001181315048597753,
-0.10431072115898132,
0.00017195030522998422,
0.03436727449297905,
-0.032582707703113556,
-0.009771933779120445,
-0.05392073839902878,
0.07410743087530136,
0.030395176261663437,
0.03693858161568642,
0.038339368999004364,
-0.0386463925242424,
-0.08734775334596634,
-0.012664657086133957,
-0.06620161980390549,
0.021817749366164207,
0.027440089732408524,
0.002127566374838352,
0.02406284771859646,
-0.013604911975562572,
-0.01853645220398903,
-0.035192396491765976,
-0.03749506175518036,
0.052922915667295456,
0.016540810465812683,
0.025828225538134575,
-0.029512489214539528,
0.03427132964134216,
0.03501969575881958,
-0.025981735438108444,
-0.02354474924504757,
0.021184517070651054,
0.08258891850709915,
-0.023276103660464287,
0.0031829546205699444,
0.03246757388114929,
-0.033100809901952744,
-0.022355038672685623,
-0.013432212173938751,
0.00713826110586524,
0.02694118022918701,
0.030721386894583702,
-0.022143961861729622,
-0.018872257322072983,
-0.0033676475286483765,
-0.008001760579645634,
0.039337191730737686,
0.006677728146314621,
0.04505547508597374,
0.023794203996658325,
-0.030721386894583702,
-0.06911832839250565,
-0.016396893188357353,
-0.0019188874866813421,
0.010064564645290375,
0.01721242070198059,
0.020474528893828392,
-0.0016826244536787271,
-0.051848337054252625,
-0.0003032741660717875,
-0.02442743629217148,
0.007296569645404816,
0.06363030523061752,
-0.010601853020489216,
0.020301828160881996,
-0.07360852509737015,
0.010237264446914196,
-0.03311999887228012,
0.04083392396569252,
0.02529093623161316,
0.036305349320173264,
-0.0018925027688965201,
0.00041915697511285543,
0.0026048896834254265,
0.07829060405492783,
0.013940717093646526,
-0.03298567607998848,
0.032218120992183685,
0.05948550999164581,
0.02498391456902027,
-0.03530753031373024,
0.03423295170068741,
0.018977796658873558,
-0.0577201321721077,
-0.036286160349845886,
0.01173399668186903,
0.034616727381944656,
-0.0004407444503158331,
-0.033024054020643234,
-0.023448804393410683,
-0.011897101998329163,
-0.029186278581619263,
0.014007878489792347,
-0.03300486505031586,
-0.0662783682346344,
0.029474111273884773,
-0.007891424931585789,
-0.00401527201756835,
0.01795119233429432,
-0.015283938497304916,
0.016147438436746597,
-0.02855304442346096,
0.0061500342562794685,
-0.02012912929058075,
0.05484180152416229,
-0.06470488756895065,
0.0018877055263146758,
0.026979558169841766,
-0.024523381143808365,
-0.009119512513279915,
0.03371485322713852,
-0.025463636964559555,
-0.02245098352432251,
-0.0878082886338234,
0.03666993975639343,
-0.04804893955588341,
0.04463332146406174,
-0.011014414019882679,
-0.0003861761069856584,
0.03219893202185631,
0.0016766279004514217,
-0.026864424347877502,
0.06681565940380096,
0.07556578516960144,
0.027631979435682297,
-0.03177677467465401,
-0.03895341604948044,
-0.024580948054790497,
0.032793786376714706,
0.008951609954237938,
0.018152674660086632,
-0.02943573333323002,
0.06792861223220825,
0.01125427521765232,
-0.08872935175895691,
-0.08228189498186111,
0.049085140228271484,
-0.013710450381040573,
-0.03686182573437691,
-0.040949057787656784,
-0.06090548634529114,
0.01336505077779293,
0.021664239466190338,
-0.05864119902253151,
0.00952247902750969,
-0.03239081799983978,
0.03123948723077774,
-0.03793640434741974,
0.01525515504181385,
-0.0321221761405468,
-0.03728398308157921,
-0.015667716041207314,
0.01859401911497116,
-0.0127126295119524,
-0.03538428246974945,
0.037955593317747116,
-0.016320137307047844,
-0.06374543905258179,
0.0079873688519001,
-0.02333367057144642,
-0.03150813281536102,
-0.0027703936211764812,
0.04398090019822121,
-0.020877495408058167,
-0.08834557980298996,
-0.021740995347499847,
-0.09463952481746674,
-0.027919812127947807,
-0.013019651174545288,
0.007397310808300972,
-0.014209361746907234,
0.012559118680655956,
0.0443262979388237,
-0.0047012739814817905,
-0.002576106460765004,
0.019121713936328888,
0.010966441594064236,
0.027862245216965675,
0.02231666073203087,
0.02245098352432251,
0.021011818200349808,
0.0020688006188720465,
0.04977593943476677,
0.01715485379099846,
-0.05595475807785988,
-0.01064023096114397,
-0.02732495777308941,
-0.04171661287546158,
0.044786833226680756,
0.003988887183368206,
0.013460995629429817,
0.029589243233203888,
-0.0008137281984090805,
0.04179336875677109,
-0.009632814675569534,
0.014631516300141811,
0.0360175184905529,
-0.06858103722333908,
0.017624981701374054,
0.047051120549440384,
-0.0011135543463751674,
0.02078155055642128,
0.014996104873716831,
-0.04140958935022354,
-0.013787206262350082,
0.089496910572052,
-0.031719207763671875,
0.004564553499221802,
0.018622802570462227,
-0.039126113057136536,
0.03548022732138634,
0.042983077466487885,
0.019668595865368843,
-0.03874233737587929,
-0.030625443905591965,
0.056338533759117126,
-0.0044830008409917355,
0.02018669620156288,
0.02091587334871292,
0.03315837308764458,
0.04455656558275223,
0.023890148848295212,
0.0504283607006073,
-0.023410426452755928,
-0.018210241571068764,
0.012156152166426182,
-0.027708735316991806,
-0.00810250174254179,
0.03298567607998848,
0.024945536628365517,
0.011791563592851162,
0.020436150953173637,
-0.008068921975791454,
-0.004144796635955572,
-0.022220715880393982,
-0.014986510388553143,
0.0254252590239048,
0.01693418063223362,
0.03269784152507782,
0.04613005369901657,
-0.04440305382013321,
-0.004238342400640249,
-0.004984309896826744,
0.0029742754995822906,
-0.008471887558698654,
0.010189292021095753,
0.016751887276768684,
-0.0048355963081121445,
-0.004471007734537125,
0.007181436289101839,
-0.021165328100323677,
0.01093765813857317,
-0.05196347087621689,
-0.05864119902253151,
0.002556917490437627,
0.02179856039583683,
-0.024945536628365517,
0.011897101998329163,
0.02156829461455345,
-0.0022498955950140953,
0.09939836710691452,
-0.012674251571297646,
-0.022719627246260643,
-0.008347160182893276,
-0.030721386894583702,
0.05775851011276245,
-0.07690900564193726,
0.009939837269484997,
-0.05361371487379074,
0.056415289640426636,
-0.022393416613340378,
0.029013577848672867,
-0.03691939264535904,
-0.01701093651354313,
-0.028821690008044243,
-0.005281737539917231,
0.07725440710783005,
0.06719943881034851,
-0.04758840799331665,
0.0540742464363575,
-0.005962942726910114,
-0.024676892906427383,
-0.0205512847751379,
0.07844411581754684,
-0.038972605019807816,
0.000656019663438201,
-0.026116058230400085,
-0.000024473310986650176,
0.052577514201402664,
0.0205512847751379,
0.049161896109580994,
0.015485421754419804,
0.008443105034530163,
-0.08857584744691849,
-0.039490703493356705,
0.017989570274949074,
0.0031973461154848337,
0.023448804393410683,
-0.005886187311261892,
0.06167304143309593,
-0.015821225941181183,
-0.013585723005235195,
0.024177981540560722,
0.02667253464460373,
0.047051120549440384,
0.005919767543673515,
-0.012424795888364315,
-0.009882270358502865,
-0.03580643981695175,
-0.030778953805565834,
0.03866558149456978,
0.02813088893890381,
-0.0054304515942931175,
0.014046256430447102,
-0.037955593317747116,
0.005890984553843737,
0.0045309728011488914,
0.002729617292061448,
0.02012912929058075,
0.04766516387462616,
0.042023636400699615,
0.0018996985163539648,
0.03480861708521843,
0.004845190793275833,
0.08650344610214233
]
|
36,376 | statistics | mean | Return the sample arithmetic mean of data.
>>> mean([1, 2, 3, 4, 4])
2.8
>>> from fractions import Fraction as F
>>> mean([F(3, 7), F(1, 21), F(5, 3), F(1, 3)])
Fraction(13, 21)
>>> from decimal import Decimal as D
>>> mean([D("0.5"), D("0.75"), D("0.625"), D("0.375")])
Decimal('0.5625')
If ``data`` is empty, StatisticsError will be raised.
| def mean(data):
"""Return the sample arithmetic mean of data.
>>> mean([1, 2, 3, 4, 4])
2.8
>>> from fractions import Fraction as F
>>> mean([F(3, 7), F(1, 21), F(5, 3), F(1, 3)])
Fraction(13, 21)
>>> from decimal import Decimal as D
>>> mean([D("0.5"), D("0.75"), D("0.625"), D("0.375")])
Decimal('0.5625')
If ``data`` is empty, StatisticsError will be raised.
"""
if iter(data) is data:
data = list(data)
n = len(data)
if n < 1:
raise StatisticsError('mean requires at least one data point')
T, total, count = _sum(data)
assert count == n
return _convert(total / n, T)
| (data) | [
-0.030830172821879387,
-0.026256069540977478,
0.058058690279722214,
0.013839362189173698,
0.12677828967571259,
0.02551773190498352,
0.030073825269937515,
-0.01632450520992279,
0.03072212263941765,
0.07012423872947693,
0.0005028248997405171,
-0.008675488643348217,
-0.01329911407083273,
-0.03288311883807182,
-0.040770743042230606,
0.02420312725007534,
-0.03671887889504433,
0.039077963680028915,
-0.04285970330238342,
-0.015361061319708824,
-0.027192501351237297,
0.007932647131383419,
-0.03237888589501381,
-0.024365201592445374,
-0.014460647478699684,
0.042607586830854416,
0.01139023620635271,
-0.028597146272659302,
-0.018071306869387627,
-0.011966501362621784,
0.022042132914066315,
-0.029767684638500214,
-0.025157565250992775,
-0.012821894139051437,
0.051683761179447174,
-0.02593192085623741,
-0.02097964473068714,
-0.005456508602946997,
-0.08276604861021042,
-0.04462451487779617,
0.0013191064354032278,
-0.04592110961675644,
-0.04873040318489075,
0.0755627378821373,
0.023608854040503502,
0.04401223361492157,
0.0677831619977951,
0.07721950113773346,
-0.042607586830854416,
-0.0279848650097847,
-0.035350251942873,
0.03572842478752136,
-0.05395280197262764,
0.01525301206856966,
-0.015937326475977898,
0.06918780505657196,
-0.010985050350427628,
-0.06220059469342232,
-0.020007196813821793,
0.027372583746910095,
0.06486582010984421,
0.01714388094842434,
0.04484061524271965,
-0.055177364498376846,
-0.017657117918133736,
0.0008812801679596305,
-0.02614802122116089,
0.039834313094615936,
-0.04105887562036514,
-0.02033134736120701,
-0.04221140593290329,
0.02728254161775112,
0.020385371521115303,
0.004067619796842337,
0.04192327335476875,
0.0691157728433609,
0.062452711164951324,
0.03230685368180275,
0.03976228088140488,
0.04401223361492157,
0.02157391794025898,
-0.03254095837473869,
0.0162434671074152,
0.007991173304617405,
-0.041635140776634216,
0.00222289701923728,
-0.053448572754859924,
0.016405541449785233,
-0.04588509351015091,
-0.001783945132046938,
0.02618403732776642,
0.01627948321402073,
0.026328103616833687,
0.00497028511017561,
-0.06515394896268845,
-0.011246169917285442,
-0.07426614314317703,
-0.023122629150748253,
0.024743374437093735,
0.0026899867225438356,
-0.011138120666146278,
0.0736178457736969,
0.055393464863300323,
-0.013389155268669128,
0.00029995039221830666,
-0.026256069540977478,
0.036196641623973846,
-0.01210156362503767,
0.008256795816123486,
0.09962179511785507,
-0.05229604244232178,
-0.0581667385995388,
0.025427689775824547,
-0.017125872895121574,
-0.030794156715273857,
-0.018440477550029755,
0.011543306522071362,
0.0819016546010971,
-0.05143164470791817,
0.017305955290794373,
0.005632088985294104,
0.06551411747932434,
-0.03027191571891308,
0.03961821272969246,
0.031946685165166855,
-0.010534843429923058,
0.05939130485057831,
-0.08017285913228989,
-0.06277685612440109,
0.015658197924494743,
0.0491626001894474,
0.0485503189265728,
0.03670087084174156,
-0.011372228153049946,
0.0021835037041455507,
0.03230685368180275,
0.02070952020585537,
-0.023500803858041763,
0.04188725724816322,
-0.05193587765097618,
0.048010069876909256,
-0.03444983810186386,
0.025913912802934647,
0.04203132167458534,
0.02618403732776642,
-0.012263637967407703,
0.025355655699968338,
-0.018440477550029755,
0.007108767982572317,
0.020025206729769707,
-0.026093995198607445,
0.016576619818806648,
0.07376191020011902,
-0.03493605926632881,
0.041851241141557693,
0.005983250681310892,
0.0030456501990556717,
-0.09580404311418533,
-0.09191425144672394,
-0.0838465467095375,
-0.011012062430381775,
0.03576444089412689,
0.006843145936727524,
0.03214477747678757,
-0.00947235431522131,
0.009454346261918545,
-0.10423191636800766,
0.0192868672311306,
-0.04231945425271988,
-0.08600754290819168,
0.03914999961853027,
-0.012911936268210411,
0.03383755683898926,
0.044336382299661636,
0.019989188760519028,
-0.02198810875415802,
-0.04458849877119064,
0.026778310537338257,
-0.003421572968363762,
-0.012425712309777737,
0.05813072249293327,
0.003122185356914997,
-0.023140639066696167,
-0.0274986419826746,
-0.04228343814611435,
-0.06274084001779556,
0.016216455027461052,
-0.005456508602946997,
-0.02251034788787365,
0.006703581660985947,
-0.014415627345442772,
-0.057950641959905624,
-0.008887085132300854,
0.01480280514806509,
0.008576442487537861,
-0.02603997103869915,
-0.021826034411787987,
-0.00437150988727808,
0.05564558133482933,
-0.006244370713829994,
-0.04685753956437111,
-0.012974964454770088,
0.05838283896446228,
-0.010714925825595856,
0.030217891559004784,
-0.025193581357598305,
-0.049018535763025284,
0.017134876921772957,
-0.03421572968363762,
-0.00436250539496541,
0.006289391312748194,
0.006595531944185495,
-0.027588682249188423,
0.04764990508556366,
0.01804429478943348,
0.030632082372903824,
0.09529981017112732,
-0.10192685574293137,
0.0033607950899749994,
0.03943813219666481,
-0.011174136772751808,
-0.02371690236032009,
0.03680892288684845,
0.04105887562036514,
0.015937326475977898,
-0.0055420477874577045,
0.012974964454770088,
0.016297493129968643,
0.0008548304904252291,
0.022492339834570885,
0.03092021495103836,
-0.0318206287920475,
-0.003761479165405035,
-0.006329909898340702,
-0.020799562335014343,
-0.012695836834609509,
0.0205654539167881,
-0.033333323895931244,
0.012254633940756321,
0.0029803700745105743,
-0.04019447788596153,
-0.01827840320765972,
-0.004157661460340023,
-0.01665765792131424,
-0.0536646693944931,
-0.04476857930421829,
-0.05917520448565483,
0.024779392406344414,
-0.01883666031062603,
0.02600395493209362,
-0.03598054125905037,
0.05319645628333092,
0.04325588420033455,
-0.028687188401818275,
0.0120475385338068,
0.03493605926632881,
0.03940211236476898,
0.05467313528060913,
0.027696732431650162,
0.015352057293057442,
0.009976586326956749,
-0.012326667085289955,
0.04120294004678726,
0.03522419184446335,
-0.039005931466817856,
0.0025819370057433844,
-0.0024941465817391872,
-0.023554828017950058,
0.04768592119216919,
0.06274084001779556,
0.044444430619478226,
0.03770933672785759,
0.0626688078045845,
-0.0585269071161747,
0.025535739958286285,
-0.00222289701923728,
0.09457948058843613,
0.009805507957935333,
0.018476493656635284,
-0.007802086882293224,
-0.0008334456360898912,
-0.0016083644004538655,
-0.04332792013883591,
0.01583828032016754,
-0.024779392406344414,
0.013146043755114079,
-0.00797316525131464,
-0.04303978756070137,
0.02739059180021286,
0.029767684638500214,
0.06767511367797852,
-0.021735992282629013,
-0.06356922537088394,
-0.03189266100525856,
-0.03661083057522774,
0.010958037339150906,
-0.030073825269937515,
-0.004344497341662645,
0.004227443598210812,
0.018710602074861526,
0.019502965733408928,
0.018143340945243835,
0.04602916166186333,
0.017585083842277527,
-0.019088774919509888,
-0.004736177157610655,
0.032811082899570465,
0.008220779709517956,
-0.04692957550287247,
-0.0037232115864753723,
0.006491984706372023,
-0.014127494767308235,
-0.013290110044181347,
-0.006730594206601381,
0.031730588525533676,
0.005636591464281082,
0.03129838779568672,
-0.00741941062733531,
0.027192501351237297,
-0.02555374801158905,
-0.0024648832622915506,
0.012443720363080502,
0.07772373408079147,
0.003982080612331629,
0.040698710829019547,
0.044408414512872696,
-0.015703219920396805,
0.0385737344622612,
0.0007991173770278692,
-0.03057805821299553,
-0.048982519656419754,
-0.07462630420923233,
-0.0391860157251358,
0.04105887562036514,
-0.050711311399936676,
-0.02416710928082466,
0.011210153810679913,
0.012164592742919922,
-0.01455969363451004,
-0.0023455782793462276,
-0.03961821272969246,
0.04642534255981445,
0.05942732095718384,
0.049810897558927536,
-0.04862235113978386,
-0.0334593802690506,
0.0205654539167881,
-0.026688268408179283,
0.02070952020585537,
0.030758140608668327,
-0.015262016095221043,
-0.0043917689472436905,
0.02510354109108448,
-0.046281278133392334,
0.050783347338438034,
-0.02097964473068714,
0.0178552083671093,
-0.020403379574418068,
-0.02960561029613018,
-0.01513595785945654,
0.06457769125699997,
0.035170167684555054,
0.0677831619977951,
-0.014946871437132359,
-0.006744100246578455,
0.03650278225541115,
-0.007203311659395695,
0.002662974176928401,
-0.053448572754859924,
0.032360877841711044,
-0.00358814955689013,
-0.04386816546320915,
-0.06688274443149567,
-0.028110923245549202,
0.04469654709100723,
0.012308658100664616,
0.050783347338438034,
-0.0274986419826746,
-0.01973707415163517,
0.0061273169703781605,
0.00027012417558580637,
-0.022258233278989792,
0.00268773571588099,
0.016720686107873917,
0.018251391127705574,
0.013533221557736397,
-0.030451999977231026,
-0.013065006583929062,
-0.06036375090479851,
0.02393300272524357,
-0.01684674434363842,
-0.024851424619555473,
-0.021447859704494476,
-0.04199530556797981,
-0.09141002595424652,
0.007797584868967533,
0.034197721630334854,
-0.06763909757137299,
-0.05586168169975281,
0.028561130166053772,
0.013686291873455048,
-0.007446423172950745,
-0.0031244363635778427,
-0.02967764250934124,
-0.03781738504767418,
-0.028543122112751007,
-0.07340174168348312,
-0.09061765670776367,
-0.008603455498814583,
0.006582025904208422,
0.016117408871650696,
0.04566899314522743,
0.04484061524271965,
0.1037997156381607,
0.055393464863300323,
0.03951016440987587,
-0.05326848849654198,
-0.05294433981180191,
-0.09378711879253387,
0.0028543120715767145,
0.015207991003990173,
-0.06342516094446182,
-0.017395997419953346,
0.0585269071161747,
0.05496126785874367,
-0.053520604968070984,
0.00934629701077938,
-0.06000358611345291,
-0.016378529369831085,
-0.014208531938493252,
0.00009988967212848365,
-0.01521699596196413,
-0.0691157728433609,
-0.00005117586988490075,
0.021970100700855255,
-0.012632807716727257,
-0.03200071305036545,
0.002034935401752591,
-0.008954616263508797,
-0.03969024494290352,
0.008139741607010365,
0.04383214935660362,
0.03969024494290352,
0.017540063709020615,
-0.025751838460564613,
-0.04221140593290329,
-0.010318743996322155,
0.0011626594932749867,
0.018431473523378372,
-0.027858806774020195,
-0.03695298731327057,
-0.06346117705106735,
0.02888527885079384,
0.01123716589063406,
0.03099224716424942,
0.00551503524184227,
-0.012371687218546867,
0.007450925186276436,
0.02499549090862274,
0.026670260354876518,
-0.0027327563147991896,
0.017206910997629166,
-0.0055600558407604694,
-0.03677290678024292,
0.009373309090733528,
-0.009517375379800797,
0.035404276102781296,
0.016909774392843246,
0.031208347529172897,
0.028236981481313705,
0.04199530556797981,
0.014253553003072739,
-0.004434538539499044,
0.002327569993212819,
0.00943633820861578,
0.04293173551559448,
-0.004310731776058674,
0.013587246648967266,
0.03695298731327057,
0.013119030743837357,
0.01605438068509102,
0.0010450428817421198,
0.02341076172888279,
0.02513955719769001,
-0.013434176333248615,
0.049738865345716476,
-0.0065640173852443695,
0.002825048752129078,
0.08197368681430817,
-0.041707172989845276,
0.03196469321846962,
0.03749323636293411,
0.018854668363928795,
-0.039041947573423386,
-0.056978192180395126,
-0.0360165573656559,
0.03288311883807182,
0.03012784942984581,
0.02499549090862274,
0.009328288026154041,
0.058779023587703705,
-0.0318206287920475,
-0.012722848914563656,
-0.04480459913611412,
-0.001317980932071805,
0.04743380472064018,
-0.022834496572613716,
0.020421387627720833,
-0.009103184565901756,
0.010741937905550003,
-0.03320726752281189,
0.06807129085063934,
0.01617143489420414,
0.024707358330488205,
0.05460109934210777,
-0.026580220088362694,
0.023014580830931664,
0.016198446974158287,
-0.01438861433416605,
-0.026328103616833687,
0.009499367326498032,
-0.01234467513859272,
-0.08716006577014923,
0.06180441379547119,
-0.009787499904632568,
-0.0031829632353037596,
-0.05143164470791817,
-0.013632266782224178,
-0.02191607467830181,
0.036196641623973846,
-0.021033668890595436,
0.028489096090197563,
0.003937060013413429,
-0.011975505389273167,
-0.05496126785874367,
0.01210156362503767,
0.027858806774020195,
-0.058995120227336884,
0.025157565250992775,
0.05316044017672539,
0.00045724146184511483,
-0.026760302484035492,
0.0466054268181324,
0.01582927629351616,
0.06277685612440109,
0.001532954745925963,
-0.030560048297047615,
-0.017567075788974762,
0.0034598405472934246,
-0.021033668890595436,
0.08118131756782532,
-0.06130018085241318,
-0.015577160753309727,
0.05391678586602211,
-0.013623262755572796,
-0.03300917521119118,
-0.009148205630481243,
0.015027908608317375,
-0.024023042991757393,
-0.04127497598528862,
-0.03209075331687927,
-0.06410947442054749,
0.006699079647660255,
0.01480280514806509,
0.006649557035416365,
0.004490814637392759,
-0.020313339307904243,
-0.048046085983514786,
-0.036340706050395966,
-0.015694214031100273,
-0.03410768136382103,
0.03608858957886696,
0.04339995235204697,
-0.025949928909540176,
0.0020687009673565626,
0.019340891391038895,
-0.0031469466630369425,
-0.05935528501868248,
-0.028146939352154732,
-0.03459390252828598,
-0.04336393624544144,
-0.05132359266281128,
-0.02649017795920372,
-0.008072211407124996,
0.006154329050332308,
0.04066269472241402,
-0.07765169441699982,
0.0016803975449874997,
-0.029515568166971207,
0.03527821972966194,
-0.031244363635778427,
-0.05204392597079277,
-0.015379070304334164,
0.016000356525182724,
0.020439395681023598,
0.005415990017354488,
0.018026286736130714,
-0.05395280197262764,
-0.0024873935617506504,
0.019196825101971626,
0.00008265518408734351,
0.053340520709753036,
-0.00045639730524271727,
0.029029345139861107,
0.028489096090197563,
0.04285970330238342,
-0.025319639593362808,
-0.01781919226050377,
-0.005924723576754332,
-0.04048261046409607,
0.006654059048742056,
0.038177549839019775,
-0.05481719970703125,
0.01283089816570282,
0.006329909898340702,
0.011417248286306858,
-0.01681072823703289,
-0.03275705873966217,
0.02160993404686451,
0.06551411747932434,
0.032468926161527634,
-0.004785700235515833,
-0.01319106388837099,
0.0018368444871157408,
-0.003369799116626382,
-0.06706283241510391,
0.008851069025695324,
0.017720146104693413,
-0.0475778728723526,
-0.09047359228134155,
-0.013722307980060577,
0.019340891391038895,
-0.025355655699968338,
-0.029479552060365677,
-0.021754000335931778,
0.033675480633974075,
-0.0007811090908944607,
0.009958578273653984,
-0.03569240868091583,
0.015847286209464073,
0.05280027166008949,
-0.017720146104693413,
0.015379070304334164,
-0.031982701271772385,
0.06684672832489014,
0.02874121256172657,
-0.07765169441699982,
-0.0321807935833931,
0.02967764250934124,
0.016009360551834106,
-0.003840265329927206,
0.009904553182423115,
-0.005298935808241367,
0.04556094482541084,
0.048154138028621674,
0.06951195746660233,
0.011102103628218174,
-0.02326669543981552,
-0.013776333071291447,
0.008995135314762592,
-0.048910483717918396,
0.006361424457281828,
-0.03583647310733795,
0.058815039694309235,
0.016117408871650696,
0.0620565302670002,
-0.0710606649518013,
0.020871594548225403,
0.01168737281113863,
-0.003777236444875598,
-0.004486312624067068,
0.0819016546010971,
0.0024041051510721445,
0.025355655699968338,
0.03306319937109947,
0.006311901845037937,
0.019016742706298828,
-0.028417063876986504,
-0.03835763409733772,
0.004432287532836199,
-0.003552132984623313,
-0.043580032885074615,
0.06486582010984421,
-0.041671156883239746,
-0.023734912276268005,
0.01849450170993805,
0.008734014816582203,
-0.0025954432785511017,
0.02206014096736908,
-0.006262378767132759,
-0.028723204508423805,
-0.01075094286352396,
-0.0034530875273048878,
-0.02510354109108448,
-0.050675295293331146,
0.0242751594632864,
-0.04674949124455452,
0.0022938044276088476,
0.012236624956130981,
0.0017591837095096707,
0.024563292041420937,
0.028272997587919235,
0.007099763955920935,
0.009508371353149414,
0.026778310537338257,
-0.020421387627720833,
-0.04145505651831627,
0.00889158807694912,
0.008936608210206032,
0.009985590353608131,
0.0030118846334517,
0.01917881704866886,
-0.043471984565258026,
0.08427874743938446,
0.022168191149830818,
-0.01838645339012146,
0.04732575640082359,
-0.021213753148913383,
-0.02292453870177269,
0.039113979786634445,
-0.010408785194158554,
-0.015144962817430496,
0.03147847205400467,
0.030740132555365562,
-0.020475413650274277,
0.013110026717185974,
0.06533403694629669,
-0.026328103616833687,
-0.04282368719577789,
0.016837740316987038,
-0.006005760747939348,
-0.002998378360643983,
0.03621464967727661,
0.0036489274352788925,
0.04610119387507439,
0.0034080666955560446,
-0.02956959418952465,
-0.018332427367568016,
0.013461188413202763,
-0.007860613986849785,
0.019899148494005203,
-0.015784256160259247,
0.02029532939195633,
-0.01644155941903591,
-0.009220238775014877,
-0.10668104141950607,
0.04199530556797981,
0.008589948527514935,
0.009256254881620407,
0.028453079983592033,
-0.048154138028621674,
-0.02825498953461647,
-0.037133071571588516,
0.04761388897895813,
-0.0010202815756201744,
0.019268859177827835,
-0.030073825269937515,
-0.06346117705106735,
0.025391673669219017,
-0.004353501368314028,
-0.004799206275492907,
-0.05308840423822403,
0.05200790986418724,
-0.004875741433352232,
-0.05921122059226036,
0.0016229961765930057,
-0.0274986419826746,
-0.003725462593138218
]
|
36,377 | statistics | median | Return the median (middle value) of numeric data.
When the number of data points is odd, return the middle data point.
When the number of data points is even, the median is interpolated by
taking the average of the two middle values:
>>> median([1, 3, 5])
3
>>> median([1, 3, 5, 7])
4.0
| def median(data):
"""Return the median (middle value) of numeric data.
When the number of data points is odd, return the middle data point.
When the number of data points is even, the median is interpolated by
taking the average of the two middle values:
>>> median([1, 3, 5])
3
>>> median([1, 3, 5, 7])
4.0
"""
data = sorted(data)
n = len(data)
if n == 0:
raise StatisticsError("no median for empty data")
if n % 2 == 1:
return data[n // 2]
else:
i = n // 2
return (data[i - 1] + data[i]) / 2
| (data) | [
-0.033533938229084015,
0.03905615210533142,
0.026792310178279877,
0.020294565707445145,
0.06598782539367676,
0.010591498576104641,
0.045466795563697815,
0.0012401024578139186,
-0.02060812897980213,
0.06013462692499161,
0.004098108503967524,
0.04585003852844238,
-0.004309328738600016,
-0.03884710744023323,
0.003092090366408229,
0.027262656018137932,
0.021113315597176552,
0.07330431789159775,
-0.02343020588159561,
0.035711467266082764,
-0.03130415081977844,
-0.010173412971198559,
-0.05908941105008125,
-0.026740049943327904,
-0.04125110059976578,
0.026513585820794106,
0.017402807250618935,
-0.018988048657774925,
-0.0034905781503766775,
-0.0009080293821170926,
-0.01931903325021267,
-0.019005468115210533,
-0.009894689545035362,
0.010286644101142883,
0.05936813727021217,
0.015434321947395802,
0.03856838494539261,
-0.0145110497251153,
-0.07964528352022171,
0.01310001127421856,
-0.04173886403441429,
-0.04964764788746834,
-0.00796104408800602,
0.038080617785453796,
0.012019957415759563,
0.06982026994228363,
0.07999368757009506,
0.0006418264820240438,
-0.006506455130875111,
-0.004050203133374453,
-0.02012036368250847,
0.023186322301626205,
-0.012089638039469719,
0.02611292153596878,
0.007364401128143072,
0.03146092966198921,
0.04320216551423073,
-0.055744729936122894,
0.0025477083399891853,
0.013657458126544952,
0.05264392867684364,
-0.000480145012261346,
0.09978306293487549,
-0.005073641426861286,
-0.044526100158691406,
0.05752159282565117,
0.0038847108371555805,
0.01526882965117693,
-0.07630059868097305,
0.004213517531752586,
0.012211579829454422,
0.012664505280554295,
0.02895241789519787,
0.014746222645044327,
0.06243409588932991,
0.01280386745929718,
0.03264550492167473,
0.007229394279420376,
0.01505107618868351,
-0.010034050792455673,
0.04602424055337906,
0.013526806607842445,
0.020677810534834862,
0.031513191759586334,
-0.02590387873351574,
-0.031217047944664955,
-0.013953601941466331,
0.0006260394584387541,
-0.037871573120355606,
0.012647084891796112,
-0.02221078984439373,
-0.038150299340486526,
0.03919551149010658,
0.03053765930235386,
-0.05051866173744202,
0.03341199830174446,
-0.044177696108818054,
-0.02280307747423649,
-0.02228047139942646,
-0.0341959074139595,
0.03341199830174446,
0.05619765445590019,
0.04027556627988815,
-0.023534728214144707,
0.0002042793930741027,
-0.015974348410964012,
0.03045055828988552,
0.041773706674575806,
-0.07734581083059311,
0.0580441989004612,
-0.05766095221042633,
-0.03154803067445755,
-0.048811476677656174,
-0.0055047920905053616,
0.01762055978178978,
0.0015275361947715282,
0.02264629676938057,
0.04515323042869568,
-0.007216329220682383,
-0.015181728638708591,
-0.018064776435494423,
-0.017925413325428963,
-0.050100576132535934,
-0.026234863325953484,
0.0013609552988782525,
-0.04682557284832001,
0.1071692407131195,
-0.044526100158691406,
-0.08549847453832626,
0.02590387873351574,
0.007072612177580595,
0.021513981744647026,
-0.0036865556612610817,
-0.007434082217514515,
-0.0006265838164836168,
0.02728007733821869,
0.041704025119543076,
-0.016044029965996742,
0.025799356400966644,
-0.031879015266895294,
-0.0014230147935450077,
-0.012681925669312477,
-0.03466625139117241,
0.03351651877164841,
0.029718907549977303,
-0.017089243978261948,
0.020503608509898186,
-0.006589201278984547,
0.09825008362531662,
-0.005313169211149216,
-0.02691425196826458,
-0.012229000218212605,
0.09685646742582321,
-0.02379603125154972,
0.07379208505153656,
-0.023116642609238625,
0.024562520906329155,
-0.03499723598361015,
-0.1043820008635521,
0.01895320788025856,
0.006763403303921223,
0.0006924540502950549,
-0.005064931232482195,
-0.011000873520970345,
-0.026304543018341064,
0.0376276932656765,
-0.004598940256983042,
0.006114500109106302,
-0.030868643894791603,
-0.021740444004535675,
0.0005280506447888911,
-0.0012117945589125156,
-0.03335973620414734,
0.028011726215481758,
-0.012594824656844139,
-0.0027676387690007687,
-0.058775849640369415,
0.03160029277205467,
0.026792310178279877,
-0.022977279499173164,
-0.0376276932656765,
-0.0001659004483371973,
-0.002425766782835126,
-0.029492445290088654,
-0.053723983466625214,
-0.002878692699596286,
0.0454319529235363,
-0.012159318663179874,
0.023482466116547585,
-0.01585240662097931,
-0.03130415081977844,
-0.03457915037870407,
-0.028342710807919502,
0.0052086482755839825,
0.02060812897980213,
-0.03776705265045166,
0.015486582182347775,
0.054664675146341324,
0.0582880824804306,
-0.04912504181265831,
-0.04031040519475937,
-0.008148311637341976,
0.00830509327352047,
-0.006458549294620752,
0.03045055828988552,
0.03884710744023323,
-0.009676936082541943,
0.026217442005872726,
-0.03640827536582947,
0.05637185648083687,
-0.018761584535241127,
-0.0029853915330022573,
0.0032815353479236364,
0.056476376950740814,
0.027471698820590973,
0.011227336712181568,
0.023238584399223328,
-0.05783515423536301,
0.07400112599134445,
-0.0025411758106201887,
-0.027036193758249283,
-0.025381270796060562,
0.029492445290088654,
0.07407081127166748,
0.04877663776278496,
-0.0019891723059117794,
0.01778605207800865,
-0.021601082757115364,
0.03574630618095398,
-0.024179276078939438,
0.02604323998093605,
-0.024876084178686142,
-0.02510254830121994,
-0.02315148338675499,
0.022907599806785583,
-0.05490855872631073,
0.002510690363124013,
-0.07337399572134018,
-0.009825007990002632,
-0.011236046440899372,
-0.021827545017004013,
-0.03930003196001053,
-0.027314916253089905,
0.02633938379585743,
-0.049229562282562256,
-0.043097641319036484,
-0.04449126124382019,
0.021792704239487648,
0.019876480102539062,
0.012072217650711536,
-0.0626431405544281,
0.043132483959198,
0.022106269374489784,
-0.02957954630255699,
0.030363457277417183,
-0.000999485608190298,
0.01714150421321392,
0.048741795122623444,
0.0454319529235363,
-0.015538843348622322,
0.0392303541302681,
-0.09776231646537781,
0.03214031830430031,
0.01608758047223091,
0.0040175397880375385,
-0.0029549060855060816,
-0.007926203310489655,
-0.010365035384893417,
0.03414364531636238,
0.006153695285320282,
0.06187664717435837,
0.006985511165112257,
0.002656584605574608,
-0.09128199517726898,
0.04515323042869568,
0.009128198958933353,
0.04926440492272377,
-0.042296312749385834,
0.03240162506699562,
-0.003913018852472305,
-0.004977830220013857,
-0.048811476677656174,
-0.04490934684872627,
0.0205384474247694,
-0.0021971261594444513,
-0.010434716008603573,
0.049159880727529526,
-0.054838877171278,
0.06386255472898483,
0.05867132544517517,
-0.007468922529369593,
-0.018918367102742195,
-0.11699424684047699,
-0.018569963052868843,
-0.02851691283285618,
0.022332731634378433,
-0.039543915539979935,
-0.010948613286018372,
0.00017774075968191028,
-0.01505107618868351,
-0.026949092745780945,
-0.03471851348876953,
0.014119094237685204,
-0.0012803866993635893,
0.029056940227746964,
0.03738380968570709,
-0.008962706662714481,
-0.04320216551423073,
0.029056940227746964,
-0.032802287489175797,
-0.005073641426861286,
-0.007364401128143072,
-0.02510254830121994,
0.02806398645043373,
0.017524749040603638,
-0.04494418576359749,
-0.020521027967333794,
0.017995094880461693,
0.014406528323888779,
0.023604407906532288,
0.019057728350162506,
-0.049299243837594986,
0.003035474568605423,
-0.003233629744499922,
0.06330510973930359,
0.004577165003865957,
-0.06543037295341492,
0.020068101584911346,
0.008544621989130974,
0.01620081253349781,
-0.055082760751247406,
-0.057417068630456924,
0.004768787417560816,
0.05665057897567749,
0.012411911971867085,
-0.012978069484233856,
0.007421017158776522,
0.004098108503967524,
-0.011166365817189217,
0.011218626983463764,
-0.02025972492992878,
-0.08194474875926971,
0.05703382566571236,
0.038150299340486526,
0.01952807605266571,
0.009128198958933353,
0.05107610672712326,
-0.03738380968570709,
0.020068101584911346,
0.09009741991758347,
0.020642969757318497,
0.024910924956202507,
0.02764590084552765,
-0.011479930020868778,
0.03971811756491661,
0.005400270689278841,
0.02590387873351574,
-0.031164787709712982,
-0.022733397781848907,
0.01008631195873022,
0.0706564411520958,
0.039752960205078125,
-0.00362558476626873,
0.023134062066674232,
-0.015112047083675861,
0.013657458126544952,
-0.0686008557677269,
0.058775849640369415,
0.0006924540502950549,
0.03313327208161354,
0.00006539389869431034,
-0.05243488401174545,
-0.030798962339758873,
0.005709479562938213,
0.033324893563985825,
0.02583419717848301,
0.03821998089551926,
-0.0005574472597800195,
-0.02714071422815323,
-0.00922401063144207,
-0.07553410530090332,
0.00026348093524575233,
-0.02294244058430195,
0.024370897561311722,
-0.027750423178076744,
0.07142293453216553,
-0.04515323042869568,
-0.015199149027466774,
-0.05745191127061844,
-0.0137097192928195,
-0.07288623601198196,
-0.02532901056110859,
0.01414522435516119,
-0.016949880868196487,
-0.05100642517209053,
0.0686008557677269,
0.016209522262215614,
-0.0419827476143837,
-0.04396865516901016,
0.026583267375826836,
-0.015591103583574295,
-0.06414128094911575,
-0.008858186192810535,
0.021095896139740944,
-0.0063453176990151405,
-0.0525394082069397,
-0.04623328521847725,
-0.019231930375099182,
0.03322037309408188,
-0.003682200564071536,
0.024144435301423073,
-0.05532664433121681,
0.04233115166425705,
0.024423159658908844,
0.10556657612323761,
0.017263446003198624,
-0.008035079576075077,
0.020799752324819565,
-0.04731334000825882,
-0.01457202062010765,
0.024005074054002762,
-0.1011766791343689,
-0.012960649095475674,
0.007734580896794796,
-0.023395365104079247,
-0.06288702040910721,
-0.0054220459423959255,
-0.04783594608306885,
-0.03905615210533142,
0.002152486937120557,
0.014476208947598934,
0.013587777502834797,
-0.05072770267724991,
-0.04031040519475937,
0.007743291091173887,
0.04058913141489029,
-0.041425302624702454,
0.00574867520481348,
0.024910924956202507,
-0.04414285719394684,
0.0055526974610984325,
0.09002773463726044,
-0.022750817239284515,
-0.02191464602947235,
-0.01654050685465336,
-0.0016494777519255877,
0.026600686833262444,
0.006380158476531506,
0.010547948069870472,
-0.04355056956410408,
-0.020886853337287903,
-0.06375803053379059,
-0.007407951634377241,
-0.020730070769786835,
0.028447231277823448,
-0.075255386531353,
-0.021949486806988716,
-0.002695780247449875,
0.07149261236190796,
0.054142069071531296,
0.0017158924601972103,
0.04724365845322609,
-0.04884631931781769,
-0.06386255472898483,
0.019440973177552223,
0.03574630618095398,
0.022959860041737556,
0.0051694526337087154,
0.015390771441161633,
-0.02872595563530922,
0.06198117136955261,
0.034039124846458435,
-0.02930082194507122,
0.013648748397827148,
0.04118141904473305,
0.03438752889633179,
0.011131525039672852,
0.005535277538001537,
0.03710508346557617,
0.025067707523703575,
-0.012281260453164577,
-0.009206590242683887,
0.012028667144477367,
0.016070159152150154,
-0.04146014153957367,
0.02140945941209793,
-0.07041256129741669,
-0.03682636097073555,
0.08333837240934372,
-0.061179839074611664,
0.04442157968878746,
0.027942044660449028,
0.028046566992998123,
-0.007695385720580816,
-0.02872595563530922,
0.009520154446363449,
0.06006494536995888,
0.03227968141436577,
0.03609471023082733,
-0.022175949066877365,
0.05504791811108589,
-0.02574709616601467,
0.03294165059924126,
-0.07936655730009079,
-0.021513981744647026,
0.04212211072444916,
-0.031791914254426956,
-0.01103571429848671,
-0.043167322874069214,
-0.011558321304619312,
0.01601789891719818,
0.04389897361397743,
0.00013071975263301283,
0.037000562995672226,
0.018117036670446396,
-0.027071034535765648,
-0.029335662722587585,
0.034613993018865585,
-0.014789773151278496,
-0.022524354979395866,
-0.008997547440230846,
-0.05522212013602257,
-0.03538048267364502,
0.05240004509687424,
-0.013213242404162884,
-0.0016342351445928216,
-0.048358552157878876,
0.01741151697933674,
-0.038080617785453796,
0.03297648951411247,
-0.07476761937141418,
0.04212211072444916,
-0.009467893280088902,
0.011253466829657555,
-0.018709324300289154,
-0.0015721755335107446,
-0.0047905626706779,
-0.007939268834888935,
0.10793572664260864,
0.005247843451797962,
-0.00031982449581846595,
-0.047348178923130035,
0.018831266090273857,
-0.012917098589241505,
0.03595535084605217,
0.0137097192928195,
-0.05341041833162308,
0.037801895290613174,
0.005352364853024483,
-0.00564415380358696,
0.026670368388295174,
-0.028708534315228462,
0.03097316436469555,
-0.0454319529235363,
-0.0013370024971663952,
0.019789379090070724,
-0.011462509632110596,
-0.030485399067401886,
0.004929924383759499,
-0.00750811817124486,
-0.025381270796060562,
0.015173017978668213,
0.036861199885606766,
0.02625228278338909,
-0.011767364107072353,
-0.030346035957336426,
-0.017890574410557747,
-0.030920904129743576,
-0.04696493223309517,
-0.031652554869651794,
-0.005818355828523636,
0.06720723956823349,
0.03294165059924126,
0.021182997152209282,
0.015913378447294235,
0.017193764448165894,
0.042365994304418564,
-0.03513659909367561,
-0.013988442718982697,
-0.05706866458058357,
0.005051866173744202,
-0.02106105536222458,
0.01881384663283825,
-0.02388313226401806,
-0.05881068855524063,
0.010626338422298431,
-0.08117826282978058,
0.0011823979439213872,
-0.038150299340486526,
0.03727928549051285,
0.012890968471765518,
-0.04529259353876114,
-0.04686041176319122,
-0.014894294552505016,
0.012507723644375801,
0.006776468362659216,
-0.027698161080479622,
-0.012098347768187523,
0.02856917306780815,
0.0020555867813527584,
-0.03978779911994934,
0.003669135505333543,
-0.005047510843724012,
-0.007011641748249531,
0.04654684662818909,
0.03581598773598671,
-0.04139045998454094,
-0.03964843973517418,
-0.055535685271024704,
-0.058706168085336685,
-0.008609947748482227,
0.06692851334810257,
-0.02574709616601467,
0.004842823371291161,
0.029335662722587585,
0.04832370951771736,
0.018395761027932167,
-0.052051641047000885,
0.007782486733049154,
0.025154808536171913,
0.01741151697933674,
0.020137783139944077,
0.049508288502693176,
-0.022384991869330406,
0.012002537027001381,
-0.0805511325597763,
0.054594993591308594,
-0.044177696108818054,
0.007852167822420597,
-0.0713532492518425,
-0.03644311800599098,
0.011958986520767212,
0.013187112286686897,
-0.060517869889736176,
-0.041425302624702454,
0.0486372746527195,
0.007460212334990501,
-0.013143561780452728,
-0.004074155818670988,
0.0016777856508269906,
0.038533542305231094,
0.0018911834340542555,
0.005247843451797962,
0.006062239408493042,
0.0674511194229126,
-0.04306280240416527,
-0.004890728741884232,
0.05783515423536301,
-0.0027415084186941385,
0.017960254102945328,
-0.024039914831519127,
0.028830476105213165,
0.01775992289185524,
0.03348167613148689,
0.07260750979185104,
-0.04375961050391197,
0.028203347697854042,
-0.0011823979439213872,
-0.012934518977999687,
-0.02343020588159561,
0.013422285206615925,
-0.02388313226401806,
-0.04571067541837692,
0.016375014558434486,
0.07901815325021744,
0.04689525440335274,
-0.0690537840127945,
0.036059871315956116,
-0.005692059174180031,
-0.028203347697854042,
0.05243488401174545,
0.06396707892417908,
0.05811388045549393,
0.007843457162380219,
0.040693651884794235,
-0.019336452707648277,
0.035641785711050034,
-0.029196301475167274,
-0.09044582396745682,
0.05006573349237442,
0.02120041660964489,
-0.016618896275758743,
0.015913378447294235,
0.010652469471096992,
0.004834113176912069,
0.060587551444768906,
0.00765183474868536,
-0.03905615210533142,
-0.014746222645044327,
0.031077686697244644,
-0.006519520189613104,
-0.07048223912715912,
0.018099617213010788,
-0.024788983166217804,
-0.03902130946516991,
0.003919551149010658,
-0.050901904702186584,
0.0814569815993309,
0.03588566929101944,
-0.004104641266167164,
0.026391644030809402,
0.023203743621706963,
-0.008688338100910187,
-0.021966906264424324,
-0.019510654732584953,
-0.03940455615520477,
0.0031095105223357677,
0.009093359112739563,
0.047139134258031845,
-0.06358382850885391,
-0.02308180183172226,
0.002445364370942116,
-0.02647874504327774,
0.05271361023187637,
0.008488005958497524,
-0.01103571429848671,
-0.04480482637882233,
0.01952807605266571,
0.028917577117681503,
0.013892631977796555,
0.020677810534834862,
-0.04780110344290733,
0.050901904702186584,
0.04191306605935097,
-0.09218784421682358,
0.02012036368250847,
0.0182389784604311,
-0.013587777502834797,
-0.05229552462697029,
-0.04208726808428764,
-0.04992637410759926,
0.018779005855321884,
0.024440579116344452,
0.04407317563891411,
0.019737116992473602,
0.009023677557706833,
0.03031119517982006,
-0.007721515838056803,
0.03045055828988552,
0.017594430595636368,
-0.01721118576824665,
-0.001971751917153597,
0.02863885462284088,
-0.01601789891719818,
0.009720486588776112,
-0.02525933086872101,
0.01103571429848671,
-0.010852801613509655,
0.024858664721250534,
-0.00330113316886127,
0.004781852476298809,
-0.024998025968670845,
-0.02907435968518257,
0.00800894945859909,
-0.04072849079966545,
0.013779399916529655,
-0.029056940227746964,
-0.012455462478101254,
0.009354662150144577,
-0.022628875449299812,
-0.011767364107072353,
-0.0017496440559625626,
0.016766969114542007,
-0.008906091563403606,
-0.04553647339344025,
0.03835934028029442,
-0.028778215870261192,
-0.003823739942163229
]
|
36,378 | statistics | median_grouped | Return the 50th percentile (median) of grouped continuous data.
>>> median_grouped([1, 2, 2, 3, 4, 4, 4, 4, 4, 5])
3.7
>>> median_grouped([52, 52, 53, 54])
52.5
This calculates the median as the 50th percentile, and should be
used when your data is continuous and grouped. In the above example,
the values 1, 2, 3, etc. actually represent the midpoint of classes
0.5-1.5, 1.5-2.5, 2.5-3.5, etc. The middle value falls somewhere in
class 3.5-4.5, and interpolation is used to estimate it.
Optional argument ``interval`` represents the class interval, and
defaults to 1. Changing the class interval naturally will change the
interpolated 50th percentile value:
>>> median_grouped([1, 3, 3, 5, 7], interval=1)
3.25
>>> median_grouped([1, 3, 3, 5, 7], interval=2)
3.5
This function does not check whether the data points are at least
``interval`` apart.
| def median_grouped(data, interval=1):
"""Return the 50th percentile (median) of grouped continuous data.
>>> median_grouped([1, 2, 2, 3, 4, 4, 4, 4, 4, 5])
3.7
>>> median_grouped([52, 52, 53, 54])
52.5
This calculates the median as the 50th percentile, and should be
used when your data is continuous and grouped. In the above example,
the values 1, 2, 3, etc. actually represent the midpoint of classes
0.5-1.5, 1.5-2.5, 2.5-3.5, etc. The middle value falls somewhere in
class 3.5-4.5, and interpolation is used to estimate it.
Optional argument ``interval`` represents the class interval, and
defaults to 1. Changing the class interval naturally will change the
interpolated 50th percentile value:
>>> median_grouped([1, 3, 3, 5, 7], interval=1)
3.25
>>> median_grouped([1, 3, 3, 5, 7], interval=2)
3.5
This function does not check whether the data points are at least
``interval`` apart.
"""
data = sorted(data)
n = len(data)
if n == 0:
raise StatisticsError("no median for empty data")
elif n == 1:
return data[0]
# Find the value at the midpoint. Remember this corresponds to the
# centre of the class interval.
x = data[n // 2]
for obj in (x, interval):
if isinstance(obj, (str, bytes)):
raise TypeError('expected number but got %r' % obj)
try:
L = x - interval / 2 # The lower limit of the median interval.
except TypeError:
# Mixed type. For now we just coerce to float.
L = float(x) - float(interval) / 2
# Uses bisection search to search for x in data with log(n) time complexity
# Find the position of leftmost occurrence of x in data
l1 = _find_lteq(data, x)
# Find the position of rightmost occurrence of x in data[l1...len(data)]
# Assuming always l1 <= l2
l2 = _find_rteq(data, l1, x)
cf = l1
f = l2 - l1 + 1
return L + interval * (n / 2 - cf) / f
| (data, interval=1) | [
-0.006742270663380623,
0.002950318157672882,
-0.0326351635158062,
0.019536947831511497,
0.055520251393318176,
-0.030703546479344368,
0.04356260970234871,
-0.010246779769659042,
-0.018773498013615608,
0.048787180334329605,
-0.032782334834337234,
0.03316865861415863,
0.03451159596443176,
-0.025000670924782753,
0.0008082906133495271,
0.01692466251552105,
0.006696279626339674,
0.03763897716999054,
-0.02406245470046997,
0.030482789501547813,
-0.0161244198679924,
0.030850715935230255,
-0.02284829504787922,
-0.008462331257760525,
-0.006687081418931484,
0.04448242858052254,
0.011562120169401169,
-0.010863058269023895,
-0.018690714612603188,
-0.0012337067164480686,
-0.003897731425240636,
-0.02264593355357647,
-0.0016786690102890134,
-0.03710548207163811,
0.014615917578339577,
-0.037381429225206375,
0.057175926864147186,
0.010982634499669075,
-0.039956919848918915,
0.016188807785511017,
-0.03767577186226845,
-0.024172833189368248,
-0.01885628141462803,
0.018184814602136612,
0.017835283651947975,
0.08992146700620651,
0.04606451466679573,
0.02527661621570587,
-0.0034539189655333757,
0.0302252396941185,
-0.00022866115614306182,
0.013723693788051605,
-0.029562970623373985,
0.005022209603339434,
-0.013852468691766262,
0.0515834279358387,
0.034474801272153854,
-0.06670524924993515,
0.0047416649758815765,
0.02023600973188877,
0.053864579647779465,
0.04017767682671547,
0.09220261871814728,
-0.006599698681384325,
-0.06412975490093231,
0.05062681809067726,
-0.04860321432352066,
0.004152981098741293,
-0.06791940331459045,
0.006576702930033207,
0.028220035135746002,
-0.019720911979675293,
0.060560859739780426,
0.019555343315005302,
0.011414948850870132,
0.04168618097901344,
-0.004152981098741293,
-0.002568593481555581,
0.050884366035461426,
0.029489384964108467,
0.06460805982351303,
0.01343854982405901,
0.05070040374994278,
-0.03342621028423309,
0.016878671944141388,
-0.026895496994256973,
-0.015563330613076687,
-0.002966415137052536,
0.018929867073893547,
-0.006001816596835852,
-0.0304275993257761,
0.00902801938354969,
0.06317314505577087,
0.0031572773586958647,
-0.04426167160272598,
0.03243280574679375,
-0.05500515177845955,
0.006751468870788813,
-0.018240002915263176,
-0.033223848789930344,
0.020015252754092216,
0.01873670518398285,
0.04234844818711281,
0.00031906209187582135,
-0.015563330613076687,
-0.005643087439239025,
0.004488714970648289,
0.03517386317253113,
-0.09242337197065353,
0.04025126248598099,
-0.05128908529877663,
-0.001365930656902492,
-0.0330398865044117,
0.02849598042666912,
0.018635524436831474,
-0.026895496994256973,
0.012261182069778442,
0.038632381707429886,
0.003888533217832446,
-0.07689683884382248,
-0.036369629204273224,
-0.025258218869566917,
-0.06357786059379578,
0.00439213402569294,
0.02792569249868393,
-0.052172113209962845,
0.10346119850873947,
-0.033554982393980026,
-0.03651680052280426,
0.004102391190826893,
0.03888992965221405,
0.009777671657502651,
-0.014119216240942478,
-0.009120001457631588,
0.03394130617380142,
0.0012452044757083058,
-0.0026467780116945505,
0.009777671657502651,
0.028146449476480484,
0.022259609773755074,
0.010973435826599598,
-0.054674018174409866,
-0.02514784038066864,
0.02437519282102585,
0.05868442729115486,
-0.016179610043764114,
0.03833803907036781,
-0.0020971863996237516,
0.056440070271492004,
-0.048419252038002014,
-0.0503692664206028,
-0.006043208297342062,
0.09889889508485794,
-0.028312016278505325,
0.0818270668387413,
-0.03570735827088356,
0.020291198045015335,
0.00975007750093937,
-0.10530083626508713,
0.022885087877511978,
-0.011681696400046349,
0.02720823511481285,
-0.020254405215382576,
-0.018405569717288017,
-0.026380397379398346,
0.03307667747139931,
-0.0009140697657130659,
0.015305781736969948,
-0.028882304206490517,
-0.04639565199613571,
-0.007910439744591713,
0.03349979594349861,
-0.009961635805666447,
0.03333422541618347,
-0.0612599216401577,
0.038669176399707794,
-0.04131825268268585,
0.0415022149682045,
0.018469957634806633,
-0.018801093101501465,
-0.021376585587859154,
-0.02514784038066864,
0.0051785786636173725,
-0.02612284943461418,
-0.0532023087143898,
0.01309821754693985,
0.05967783182859421,
0.01438596285879612,
-0.017991652712225914,
-0.008821060881018639,
-0.01950015500187874,
-0.04790415242314339,
-0.02253555692732334,
0.02612284943461418,
0.013852468691766262,
-0.021229414269328117,
-0.0406927764415741,
0.050884366035461426,
0.050074927508831024,
0.01333737000823021,
0.011442543938755989,
0.0005490167532116175,
0.0342724435031414,
-0.024651138111948967,
0.00981446448713541,
0.03272714465856552,
-0.020401576533913612,
0.041575800627470016,
-0.022186025977134705,
0.01575649343430996,
-0.030685149133205414,
-0.038264453411102295,
-0.007542512845247984,
0.07711759209632874,
0.026987478137016296,
0.028422394767403603,
-0.0024789110757410526,
-0.0556306317448616,
0.0455494187772274,
-0.015508142299950123,
0.012665902264416218,
0.0015694404719397426,
0.021008657291531563,
0.05323910340666771,
0.04098711907863617,
0.030170051380991936,
0.03451159596443176,
-0.037381429225206375,
0.046248480677604675,
-0.03140260651707649,
0.03510027751326561,
-0.046248480677604675,
-0.0013613315531983972,
-0.04308430477976799,
-0.013843270018696785,
-0.07476285845041275,
0.01825840026140213,
-0.01834118366241455,
0.0031733743380755186,
0.001104357186704874,
-0.03309507295489311,
-0.041134290397167206,
-0.014947053045034409,
0.03373894840478897,
-0.03337102010846138,
-0.07101000100374222,
-0.042458828538656235,
0.011332165449857712,
0.03614887222647667,
0.022553952410817146,
-0.07067885994911194,
-0.01801924593746662,
-0.018350381404161453,
-0.025681335479021072,
0.04264279082417488,
-0.012546326033771038,
-0.03475074842572212,
0.009455735795199871,
0.05044285207986832,
0.005077398847788572,
0.04551262408494949,
-0.07571946829557419,
0.020052045583724976,
-0.015259791165590286,
-0.014174404554069042,
0.020990261808037758,
-0.01926100254058838,
-0.01311661396175623,
0.06975904107093811,
0.0023110443726181984,
0.028312016278505325,
0.03797011449933052,
-0.011865660548210144,
-0.07027414441108704,
-0.01756853610277176,
0.008154192008078098,
0.043746571987867355,
-0.06847129762172699,
0.029158249497413635,
-0.0676986500620842,
0.0021224813535809517,
-0.06365144997835159,
-0.027134649455547333,
-0.011580516584217548,
0.01235316414386034,
0.020990261808037758,
-0.0025892893318086863,
-0.033757343888282776,
0.04304751008749008,
0.05316551774740219,
-0.06184860318899155,
-0.025902092456817627,
-0.10243099927902222,
-0.010807869024574757,
-0.014358368702232838,
0.048419252038002014,
-0.01648315042257309,
-0.03819086775183678,
0.022553952410817146,
-0.004651982802897692,
-0.016050834208726883,
-0.023565752431750298,
-0.0021017855033278465,
0.03811728209257126,
0.008388745598495007,
0.0427163764834404,
-0.009961635805666447,
-0.05231928452849388,
-0.010072014294564724,
-0.01055951789021492,
0.022222816944122314,
0.017550138756632805,
0.03397810086607933,
-0.0047278678975999355,
0.03430923447012901,
-0.05496836081147194,
-0.011184994131326675,
0.021229414269328117,
0.008420939557254314,
0.046248480677604675,
0.020254405215382576,
-0.041171081364154816,
-0.026913892477750778,
0.049228694289922714,
0.08675729483366013,
0.023952076211571693,
-0.01623479835689068,
0.04933907091617584,
0.005252164322882891,
0.021670926362276077,
-0.05073719471693039,
-0.023510564118623734,
0.024595949798822403,
0.05044285207986832,
-0.01765131950378418,
0.029121456667780876,
0.01717301271855831,
-0.00973168108612299,
0.00018123301560990512,
-0.029029475525021553,
-0.03510027751326561,
-0.04175976663827896,
0.017274193465709686,
0.021946871653199196,
0.03877955302596092,
-0.0374734103679657,
0.05651365593075752,
-0.029967689886689186,
0.028072863817214966,
0.08918561041355133,
0.039956919848918915,
0.028753530234098434,
0.037749357521533966,
0.016308384016156197,
0.011782876215875149,
0.0006168533582240343,
0.06096557900309563,
-0.01160811074078083,
0.008600303903222084,
0.0010549169965088367,
0.09043657034635544,
0.012261182069778442,
0.020806297659873962,
-0.045880552381277084,
0.0038402427453547716,
0.018837885931134224,
-0.05846367031335831,
0.05905235558748245,
0.003766657318919897,
0.07557229697704315,
0.01497464720159769,
-0.037859734147787094,
-0.034713953733444214,
0.0447399765253067,
0.014643512666225433,
0.011139003559947014,
-0.0001756278652464971,
-0.03922106698155403,
-0.048308875411748886,
-0.010945841670036316,
-0.03107147291302681,
-0.016510743647813797,
0.00178099877666682,
0.06593260169029236,
-0.008296763524413109,
0.0415022149682045,
0.004355341196060181,
-0.004254160914570093,
0.014496341347694397,
-0.02474312111735344,
-0.03614887222647667,
-0.027999278157949448,
0.024246418848633766,
0.009129200130701065,
-0.06961186975240707,
0.029857313260436058,
0.007974827662110329,
-0.03414366766810417,
-0.02890070155262947,
0.015581727027893066,
-0.004962421488016844,
-0.04507111385464668,
0.009037218056619167,
0.02954457327723503,
0.028164846822619438,
-0.008512921631336212,
-0.029066268354654312,
-0.032984696328639984,
-0.0003075643617194146,
-0.020217612385749817,
0.004585295915603638,
-0.018911471590399742,
0.02636200189590454,
0.014091621153056622,
0.08447614312171936,
-0.0036309841088950634,
-0.029397403821349144,
-0.015370168723165989,
-0.0415022149682045,
-0.04010409116744995,
-0.008894645608961582,
-0.09212902933359146,
-0.010375553742051125,
0.02615964226424694,
-0.06343068927526474,
-0.062400493770837784,
0.04985417053103447,
-0.056807998567819595,
-0.03644321486353874,
-0.0044979131780564785,
-0.022737916558980942,
0.01777089573442936,
-0.1253896802663803,
-0.009980032220482826,
0.020659126341342926,
0.0338493250310421,
-0.05570421740412712,
0.025902092456817627,
0.011994434520602226,
-0.019481757655739784,
-0.07067885994911194,
0.07954591512680054,
-0.00610759574919939,
-0.006066203583031893,
-0.000996853457763791,
-0.024172833189368248,
0.00975007750093937,
-0.02809126116335392,
0.008862452581524849,
-0.021468566730618477,
-0.004212769214063883,
-0.06508636474609375,
0.001273948815651238,
-0.012877460569143295,
0.023712923750281334,
-0.053496651351451874,
-0.014211197383701801,
-0.0048382459208369255,
0.06515995413064957,
0.02615964226424694,
0.019720911979675293,
0.05331268906593323,
-0.04657961428165436,
-0.01045833807438612,
0.00959370844066143,
0.03451159596443176,
0.025846904143691063,
0.016225600615143776,
0.007827656343579292,
-0.051767390221357346,
0.042458828538656235,
0.05655045062303543,
-0.05493156984448433,
0.04959661886096001,
0.014643512666225433,
0.06677883118391037,
0.000448411563411355,
0.03454838693141937,
0.007156189065426588,
0.003311346983537078,
0.018690714612603188,
-0.03892672434449196,
0.040766362100839615,
0.009658095426857471,
-0.05916273221373558,
-0.020180821418762207,
-0.03245120123028755,
-0.03710548207163811,
0.02152375504374504,
-0.06343068927526474,
0.012150803580880165,
0.00969488825649023,
0.004024206660687923,
0.01595885306596756,
-0.013843270018696785,
-0.00016441757907159626,
0.0467635802924633,
0.030813923105597496,
0.03797011449933052,
-0.05949386954307556,
0.06920715421438217,
-0.006043208297342062,
0.01861712895333767,
-0.05246645584702492,
0.034033287316560745,
0.04889755696058273,
-0.016694707795977592,
0.012767082080245018,
-0.04790415242314339,
-0.03922106698155403,
0.018718309700489044,
0.030445996671915054,
-0.03377573937177658,
0.007078004069626331,
0.006121392827481031,
-0.028348809108138084,
-0.0009721333044581115,
-0.004684176295995712,
-0.03914748132228851,
-0.01777089573442936,
0.007956431247293949,
-0.0487503856420517,
0.00805761106312275,
0.051362670958042145,
-0.007441332563757896,
0.027704937383532524,
-0.0009134948486462235,
0.028403999283909798,
-0.04083994776010513,
0.03086911328136921,
-0.060708027333021164,
0.04091353341937065,
0.0021673226729035378,
0.015452953055500984,
0.016492348164319992,
0.03723425790667534,
-0.028845511376857758,
0.028422394767403603,
0.10338761657476425,
0.03892672434449196,
-0.0358729250729084,
-0.008554313331842422,
0.027594558894634247,
0.011672498658299446,
0.018184814602136612,
0.02362094260752201,
-0.0362776480615139,
0.03342621028423309,
0.011175796389579773,
0.02582850679755211,
0.07763268798589706,
0.0024260214995592833,
0.009193587116897106,
-0.04900793731212616,
0.032782334834337234,
0.02224121429026127,
-0.017752500250935555,
-0.019518550485372543,
0.005523510742932558,
-0.024963878095149994,
-0.03160496801137924,
0.03561537712812424,
0.024614347144961357,
0.011332165449857712,
-0.02422802336513996,
-0.021744512021541595,
0.010991832241415977,
-0.021431773900985718,
-0.07726476341485977,
0.00528895715251565,
-0.020585540682077408,
0.10257817059755325,
-0.010817066766321659,
-0.004925628658384085,
-0.007698881905525923,
0.010467535816133022,
0.036406420171260834,
-0.015600123442709446,
-0.0423116572201252,
-0.09374791383743286,
-0.027999278157949448,
-0.00004405068830237724,
0.04606451466679573,
-0.03980974853038788,
-0.06843450665473938,
-0.025423787534236908,
-0.0818270668387413,
-0.013705297373235226,
-0.054637227207422256,
0.05702875554561615,
0.031145058572292328,
-0.015416160225868225,
-0.07115716487169266,
-0.003407927928492427,
0.02582850679755211,
0.006857248023152351,
-0.013190198689699173,
-0.043268267065286636,
0.015103422105312347,
-0.0163175817579031,
0.030887508764863014,
0.009294766932725906,
-0.042458828538656235,
0.019555343315005302,
0.056035351008176804,
0.04871359467506409,
-0.03808049112558365,
-0.06133350729942322,
-0.011672498658299446,
-0.04175976663827896,
-0.03977295756340027,
0.07991383969783783,
0.017467355355620384,
0.03456678241491318,
-0.0018131925025954843,
0.029158249497413635,
0.022921880707144737,
-0.044114500284194946,
0.03154977783560753,
0.01619800552725792,
0.013493739068508148,
-0.010605508461594582,
0.051325879991054535,
0.010881454683840275,
0.022664330899715424,
-0.08918561041355133,
0.019849685952067375,
-0.028606358915567398,
0.0435258187353611,
-0.03215685859322548,
-0.011221786960959435,
0.03454838693141937,
0.014413557946681976,
-0.0963234081864357,
-0.021302999928593636,
0.025644542649388313,
-0.008678488433361053,
-0.004930227994918823,
-0.03228563442826271,
-0.01162650715559721,
0.011516128666698933,
-0.011700092814862728,
-0.006480121985077858,
0.0074643283151090145,
0.038705967366695404,
-0.08153272420167923,
0.0002194629778387025,
0.04602772369980812,
-0.009520122781395912,
0.0014015736524015665,
-0.03197289630770683,
0.03158657252788544,
0.03611207753419876,
0.0016464752843603492,
0.025865299627184868,
-0.033757343888282776,
-0.014073224738240242,
0.024356797337532043,
-0.018322786316275597,
-0.03252478688955307,
-0.0009577611344866455,
-0.01521379966288805,
-0.04599093273282051,
0.017191410064697266,
0.045770175755023956,
0.05570421740412712,
-0.02612284943461418,
0.008397944271564484,
-0.02994929440319538,
-0.02365773543715477,
0.06736751645803452,
0.06655807793140411,
0.037859734147787094,
0.0020385480020195246,
-0.005813253577798605,
-0.02119262143969536,
0.007399940863251686,
-0.02264593355357647,
-0.10412346571683884,
0.014156008139252663,
0.047499433159828186,
-0.009354555048048496,
-0.01926100254058838,
-0.007951832376420498,
0.023970473557710648,
0.066116563975811,
0.037013500928878784,
-0.08852334320545197,
-0.013723693788051605,
0.008420939557254314,
0.0366823673248291,
-0.0069078379310667515,
-0.005827051121741533,
-0.03204648196697235,
-0.03635123372077942,
0.020015252754092216,
-0.058095745742321014,
0.07307039201259613,
0.07380624860525131,
-0.04168618097901344,
0.01942656934261322,
0.005523510742932558,
0.0006375492666848004,
-0.0048382459208369255,
-0.010973435826599598,
-0.012895856983959675,
-0.007473526522517204,
0.025239823386073112,
0.05191456153988838,
-0.021413376554846764,
-0.02352895960211754,
0.032340820878744125,
-0.048419252038002014,
0.005620091687887907,
-0.001052042585797608,
-0.004146082326769829,
-0.03852200508117676,
0.007524116430431604,
-0.01595885306596756,
0.018074436113238335,
0.031163454055786133,
-0.026545966044068336,
0.04852962866425514,
0.004293253179639578,
-0.07770627737045288,
0.026950685307383537,
0.03631443902850151,
0.00811739917844534,
-0.06983263045549393,
-0.0523928701877594,
-0.01813882403075695,
0.061517469584941864,
-0.01355812605470419,
0.03434602543711662,
0.025368597358465195,
-0.009676491841673851,
-0.00305839697830379,
-0.05040606111288071,
0.016354374587535858,
0.05206173285841942,
-0.02043836936354637,
-0.033352624624967575,
0.01632678136229515,
-0.03243280574679375,
-0.011819669045507908,
-0.03086911328136921,
0.023234618827700615,
0.007514918223023415,
0.0007387293153442442,
-0.02172611653804779,
-0.012058822438120842,
-0.04187014326453209,
-0.029323818162083626,
-0.014376765117049217,
-0.03763897716999054,
0.01221519149839878,
-0.01810203120112419,
0.00041190627962350845,
0.013962846249341965,
-0.0018453861121088266,
-0.003704569535329938,
-0.00961210485547781,
0.05776460841298103,
-0.026729928329586983,
-0.030298825353384018,
0.033554982393980026,
-0.0451446995139122,
0.015287385322153568
]
|
36,379 | statistics | median_high | Return the high median of data.
When the number of data points is odd, the middle value is returned.
When it is even, the larger of the two middle values is returned.
>>> median_high([1, 3, 5])
3
>>> median_high([1, 3, 5, 7])
5
| def median_high(data):
"""Return the high median of data.
When the number of data points is odd, the middle value is returned.
When it is even, the larger of the two middle values is returned.
>>> median_high([1, 3, 5])
3
>>> median_high([1, 3, 5, 7])
5
"""
data = sorted(data)
n = len(data)
if n == 0:
raise StatisticsError("no median for empty data")
return data[n // 2]
| (data) | [
-0.04546920582652092,
0.01709427312016487,
0.018957054242491722,
0.014616339467465878,
0.053890712559223175,
0.0033118529245257378,
0.0380873903632164,
0.01448637805879116,
-0.00959982443600893,
0.01790003478527069,
0.008694426156580448,
0.037948764860630035,
-0.021642927080392838,
-0.05465315282344818,
0.010474898852407932,
0.06619373708963394,
0.007823684252798557,
0.05836138874292374,
0.022405367344617844,
0.04879622161388397,
-0.02084582857787609,
0.00580061599612236,
-0.06491144746541977,
-0.06820380687713623,
-0.01736285910010338,
0.02214544452726841,
0.014919583685696125,
0.015066873282194138,
-0.0061428481712937355,
-0.010396922007203102,
-0.05205392464995384,
-0.026668105274438858,
-0.008720418438315392,
0.013819241896271706,
0.055970098823308945,
0.04054799675941467,
0.03774082660675049,
-0.005995558574795723,
-0.08338331431150436,
0.003112578531727195,
-0.03169328346848488,
-0.06421831995248795,
0.01653110608458519,
0.040651965886354446,
-0.00884171575307846,
0.0569404773414135,
0.06498076021671295,
0.009400550276041031,
0.006970270071178675,
-0.007477120030671358,
-0.00865110568702221,
0.002097795717418194,
-0.03541884943842888,
0.03176259621977806,
0.001527047948911786,
0.026442838832736015,
0.05111819878220558,
-0.05465315282344818,
-0.0015086367493495345,
0.009071314707398415,
0.03753288835287094,
0.008941353298723698,
0.08712621033191681,
-0.020048731938004494,
-0.02037796750664711,
0.06879296898841858,
-0.011991117149591446,
0.03148534521460533,
-0.08109599351882935,
0.015586718916893005,
0.01857583411037922,
0.004977526608854532,
0.026234900578856468,
0.0420035645365715,
0.05434124544262886,
-0.0012963662156835198,
0.019962090998888016,
-0.028643520548939705,
-0.0032143818680197,
0.007555096875876188,
0.062450844794511795,
0.0046136341989040375,
0.030878858640789986,
0.019338274374604225,
-0.03936967998743057,
-0.031312063336372375,
0.03867654874920845,
0.006524068769067526,
-0.033547401428222656,
0.009539175778627396,
-0.04113715514540672,
-0.0015530402306467295,
0.04366707429289818,
0.04321654140949249,
-0.03864189237356186,
0.005484376568347216,
-0.05337086692452431,
0.01556939072906971,
-0.0018779441015794873,
-0.029163366183638573,
0.024796659126877785,
0.0639757290482521,
0.05461849644780159,
-0.007477120030671358,
-0.004256240092217922,
-0.004730599466711283,
0.030722904950380325,
0.06206962466239929,
-0.08331400156021118,
0.03368602693080902,
-0.053301554173231125,
-0.05080629140138626,
-0.04408295080065727,
0.013048137538135052,
0.023895593360066414,
0.013559319078922272,
0.045365236699581146,
0.0431818850338459,
0.023652998730540276,
-0.003537119599059224,
-0.041760969907045364,
-0.03365137055516243,
-0.059539709240198135,
-0.052712395787239075,
-0.009452534839510918,
-0.024588720872998238,
0.10119670629501343,
-0.058014824986457825,
-0.09052253514528275,
0.027118638157844543,
0.015396108850836754,
0.024172844365239143,
0.0005328422412276268,
0.01189581211656332,
-0.02484864369034767,
-0.005302430130541325,
0.038503266870975494,
-0.032057177275419235,
0.026633448898792267,
-0.059816960245370865,
-0.010864784009754658,
-0.006822980009019375,
-0.017536142840981483,
0.024571392685174942,
0.03396327793598175,
-0.06082199513912201,
0.005674986634403467,
-0.025143222883343697,
0.12781283259391785,
0.005332754459232092,
-0.026078946888446808,
-0.01761411875486374,
0.05288567766547203,
-0.03597335144877434,
0.06113390251994133,
-0.028244972229003906,
0.01121134776622057,
-0.027101309970021248,
-0.10902905464172363,
0.0186451468616724,
0.026668105274438858,
-0.026061618700623512,
0.008122595027089119,
-0.02874748967587948,
-0.02933664806187153,
0.009669137187302113,
0.01928628981113434,
0.02367032691836357,
-0.010700165294110775,
0.02822764404118061,
-0.015205498784780502,
0.0034743049181997776,
-0.07229326665401459,
0.027933064848184586,
-0.03784479573369026,
-0.024640705436468124,
-0.05884657800197601,
0.022474680095911026,
0.035124268382787704,
-0.007594085298478603,
-0.0451572984457016,
0.014191798865795135,
-0.022838572040200233,
-0.019130336120724678,
-0.035557474941015244,
-0.0013916713651269674,
0.03313152492046356,
0.00546704838052392,
-0.006194832734763622,
0.006749335210770369,
-0.059227798134088516,
-0.04425623267889023,
-0.013819241896271706,
-0.008113930933177471,
0.042384784668684006,
-0.02893809974193573,
0.0020718034356832504,
0.06525801122188568,
0.051880642771720886,
-0.0384686104953289,
-0.015188170596957207,
0.007529104594141245,
0.01643580198287964,
-0.012675580568611622,
0.026009634137153625,
0.04546920582652092,
0.012199055403470993,
0.004977526608854532,
-0.04602370783686638,
0.020395295694470406,
-0.029752526432275772,
0.006220825016498566,
-0.025472458451986313,
0.04248875379562378,
0.043875012546777725,
0.01569068804383278,
0.00037553466972894967,
-0.04792981222271919,
0.034847017377614975,
0.004271402023732662,
-0.03252503648400307,
-0.02493528462946415,
0.023271776735782623,
0.09807763248682022,
0.0478951558470726,
0.0046569546684622765,
0.02100178226828575,
-0.0304283257573843,
0.05933176726102829,
-0.006307465955615044,
0.003996316809207201,
0.011332645080983639,
-0.0005179508589208126,
-0.03430984169244766,
0.009261924773454666,
-0.016912326216697693,
0.0014436559285968542,
-0.0808880552649498,
-0.03895379975438118,
0.012987488880753517,
-0.01643580198287964,
-0.03604266420006752,
-0.020204685628414154,
0.028452910482883453,
-0.05170736089348793,
-0.04820706322789192,
-0.05427193269133568,
0.005796283949166536,
0.029891151934862137,
0.011020737700164318,
-0.06349053978919983,
0.008620780892670155,
0.01975415274500847,
-0.021105751395225525,
0.029821839183568954,
-0.015751337632536888,
0.007355822250247002,
-0.00865110568702221,
0.01205176580697298,
-0.006511072628200054,
0.031190766021609306,
-0.0514301098883152,
0.01966751180589199,
0.022076131775975227,
-0.017796065658330917,
-0.000805761490482837,
-0.0145296985283494,
-0.014789621345698833,
0.02760382741689682,
0.009781771339476109,
0.0738181471824646,
-0.008772403001785278,
-0.006064871326088905,
-0.08788865059614182,
0.031866565346717834,
-0.010838791728019714,
0.03968158736824989,
-0.058326732367277145,
0.03711701184511185,
0.015768665820360184,
-0.008061946369707584,
-0.047098055481910706,
-0.030133746564388275,
0.02198949083685875,
0.0012411326169967651,
0.009270588867366314,
0.010076350532472134,
-0.08629445731639862,
0.06016352400183678,
0.03583472594618797,
-0.01012833509594202,
-0.002727026119828224,
-0.12372337281703949,
0.016011260449886322,
-0.009842419996857643,
-0.012580275535583496,
-0.025229863822460175,
0.015101529657840729,
0.035349536687135696,
-0.021885521709918976,
-0.03522823750972748,
-0.04962797462940216,
0.005259109660983086,
-0.014555690810084343,
0.03179725259542465,
0.006082199513912201,
-0.019095679745078087,
-0.04550386220216751,
0.021660255268216133,
-0.01556939072906971,
0.0019938263576477766,
0.007312501780688763,
0.006077867466956377,
0.03110412508249283,
-0.0003825742460321635,
-0.025420473888516426,
-0.014694316312670708,
0.00468294695019722,
0.0007093733293004334,
0.0190436951816082,
0.008165915496647358,
-0.07312501966953278,
0.0069789341650903225,
-0.028452910482883453,
0.04436020180583,
0.009755779057741165,
-0.08407644182443619,
-0.0009216438047587872,
0.03411923348903656,
-0.03240374103188515,
-0.05839604511857033,
-0.05787619948387146,
0.03444846719503403,
0.04304325580596924,
0.020672546699643135,
0.0034179880749434233,
0.00267070927657187,
0.006233821157366037,
0.010292952880263329,
-0.007905992679297924,
-0.04186493903398514,
-0.06075268238782883,
0.04519195482134819,
0.05257377028465271,
0.021608270704746246,
0.01352466270327568,
0.04307791218161583,
-0.03902311623096466,
0.003541451646015048,
0.07790759950876236,
0.03521091118454933,
-0.00021470726642291993,
0.010587532073259354,
-0.002781176706776023,
0.05337086692452431,
-0.010344937443733215,
0.026217572391033173,
-0.008473491296172142,
-0.009452534839510918,
0.04137974977493286,
0.028054362162947655,
-0.007550764828920364,
-0.02822764404118061,
0.026252228766679764,
-0.04643958434462547,
0.00877673551440239,
-0.044429514557123184,
0.08587857335805893,
-0.0038165368605405092,
0.009738449938595295,
-0.013949204236268997,
-0.048311032354831696,
0.007693722378462553,
0.019528886303305626,
0.042696692049503326,
0.04172631353139877,
-0.004899549763649702,
0.0196328554302454,
-0.01817728579044342,
-0.012649588286876678,
-0.058049481362104416,
-0.013351380825042725,
-0.05226186290383339,
-0.00620349682867527,
-0.012996152974665165,
0.060440775007009506,
-0.051568735390901566,
-0.013264739885926247,
-0.06061405688524246,
-0.01513618603348732,
-0.035124268382787704,
-0.01997941918671131,
-0.005042507313191891,
-0.033512745052576065,
-0.018107973039150238,
0.09093841165304184,
0.02304651029407978,
-0.013827905990183353,
-0.01397519651800394,
0.0005539610283449292,
-0.032178472727537155,
-0.045330580323934555,
0.0008907779701985419,
0.00048058689571917057,
0.014538362622261047,
-0.02760382741689682,
-0.017917362973093987,
0.04231547191739082,
0.014382408931851387,
0.0076720621436834335,
-0.010310281068086624,
-0.043597761541604996,
-0.0021270369179546833,
0.001973249251022935,
0.08608651161193848,
-0.00612551998347044,
0.037394262850284576,
0.05129148066043854,
-0.025333832949399948,
-0.03126008063554764,
0.008113930933177471,
-0.0836605653166771,
-0.026494823396205902,
-0.02564574033021927,
-0.03136404976248741,
-0.06220825016498566,
-0.042939286679029465,
-0.022561321035027504,
-0.050633009523153305,
0.01566469669342041,
0.004821572452783585,
0.009296581149101257,
-0.07010991126298904,
-0.05423727631568909,
0.0064287637360394,
0.03327015042304993,
-0.03687441721558571,
-0.004856228828430176,
0.011713865213096142,
-0.02108842320740223,
0.02034331113100052,
0.08386850357055664,
-0.0128575274720788,
0.012311688624322414,
0.014746300876140594,
-0.015274811536073685,
0.03074023313820362,
0.016643740236759186,
0.05264308303594589,
-0.03569610044360161,
-0.018627818673849106,
-0.06078733876347542,
0.008139923214912415,
-0.0011609896318987012,
0.032455723732709885,
-0.0985628217458725,
-0.043563105165958405,
0.004121946636587381,
0.08379919081926346,
0.04723668470978737,
-0.016201870515942574,
0.04456814005970955,
-0.025732383131980896,
-0.045018672943115234,
0.0043017263524234295,
0.016946982592344284,
0.02496994100511074,
-0.02720527909696102,
0.006476416252553463,
-0.03600800782442093,
0.07624409347772598,
0.02276925928890705,
-0.022197429090738297,
-0.005380406975746155,
0.029544586315751076,
0.0178653784096241,
0.03027237206697464,
-0.01290084794163704,
0.03930036723613739,
0.020031403750181198,
0.026356197893619537,
-0.00514214439317584,
-0.0019635020289570093,
0.00498619070276618,
-0.02810634672641754,
0.010076350532472134,
-0.08643308281898499,
-0.041622344404459,
0.06345587968826294,
-0.05305895954370499,
0.05839604511857033,
-0.00880705937743187,
0.0041284444741904736,
-0.008984673768281937,
-0.0002702116617001593,
-0.0011772348079830408,
0.07056044787168503,
0.039161741733551025,
0.023999562487006187,
-0.02540314570069313,
0.025264520198106766,
-0.019095679745078087,
0.02732657641172409,
-0.08899765461683273,
-0.0196328554302454,
0.034015264362096786,
-0.0002444901328999549,
-0.02289055660367012,
-0.02143498696386814,
0.011783177964389324,
0.017917362973093987,
0.03930036723613739,
-0.013628631830215454,
0.015283475629985332,
0.03670113533735275,
-0.010362265631556511,
-0.0034829690121114254,
0.05146476626396179,
0.009929060935974121,
0.011237340047955513,
-0.00928791705518961,
-0.061029933393001556,
-0.02347971498966217,
0.035557474941015244,
0.0014382408699020743,
-0.03933502361178398,
-0.04598905146121979,
0.027395889163017273,
-0.017206905409693718,
0.06033680588006973,
-0.08199705928564072,
0.016583090648055077,
-0.014061837457120419,
0.013697944581508636,
-0.01394054014235735,
-0.00840851105749607,
-0.003495965152978897,
0.02555909939110279,
0.08927490562200546,
-0.007000594399869442,
-0.014321760274469852,
-0.060371462255716324,
0.03266366198658943,
0.017319539561867714,
0.011341309174895287,
-0.0027486863546073437,
-0.0714615136384964,
0.07250120490789413,
-0.008759407326579094,
-0.030410997569561005,
0.020863156765699387,
0.0013093623565509915,
0.05853467062115669,
-0.05437590181827545,
0.00315156695432961,
0.00944387074559927,
0.007416470907628536,
0.0005393403116613626,
0.0143304243683815,
0.013464014045894146,
-0.025004597380757332,
0.03538419306278229,
0.018991710618138313,
0.009660473093390465,
-0.0022678286768496037,
-0.03895379975438118,
-0.03569610044360161,
-0.012086422182619572,
-0.04158768802881241,
-0.02403421886265278,
0.006502408534288406,
0.09592893719673157,
0.0261136032640934,
0.0022699947003275156,
0.029925808310508728,
0.028019705787301064,
0.04747927933931351,
-0.022197429090738297,
-0.005839604418724775,
-0.04068662226200104,
-0.008503816090524197,
0.002947960514575243,
0.002586234360933304,
-0.010466234758496284,
-0.06536198407411575,
-0.0019158495124429464,
-0.0534055233001709,
-0.0001224481238750741,
-0.034344498068094254,
0.05295499041676521,
0.034535109996795654,
-0.06394106894731522,
-0.03950830549001694,
-0.010336273349821568,
0.010873448103666306,
0.02022201381623745,
-0.016522442921996117,
-0.013351380825042725,
0.025004597380757332,
0.025264520198106766,
-0.035436175763607025,
0.00668435450643301,
-0.01012833509594202,
-0.025472458451986313,
0.0683424323797226,
0.010275624692440033,
-0.022284070029854774,
-0.03498564288020134,
-0.05898520350456238,
-0.05375208705663681,
-0.013273403979837894,
0.06723342835903168,
-0.011046729981899261,
0.019996747374534607,
0.01405317336320877,
0.05583147332072258,
0.03593869507312775,
-0.06660961359739304,
0.01175718568265438,
-0.0013028642861172557,
0.03552281856536865,
0.028418254107236862,
0.07229326665401459,
-0.021296361461281776,
0.028799474239349365,
-0.06917418539524078,
0.05898520350456238,
-0.045330580323934555,
-0.004080791957676411,
-0.03372068330645561,
-0.0304283257573843,
-0.00021078134886920452,
0.023462386801838875,
-0.07052578777074814,
-0.057460322976112366,
0.04009746387600899,
0.026997340843081474,
-0.00670601474121213,
0.0008517894893884659,
-0.013455349951982498,
0.0029241342563182116,
0.04373638704419136,
-0.003305354854092002,
0.000685547071043402,
0.05364811792969704,
-0.014287103898823261,
-0.011869819834828377,
0.0903145968914032,
-0.02289055660367012,
-0.0017566466704010963,
-0.030012449249625206,
0.0054887086153030396,
0.02010071650147438,
0.03384198248386383,
0.07652134448289871,
-0.04654355347156525,
0.04494936019182205,
0.0018627819372341037,
-0.012086422182619572,
-0.02564574033021927,
0.01160123199224472,
-0.03451777994632721,
-0.015361452475190163,
-0.0045703137293457985,
0.062173593789339066,
0.04685546085238457,
-0.040651965886354446,
0.01537011656910181,
-0.0020317318849265575,
-0.04806843772530556,
0.0635945051908493,
0.03545350581407547,
0.0675453394651413,
-0.0015432931249961257,
0.046820804476737976,
-0.02226674184203148,
0.022388039156794548,
0.0004112740862183273,
-0.07645203173160553,
0.015560726635158062,
0.027967721223831177,
-0.014165806584060192,
-0.019892778247594833,
0.013282068073749542,
0.027551842853426933,
0.06799586862325668,
-0.008174579590559006,
-0.006857636384665966,
-0.03836464136838913,
0.028487566858530045,
-0.010162991471588612,
-0.09045322239398956,
0.0040179770439863205,
-0.022180100902915,
-0.04189959540963173,
-0.0011100880801677704,
-0.041760969907045364,
0.07208532840013504,
0.04217684641480446,
-0.001287702121771872,
0.032923586666584015,
0.038884487003088,
-0.015240155160427094,
-0.031086796894669533,
-0.015621375292539597,
-0.012831535190343857,
-0.0025234196800738573,
0.047999124974012375,
0.03522823750972748,
-0.07915523648262024,
-0.031225422397255898,
-0.002052309224382043,
-0.009261924773454666,
0.04702874273061752,
-0.026442838832736015,
-0.02971786819398403,
-0.05312827229499817,
0.05219255015254021,
0.00007520169310737401,
0.03278496116399765,
0.011696537025272846,
-0.007390478625893593,
0.05070232227444649,
0.019095679745078087,
-0.09204741567373276,
0.020031403750181198,
0.04349379241466522,
-0.02524719201028347,
-0.03353007510304451,
-0.03659716621041298,
-0.03439648449420929,
-0.02869550511240959,
0.010544211603701115,
0.03287160396575928,
0.02347971498966217,
0.00008454268390778452,
0.042350128293037415,
-0.016765037551522255,
0.0738181471824646,
0.020308654755353928,
0.012381001375615597,
0.02034331113100052,
0.019147664308547974,
-0.007940649054944515,
0.003010775428265333,
-0.02639085426926613,
0.01336870901286602,
-0.000928683381062001,
0.014105157926678658,
-0.013342716731131077,
-0.008677097968757153,
-0.03635457158088684,
-0.0038988457527011633,
0.017778737470507622,
-0.044186919927597046,
0.03458709269762039,
-0.021192392334342003,
0.012077758088707924,
0.0095218475908041,
-0.01680835708975792,
0.019719496369361877,
-0.0004597388906404376,
0.009565168060362339,
-0.024294141680002213,
-0.039993494749069214,
0.02968321181833744,
-0.038191359490156174,
-0.02269994653761387
]
|
36,380 | statistics | median_low | Return the low median of numeric data.
When the number of data points is odd, the middle value is returned.
When it is even, the smaller of the two middle values is returned.
>>> median_low([1, 3, 5])
3
>>> median_low([1, 3, 5, 7])
3
| def median_low(data):
"""Return the low median of numeric data.
When the number of data points is odd, the middle value is returned.
When it is even, the smaller of the two middle values is returned.
>>> median_low([1, 3, 5])
3
>>> median_low([1, 3, 5, 7])
3
"""
data = sorted(data)
n = len(data)
if n == 0:
raise StatisticsError("no median for empty data")
if n % 2 == 1:
return data[n // 2]
else:
return data[n // 2 - 1]
| (data) | [
-0.052392780780792236,
0.019542787224054337,
0.03905073553323746,
0.03936425969004631,
0.05507512390613556,
0.01760070025920868,
0.0523231104016304,
-0.01012845803052187,
-0.0010619423119351268,
0.01234922930598259,
0.0023122148122638464,
0.019438279792666435,
-0.013873288407921791,
-0.0545525923371315,
-0.014892230741679668,
0.0385282039642334,
-0.007546267472207546,
0.05570216849446297,
-0.012627914547920227,
0.030150234699249268,
-0.015336384996771812,
0.03657740727066994,
-0.06158938631415367,
-0.028042679652571678,
-0.029192255809903145,
0.037099942564964294,
0.014857394620776176,
-0.0007631179178133607,
-0.011356414295732975,
-0.01604180596768856,
-0.02368822693824768,
0.010677119717001915,
0.008395385928452015,
-0.014700634405016899,
0.04978011175990105,
0.019072504714131355,
0.05193991959095001,
-0.04267364367842674,
-0.09245375543832779,
0.009658177383244038,
-0.04465927183628082,
-0.058837372809648514,
0.014404531568288803,
0.01674722693860531,
-0.0016329200007021427,
0.05235794559121132,
0.07224909216165543,
-0.011434794403612614,
0.019072504714131355,
0.0069366442039608955,
0.009022427722811699,
0.044136740267276764,
-0.03692576289176941,
0.018706731498241425,
-0.02433268539607525,
0.03060309775173664,
0.030550844967365265,
-0.08053997159004211,
-0.023043766617774963,
0.028216857463121414,
0.03849336877465248,
0.02246897853910923,
0.09440454840660095,
-0.02281733602285385,
-0.027816247195005417,
0.03577618673443794,
-0.013577185571193695,
0.03220553696155548,
-0.08813413232564926,
0.0029174836818128824,
-0.00382538721896708,
0.01902025192975998,
0.024750713258981705,
0.03271065279841423,
0.038806889206171036,
0.023844987154006958,
0.01865447871387005,
-0.031125633046030998,
0.008573918603360653,
-0.010973222553730011,
0.07587199658155441,
0.009910735301673412,
0.04354453459382057,
0.052915316075086594,
-0.037343792617321014,
-0.046714574098587036,
0.02161550708115101,
0.012227305211126804,
-0.016616594046354294,
0.021685177460312843,
-0.04626171290874481,
0.02999347448348999,
0.023113438859581947,
0.031787510961294174,
-0.008778577670454979,
0.04876987636089325,
-0.03530590608716011,
0.018184196203947067,
-0.020152410492300987,
-0.027920754626393318,
0.04546049237251282,
0.07001961022615433,
0.015162206254899502,
-0.015214459970593452,
-0.013934250921010971,
-0.0028303945437073708,
0.027711741626262665,
0.047341614961624146,
-0.05702592059969902,
0.06050948426127434,
-0.05664272978901863,
-0.0841628760099411,
-0.06287830322980881,
0.031282391399145126,
0.001061397953890264,
0.0052209896966814995,
0.046366218477487564,
0.052775975316762924,
0.0056782071478664875,
-0.011817986145615578,
-0.04047899693250656,
-0.036856092512607574,
-0.04528631269931793,
-0.04270847886800766,
0.007698673289269209,
-0.03171783685684204,
0.11858047544956207,
-0.05970826372504234,
-0.07719574868679047,
-0.0041519710794091225,
0.045599836856126785,
0.012375356629490852,
0.0063444385305047035,
0.0039777932688593864,
-0.029958639293909073,
-0.013011106289923191,
0.038458529859781265,
-0.014465494081377983,
0.0421859435737133,
-0.04500763118267059,
-0.0047158729285001755,
-0.011208362877368927,
-0.034644030034542084,
0.047829315066337585,
0.006927935406565666,
-0.042394958436489105,
0.0065490975975990295,
-0.004282604902982712,
0.12519924342632294,
0.022434143349528313,
-0.026231227442622185,
-0.028042679652571678,
0.05939474329352379,
-0.02273024618625641,
0.052532125264406204,
-0.026387987658381462,
0.0065665156580507755,
-0.05308949574828148,
-0.0999782457947731,
0.022016115486621857,
0.017443940043449402,
-0.028965823352336884,
0.018793821334838867,
-0.049187906086444855,
-0.029714789241552353,
0.009396910667419434,
-0.023165691643953323,
-0.0036686270032078028,
-0.02938385121524334,
0.024506863206624985,
0.00240583554841578,
0.0187589842826128,
-0.015780538320541382,
0.01624211110174656,
-0.0005927499732933939,
-0.0052209896966814995,
-0.056329209357500076,
0.01865447871387005,
0.014334860257804394,
-0.0050119757652282715,
-0.04699325934052467,
0.05173090472817421,
-0.020291753113269806,
-0.027485309168696404,
-0.042778149247169495,
-0.008417158387601376,
0.017130419611930847,
-0.027224041521549225,
0.010145876556634903,
0.00895275641232729,
-0.0456346720457077,
-0.024280432611703873,
-0.005983018781989813,
-0.0033202706836163998,
0.027450473979115486,
-0.009005009196698666,
0.004824734292924404,
0.06033530458807945,
0.03483562543988228,
-0.04528631269931793,
-0.014709343202412128,
0.011304160580039024,
0.02591770701110363,
0.00025677666417323053,
0.01618114858865738,
0.05113869905471802,
-0.008186371996998787,
0.02455911599099636,
-0.03908557444810867,
0.04037449136376381,
-0.02630089782178402,
-0.018445463851094246,
-0.016085350885987282,
0.03898106515407562,
0.03898106515407562,
-0.0005402243696153164,
-0.0010222078999504447,
-0.050790343433618546,
0.024524280801415443,
-0.01997823268175125,
-0.015641195699572563,
-0.022434143349528313,
-0.0009661443182267249,
0.048944056034088135,
0.04779447987675667,
0.02541258931159973,
0.008308297023177147,
-0.04500763118267059,
0.038458529859781265,
0.03021990694105625,
0.019037669524550438,
-0.02725887857377529,
0.007546267472207546,
-0.03483562543988228,
0.008138473145663738,
-0.01172218844294548,
-0.0020106688607484102,
-0.07677771896123886,
-0.018619641661643982,
-0.02123231440782547,
-0.0334596186876297,
-0.028809063136577606,
0.0022175053600221872,
0.04748095944523811,
-0.03668191656470299,
-0.04458960145711899,
-0.07176139205694199,
-0.0014347924152389169,
0.00436969380825758,
0.017679080367088318,
-0.06542130559682846,
0.02565643936395645,
0.024907473474740982,
-0.002492924453690648,
0.038214683532714844,
-0.020326588302850723,
0.034487269818782806,
-0.0043762256391346455,
-0.006096234545111656,
-0.012671459466218948,
0.022677993401885033,
-0.06660571694374084,
0.030185069888830185,
0.0033638151362538338,
-0.007332899607717991,
0.005016330163925886,
-0.011809277348220348,
-0.009327239356935024,
0.03539299592375755,
0.03295450285077095,
0.0634705126285553,
-0.015014154836535454,
0.030585680156946182,
-0.06684956699609756,
0.05740911141037941,
-0.03558459132909775,
0.022294800728559494,
-0.03514914587140083,
0.05403005704283714,
0.026231227442622185,
-0.03161333128809929,
-0.02861746773123741,
-0.04040932655334473,
0.024611370638012886,
-0.00367080420255661,
-0.03175267204642296,
0.03349445387721062,
-0.10304377973079681,
0.04148923233151436,
0.026980193331837654,
-0.008238625712692738,
0.005038102623075247,
-0.11126498878002167,
-0.03441759943962097,
-0.00951012596487999,
-0.0002974635863211006,
-0.01841062866151333,
0.02232963591814041,
0.004128021653741598,
-0.009092098101973534,
-0.008573918603360653,
-0.06583933532238007,
-0.007598521187901497,
-0.0033703469671308994,
0.047341614961624146,
0.009161769412457943,
-0.037343792617321014,
-0.04385805502533913,
-0.018340958282351494,
-0.02445461042225361,
-0.026945356279611588,
0.016015678644180298,
-0.00876986887305975,
-0.014334860257804394,
0.009414328262209892,
-0.045112136751413345,
-0.01326366513967514,
0.04897889122366905,
0.020901376381516457,
0.0261615552008152,
0.032170701771974564,
-0.054761603474617004,
0.0004248313489370048,
0.002523405710235238,
0.018967999145388603,
0.029349016025662422,
-0.0535423569381237,
0.005199217237532139,
0.007006315514445305,
-0.010276509448885918,
-0.059325072914361954,
-0.03196168690919876,
0.018967999145388603,
0.035480085760354996,
0.0037121714558452368,
0.004532985854893923,
0.008229916915297508,
0.0030285222455859184,
-0.018236450850963593,
0.0004153059853706509,
-0.0052209896966814995,
-0.08430221676826477,
0.050198137760162354,
0.0508948490023613,
0.02725887857377529,
0.00956237968057394,
0.07719574868679047,
-0.043649040162563324,
0.014900939539074898,
0.09092098474502563,
0.03640323132276535,
0.01936860755085945,
0.01666884683072567,
-0.038563039153814316,
0.07217942178249359,
0.008264752104878426,
0.0035771834664046764,
-0.015850210562348366,
0.0032244727481156588,
0.035114310681819916,
0.05953408405184746,
-0.019473114982247353,
-0.02173743024468422,
0.0067276302725076675,
-0.03866754472255707,
0.012775965966284275,
-0.04789898544549942,
0.041907258331775665,
-0.03011539950966835,
0.04772480949759483,
-0.023148274049162865,
-0.059081222862005234,
-0.035358160734176636,
-0.015170915052294731,
0.03595036640763283,
0.019403444603085518,
0.017304597422480583,
0.017008494585752487,
-0.03664707764983177,
0.008652298711240292,
-0.05688657984137535,
-0.008147181943058968,
-0.04570434242486954,
0.007228392641991377,
-0.016694974154233932,
0.05451775714755058,
-0.06374919414520264,
0.0024232533760368824,
-0.034678865224123,
-0.01758328266441822,
-0.020431095734238625,
-0.030185069888830185,
0.025987377390265465,
-0.026074467226862907,
-0.011373831890523434,
0.07399087399244308,
0.0295057762414217,
-0.026213809847831726,
0.004354453179985285,
-0.031003708019852638,
-0.01936860755085945,
-0.06061398983001709,
0.0063139572739601135,
0.0052035716362297535,
0.008643589913845062,
-0.021632924675941467,
-0.040792517364025116,
0.012209886685013771,
0.015440891496837139,
0.02050076611340046,
-0.007176138926297426,
-0.026701508089900017,
0.021319404244422913,
-0.008512956090271473,
0.08555629849433899,
-0.014169391244649887,
0.021946445107460022,
0.060788169503211975,
-0.039677780121564865,
-0.025151321664452553,
0.012915308587253094,
-0.09273243695497513,
-0.03096887283027172,
0.00218484690412879,
-0.030463755130767822,
-0.050302643328905106,
-0.015275422483682632,
-0.029923804104328156,
-0.034731119871139526,
0.04789898544549942,
0.011278034187853336,
0.03267581760883331,
-0.054761603474617004,
-0.04556499794125557,
-0.012453736737370491,
0.031003708019852638,
-0.051661234349012375,
0.01746135763823986,
-0.0069192261435091496,
-0.027955589815974236,
0.03699543699622154,
0.0774744302034378,
0.008896147832274437,
0.009065971709787846,
0.013507514260709286,
-0.006814719643443823,
0.011809277348220348,
0.03863270953297615,
0.03262356296181679,
-0.021824520081281662,
-0.034887880086898804,
-0.07322448492050171,
0.0028151541482657194,
0.00505987461656332,
-0.001246462226845324,
-0.08033095300197601,
-0.04002613574266434,
0.009065971709787846,
0.06580449640750885,
0.0387372151017189,
0.00731112714856863,
0.045251477509737015,
-0.052671466022729874,
-0.048560865223407745,
0.02541258931159973,
0.05148705467581749,
0.013045942410826683,
-0.010738082230091095,
-0.01166993472725153,
-0.029558029025793076,
0.08472024649381638,
0.013568476773798466,
-0.010781626217067242,
-0.01462225429713726,
0.038458529859781265,
0.04047899693250656,
0.003167864866554737,
-0.00793816801160574,
0.06455041468143463,
0.013342045247554779,
-0.0032527765724807978,
-0.018445463851094246,
0.026387987658381462,
0.01573699340224266,
-0.03567168116569519,
0.0019083392107859254,
-0.11412151157855988,
-0.01924668438732624,
0.05605052411556244,
-0.06249511241912842,
0.05448291823267937,
0.014308733865618706,
0.01790551282465458,
-0.008456348441541195,
-0.005538864526897669,
0.007419988512992859,
0.05396038666367531,
0.04305683448910713,
0.036716751754283905,
-0.010537777096033096,
0.01012845803052187,
-0.0013792731333523989,
0.021632924675941467,
-0.046470724046230316,
-0.007746572606265545,
0.04929241165518761,
-0.00771173695102334,
-0.01098193135112524,
-0.007494014222174883,
0.0019050732953473926,
0.024750713258981705,
0.04546049237251282,
0.013298500329256058,
0.026736343279480934,
0.018062273040413857,
-0.0068016559816896915,
0.00014179188292473555,
0.06315699219703674,
0.003106902353465557,
-0.011356414295732975,
0.005917701870203018,
-0.0774744302034378,
-0.0145003292709589,
0.02097104676067829,
0.002516874112188816,
-0.046366218477487564,
-0.045495327562093735,
-0.012140216305851936,
-0.03741346299648285,
0.05298498645424843,
-0.04953626170754433,
0.006192032713443041,
-0.011565428227186203,
-0.002871762029826641,
0.0029544965364038944,
-0.0055911182425916195,
-0.005416939966380596,
0.012436318211257458,
0.09990857541561127,
-0.006057044491171837,
-0.0045983027666807175,
-0.05838451161980629,
0.04556499794125557,
0.043649040162563324,
0.034138914197683334,
0.0016427175141870975,
-0.09370783716440201,
0.09489224851131439,
-0.05618986487388611,
-0.034853044897317886,
0.019438279792666435,
-0.027433056384325027,
0.05249729007482529,
-0.05517963320016861,
-0.0051469639874994755,
0.0034204230178147554,
-0.0001443773362552747,
0.00009266821143683046,
0.009083389304578304,
0.001927934237755835,
0.0016917050816118717,
0.024959726259112358,
0.0070237331092357635,
0.0031460924074053764,
-0.029453521594405174,
-0.06496844440698624,
-0.038214683532714844,
-0.020883958786725998,
-0.035009805113077164,
-0.018358375877141953,
0.028460707515478134,
0.07357284426689148,
0.018340958282351494,
0.05134771391749382,
0.01443936675786972,
0.019211847335100174,
0.03985195606946945,
-0.024663623422384262,
-0.023618554696440697,
-0.06472459435462952,
0.019925978034734726,
-0.038179848343133926,
0.0017102115089073777,
-0.021580670028924942,
-0.06169389560818672,
-0.0036316141486167908,
-0.05430874228477478,
0.0015295017510652542,
-0.03999130055308342,
0.02358371950685978,
0.035236235707998276,
-0.07691705971956253,
-0.048317015171051025,
-0.000749510305467993,
0.012993688695132732,
0.031160468235611916,
-0.002442848403006792,
-0.018201615661382675,
0.02516873925924301,
0.033511873334646225,
-0.048456355929374695,
0.005996082443743944,
-0.0011626390041783452,
-0.025708692148327827,
0.044485095888376236,
0.013054651208221912,
-0.016398871317505836,
-0.03925975039601326,
-0.03514914587140083,
-0.049954287707805634,
0.021510999649763107,
0.05249729007482529,
-0.026074467226862907,
0.0067276302725076675,
0.011983455158770084,
0.05497061833739281,
0.03358154371380806,
-0.08388418704271317,
0.0464358888566494,
-0.0070237331092357635,
0.02863488532602787,
-0.00809057429432869,
0.05483127757906914,
-0.03849336877465248,
0.01567603275179863,
-0.060161128640174866,
0.07496626675128937,
-0.00867842510342598,
0.000743522890843451,
-0.06145004555583,
-0.0068626184947788715,
0.008526019752025604,
0.04065317660570145,
-0.057339441031217575,
-0.06374919414520264,
0.04110603779554367,
0.024611370638012886,
-0.016355326399207115,
-0.023008931428194046,
0.002110821194946766,
0.0026845205575227737,
0.03279774263501167,
-0.018828656524419785,
-0.0056651439517736435,
0.05322883650660515,
-0.03664707764983177,
-0.018236450850963593,
0.07231876254081726,
-0.003559765638783574,
0.009283694438636303,
-0.024019164964556694,
0.011678643524646759,
0.023531464859843254,
0.03689092770218849,
0.0636795237660408,
-0.029819296672940254,
0.04312650486826897,
-0.012044417671859264,
0.01814936101436615,
-0.03121272101998329,
0.010485523380339146,
-0.023757897317409515,
0.0022773791570216417,
0.02269541099667549,
0.08144569396972656,
0.03692576289176941,
-0.030899200588464737,
0.021545834839344025,
0.02145874686539173,
-0.04058350622653961,
0.017025912180542946,
0.05629437416791916,
0.07040280103683472,
0.00038836279418319464,
0.05249729007482529,
-0.004341389983892441,
0.031177885830402374,
-0.028112350031733513,
-0.06911388039588928,
0.02529066428542137,
-0.0010232964996248484,
-0.007685610093176365,
0.0048508611507713795,
0.008896147832274437,
-0.006022208835929632,
0.04493795707821846,
-0.02962770126760006,
-0.03037666715681553,
-0.027694322168827057,
0.04741128906607628,
-0.0026387986727058887,
-0.0770564079284668,
0.0033551063388586044,
-0.027572399005293846,
-0.05096452310681343,
-0.027589816600084305,
-0.0466449037194252,
0.08478991687297821,
0.04305683448910713,
0.0057086884044110775,
0.05420423671603203,
0.02628348022699356,
-0.020326588302850723,
-0.028687138110399246,
-0.03086436539888382,
-0.03231004253029823,
-0.004624429624527693,
0.027624651789665222,
0.030167652294039726,
-0.05284564569592476,
-0.013228829018771648,
-0.012114088982343674,
-0.0222077127546072,
0.04121054708957672,
0.007359025999903679,
-0.007885915227234364,
-0.06709341704845428,
0.029470939189195633,
0.013307209126651287,
0.030167652294039726,
0.02248639613389969,
-0.01660788431763649,
0.013176575303077698,
0.05075550824403763,
-0.07190073281526566,
0.03762247785925865,
0.023548884317278862,
-0.031317226588726044,
-0.05761812627315521,
-0.02727629616856575,
-0.018793821334838867,
-0.006914871744811535,
0.00956237968057394,
0.02273024618625641,
0.050441987812519073,
0.008216853253543377,
0.02468104101717472,
0.00876986887305975,
0.06374919414520264,
0.010006533935666084,
-0.007224038243293762,
0.00802090298384428,
0.017835840582847595,
-0.014543874189257622,
0.015449600294232368,
-0.03330285847187042,
0.04789898544549942,
0.004515568260103464,
0.01598084345459938,
0.0039146533235907555,
-0.007881560362875462,
-0.04305683448910713,
-0.021023301407694817,
0.0017352496506646276,
-0.0565730556845665,
0.021580670028924942,
-0.05451775714755058,
0.024019164964556694,
0.015345093794167042,
-0.02469845861196518,
0.0057522328570485115,
-0.020831704139709473,
-0.009849773719906807,
0.005608535837382078,
-0.03849336877465248,
0.03678642213344574,
-0.02914000116288662,
-0.001350969192571938
]
|
36,381 | statistics | mode | Return the most common data point from discrete or nominal data.
``mode`` assumes discrete data, and returns a single value. This is the
standard treatment of the mode as commonly taught in schools:
>>> mode([1, 1, 2, 3, 3, 3, 3, 4])
3
This also works with nominal (non-numeric) data:
>>> mode(["red", "blue", "blue", "red", "green", "red", "red"])
'red'
If there are multiple modes with same frequency, return the first one
encountered:
>>> mode(['red', 'red', 'green', 'blue', 'blue'])
'red'
If *data* is empty, ``mode``, raises StatisticsError.
| def mode(data):
"""Return the most common data point from discrete or nominal data.
``mode`` assumes discrete data, and returns a single value. This is the
standard treatment of the mode as commonly taught in schools:
>>> mode([1, 1, 2, 3, 3, 3, 3, 4])
3
This also works with nominal (non-numeric) data:
>>> mode(["red", "blue", "blue", "red", "green", "red", "red"])
'red'
If there are multiple modes with same frequency, return the first one
encountered:
>>> mode(['red', 'red', 'green', 'blue', 'blue'])
'red'
If *data* is empty, ``mode``, raises StatisticsError.
"""
pairs = Counter(iter(data)).most_common(1)
try:
return pairs[0][0]
except IndexError:
raise StatisticsError('no mode for empty data') from None
| (data) | [
0.03486686199903488,
0.01174804475158453,
0.03193643316626549,
-0.007628771476447582,
0.10507436841726303,
0.005343210883438587,
0.059626370668411255,
-0.015283863991498947,
0.06948806345462799,
-0.0186003390699625,
-0.07071638852357864,
0.004566734191030264,
-0.030146587640047073,
-0.038218434900045395,
0.019126763567328453,
-0.012748251669108868,
-0.026408972218632698,
0.009914332069456577,
-0.03565650060772896,
0.03706029802560806,
0.05471307411789894,
0.05320398882031441,
-0.04337739571928978,
-0.05432702973484993,
0.012625419534742832,
0.029427140951156616,
0.015529529191553593,
-0.006176716648042202,
-0.041798122227191925,
-0.003318669041618705,
-0.06608384847640991,
0.005251086317002773,
-0.06131093204021454,
0.02767239138484001,
0.014546869322657585,
0.0012085833586752415,
0.016915779560804367,
0.0740504115819931,
-0.02590009570121765,
-0.04678160697221756,
-0.06720688939094543,
-0.052782848477363586,
-0.041201505810022354,
0.04607971012592316,
-0.04783445969223976,
0.006211811676621437,
0.04306153953075409,
0.015204899944365025,
-0.025215743109583855,
-0.02568952552974224,
-0.02905864454805851,
-0.0423947349190712,
-0.03702520579099655,
0.016117369756102562,
-0.03195397928357124,
0.04085055738687515,
-0.03553366661071777,
-0.03597235307097435,
-0.056222159415483475,
-0.005158962216228247,
0.017529942095279694,
0.0016132723540067673,
0.007813019677996635,
-0.032936640083789825,
-0.028409386053681374,
-0.012721930630505085,
0.006874229293316603,
0.0788935124874115,
-0.01786334440112114,
0.01630161888897419,
-0.03607764095067978,
-0.022478334605693817,
0.006018789019435644,
0.008800066076219082,
0.052396804094314575,
0.014046765863895416,
0.038604479283094406,
0.006396060343831778,
0.03560385853052139,
0.03186624124646187,
0.01282721571624279,
-0.012511360459029675,
0.07608591765165329,
-0.02360137365758419,
-0.05895956605672836,
-0.005211604759097099,
0.0479748398065567,
0.019512809813022614,
-0.048782020807266235,
-0.004213591106235981,
-0.022337954491376877,
0.011993709951639175,
0.038253527134656906,
0.028163721784949303,
-0.028023341670632362,
-0.007119894027709961,
-0.0338842049241066,
0.017986176535487175,
0.05895956605672836,
-0.05394098535180092,
-0.025847453624010086,
0.04211397469043732,
0.01988130621612072,
-0.02303985506296158,
-0.02725125290453434,
-0.005365144927054644,
0.027058228850364685,
0.08773744851350784,
-0.05029110610485077,
0.004421967547386885,
-0.07496287673711777,
-0.002682572463527322,
0.02912883274257183,
-0.0011340065393596888,
0.004808012396097183,
-0.000671739864628762,
-0.015327733010053635,
0.05043148621916771,
-0.03212945535778999,
0.006839134264737368,
-0.09461607038974762,
0.018372222781181335,
-0.01984621211886406,
-0.06190754473209381,
0.05418664962053299,
-0.03618292510509491,
0.034357987344264984,
-0.027882961556315422,
-0.04035922884941101,
0.052186235785484314,
0.05155452713370323,
0.005452882498502731,
0.025040268898010254,
0.017801929265260696,
0.026426520198583603,
-0.048746928572654724,
-0.0002699297619983554,
0.0027988245710730553,
-0.027479369193315506,
0.059415802359580994,
0.052396804094314575,
0.02498762682080269,
-0.028865620493888855,
0.03737615421414375,
0.05071224644780159,
-0.015090841799974442,
0.04400910437107086,
-0.018723171204328537,
0.04706236720085144,
0.017240408807992935,
0.017810702323913574,
0.021811529994010925,
0.05534478276968002,
-0.024303274229168892,
0.06103017181158066,
-0.04769407957792282,
-0.005711708217859268,
-0.048115216195583344,
-0.07103224098682404,
-0.05545007064938545,
0.004825559910386801,
0.037481438368558884,
-0.020934155210852623,
-0.005492364522069693,
0.04709746316075325,
0.049378637224435806,
-0.06432909518480301,
-0.004185076337307692,
0.056222159415483475,
-0.04411438852548599,
-0.0033011215273290873,
-0.03316475450992584,
-0.0035928485449403524,
0.006900550331920385,
-0.013204486109316349,
0.025987833738327026,
-0.05555535480380058,
0.0015014071250334382,
0.060082606971263885,
0.02116227336227894,
0.022741546854376793,
-0.05695915222167969,
-0.06787369400262833,
-0.004353970754891634,
-0.025812357664108276,
-0.00029446883127093315,
0.06134602427482605,
-0.037972766906023026,
0.007861275225877762,
0.007782311644405127,
-0.028514672070741653,
-0.055871207267045975,
-0.020811323076486588,
-0.011879650875926018,
0.0274618212133646,
-0.05773124098777771,
0.004228944890201092,
-0.03221719339489937,
0.05453759804368019,
0.010203865356743336,
-0.024197988212108612,
0.010458304546773434,
0.045693665742874146,
0.020109424367547035,
0.029620163142681122,
0.041692838072776794,
0.021109631285071373,
-0.009010636247694492,
-0.02346099354326725,
0.017135124653577805,
0.02749691717326641,
-0.034007035195827484,
0.048992592841386795,
0.08443852514028549,
0.05853842571377754,
0.04604461416602135,
0.018302032724022865,
-0.03125207871198654,
-0.025321029126644135,
0.01884600520133972,
-0.049413733184337616,
-0.0014685055939480662,
0.045588377863168716,
0.09587948769330978,
0.015634814277291298,
-0.0715937614440918,
0.014406489208340645,
0.03553366661071777,
0.021671149879693985,
0.02693539671599865,
0.006330257281661034,
-0.002985266735777259,
0.023724205791950226,
-0.027619749307632446,
0.016099821776151657,
-0.05029110610485077,
0.049168068915605545,
0.033726274967193604,
-0.08682498335838318,
0.005448495503515005,
-0.02023225650191307,
-0.004081984981894493,
0.025391217321157455,
0.02481215074658394,
-0.014617059379816055,
-0.028584862127900124,
0.018337126821279526,
-0.017266729846596718,
-0.01637180894613266,
-0.052221331745386124,
-0.016099821776151657,
-0.021530769765377045,
-0.02349608950316906,
-0.06436419486999512,
0.02040773071348667,
-0.12325356900691986,
-0.06282001733779907,
0.01428365707397461,
-0.0030247485265135765,
0.02182907797396183,
-0.024057608097791672,
0.06478533148765564,
-0.022583620622754097,
0.07257641851902008,
-0.020600752905011177,
-0.02339080348610878,
-0.02179398201406002,
-0.00834821816533804,
0.024777056649327278,
0.01195861492305994,
0.10444266349077225,
-0.024127798154950142,
0.027268799021840096,
-0.0067294626496732235,
-0.07566478103399277,
0.0007178020314313471,
0.026882754638791084,
-0.002430327469483018,
0.028549766167998314,
0.001709783566184342,
-0.022460786625742912,
-0.014529322274029255,
-0.0476238876581192,
-0.004983487073332071,
-0.04664123058319092,
0.033971939235925674,
-0.007891983725130558,
-0.093843974173069,
0.07001448422670364,
0.06103017181158066,
0.041096221655607224,
0.05190547555685043,
-0.030392253771424294,
0.06892654299736023,
-0.015187352895736694,
0.00583892734721303,
0.06517137587070465,
-0.025145553052425385,
0.06025807932019234,
0.006251293234527111,
0.004566734191030264,
-0.05801200121641159,
-0.0007528970018029213,
-0.0316205769777298,
-0.011625212617218494,
-0.04025394096970558,
0.0203375406563282,
-0.041236601769924164,
-0.009668666869401932,
0.02784786745905876,
0.03183114528656006,
0.017845798283815384,
0.02335570938885212,
0.05408136546611786,
-0.0695231556892395,
0.01658237725496292,
0.012449944391846657,
-0.04618499428033829,
0.006343417800962925,
0.02168869785964489,
0.008760584518313408,
-0.0027001199778169394,
0.04808012396097183,
-0.00791830476373434,
-0.01552075520157814,
0.01814410462975502,
-0.025215743109583855,
-0.04979977756738663,
0.0722956582903862,
0.0314626507461071,
-0.07917427271604538,
-0.0406750813126564,
0.00841840822249651,
0.04271059110760689,
-0.037727102637290955,
0.03242776170372963,
-0.00005158002386451699,
0.0022592393215745687,
0.03930637612938881,
0.0044526755809783936,
-0.013809874653816223,
0.025707073509693146,
-0.04751860350370407,
-0.02346099354326725,
0.0032046104315668344,
0.02377684973180294,
0.026005379855632782,
-0.008642138913273811,
0.07187452167272568,
-0.0019784795586019754,
-0.026566900312900543,
-0.034586101770401,
0.013458925299346447,
0.018337126821279526,
-0.013204486109316349,
-0.004393452778458595,
0.03156793490052223,
0.023513637483119965,
0.0027045069728046656,
-0.005202830769121647,
0.017214087769389153,
0.0039087035693228245,
0.014081860892474651,
-0.006834747269749641,
-0.04432496055960655,
0.017372015863656998,
-0.01758258417248726,
0.08991333842277527,
0.00907205231487751,
-0.05653801187872887,
-0.0238119438290596,
0.010686421766877174,
0.048641644418239594,
-0.007663866505026817,
0.008124487474560738,
0.0354459285736084,
0.014134502969682217,
-0.029111286625266075,
0.006957579869776964,
-0.03391929715871811,
-0.006773331202566624,
-0.023636469617486,
-0.041412077844142914,
-0.02002168633043766,
-0.056292347609996796,
0.03367363288998604,
-0.0695231556892395,
-0.012599097564816475,
-0.020688490942120552,
0.016810495406389236,
-0.027918057516217232,
-0.028128625825047493,
-0.028514672070741653,
-0.03114679455757141,
0.004702727310359478,
0.06843521445989609,
0.010572362691164017,
-0.000163822274771519,
-0.028216363862156868,
0.012397301383316517,
-0.04334229975938797,
0.045483093708753586,
0.020600752905011177,
0.005075611639767885,
-0.016275297850370407,
0.06145131215453148,
-0.017951082438230515,
-0.00410172576084733,
-0.018161652609705925,
-0.05113338679075241,
-0.03909580782055855,
0.04436005651950836,
-0.013669494539499283,
-0.014959235675632954,
0.02874278835952282,
-0.004514091648161411,
-0.002384265186265111,
0.04776426777243614,
0.018266936764121056,
-0.013871290720999241,
0.009344038553535938,
-0.01870562508702278,
-0.016450772061944008,
0.029216570779681206,
-0.020390182733535767,
-0.022636262699961662,
0.01956545189023018,
0.02481215074658394,
-0.01673153229057789,
0.038358815014362335,
-0.0890008732676506,
-0.027900509536266327,
-0.03709539398550987,
-0.09981012344360352,
-0.018916195258498192,
-0.019828664138913155,
-0.060328271239995956,
0.030778298154473305,
-0.03934147208929062,
-0.026321236044168472,
0.012292017228901386,
0.038288623094558716,
-0.01803882047533989,
0.049343541264534,
-0.013862517662346363,
-0.007624384481459856,
0.016275297850370407,
-0.005957372952252626,
-0.03632330521941185,
-0.012300790287554264,
-0.003208997193723917,
-0.030181683599948883,
-0.00417410908266902,
0.0028712081257253885,
0.02172379195690155,
-0.026321236044168472,
-0.0632762461900711,
0.04723784327507019,
0.06611894071102142,
-0.01949526183307171,
-0.016152463853359222,
0.020548110827803612,
-0.028479576110839844,
-0.03420005738735199,
-0.04278077930212021,
0.03477912396192551,
0.010870669968426228,
0.016749078407883644,
0.015924347564578056,
-0.017135124653577805,
0.019003931432962418,
0.027725035324692726,
-0.026093117892742157,
-0.0290235485881567,
-0.025215743109583855,
0.05541497468948364,
0.0038319332525134087,
-0.028619956225156784,
0.059731654822826385,
-0.006018789019435644,
0.06969863176345825,
0.006742623168975115,
0.0012985143112018704,
-0.06636460870504379,
0.003279187250882387,
-0.013748458586633205,
-0.04292115941643715,
0.00030132330721244216,
-0.012204279191792011,
0.0015036005061119795,
0.030567727982997894,
0.0018468733178451657,
-0.010765384882688522,
0.007115507032722235,
0.01655605621635914,
0.04765898361802101,
0.0357968807220459,
-0.006839134264737368,
-0.02307494916021824,
0.007852502167224884,
0.03716558590531349,
-0.00799288135021925,
-0.04685179889202118,
-0.07327831536531448,
-0.02735653705894947,
0.006558374501764774,
-0.022601166740059853,
-0.017450978979468346,
0.024566486477851868,
-0.00893167220056057,
0.008111326955258846,
-0.03472648188471794,
0.045623473823070526,
-0.02335570938885212,
0.0538707934319973,
0.00548359053209424,
0.0615215003490448,
-0.05478326231241226,
-0.04320191964507103,
0.04678160697221756,
-0.02874278835952282,
-0.029830733314156532,
-0.005632744170725346,
0.08289434015750885,
-0.03885014355182648,
0.019337333738803864,
-0.026005379855632782,
-0.02718106284737587,
-0.006251293234527111,
0.04071017727255821,
-0.013257129117846489,
0.018688077107071877,
-0.013318545185029507,
0.08015693724155426,
0.0011427802965044975,
-0.044956669211387634,
-0.01771419122815132,
-0.008637752383947372,
0.05541497468948364,
0.045798949897289276,
-0.028479576110839844,
-0.0604686513543129,
0.059907130897045135,
0.02863750420510769,
0.0635921061038971,
-0.03570914268493652,
0.020653394982218742,
-0.006922484841197729,
-0.005365144927054644,
-0.0046193767338991165,
-0.00024922919692471623,
-0.016520962119102478,
-0.009537060745060444,
-0.03314720839262009,
-0.004540413152426481,
-0.001917063258588314,
0.04776426777243614,
0.022390596568584442,
0.013283450156450272,
-0.04253511503338814,
-0.06071431562304497,
-0.002673798706382513,
0.02516310103237629,
0.015125936828553677,
0.06913711130619049,
-0.06134602427482605,
-0.00037535178125835955,
0.0050887721590697765,
-0.03495460003614426,
-0.021320199593901634,
0.012195505201816559,
0.03699010983109474,
-0.004869428463280201,
-0.03148019686341286,
0.021565865725278854,
0.0660487562417984,
0.0082560945302248,
-0.03607764095067978,
0.019232049584388733,
0.02144303359091282,
-0.07966560870409012,
0.0006262260721996427,
-0.003779290709644556,
-0.021776435896754265,
0.00039262507925741374,
0.05450250580906868,
0.004042502958327532,
0.034112319350242615,
-0.017696643248200417,
0.000038693586247973144,
-0.009484418667852879,
-0.02597028575837612,
0.056222159415483475,
-0.045097049325704575,
0.0006147105013951659,
0.045798949897289276,
-0.0016527542611584067,
-0.016363034024834633,
0.032550595700740814,
0.03555121645331383,
-0.025671977549791336,
-0.007409427780658007,
-0.03628820925951004,
-0.008378926664590836,
0.03537574037909508,
-0.03274361789226532,
-0.041517361998558044,
0.06120564416050911,
0.02777767740190029,
0.0010802673641592264,
-0.02384703978896141,
0.027268799021840096,
-0.02835674397647381,
-0.018881099298596382,
0.03314720839262009,
0.023127591237425804,
0.009080826304852962,
-0.03218209743499756,
-0.023618921637535095,
0.022373050451278687,
0.03312966227531433,
0.010572362691164017,
0.024794602766633034,
-0.009203658439218998,
0.015196126885712147,
0.08212225139141083,
-0.03709539398550987,
-0.00912469532340765,
-0.030567727982997894,
-0.018512602895498276,
-0.014152050949633121,
0.019144311547279358,
-0.015231220982968807,
-0.03667425364255905,
-0.01380110066384077,
0.05043148621916771,
-0.017178993672132492,
0.03339287266135216,
-0.0017240409506484866,
0.03906071186065674,
-0.020969251170754433,
0.05499383434653282,
0.0809992179274559,
-0.0253736712038517,
-0.0022899473551660776,
-0.020530562847852707,
0.005246699322015047,
0.027444275096058846,
0.02172379195690155,
-0.027900509536266327,
-0.013537888415157795,
-0.03899052366614342,
0.031129246577620506,
0.0010906861862167716,
0.07096204906702042,
-0.02388213388621807,
0.04292115941643715,
-0.0323224775493145,
-0.020758680999279022,
-0.038464099168777466,
-0.009642345830798149,
-0.008177130483090878,
0.049027688801288605,
-0.01247626543045044,
-0.04723784327507019,
0.003972312901169062,
-0.007146215531975031,
-0.01984621211886406,
0.0028580473735928535,
-0.021004345268011093,
0.027303894981741905,
0.06183735653758049,
0.06650498509407043,
0.004264039918780327,
-0.01800372451543808,
0.010607457719743252,
-0.005452882498502731,
0.01658237725496292,
-0.02349608950316906,
-0.010519720613956451,
0.0882989689707756,
0.020635848864912987,
0.01970583200454712,
-0.041482266038656235,
0.04604461416602135,
0.02835674397647381,
-0.026233498007059097,
0.00602317601442337,
-0.03867466747760773,
-0.05488855019211769,
-0.020548110827803612,
-0.03600744903087616,
0.034112319350242615,
-0.08766726404428482,
-0.048852212727069855,
-0.010159996338188648,
-0.04671141877770424,
0.09124694764614105,
0.022127384319901466,
0.0031168728601187468,
-0.014871497638523579,
0.01473989151418209,
0.041657742112874985,
-0.024619128555059433,
-0.0022570458240807056,
0.027128418907523155,
-0.0705409124493599,
0.02098679728806019,
0.012555229477584362,
-0.011616438627243042,
-0.03239266574382782,
0.019284691661596298,
-0.032445307821035385,
0.02395232394337654,
-0.04260530695319176,
0.005207217764109373,
-0.0671016052365303,
0.04681670293211937,
-0.04650085046887398,
0.05046658217906952,
-0.015231220982968807,
0.02123246341943741,
0.04976468160748482,
0.021320199593901634,
0.007677027024328709,
0.023829491809010506,
0.0729975625872612,
0.01176559180021286,
-0.0011570376809686422,
-0.07166395336389542,
-0.05373041331768036,
-0.045588377863168716,
-0.059872034937143326,
0.03688482567667961,
0.016591152176260948,
0.041341885924339294,
0.04432496055960655,
-0.05888937786221504,
0.022794188931584358,
0.0016308198682963848,
-0.021565865725278854,
0.012186732143163681,
0.0009815627709031105,
0.041692838072776794,
-0.028795430436730385,
-0.033866655081510544,
-0.003544592997059226,
-0.0042508793994784355,
-0.017915988340973854,
-0.021320199593901634,
-0.006049497053027153,
-0.04386872425675392,
0.03570914268493652,
-0.004301328677684069,
-0.06517137587070465,
0.034533459693193436,
-0.0368497297167778,
-0.01977602206170559,
0.029760543256998062,
0.00006782515993108973,
-0.008655299432575703,
-0.0507473424077034,
0.009019410237669945,
0.008563174866139889,
-0.07243604212999344,
0.027093324810266495,
0.015257542952895164,
-0.041341885924339294
]
|
36,382 | statistics | multimode | Return a list of the most frequently occurring values.
Will return more than one result if there are multiple modes
or an empty list if *data* is empty.
>>> multimode('aabbbbbbbbcc')
['b']
>>> multimode('aabbbbccddddeeffffgg')
['b', 'd', 'f']
>>> multimode('')
[]
| def multimode(data):
"""Return a list of the most frequently occurring values.
Will return more than one result if there are multiple modes
or an empty list if *data* is empty.
>>> multimode('aabbbbbbbbcc')
['b']
>>> multimode('aabbbbccddddeeffffgg')
['b', 'd', 'f']
>>> multimode('')
[]
"""
counts = Counter(iter(data)).most_common()
maxcount, mode_items = next(groupby(counts, key=itemgetter(1)), (0, []))
return list(map(itemgetter(0), mode_items))
| (data) | [
0.05581855773925781,
0.026033466681838036,
0.005132186692208052,
-0.04586097598075867,
0.08744440227746964,
0.03674488142132759,
0.03681500256061554,
-0.06430353969335556,
0.06963294744491577,
-0.027067793533205986,
-0.043126147240400314,
0.030889540910720825,
-0.043967634439468384,
-0.04389750957489014,
0.03485153615474701,
-0.045545417815446854,
-0.0441429428756237,
-0.013744267635047436,
-0.003420727327466011,
0.045264922082424164,
0.06374254822731018,
0.05066445842385292,
-0.03243226557970047,
0.03441326320171356,
0.005596756935119629,
0.03972514346241951,
0.003063534153625369,
-0.014007232151925564,
-0.030135709792375565,
0.036218952387571335,
-0.053890153765678406,
0.03828760236501694,
-0.05346940830349922,
0.0035083822440356016,
0.0010009078541770577,
0.0006908291834406555,
0.03727080672979355,
0.04926197975873947,
-0.06128821521997452,
-0.01823219284415245,
-0.03280041366815567,
-0.07706607133150101,
0.0040978603065013885,
0.014594519510865211,
-0.033028315752744675,
-0.023386292159557343,
0.03804216906428337,
0.02878582663834095,
-0.00427974434569478,
-0.03681500256061554,
-0.005289965309202671,
-0.03923427686095238,
-0.04712320491671562,
0.03020583465695381,
-0.03395745903253555,
0.04529998451471329,
-0.027050262317061424,
-0.04382738471031189,
-0.011395120061933994,
0.001004194957204163,
-0.050804704427719116,
-0.00831843726336956,
0.023140858858823776,
-0.04214441403746605,
-0.014489333145320415,
-0.03029348887503147,
-0.005338175687938929,
0.05662498250603676,
-0.03632413595914841,
0.008296524174511433,
-0.06518008559942245,
-0.022685054689645767,
0.005132186692208052,
0.01013289112597704,
0.018740590661764145,
-0.0026099206879734993,
0.014506864361464977,
0.021089738234877586,
0.006946640554815531,
0.024157654494047165,
0.01270994171500206,
0.02466605231165886,
0.05252273753285408,
-0.00026310127577744424,
-0.060131173580884933,
0.008796156384050846,
0.0956488847732544,
0.05690547823905945,
-0.010062768124043941,
-0.015129213221371174,
-0.03842785209417343,
0.0036376728676259518,
0.051926687359809875,
0.04898148402571678,
-0.05441608279943466,
0.0043827383778989315,
-0.07001863420009613,
0.018582811579108238,
0.02186110056936741,
-0.03604364022612572,
-0.039023902267217636,
0.04586097598075867,
0.030907072126865387,
-0.07107048481702805,
-0.022457152605056763,
-0.01266611460596323,
-0.022369496524333954,
0.03776167333126068,
-0.02738334983587265,
-0.015497363172471523,
-0.03558783605694771,
-0.0037406673654913902,
0.008401709608733654,
0.009405356831848621,
0.011377588845789433,
0.04410788044333458,
-0.014401678927242756,
0.016961198300123215,
0.0031752940267324448,
-0.033519186079502106,
-0.06072722375392914,
0.006197192240506411,
-0.0007620486430823803,
-0.03202905133366585,
0.030311020091176033,
0.012745003215968609,
0.043231334537267685,
-0.010991908609867096,
-0.03339646756649017,
0.08919749408960342,
0.04712320491671562,
0.022842833772301674,
0.024332964792847633,
0.04887630045413971,
-0.006056944839656353,
-0.05851832404732704,
0.012438211590051651,
-0.03765648975968361,
-0.0069334921427071095,
0.028522862121462822,
-0.004676382057368755,
0.009826099500060081,
-0.013305993750691414,
0.08737427741289139,
0.02496407926082611,
-0.027120385318994522,
0.04375725984573364,
-0.003127083880826831,
0.030170772224664688,
-0.00576768396422267,
0.015874279662966728,
0.0590442530810833,
0.017267988994717598,
-0.02917150780558586,
0.07201716303825378,
-0.027050262317061424,
-0.01275376882404089,
-0.019284049049019814,
-0.019511951133608818,
-0.042670343071222305,
0.010325731709599495,
0.06241019815206528,
-0.06437366455793381,
0.004054033197462559,
0.04498443007469177,
0.027260633185505867,
-0.033589307218790054,
-0.01577785797417164,
0.022772708907723427,
0.04260021820664406,
0.020616402849555016,
-0.05059433355927467,
-0.042670343071222305,
-0.030311020091176033,
-0.013647847808897495,
0.0062848469242453575,
-0.05171631649136543,
0.014489333145320415,
0.06703837215900421,
0.018582811579108238,
-0.038357727229595184,
-0.03544759005308151,
-0.0730690136551857,
-0.00102830003015697,
-0.003931316547095776,
0.026138652116060257,
0.06493465602397919,
-0.025104327127337456,
0.020809242501854897,
-0.021826038137078285,
-0.03094213455915451,
-0.08050214499235153,
-0.05325903743505478,
-0.03413276746869087,
0.020581340417265892,
-0.0413379892706871,
0.0033834741916507483,
-0.034641165286302567,
0.04063675180077553,
-0.0034930426627397537,
-0.02505173347890377,
-0.027260633185505867,
0.02811964973807335,
-0.0017169378697872162,
0.05774696171283722,
0.016216132789850235,
-0.009405356831848621,
0.0018977257423102856,
0.010036471299827099,
-0.005587991792708635,
0.03842785209417343,
-0.01234179176390171,
0.03727080672979355,
0.07089518010616302,
0.046597275882959366,
0.0077574471943080425,
0.017040086910128593,
0.016128478571772575,
-0.014734767377376556,
-0.028242366388440132,
-0.01711897738277912,
0.019739855080842972,
-0.007748681586235762,
0.09494765102863312,
0.00010244651639368385,
-0.03849797695875168,
0.023351231589913368,
0.047999750822782516,
0.008349116891622543,
0.03972514346241951,
0.0039028285536915064,
0.02356160245835781,
0.029855214059352875,
-0.007170160301029682,
-0.03607870265841484,
-0.03066163882613182,
0.03404511138796806,
0.035096969455480576,
-0.056484732776880264,
-0.012604756280779839,
0.008046708069741726,
-0.028838420286774635,
0.01877565123140812,
0.04274046793580055,
-0.017627375200390816,
-0.02850533090531826,
0.013016733340919018,
-0.008984614163637161,
0.01606711931526661,
-0.03401005268096924,
-0.022772708907723427,
-0.011710677295923233,
-0.007932757027447224,
-0.053329162299633026,
0.05273310840129852,
-0.09571900963783264,
-0.08681328594684601,
0.011053266935050488,
0.012578459456562996,
-0.011894752271473408,
0.013533896766602993,
0.055292628705501556,
0.012648583389818668,
0.0814838781952858,
-0.019932694733142853,
-0.008064239285886288,
0.013227105140686035,
0.004301657900214195,
-0.016698233783245087,
0.014568222686648369,
0.02683989144861698,
-0.07959052920341492,
-0.0016774932155385613,
0.007336704526096582,
-0.08793526887893677,
-0.0019404574995860457,
0.02009047381579876,
0.016593048349022865,
0.000550855475012213,
-0.019511951133608818,
-0.04316120967268944,
0.021843569353222847,
-0.014813655987381935,
-0.03392239660024643,
-0.04582591354846954,
0.026874952018260956,
0.0019032042473554611,
-0.07156135141849518,
0.05925462394952774,
0.02952212654054165,
0.05027877539396286,
0.027698908001184464,
-0.06374254822731018,
0.03597351908683777,
0.009948816150426865,
-0.034921661019325256,
0.05869363620877266,
-0.0017804874805733562,
0.06142846494913101,
-0.020230721682310104,
-0.02785668522119522,
-0.05448620393872261,
-0.005329410079866648,
-0.040321193635463715,
0.0023359996266663074,
-0.022211719304323196,
-0.010150422342121601,
-0.021563073620200157,
-0.012701176106929779,
0.033589307218790054,
0.02235196717083454,
0.04242490977048874,
0.002447759499773383,
0.03155571594834328,
-0.05420571193099022,
0.040321193635463715,
0.015120447613298893,
0.013525131158530712,
-0.020160596817731857,
0.017504658550024033,
0.03202905133366585,
-0.014682173728942871,
0.004965642932802439,
0.012464508414268494,
-0.04999827966094017,
0.000820667773950845,
0.007183308247476816,
-0.07552334666252136,
0.04477405548095703,
0.012245371006429195,
-0.04831530898809433,
-0.023210983723402023,
-0.01341118011623621,
0.019950225949287415,
0.0005796171608380973,
0.018670465797185898,
0.012490805238485336,
-0.012885251082479954,
0.026033466681838036,
-0.023246044293045998,
0.002340382430702448,
0.0032717143185436726,
-0.03888365626335144,
-0.013016733340919018,
-0.011132155545055866,
0.03401005268096924,
-0.0016270916676148772,
0.003795451484620571,
0.057992395013570786,
-0.006236637011170387,
0.015120447613298893,
-0.046492088586091995,
0.0029145211447030306,
0.035833269357681274,
0.016032056882977486,
0.005018235649913549,
0.001934979110956192,
0.006170895881950855,
-0.003642055671662092,
0.03290560096502304,
0.03074929304420948,
0.021440356969833374,
0.021528011187911034,
-0.0016950240824371576,
-0.01191228348761797,
-0.021352702751755714,
-0.008774242363870144,
0.07510260492563248,
0.001299481955356896,
-0.04449355974793434,
-0.011132155545055866,
0.012823892757296562,
0.06770454347133636,
-0.03497425466775894,
0.01570773497223854,
0.014094887301325798,
-0.013717971742153168,
-0.006946640554815531,
-0.017066383734345436,
0.010194249451160431,
-0.032554980367422104,
-0.08898711949586868,
0.0133585873991251,
-0.044072818011045456,
-0.047894567251205444,
0.05953511968255043,
-0.047158267349004745,
0.0074725691229105,
-0.014296493493020535,
0.04056662693619728,
-0.029574720188975334,
-0.014278962276875973,
-0.05318891629576683,
-0.04189898073673248,
0.013761798851191998,
0.0744013711810112,
0.023964814841747284,
0.022124063223600388,
0.004034311044961214,
0.012122654356062412,
-0.024438150227069855,
0.013866984285414219,
0.007577755022794008,
0.0024368027225136757,
-0.020686525851488113,
0.06402304768562317,
-0.01050980668514967,
-0.011728208512067795,
-0.014436740428209305,
-0.07001863420009613,
-0.014287727884948254,
-0.0069334921427071095,
0.04821012541651726,
-0.028382614254951477,
0.014708470553159714,
-0.06784479320049286,
0.025612723082304,
0.05487188696861267,
0.02419271692633629,
0.01542723923921585,
0.03437820076942444,
0.011991173028945923,
-0.004001440480351448,
0.016698233783245087,
-0.01580415479838848,
-0.001988667529076338,
0.0337996780872345,
0.0441429428756237,
-0.04498443007469177,
0.035657960921525955,
-0.06339193135499954,
-0.007200839463621378,
-0.016619345173239708,
-0.09613975137472153,
-0.022492215037345886,
-0.0305564533919096,
-0.05431089550256729,
0.0030766823329031467,
-0.0441429428756237,
-0.020721588283777237,
-0.004306040704250336,
0.012105124071240425,
-0.015251929871737957,
0.04217947646975517,
0.04950741305947304,
-0.00652151508256793,
-0.0009554370190016925,
0.059394873678684235,
0.02026578225195408,
0.010325731709599495,
-0.019406765699386597,
-0.025752970948815346,
-0.03877846896648407,
0.00924757868051529,
0.07201716303825378,
0.025665316730737686,
-0.059009190648794174,
0.06956282258033752,
0.05974549055099487,
-0.03562289848923683,
0.03692018985748291,
0.025752970948815346,
-0.022018877789378166,
-0.01814453676342964,
-0.042214538902044296,
0.044633809477090836,
-0.016496628522872925,
0.0067669483833014965,
0.028452739119529724,
0.009002145379781723,
-0.00731040770187974,
0.03635919839143753,
-0.019108740612864494,
-0.06640725582838058,
0.01457698829472065,
0.02980262227356434,
-0.010255607776343822,
-0.03271276131272316,
0.033887334167957306,
-0.028189774602651596,
0.05385509133338928,
-0.00037746335146948695,
-0.020984552800655365,
-0.06500478088855743,
-0.03692018985748291,
-0.08071251213550568,
-0.00427974434569478,
-0.04992815852165222,
-0.0033506036270409822,
-0.021089738234877586,
-0.0013542661909013987,
0.015681438148021698,
0.006289229728281498,
0.027120385318994522,
0.061253152787685394,
0.048455558717250824,
0.003061342751607299,
-0.009843630716204643,
-0.0008310768171213567,
0.050138529390096664,
0.03849797695875168,
0.007288494147360325,
-0.026331493631005287,
-0.03113497421145439,
-0.005741387605667114,
0.04459874704480171,
-0.02917150780558586,
-0.046772584319114685,
0.009966347366571426,
-0.043967634439468384,
-0.030030524358153343,
-0.06381267309188843,
0.005390768405050039,
0.003788877511397004,
0.011237341910600662,
-0.016032056882977486,
0.033028315752744675,
-0.07608433812856674,
-0.029399409890174866,
0.044809117913246155,
-0.02962731197476387,
-0.005653732921928167,
-0.02868064120411873,
0.050980012863874435,
-0.020774180069565773,
0.01265734899789095,
-0.03828760236501694,
-0.040321193635463715,
-0.005745770409703255,
0.040601689368486404,
-0.0035083822440356016,
-0.011430182494223118,
-0.011360058560967445,
0.08365771174430847,
-0.011351292952895164,
-0.05399533733725548,
0.021002082154154778,
0.03541252762079239,
0.0955086350440979,
0.024823831394314766,
-0.013297229073941708,
-0.028908543288707733,
0.03460610285401344,
0.027593722566962242,
0.01635638065636158,
0.00897584855556488,
0.009159923531115055,
0.020125536248087883,
0.0057895975187420845,
-0.011929814703762531,
-0.020423561334609985,
-0.005526633467525244,
-0.037340931594371796,
-0.07194703817367554,
-0.003913785330951214,
-0.01954701356589794,
0.09740198403596878,
0.003381282789632678,
0.01265734899789095,
-0.04130292683839798,
-0.01682095043361187,
-0.004851691424846649,
-0.04505455121397972,
0.022124063223600388,
0.05087482929229736,
-0.03681500256061554,
0.01578662358224392,
0.03271276131272316,
-0.000967489555478096,
0.020686525851488113,
0.013577723875641823,
-0.013700440526008606,
0.016943667083978653,
-0.05087482929229736,
0.043967634439468384,
0.03898884356021881,
-0.0014035720378160477,
-0.06437366455793381,
0.022948019206523895,
-0.00020544086873997003,
-0.05413558706641197,
0.022597400471568108,
0.017530953511595726,
-0.01879318244755268,
0.03965501859784126,
0.04964766278862953,
0.03895378112792969,
0.03036361187696457,
-0.027523597702383995,
0.007810039911419153,
0.03367696329951286,
-0.01756601594388485,
0.06475934386253357,
-0.04018094763159752,
-0.03157324716448784,
0.02421024814248085,
-0.0004421087505761534,
0.023982346057891846,
-0.012972906231880188,
0.0330633781850338,
-0.02917150780558586,
0.008682205341756344,
-0.041548360139131546,
-0.0007242475403472781,
0.02045862376689911,
-0.04680764675140381,
-0.01453316118568182,
0.07201716303825378,
0.0045010726898908615,
0.026050997897982597,
-0.026471741497516632,
0.0450194887816906,
0.002892607357352972,
-0.00614898232743144,
0.017688732594251633,
0.03222189471125603,
-0.017811449244618416,
-0.00203139940276742,
-0.008366648107767105,
-0.02168579027056694,
0.00977350678294897,
0.01718033477663994,
0.02570037916302681,
0.0017377558397129178,
0.005780831910669804,
0.056309424340724945,
-0.06875640153884888,
0.0030284724198281765,
-0.024455681443214417,
-0.010238077491521835,
0.019950225949287415,
0.016514157876372337,
0.027646314352750778,
-0.002664705039933324,
-0.014717236161231995,
0.02973249740898609,
-0.04498443007469177,
0.013367352075874805,
-0.04785950481891632,
0.025454945862293243,
-0.06717861443758011,
0.037516240030527115,
0.07938016206026077,
-0.05750152841210365,
-0.013148215599358082,
-0.02952212654054165,
0.009869927540421486,
0.035184625536203384,
0.004008014220744371,
-0.027733968570828438,
-0.018950961530208588,
-0.010921784676611423,
0.06963294744491577,
-0.009887457825243473,
0.06016623601317406,
-0.03783179819583893,
0.06234007328748703,
-0.0238420981913805,
-0.03253744915127754,
-0.02736581861972809,
0.0001984558766707778,
-0.013393648900091648,
0.04189898073673248,
0.003869958221912384,
-0.021177392452955246,
-0.02319345250725746,
-0.005035766400396824,
0.01346377283334732,
0.035096969455480576,
-0.005706325639039278,
0.05950005725026131,
0.06223488599061966,
0.06721367686986923,
0.012026234529912472,
-0.02580556459724903,
0.048560742288827896,
-0.005890400614589453,
0.007078122813254595,
0.011070797219872475,
-0.002039069077000022,
0.05147087946534157,
0.0023009376600384712,
0.04063675180077553,
-0.03290560096502304,
0.02738334983587265,
-0.026419147849082947,
-0.011438947170972824,
0.02833002246916294,
-0.019774915650486946,
-0.07727644592523575,
-0.009501777589321136,
-0.042565155774354935,
0.03983032703399658,
-0.09059996902942657,
-0.03737599402666092,
0.05336422473192215,
-0.028540393337607384,
0.10679857432842255,
0.04999827966094017,
-0.001056239940226078,
-0.03385227173566818,
0.03101225756108761,
0.024332964792847633,
-0.03001299314200878,
0.014875014312565327,
0.012508335523307323,
-0.06728380173444748,
0.008826835080981255,
-0.00539515120908618,
-0.033308811485767365,
-0.0058553386479616165,
0.052662987262010574,
-0.05946499481797218,
0.014883779920637608,
-0.04729851335287094,
-0.0308544784784317,
-0.02017812803387642,
0.04316120967268944,
-0.017811449244618416,
0.04698295518755913,
-0.006981702521443367,
0.05848326161503792,
0.021896161139011383,
0.0025901985354721546,
-0.01803935132920742,
0.05213705822825432,
0.03131028264760971,
0.0330633781850338,
0.0009817334357649088,
-0.08183449506759644,
-0.032397203147411346,
-0.031538184732198715,
-0.0534343495965004,
0.01606711931526661,
0.022036409005522728,
-0.006070092786103487,
0.05083976686000824,
-0.0898987352848053,
0.005680029280483723,
-0.0055923741310834885,
-0.024543335661292076,
-0.019108740612864494,
0.03937452286481857,
0.10679857432842255,
-0.07285864651203156,
-0.04950741305947304,
0.03222189471125603,
0.010010174475610256,
-0.033028315752744675,
-0.042214538902044296,
-0.03194139897823334,
-0.0334315299987793,
0.021247517317533493,
-0.035570304840803146,
-0.03485153615474701,
0.0603766068816185,
-0.004148262087255716,
-0.0618492066860199,
0.0014890354359522462,
-0.005114655941724777,
0.0007905364618636668,
-0.05438102036714554,
0.01765367016196251,
0.018758120015263557,
-0.09319455176591873,
0.022632461041212082,
0.005316261667758226,
-0.042004164308309555
]
|
36,383 | collections | namedtuple | Returns a new subclass of tuple with named fields.
>>> Point = namedtuple('Point', ['x', 'y'])
>>> Point.__doc__ # docstring for the new class
'Point(x, y)'
>>> p = Point(11, y=22) # instantiate with positional args or keywords
>>> p[0] + p[1] # indexable like a plain tuple
33
>>> x, y = p # unpack like a regular tuple
>>> x, y
(11, 22)
>>> p.x + p.y # fields also accessible by name
33
>>> d = p._asdict() # convert to a dictionary
>>> d['x']
11
>>> Point(**d) # convert from a dictionary
Point(x=11, y=22)
>>> p._replace(x=100) # _replace() is like str.replace() but targets named fields
Point(x=100, y=22)
| def namedtuple(typename, field_names, *, rename=False, defaults=None, module=None):
"""Returns a new subclass of tuple with named fields.
>>> Point = namedtuple('Point', ['x', 'y'])
>>> Point.__doc__ # docstring for the new class
'Point(x, y)'
>>> p = Point(11, y=22) # instantiate with positional args or keywords
>>> p[0] + p[1] # indexable like a plain tuple
33
>>> x, y = p # unpack like a regular tuple
>>> x, y
(11, 22)
>>> p.x + p.y # fields also accessible by name
33
>>> d = p._asdict() # convert to a dictionary
>>> d['x']
11
>>> Point(**d) # convert from a dictionary
Point(x=11, y=22)
>>> p._replace(x=100) # _replace() is like str.replace() but targets named fields
Point(x=100, y=22)
"""
# Validate the field names. At the user's option, either generate an error
# message or automatically replace the field name with a valid name.
if isinstance(field_names, str):
field_names = field_names.replace(',', ' ').split()
field_names = list(map(str, field_names))
typename = _sys.intern(str(typename))
if rename:
seen = set()
for index, name in enumerate(field_names):
if (not name.isidentifier()
or _iskeyword(name)
or name.startswith('_')
or name in seen):
field_names[index] = f'_{index}'
seen.add(name)
for name in [typename] + field_names:
if type(name) is not str:
raise TypeError('Type names and field names must be strings')
if not name.isidentifier():
raise ValueError('Type names and field names must be valid '
f'identifiers: {name!r}')
if _iskeyword(name):
raise ValueError('Type names and field names cannot be a '
f'keyword: {name!r}')
seen = set()
for name in field_names:
if name.startswith('_') and not rename:
raise ValueError('Field names cannot start with an underscore: '
f'{name!r}')
if name in seen:
raise ValueError(f'Encountered duplicate field name: {name!r}')
seen.add(name)
field_defaults = {}
if defaults is not None:
defaults = tuple(defaults)
if len(defaults) > len(field_names):
raise TypeError('Got more default values than field names')
field_defaults = dict(reversed(list(zip(reversed(field_names),
reversed(defaults)))))
# Variables used in the methods and docstrings
field_names = tuple(map(_sys.intern, field_names))
num_fields = len(field_names)
arg_list = ', '.join(field_names)
if num_fields == 1:
arg_list += ','
repr_fmt = '(' + ', '.join(f'{name}=%r' for name in field_names) + ')'
tuple_new = tuple.__new__
_dict, _tuple, _len, _map, _zip = dict, tuple, len, map, zip
# Create all the named tuple methods to be added to the class namespace
namespace = {
'_tuple_new': tuple_new,
'__builtins__': {},
'__name__': f'namedtuple_{typename}',
}
code = f'lambda _cls, {arg_list}: _tuple_new(_cls, ({arg_list}))'
__new__ = eval(code, namespace)
__new__.__name__ = '__new__'
__new__.__doc__ = f'Create new instance of {typename}({arg_list})'
if defaults is not None:
__new__.__defaults__ = defaults
@classmethod
def _make(cls, iterable):
result = tuple_new(cls, iterable)
if _len(result) != num_fields:
raise TypeError(f'Expected {num_fields} arguments, got {len(result)}')
return result
_make.__func__.__doc__ = (f'Make a new {typename} object from a sequence '
'or iterable')
def _replace(self, /, **kwds):
result = self._make(_map(kwds.pop, field_names, self))
if kwds:
raise ValueError(f'Got unexpected field names: {list(kwds)!r}')
return result
_replace.__doc__ = (f'Return a new {typename} object replacing specified '
'fields with new values')
def __repr__(self):
'Return a nicely formatted representation string'
return self.__class__.__name__ + repr_fmt % self
def _asdict(self):
'Return a new dict which maps field names to their values.'
return _dict(_zip(self._fields, self))
def __getnewargs__(self):
'Return self as a plain tuple. Used by copy and pickle.'
return _tuple(self)
# Modify function metadata to help with introspection and debugging
for method in (
__new__,
_make.__func__,
_replace,
__repr__,
_asdict,
__getnewargs__,
):
method.__qualname__ = f'{typename}.{method.__name__}'
# Build-up the class namespace dictionary
# and use type() to build the result class
class_namespace = {
'__doc__': f'{typename}({arg_list})',
'__slots__': (),
'_fields': field_names,
'_field_defaults': field_defaults,
'__new__': __new__,
'_make': _make,
'_replace': _replace,
'__repr__': __repr__,
'_asdict': _asdict,
'__getnewargs__': __getnewargs__,
'__match_args__': field_names,
}
for index, name in enumerate(field_names):
doc = _sys.intern(f'Alias for field number {index}')
class_namespace[name] = _tuplegetter(index, doc)
result = type(typename, (tuple,), class_namespace)
# For pickling to work, the __module__ variable needs to be set to the frame
# where the named tuple is created. Bypass this step in environments where
# sys._getframe is not defined (Jython for example) or sys._getframe is not
# defined for arguments greater than 0 (IronPython), or where the user has
# specified a particular module.
if module is None:
try:
module = _sys._getframe(1).f_globals.get('__name__', '__main__')
except (AttributeError, ValueError):
pass
if module is not None:
result.__module__ = module
return result
| (typename, field_names, *, rename=False, defaults=None, module=None) | [
0.05422442406415939,
0.0013919216580688953,
-0.015399984084069729,
-0.03568263724446297,
-0.032860167324543,
-0.03329280763864517,
0.0027967195492237806,
0.021529074758291245,
0.021014025434851646,
-0.04614844545722008,
-0.04223407059907913,
0.05710870400071144,
0.004498958587646484,
0.06328929960727692,
0.010836644098162651,
0.03343702107667923,
-0.0298110730946064,
0.05636703222990036,
-0.06543190777301788,
-0.03232451528310776,
0.019025932997465134,
0.01592533476650715,
0.03345762565732002,
0.05978696048259735,
0.031994882971048355,
0.010980858467519283,
0.018809612840414047,
0.01048640999943018,
0.0017988107865676284,
-0.00597972609102726,
-0.004107520915567875,
-0.01582232490181923,
-0.030202509835362434,
-0.010733634233474731,
0.0028507995884865522,
-0.06089947000145912,
-0.05006282404065132,
0.058550842106342316,
0.04927994683384895,
-0.005050061736255884,
0.06394856423139572,
-0.09963119775056839,
-0.04952717199921608,
-0.0609818771481514,
-0.0017627573106437922,
0.02340385504066944,
0.022682785987854004,
-0.0114341014996171,
-0.024248536676168442,
-0.053441550582647324,
0.023589273914694786,
0.0063196588307619095,
0.015801722183823586,
-0.004215680994093418,
-0.023156631737947464,
-0.0009464037138968706,
-0.001845165272243321,
0.06184715777635574,
-0.006911966018378735,
0.02313602901995182,
-0.002206987701356411,
0.057603150606155396,
-0.015080653131008148,
0.010481259785592556,
-0.05422442406415939,
-0.024207333102822304,
-0.009281194768846035,
-0.0735078826546669,
-0.02276519313454628,
0.0012451325310394168,
-0.009023669175803661,
-0.000875584373716265,
0.01879931055009365,
0.024248536676168442,
0.07635095715522766,
0.04227527230978012,
-0.02923421747982502,
-0.010846945457160473,
0.04425306245684624,
-0.05158736929297447,
-0.0165948998183012,
-0.01343249436467886,
-0.08075977861881256,
-0.043511394411325455,
-0.03424049913883209,
0.03947340324521065,
-0.050474863499403,
-0.00045678464812226593,
0.030140703544020653,
-0.0017370048444718122,
-0.05311191827058792,
0.016038645058870316,
-0.0037907653022557497,
0.03333401307463646,
-0.051669780164957047,
-0.08661074936389923,
0.0038165177684277296,
-0.03786644712090492,
-0.012896842323243618,
0.035826850682497025,
0.025010809302330017,
-0.045777611434459686,
-0.0918024480342865,
-0.021024325862526894,
-0.008699188008904457,
-0.019767604768276215,
-0.01951007917523384,
-0.015163061209022999,
0.0359092615544796,
-0.03265414759516716,
-0.04322296380996704,
-0.05768555775284767,
-0.029955286532640457,
0.06089947000145912,
-0.003986483905464411,
-0.03403447940945625,
0.021096432581543922,
-0.025999704375863075,
-0.030676355585455894,
-0.03106779418885708,
0.027091611176729202,
0.018809612840414047,
-0.06127030402421951,
0.0491151325404644,
0.008462265133857727,
-0.008992766961455345,
0.061435118317604065,
-0.02597910352051258,
0.038937751203775406,
-0.003363274037837982,
0.022991815581917763,
0.00298986304551363,
-0.042398884892463684,
0.05673786625266075,
0.017872221767902374,
0.03844330459833145,
0.04989800974726677,
0.05031004920601845,
-0.06984072923660278,
0.037619225680828094,
0.0420074462890625,
-0.01217577327042818,
0.06555552035570145,
0.03545601665973663,
-0.0018464529421180487,
-0.04623085632920265,
0.01329858135432005,
0.0069583202712237835,
-0.037516213953495026,
0.03007889911532402,
-0.03302498161792755,
-0.035991668701171875,
0.01893322356045246,
0.02239435724914074,
-0.04643687605857849,
-0.005150496494024992,
-0.0111765768378973,
-0.06407217681407928,
-0.023218438029289246,
-0.041512999683618546,
0.01856238953769207,
-0.0531943254172802,
-0.016172558069229126,
-0.015709014609456062,
0.055336933583021164,
0.021323055028915405,
0.04342898353934288,
-0.08529222011566162,
-0.01361791230738163,
-0.03356063365936279,
-0.00040173871093429625,
0.041203971952199936,
0.026370540261268616,
0.04417065531015396,
-0.034158091992139816,
0.01944827474653721,
-0.007117985747754574,
0.024845995008945465,
0.02398071065545082,
-0.02042686752974987,
0.03879353776574135,
-0.014318379573523998,
-0.062011975795030594,
0.008889756165444851,
0.05846843495965004,
0.03180946409702301,
-0.0020177068654447794,
0.06230040267109871,
0.052287839353084564,
0.026803182438015938,
0.016141654923558235,
-0.04000905528664589,
0.005737653002142906,
-0.006597785744816065,
0.008683736436069012,
0.0630008727312088,
-0.06353652477264404,
0.04614844545722008,
0.017604395747184753,
0.1104266420006752,
-0.027565456926822662,
0.0331897996366024,
0.029213614761829376,
-0.01744988188147545,
0.03279836103320122,
-0.029481440782546997,
0.0548836886882782,
-0.05105172097682953,
-0.03158284351229668,
-0.03378725424408913,
0.08339683711528778,
-0.021426064893603325,
0.007710292935371399,
0.019602788612246513,
-0.010816042311489582,
-0.07251898944377899,
0.0535239577293396,
-0.02987287938594818,
0.006345411296933889,
-0.00417447742074728,
0.08817649632692337,
0.02340385504066944,
-0.02612331695854664,
-0.00585096376016736,
0.0413275808095932,
-0.048826705664396286,
-0.01616225764155388,
-0.029110604897141457,
-0.038402099162340164,
-0.06394856423139572,
0.06271244585514069,
-0.012835036963224411,
-0.029090002179145813,
-0.019283458590507507,
0.02398071065545082,
-0.01629617065191269,
0.009224538691341877,
-0.035723842680454254,
-0.023197835311293602,
-0.02628813311457634,
0.027833281084895134,
0.03568263724446297,
-0.03380785882472992,
-0.009868350811302662,
-0.00973958894610405,
-0.0674096941947937,
-0.02781268022954464,
0.02818351611495018,
-0.019808808341622353,
0.00776694854721427,
-0.01666700653731823,
0.014977643266320229,
-0.010949955321848392,
0.03277776017785072,
0.004362470470368862,
-0.02476358599960804,
-0.03560023009777069,
-0.013525202870368958,
-0.014256573282182217,
-0.027750873938202858,
0.004099795129150152,
-0.058344822376966476,
0.030799968168139458,
0.045035939663648605,
0.05121653527021408,
-0.02770967036485672,
0.004625145811587572,
-0.025690674781799316,
0.013185270130634308,
0.01527637243270874,
0.12031559646129608,
0.036259494721889496,
-0.015451489016413689,
0.016285868361592293,
-0.04536557197570801,
-0.03345762565732002,
0.016440384089946747,
-0.025196228176355362,
0.022806396707892418,
-0.051134128123521805,
-0.00887430552393198,
-0.0228682029992342,
-0.022888805717229843,
-0.01135169342160225,
0.022682785987854004,
0.0613115094602108,
-0.05529572814702988,
0.030738161876797676,
-0.00848286785185337,
-0.00015548060764558613,
0.04515955224633217,
-0.032860167324543,
0.013442795723676682,
-0.03191247582435608,
0.0004175121139269322,
0.02412492409348488,
-0.0857042595744133,
0.02049897611141205,
0.02340385504066944,
-0.06872822344303131,
-0.02496960572898388,
0.018201854079961777,
0.041245173662900925,
0.03889654949307442,
0.051669780164957047,
-0.041822031140327454,
-0.027421241626143456,
-0.004393373150378466,
-0.011052965186536312,
0.046725302934646606,
-0.0276066605001688,
0.01343249436467886,
-0.0215084720402956,
0.00576855568215251,
0.06024020537734032,
0.022435562685132027,
0.0015103830955922604,
-0.014689215458929539,
0.01480252668261528,
0.04318176209926605,
-0.01480252668261528,
-0.06287726014852524,
-0.048085033893585205,
-0.014359584078192711,
-0.008760994300246239,
-0.033890265971422195,
-0.05068088322877884,
-0.007808152586221695,
0.011866743676364422,
-0.017913425341248512,
-0.03568263724446297,
0.007051029242575169,
0.014205068349838257,
0.05785037577152252,
0.001169806462712586,
-0.009713836014270782,
0.010002263821661472,
-0.0259172972291708,
0.004406249616295099,
-0.020540179684758186,
0.0491151325404644,
-0.010445206426084042,
-0.04631326347589493,
-0.01119717862457037,
-0.007117985747754574,
-0.01792372763156891,
0.0140608549118042,
0.016986336559057236,
0.12657859921455383,
-0.0228682029992342,
0.01170192752033472,
-0.08364406228065491,
-0.05311191827058792,
0.01409175805747509,
0.04870309308171272,
-0.02834833227097988,
0.0022662184201180935,
-0.01324707642197609,
0.006685344036668539,
-0.009147281758487225,
0.008915509097278118,
-0.05414201691746712,
0.0012869802303612232,
0.011361994780600071,
0.020169343799352646,
-0.03545601665973663,
-0.032262708991765976,
-0.014998245052993298,
-0.014730419032275677,
-0.011361994780600071,
0.016203461214900017,
-0.015832625329494476,
-0.02954324707388878,
-0.03568263724446297,
-0.047137342393398285,
-0.03211849555373192,
0.027277028188109398,
0.07379630953073502,
-0.08727000653743744,
-0.06778053194284439,
0.01356640737503767,
-0.0663795992732048,
0.027833281084895134,
0.021024325862526894,
0.012216976843774319,
-0.00243875989690423,
0.05583138018846512,
0.02902819775044918,
0.014205068349838257,
0.06271244585514069,
-0.06695645302534103,
0.018943525850772858,
-0.03601226955652237,
-0.031521037220954895,
0.03537360951304436,
-0.013473697938024998,
-0.03937039524316788,
-0.03597106784582138,
-0.05010402947664261,
-0.01246420107781887,
0.007746346294879913,
-0.04375861585140228,
-0.035249996930360794,
0.044294267892837524,
-0.029193013906478882,
0.018129747360944748,
0.09658210724592209,
-0.04412945359945297,
0.009420257993042469,
-0.008549823425710201,
0.046395670622587204,
0.023630477488040924,
-0.06304207444190979,
-0.0833144262433052,
0.06431939452886581,
0.022414959967136383,
0.010543066076934338,
0.03347822651267052,
0.03564143553376198,
0.034570131450891495,
-0.0025082917418330908,
-0.006448421161621809,
0.006000328343361616,
0.02313602901995182,
-0.02886338159441948,
0.04425306245684624,
-0.04384102299809456,
0.024845995008945465,
0.01361791230738163,
0.005050061736255884,
-0.04075072705745697,
0.0012522144243121147,
0.004702403210103512,
-0.012639317661523819,
0.05430683121085167,
-0.0375986211001873,
-0.00789571087807417,
-0.03743380680680275,
-0.010877848602831364,
0.028883982449769974,
0.00889490731060505,
-0.0003228717250749469,
0.010929353535175323,
-0.050474863499403,
0.010743935592472553,
0.015204264782369137,
-0.04759058728814125,
0.01219637505710125,
0.04211045801639557,
0.01673911325633526,
0.0751972422003746,
0.056655459105968475,
0.08463295549154282,
0.015657508745789528,
-0.002065348904579878,
-0.03811367228627205,
-0.03920557722449303,
-0.04837346076965332,
0.01612105406820774,
0.0022404659539461136,
0.01774861104786396,
-0.025793684646487236,
0.05006282404065132,
0.03325160592794418,
-0.04126577451825142,
-0.008426211774349213,
0.03881413862109184,
-0.069099061191082,
-0.015358779579401016,
-0.041142165660858154,
0.06551431119441986,
-0.015317576006054878,
0.024887198582291603,
-0.019736701622605324,
-0.03465253859758377,
0.01616225764155388,
0.00023660092847421765,
-0.008596178144216537,
-0.01866539940237999,
-0.07861717790365219,
0.052658673375844955,
-0.02187930792570114,
0.05410081148147583,
0.002276519313454628,
-0.002737488830462098,
0.03012010268867016,
0.052823491394519806,
0.030367325991392136,
-0.009981662034988403,
0.03044973500072956,
-0.061805956065654755,
0.02787448652088642,
0.0518345944583416,
-0.008302600122988224,
0.00553163280710578,
-0.006463872734457254,
-0.02428974024951458,
0.04149239882826805,
-0.043552596122026443,
-0.033622439950704575,
0.04285212978720665,
-0.050392456352710724,
0.02587609365582466,
-0.03112960048019886,
0.06654441356658936,
-0.039555810391902924,
0.060446225106716156,
0.011022062040865421,
-0.01248480286449194,
-0.03261294215917587,
-0.06378374248743057,
-0.019015632569789886,
0.01744988188147545,
-0.030223112553358078,
0.0019417371368035674,
0.0060363817028701305,
0.004650898277759552,
0.023795293644070625,
-0.065720334649086,
-0.052864693105220795,
0.037516213953495026,
0.0298110730946064,
-0.032839562743902206,
0.015286672860383987,
-0.02991408295929432,
0.028780972585082054,
0.02544345147907734,
-0.0082974499091506,
0.03990604355931282,
0.024413352832198143,
0.00297698681242764,
-0.050474863499403,
-0.0235480684787035,
-0.05484248325228691,
0.03852571174502373,
0.03702176734805107,
-0.0046611991710960865,
0.01792372763156891,
0.04052410647273064,
0.020200246945023537,
0.04816744104027748,
0.05451285094022751,
-0.05546054244041443,
-0.026370540261268616,
-0.011104470118880272,
0.00035248708445578814,
-0.024536963552236557,
0.010058918967843056,
-0.015235167928040028,
-0.03028491884469986,
-0.0064381202682852745,
-0.01768680475652218,
0.0015554499113932252,
-0.010373099707067013,
-0.046560484915971756,
-0.01609015092253685,
-0.0359092615544796,
0.004885245580226183,
0.017192356288433075,
0.030161306262016296,
0.004995981231331825,
0.006633839104324579,
0.02445455640554428,
-0.009760190732777119,
-0.001051345025189221,
0.031994882971048355,
0.03980303555727005,
0.017728008329868317,
-0.0073394570499658585,
-0.01829456351697445,
0.030676355585455894,
0.008271696977317333,
0.046972524374723434,
0.017666202038526535,
0.01388573832809925,
0.029481440782546997,
-0.03689815476536751,
0.0038551464676856995,
-0.01482312846928835,
-0.057397130876779556,
0.02764786407351494,
0.04289333149790764,
-0.011557714082300663,
-0.06176475062966347,
-0.011495907790958881,
-0.02628813311457634,
-0.02045777067542076,
0.008251095190644264,
0.027318231761455536,
0.008513770066201687,
-0.023589273914694786,
0.042398884892463684,
-0.0047101289965212345,
-0.00037341099232435226,
-0.01934526488184929,
0.022105930373072624,
-0.0365891270339489,
0.006469023413956165,
0.010316443629562855,
0.0010024153161793947,
-0.04800262674689293,
0.03813427314162254,
-0.03347822651267052,
-0.002582973800599575,
0.004182203207165003,
-0.03652732074260712,
-0.015523595735430717,
0.00632480951026082,
0.050557270646095276,
0.014205068349838257,
0.06147632375359535,
-0.04853827878832817,
0.03965882211923599,
0.00821504183113575,
-0.02154967561364174,
-0.018243057653307915,
-0.014524399302899837,
-0.015121856704354286,
0.01238179299980402,
-0.04804382845759392,
-0.06794534623622894,
0.024227933958172798,
0.012917445041239262,
0.009373903274536133,
-0.009100927039980888,
-0.05669666454195976,
-0.011207479983568192,
-0.03718658164143562,
0.05125774070620537,
-0.04495353251695633,
-0.0306557547301054,
-0.028101107105612755,
0.023280242457985878,
-0.06703885644674301,
-0.03632130101323128,
0.012402394786477089,
0.02086981013417244,
-0.014781923964619637,
0.01417416613548994,
0.06225920096039772,
0.01167102437466383,
-0.032262708991765976,
-0.006499926093965769,
0.014359584078192711,
-0.010764537379145622,
-0.023280242457985878,
0.05179338902235031,
-0.09600525349378586,
0.0443766750395298,
0.01548239216208458,
-0.020066333934664726,
0.05389479175209999,
0.015266071073710918,
-0.03174765780568123,
-0.02554646134376526,
0.007081932388246059,
-0.0782463401556015,
-0.010527614504098892,
0.027853883802890778,
0.012443599291145802,
0.012165471911430359,
-0.04985680431127548,
0.035311803221702576,
-0.0274418443441391,
0.005804609507322311,
0.05031004920601845,
-0.024310342967510223,
0.05616101250052452,
0.05327673256397247,
0.018850816413760185,
-0.023568671196699142,
-0.003875748487189412,
0.05451285094022751,
-0.003690330544486642,
-0.026638366281986237,
-0.028636759147047997,
0.025381645187735558,
0.048785500228405,
-0.03232451528310776,
-0.0016404330963268876,
0.06118789687752724,
0.013401591219007969,
-0.04491232708096504,
-0.026226326823234558,
-0.007442466914653778,
-0.00913183018565178,
0.021055229008197784,
0.0053771180100739,
0.03059394843876362,
-0.08751723170280457,
0.03939099609851837,
0.01981911063194275,
0.017398376017808914,
0.01981911063194275,
-0.06168234348297119,
-0.02412492409348488,
0.027277028188109398,
-0.03180946409702301,
0.04800262674689293,
-0.020375363528728485,
0.020622586831450462,
0.005245780572295189,
-0.0024284590035676956,
0.03976183012127876,
0.0037341099232435226,
0.052287839353084564,
-0.0013352661626413465,
0.02255917340517044,
0.038772936910390854,
-0.006788353901356459,
-0.008678586222231388,
0.04417065531015396,
0.012000656686723232,
-0.009167883545160294,
0.050969310104846954,
-0.05430683121085167,
0.026576559990644455,
0.07029397040605545,
-0.015575100667774677,
0.03413749113678932,
0.028945788741111755,
-0.0177898146212101,
0.0863635241985321,
-0.002482539275661111,
0.005075814202427864,
0.00006743930862285197,
-0.029996490105986595,
-0.02544345147907734,
-0.03753681853413582,
0.017872221767902374,
0.04412945359945297,
0.04487112537026405,
-0.0460660383105278,
0.023197835311293602,
0.03244812786579132,
-0.031891871243715286,
0.025999704375863075,
0.018706602975726128,
-0.006159993354231119,
0.07387872040271759,
-0.05805639550089836,
0.06250642240047455,
-0.0012238867348060012,
0.04594242572784424,
-0.04969199001789093,
-0.018892019987106323,
0.05892167612910271,
0.02435154654085636,
-0.00768969114869833,
0.02655595913529396,
0.0129586486145854,
0.03801066428422928,
-0.019602788612246513,
-0.019561585038900375,
0.03271595388650894,
-0.06555552035570145,
0.03945280238986015,
-0.0118564423173666,
-0.02834833227097988,
-0.05274108052253723,
-0.031005987897515297,
-0.0023177233524620533,
0.018067941069602966,
0.01934526488184929,
-0.0017794964369386435,
0.03675394132733345,
0.005624341778457165,
0.03271595388650894
]
|
36,385 | statistics | pstdev | Return the square root of the population variance.
See ``pvariance`` for arguments and other details.
>>> pstdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
0.986893273527251
| def pstdev(data, mu=None):
"""Return the square root of the population variance.
See ``pvariance`` for arguments and other details.
>>> pstdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
0.986893273527251
"""
# Fixme: Despite the exact sum of squared deviations, some inaccuracy
# remain because there are two rounding steps. The first occurs in
# the _convert() step for pvariance(), the second occurs in math.sqrt().
var = pvariance(data, mu)
try:
return var.sqrt()
except AttributeError:
return math.sqrt(var)
| (data, mu=None) | [
0.02173636294901371,
0.04194248467683792,
0.07915513962507248,
-0.024553395807743073,
0.0464288704097271,
0.00817721989005804,
0.053349729627370834,
-0.07338196039199829,
0.04079480469226837,
0.0779031291604042,
-0.028587665408849716,
-0.05874034762382507,
0.010607345029711723,
-0.00853369664400816,
-0.05077614262700081,
0.09202306717634201,
-0.026135802268981934,
-0.0011031203903257847,
0.012007166631519794,
0.03662142530083656,
-0.021162522956728935,
0.0030474381055682898,
-0.01029434148222208,
-0.021597251296043396,
-0.05018491670489311,
-0.016858723014593124,
0.017276061698794365,
-0.06260072439908981,
-0.004303799942135811,
-0.00934663601219654,
0.011572440154850483,
-0.002147552790120244,
0.052202049642801285,
0.009242301806807518,
0.04729832708835602,
0.071434386074543,
0.03345660865306854,
-0.06524387001991272,
-0.08430231362581253,
0.006938247010111809,
-0.03613452985882759,
-0.004638540092855692,
-0.044029176235198975,
0.04145559296011925,
0.07421664148569107,
0.0014922013506293297,
0.050706587731838226,
0.05282805860042572,
-0.10913392901420593,
0.04545508325099945,
-0.006764356046915054,
0.03620408475399017,
-0.016458773985505104,
0.028118159621953964,
-0.01338959950953722,
0.013746076263487339,
-0.00060535769443959,
-0.009781363420188427,
0.019128000363707542,
-0.023162268102169037,
0.07880736142396927,
0.03105691634118557,
0.034013062715530396,
-0.07741623371839523,
0.017649926245212555,
-0.023527439683675766,
0.018154211342334747,
0.026170581579208374,
-0.015163286589086056,
0.031213417649269104,
-0.03947323560714722,
0.0036038889084011316,
-0.061140041798353195,
-0.0020399577915668488,
0.09230129420757294,
0.039438456296920776,
0.029057171195745468,
-0.04072524979710579,
-0.04204682260751724,
0.01785859651863575,
0.036308422684669495,
0.001644355827011168,
0.0015324136475101113,
0.05588853731751442,
0.029735345393419266,
0.03543896600604057,
0.013537406921386719,
0.05307150259613991,
-0.02909194864332676,
0.02486640028655529,
0.03728220984339714,
-0.01555454172194004,
0.06555686891078949,
0.03832555562257767,
-0.03303927183151245,
0.010033505037426949,
-0.01904105395078659,
0.02328399196267128,
-0.007229514420032501,
-0.02366655133664608,
0.03328271955251694,
0.06927813589572906,
0.05745355412364006,
0.007925078272819519,
0.01825854554772377,
0.053349729627370834,
0.05863601341843605,
0.032778434455394745,
0.0015682786470279098,
0.029596231877803802,
-0.04542030394077301,
0.015650181099772453,
0.0038821145426481962,
0.010398675687611103,
-0.02328399196267128,
-0.03463906794786453,
-0.03069174475967884,
0.05328017473220825,
-0.027022646740078926,
0.008920603431761265,
-0.051054369658231735,
0.028031213209033012,
-0.028831111267209053,
-0.0027344345580786467,
-0.00928577408194542,
0.008677156642079353,
0.02982228994369507,
-0.056514542549848557,
-0.04548986256122589,
0.047924332320690155,
0.07971159368753433,
0.01049431599676609,
0.027300871908664703,
-0.007194736041128635,
0.03853422403335571,
-0.041733816266059875,
0.05147170647978783,
0.015076341107487679,
0.07477308809757233,
-0.0210060216486454,
0.008624988608062267,
0.036308422684669495,
-0.04548986256122589,
0.022727541625499725,
0.0335087776184082,
0.06726100295782089,
0.03029179573059082,
0.048306893557310104,
0.020084399729967117,
0.029318006709218025,
-0.037838660180568695,
-0.02761387638747692,
0.0528976134955883,
-0.03488251566886902,
0.07000847905874252,
-0.05004580318927765,
0.01750211976468563,
-0.07978114485740662,
-0.01244189403951168,
-0.04302060976624489,
-0.03717787563800812,
0.007781617809087038,
-0.03528246656060219,
0.013154846616089344,
0.0036582299508154392,
0.0059774997644126415,
-0.013311348855495453,
0.06103570759296417,
-0.004238590598106384,
-0.00910318922251463,
-0.0022801444865763187,
0.033178385347127914,
-0.0397166833281517,
0.028900668025016785,
0.05967935919761658,
-0.04455085098743439,
0.00505153089761734,
0.028239883482456207,
-0.010172617621719837,
-0.033595722168684006,
0.013450461439788342,
0.008664114400744438,
0.025335904210805893,
0.06183560565114021,
-0.013911272399127483,
0.018832385540008545,
-0.02837899513542652,
0.01820637844502926,
-0.04841122776269913,
-0.027370428666472435,
-0.04312494397163391,
-0.027318261563777924,
-0.027857322245836258,
0.0036082363221794367,
0.005212380085140467,
0.040203578770160675,
-0.021579861640930176,
-0.009772668592631817,
0.005812303628772497,
-0.0798507034778595,
-0.0032669752836227417,
-0.014059079810976982,
-0.01553715206682682,
-0.006686105392873287,
-0.0065469928085803986,
-0.04149036854505539,
-0.04479429870843887,
0.02910933829843998,
0.018049875274300575,
0.00612530717626214,
0.01780642941594124,
0.023075323551893234,
0.052202049642801285,
0.0035864999517798424,
0.02253626100718975,
-0.02286665327847004,
0.07595554739236832,
-0.09160573035478592,
-0.0014476417563855648,
0.056549321860075,
0.039403680711984634,
-0.09640511870384216,
0.057627446949481964,
0.09821358323097229,
-0.026483584195375443,
0.030187461525201797,
-0.004668970592319965,
0.02443167194724083,
0.03423912078142166,
0.007720756344497204,
0.04781999811530113,
-0.020101789385080338,
-0.016180548816919327,
-0.04392484202980995,
-0.011294214054942131,
-0.03230892866849899,
-0.041003476828336716,
-0.04006446525454521,
0.000887930451426655,
0.013537406921386719,
-0.0233013816177845,
-0.023996945470571518,
0.003619104390963912,
0.05004580318927765,
0.0046602762304246426,
0.007159958127886057,
-0.022762319073081017,
-0.015850156545639038,
0.033543556928634644,
0.005890554282814264,
0.005473216064274311,
0.022031977772712708,
0.0001369390811305493,
0.04225549101829529,
0.031630754470825195,
0.012615785002708435,
0.021962421014904976,
0.07484264671802521,
0.034378230571746826,
0.015276315622031689,
0.0009721588576212525,
-0.04395962134003639,
0.008398930542171001,
0.08186783641576767,
-0.05077614262700081,
-0.012728814035654068,
-0.009816141799092293,
-0.04267282783985138,
0.0006971938419155777,
0.018015097826719284,
0.06468741595745087,
0.03874289244413376,
0.04155992716550827,
-0.07539909332990646,
0.015702348202466965,
-0.02982228994369507,
0.015415429137647152,
0.04962846264243126,
0.09355330467224121,
-0.007564254570752382,
-0.0025409809313714504,
-0.012181057594716549,
-0.012163668870925903,
0.04646364971995354,
0.009564000181853771,
-0.02646619640290737,
0.0019736618269234896,
-0.05536686256527901,
0.04691576585173607,
0.06298328936100006,
-0.02451861836016178,
-0.06955636292695999,
-0.05967935919761658,
0.022657984867691994,
-0.002651836257427931,
0.029735345393419266,
-0.008320679888129234,
0.01628488302230835,
0.01278098113834858,
0.007685977965593338,
0.0008553258958272636,
0.02867460995912552,
0.01935405842959881,
0.06277461349964142,
0.008029412478208542,
0.0794333666563034,
0.00524281058460474,
-0.09633556008338928,
-0.0019323626765981317,
-0.03331749886274338,
-0.015241538174450397,
-0.0380125530064106,
-0.03065696731209755,
0.04315972328186035,
0.0233013816177845,
0.006738272495567799,
0.03336966410279274,
-0.06204427406191826,
0.025927133858203888,
0.003916892688721418,
0.027492152526974678,
-0.013876494020223618,
0.13167019188404083,
-0.007907688617706299,
0.0403079129755497,
-0.008642378263175488,
-0.050254471600055695,
0.00669479975476861,
0.04340317100286484,
-0.009763974696397781,
-0.07915513962507248,
-0.04312494397163391,
0.0536627322435379,
0.039821017533540726,
0.021214690059423447,
-0.008433708921074867,
0.016197938472032547,
-0.04861989617347717,
-0.012694035656750202,
-0.06524387001991272,
0.005590592510998249,
0.005942721851170063,
0.02297098934650421,
-0.02639663964509964,
0.002408389002084732,
0.04646364971995354,
-0.024344727396965027,
-0.018380269408226013,
0.025301126763224602,
0.00591663783416152,
0.03147425502538681,
0.034743402153253555,
-0.027787767350673676,
0.02756170928478241,
0.008411972783505917,
-0.034013062715530396,
0.04806344583630562,
0.008320679888129234,
0.010389981791377068,
-0.004051658324897289,
-0.008629336021840572,
0.09654422849416733,
-0.00915535632520914,
-0.053767066448926926,
0.03776910528540611,
-0.020432181656360626,
-0.003516943659633398,
-0.05077614262700081,
0.013937355950474739,
0.02832682803273201,
-0.0037690852768719196,
-0.07122571766376495,
-0.03961234912276268,
-0.03253498673439026,
0.001221583574078977,
0.005599287338554859,
-0.001985616749152541,
-0.04514208063483238,
-0.016997836530208588,
-0.007620769087225199,
-0.054949525743722916,
-0.03483034670352936,
-0.001812812639400363,
0.0051080454140901566,
0.036273643374443054,
-0.018710661679506302,
-0.09953515231609344,
0.02058868296444416,
-0.042881496250629425,
-0.010346508584916592,
-0.02439689449965954,
0.010389981791377068,
0.05484519153833389,
0.02215370163321495,
0.009033632464706898,
0.03143947571516037,
-0.019597504287958145,
-0.04197726398706436,
-0.03493468463420868,
0.05192382261157036,
-0.00777727086097002,
0.0022649290040135384,
-0.06552208960056305,
-0.005138476379215717,
-0.035578079521656036,
-0.056514542549848557,
-0.04166426137089729,
-0.02177114225924015,
-0.003684313502162695,
0.039855796843767166,
0.02679658867418766,
0.020101789385080338,
0.01745864748954773,
0.01668483205139637,
0.047959111630916595,
0.028083380311727524,
-0.061487823724746704,
0.028205104172229767,
0.02248409390449524,
-0.05668843537569046,
-0.002071475377306342,
-0.08186783641576767,
0.006086181849241257,
-0.011989777907729149,
0.03130036219954491,
-0.0458376444876194,
-0.015050257556140423,
-0.04312494397163391,
-0.030830858275294304,
0.0481330044567585,
0.03756043687462807,
-0.015424123033881187,
-0.005016752518713474,
0.00474722171202302,
0.01710217073559761,
0.005581898149102926,
-0.04315972328186035,
0.03957756981253624,
-0.010676901787519455,
-0.022762319073081017,
0.03253498673439026,
0.06976503133773804,
0.0011292040580883622,
-0.009129272773861885,
-0.011711552739143372,
0.010763847269117832,
0.0069686779752373695,
-0.0325697660446167,
0.030917802825570107,
-0.03270887956023216,
0.018832385540008545,
-0.028483331203460693,
0.04764610901474953,
-0.011920221149921417,
0.001989964162930846,
-0.03964712470769882,
-0.026935700327157974,
-0.011963694356381893,
-0.01378954853862524,
-0.006577423308044672,
-0.009459665045142174,
-0.012894011102616787,
-0.03957756981253624,
-0.03062218800187111,
0.0037169181741774082,
0.012102806940674782,
0.03528246656060219,
0.011007294058799744,
0.02837899513542652,
-0.006255725398659706,
0.04416828975081444,
0.06882601976394653,
-0.018936719745397568,
-0.005386270582675934,
-0.015484984964132309,
0.013337432406842709,
-0.08110272139310837,
-0.011728941462934017,
0.015285010449588299,
0.03065696731209755,
-0.027457373216748238,
-0.0011748503893613815,
0.032395876944065094,
0.04618542268872261,
-0.03609975054860115,
-0.05046314001083374,
-0.031630754470825195,
0.004790694452822208,
0.035525910556316376,
-0.003051785286515951,
0.02596191130578518,
0.010755152441561222,
0.010276952758431435,
-0.046846210956573486,
-0.08541521430015564,
-0.03950801491737366,
0.043646618723869324,
-0.017997708171606064,
0.0279790461063385,
-0.0015421949792653322,
0.04009924456477165,
0.02444906160235405,
0.04416828975081444,
-0.08701501041650772,
0.012433200143277645,
0.003612583503127098,
-0.0126070911064744,
0.02128424681723118,
-0.04315972328186035,
0.016841333359479904,
-0.02288404293358326,
-0.03065696731209755,
0.004042963497340679,
-0.002136684488505125,
0.05950546637177467,
-0.01711956039071083,
0.028465941548347473,
-0.004421176388859749,
0.02373610809445381,
0.00022660157992504537,
-0.007690325379371643,
-0.0032365445513278246,
-0.05668843537569046,
0.06023580953478813,
-0.001104207243770361,
-0.01225930918008089,
-0.07171261310577393,
0.022814486175775528,
-0.061522603034973145,
0.04225549101829529,
0.03140469640493393,
-0.0023975209333002567,
-0.006364407017827034,
-0.01631966233253479,
-0.019284501671791077,
-0.02053651586174965,
-0.03491729497909546,
-0.049871910363435745,
0.024309948086738586,
-0.003979928325861692,
-0.007942466996610165,
-0.004855903331190348,
0.06583509594202042,
0.019684450700879097,
0.023979555815458298,
-0.008638030849397182,
-0.05077614262700081,
0.009233606979250908,
0.027822544798254967,
-0.0025888008531183004,
0.07442530989646912,
-0.005277588963508606,
0.018067264929413795,
0.0691390261054039,
0.002886588918045163,
-0.022727541625499725,
0.021562471985816956,
0.038221221417188644,
-0.024692509323358536,
-0.05487997084856033,
-0.06427007913589478,
-0.05324539542198181,
0.05369751155376434,
0.029422340914607048,
-0.0028061645571142435,
-0.0019193209009245038,
-0.04475951939821243,
-0.024570785462856293,
-0.06628721207380295,
-0.032361097633838654,
-0.024727286770939827,
-0.025753242895007133,
0.034186951816082,
0.0013889536494389176,
0.020449571311473846,
-0.005381923634558916,
0.011963694356381893,
-0.01787598431110382,
-0.04576808586716652,
-0.006786092650145292,
0.010859486646950245,
-0.05936635658144951,
-0.060374923050403595,
0.008594557642936707,
-0.043716173619031906,
0.0049863215535879135,
-0.04009924456477165,
-0.06249639019370079,
-0.03441300988197327,
0.002460556337609887,
-0.02246670424938202,
-0.018710661679506302,
-0.027718210592865944,
-0.009450971148908138,
0.03449995443224907,
-0.0481330044567585,
0.01419819239526987,
0.032065484672784805,
0.02876155637204647,
0.017536897212266922,
-0.03176986798644066,
0.0213016364723444,
0.040203578770160675,
-0.029700566083192825,
0.04305538907647133,
-0.026170581579208374,
0.005394965410232544,
-0.04159470275044441,
0.003842988982796669,
0.0016943494556471705,
-0.018919330090284348,
0.018015097826719284,
-0.06986936926841736,
0.03062218800187111,
0.026101024821400642,
0.022605817764997482,
-0.0039060243871062994,
-0.04044702276587486,
0.020797351375222206,
0.003701702691614628,
-0.01455466914921999,
0.0009433581726625562,
0.02910933829843998,
-0.015163286589086056,
0.0038277735002338886,
-0.012685341760516167,
0.0070817070081830025,
0.000069216730480548,
-0.04931546002626419,
-0.09689201414585114,
-0.008490223437547684,
0.017623843625187874,
0.02829205058515072,
-0.05967935919761658,
-0.04531596973538399,
0.01670222170650959,
-0.010120450519025326,
-0.04496818780899048,
-0.01205063983798027,
0.031613364815711975,
0.03683009371161461,
0.014128635637462139,
0.04225549101829529,
0.007146916352212429,
0.025718465447425842,
0.036690980195999146,
-0.03032657317817211,
0.027822544798254967,
0.016154464334249496,
-0.011824581772089005,
0.007729450706392527,
-0.01975400745868683,
0.022292813286185265,
0.011424632743000984,
0.03032657317817211,
0.024622952565550804,
0.024744676426053047,
-0.01089426502585411,
-0.02250148355960846,
-0.01827593334019184,
0.004066873341798782,
-0.0335087776184082,
-0.10829925537109375,
0.026327082887291908,
0.039021119475364685,
-0.023979555815458298,
-0.04034268856048584,
0.029404951259493828,
-0.05401051416993141,
-0.03696920722723007,
-0.025927133858203888,
0.08284162729978561,
0.0029670135118067265,
-0.029283229261636734,
-0.04138603433966637,
-0.010259563103318214,
0.031630754470825195,
-0.04385528713464737,
-0.08917125314474106,
0.020432181656360626,
-0.02097124233841896,
0.015484984964132309,
0.021440748125314713,
-0.02832682803273201,
-0.025944523513317108,
0.051054369658231735,
0.004438565578311682,
-0.009172745048999786,
0.015676265582442284,
0.014641614630818367,
-0.033995673060417175,
-0.07366018742322922,
-0.022240646183490753,
-0.013824326917529106,
-0.04270760715007782,
-0.02451861836016178,
0.039855796843767166,
0.05929679796099663,
-0.03371744602918625,
0.006433963309973478,
-0.01987573131918907,
0.012928788550198078,
0.005899249110370874,
-0.0031061263289302588,
0.013963439501821995,
-0.019545337185263634,
0.017789039760828018,
0.0025953217409551144,
0.031978536397218704,
-0.014215581119060516,
-0.0054384381510317326,
-0.052619386464357376,
0.032361097633838654,
-0.03609975054860115,
0.01626749336719513,
0.010016116313636303,
-0.057662222534418106,
0.008098969236016273,
0.024675119668245316,
-0.01183327566832304,
-0.0044472599402070045,
-0.0009210783755406737,
0.032761044800281525,
-0.01748473010957241,
-0.026657475158572197,
0.017606453970074654,
0.03107430413365364,
-0.049524128437042236,
0.023753497749567032,
-0.001792163122445345,
-0.038186442106962204,
0.000029632776204380207,
0.010911654680967331,
-0.00232579093426466,
-0.013067901134490967,
0.03305666148662567,
-0.04775044322013855,
-0.009564000181853771,
-0.006560034584254026,
-0.04479429870843887,
0.011798498220741749,
0.06600898504257202,
0.03156119957566261,
-0.05738399922847748,
0.00485155638307333,
-0.05783611536026001,
0.022292813286185265,
-0.044029176235198975,
0.04472474008798599,
-0.039855796843767166,
0.013728686608374119,
-0.016224021092057228,
-0.06009669601917267,
0.039368901401758194,
-0.015006785281002522,
0.011415937915444374,
-0.004647234454751015,
-0.025109846144914627,
-0.015119814313948154,
-0.03686487302184105,
-0.02481423132121563,
0.032761044800281525,
0.01985834166407585,
0.026274915784597397,
-0.02792687900364399,
0.03110908344388008,
-0.04347272589802742,
0.005003710743039846
]
|
36,386 | statistics | pvariance | Return the population variance of ``data``.
data should be a sequence or iterable of Real-valued numbers, with at least one
value. The optional argument mu, if given, should be the mean of
the data. If it is missing or None, the mean is automatically calculated.
Use this function to calculate the variance from the entire population.
To estimate the variance from a sample, the ``variance`` function is
usually a better choice.
Examples:
>>> data = [0.0, 0.25, 0.25, 1.25, 1.5, 1.75, 2.75, 3.25]
>>> pvariance(data)
1.25
If you have already calculated the mean of the data, you can pass it as
the optional second argument to avoid recalculating it:
>>> mu = mean(data)
>>> pvariance(data, mu)
1.25
Decimals and Fractions are supported:
>>> from decimal import Decimal as D
>>> pvariance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")])
Decimal('24.815')
>>> from fractions import Fraction as F
>>> pvariance([F(1, 4), F(5, 4), F(1, 2)])
Fraction(13, 72)
| def pvariance(data, mu=None):
"""Return the population variance of ``data``.
data should be a sequence or iterable of Real-valued numbers, with at least one
value. The optional argument mu, if given, should be the mean of
the data. If it is missing or None, the mean is automatically calculated.
Use this function to calculate the variance from the entire population.
To estimate the variance from a sample, the ``variance`` function is
usually a better choice.
Examples:
>>> data = [0.0, 0.25, 0.25, 1.25, 1.5, 1.75, 2.75, 3.25]
>>> pvariance(data)
1.25
If you have already calculated the mean of the data, you can pass it as
the optional second argument to avoid recalculating it:
>>> mu = mean(data)
>>> pvariance(data, mu)
1.25
Decimals and Fractions are supported:
>>> from decimal import Decimal as D
>>> pvariance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")])
Decimal('24.815')
>>> from fractions import Fraction as F
>>> pvariance([F(1, 4), F(5, 4), F(1, 2)])
Fraction(13, 72)
"""
if iter(data) is data:
data = list(data)
n = len(data)
if n < 1:
raise StatisticsError('pvariance requires at least one data point')
T, ss = _ss(data, mu)
return _convert(ss / n, T)
| (data, mu=None) | [
0.027294699102640152,
0.019790448248386383,
0.0595325343310833,
-0.020453115925192833,
0.06057130917906761,
0.007204260677099228,
0.04448821023106575,
-0.06128770485520363,
0.05971163511276245,
0.0661592036485672,
-0.014578665606677532,
-0.01185635942965746,
-0.0023909728042781353,
-0.031306520104408264,
-0.06329361349344254,
0.1045222207903862,
-0.010763854719698429,
0.029784176498651505,
-0.007607233244925737,
0.0608578659594059,
-0.03569444641470909,
0.023676898330450058,
-0.03315123915672302,
-0.03761080652475357,
-0.019145691767334938,
-0.04316287860274315,
0.013548845425248146,
-0.06927552819252014,
-0.01568012498319149,
-0.0045894137583673,
-0.02890659123659134,
-0.01531297154724598,
0.00813557580113411,
0.035801906138658524,
0.05498341843485832,
0.044738952070474625,
0.007275900337845087,
-0.0032081122044473886,
-0.08360344916582108,
0.030715491622686386,
-0.017050232738256454,
-0.05222529172897339,
0.0021648602560162544,
0.06289959698915482,
0.039939094334840775,
0.009563891217112541,
0.07031429558992386,
0.030482662841677666,
-0.09370464086532593,
0.02706187032163143,
0.010163872502744198,
0.05537743493914604,
0.007025161292403936,
-0.009662395343184471,
-0.005426702089607716,
0.0532640665769577,
0.01928897015750408,
0.022673944011330605,
-0.0012156349839642644,
0.028190195560455322,
0.0810244232416153,
0.005592369008809328,
0.015357745811343193,
-0.08353181183338165,
0.012966773472726345,
-0.011883224360644817,
-0.006622188724577427,
0.024303745478391647,
-0.04276886209845543,
0.0029976707883179188,
-0.039939094334840775,
0.00835497211664915,
-0.023300791159272194,
0.03979581594467163,
0.08539444208145142,
0.05129397660493851,
0.026488754898309708,
-0.007844539359211922,
-0.031342338770627975,
0.035210877656936646,
0.03513924032449722,
-0.029085690155625343,
0.00405883276835084,
0.0420166440308094,
0.013298106379806995,
0.021044142544269562,
-0.03023192472755909,
0.011704124510288239,
0.026488754898309708,
0.04588518291711807,
0.014086143113672733,
0.007723648101091385,
0.06329361349344254,
0.06569354236125946,
-0.04115696996450424,
-0.004929702263325453,
-0.008426611311733723,
-0.00401181960478425,
-0.011963818222284317,
-0.02702605165541172,
0.008108710870146751,
0.0863257572054863,
0.046028465032577515,
0.0000010843889413081342,
0.016208466142416,
0.026309654116630554,
0.05100741982460022,
0.027133511379361153,
0.030124465003609657,
0.022906772792339325,
-0.036894410848617554,
0.061538442969322205,
-0.005104323849081993,
0.022118736058473587,
-0.045634444802999496,
-0.024787312373518944,
-0.02553952857851982,
0.05168799310922623,
-0.05831466242671013,
0.05100741982460022,
-0.07486341893672943,
0.06006983295083046,
0.009877314791083336,
0.003980476874858141,
-0.014148827642202377,
-0.03553325682878494,
0.020220287144184113,
-0.07486341893672943,
-0.07457685470581055,
0.04144352674484253,
0.06368762999773026,
-0.021473979577422142,
-0.021850088611245155,
-0.0317542664706707,
0.04140770807862282,
-0.039580896496772766,
0.06193246319890022,
0.00001275906015507644,
0.06565771996974945,
-0.018115872517228127,
0.015089097432792187,
0.04986118525266647,
-0.03897196054458618,
0.021617259830236435,
0.03850630298256874,
0.024554483592510223,
0.07951999455690384,
0.03050057403743267,
0.0009324345737695694,
-0.005977431777864695,
-0.06229066103696823,
-0.023802267387509346,
0.04287632182240486,
-0.01636965572834015,
0.04785527288913727,
-0.044344931840896606,
0.012402611784636974,
-0.08288705348968506,
-0.053335707634687424,
-0.051258157938718796,
-0.019396429881453514,
0.03574817627668381,
-0.027133511379361153,
0.04144352674484253,
-0.003678247332572937,
0.00038198474794626236,
0.0034879546146839857,
0.042553942650556564,
-0.011005638167262077,
-0.03277513012290001,
-0.01945015974342823,
-0.018912862986326218,
-0.036267563700675964,
0.03331242874264717,
0.044344931840896606,
-0.03354525938630104,
0.013853314332664013,
-0.00009556615259498358,
-0.011874268762767315,
0.01650398038327694,
0.021312789991497993,
-0.03354525938630104,
-0.0017316642915830016,
-0.0231575109064579,
-0.039974916726350784,
-0.022978411987423897,
-0.0003682724782265723,
0.03757498785853386,
-0.03229156509041786,
-0.021223241463303566,
-0.028727492317557335,
-0.03230947256088257,
-0.016521889716386795,
0.020130736753344536,
0.032076645642519,
-0.0006005415925756097,
-0.017703944817185402,
0.008789286948740482,
0.010575801134109497,
-0.0711023360490799,
0.03750334680080414,
-0.03390345722436905,
0.012268287129700184,
-0.000936912081670016,
-0.010629530064761639,
-0.0025812655221670866,
-0.04839257150888443,
-0.013521980494260788,
0.028566302731633186,
-0.03528251871466637,
0.006299810018390417,
0.005861017387360334,
0.0932748019695282,
0.004996864590793848,
-0.0024245537351816893,
0.01013700757175684,
0.055520713329315186,
-0.10151335597038269,
0.03230947256088257,
0.064833864569664,
0.07994983345270157,
-0.10932207852602005,
0.01255484577268362,
0.12221721559762955,
-0.001788752037100494,
0.002885733963921666,
-0.016853222623467445,
-0.003138711443170905,
0.012098142877221107,
0.033097509294748306,
0.03402882441878319,
0.016647258773446083,
0.004161814693361521,
-0.05713260546326637,
0.02190381847321987,
0.012751854956150055,
-0.01842929609119892,
-0.02613055519759655,
-0.018375566229224205,
0.057240065187215805,
-0.07228438556194305,
0.01687113381922245,
0.0015223422087728977,
0.055126696825027466,
-0.0357302650809288,
0.005820719990879297,
-0.022978411987423897,
0.04746125638484955,
0.002587981754913926,
0.022781403735280037,
-0.020238196477293968,
0.025378338992595673,
0.0030916978139430285,
0.0396883562207222,
0.04746125638484955,
0.03334824740886688,
0.009393746964633465,
0.029103601351380348,
0.03850630298256874,
0.04287632182240486,
0.009008684195578098,
-0.054231200367212296,
0.018715854734182358,
0.07085159420967102,
-0.05487595871090889,
-0.026649942621588707,
-0.010674305260181427,
-0.05143725499510765,
0.01218769233673811,
0.04857167229056358,
-0.001682411995716393,
0.038255564868450165,
0.08446312695741653,
-0.06923970580101013,
0.030178194865584373,
-0.02686486206948757,
0.03979581594467163,
0.03718096762895584,
0.051186516880989075,
0.013020503334701061,
0.011336972005665302,
0.0034275087527930737,
-0.018572574481368065,
0.008825107477605343,
0.011086232960224152,
-0.009948953986167908,
0.00010766932973638177,
-0.05315660685300827,
0.03148561716079712,
0.06497714668512344,
0.007257990073412657,
-0.09040921926498413,
-0.0767260491847992,
0.014892088249325752,
-0.02835138514637947,
0.04885822907090187,
-0.03116323985159397,
0.03807646408677101,
0.04119278863072395,
0.014327926561236382,
0.01968298852443695,
0.028494663536548615,
0.02620219625532627,
0.041300248354673386,
-0.007674395572394133,
0.05039848014712334,
0.040368933230638504,
-0.0678069144487381,
-0.021653078496456146,
-0.01948598027229309,
0.017247240990400314,
-0.01113100815564394,
-0.024160465225577354,
0.03714514896273613,
0.010423566214740276,
0.015223422087728977,
0.015008502639830112,
-0.07292914390563965,
0.01593981869518757,
-0.013432431034743786,
0.012151872739195824,
-0.02401718683540821,
0.10051040351390839,
-0.009993729181587696,
0.04545534774661064,
0.0509357787668705,
-0.08517952263355255,
0.04273303970694542,
0.039079420268535614,
0.0038774951826781034,
-0.05956835299730301,
-0.054625220596790314,
0.024787312373518944,
0.06909642368555069,
-0.013656305149197578,
-0.005771467927843332,
0.00016258838877547532,
-0.01491895318031311,
0.029748357832431793,
-0.03230947256088257,
-0.0070162066258490086,
-0.015044323168694973,
0.002603652887046337,
-0.032363202422857285,
0.015957728028297424,
0.024715673178434372,
-0.013065277598798275,
-0.016450250521302223,
0.041658446192741394,
0.06580100208520889,
-0.0011260855244472623,
0.03136024996638298,
0.0027469322085380554,
0.030178194865584373,
-0.006228170357644558,
-0.056380391120910645,
0.07744244486093521,
-0.0034140762872993946,
-0.012823494151234627,
-0.010817584581673145,
-0.00886540487408638,
0.07027848064899445,
0.029981186613440514,
-0.04624338448047638,
0.03456612303853035,
-0.020488934591412544,
-0.019969547167420387,
-0.021814268082380295,
0.0070654586888849735,
0.018232285976409912,
0.0026932023465633392,
-0.09843285381793976,
-0.04276886209845543,
-0.02738424949347973,
0.012689169496297836,
-0.005708783399313688,
-0.01574280858039856,
-0.04459566995501518,
-0.008144530467689037,
-0.008305720053613186,
-0.01422046683728695,
-0.04262557998299599,
-0.009975818917155266,
0.00502820685505867,
0.028261834755539894,
0.0042043509893119335,
-0.04463149234652519,
-0.0167009886354208,
-0.03535415977239609,
0.026721583679318428,
-0.05484014004468918,
0.020453115925192833,
0.026184285059571266,
-0.02784990705549717,
-0.007141575682908297,
-0.004029729403555393,
-0.025181330740451813,
-0.06214738264679909,
-0.030840862542390823,
0.04488223046064377,
0.015286106616258621,
-0.005690873134881258,
-0.05924597755074501,
0.01971880905330181,
-0.03218410536646843,
-0.04577772691845894,
-0.03444075211882591,
-0.029658807441592216,
-0.006008774042129517,
-0.012733944691717625,
0.0420166440308094,
0.024232106283307076,
-0.006022206507623196,
0.005628188606351614,
0.062433939427137375,
0.04420165345072746,
-0.030912501737475395,
-0.023623168468475342,
-0.005171486176550388,
-0.045526985079050064,
0.025593258440494537,
-0.0724276676774025,
0.0053192428313195705,
-0.005346107762306929,
0.026918591931462288,
-0.0383630245923996,
-0.046494122594594955,
-0.04330615699291229,
-0.03658994287252426,
0.020650124177336693,
0.02811855636537075,
-0.027975276112556458,
-0.006183395627886057,
-0.03513924032449722,
0.03297214210033417,
-0.006510251667350531,
-0.06168172508478165,
0.039580896496772766,
-0.023802267387509346,
-0.004318526480346918,
0.04506132751703262,
0.07751408219337463,
0.017372610047459602,
0.001653308398090303,
-0.018697943538427353,
0.006366972345858812,
-0.013521980494260788,
-0.013477206230163574,
0.006317720282822847,
-0.07253512740135193,
-0.0035215357784181833,
-0.02007700689136982,
0.038291383534669876,
-0.022835133597254753,
0.04151516780257225,
-0.03221992403268814,
-0.031503528356552124,
-0.013584665022790432,
0.013656305149197578,
-0.006022206507623196,
-0.015178646892309189,
-0.01593981869518757,
-0.013486160896718502,
-0.04183754697442055,
-0.005072981584817171,
-0.02722305990755558,
0.039473436772823334,
-0.033222880214452744,
0.0045379227958619595,
0.013119007460772991,
0.0046923961490392685,
0.04803437367081642,
-0.022512754425406456,
-0.016423385590314865,
-0.007213215343654156,
0.015142827294766903,
-0.04291214048862457,
-0.019127782434225082,
0.011829494498670101,
0.02195754647254944,
0.002321571810171008,
0.027975276112556458,
0.00706098135560751,
0.05279840901494026,
-0.005941612180322409,
-0.021724717691540718,
-0.026900682598352432,
0.023569438606500626,
0.04022565484046936,
-0.005538639146834612,
0.0016936056781560183,
0.00539088249206543,
0.004211067222058773,
0.012250376865267754,
-0.06952626258134842,
-0.040762949734926224,
0.043879274278879166,
-0.005619233474135399,
0.02784990705549717,
-0.024590304121375084,
0.05301332846283913,
0.015321926213800907,
0.039473436772823334,
-0.08854658901691437,
-0.0063759274780750275,
-0.0010941834188997746,
0.03136024996638298,
0.024984322488307953,
-0.023408249020576477,
-0.001441747648641467,
-0.03089459240436554,
0.0038931663148105145,
0.003156621241942048,
-0.005328197497874498,
0.06221901997923851,
-0.006066981237381697,
-0.02437538467347622,
0.021742628887295723,
-0.004634188953787088,
-0.0013801823370158672,
0.019002413377165794,
-0.058565400540828705,
-0.046816498041152954,
0.08639739453792572,
0.00006506333738798276,
0.006975909229367971,
-0.09785974025726318,
-0.029228970408439636,
-0.06096532568335533,
0.03089459240436554,
-0.030554303899407387,
-0.01372794434428215,
-0.015590574592351913,
-0.015689078718423843,
-0.026703672483563423,
-0.002303662011399865,
-0.004867017734795809,
-0.05154471471905708,
-0.019754629582166672,
0.029103601351380348,
0.009948953986167908,
0.05369390547275543,
0.0568818673491478,
0.019145691767334938,
0.05218947306275368,
-0.001205560634844005,
-0.07686932384967804,
-0.009004206396639347,
0.05670277029275894,
0.02358734980225563,
0.04190918430685997,
-0.02738424949347973,
-0.004211067222058773,
0.0767260491847992,
0.02553952857851982,
-0.05197455361485481,
-0.0038931663148105145,
0.024984322488307953,
-0.01683531329035759,
-0.04280468076467514,
-0.053801365196704865,
-0.02996327541768551,
0.015626395121216774,
0.032040826976299286,
-0.0047550806775689125,
0.031342338770627975,
-0.027831997722387314,
-0.032828859984874725,
-0.04409419372677803,
-0.04581354558467865,
0.026972321793437004,
0.001817855634726584,
-0.006447567138820887,
-0.00964448507875204,
0.008184827864170074,
0.029121510684490204,
0.023533619940280914,
-0.034154195338487625,
-0.02897823043167591,
0.03315123915672302,
-0.03264976292848587,
-0.05996237322688103,
-0.022369476035237312,
0.007490818854421377,
-0.06257721781730652,
0.04781945422291756,
-0.05612965300679207,
-0.01723828725516796,
-0.008404224179685116,
0.06003401055932045,
-0.024751493707299232,
-0.03940179944038391,
-0.0005454126512631774,
-0.004670008551329374,
0.008825107477605343,
-0.03553325682878494,
0.02804691530764103,
-0.0022219480015337467,
0.016118917614221573,
-0.025790268555283546,
-0.015241331420838833,
0.036966051906347275,
0.010119098238646984,
0.012214557267725468,
0.04190918430685997,
-0.00838631484657526,
-0.012286197394132614,
-0.013324971310794353,
0.04112114757299423,
0.014596574939787388,
-0.038721222430467606,
-0.009975818917155266,
-0.03447657451033592,
0.005377450026571751,
0.008623620495200157,
0.03238111361861229,
-0.03764662519097328,
-0.04588518291711807,
0.00041612552013248205,
0.03293631970882416,
-0.01568012498319149,
-0.009725079871714115,
0.006626666057854891,
0.016181601211428642,
-0.02870958298444748,
-0.03925851732492447,
0.005592369008809328,
-0.04549116641283035,
-0.05222529172897339,
-0.11326225847005844,
-0.019074052572250366,
-0.009859404526650906,
0.04144352674484253,
-0.03628547489643097,
-0.024035096168518066,
0.012098142877221107,
0.01015491783618927,
-0.017918862402439117,
-0.01316378265619278,
-0.00812214333564043,
0.05716842785477638,
-0.003911076113581657,
0.02527088113129139,
0.03003491647541523,
0.04660158231854439,
-0.008059458807110786,
-0.047246336936950684,
0.04713887721300125,
0.030178194865584373,
-0.02519924007356167,
0.03311542049050331,
-0.023211240768432617,
-0.00008647127833683044,
0.040010735392570496,
0.02206500619649887,
0.01570698991417885,
0.06472640484571457,
0.01208918821066618,
-0.030769221484661102,
-0.0053864046931266785,
-0.009778809733688831,
-0.006326674949377775,
-0.10473714023828506,
0.029712537303566933,
0.08073786646127701,
0.016817403957247734,
-0.05140143632888794,
0.02586190775036812,
-0.021491888910531998,
0.004437179770320654,
0.010754900053143501,
0.07758571952581406,
-0.027169330045580864,
-0.03050057403743267,
0.005498341750353575,
-0.029425978660583496,
0.009456431493163109,
-0.06805764883756638,
-0.038255564868450165,
0.05372972413897514,
0.0031790086068212986,
-0.003577504074200988,
0.020256105810403824,
-0.04481058940291405,
-0.011354881338775158,
0.05351480469107628,
0.016718899831175804,
-0.01733679138123989,
-0.027169330045580864,
-0.01971880905330181,
-0.026452934369444847,
-0.03284677118062973,
-0.03137815743684769,
-0.017318882048130035,
-0.021079961210489273,
0.007307242602109909,
0.015062232501804829,
0.03510342165827751,
-0.024518664926290512,
0.017381565645337105,
-0.015223422087728977,
-0.02073967270553112,
-0.005471476819366217,
0.03284677118062973,
-0.006644575856626034,
-0.003364823991432786,
0.004358823876827955,
-0.012465296313166618,
0.031503528356552124,
-0.006796810310333967,
-0.0367153100669384,
-0.03386763483285904,
0.02390972711145878,
-0.02394554764032364,
0.018330790102481842,
0.03381390497088432,
-0.04781945422291756,
0.03460194170475006,
-0.0005230252863839269,
0.005502819083631039,
0.006165485829114914,
0.007893792353570461,
0.02566489763557911,
-0.005722215864807367,
-0.03281095251441002,
-0.000967694737482816,
0.06540698558092117,
-0.030321475118398666,
0.020829223096370697,
0.011560846120119095,
-0.011238466948270798,
0.015886088833212852,
0.012590665370225906,
-0.031019961461424828,
-0.007804242428392172,
0.007307242602109909,
-0.06658903509378433,
0.020291926339268684,
-0.0022577678319066763,
-0.028494663536548615,
0.008162440732121468,
0.04112114757299423,
0.013217512518167496,
-0.02682904154062271,
0.004961044527590275,
-0.06562190502882004,
0.006460999138653278,
-0.021330701187253,
0.0172024667263031,
-0.02811855636537075,
-0.015062232501804829,
-0.004746125545352697,
-0.05763408541679382,
0.058493759483098984,
-0.017614394426345825,
-0.009366882033646107,
0.02811855636537075,
-0.04287632182240486,
-0.018035277724266052,
-0.05501923710107803,
-0.06361599266529083,
0.036267563700675964,
0.07056503742933273,
0.008256467990577221,
-0.023103781044483185,
0.019324790686368942,
-0.011963818222284317,
0.002101056044921279
]
|
36,387 | statistics | quantiles | Divide *data* into *n* continuous intervals with equal probability.
Returns a list of (n - 1) cut points separating the intervals.
Set *n* to 4 for quartiles (the default). Set *n* to 10 for deciles.
Set *n* to 100 for percentiles which gives the 99 cuts points that
separate *data* in to 100 equal sized groups.
The *data* can be any iterable containing sample.
The cut points are linearly interpolated between data points.
If *method* is set to *inclusive*, *data* is treated as population
data. The minimum value is treated as the 0th percentile and the
maximum value is treated as the 100th percentile.
| def quantiles(data, *, n=4, method='exclusive'):
"""Divide *data* into *n* continuous intervals with equal probability.
Returns a list of (n - 1) cut points separating the intervals.
Set *n* to 4 for quartiles (the default). Set *n* to 10 for deciles.
Set *n* to 100 for percentiles which gives the 99 cuts points that
separate *data* in to 100 equal sized groups.
The *data* can be any iterable containing sample.
The cut points are linearly interpolated between data points.
If *method* is set to *inclusive*, *data* is treated as population
data. The minimum value is treated as the 0th percentile and the
maximum value is treated as the 100th percentile.
"""
if n < 1:
raise StatisticsError('n must be at least 1')
data = sorted(data)
ld = len(data)
if ld < 2:
raise StatisticsError('must have at least two data points')
if method == 'inclusive':
m = ld - 1
result = []
for i in range(1, n):
j, delta = divmod(i * m, n)
interpolated = (data[j] * (n - delta) + data[j + 1] * delta) / n
result.append(interpolated)
return result
if method == 'exclusive':
m = ld + 1
result = []
for i in range(1, n):
j = i * m // n # rescale i to m/n
j = 1 if j < 1 else ld-1 if j > ld-1 else j # clamp to 1 .. ld-1
delta = i*m - j*n # exact integer math
interpolated = (data[j - 1] * (n - delta) + data[j] * delta) / n
result.append(interpolated)
return result
raise ValueError(f'Unknown method: {method!r}')
| (data, *, n=4, method='exclusive') | [
-0.041916292160749435,
-0.020731665194034576,
-0.04815321043133736,
-0.05996503308415413,
0.037107937037944794,
0.021027831360697746,
0.05623681843280792,
-0.0650869756937027,
-0.030034782364964485,
0.0598953478038311,
0.014137601479887962,
0.07198591530323029,
0.01935536041855812,
0.00046874902909621596,
-0.034215956926345825,
0.0002779284259304404,
0.007168974727392197,
0.021254312247037888,
-0.02470378205180168,
-0.012970357201993465,
0.02695116400718689,
0.0353832021355629,
-0.016837945207953453,
0.009547018446028233,
0.008257823064923286,
0.05783960223197937,
0.03808354586362839,
-0.020261282101273537,
-0.040627095848321915,
0.03376299887895584,
-0.031114919111132622,
0.001045838464051485,
0.008427683264017105,
-0.02130657620728016,
0.019912851974368095,
-0.023327479138970375,
0.03278739005327225,
-0.0019403269980102777,
-0.09609736502170563,
0.06344934552907944,
-0.021080097183585167,
-0.033745575696229935,
-0.0025065280497074127,
-0.016167214140295982,
0.0003258377546444535,
0.030435478314757347,
0.039686329662799835,
0.041811760514974594,
-0.017317038029432297,
-0.0008133694063872099,
0.033745575696229935,
-0.0066985925659537315,
0.011123670265078545,
0.007735176011919975,
-0.028519105166196823,
0.07505211234092712,
0.024320507422089577,
0.00634145038202405,
0.023815281689167023,
-0.014747356995940208,
-0.00025751255452632904,
0.010635866783559322,
0.05850162357091904,
-0.038327448070049286,
-0.04261315241456032,
0.008048764429986477,
-0.05414623022079468,
-0.016463380306959152,
-0.05885005369782448,
0.02459925226867199,
0.026167193427681923,
0.019024351611733437,
0.018083587288856506,
0.004817063454538584,
-0.01603655330836773,
0.07630646228790283,
0.04247378185391426,
0.00507403165102005,
0.05620197579264641,
0.016567910090088844,
0.03559226170182228,
-0.00009507003414910287,
0.0477699376642704,
-0.04289189726114273,
-0.016472091898322105,
-0.0012489085784181952,
0.015531327575445175,
-0.001218420802615583,
0.024146292358636856,
-0.002976910211145878,
-0.05083613470196724,
0.016324007883667946,
0.03895462304353714,
0.0018521304009482265,
-0.0356445275247097,
-0.026271723210811615,
-0.035034772008657455,
0.022787410765886307,
-0.04432046785950661,
-0.039930231869220734,
0.027874507009983063,
-0.006633261684328318,
0.018675919622182846,
0.0004472442960832268,
-0.007952945306897163,
-0.002689454471692443,
-0.030975546687841415,
0.03982570394873619,
-0.06968627125024796,
0.006332739721983671,
-0.056585248559713364,
0.05466887727379799,
0.030435478314757347,
-0.030104467645287514,
0.0004725600010715425,
0.006485178600996733,
-0.05484309419989586,
0.034512124955654144,
0.035853587090969086,
-0.05895458161830902,
-0.032456379383802414,
0.020696822553873062,
-0.06118454411625862,
0.0238849688321352,
-0.016393695026636124,
-0.016646306961774826,
0.06965142488479614,
-0.0039067864418029785,
-0.06724724918603897,
-0.012395445257425308,
0.06076642498373985,
0.01643724925816059,
-0.0076611340045928955,
0.03146335110068321,
-0.00032610996277071536,
-0.04163754731416702,
-0.012142832390964031,
0.019756056368350983,
0.04599293693900108,
0.003660706803202629,
0.022142812609672546,
-0.04679432883858681,
-0.03202084079384804,
0.06763052195310593,
0.04195113480091095,
-0.011341440491378307,
0.0665852278470993,
0.0016811812529340386,
0.016393695026636124,
-0.04756087809801102,
-0.031811781227588654,
0.030278684571385384,
0.03324035182595253,
-0.10961650311946869,
0.09310085326433182,
-0.04432046785950661,
0.0047865756787359715,
-0.005818803329020739,
-0.06275248527526855,
-0.04209050536155701,
0.0017824440728873014,
0.03499992936849594,
-0.020104488357901573,
0.011437258683145046,
-0.039686329662799835,
0.04094068333506584,
-0.01311844028532505,
-0.024686360731720924,
-0.01685536652803421,
-0.03134139999747276,
0.008153293281793594,
0.030139312148094177,
0.02264803647994995,
-0.007199462503194809,
-0.02517416514456272,
-0.022682880982756615,
-0.01690763048827648,
-0.009364092722535133,
-0.010705552995204926,
-0.006598418578505516,
-0.0137369055300951,
-0.11456422507762909,
0.03170725330710411,
-0.024790890514850616,
-0.05264797434210777,
-0.003105394309386611,
0.06034830957651138,
0.002036145655438304,
-0.018972085788846016,
-0.010461650788784027,
-0.03655044734477997,
-0.062055621296167374,
-0.04195113480091095,
0.006763923447579145,
0.0022604484111070633,
-0.02041807770729065,
-0.0363762341439724,
0.03160272166132927,
0.011637606658041477,
0.017979057505726814,
-0.009006950072944164,
0.04738666117191315,
0.0435539186000824,
-0.035679370164871216,
0.01801390014588833,
-0.007665489800274372,
-0.037735115736722946,
-0.0074346535839140415,
0.057456329464912415,
0.055156681686639786,
0.024372773244976997,
-0.02965150773525238,
0.01702958159148693,
0.03902431204915047,
-0.006681171245872974,
0.0435539186000824,
0.02895464561879635,
-0.06996501237154007,
0.023275213316082954,
-0.006441624369472265,
0.05299640819430351,
-0.02695116400718689,
0.01836233213543892,
0.08229948580265045,
0.022665459662675858,
0.03259575366973877,
0.0428222119808197,
0.008061829954385757,
0.025104478001594543,
-0.04616715386509895,
-0.009442489594221115,
0.018257802352309227,
0.040627095848321915,
-0.029337918385863304,
-0.02311841957271099,
-0.016297876834869385,
-0.0029181125573813915,
-0.009425068274140358,
-0.02141110599040985,
0.06390231102705002,
-0.060278624296188354,
0.018432017415761948,
-0.024337928742170334,
0.04940756410360336,
0.014668959192931652,
-0.04209050536155701,
-0.056167133152484894,
0.044041723012924194,
0.024843154475092888,
0.03794417157769203,
-0.00869771745055914,
-0.02259577251970768,
-0.05724726989865303,
-0.03996507450938225,
0.025435488671064377,
0.016611464321613312,
-0.02724733203649521,
-0.02123689092695713,
0.033623624593019485,
-0.008989528752863407,
0.05829256400465965,
-0.11547014862298965,
-0.012726454995572567,
-0.002613235032185912,
0.009695102460682392,
-0.012273494154214859,
-0.02878042869269848,
-0.004943369887769222,
0.03158530220389366,
0.041149742901325226,
-0.0063109626062214375,
0.05578385666012764,
0.04466889798641205,
-0.03602780029177666,
0.006520021706819534,
0.030853595584630966,
0.07198591530323029,
-0.025853605940937996,
0.02254350855946541,
-0.08599285781383514,
0.02670726180076599,
-0.02242155745625496,
-0.0026219459250569344,
-0.019442468881607056,
0.03679434955120087,
0.026480782777071,
-0.0021069208160042763,
-0.0020807883702218533,
0.06616710871458054,
0.05163752660155296,
-0.022578351199626923,
0.016742127016186714,
-0.0905921459197998,
-0.005797026678919792,
0.04372813552618027,
0.015026101842522621,
-0.0034690694883465767,
-0.03689888119697571,
0.025104478001594543,
0.01952957734465599,
0.016324007883667946,
-0.043449386954307556,
0.0012097100261598825,
0.013057464733719826,
0.0034581811632961035,
0.03158530220389366,
0.0008291577105410397,
-0.03360620141029358,
-0.03325777128338814,
-0.028919801115989685,
0.03324035182595253,
0.04508701711893082,
-0.015618435107171535,
-0.045156702399253845,
0.07658521085977554,
-0.07296152412891388,
-0.020627135410904884,
0.024843154475092888,
-0.04006960615515709,
-0.0031925023067742586,
-0.016498224809765816,
0.004148510750383139,
0.01739543490111828,
0.031811781227588654,
0.03954695910215378,
0.058571308851242065,
-0.029442448168992996,
0.007360612042248249,
-0.03479086980223656,
0.0009739744709804654,
-0.04073162376880646,
0.04205566272139549,
0.02519158646464348,
0.06334482133388519,
-0.0356445275247097,
0.03972117230296135,
0.04749119281768799,
-0.02036581188440323,
0.00719510717317462,
-0.04435531049966812,
-0.02688147872686386,
-0.028083566576242447,
0.0018532192334532738,
-0.004120200872421265,
0.007456430699676275,
-0.02430308610200882,
0.04153301566839218,
-0.005805737338960171,
0.013850145973265171,
0.07693363726139069,
0.029564399272203445,
-0.03125429153442383,
0.0403483510017395,
0.03599295765161514,
0.014817043207585812,
0.0017748221289366484,
0.03364104777574539,
-0.042752526700496674,
0.011959905736148357,
0.010078377090394497,
0.0708012506365776,
0.032857075333595276,
0.051289092749357224,
0.014773488976061344,
0.020034803077578545,
-0.0020633668173104525,
0.002445552498102188,
0.05195111408829689,
-0.04317064210772514,
0.07386744767427444,
-0.005644587799906731,
-0.05076644569635391,
-0.023031311109662056,
0.038153231143951416,
0.021445948630571365,
-0.03437275066971779,
-0.02813583053648472,
-0.02554001845419407,
-0.06776989996433258,
0.017857106402516365,
-0.03048774227499962,
-0.058048661798238754,
-0.006476467475295067,
0.02935534156858921,
0.0043009496293962,
0.021898910403251648,
0.04397203400731087,
0.010156773962080479,
0.021846644580364227,
-0.0358884297311306,
-0.04494764283299446,
-0.025505173951387405,
0.015461641363799572,
0.03078390844166279,
-0.049686308950185776,
0.003800079459324479,
0.04128911346197128,
-0.020052224397659302,
-0.00698604853823781,
0.03616717457771301,
-0.013902410864830017,
-0.006650683470070362,
0.024442458525300026,
0.027404125779867172,
0.02395465411245823,
-0.03944242745637894,
0.014477322809398174,
-0.0717768594622612,
0.02130657620728016,
-0.0603831522166729,
-0.022613193839788437,
0.04881523177027702,
-0.002452085493132472,
-0.004904170986264944,
0.05602775886654854,
0.017308326438069344,
-0.03177693858742714,
-0.03175951540470123,
-0.03578389808535576,
0.022961625829339027,
0.023275213316082954,
-0.11045273393392563,
-0.0319337323307991,
0.04383266344666481,
-0.028606213629245758,
-0.09881512820720673,
0.046271681785583496,
-0.06379777938127518,
-0.034041743725538254,
0.04536576196551323,
-0.02499994821846485,
-0.007813572883605957,
-0.09770014882087708,
-0.0020492118783295155,
0.01615850441157818,
-0.042508624494075775,
-0.050627075135707855,
-0.008819668553769588,
-0.011350151151418686,
0.0008204469340853393,
-0.06874550133943558,
0.03477344661951065,
0.05348421260714531,
-0.029459869489073753,
0.027195066213607788,
-0.004076646640896797,
-0.012212518602609634,
-0.02324037067592144,
-0.03252606466412544,
-0.062160152941942215,
-0.005139362532645464,
0.0048693278804421425,
0.014991258271038532,
0.0027134090196341276,
0.025452909991145134,
-0.052682820707559586,
-0.017830973491072655,
-0.0004905260284431279,
0.022560929879546165,
0.028153251856565475,
0.06571415066719055,
0.05752601474523544,
-0.03731699660420418,
-0.013249102048575878,
-0.01394596416503191,
0.008209913969039917,
-0.008179426193237305,
-0.010522626340389252,
0.015827493742108345,
-0.05982566252350807,
0.032386694103479385,
0.07156779617071152,
-0.026811791583895683,
0.01108882762491703,
0.04017413407564163,
0.06637617200613022,
0.005191626958549023,
0.04519154503941536,
0.034982506185770035,
-0.03672466427087784,
0.031045231968164444,
-0.009773499332368374,
0.03672466427087784,
0.00288326945155859,
-0.07547023147344589,
-0.03641107678413391,
-0.03752605617046356,
0.001762844854965806,
0.01394596416503191,
-0.009538307785987854,
0.023623645305633545,
-0.01895466446876526,
0.010200327262282372,
0.02554001845419407,
-0.01606268435716629,
0.005513926036655903,
0.07505211234092712,
0.009015660732984543,
0.04731697589159012,
-0.027038272470235825,
0.05885005369782448,
-0.004978212993592024,
0.06142844632267952,
-0.017979057505726814,
0.012543528340756893,
0.03059227205812931,
0.030923282727599144,
0.04407656565308571,
-0.05226470157504082,
-0.04818805307149887,
0.02606266364455223,
-0.013222969137132168,
-0.002817938569933176,
-0.010261302813887596,
0.0650869756937027,
-0.02707311511039734,
-0.01055746991187334,
-0.03059227205812931,
-0.025871027261018753,
0.007918102666735649,
0.007121065631508827,
0.013867567293345928,
0.03141108527779579,
0.04146333038806915,
-0.018344910815358162,
-0.012979067862033844,
0.010313567705452442,
0.010940744541585445,
-0.019163724035024643,
0.05254344642162323,
-0.01236060168594122,
0.058745525777339935,
0.026445938274264336,
-0.022212497889995575,
0.02064455673098564,
0.07749113440513611,
-0.06132391840219498,
0.02541806735098362,
0.11700324714183807,
0.03041805699467659,
-0.009320538491010666,
0.007565315347164869,
0.05090581998229027,
-0.012203807942569256,
-0.01394596416503191,
0.039790861308574677,
-0.025853605940937996,
0.02081877365708351,
0.09637610614299774,
-0.003009575651958585,
0.09393709152936935,
0.01567069999873638,
0.0069512054324150085,
-0.06515666097402573,
0.022212497889995575,
-0.026846634224057198,
0.021445948630571365,
-0.027560919523239136,
-0.02188148908317089,
-0.005984308198094368,
-0.0655747801065445,
0.02264803647994995,
0.017857106402516365,
0.0003345485311001539,
-0.007491273805499077,
0.024372773244976997,
0.041916292160749435,
-0.008401550352573395,
-0.058571308851242065,
-0.05031348764896393,
-0.014163734391331673,
0.09763046354055405,
-0.012691611424088478,
-0.0206619780510664,
0.02529611624777317,
-0.039790861308574677,
0.006480822805315256,
-0.12857116758823395,
-0.05836224928498268,
-0.07017407566308975,
-0.027212487533688545,
-0.014189866371452808,
0.027491232380270958,
-0.052682820707559586,
-0.04313579946756363,
0.0403483510017395,
-0.0848778784275055,
0.02148079313337803,
0.021846644580364227,
0.04958178102970123,
0.037107937037944794,
0.002565325703471899,
-0.013902410864830017,
-0.032038263976573944,
0.048048682510852814,
0.007303992286324501,
-0.028397154062986374,
-0.05303125083446503,
-0.057107895612716675,
-0.03329261392354965,
0.017857106402516365,
0.053344838321208954,
-0.06066189706325531,
0.04094068333506584,
0.03541804477572441,
-0.026254301890730858,
-0.031202027574181557,
-0.011480812914669514,
-0.005879778880625963,
-0.02395465411245823,
0.011768268421292305,
0.0811845064163208,
0.028379732742905617,
0.00719510717317462,
-0.013710773549973965,
0.018989508971571922,
-0.008723849430680275,
-0.04442499577999115,
0.04017413407564163,
-0.025731654837727547,
-0.02818809635937214,
0.006972982082515955,
0.03620201721787453,
0.023675909265875816,
0.015783939510583878,
-0.0695468932390213,
0.025627125054597855,
-0.017552228644490242,
-0.021323997527360916,
-0.04069678112864494,
0.0001020794952637516,
0.01153307780623436,
0.033100977540016174,
-0.04341454431414604,
-0.06142844632267952,
0.024215977638959885,
-0.007373678497970104,
-0.004486053716391325,
-0.030087046325206757,
-0.0039590513333678246,
0.049093976616859436,
-0.007861481979489326,
0.004756087902933359,
-0.017709022387862206,
0.012743876315653324,
-0.034686341881752014,
-0.018815292045474052,
-0.01662888564169407,
0.011358861811459064,
-0.035087037831544876,
0.0008776114555075765,
-0.003477780381217599,
0.019790900871157646,
-0.00824040174484253,
-0.0029006910044699907,
0.028379732742905617,
-0.018623655661940575,
0.008963396772742271,
0.003732570679858327,
-0.04358876124024391,
0.026254301890730858,
-0.0012946402421221137,
-0.0021188980899751186,
0.0038479885552078485,
-0.004525252152234316,
0.0547037199139595,
-0.015139342285692692,
-0.007081867195665836,
-0.044634055346250534,
0.005461661145091057,
0.05376295745372772,
0.04958178102970123,
0.02200344018638134,
0.007290925830602646,
0.0022212497424334288,
0.030522584915161133,
-0.06425073742866516,
-0.03881525248289108,
-0.0960276797413826,
0.009651548229157925,
0.021027831360697746,
-0.05435528978705406,
-0.03019157610833645,
-0.002436841605231166,
0.026637576520442963,
0.07073156535625458,
0.04358876124024391,
-0.05749117210507393,
-0.03829260542988777,
0.025034792721271515,
0.013336209580302238,
0.015696832910180092,
-0.03041805699467659,
-0.014303106814622879,
0.0027569630183279514,
-0.029982516542077065,
-0.010296146385371685,
0.018675919622182846,
0.04707307368516922,
-0.026672419160604477,
-0.007878904230892658,
-0.010949455201625824,
0.03482571244239807,
0.013040043413639069,
-0.019895430654287338,
-0.02383270487189293,
-0.01801390014588833,
-0.018902400508522987,
0.0309407040476799,
0.014930282719433308,
-0.023519115522503853,
0.009808341972529888,
-0.044215936213731766,
-0.008549634367227554,
-0.052682820707559586,
0.02581876330077648,
-0.01635885238647461,
0.020801350474357605,
-0.037282153964042664,
0.025278694927692413,
0.041811760514974594,
-0.00967768020927906,
0.0006614751182496548,
-0.02846684120595455,
-0.05031348764896393,
0.02801387943327427,
0.053275153040885925,
0.0019054838921874762,
-0.057456329464912415,
-0.025731654837727547,
-0.019616683945059776,
0.026202037930488586,
0.006964271422475576,
0.008196847513318062,
0.050452858209609985,
-0.04470374062657356,
-0.0038153231143951416,
-0.037212468683719635,
-0.006380648817867041,
0.015330979600548744,
-0.0003236600605305284,
-0.010052244178950787,
0.051811739802360535,
-0.021341420710086823,
-0.014756067655980587,
-0.02141110599040985,
0.016053974628448486,
-0.01394596416503191,
-0.02247382141649723,
-0.05167236924171448,
-0.0011618008138611913,
0.020452920347452164,
-0.03477344661951065,
0.010261302813887596,
-0.01935536041855812,
-0.011698582209646702,
0.011350151151418686,
-0.01238673459738493,
-0.004274817183613777,
-0.007730820681899786,
-0.0051654945127666,
0.04944240674376488,
0.023867547512054443,
0.015043523162603378,
-0.05330999568104744,
0.015426797792315483,
0.02688147872686386,
0.003747814567759633
]
|
36,390 | statistics | stdev | Return the square root of the sample variance.
See ``variance`` for arguments and other details.
>>> stdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
1.0810874155219827
| def stdev(data, xbar=None):
"""Return the square root of the sample variance.
See ``variance`` for arguments and other details.
>>> stdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
1.0810874155219827
"""
# Fixme: Despite the exact sum of squared deviations, some inaccuracy
# remain because there are two rounding steps. The first occurs in
# the _convert() step for variance(), the second occurs in math.sqrt().
var = variance(data, xbar)
try:
return var.sqrt()
except AttributeError:
return math.sqrt(var)
| (data, xbar=None) | [
-0.005751325283199549,
0.052862491458654404,
0.04877975955605507,
-0.04917028173804283,
0.08754795789718628,
0.014919719658792019,
0.03312337398529053,
-0.0450875498354435,
0.020271647721529007,
0.060708437114953995,
0.0005536094540730119,
-0.03598128631711006,
0.013801406137645245,
-0.058010283857584,
-0.01649068295955658,
0.07789140939712524,
-0.02188698947429657,
0.03457895666360855,
0.023342570289969444,
0.0330168679356575,
-0.027141286060214043,
-0.0013435292057693005,
-0.06166699156165123,
-0.03177429735660553,
-0.02327156625688076,
0.011964176781475544,
0.029058394953608513,
-0.04189237207174301,
-0.009168393909931183,
0.0017562400316819549,
-0.0008847766439430416,
-0.006652188953012228,
0.030531728640198708,
-0.007229096721857786,
0.010668354108929634,
0.05247196927666664,
0.02376859448850155,
-0.07995052635669708,
-0.04569108411669731,
0.0055250003933906555,
-0.02085743099451065,
0.013703775592148304,
-0.016694819554686546,
0.04899277165532112,
0.043170444667339325,
-0.003678895765915513,
0.025827711448073387,
0.037951648235321045,
-0.09400931745767593,
0.015345743857324123,
0.017174096778035164,
0.0029777309391647577,
-0.03147253021597862,
0.03140152618288994,
0.03189855441451073,
0.011999678798019886,
-0.0005400188383646309,
-0.020786426961421967,
0.050803374499082565,
0.00004028646071674302,
0.08513382077217102,
0.0434899628162384,
0.013348755426704884,
-0.033584900200366974,
0.0013302159495651722,
-0.012221566401422024,
0.02518867515027523,
0.018177028745412827,
-0.00434012059122324,
0.024869157001376152,
-0.03578602522611618,
0.029093896970152855,
-0.028525864705443382,
-0.0022366265766322613,
0.06997445970773697,
0.028969639912247658,
0.04331245273351669,
-0.032555341720581055,
-0.051122892647981644,
0.015150482766330242,
0.03922972083091736,
0.01673032157123089,
0.00819652620702982,
0.043880484998226166,
-0.010606225579977036,
0.021247953176498413,
-0.000645692809484899,
0.04391598701477051,
-0.030123455449938774,
0.03058498166501522,
0.00490371510386467,
0.006550120655447245,
0.03353164717555046,
0.023058554157614708,
-0.062128517776727676,
-0.0031463655177503824,
-0.03372690826654434,
-0.015363494865596294,
0.030265463516116142,
-0.03149028122425079,
0.023342570289969444,
0.08158361911773682,
0.053572531789541245,
0.052684981375932693,
-0.029129398986697197,
0.04466152936220169,
0.0455135740339756,
0.011662409640848637,
-0.007411044556647539,
0.0324665866792202,
0.0038231227081269026,
-0.01913558319211006,
0.023307068273425102,
0.02259702794253826,
-0.06926441937685013,
-0.058116789907217026,
-0.005529438145458698,
0.04327695071697235,
-0.025472691282629967,
-0.01963261142373085,
-0.007198032457381487,
0.0016375301638618112,
-0.05389204993844032,
0.021301206201314926,
0.0036167672369629145,
0.036886587738990784,
0.018496546894311905,
-0.042460404336452484,
-0.07512225210666656,
0.08335871994495392,
0.09841156750917435,
-0.014688956551253796,
0.017147470265626907,
-0.0005713604623451829,
0.06997445970773697,
-0.001809493056498468,
0.08158361911773682,
0.028170844539999962,
0.05857831612229347,
-0.06454265117645264,
0.037596628069877625,
0.038981206715106964,
-0.04199887812137604,
-0.017449237406253815,
0.007881445810198784,
0.08868402242660522,
0.013304377906024456,
0.00982518121600151,
0.01179554220288992,
0.03456120565533638,
-0.057939279824495316,
0.01303811278194189,
0.018656305968761444,
-0.05005783215165138,
0.04434201121330261,
-0.04391598701477051,
-0.02190474048256874,
-0.0857018530368805,
0.01625104434788227,
-0.024780401960015297,
-0.04895726963877678,
0.0019526105606928468,
-0.013402008451521397,
-0.0324665866792202,
0.01963261142373085,
0.006164036225527525,
-0.07377317547798157,
0.08726394176483154,
-0.019171085208654404,
-0.018691807985305786,
-0.004444407764822245,
0.040898315608501434,
-0.08989108353853226,
0.0002854028716683388,
0.03125951811671257,
-0.05893333628773689,
-0.03149028122425079,
0.03303461894392967,
-0.014964097179472446,
-0.04451952129602432,
0.03040747158229351,
-0.00464632548391819,
0.000644028652459383,
0.04175036400556564,
-0.02067992091178894,
0.0005305886152200401,
-0.019366346299648285,
0.01329550240188837,
-0.02376859448850155,
-0.024372128769755363,
-0.03335413709282875,
-0.046472128480672836,
-0.022685782983899117,
-0.023200562223792076,
0.009505663067102432,
0.011591405607759953,
-0.007388855796307325,
-0.010978996753692627,
0.05563164874911308,
-0.10231678932905197,
0.011964176781475544,
-0.003980662673711777,
0.0000891017189132981,
-0.0253306832164526,
-0.03109976090490818,
-0.007517550606280565,
-0.03415293246507645,
-0.007592992391437292,
-0.026537751778960228,
0.008804498240351677,
-0.00513004045933485,
0.01284285169094801,
0.03523574396967888,
-0.01145827304571867,
0.03823566436767578,
-0.01345526147633791,
0.08250667154788971,
-0.09720449894666672,
0.02694602496922016,
0.044200003147125244,
0.09038811177015305,
-0.10096771270036697,
0.024886908009648323,
0.08016353845596313,
-0.018869318068027496,
0.017058715224266052,
0.020786426961421967,
-0.0028534738812595606,
0.004122670739889145,
-0.00006861179281258956,
0.02030714973807335,
0.02048465982079506,
0.0045331628061831,
-0.04167935997247696,
-0.053430523723363876,
0.0011127660982310772,
-0.008476104587316513,
-0.036922089755535126,
0.026875020936131477,
-0.03243108466267586,
-0.04001076519489288,
-0.012221566401422024,
-0.003208494046702981,
0.023697590455412865,
-0.01799064315855503,
0.0025450503453612328,
-0.04494554176926613,
0.019756868481636047,
-0.0014356124447658658,
-0.01649068295955658,
0.01537237036973238,
0.014511446468532085,
0.019064579159021378,
0.029289158061146736,
0.05034184828400612,
0.010925743728876114,
0.03418843448162079,
0.05783277377486229,
0.04164385795593262,
-0.024727148935198784,
-0.021940242499113083,
-0.021993495523929596,
0.008822249248623848,
0.055667150765657425,
-0.049915824085474014,
-0.007721687201410532,
0.004135983996093273,
-0.026164980605244637,
0.03109976090490818,
0.04175036400556564,
0.10892016440629959,
0.027496306225657463,
0.020608916878700256,
-0.0524364672601223,
0.011600281111896038,
0.0003874711401294917,
0.036212049424648285,
0.005760200787335634,
0.1392388790845871,
0.029981447383761406,
-0.017591245472431183,
-0.008271967992186546,
-0.03653156757354736,
0.05048385635018349,
0.03232457861304283,
-0.03598128631711006,
-0.0027203415520489216,
-0.10686104744672775,
0.0368155837059021,
0.06812835484743118,
-0.025117671117186546,
-0.043880484998226166,
-0.05186843499541283,
0.012620964087545872,
-0.014014418236911297,
0.017946265637874603,
-0.018691807985305786,
0.0006917344871908426,
0.019171085208654404,
0.03349614515900612,
-0.0008254217100329697,
0.04118233174085617,
0.0011055547511205077,
0.05257847532629967,
-0.005027972161769867,
0.04451952129602432,
0.011121004819869995,
-0.09138216823339462,
-0.016419678926467896,
-0.008547108620405197,
-0.006035341415554285,
-0.00026141127455048263,
-0.02364433743059635,
0.022100001573562622,
0.030123455449938774,
0.025827711448073387,
0.008223152719438076,
-0.056661207228899,
-0.0068430122919380665,
0.04409349709749222,
0.017751004546880722,
-0.021425463259220123,
0.08449478447437286,
0.011547028087079525,
0.04206988215446472,
0.036016788333654404,
-0.04011727124452591,
-0.026271486654877663,
0.03161453828215599,
-0.040756307542324066,
-0.04675614461302757,
-0.07427020370960236,
0.021922491490840912,
0.011121004819869995,
0.04189237207174301,
-0.03406417742371559,
0.008511606603860855,
-0.011884297244250774,
-0.008200963959097862,
-0.018354538828134537,
-0.01373040210455656,
0.015221486799418926,
0.06482666730880737,
-0.013544016517698765,
-0.025401687249541283,
0.0024252310395240784,
-0.02272128500044346,
-0.04739518091082573,
0.022277511656284332,
0.03527124598622322,
0.02605847455561161,
-0.004282429814338684,
-0.0005913303466513753,
0.024620642885565758,
0.009230522438883781,
-0.0479632131755352,
0.04948979988694191,
0.03227132558822632,
0.003066485980525613,
-0.02517092414200306,
-0.017333855852484703,
0.09486136585474014,
-0.039868757128715515,
-0.008915442042052746,
0.016703695058822632,
-0.016437429934740067,
-0.021496467292308807,
-0.06219952180981636,
0.005183293484151363,
0.027567310258746147,
-0.0324665866792202,
-0.05552514269948006,
-0.03922972083091736,
-0.03195180743932724,
0.020768675953149796,
0.017688876017928123,
0.01771550253033638,
-0.037596628069877625,
0.023200562223792076,
-0.0028113152366131544,
-0.03509373590350151,
-0.017129719257354736,
-0.00737998029217124,
-0.004557570442557335,
0.03054947964847088,
0.014351687394082546,
-0.12006779760122299,
-0.0031951807904988527,
-0.007588554639369249,
-0.012549960054457188,
0.012257068417966366,
0.008436164818704128,
0.04501654580235481,
0.02428337372839451,
0.00044765815255232155,
0.022188756614923477,
-0.015132731758058071,
-0.049560803920030594,
-0.012079558335244656,
0.056199681013822556,
-0.04682714864611626,
0.0028113152366131544,
-0.045584578067064285,
0.009479036554694176,
-0.02481590397655964,
-0.022028997540473938,
-0.03976225107908249,
-0.019597109407186508,
-0.026981526985764503,
0.012052931822836399,
0.020378153771162033,
0.007087088655680418,
0.02138996124267578,
0.044235505163669586,
0.044235505163669586,
0.04064980149269104,
-0.01839004084467888,
0.05264947935938835,
0.0068075102753937244,
-0.030673736706376076,
-0.014573574997484684,
-0.08960706740617752,
0.016890080645680428,
-0.004730642773211002,
0.019419599324464798,
-0.028046587482094765,
-0.043170444667339325,
-0.030868997797369957,
-0.015079478733241558,
0.009665422141551971,
0.025756707414984703,
-0.015061727724969387,
-0.0381646603345871,
-0.009576667100191116,
-0.004016164690256119,
-0.00750867510214448,
-0.05502811446785927,
0.03163228929042816,
0.0032395583111792803,
0.0009929467923939228,
0.01658831350505352,
0.07462522387504578,
0.02501116506755352,
-0.0064791166223585606,
-0.04476803168654442,
0.013153494335711002,
0.008653614670038223,
0.0034237250220030546,
0.03470321372151375,
-0.043170444667339325,
-0.009967189282178879,
-0.03523574396967888,
0.037064097821712494,
0.022171005606651306,
-0.040401287376880646,
-0.06397461891174316,
-0.02327156625688076,
-0.017937390133738518,
-0.0007178062223829329,
-0.011742289178073406,
-0.011653534136712551,
0.00581789156422019,
-0.06716980040073395,
-0.05559614673256874,
0.0010878037428483367,
0.02433662675321102,
0.009878434240818024,
0.025792209431529045,
0.05754875764250755,
-0.00955004058778286,
0.02156747132539749,
0.08932305872440338,
-0.004859337583184242,
0.007264598738402128,
0.019064579159021378,
0.03161453828215599,
-0.043667472898960114,
-0.0008692445117048919,
-0.012816225178539753,
0.02069767192006111,
0.0013302159495651722,
-0.012993735261261463,
-0.010765984654426575,
0.02449638582766056,
-0.021602973341941833,
-0.015789518132805824,
-0.06578522175550461,
0.013836908154189587,
0.053430523723363876,
0.005396305583417416,
0.00921277143061161,
-0.011644658632576466,
-0.008280843496322632,
-0.048886265605688095,
-0.05161992087960243,
-0.036709077656269073,
0.04735967889428139,
0.013836908154189587,
-0.0025272993370890617,
0.010615101084113121,
0.020058635622262955,
-0.005027972161769867,
0.034472450613975525,
-0.04842473939061165,
-0.011192007921636105,
0.0277803223580122,
-0.04050779342651367,
0.029324660077691078,
-0.03717060387134552,
-0.03555526211857796,
-0.03983325511217117,
-0.030496226623654366,
0.026182731613516808,
-0.018177028745412827,
0.05832980200648308,
-0.06031791493296623,
0.009266024455428123,
0.017759880051016808,
0.028028836473822594,
0.012558835558593273,
-0.034809719771146774,
-0.0015188202960416675,
-0.03773863613605499,
0.037596628069877625,
0.03699309378862381,
-0.02694602496922016,
-0.0754062682390213,
0.005050160922110081,
-0.03156128525733948,
0.03891020268201828,
0.021940242499113083,
0.010863615199923515,
0.014804338105022907,
-0.012807349674403667,
-0.008081144653260708,
-0.010428715497255325,
-0.004739518277347088,
-0.054105062037706375,
0.032892610877752304,
-0.026662008836865425,
0.0066788154654204845,
-0.02412361465394497,
0.042495906352996826,
0.02364433743059635,
0.0007444327347911894,
-0.002873443765565753,
-0.04118233174085617,
0.003696646774187684,
0.01625104434788227,
-0.007646245416253805,
0.0767553448677063,
0.013508514501154423,
0.023058554157614708,
0.010251205414533615,
-0.01716522127389908,
-0.037099599838256836,
-0.030496226623654366,
0.039868757128715515,
-0.015248113311827183,
-0.05073237046599388,
-0.02969743125140667,
-0.02746080420911312,
0.05779727175831795,
0.006953956093639135,
0.016721446067094803,
0.019224338233470917,
-0.007118152920156717,
-0.06411662697792053,
-0.04892176762223244,
-0.04288642853498459,
-0.02746080420911312,
-0.0003636182227637619,
0.03330088406801224,
0.0354665070772171,
0.009594418108463287,
0.0342416875064373,
0.00029843876836821437,
-0.042140886187553406,
-0.07419919967651367,
-0.03452570363879204,
0.008431727066636086,
-0.04831823334097862,
-0.059146348387002945,
0.0021600753534585238,
-0.007282349746674299,
0.009585542604327202,
-0.032058313488960266,
-0.04082731157541275,
-0.03461445868015289,
0.0033571587409824133,
-0.0109346192330122,
-0.029147149994969368,
-0.04601060226559639,
-0.02154972031712532,
0.0319163054227829,
-0.0461881123483181,
0.019384097307920456,
0.014200803823769093,
0.01554988045245409,
0.023395823314785957,
-0.013304377906024456,
0.023733092471957207,
0.04988032206892967,
-0.011387269012629986,
0.060708437114953995,
0.02137221023440361,
0.015088354237377644,
-0.03756112605333328,
-0.01777763105928898,
-0.019011326134204865,
-0.021496467292308807,
0.022810040041804314,
-0.05023534223437309,
0.0450875498354435,
0.03074474073946476,
0.031206266954541206,
0.041963376104831696,
-0.017493614926934242,
0.0019171085441485047,
0.03837767243385315,
0.013268875889480114,
0.027496306225657463,
0.02446088381111622,
-0.010197952389717102,
0.003390441881492734,
0.006918454077094793,
0.020555663853883743,
0.006798634771257639,
-0.061915505677461624,
-0.11680161207914352,
-0.005316426046192646,
0.02067992091178894,
0.03404642641544342,
-0.05769076570868492,
-0.04288642853498459,
0.010943494737148285,
0.015319117344915867,
-0.01858530193567276,
-0.01803502067923546,
0.04601060226559639,
0.03156128525733948,
0.040401287376880646,
0.0468626506626606,
0.03972674906253815,
0.022100001573562622,
0.016517309471964836,
-0.03143702819943428,
0.026484498754143715,
0.023023052141070366,
-0.0017296135192736983,
-0.006634437944740057,
-0.008875502273440361,
-0.028401607647538185,
0.015647510066628456,
0.06905140727758408,
0.03834217041730881,
0.034490201622247696,
-0.03630080446600914,
-0.029289158061146736,
-0.011848795227706432,
0.021443214267492294,
-0.040543295443058014,
-0.06312257051467896,
0.052897993475198746,
0.03441919758915901,
-0.030780242756009102,
-0.01633092388510704,
0.030318716540932655,
-0.04948979988694191,
-0.08953606337308884,
0.0027203415520489216,
0.04185687005519867,
-0.021815985441207886,
-0.025490442290902138,
-0.05552514269948006,
-0.03495172783732414,
0.016304297372698784,
-0.004397811368107796,
-0.06550120562314987,
-0.009434659034013748,
-0.033584900200366974,
0.021957993507385254,
0.06060193106532097,
-0.041075825691223145,
-0.0007821536273695529,
0.028046587482094765,
0.004659638740122318,
-0.019224338233470917,
0.009913936257362366,
0.01075710915029049,
-0.05037735030055046,
-0.07086201012134552,
-0.035519760102033615,
-0.016446305438876152,
-0.027496306225657463,
-0.060530927032232285,
0.029005141928792,
0.06784433871507645,
0.02882763184607029,
-0.013899036683142185,
-0.001191536197438836,
-0.00084206328028813,
0.017094217240810394,
0.05573815479874611,
0.03965574502944946,
-0.04860224947333336,
-0.0002285441878484562,
-0.03642506152391434,
0.03054947964847088,
-0.04341895878314972,
0.010828113183379173,
-0.09471935778856277,
-0.0010595130734145641,
0.023537831380963326,
-0.032555341720581055,
-0.00293335341848433,
-0.05698072537779808,
-0.003201837418600917,
0.01527473982423544,
0.005476185120642185,
0.015061727724969387,
-0.02866787277162075,
0.04579759016633034,
0.015265864320099354,
-0.019668113440275192,
0.01250558253377676,
0.07753638923168182,
0.0010894678998738527,
0.030496226623654366,
-0.014049920253455639,
-0.0031108635012060404,
-0.03905221074819565,
0.03841317445039749,
0.01424518134444952,
0.007801566738635302,
0.05314650759100914,
-0.04700465872883797,
-0.0205201618373394,
0.024869157001376152,
-0.03869719058275223,
0.047643695026636124,
0.03003470040857792,
0.01599365472793579,
-0.05208144709467888,
-0.01607353426516056,
-0.01894032210111618,
0.024017108604311943,
-0.0008326330571435392,
0.03922972083091736,
-0.04274442046880722,
0.012620964087545872,
-0.04569108411669731,
-0.042992934584617615,
0.05726474151015282,
-0.012301445938646793,
0.021496467292308807,
-0.0055605024099349976,
-0.06447164714336395,
-0.0005891114706173539,
-0.03642506152391434,
0.03433044254779816,
-0.00893763080239296,
0.05229445919394493,
-0.010277831926941872,
0.013188996352255344,
0.024372128769755363,
-0.040933817625045776,
0.007916947826743126
]
|
36,391 | statistics | variance | Return the sample variance of data.
data should be an iterable of Real-valued numbers, with at least two
values. The optional argument xbar, if given, should be the mean of
the data. If it is missing or None, the mean is automatically calculated.
Use this function when your data is a sample from a population. To
calculate the variance from the entire population, see ``pvariance``.
Examples:
>>> data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5]
>>> variance(data)
1.3720238095238095
If you have already calculated the mean of your data, you can pass it as
the optional second argument ``xbar`` to avoid recalculating it:
>>> m = mean(data)
>>> variance(data, m)
1.3720238095238095
This function does not check that ``xbar`` is actually the mean of
``data``. Giving arbitrary values for ``xbar`` may lead to invalid or
impossible results.
Decimals and Fractions are supported:
>>> from decimal import Decimal as D
>>> variance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")])
Decimal('31.01875')
>>> from fractions import Fraction as F
>>> variance([F(1, 6), F(1, 2), F(5, 3)])
Fraction(67, 108)
| def variance(data, xbar=None):
"""Return the sample variance of data.
data should be an iterable of Real-valued numbers, with at least two
values. The optional argument xbar, if given, should be the mean of
the data. If it is missing or None, the mean is automatically calculated.
Use this function when your data is a sample from a population. To
calculate the variance from the entire population, see ``pvariance``.
Examples:
>>> data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5]
>>> variance(data)
1.3720238095238095
If you have already calculated the mean of your data, you can pass it as
the optional second argument ``xbar`` to avoid recalculating it:
>>> m = mean(data)
>>> variance(data, m)
1.3720238095238095
This function does not check that ``xbar`` is actually the mean of
``data``. Giving arbitrary values for ``xbar`` may lead to invalid or
impossible results.
Decimals and Fractions are supported:
>>> from decimal import Decimal as D
>>> variance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")])
Decimal('31.01875')
>>> from fractions import Fraction as F
>>> variance([F(1, 6), F(1, 2), F(5, 3)])
Fraction(67, 108)
"""
if iter(data) is data:
data = list(data)
n = len(data)
if n < 2:
raise StatisticsError('variance requires at least two data points')
T, ss = _ss(data, xbar)
return _convert(ss / (n - 1), T)
| (data, xbar=None) | [
0.004792107734829187,
0.012972123920917511,
0.03291620686650276,
-0.033415477722883224,
0.08166642487049103,
0.015147517435252666,
0.015120770782232285,
-0.04878588393330574,
0.0785994753241539,
0.05024803429841995,
0.009495059959590435,
0.00557667575776577,
-0.02246718294918537,
-0.06073271855711937,
-0.054777130484580994,
0.0808105319738388,
-0.0071101500652730465,
0.05734480917453766,
0.02091587707400322,
0.05288703739643097,
-0.042651984840631485,
0.012526346370577812,
-0.06989790499210358,
-0.03443184867501259,
-0.0021230150014162064,
-0.010796729475259781,
0.015967747196555138,
-0.054598819464445114,
-0.020951539278030396,
0.022859467193484306,
-0.03469931706786156,
-0.031240083277225494,
-0.00932566449046135,
0.01829470694065094,
0.024089813232421875,
0.035412561148405075,
-0.003445859532803297,
-0.012668995186686516,
-0.08701575547456741,
0.01665424555540085,
0.0221283920109272,
-0.04554062336683273,
0.015102939680218697,
0.068970687687397,
0.021718276664614677,
-0.007930380292236805,
0.052316442131996155,
0.016796894371509552,
-0.07189498841762543,
-0.00914735347032547,
0.022324534133076668,
0.016574004665017128,
-0.004297294653952122,
-0.0091027757152915,
0.016235213726758957,
0.07046850025653839,
0.013025617226958275,
0.038122888654470444,
0.023661866784095764,
0.05142488703131676,
0.07581783086061478,
0.02186092548072338,
0.0021999117452651262,
-0.05349329486489296,
0.006428110878914595,
0.0053537869825959206,
-0.01950722001492977,
0.007261714432388544,
-0.0329340361058712,
0.009816018864512444,
-0.03596532344818115,
0.03484196588397026,
-0.006205222103744745,
0.0373026579618454,
0.07325015217065811,
0.0492851547896862,
0.02754904516041279,
0.009789272211492062,
-0.03273789584636688,
0.04225970059633255,
0.03436052426695824,
-0.021932249888777733,
-0.007859055884182453,
0.03701736032962799,
0.01133166253566742,
0.0005379976355470717,
-0.046753138303756714,
0.004903551656752825,
0.047002773731946945,
0.0412968210875988,
-0.009379157796502113,
0.02457125298678875,
0.05691686272621155,
0.06212354451417923,
-0.06287244707345963,
-0.033682942390441895,
-0.02248501405119896,
-0.0392284132540226,
0.02369752898812294,
-0.02806614711880684,
-0.0028262289706617594,
0.07078945636749268,
0.0348597951233387,
0.03300536051392555,
0.00937024224549532,
0.030116723850369453,
0.026443518698215485,
0.010983956046402454,
0.00720822112634778,
0.025569794699549675,
0.0005778390332125127,
0.011260338127613068,
0.014781979843974113,
0.02275248058140278,
-0.06932730972766876,
-0.03765928000211716,
-0.02622954547405243,
0.057986728847026825,
-0.0569881871342659,
0.010698658414185047,
-0.019453726708889008,
0.04878588393330574,
0.01845518685877323,
0.023840177804231644,
-0.005977875553071499,
-0.026265207678079605,
0.02483871951699257,
-0.049106843769550323,
-0.09065330028533936,
0.08551794290542603,
0.060946691781282425,
-0.04372185096144676,
-0.04069056361913681,
-0.020077815279364586,
0.06508350372314453,
-0.02683580294251442,
0.08680178225040436,
0.0034926661755889654,
0.06658131629228592,
-0.08159510046243668,
0.02474956400692463,
0.05648891627788544,
-0.027584707364439964,
0.004384221043437719,
0.008844224736094475,
0.03726699575781822,
0.07004055380821228,
-0.0004605438152793795,
0.008380616083741188,
-0.01486221980303526,
-0.07228726893663406,
0.023216089233756065,
-0.003419112879782915,
-0.053528957068920135,
0.03170369192957878,
-0.019453726708889008,
-0.02562328800559044,
-0.07171667367219925,
-0.030740812420845032,
-0.03947804868221283,
-0.04176042973995209,
0.03395041078329086,
-0.015040530823171139,
0.006610879674553871,
0.013729944825172424,
-0.011465395800769329,
-0.03058033250272274,
0.05887828394770622,
-0.01137624029070139,
-0.018936626613140106,
-0.020594917237758636,
-0.02952829748392105,
-0.06722323596477509,
-0.004564761184155941,
0.018615666776895523,
-0.04268764704465866,
-0.033058855682611465,
-0.0132841682061553,
-0.004515725653618574,
0.024161137640476227,
0.029991906136274338,
-0.0629081130027771,
-0.02326958253979683,
-0.0392284132540226,
-0.05759444460272789,
-0.025890754535794258,
0.015325828455388546,
0.03197115659713745,
-0.02954612858593464,
-0.014345117844641209,
-0.010689742863178253,
-0.04589724540710449,
-0.026461349800229073,
0.012080568820238113,
0.03769494220614433,
-0.026514843106269836,
0.0015479621943086386,
0.011857680045068264,
0.03887179121375084,
-0.07581783086061478,
0.04867889732122421,
-0.030473345890641212,
0.020166970789432526,
0.0016660932451486588,
-0.01741206645965576,
0.013123688288033009,
-0.04154645651578903,
-0.042473673820495605,
-0.01358729600906372,
-0.05064031854271889,
-0.0029265289194881916,
0.005928840022534132,
0.06996922940015793,
-0.006815936882048845,
-0.01537932176142931,
0.006267630960792303,
0.059555865824222565,
-0.09985414892435074,
0.03378992900252342,
0.04593290761113167,
0.11140869557857513,
-0.08986873179674149,
-0.037338320165872574,
0.10620202124118805,
0.019739024341106415,
0.013712113723158836,
0.006285462062805891,
-0.016618583351373672,
-0.0033633909188210964,
0.022984284907579422,
0.01570028066635132,
0.04907118156552315,
0.007038825657218695,
-0.04628952965140343,
-0.03528774157166481,
0.025124017149209976,
0.013560549356043339,
-0.03230994939804077,
0.019756855443120003,
0.017652787268161774,
-0.06697360426187515,
0.016154974699020386,
0.00863025151193142,
0.03321933373808861,
-0.0452909879386425,
0.0022244295105338097,
-0.04557628557085991,
0.08623118698596954,
-0.02029178850352764,
0.011616960167884827,
-0.018223382532596588,
0.002293525030836463,
0.011090942658483982,
0.039335399866104126,
0.053101010620594025,
0.02161129005253315,
0.018490849062800407,
0.02205706760287285,
0.05445617064833641,
0.012535261921584606,
0.0011545636225491762,
-0.031079603359103203,
0.01059167180210352,
0.06080404296517372,
-0.04611121863126755,
-0.014826557599008083,
-0.005866431165486574,
-0.02412547543644905,
0.029867088422179222,
0.05680987611413002,
-0.007573758717626333,
0.04279463365674019,
0.06576108932495117,
-0.06551145017147064,
0.03808722645044327,
0.011679369024932384,
0.056774213910102844,
0.0015958832809701562,
0.0926503837108612,
0.017474476248025894,
0.008982415311038494,
0.0017485619755461812,
-0.015575463883578777,
0.0061205243691802025,
0.03582267463207245,
-0.039870332926511765,
-0.004355245735496283,
-0.11625875532627106,
0.023465724661946297,
0.05613229423761368,
-0.002293525030836463,
-0.06708058714866638,
-0.05042634531855583,
0.03188200294971466,
-0.036803387105464935,
0.048821546137332916,
-0.029260830953717232,
0.014585837721824646,
0.03972768411040306,
0.03361161798238754,
0.017536884173750877,
0.04086887463927269,
0.018223382532596588,
0.02237802743911743,
-0.009379157796502113,
0.008991330862045288,
0.04472039267420769,
-0.048143964260816574,
-0.03976334631443024,
0.006423653103411198,
0.0064637730829417706,
0.003991936799138784,
-0.016939543187618256,
0.015842929482460022,
0.02492787502706051,
0.017358573153614998,
0.013471394777297974,
-0.04728807136416435,
-0.009307833388447762,
0.004000852350145578,
0.007604963146150112,
-0.01959637552499771,
0.07332147657871246,
0.0221283920109272,
0.042224038392305374,
0.07039717584848404,
-0.06629601866006851,
0.016056902706623077,
0.019132768735289574,
-0.01979251764714718,
-0.0521024689078331,
-0.057630106806755066,
-0.018250128254294395,
0.05777275562286377,
-0.01671665348112583,
-0.01576269045472145,
-0.013177181594073772,
0.011162267066538334,
0.05295836180448532,
0.01441644225269556,
-0.025106186047196388,
-0.012642248533666134,
0.021112019196152687,
-0.02055925503373146,
0.006887261290103197,
-0.0006335611687973142,
-0.005429569166153669,
-0.040119968354701996,
0.028297951444983482,
0.06836442649364471,
-0.008732779882848263,
0.0011099858675152063,
0.02560545690357685,
0.0329340361058712,
-0.0047341566532850266,
-0.05795106664299965,
0.07817152887582779,
0.00012809135660063475,
-0.014853304252028465,
-0.01577160507440567,
-0.01916843093931675,
0.08801429718732834,
0.0032363443169742823,
-0.00497041828930378,
0.029653115198016167,
-0.006401364225894213,
-0.02457125298678875,
-0.0061205243691802025,
-0.026425687596201897,
0.0029621911235153675,
-0.012053822167217731,
-0.09122389554977417,
-0.050212372094392776,
-0.02735290303826332,
0.016743401065468788,
-0.006891719065606594,
-0.008603504858911037,
-0.04625386744737625,
0.021646952256560326,
-0.010992871597409248,
0.01010131649672985,
-0.03154321014881134,
-0.01595883257687092,
-0.0036865794099867344,
0.015611126087605953,
0.03658941388130188,
-0.06383533030748367,
-0.045184001326560974,
-0.006071488838642836,
0.0318998321890831,
-0.018758315593004227,
0.025480639189481735,
0.03156104311347008,
-0.0231625959277153,
-0.03218512982130051,
-0.01690388098359108,
-0.014737402088940144,
-0.07225161045789719,
0.005108609329909086,
0.046646151691675186,
-0.010333120822906494,
-0.008607962168753147,
-0.042830295860767365,
0.024268124252557755,
-0.02091587707400322,
-0.023644035682082176,
-0.01656509004533291,
-0.026514843106269836,
-0.01603907160460949,
-0.026283038780093193,
0.01916843093931675,
0.005407280288636684,
0.0043953657150268555,
0.025480639189481735,
0.07021886110305786,
0.047609031200408936,
-0.0013250734191387892,
-0.004139043390750885,
-0.016672076657414436,
-0.018348200246691704,
0.021379485726356506,
-0.06223053112626076,
0.020862383767962456,
0.0026924957055598497,
0.03334415331482887,
-0.0393710620701313,
-0.06151728704571724,
-0.04268764704465866,
-0.03530557453632355,
-0.006187391001731157,
0.015263419598340988,
-0.0192397553473711,
-0.025908585637807846,
-0.04061923921108246,
0.028083978220820427,
-0.011723946779966354,
-0.06237317994236946,
0.03159670531749725,
-0.012909715063869953,
0.030081061646342278,
0.033486802130937576,
0.08237966895103455,
0.040226954966783524,
-0.012597670778632164,
-0.06914899498224258,
0.01708219200372696,
-0.023804515600204468,
0.001199141377583146,
-0.0030245999805629253,
-0.0805252343416214,
-0.027299409732222557,
-0.016484849154949188,
0.036732062697410583,
0.016484849154949188,
-0.0030669488478451967,
-0.042473673820495605,
-0.026532674208283424,
-0.01968553103506565,
0.004388678818941116,
-0.012847306206822395,
-0.009218677878379822,
-0.005478604696691036,
-0.028797222301363945,
-0.04397148638963699,
0.0037333860527724028,
-0.025658950209617615,
0.018954457715153694,
-0.01446102000772953,
0.03929973766207695,
0.020523592829704285,
-0.012526346370577812,
0.0660107210278511,
-0.011706115677952766,
-0.0025074980221688747,
0.03519858792424202,
0.008398447185754776,
-0.023233920335769653,
-0.00022483899374492466,
-0.012249964289367199,
0.017973747104406357,
0.00650835083797574,
0.027228085324168205,
0.0008447482250630856,
0.03929973766207695,
-0.00425048777833581,
0.004448859021067619,
-0.03521641716361046,
0.039335399866104126,
0.04643217846751213,
-0.0004928626585751772,
-0.015325828455388546,
0.012891883961856365,
-0.010734320618212223,
0.009495059959590435,
-0.05837901309132576,
-0.0639423131942749,
0.0411541722714901,
0.00937024224549532,
0.02483871951699257,
-0.0028262289706617594,
0.030740812420845032,
0.012704657390713692,
0.016627497971057892,
-0.062159206718206406,
-0.02351921796798706,
0.02824445813894272,
-0.008041825145483017,
0.02883288450539112,
-0.022342365235090256,
-0.03858649730682373,
-0.0660107210278511,
-0.017135685309767723,
-0.0002096547104883939,
0.000644148385617882,
0.051959820091724396,
-0.03997731953859329,
-0.034717146307229996,
0.04539797455072403,
-0.01319501269608736,
-0.0015011555515229702,
-0.012419359758496284,
-0.04118983447551727,
-0.022271040827035904,
0.048999857157468796,
0.029492635279893875,
0.0064637730829417706,
-0.09286435693502426,
-0.03912142664194107,
-0.04661048948764801,
0.03239910304546356,
-0.055205076932907104,
-0.00901807751506567,
-0.003780192695558071,
-0.012562008574604988,
-0.03441401943564415,
0.0008480915566906333,
-0.0023849094286561012,
-0.048571910709142685,
-0.02544497698545456,
0.022805973887443542,
0.021379485726356506,
0.0279769916087389,
0.04122549667954445,
0.02369752898812294,
0.020505761727690697,
0.002449546940624714,
-0.06536880135536194,
-0.006031368859112263,
0.05295836180448532,
0.028422769159078598,
0.047002773731946945,
-0.03705302253365517,
0.0008731665438972414,
0.02858324907720089,
-0.0003574577858671546,
-0.0463251918554306,
-0.04768035560846329,
0.020238295197486877,
0.004127899184823036,
-0.030081061646342278,
-0.01088588498532772,
-0.008621335960924625,
0.04693144932389259,
0.031418394297361374,
-0.013159350492060184,
0.05181717127561569,
-0.0014220300363376737,
-0.04539797455072403,
-0.03316584229469299,
-0.030027568340301514,
0.031846340745687485,
0.0040209125727415085,
-0.00832266453653574,
-0.0036865794099867344,
-0.013712113723158836,
0.04468473047018051,
0.020256126299500465,
-0.065119169652462,
-0.05096127837896347,
0.0016995264450088143,
-0.04732373356819153,
-0.04279463365674019,
-0.0025832802057266235,
-0.02186092548072338,
-0.030883461236953735,
0.07403472065925598,
-0.03694603592157364,
-0.007841224782168865,
0.021450810134410858,
0.06775817275047302,
-0.02603340335190296,
-0.013257421553134918,
-0.020434437319636345,
-0.009691201150417328,
0.01934674009680748,
-0.03519858792424202,
0.02936781756579876,
-0.017135685309767723,
0.003013455541804433,
-0.043365228921175,
0.0020962683483958244,
0.04250933602452278,
0.0032697776332497597,
0.028030484914779663,
0.033237166702747345,
0.0206484105437994,
-0.019649868831038475,
-0.014674993231892586,
0.030651656910777092,
0.0002846010320354253,
-0.049534790217876434,
0.000997984199784696,
-0.014104397967457771,
0.025124017149209976,
0.03805156424641609,
0.03548388555645943,
-0.021112019196152687,
-0.03182850778102875,
-0.0003245816915296018,
0.04593290761113167,
-0.015486308373510838,
0.01786676049232483,
0.005184391513466835,
0.01437186449766159,
-0.0206484105437994,
-0.009923005476593971,
0.008732779882848263,
-0.049106843769550323,
-0.062159206718206406,
-0.1043475866317749,
-0.006338955368846655,
-0.018936626613140106,
0.0707537978887558,
-0.03557303920388222,
-0.02943914197385311,
0.007315207738429308,
0.03015238605439663,
0.00018430111231282353,
-0.026104727759957314,
0.009138437919318676,
0.03954937309026718,
0.00226566381752491,
0.032470427453517914,
0.05748745799064636,
0.056774213910102844,
-0.02728157863020897,
-0.06340738385915756,
0.0482509508728981,
0.03423570841550827,
-0.019043613225221634,
0.02804831601679325,
-0.01856217347085476,
-0.03313018009066582,
0.0646912232041359,
0.03234561160206795,
0.04489870369434357,
0.07004055380821228,
-0.01502269972115755,
-0.021736107766628265,
-0.008915549144148827,
-0.007703034207224846,
-0.013729944825172424,
-0.0863025113940239,
0.06437025964260101,
0.08965475857257843,
-0.0012102856999263167,
-0.0470740981400013,
0.007569300942122936,
-0.023804515600204468,
-0.015530886128544807,
0.0569881871342659,
0.02972443960607052,
-0.050497669726610184,
-0.009352411143481731,
-0.015441730618476868,
-0.06169559806585312,
-0.0110641960054636,
-0.021896587684750557,
-0.037587955594062805,
0.023644035682082176,
0.00039144832408055663,
-0.021985743194818497,
0.040226954966783524,
-0.06640300899744034,
-0.008612420409917831,
0.03972768411040306,
0.008942295797169209,
-0.008995789103209972,
-0.03362945094704628,
-0.01568244956433773,
-0.037409644573926926,
-0.02728157863020897,
-0.010983956046402454,
-0.003706639399752021,
-0.02849409356713295,
-0.020630579441785812,
0.009441566653549671,
0.032630909234285355,
0.012035991065204144,
-0.01594100147485733,
-0.010992871597409248,
-0.018918795511126518,
-0.006218595430254936,
0.0695769414305687,
0.006963043473660946,
-0.021308161318302155,
-0.022520676255226135,
-0.06151728704571724,
0.03156104311347008,
-0.023626204580068588,
-0.02221754752099514,
-0.05709517374634743,
0.012044906616210938,
0.019364571198821068,
0.00005701075497199781,
0.03040202148258686,
-0.040048643946647644,
0.01907927542924881,
-0.005086320452392101,
0.016707738861441612,
0.012053822167217731,
0.012508515268564224,
0.026942789554595947,
0.018312538042664528,
-0.017037613317370415,
0.007159185595810413,
0.09329230338335037,
0.001953619532287121,
0.04896419495344162,
0.00548752024769783,
0.02787000499665737,
-0.010912631638348103,
0.050141047686338425,
-0.01636894792318344,
0.014764148741960526,
0.016333285719156265,
-0.06283678859472275,
0.0132841682061553,
0.028618911281228065,
-0.021557796746492386,
0.037231333553791046,
0.001140075852163136,
0.013712113723158836,
-0.02421463094651699,
-0.014559091068804264,
-0.039513710886240005,
0.015094024129211903,
0.02098720148205757,
0.01708219200372696,
-0.030384190380573273,
0.0008742809877730906,
-0.018954457715153694,
-0.05384991690516472,
0.06757985800504684,
0.002398282755166292,
0.0132841682061553,
0.037160009145736694,
-0.08295026421546936,
0.006820394657552242,
-0.05199548229575157,
-0.027299409732222557,
0.0043686190620064735,
0.08480469882488251,
-0.007783274166285992,
0.024624746292829514,
0.01446102000772953,
-0.002846288960427046,
0.022716818377375603
]
|
36,394 | vobject | iCalendar | null | def iCalendar():
return newFromBehavior('vcalendar', '2.0')
| () | [
0.07378633320331573,
-0.047345079481601715,
0.012649580836296082,
-0.007661561947315931,
-0.039073534309864044,
-0.06800663471221924,
-0.013930113054811954,
0.03623559698462486,
0.021699827164411545,
0.04402261599898338,
0.0036966712214052677,
0.005420630797743797,
-0.02332644909620285,
0.006445921957492828,
-0.005788351409137249,
0.05295173451304436,
-0.0006997502059675753,
0.004503493197262287,
-0.07447851449251175,
-0.06070414558053017,
-0.005805655848234892,
-0.06856038421392441,
-0.03761995583772659,
0.0015725453849881887,
0.04070015624165535,
0.12313873320817947,
-0.07870081067085266,
0.021838264539837837,
0.030767379328608513,
-0.08326919376850128,
-0.03717004135251045,
-0.023309145122766495,
-0.018585020676255226,
0.0002682195627130568,
0.048210304230451584,
0.026891173794865608,
-0.019346417859196663,
-0.025783687829971313,
0.0015693007735535502,
0.10216569900512695,
0.05160198360681534,
-0.005567719228565693,
0.030075199902057648,
-0.010460563004016876,
0.026856565847992897,
-0.0005291387788020074,
0.04080398380756378,
-0.016075870022177696,
0.07274806499481201,
-0.015418298542499542,
0.0071424273774027824,
0.003415473271161318,
0.021699827164411545,
-0.06721062958240509,
-0.08970646560192108,
0.09081394970417023,
0.01237270887941122,
0.10258100181818008,
-0.003858900861814618,
0.03703160583972931,
-0.05585888773202896,
-0.025264551863074303,
0.0447147972881794,
0.022340094670653343,
-0.024139760062098503,
0.028465881943702698,
0.029902154579758644,
-0.04474940523505211,
0.00902429036796093,
0.024053238332271576,
-0.006134441122412682,
0.04990614205598831,
0.0025762056466192007,
-0.03789683058857918,
0.003408984048292041,
-0.018187016248703003,
-0.084307461977005,
-0.015435603447258472,
-0.005355739034712315,
-0.011940096504986286,
0.014284854754805565,
0.028465881943702698,
-0.03976571187376976,
0.06374973058700562,
0.042257558554410934,
0.005710481200367212,
-0.014812641777098179,
-0.009526120498776436,
-0.030680857598781586,
-0.006722793448716402,
0.008176370523869991,
-0.027427613735198975,
-0.031476862728595734,
0.021803654730319977,
-0.03568185493350029,
-0.021578695625066757,
-0.0016666385345160961,
-0.019346417859196663,
0.025074202567338943,
0.01003660261631012,
-0.021769046783447266,
-0.04381496459245682,
-0.08063891530036926,
-0.017581360414624214,
-0.01488185953348875,
0.022184353321790695,
-0.0141550712287426,
0.0003920548188034445,
-0.040492501109838486,
-0.013895504176616669,
0.0027168046217411757,
0.06291911751031876,
-0.01669883169233799,
-0.01291779987514019,
-0.03519732877612114,
0.04810647666454315,
0.029590673744678497,
-0.0008900996181182563,
0.01546156033873558,
-0.012139098718762398,
-0.06451112776994705,
0.018065884709358215,
-0.018844587728381157,
0.02339566871523857,
0.05135972052812576,
-0.02474541775882244,
-0.07070613652467728,
-0.0013811144744977355,
0.0501830168068409,
-0.043226610869169235,
0.03197869285941124,
-0.050563715398311615,
0.014483856037259102,
-0.027358395978808403,
-0.011896835640072823,
0.012268882244825363,
0.04104624688625336,
0.004611645825207233,
-0.07468616962432861,
0.09067551791667938,
-0.08956802636384964,
0.05544358119368553,
0.01766788214445114,
0.08596869558095932,
-0.053228605538606644,
0.0032792005222290754,
-0.0002774125605355948,
0.036789342761039734,
-0.039073534309864044,
0.009777035564184189,
0.03872744366526604,
-0.04028484970331192,
0.004546754062175751,
0.024157065898180008,
0.053263213485479355,
-0.056966375559568405,
-0.0019932608120143414,
-0.02374175749719143,
0.019311808049678802,
-0.010884523391723633,
-0.022028613835573196,
0.026337429881095886,
-0.03322461619973183,
0.014371377415955067,
0.011446918360888958,
0.02190748229622841,
0.05516670644283295,
-0.018152408301830292,
0.01662961207330227,
0.00911946501582861,
-0.03235939145088196,
-0.0247800275683403,
-0.032255563884973526,
0.0034176362678408623,
0.002009483752772212,
0.03201330453157425,
0.011723790317773819,
0.060531098395586014,
0.05942361056804657,
0.033605314791202545,
0.011022958904504776,
0.06541096419095993,
-0.08735305815935135,
0.009188682772219181,
-0.009058899246156216,
0.007605322636663914,
0.006082527339458466,
0.00632911641150713,
0.020488513633608818,
-0.02516072615981102,
0.002855240600183606,
0.054197657853364944,
0.04454175382852554,
0.0076269530691206455,
-0.04253443330526352,
-0.05222494527697563,
-0.041426945477724075,
0.026268212124705315,
-0.10645721107721329,
0.01804858073592186,
0.012692841701209545,
0.05945822224020958,
-0.015340428799390793,
0.01507220882922411,
0.030455898493528366,
0.01323793362826109,
-0.0005975455860607326,
-0.09399797767400742,
0.028015965595841408,
-0.05014840513467789,
-0.011135438457131386,
0.0035777029115706682,
-0.030352072790265083,
-0.012796669267117977,
-0.05447452887892723,
0.03395140543580055,
-0.014423291198909283,
-0.021803654730319977,
-0.01534908078610897,
0.03303426876664162,
-0.013921461068093777,
0.029158063232898712,
-0.014907816424965858,
-0.08679930865764618,
0.012061228044331074,
-0.027306482195854187,
0.02438202314078808,
-0.04104624688625336,
-0.03235939145088196,
-0.07288650423288345,
-0.0009025371982716024,
-0.05312477797269821,
-0.005243259947746992,
-0.038277529180049896,
-0.02522994391620159,
-0.00018751034804154187,
-0.004667885601520538,
0.006143093109130859,
-0.03661629557609558,
0.027514135465025902,
0.05111745744943619,
0.024728113785386086,
0.0456838496029377,
0.06638001650571823,
-0.012216968461871147,
0.0044126445427536964,
-0.06551478803157806,
0.02786022610962391,
-0.027306482195854187,
-0.030127113685011864,
-0.02142295613884926,
-0.10576502978801727,
-0.00995873287320137,
0.01846388913691044,
0.018187016248703003,
0.0019240427063778043,
-0.02782561630010605,
0.016941092908382416,
0.06125788763165474,
-0.033086180686950684,
-0.018896501511335373,
0.05935439467430115,
-0.014033939689397812,
0.04298434779047966,
0.04170381650328636,
-0.010097168385982513,
0.01534908078610897,
0.029625283554196358,
0.026891173794865608,
0.00913676992058754,
0.08922193944454193,
-0.04104624688625336,
0.007691844832152128,
0.004094674251973629,
0.002675706520676613,
-0.0023923455737531185,
-0.04983692616224289,
-0.029902154579758644,
-0.03336305171251297,
-0.04159998893737793,
0.007648583501577377,
0.07413242757320404,
-0.004979366436600685,
0.0614655427634716,
-0.030075199902057648,
-0.050598323345184326,
-0.008353741839528084,
0.015435603447258472,
-0.022409312427043915,
-0.02452045865356922,
0.013428282923996449,
0.02351679839193821,
-0.011524789035320282,
-0.04796804115176201,
0.00799467321485281,
0.07828550040721893,
0.03133842721581459,
-0.01488185953348875,
-0.01304758433252573,
0.03192678093910217,
0.024347415193915367,
-0.03395140543580055,
0.005277868825942278,
0.05094441398978233,
-0.07022161036729813,
0.01631813310086727,
-0.009102161042392254,
0.048660218715667725,
-0.006225289776921272,
-0.006852577440440655,
-0.010226952843368053,
-0.0035993335768580437,
-0.028206314891576767,
-0.06229615584015846,
-0.042707476764917374,
-0.031199991703033447,
-0.008215305395424366,
-0.0061517455615103245,
0.07184823602437973,
0.04533775895833969,
-0.020453905686736107,
0.023828279227018356,
0.021474869921803474,
-0.053747739642858505,
0.05104823783040047,
0.004862561356276274,
0.02725456841289997,
0.02107686549425125,
-0.01868884637951851,
0.02059234119951725,
-0.007190014701336622,
-0.013177367858588696,
0.02998867817223072,
0.06461495906114578,
-0.010581694543361664,
-0.025368379428982735,
0.004304491449147463,
-0.08541495352983475,
-0.00452079763635993,
-0.05073675885796547,
0.042776692658662796,
0.04339965432882309,
-0.05530514195561409,
-0.011749747209250927,
-0.017235269770026207,
-0.011464223265647888,
0.008730114437639713,
0.000489662925247103,
-0.014189680106937885,
-0.08216170966625214,
-0.014380029402673244,
-0.01879267394542694,
-0.02261696569621563,
0.01917337253689766,
-0.03993875905871391,
0.013168714940547943,
0.06098101660609245,
-0.04063093662261963,
0.010183691047132015,
-0.0051480852998793125,
-0.03299965709447861,
0.04800264909863472,
0.005230281502008438,
-0.013860895298421383,
-0.036304816603660583,
-0.01927720010280609,
0.01610182598233223,
-0.005714807193726301,
0.06184624135494232,
-0.03145955875515938,
0.00641996506601572,
0.01116139441728592,
0.02471080981194973,
0.04194607958197594,
0.009474207647144794,
-0.03793143853545189,
0.02827553264796734,
-0.010183691047132015,
-0.020090511068701744,
-0.03983493149280548,
0.013549414463341236,
0.05156737565994263,
-0.030646247789263725,
0.008280197158455849,
0.04395340010523796,
-0.016006652265787125,
0.020038597285747528,
0.030230941250920296,
-0.013783024623990059,
-0.01782362349331379,
-0.03879666328430176,
-0.06644923239946365,
-0.002147919498383999,
0.006952078081667423,
-0.0028985016979277134,
-0.046964380890131,
0.011109481565654278,
0.018394671380519867,
0.015972042456269264,
0.003997336607426405,
0.04260364919900894,
0.031096164137125015,
0.040077194571495056,
-0.0027816963847726583,
0.026527781039476395,
-0.04488784074783325,
0.061084844172000885,
-0.05478600785136223,
-0.017356401309370995,
-0.06544557213783264,
0.002602162305265665,
-0.024122456088662148,
-0.09212909638881683,
-0.04384957253932953,
0.004836604464799166,
0.010079864412546158,
-0.022668879479169846,
-0.05675872042775154,
0.04627219960093498,
-0.025818295776844025,
0.017287183552980423,
0.016984354704618454,
0.012909147888422012,
0.00754475686699152,
0.025368379428982735,
0.009898167103528976,
0.004806321579962969,
0.03935040533542633,
-0.04398800805211067,
-0.03703160583972931,
0.040457893162965775,
0.0421537309885025,
-0.03789683058857918,
-0.0563088022172451,
-0.0011518299579620361,
-0.023153405636548996,
-0.03512810915708542,
-0.04609915614128113,
0.011187351308763027,
0.006571379490196705,
0.019709812477231026,
-0.0009398499969393015,
0.023672539740800858,
-0.029296498745679855,
-0.012043924070894718,
-0.03692777827382088,
-0.030127113685011864,
0.028552405536174774,
0.04796804115176201,
-0.06385356187820435,
0.02516072615981102,
0.04381496459245682,
0.024987680837512016,
-0.024157065898180008,
0.02957336977124214,
-0.03782761096954346,
0.0006781195988878608,
0.02786022610962391,
0.010720130056142807,
-0.013973373919725418,
-0.024399328976869583,
-0.02737569995224476,
-0.029400324448943138,
-0.0798083022236824,
0.00960399117320776,
-0.00040070703835226595,
-0.046445246785879135,
-0.03220365196466446,
-0.007220297586172819,
0.04384957253932953,
0.04436870664358139,
0.00984625332057476,
0.030265549197793007,
-0.03713542968034744,
0.01631813310086727,
0.021544087678194046,
-0.02310149185359478,
-0.013272542506456375,
0.020315468311309814,
-0.0015941759338602424,
-0.006238267756998539,
0.042292170226573944,
-0.0008782027871347964,
0.045060887932777405,
-0.03258435055613518,
0.0009187601390294731,
0.035924118012189865,
-0.01853310689330101,
-0.05686254799365997,
-0.008409981615841389,
0.001836438779719174,
0.0868685320019722,
-0.051913462579250336,
0.03325922414660454,
0.09808183461427689,
0.006536770146340132,
0.0563088022172451,
0.007912477478384972,
0.03980032354593277,
0.015972042456269264,
0.007648583501577377,
-0.018965719267725945,
-0.01875806413590908,
-0.010469214990735054,
0.019484853371977806,
-0.06679532676935196,
-0.023637929931282997,
-0.05488983541727066,
0.03485123813152313,
-0.03665090724825859,
0.04668750986456871,
-0.019605984911322594,
0.007925455458462238,
-0.022963056340813637,
0.011351743713021278,
-0.04357270151376724,
-0.052813299000263214,
0.03261895850300789,
0.005857569165527821,
-0.014276202768087387,
0.041842252016067505,
-0.010399997234344482,
0.01782362349331379,
-0.06329981982707977,
-0.021994004026055336,
0.010278865694999695,
-0.03142495080828667,
-0.02564525045454502,
-0.027964051812887192,
0.012156402692198753,
0.0017153073567897081,
-0.012831278145313263,
0.011369048617780209,
0.040492501109838486,
-0.03896970674395561,
0.007799997925758362,
-0.06544557213783264,
-0.015937432646751404,
-0.022997664287686348,
-0.025991341099143028,
-0.011749747209250927,
0.02142295613884926,
0.03242861106991768,
0.03845057263970375,
0.04388418048620224,
0.0056628938764333725,
-0.025558728724718094,
-0.04284591227769852,
-0.0010485438397154212,
0.03327653184533119,
0.0025999993085861206,
0.017096834257245064,
0.022045917809009552,
0.010079864412546158,
-0.05170581117272377,
0.027168046683073044,
0.025852905586361885,
-0.02934841252863407,
0.024087848141789436,
-0.003742095548659563,
-0.008859897963702679,
0.06554940342903137,
-0.027341090142726898,
-0.004663559608161449,
-0.028483187779784203,
0.052847906947135925,
0.06804125010967255,
0.021699827164411545,
-0.01905224099755287,
0.019190676510334015,
-0.01676804944872856,
-0.03208252042531967,
0.03993875905871391,
0.010322127491235733,
0.00679633766412735,
0.06430348008871078,
-0.021924786269664764,
0.005182694178074598,
0.016915136948227882,
-0.03845057263970375,
-0.04893709346652031,
-0.04294973984360695,
0.03142495080828667,
-0.12279264628887177,
-0.010123125277459621,
-0.04339965432882309,
-0.03599333390593529,
0.012199664488434792,
0.006502161268144846,
-0.013281194493174553,
0.02452045865356922,
-0.02355140820145607,
-0.012649580836296082,
0.015868214890360832,
-0.019900161772966385,
-0.012476535513997078,
-0.008522460237145424,
-0.019381025806069374,
-0.008868549950420856,
-0.046964380890131,
-0.009707817807793617,
0.04786421358585358,
0.003049916122108698,
0.029521455988287926,
0.010547085665166378,
0.03192678093910217,
-0.01323793362826109,
-0.0739939883351326,
0.010676869191229343,
-0.010772043839097023,
-0.01823893003165722,
-0.020263556391000748,
-0.02497037686407566,
0.020419295877218246,
0.06928717344999313,
0.006277203094214201,
-0.038208309561014175,
0.07517069578170776,
-0.024122456088662148,
-0.00939633697271347,
-0.019761724397540092,
0.04724125191569328,
-0.010694173164665699,
-0.03189217299222946,
-0.048210304230451584,
-0.021371042355895042,
0.028240924701094627,
0.014189680106937885,
0.05447452887892723,
0.031061556190252304,
0.043711137026548386,
0.011230613104999065,
-0.04519932344555855,
-0.03493776172399521,
0.021059561520814896,
0.026718130335211754,
0.001990016084164381,
0.00838402472436428,
0.03620098903775215,
0.12749946117401123,
-0.0034565713722258806,
0.01879267394542694,
0.04433409869670868,
0.014241593889892101,
-0.030352072790265083,
0.013653241097927094,
-0.004784691147506237,
-0.022980360314249992,
0.021146085113286972,
-0.0153663856908679,
-0.008236936293542385,
-0.021319128572940826,
-0.00243776966817677,
0.01349750068038702,
-0.07198666781187057,
-0.006255572196096182,
0.030040591955184937,
0.0009831112110987306,
0.007536104414612055,
-0.01488185953348875,
0.005857569165527821,
0.038623616099357605,
-0.031199991703033447,
0.01396472193300724,
0.06859499216079712,
0.026908479630947113,
0.044126443564891815,
0.01488185953348875,
-0.0013086518738418818,
0.02564525045454502,
0.03069816157221794,
-0.016794005408883095,
0.0431227833032608,
0.029815632849931717,
-0.013168714940547943,
-0.008050912991166115,
-0.010573042556643486,
0.040492501109838486,
0.0814003124833107,
0.014674206264317036,
0.008596003986895084,
0.005260564386844635,
-0.0033159726299345493,
-0.009638600051403046,
-0.02587020955979824,
-0.015548082068562508,
0.01061630342155695,
-0.05617036670446396,
0.05267485976219177,
-0.09060630202293396,
-0.005615306552499533,
0.04602993652224541,
-0.022790011018514633,
0.02111147530376911,
0.07904689759016037,
0.006303159985691309,
-0.029261888936161995,
-0.014354072511196136,
-0.009742426685988903,
0.016032608225941658,
0.08728383481502533,
-0.002314475364983082,
0.007657235953956842,
0.04101163521409035,
0.02377636730670929,
0.02130182459950447,
0.002545922761783004,
-0.013272542506456375,
0.02580099180340767,
-0.01396472193300724,
0.03391679748892784,
0.07800862938165665,
0.017737099900841713,
0.011697834357619286,
0.07565522193908691,
-0.04208451509475708,
-0.017962059006094933,
0.002209566766396165,
-0.006541096605360508,
-0.011403657495975494,
0.030005982145667076,
-0.0424652136862278,
-0.012649580836296082,
0.00674875034019351,
0.055582016706466675,
0.07482460886240005,
-0.03758534789085388,
0.03800065442919731,
-0.014103157445788383,
0.024087848141789436,
0.00043071951949968934,
-0.024555068463087082,
-0.029296498745679855,
0.005061562638729811,
-0.011619963683187962,
-0.0019618964288383722,
-0.04395340010523796,
0.020990343764424324,
-0.03627020865678787,
-0.03336305171251297,
-0.042292170226573944,
-0.019000327214598656,
-0.005013975314795971,
0.03092312067747116,
-0.03841596469283104,
0.031199991703033447,
-0.020246250554919243,
-0.05160198360681534,
0.031736429780721664,
0.055028270930051804,
-0.023014968261122704,
-0.0328093096613884,
-0.020159728825092316,
0.015712475404143333,
-0.02055773138999939,
-0.04381496459245682,
-0.013791676610708237,
0.034505147486925125,
0.033190008252859116,
0.041807644069194794,
-0.04845256730914116,
-0.03538767620921135,
0.022253571078181267,
-0.0008430530433543026,
-0.016041260212659836,
0.02232278883457184,
0.014968382194638252,
0.020350078120827675
]
|
36,396 | vobject.base | newFromBehavior |
Given a name, return a behaviored ContentLine or Component.
| def newFromBehavior(name, id=None):
"""
Given a name, return a behaviored ContentLine or Component.
"""
name = name.upper()
behavior = getBehavior(name, id)
if behavior is None:
raise VObjectError("No behavior found named {0!s}".format(name))
if behavior.isComponent:
obj = Component(name)
else:
obj = ContentLine(name, [], '')
obj.behavior = behavior
obj.isNative = False
return obj
| (name, id=None) | [
0.05304768308997154,
-0.03345680609345436,
-0.019993549212813377,
-0.06813913583755493,
-0.051226906478405,
-0.04215802624821663,
0.01571296900510788,
0.09384012967348099,
0.01196636725217104,
-0.0061582583002746105,
-0.017901405692100525,
0.05735452473163605,
-0.07661276310682297,
0.0025385855697095394,
-0.09033863246440887,
0.022654687985777855,
0.010688320733606815,
0.015397834591567516,
-0.0841059684753418,
-0.02851969562470913,
0.06491775810718536,
0.016308223828673363,
0.01589679718017578,
-0.008171618916094303,
0.06995991617441177,
0.03230131417512894,
-0.009270214475691319,
0.06152130663394928,
0.006928587798029184,
-0.05077170953154564,
0.006512784864753485,
-0.04965123161673546,
-0.004735775291919708,
0.03617046773433685,
-0.010014282539486885,
0.013542041182518005,
0.0051078093238174915,
0.003188550937920809,
-0.009550333954393864,
-0.008464870043098927,
0.05045657604932785,
0.038446441292762756,
0.02951762266457081,
0.03582031652331352,
-0.028362128883600235,
-0.022654687985777855,
0.02149919420480728,
0.013620824553072453,
-0.008972587063908577,
-0.010180603712797165,
0.010872148908674717,
-0.07500207424163818,
0.01866297982633114,
0.007436304818838835,
-0.012903017923235893,
0.03280903026461601,
0.00439437897875905,
0.07122045755386353,
-0.02282976172864437,
0.07318129390478134,
-0.06964477896690369,
-0.028554709628224373,
0.020011056214571,
-0.048040542751550674,
-0.03925178572535515,
-0.02718912623822689,
0.05315272882580757,
-0.0435936413705349,
-0.04170283302664757,
0.0004811823309864849,
0.007738308981060982,
0.028484679758548737,
0.05679428577423096,
0.011511172167956829,
0.02337249368429184,
0.015240266919136047,
-0.0052084773778915405,
0.029009904712438583,
0.10021284967660904,
0.030515549704432487,
-0.015905551612377167,
0.02148168534040451,
-0.04135268181562424,
-0.029727712273597717,
-0.03802626207470894,
0.018435383215546608,
-0.0013207209995016456,
-0.03053305670619011,
0.015319050289690495,
-0.04219304397702217,
-0.0006466828053817153,
0.01046072319149971,
-0.07048513740301132,
0.0006909986259415746,
0.005396682769060135,
-0.0019389541121199727,
0.08137479424476624,
-0.007659525144845247,
0.05973554402589798,
0.08683713525533676,
-0.04443399980664253,
0.02393273450434208,
-0.10434462130069733,
0.0015297166537493467,
-0.013918451964855194,
-0.021534208208322525,
0.022111956030130386,
0.004836443345993757,
-0.019415803253650665,
-0.005217230878770351,
0.021236581727862358,
0.044013820588588715,
-0.02239207550883293,
0.04713015258312225,
0.02839714288711548,
-0.03042801097035408,
0.00785648450255394,
-0.030918221920728683,
0.0011068014428019524,
-0.019538354128599167,
-0.039076708257198334,
-0.034279659390449524,
-0.012920524924993515,
0.012544114142656326,
0.04954618588089943,
0.01810274086892605,
-0.035382628440856934,
-0.0621865913271904,
0.04600967466831207,
-0.03520755469799042,
0.023109883069992065,
-0.036065421998500824,
-0.012106426991522312,
-0.05143699422478676,
-0.03914673998951912,
0.024422943592071533,
-0.024475466459989548,
0.01857544295489788,
0.0007758004940114915,
0.01880304142832756,
-0.007493204437196255,
0.02641879767179489,
0.023022344335913658,
0.007725178264081478,
-0.04488919675350189,
-0.03617046773433685,
0.025683483108878136,
0.0037816171534359455,
-0.0639723539352417,
0.02886984497308731,
-0.0256134532392025,
0.0056549180299043655,
0.0013163441326469183,
0.04453904554247856,
0.0362054817378521,
-0.04152775928378105,
-0.054203178733587265,
-0.0695747509598732,
0.009821699932217598,
0.022899791598320007,
0.018155263736844063,
-0.005751209333539009,
0.04373370110988617,
-0.0026983413845300674,
0.026663901284337044,
-0.017778852954506874,
0.03939184546470642,
-0.045904628932476044,
-0.02079889364540577,
0.005138447508215904,
-0.031811103224754333,
0.04663994535803795,
0.00031048431992530823,
0.023442523553967476,
0.000982607714831829,
0.03851646929979324,
0.010259387083351612,
0.003945749718695879,
0.06022575497627258,
0.00819788035005331,
0.01453996729105711,
0.059560470283031464,
-0.0011456460924819112,
0.05112186074256897,
0.01878553256392479,
-0.010784612037241459,
0.01313936896622181,
0.025228288024663925,
0.05794978141784668,
0.005300391465425491,
0.007291868329048157,
0.04149274155497551,
0.051401980221271515,
0.009261460043489933,
-0.03279152140021324,
-0.01113476138561964,
-0.029149964451789856,
-0.02920248731970787,
-0.07041510939598083,
0.06005067750811577,
0.042017966508865356,
0.007615756709128618,
-0.00031267275335267186,
0.05921031907200813,
0.04530937597155571,
0.04933609813451767,
0.04453904554247856,
-0.059140291064977646,
-0.02606864832341671,
-0.026436304673552513,
-0.05437825247645378,
-0.023897718638181686,
-0.0016369499498978257,
0.03879658877849579,
-0.003387698670849204,
-0.031951162964105606,
-0.06330706924200058,
0.031023265793919563,
0.038411423563957214,
0.007392536383122206,
-0.007103662472218275,
0.04912600666284561,
0.006911080330610275,
0.0219193734228611,
-0.03711587190628052,
-0.039882052689790726,
-0.03704584017395973,
-0.030130384489893913,
0.0024773094337433577,
-0.005869384855031967,
0.013550794683396816,
-0.035645242780447006,
-0.009033863432705402,
-0.06187145784497261,
-0.016316978260874748,
-0.004775166977196932,
-0.039321813732385635,
0.02451048046350479,
-0.046709973365068436,
0.005943791475147009,
0.02449297346174717,
-0.003536512376740575,
0.045694541186094284,
0.04751531779766083,
-0.012797972187399864,
0.011948859319090843,
0.004028910305351019,
-0.05315272882580757,
-0.018645472824573517,
-0.038656529039144516,
-0.020623819902539253,
-0.028922367841005325,
0.006293941289186478,
0.025088228285312653,
-0.003411771496757865,
-0.03627551347017288,
-0.03224879130721092,
-0.09131904691457748,
0.01252660620957613,
0.0010192639892920852,
-0.06523289531469345,
0.04261322319507599,
0.04215802624821663,
0.049161020666360855,
0.023214926943182945,
-0.05815986916422844,
-0.05518359690904617,
0.04734024405479431,
-0.009550333954393864,
0.0032388849649578333,
-0.01575673744082451,
0.007733932230621576,
0.02403777837753296,
0.00136448978446424,
-0.012631651945412159,
-0.06456761062145233,
-0.0027049067430198193,
-0.003523381659761071,
-0.005676802713423967,
-0.006504031363874674,
-0.000607290945481509,
0.02787191793322563,
-0.013244413770735264,
0.015765491873025894,
-0.04762036353349686,
-0.06054088845849037,
0.003508062567561865,
-0.030620593577623367,
-0.041212622076272964,
-0.01168624684214592,
-0.032616447657346725,
0.04366367310285568,
-0.05434323847293854,
-0.017542501911520958,
-0.003606542246416211,
0.02671642415225506,
-0.018838055431842804,
-0.010854641906917095,
-0.029009904712438583,
-0.03242386505007744,
0.05907025933265686,
-0.011108499951660633,
0.009506565518677235,
0.02673393115401268,
-0.08536650240421295,
-0.04296337068080902,
-0.03900668025016785,
-0.03354434296488762,
-0.021779313683509827,
-0.006810412276536226,
0.02787191793322563,
0.024002764374017715,
-0.03526007756590843,
0.0005892363260500133,
-0.0002747854741755873,
0.05413314700126648,
0.030252937227487564,
-0.04488919675350189,
0.05907025933265686,
0.05178714543581009,
-0.02550840750336647,
-0.02405528724193573,
-0.058545034378767014,
0.007624510210007429,
0.007558857090771198,
-0.014811333268880844,
0.029342547059059143,
0.005282883998006582,
-0.010014282539486885,
0.006814789026975632,
-0.029955308884382248,
0.02974521927535534,
0.03935683146119118,
0.004475351423025131,
-0.055428702384233475,
-0.052067264914512634,
0.005646164529025555,
-0.03280903026461601,
-0.0035211932845413685,
-0.041317667812108994,
0.13361713290214539,
0.04040727764368057,
-0.03939184546470642,
0.021516701206564903,
0.05339783430099487,
0.04103754833340645,
0.05514858290553093,
0.009419027715921402,
0.052977655082941055,
-0.03991707041859627,
-0.04114259406924248,
-0.052872609347105026,
-0.034507256001234055,
0.010784612037241459,
-0.013507026247680187,
0.00701612513512373,
0.02685648389160633,
-0.019205711781978607,
-0.056759271770715714,
-0.04194793850183487,
-0.04093250259757042,
-0.041247639805078506,
-0.012868002988398075,
0.003965445794165134,
-0.06708868592977524,
-0.024860631674528122,
0.040022112429142,
0.01622943952679634,
0.00849113054573536,
-0.0016752475639805198,
-0.0379912443459034,
0.034069567918777466,
0.03568025678396225,
0.014137295074760914,
-0.01499516237527132,
-0.00962911732494831,
0.021114028990268707,
-0.011616216972470284,
0.0530126690864563,
0.013288182206451893,
0.01687721721827984,
-0.010784612037241459,
0.04786546900868416,
0.017192352563142776,
0.02596360258758068,
0.0016883782809600234,
0.008815019391477108,
0.014898871071636677,
0.012088919058442116,
-0.046149734407663345,
0.04509928449988365,
0.0027574291452765465,
-0.0006527009536512196,
-0.023897718638181686,
-0.021166551858186722,
-0.03387698531150818,
0.00886316504329443,
0.013962220400571823,
-0.022059433162212372,
0.037080857902765274,
0.020763879641890526,
0.04219304397702217,
0.03221377357840538,
-0.016115641221404076,
-0.08312554657459259,
-0.0022891038097441196,
0.06302694976329803,
0.028046993538737297,
-0.028677262365818024,
-0.04152775928378105,
0.024142824113368988,
0.03914673998951912,
-0.0988822802901268,
-0.04663994535803795,
0.040337249636650085,
0.011730016209185123,
0.11828058212995529,
-0.04674498736858368,
-0.08137479424476624,
-0.041772861033678055,
-0.031460952013731,
0.05080672726035118,
0.012762957252562046,
0.01033817045390606,
0.0025145127438008785,
0.021534208208322525,
-0.024878138676285744,
0.037851184606552124,
0.016255700960755348,
-0.03055056370794773,
-0.027154112234711647,
-0.0005109997582621872,
-0.016176916658878326,
-0.0456245094537735,
0.039777010679244995,
-0.012780465185642242,
0.03883160650730133,
-0.020553790032863617,
0.0016008408274501562,
0.02169177494943142,
0.009095138870179653,
-0.0018689241260290146,
-0.017866389825940132,
0.022409582510590553,
-0.06369223445653915,
-0.0332467183470726,
0.018838055431842804,
-0.04327850788831711,
0.01610688678920269,
-0.05336282029747963,
0.07479198276996613,
0.0810246467590332,
0.08011426031589508,
-0.005974429659545422,
-0.0045869615860283375,
-0.0545533262193203,
0.027766874060034752,
-0.010548260994255543,
0.013436995446681976,
0.015275281853973866,
-0.05472840368747711,
0.007825846783816814,
0.012684173882007599,
-0.014890117570757866,
-0.017481224611401558,
-0.03834139555692673,
-0.0032607694156467915,
-0.02652384154498577,
0.010933425277471542,
-0.007913383655250072,
0.06523289531469345,
-0.023915225639939308,
0.0789937824010849,
-0.0025517160538583994,
0.029482606798410416,
-0.01587929017841816,
0.027836903929710388,
-0.03704584017395973,
-0.004153651185333729,
0.030287951231002808,
0.021639253944158554,
-0.03939184546470642,
-0.04576456919312477,
0.05402810499072075,
-0.016159409657120705,
0.048705827444791794,
0.014855102635920048,
-0.0008201163145713508,
0.021569224074482918,
-0.0014837594935670495,
-0.029902786016464233,
0.050386544317007065,
-0.05238239839673042,
0.017656300216913223,
0.03802626207470894,
0.029815249145030975,
0.05199723318219185,
0.010373185388743877,
0.02393273450434208,
-0.04261322319507599,
0.007930891588330269,
-0.042438145726919174,
-0.043348535895347595,
-0.06855931878089905,
0.01101220864802599,
-0.021761804819107056,
0.005466712638735771,
-0.0028471550904214382,
-0.0012977424776181579,
0.012789218686521053,
-0.013209398835897446,
-0.004897719249129295,
-0.022759731858968735,
-0.015686707571148872,
-0.021866850554943085,
-0.015065192244946957,
-0.03736097738146782,
0.008933194912970066,
-0.05539368838071823,
-0.04404883459210396,
0.06995991617441177,
-0.011020963080227375,
0.019993549212813377,
-0.07556231319904327,
-0.0023066112771630287,
0.026909006759524345,
-0.029482606798410416,
-0.028607232496142387,
0.07654272764921188,
0.04653489962220192,
0.03076065331697464,
-0.020396221429109573,
0.00014635163825005293,
0.05942041054368019,
0.015511632896959782,
-0.025123242288827896,
-0.08277539908885956,
0.008731858804821968,
-0.0780133605003357,
-0.015108960680663586,
-0.0015012669609859586,
0.01353328675031662,
-0.017341164872050285,
-0.004031098913401365,
0.027696844190359116,
0.008171618916094303,
0.025578437373042107,
0.005396682769060135,
-0.049161020666360855,
0.006018198560923338,
0.037851184606552124,
-0.017551254481077194,
-0.09846210479736328,
-0.007361898198723793,
-0.03704584017395973,
-0.00701612513512373,
-0.02372264489531517,
-0.0978318378329277,
-0.01302556972950697,
-0.01230776309967041,
0.02305736020207405,
0.08074452728033066,
0.03513752669095993,
0.004845196846872568,
0.005794978234916925,
0.05815986916422844,
0.026593871414661407,
-0.0007944022072479129,
0.004551946651190519,
0.023967748507857323,
0.04572955518960953,
-0.005847500637173653,
0.02048375830054283,
0.013795899227261543,
-0.0029106196016073227,
0.03956691920757294,
0.049055978655815125,
0.046499885618686676,
-0.016483299434185028,
0.0013721492141485214,
-0.04534438997507095,
-0.02069384977221489,
-0.06344713270664215,
-0.026821469888091087,
-0.012176456861197948,
-0.02092144638299942,
-0.05900023132562637,
0.047480303794145584,
0.10994701832532883,
-0.021989403292536736,
0.011511172167956829,
0.02843215875327587,
0.009532826021313667,
-0.01621193252503872,
-0.00769016332924366,
0.04958120360970497,
-0.013927205465734005,
-0.008337940089404583,
-0.028379635885357857,
0.0008037030347622931,
-0.02179682068526745,
0.016991015523672104,
-0.005383552052080631,
0.07472195476293564,
0.012841741554439068,
0.0003684778930619359,
-0.006368348374962807,
-0.06652844697237015,
0.04464409127831459,
0.010950933210551739,
0.017840128391981125,
-0.04418889433145523,
-0.009699147194623947,
-0.005961298942565918,
0.008482377044856548,
-0.021219072863459587,
0.0022737847175449133,
-0.009462796151638031,
0.032266296446323395,
-0.03680073842406273,
0.04551946371793747,
0.0037225293926894665,
0.00439437897875905,
0.006118866614997387,
-0.023757658898830414,
-0.009410274215042591,
-0.009322736412286758,
-0.00789587665349245,
0.02606864832341671,
-0.004155839793384075,
0.033859480172395706,
-0.0006138562457635999,
-0.0422980859875679,
-0.080044224858284,
0.029902786016464233,
0.008963832631707191,
0.004105505533516407,
-0.019415803253650665,
0.040897488594055176,
0.07941395789384842,
-0.04439898580312729,
0.001714639482088387,
0.01699976995587349,
-0.00409456342458725,
-0.07717300206422806,
0.010714582167565823,
0.03648560121655464,
-0.03345680609345436,
0.007344390731304884,
0.016745910048484802,
0.012027643620967865,
-0.0001332210231339559,
-0.006412116810679436,
0.007681409828364849,
0.0856466218829155,
0.029377562925219536,
0.0051078093238174915,
-0.00436811801046133,
-0.0019411426037549973,
0.004422828555107117,
-0.02808200754225254,
-0.00053069565910846,
0.016422022134065628,
0.026593871414661407,
0.036940798163414,
-0.002606427064165473,
0.003376756561920047,
-0.03995208442211151,
-0.008924441412091255,
0.003906358033418655,
-0.047690391540527344,
0.0379912443459034,
-0.041667819023132324,
-0.016036856919527054,
-0.015003915876150131,
-0.07009997963905334,
0.02683897688984871,
0.015800505876541138,
0.06845427304506302,
0.007173692807555199,
0.007878368720412254,
-0.014189817942678928,
0.011476157233119011,
-0.08018428832292557,
0.0155466478317976,
0.02237456850707531,
0.007751439698040485,
0.012587882578372955,
0.02675144001841545,
-0.07472195476293564,
-0.027994470670819283,
0.07654272764921188,
0.024212853983044624,
0.01600184291601181,
0.025911079719662666,
0.029605159536004066,
-0.04667495936155319,
-0.01033817045390606,
-0.004972126334905624,
0.06533794105052948,
0.058545034378767014,
-0.010399446822702885,
-0.039987098425626755,
-0.021341625601053238,
0.02627873793244362,
-0.0133144436404109,
-0.005549873225390911,
0.01747247204184532,
-0.01592305861413479,
-0.04674498736858368,
0.0008781098877079785,
0.06533794105052948,
0.04159778729081154,
0.0023197419941425323,
0.07269108295440674,
0.005287260748445988,
-0.050841741263866425,
0.020396221429109573,
-0.04394379258155823,
-0.0036152959801256657,
0.025823542848229408,
0.02034369856119156,
0.04373370110988617,
-0.03750103712081909,
0.011336097493767738,
0.014469937421381474,
-0.054308224469423294,
-0.013507026247680187,
0.016054365783929825,
0.0151614835485816,
-0.004044229164719582,
0.02013360895216465,
-0.06845427304506302,
0.02102649211883545,
0.011695001274347305,
-0.0017518429085612297,
0.03555770590901375,
0.0009322736295871437,
0.005895646288990974,
0.01158995646983385,
-0.051717113703489304,
0.02046625129878521,
-0.0003093901032116264,
0.00011557676771190017,
-0.02895738184452057,
0.05248744413256645,
0.03132089227437973,
0.03589034825563431,
-0.03408707678318024,
0.07395162433385849,
0.020308684557676315,
-0.020641326904296875,
-0.0020954273641109467,
0.03482238948345184,
0.039076708257198334,
-0.10231374949216843,
-0.004087998066097498,
0.030340474098920822,
0.02717161923646927,
-0.03405206277966499,
-0.04184289276599884,
-0.007340013515204191,
0.020046072080731392,
0.013253167271614075,
-0.027119096368551254,
-0.02862474136054516,
0.0175775159150362,
0.050491590052843094
]
|
36,397 | vobject.base | readComponents |
Generate one Component at a time from a stream.
| def readComponents(streamOrString, validate=False, transform=True,
ignoreUnreadable=False, allowQP=False):
"""
Generate one Component at a time from a stream.
"""
if isinstance(streamOrString, basestring):
stream = six.StringIO(streamOrString)
else:
stream = streamOrString
try:
stack = Stack()
versionLine = None
n = 0
for line, n in getLogicalLines(stream, allowQP):
if ignoreUnreadable:
try:
vline = textLineToContentLine(line, n)
except VObjectError as e:
if e.lineNumber is not None:
msg = "Skipped line {lineNumber}, message: {msg}"
else:
msg = "Skipped a line, message: {msg}"
logger.error(msg.format(**{'lineNumber': e.lineNumber, 'msg': str(e)}))
continue
else:
vline = textLineToContentLine(line, n)
if vline.name == "VERSION":
versionLine = vline
stack.modifyTop(vline)
elif vline.name == "BEGIN":
stack.push(Component(vline.value, group=vline.group))
elif vline.name == "PROFILE":
if not stack.top():
stack.push(Component())
stack.top().setProfile(vline.value)
elif vline.name == "END":
if len(stack) == 0:
err = "Attempted to end the {0} component but it was never opened"
raise ParseError(err.format(vline.value), n)
if vline.value.upper() == stack.topName(): # START matches END
if len(stack) == 1:
component = stack.pop()
if versionLine is not None:
component.setBehaviorFromVersionLine(versionLine)
else:
behavior = getBehavior(component.name)
if behavior:
component.setBehavior(behavior)
if validate:
component.validate(raiseException=True)
if transform:
component.transformChildrenToNative()
yield component # EXIT POINT
else:
stack.modifyTop(stack.pop())
else:
err = "{0} component wasn't closed"
raise ParseError(err.format(stack.topName()), n)
else:
stack.modifyTop(vline) # not a START or END line
if stack.top():
if stack.topName() is None:
logger.warning("Top level component was never named")
elif stack.top().useBegin:
raise ParseError("Component {0!s} was never closed".format(
(stack.topName())), n)
yield stack.pop()
except ParseError as e:
e.input = streamOrString
raise
| (streamOrString, validate=False, transform=True, ignoreUnreadable=False, allowQP=False) | [
0.014624000526964664,
0.016123898327350616,
-0.08084813505411148,
-0.03297945484519005,
-0.04100939258933067,
0.001241530990228057,
-0.009648730978369713,
0.0029220564756542444,
0.03694869577884674,
-0.012127219699323177,
-0.00030523829627782106,
0.05769117921590805,
-0.06738563627004623,
0.04181421548128128,
-0.03061985969543457,
0.047850389033555984,
0.007279990240931511,
0.0018668693955987692,
-0.002223552204668522,
0.01738600619137287,
-0.05820333957672119,
0.038046181201934814,
0.004648310597985983,
0.06551991403102875,
0.03237583488225937,
0.03530246391892433,
0.03019915521144867,
0.016443997621536255,
-0.028150515630841255,
-0.055313292890787125,
0.020065702497959137,
-0.017834147438406944,
-0.016489727422595024,
-0.019974244758486748,
-0.010352951474487782,
-0.0008499800460413098,
-0.021803388372063637,
-0.011633351445198059,
-0.0033130357041954994,
0.06562966108322144,
0.04609441012144089,
0.018465202301740646,
0.03575975075364113,
-0.02811393328011036,
-0.05169158801436424,
0.02074248529970646,
-0.015556863509118557,
0.0737144723534584,
-0.04580174759030342,
0.0009357210947200656,
0.05798384174704552,
-0.043679941445589066,
-0.003086679382249713,
-0.02793101780116558,
-0.0066718002781271935,
0.009186872281134129,
0.0074491859413683414,
0.06815388053655624,
0.03504638373851776,
0.034826889634132385,
-0.013124102726578712,
0.03950949385762215,
-0.008318029344081879,
0.0021126605570316315,
-0.017715252935886383,
-0.06844653934240341,
0.050630684942007065,
-0.07609236240386963,
-0.022955749183893204,
0.015392241068184376,
-0.016325103119015694,
0.020779067650437355,
0.04016798734664917,
-0.02317524515092373,
-0.035448797047138214,
-0.002212120220065117,
-0.02377886325120926,
0.05706927180290222,
0.03870467096567154,
-0.03347332403063774,
0.014605709351599216,
0.06153238192200661,
0.0037405979819595814,
-0.06167871132493019,
0.017669524997472763,
0.05074043571949005,
0.07049518078565598,
0.001568490406498313,
-0.05066727101802826,
0.09218882024288177,
-0.027967600151896477,
-0.008267727680504322,
0.016288520768284798,
0.0238703191280365,
0.04477742686867714,
0.012721691280603409,
0.00930576678365469,
0.006136775948107243,
0.019974244758486748,
-0.011477874591946602,
-0.01015174575150013,
0.03852175921201706,
-0.08099446445703506,
-0.018931632861495018,
-0.026321372017264366,
0.030510110780596733,
0.005597178358584642,
0.002041781321167946,
0.07989697903394699,
-0.005757228471338749,
-0.0247300174087286,
-0.021199770271778107,
-0.017504900693893433,
0.05286224186420441,
0.0039600953459739685,
-0.024364188313484192,
0.0416313000023365,
0.021309519186615944,
-0.03462568297982216,
-0.030674733221530914,
0.0012140938779339194,
0.032229505479335785,
-0.07521437108516693,
0.03393060714006424,
0.020431529730558395,
0.006799840368330479,
0.013352746143937111,
0.0011003440013155341,
0.07089759409427643,
0.005085018463432789,
-0.007403457537293434,
-0.012557068839669228,
0.049496617168188095,
-0.009383505210280418,
-0.030564984306693077,
-0.007421748712658882,
-0.022955749183893204,
-0.020779067650437355,
-0.05447188764810562,
-0.008258582092821598,
0.056264448910951614,
-0.015053849667310715,
-0.0030706743709743023,
-0.015026411972939968,
-0.026705492287874222,
0.01916942186653614,
0.0528988242149353,
-0.048362549394369125,
-0.05864233523607254,
0.02681524120271206,
-0.008331747725605965,
-0.0027299963403493166,
0.015062995254993439,
0.0225533377379179,
0.008281446062028408,
-0.024272732436656952,
-0.014779477380216122,
-0.06380052119493484,
-0.02697986364364624,
-0.01604158617556095,
0.00285346363671124,
0.016892138868570328,
-0.00867928471416235,
0.034131813794374466,
-0.011212648823857307,
0.013114957138895988,
-0.00719767902046442,
-0.03420497849583626,
-0.028168806806206703,
-0.020010827109217644,
-0.03740597888827324,
0.056081533432006836,
-0.022004593163728714,
0.04404577240347862,
0.012182094156742096,
0.028223680332303047,
0.00567949004471302,
0.019590124487876892,
-0.006273961625993252,
-0.019809622317552567,
-0.0658857449889183,
0.024510519579052925,
-0.0031141163781285286,
-0.025644589215517044,
-0.017724398523569107,
0.04170446842908859,
0.040131404995918274,
-0.030254030600190163,
0.041850797832012177,
-0.07137317210435867,
0.0027825841680169106,
0.029613830149173737,
0.027363983914256096,
0.03914366662502289,
0.05428897216916084,
0.03019915521144867,
-0.0459846630692482,
0.027711521834135056,
-0.03852175921201706,
0.03707673400640488,
-0.021968010812997818,
0.05308173969388008,
0.04635049030184746,
-0.037534020841121674,
-0.06145921349525452,
-0.00018848749459721148,
-0.00913199782371521,
0.009035968221724033,
-0.05692293867468834,
0.0141026945784688,
-0.03129664063453674,
-0.017879875376820564,
0.002212120220065117,
0.02152901701629162,
0.03393060714006424,
0.024272732436656952,
0.04883812740445137,
-0.061642128974199295,
0.03063815087080002,
-0.012063199654221535,
0.11208990216255188,
0.026047000661492348,
0.007659537717700005,
0.003315322333946824,
-0.04144838824868202,
0.0021652483846992254,
0.004961551167070866,
-0.039692409336566925,
-0.032741665840148926,
-0.009813353419303894,
0.017696961760520935,
-0.04693581536412239,
0.03486347198486328,
0.04503350704908371,
0.04353361204266548,
0.02794930897653103,
-0.01573977805674076,
0.053301237523555756,
-0.03585121035575867,
0.03623532876372337,
-0.06654423475265503,
-0.0633615255355835,
-0.011541894637048244,
-0.07269015163183212,
-0.020961981266736984,
-0.04294828325510025,
0.03641824424266815,
-0.00279630278237164,
-0.03693040460348129,
-0.005770947318524122,
0.0019846204668283463,
0.02099856548011303,
-0.004499692469835281,
-0.03029061295092106,
-0.05611811578273773,
-0.05692293867468834,
-0.010609030723571777,
-0.10974859446287155,
0.058422837406396866,
-0.032741665840148926,
-0.012630234472453594,
-0.04539933800697327,
0.0059309969656169415,
0.08304310590028763,
0.04071673005819321,
-0.00337248295545578,
0.02237042225897312,
0.008862199261784554,
0.04656998813152313,
0.04528958722949028,
0.018547512590885162,
0.039692409336566925,
-0.02072419412434101,
0.041082557290792465,
0.02985161915421486,
-0.04470426216721535,
0.03530246391892433,
-0.019553542137145996,
0.05758143216371536,
0.052971988916397095,
-0.013325309380888939,
0.07667768746614456,
-0.01244731992483139,
-0.020413238555192947,
0.048545464873313904,
-0.03539392352104187,
0.012996063567698002,
-0.06438584625720978,
-0.01891334168612957,
0.012712545692920685,
-0.0047146170400083065,
-0.034296438097953796,
-0.02619333192706108,
-0.054691385477781296,
0.011761391535401344,
0.01145958248525858,
-0.0728730708360672,
-0.042472708970308304,
-0.021236354485154152,
-0.08370159566402435,
0.01578550599515438,
0.009712751023471355,
0.011605914682149887,
0.011368125677108765,
-0.03477201238274574,
-0.05831308662891388,
-0.02333986759185791,
-0.07887265831232071,
-0.009603002108633518,
-0.022882582619786263,
0.06116655096411705,
0.067678302526474,
0.03566829487681389,
-0.035448797047138214,
0.010865110903978348,
0.03914366662502289,
0.001784557942301035,
0.03061985969543457,
0.007915617898106575,
0.016535455361008644,
-0.011532748118042946,
0.007179387379437685,
0.006392855662852526,
0.009877373464405537,
-0.05384998023509979,
0.055569373071193695,
-0.01445023249834776,
-0.000617335841525346,
-0.023010622709989548,
-0.021638765931129456,
-0.013160686008632183,
0.016535455361008644,
-0.009104561060667038,
0.03826567903161049,
0.003084392985329032,
-0.05509379506111145,
-0.0066626546904444695,
-0.05578887090086937,
0.030363779515028,
-0.05655711144208908,
0.07821416854858398,
-0.004618586972355843,
-0.0062648155726492405,
-0.03618045523762703,
-0.025900669395923615,
-0.03693040460348129,
0.0399119071662426,
-0.02783956006169319,
0.012749128974974155,
-0.0368938185274601,
0.019151130691170692,
0.011368125677108765,
-0.038119345903396606,
0.006520895753055811,
-0.00867928471416235,
0.003651427337899804,
-0.022059468552470207,
-0.022132633253932,
0.00843692384660244,
-0.022955749183893204,
0.01422158908098936,
-0.02377886325120926,
-0.006909588817507029,
-0.010270639322698116,
-0.03374769538640976,
-0.04971611499786377,
0.002373313531279564,
0.0025768056511878967,
0.012072346173226833,
0.041777633130550385,
-0.014806915074586868,
0.013352746143937111,
0.0038663516752421856,
-0.0494234524667263,
-0.018931632861495018,
0.006708383094519377,
0.03771693632006645,
0.008564963936805725,
-0.01734027825295925,
-0.024419063702225685,
0.03019915521144867,
0.04261903837323189,
-0.023010622709989548,
-0.026614034548401833,
-0.035357341170310974,
-0.021748512983322144,
0.012310134246945381,
0.05403289198875427,
-0.03096739575266838,
0.034918345510959625,
0.001354709267616272,
-0.0019228869350627065,
0.006196222733706236,
-0.07133658975362778,
-0.010435262694954872,
-0.010106016881763935,
0.02890046499669552,
0.04781380668282509,
0.006219087168574333,
-0.04788697138428688,
-0.04261903837323189,
0.014980684034526348,
0.014605709351599216,
0.03233925253152847,
-0.03800959885120392,
-0.018328016623854637,
0.08735988289117813,
-0.03186367452144623,
0.0029289156664162874,
-0.012255259789526463,
0.041265472769737244,
-0.029613830149173737,
-0.03182709217071533,
-0.060508061200380325,
0.006552905775606632,
-0.03233925253152847,
-0.00913199782371521,
-0.011084608733654022,
-0.01722138375043869,
0.015026411972939968,
-0.011386416852474213,
0.02924800105392933,
-0.0011615060502663255,
0.004897531121969223,
0.0009660163195803761,
-0.0065849157981574535,
-0.048362549394369125,
-0.041411805897951126,
0.04053381457924843,
0.012273551896214485,
-0.026156749576330185,
-0.009520690888166428,
-0.05410606041550636,
-0.05919107794761658,
-0.03219292312860489,
-0.10455383360385895,
-0.04097281023859978,
0.004652883391827345,
0.02116318792104721,
0.05615469813346863,
0.029376041144132614,
0.016306811943650246,
0.04920395463705063,
0.023797154426574707,
-0.006374564487487078,
0.015282492153346539,
0.0022349844221025705,
0.04894787445664406,
-0.026687201112508774,
-0.013462495058774948,
-0.0029517801012843847,
-0.015721486881375313,
-0.006818131543695927,
-0.05315490439534187,
0.018547512590885162,
-0.030436944216489792,
0.025534840300679207,
-0.03746085613965988,
-0.013992946594953537,
0.02888217195868492,
-0.01293204352259636,
-0.020102284848690033,
0.013691137544810772,
0.008578682318329811,
-0.0641663447022438,
-0.050703853368759155,
0.020413238555192947,
0.0051673296838998795,
-0.0264677032828331,
0.024858057498931885,
0.02438247948884964,
-0.022516753524541855,
0.0615689642727375,
0.01348993182182312,
-0.033089201897382736,
-0.021583890542387962,
0.0537768118083477,
0.010252348147332668,
-0.0007545216358266771,
-0.033272117376327515,
-0.010343804955482483,
-0.05055752024054527,
0.009456670843064785,
0.02688840590417385,
-0.019919371232390404,
0.03402206674218178,
0.059556905180215836,
-0.0342598557472229,
0.04839913174510002,
-0.01253877766430378,
-0.0225533377379179,
0.013279580511152744,
-0.0017536911182105541,
-0.002076077740639448,
0.01884017512202263,
-0.013599680736660957,
0.034296438097953796,
-0.009438379667699337,
0.0229923315346241,
-0.050191693007946014,
0.021400976926088333,
-0.02403494343161583,
0.04225321114063263,
-0.02377886325120926,
0.04261903837323189,
-0.003617130918428302,
0.03261362388730049,
-0.011779682710766792,
0.027565188705921173,
-0.03694869577884674,
-0.03577804192900658,
0.024492228403687477,
0.007691547740250826,
0.002864895621314645,
-0.05326465144753456,
-0.02586408704519272,
-0.013371037319302559,
0.035613421350717545,
-0.00994139350950718,
0.015584301203489304,
0.03453422710299492,
-0.044265266507864,
0.024053234606981277,
0.005450847093015909,
0.016325103119015694,
-0.022278964519500732,
-0.01661776751279831,
-0.07078784704208374,
0.03369281813502312,
-0.018328016623854637,
0.04583832994103432,
-0.03757060319185257,
-0.020632736384868622,
0.008944510482251644,
-0.0023115798830986023,
-0.05524012818932533,
0.07247065752744675,
-0.02012057602405548,
-0.06533700227737427,
-0.03246729448437691,
0.021364394575357437,
0.02074248529970646,
0.012355863116681576,
0.026065291836857796,
0.03477201238274574,
-0.004453964065760374,
0.08062863349914551,
-0.029723579064011574,
0.0020097712986171246,
-0.034223269671201706,
0.007732703350484371,
0.0011923727579414845,
-0.04239954054355621,
-0.015748923644423485,
0.011331542395055294,
-0.08823787420988083,
-0.006301398854702711,
0.024766599759459496,
-0.010380388237535954,
0.01070963405072689,
0.008862199261784554,
0.06091047078371048,
-0.08311627060174942,
-0.04378969222307205,
0.04953319951891899,
0.015931837260723114,
0.011999179609119892,
-0.03363794460892677,
0.028827298432588577,
0.02471172623336315,
0.057910677045583725,
0.03297945484519005,
0.019132839515805244,
-0.009612147696316242,
0.05172817409038544,
0.00783330574631691,
-0.023284994065761566,
0.06614182144403458,
0.006749538704752922,
-0.007403457537293434,
0.06380052119493484,
-0.01439535804092884,
-0.04122889041900635,
-0.06530041247606277,
0.03610729053616524,
-0.022882582619786263,
-0.03255875036120415,
0.025187302380800247,
0.04448476433753967,
0.0029197700787335634,
0.006004163064062595,
-0.029266292229294777,
0.024272732436656952,
-0.010682197287678719,
0.009996267966926098,
0.018163392320275307,
0.030583275482058525,
-0.04843571409583092,
-0.009177726693451405,
0.03029061295092106,
-0.09694459289312363,
0.06928794831037521,
0.03365623578429222,
0.03746085613965988,
0.021748512983322144,
-0.020504696294665337,
0.019480375573039055,
-0.038924168795347214,
0.04239954054355621,
0.0651175007224083,
0.0624835342168808,
-0.01944379322230816,
-0.048728376626968384,
-0.06032514572143555,
-0.027400566264986992,
-0.03215634077787399,
-0.030418653041124344,
-0.02074248529970646,
0.032741665840148926,
-0.030674733221530914,
0.058422837406396866,
0.035430505871772766,
-0.033180657774209976,
-0.03885100409388542,
-0.07437296956777573,
0.018501784652471542,
-0.009877373464405537,
-0.0009665879188105464,
0.006315117236226797,
-0.05717901885509491,
0.03539392352104187,
-0.0433872789144516,
0.03680236265063286,
-0.015053849667310715,
-0.030510110780596733,
0.023010622709989548,
0.04408235475420952,
-0.006132202688604593,
0.03168076276779175,
0.05736193433403969,
-0.003521100850775838,
-0.029339458793401718,
0.007874461822211742,
-0.03237583488225937,
-0.042655620723962784,
-0.030473526567220688,
0.06314202398061752,
-0.023138662800192833,
0.05103309825062752,
0.046899233013391495,
0.04558224976062775,
0.08077497035264969,
0.02271796017885208,
-0.018465202301740646,
0.05249641090631485,
0.0016610907623544335,
0.08516491204500198,
0.025992127135396004,
0.030382070690393448,
0.05995931848883629,
0.029558954760432243,
0.022132633253932,
0.1066756397485733,
0.06230062246322632,
-0.05074043571949005,
0.004501978866755962,
0.051142845302820206,
0.05498404800891876,
-0.004495119675993919,
-0.02118147909641266,
-0.030821064487099648,
-0.03557683527469635,
0.0014656010316684842,
0.003989818971604109,
0.012410737574100494,
-0.012474757619202137,
-0.03290628641843796,
-0.005432555451989174,
-0.0013615685747936368,
0.00046300189569592476,
0.002428187755867839,
0.030674733221530914,
-0.044631097465753555,
-0.11040709167718887,
-0.016215356066823006,
-0.0468626506626606,
0.03713160753250122,
-0.03115031123161316,
0.04938687011599541,
-0.0728730708360672,
0.011176065541803837,
0.03157101199030876,
0.014715458266437054,
-0.02551654912531376,
-0.029869910329580307,
0.028680967167019844,
-0.009493254125118256,
0.005094164051115513,
0.004870093893259764,
-0.0020269195083528757,
0.026175040751695633,
-0.04049723222851753,
-0.005459992680698633,
0.06647107005119324,
0.0031049707904458046,
0.012438174337148666,
-0.03563171252608299,
0.03029061295092106,
0.04656998813152313,
-0.021236354485154152,
0.02480318397283554,
0.012996063567698002,
-0.023797154426574707,
0.018135955557227135,
0.024748308584094048,
-0.031717345118522644,
-0.014239880256354809,
0.08787204325199127,
-0.004870093893259764,
-0.018026206642389297,
-0.002807734999805689,
0.018026206642389297,
0.00848265178501606,
0.005793811287730932,
-0.010170036926865578,
0.052971988916397095,
-0.048874709755182266,
0.026138458400964737,
0.04122889041900635,
0.023614240810275078,
-0.010160891339182854,
0.002041781321167946,
-0.10184670239686966,
-0.011697371490299702,
0.018282286822795868,
-0.016901284456253052,
-0.00609561987221241,
0.05074043571949005,
0.016398269683122635,
-0.06032514572143555,
0.0008882777183316648,
-0.008505516685545444,
-0.03078448213636875,
-0.014431940391659737,
-0.0858965665102005,
0.03265020623803139,
0.03841200843453407,
0.007604663260281086,
-0.028662675991654396,
0.0045545669272542,
-0.010682197287678719,
-0.0581301748752594,
-0.05308173969388008,
0.05264274403452873,
0.022626502439379692,
-0.07623869180679321,
-0.009095415472984314,
0.021730221807956696,
-0.05527671054005623,
-0.058422837406396866,
-0.001738829305395484,
-0.011907722800970078,
0.08231145143508911,
0.061386048793792725,
0.005231349729001522,
0.004975269548594952,
-0.03281483054161072,
0.013462495058774948
]
|
36,398 | vobject.base | readOne |
Return the first component from stream.
| def readOne(stream, validate=False, transform=True, ignoreUnreadable=False,
allowQP=False):
"""
Return the first component from stream.
"""
return next(readComponents(stream, validate, transform, ignoreUnreadable,
allowQP))
| (stream, validate=False, transform=True, ignoreUnreadable=False, allowQP=False) | [
0.008579039014875889,
-0.010558167472481728,
-0.019462138414382935,
-0.014609263278543949,
-0.009823906235396862,
0.02553878165781498,
0.06849727034568787,
-0.0326957181096077,
0.06647172570228577,
-0.004451985005289316,
0.011191151104867458,
0.04270529747009277,
-0.07210949808359146,
0.021082576364278793,
-0.010760722681879997,
0.01853376254439354,
-0.01650821417570114,
0.02163960225880146,
-0.018196171149611473,
0.07190694659948349,
-0.018685678020119667,
0.014583943411707878,
0.010743842460215092,
0.051583949476480484,
-0.012018250301480293,
0.032661955803632736,
0.042739056050777435,
0.004342267755419016,
-0.0189219918102026,
-0.02552190236747265,
0.03588595613837242,
-0.011334627866744995,
-0.061880484223365784,
-0.0043675871565938,
-0.013225139118731022,
0.054487235844135284,
-0.03517701104283333,
0.01893887110054493,
-0.028965333476662636,
0.05171898752450943,
0.032830752432346344,
0.031817980110645294,
0.0733923465013504,
-0.02985994890332222,
-0.07204198092222214,
0.01625502109527588,
-0.0009900919394567609,
0.07231205701828003,
-0.0633658841252327,
0.03889051824808121,
0.06920621544122696,
0.008047332055866718,
-0.010921078734099865,
-0.0411861389875412,
0.004101734142750502,
-0.040274642407894135,
-0.009427236393094063,
0.05050365626811981,
-0.009241561405360699,
0.044190701097249985,
-0.0449671596288681,
0.0193608608096838,
-0.0018936761189252138,
-0.0066927471198141575,
0.026416517794132233,
-0.09445804357528687,
0.04476460441946983,
-0.022753652185201645,
-0.03092336282134056,
0.012229244224727154,
-0.013647127896547318,
0.03239188343286514,
-0.029319804161787033,
-0.019023269414901733,
-0.034535590559244156,
-0.0193608608096838,
-0.002371578710153699,
0.028340788558125496,
0.0038949595764279366,
-0.007929175160825253,
0.027952559292316437,
0.05485858395695686,
-0.01081980112940073,
-0.026433398947119713,
-0.022196628153324127,
0.005393020808696747,
0.09385038167238235,
0.0028526464011520147,
-0.034079842269420624,
0.051617708057165146,
-0.0102965347468853,
-0.010946397669613361,
0.0045237233862280846,
0.040645990520715714,
0.0745401605963707,
0.02346259541809559,
-0.03645985946059227,
0.025808854028582573,
-0.005414120387285948,
-0.03397856280207634,
-0.055297452956438065,
0.061711687594652176,
-0.0693412497639656,
-0.01794297806918621,
-0.014254792593419552,
0.03026505932211876,
0.02634900063276291,
0.036189787089824677,
0.05168522521853447,
0.003036211710423231,
0.009309079498052597,
-0.015301325358450413,
-0.053271904587745667,
0.07413505017757416,
-0.01164689939469099,
-0.005937386769801378,
0.022939328104257584,
0.03392792493104935,
-0.07913140207529068,
0.017656024545431137,
0.016592612490057945,
0.049355845898389816,
-0.048916976898908615,
0.015714874491095543,
0.015081890858709812,
0.04476460441946983,
0.010676324367523193,
-0.034906938672065735,
0.08946169167757034,
0.021740879863500595,
0.03730383887887001,
0.005401460453867912,
0.03683121129870415,
0.03144662827253342,
-0.05971989780664444,
0.017369071021676064,
0.027885040268301964,
-0.001942204893566668,
-0.07352738082408905,
-0.005317063070833683,
0.03360721468925476,
0.0002160056756110862,
0.01836496591567993,
-0.02491423673927784,
-0.021707119420170784,
-0.010144618339836597,
-0.007642223034054041,
-0.046621356159448624,
-0.03899179399013519,
0.06566150486469269,
0.005025890190154314,
0.015444801189005375,
0.03230748698115349,
0.048748183995485306,
0.01636473834514618,
-0.006760265678167343,
-0.012111087329685688,
-0.03440055251121521,
-0.05030110105872154,
-0.008178149349987507,
-0.0089546088129282,
0.04489964246749878,
0.009300639852881432,
-0.00223865220323205,
-0.039228107780218124,
-0.008313185535371304,
-0.03936314582824707,
0.007393249310553074,
0.02594389021396637,
-0.006574590224772692,
-0.009114964865148067,
0.05171898752450943,
-0.026213964447379112,
0.03483942151069641,
-0.0023103903513401747,
0.036966245621442795,
0.013790604658424854,
0.04425821825861931,
0.005595575552433729,
-0.04270529747009277,
-0.06515511870384216,
0.009545394219458103,
-0.016499774530529976,
-0.05701917037367821,
0.02494799718260765,
0.08574818819761276,
0.03706752508878708,
-0.026484036818146706,
0.015360403805971146,
-0.055331211537122726,
0.02822263166308403,
0.06505384296178818,
-0.018854472786188126,
-0.007397469133138657,
0.012617474421858788,
-0.010465330444276333,
-0.01432231068611145,
-0.001998118357732892,
-0.04138869047164917,
0.01554607879370451,
-0.02962363511323929,
0.02055930905044079,
-0.005604015663266182,
0.00004025380621897057,
-0.09033942967653275,
0.04263778030872345,
-0.004629220813512802,
0.058774642646312714,
-0.06667427718639374,
0.0353795662522316,
-0.025488141924142838,
-0.01649133488535881,
-0.023732667788863182,
0.014507985673844814,
0.03568340092897415,
-0.028121354058384895,
-0.010110858827829361,
-0.0861532986164093,
0.02800319716334343,
0.008583258837461472,
0.09945439547300339,
-0.024981755763292313,
0.05786314606666565,
0.03137911111116409,
-0.01583303138613701,
-0.003977247513830662,
0.0018483123276382685,
-0.05171898752450943,
-0.0382828526198864,
-0.022956207394599915,
0.04702646657824516,
-0.022382302209734917,
0.04837683215737343,
0.03315146639943123,
0.023968981578946114,
0.03605474904179573,
-0.004013116471469402,
0.04155748710036278,
-0.038012780249118805,
0.010988596826791763,
-0.030400095507502556,
-0.06080019101500511,
0.0032999548129737377,
-0.025083033367991447,
-0.04557482525706291,
-0.02926916442811489,
0.022956207394599915,
-0.014507985673844814,
-0.04287409409880638,
-0.01638161763548851,
0.011165832169353962,
0.03296579048037529,
0.04550730437040329,
-0.004359147511422634,
0.008047332055866718,
-0.05499362200498581,
-0.04216515272855759,
-0.08831388503313065,
0.017588505521416664,
-0.045439787209033966,
-0.012423359788954258,
-0.03399544209241867,
0.024255935102701187,
0.041489969938993454,
-0.046486321836709976,
0.013419253751635551,
-0.02103193663060665,
0.005836109630763531,
0.06410858780145645,
0.04084854573011398,
0.05090876668691635,
0.005764371249824762,
0.029370442032814026,
0.004200901836156845,
0.03460310772061348,
-0.0841277465224266,
0.012465558014810085,
0.05232664942741394,
0.11694162338972092,
0.0530693493783474,
-0.023411955684423447,
0.03804653882980347,
-0.009047446772456169,
-0.031649183481931686,
0.014693660661578178,
-0.03463686630129814,
0.022736772894859314,
-0.03693248704075813,
-0.03110903687775135,
-0.0023230500519275665,
0.033033307641744614,
-0.02945484034717083,
-0.02592701092362404,
-0.07332482933998108,
-0.014085996896028519,
0.013765284791588783,
-0.03237500414252281,
-0.028087595477700233,
0.004709398373961449,
-0.050368621945381165,
0.016238141804933548,
-0.021302010864019394,
-0.052427928894758224,
0.0033316039480268955,
-0.06593158096075058,
-0.04918705299496651,
-0.021521445363759995,
-0.045406028628349304,
0.0018641368951648474,
0.0016858464805409312,
-0.007186474744230509,
0.03500821813941002,
-0.0004399236640892923,
-0.020120440050959587,
-0.04618248715996742,
0.01934398151934147,
0.0005612455424852669,
0.10721899569034576,
0.027496811002492905,
0.028138233348727226,
-0.014111315831542015,
0.04297536984086037,
0.0007949220016598701,
-0.015208487398922443,
-0.10195256769657135,
0.05506113916635513,
-0.031632304191589355,
-0.038822997361421585,
-0.016153743490576744,
0.047701649367809296,
-0.054520994424819946,
-0.009131844155490398,
-0.010085539892315865,
0.022905569523572922,
-0.02881341613829136,
-0.016330977901816368,
-0.004232550971210003,
-0.014533305540680885,
-0.008777373470366001,
-0.06755201518535614,
0.036324821412563324,
-0.050166066735982895,
0.04780292510986328,
-0.029826190322637558,
-0.007806798443198204,
0.013739965856075287,
0.009823906235396862,
-0.028931573033332825,
0.051583949476480484,
-0.09884673357009888,
0.021521445363759995,
-0.021723998710513115,
0.0045237233862280846,
0.00036238314351066947,
0.007393249310553074,
0.02636587992310524,
-0.04979471489787102,
0.04449453204870224,
0.01326733734458685,
-0.01204356923699379,
0.006485972553491592,
-0.03666241466999054,
-0.03377600759267807,
-0.0296573955565691,
-0.010237456299364567,
-0.010271214880049229,
-0.030585771426558495,
0.03234124556183815,
0.010861999355256557,
0.05252920463681221,
-0.027125461027026176,
0.0300962645560503,
-0.04753285273909569,
-0.037202559411525726,
-0.03480566293001175,
0.0007558880024589598,
0.03175045922398567,
0.028307029977440834,
-0.01836496591567993,
-0.028138233348727226,
0.025083033367991447,
0.02391834370791912,
-0.040645990520715714,
0.02805383689701557,
-0.0474315769970417,
-0.006608349736779928,
-0.06488504260778427,
0.014702100306749344,
-0.02184215746819973,
0.033894166350364685,
0.030737686902284622,
-0.025285588577389717,
0.01484557706862688,
-0.08331753313541412,
-0.03029881790280342,
0.047667890787124634,
0.037371356040239334,
0.04182755947113037,
-0.011984490789473057,
-0.05252920463681221,
-0.0088448915630579,
0.007773039396852255,
-0.02366514876484871,
0.02160584181547165,
-0.04506843909621239,
-0.013630248606204987,
0.06505384296178818,
-0.015638915821909904,
-0.003388572484254837,
-0.011089873500168324,
0.05155019089579582,
-0.031024640426039696,
0.043549276888370514,
-0.04280657693743706,
-0.024002740159630775,
0.012541516683995724,
0.009013687260448933,
0.02099817804992199,
-0.009520074352622032,
0.01954653486609459,
0.01101391576230526,
-0.005333942361176014,
-0.05175274610519409,
-0.003702954389154911,
0.024829840287566185,
-0.03973449394106865,
-0.020069802179932594,
0.0018873462686315179,
0.043346721678972244,
0.03377600759267807,
-0.03193613514304161,
-0.04121989756822586,
-0.021133214235305786,
-0.08365511894226074,
-0.016246581450104713,
-0.058572087436914444,
-0.05134763568639755,
0.03148038685321808,
0.027885040268301964,
0.01606934517621994,
0.07926643639802933,
0.031986773014068604,
0.011452784761786461,
-0.012111087329685688,
-0.019614053890109062,
0.007376369554549456,
-0.0015402602730318904,
0.061509132385253906,
-0.006523951888084412,
-0.026500916108489037,
-0.022331664338707924,
-0.06441241502761841,
0.018483122810721397,
-0.035514604300260544,
0.03679744899272919,
-0.03364097326993942,
-0.012136407196521759,
-0.017875459045171738,
0.026416517794132233,
-0.016229702159762383,
0.009807026945054531,
-0.03196989372372627,
-0.0024222175125032663,
-0.03050137311220169,
-0.03750639408826828,
-0.026433398947119713,
-0.004899293649941683,
0.04527099058032036,
-0.02120073325932026,
0.01731843315064907,
0.017875459045171738,
-0.030028745532035828,
0.01625502109527588,
-0.01572331413626671,
0.007443888112902641,
-0.0013345405459403992,
0.060496360063552856,
-0.004215671215206385,
0.036527376621961594,
-0.008937729522585869,
-0.04719526320695877,
-0.06130657717585564,
0.03892427682876587,
-0.010997036471962929,
-0.014170394279062748,
0.011655339039862156,
0.0019538095220923424,
-0.03558212146162987,
0.0465538389980793,
0.01590055041015148,
-0.0077224005945026875,
0.06832847744226456,
0.009494755417108536,
0.0008524180157110095,
0.011258669197559357,
0.0024412069469690323,
0.031632304191589355,
-0.01121647097170353,
0.05212409421801567,
0.009747948497533798,
-0.00017591670621186495,
-0.0008133840165100992,
0.02351323328912258,
-0.005747491959482431,
0.013351735658943653,
-0.02123449184000492,
-0.02515055052936077,
-0.0387217216193676,
0.03480566293001175,
0.0013957290211692452,
-0.01121647097170353,
0.06417610496282578,
-0.030552010983228683,
0.026298360899090767,
-0.05094252526760101,
-0.008853331208229065,
0.0298768300563097,
0.0179092176258564,
-0.017107438296079636,
0.010448450222611427,
0.031817980110645294,
0.021251371130347252,
-0.009190922603011131,
0.06697811186313629,
-0.010693204589188099,
-0.03416423872113228,
-0.04121989756822586,
-0.08885402977466583,
-0.004595461301505566,
-0.03848540782928467,
0.06275822222232819,
-0.046857669949531555,
-0.0593147911131382,
0.008203468285501003,
0.01031341403722763,
-0.07973906397819519,
0.01636473834514618,
-0.010693204589188099,
-0.08297993987798691,
-0.03662865608930588,
0.022922448813915253,
-0.04270529747009277,
-0.028779657557606697,
0.02243294194340706,
0.02347947470843792,
-0.008262546733021736,
0.040308400988578796,
0.040308400988578796,
0.0037388235796242952,
-0.016719209030270576,
-0.02390146255493164,
-0.05441971495747566,
-0.015993386507034302,
-0.04783668741583824,
0.030855843797326088,
-0.03929562494158745,
-0.03392792493104935,
0.04679015278816223,
-0.01572331413626671,
-0.0019474797882139683,
0.035717159509658813,
-0.025218069553375244,
-0.06042884290218353,
0.029539238661527634,
0.02783440239727497,
-0.05522993579506874,
0.017672903835773468,
0.006384695414453745,
0.057154204696416855,
-0.01454174518585205,
0.013191379606723785,
0.03787774220108986,
-0.019208945333957672,
0.020474912598729134,
0.05425092205405235,
0.013664007186889648,
-0.008224567398428917,
0.03804653882980347,
-0.0030045625753700733,
0.012136407196521759,
0.004713618196547031,
-0.048916976898908615,
0.008929289877414703,
-0.056782856583595276,
0.035143252462148666,
-0.011562502011656761,
0.009975822642445564,
-0.02447536773979664,
-0.010448450222611427,
-0.013647127896547318,
0.018871353939175606,
-0.08358760178089142,
0.024610405787825584,
0.04351551830768585,
0.02720985747873783,
0.022601736709475517,
0.07318979501724243,
-0.048343073576688766,
0.004418225958943367,
0.06967884302139282,
-0.09128468483686447,
0.044562049210071564,
0.03208805248141289,
-0.010971716605126858,
0.016980841755867004,
0.004464644938707352,
-0.021977193653583527,
-0.010448450222611427,
0.06245438754558563,
0.025234948843717575,
0.04182755947113037,
-0.013875002041459084,
-0.04780292510986328,
-0.017056800425052643,
-0.011208031326532364,
0.008777373470366001,
-0.03288139030337334,
-0.016558852046728134,
-0.032020535320043564,
0.0032303265761584044,
0.025066154077649117,
0.04719526320695877,
-0.038822997361421585,
-0.022804291918873787,
-0.044629570096731186,
0.030163781717419624,
0.006161041092127562,
-0.02472856268286705,
0.0027703584637492895,
-0.0038548705633729696,
0.044190701097249985,
-0.027226736769080162,
0.018162410706281662,
0.0033442636486142874,
-0.02700730413198471,
0.010423131287097931,
0.0032577558886259794,
0.00622855918481946,
-0.01661793142557144,
0.060260046273469925,
-0.04115237668156624,
0.024407850578427315,
-0.0019073907751590014,
-0.029505478218197823,
-0.0006878422573208809,
-0.04243522509932518,
0.03905931115150452,
0.025049272924661636,
0.0298768300563097,
0.0170061606913805,
0.0074565475806593895,
0.08466789871454239,
-0.012820029631257057,
0.03804653882980347,
0.08588322252035141,
-0.06701187044382095,
0.09783395379781723,
0.020441152155399323,
0.02594389021396637,
0.02783440239727497,
0.04530475288629532,
-0.0068109044805169106,
0.11187775433063507,
0.023006847128272057,
-0.01974909007549286,
-0.02039051428437233,
0.009638231247663498,
0.030248180031776428,
-0.02577509544789791,
-0.023310678079724312,
-0.05151643231511116,
-0.018820714205503464,
0.0013482552021741867,
-0.014592383988201618,
0.06316333264112473,
0.010304974392056465,
0.0037662528920918703,
-0.021352648735046387,
0.009612912312150002,
0.018280567601323128,
0.021251371130347252,
0.017276234924793243,
0.0004852874844800681,
-0.01656729355454445,
-0.06866607069969177,
-0.06323084980249405,
0.030771445482969284,
-0.03905931115150452,
-0.0013271557400003076,
-0.03811405599117279,
0.026450278237462044,
-0.025302467867732048,
0.021690240129828453,
-0.006996579468250275,
0.006595689803361893,
0.00937659852206707,
-0.03321898356080055,
0.020458031445741653,
-0.02386770397424698,
0.023327557370066643,
0.025268707424402237,
-0.04881570115685463,
0.02881341613829136,
0.020221717655658722,
-0.0024918457493185997,
0.012085768394172192,
-0.043144166469573975,
0.036561135202646255,
0.025015514343976974,
-0.02655155584216118,
0.0017839589854702353,
0.015377283096313477,
0.002972913207486272,
0.04341423884034157,
0.0015328754670917988,
0.03051825240254402,
-0.011410585604608059,
0.09533578157424927,
-0.03544708713889122,
0.03237500414252281,
-0.038417890667915344,
-0.03321898356080055,
-0.021470805630087852,
0.04415694251656532,
-0.0031332692597061396,
0.04979471489787102,
-0.015276005491614342,
0.02283805049955845,
0.0094609959051013,
0.02866150066256523,
0.0032113371416926384,
-0.016212821006774902,
-0.06525639444589615,
0.006072423420846462,
0.01649133488535881,
0.0035531483590602875,
0.033286500722169876,
0.05421715974807739,
0.047262780368328094,
-0.08331753313541412,
-0.015115650370717049,
-0.03068704903125763,
0.0007532505551353097,
-0.034265514463186264,
-0.07413505017757416,
-0.015292885713279247,
0.02720985747873783,
0.01049064937978983,
-0.024171536788344383,
-0.017554746940732002,
-0.007038778625428677,
-0.03375912830233574,
-0.018027374520897865,
0.04223266988992691,
-0.003342153737321496,
-0.06778833270072937,
-0.05391332879662514,
0.011773495934903622,
-0.037371356040239334,
-0.010389371775090694,
-0.01421259343624115,
0.014896215870976448,
0.048343073576688766,
0.08946169167757034,
-0.029809311032295227,
-0.021183853968977928,
-0.03428239747881889,
0.004603901412338018
]
|
36,399 | vobject | vCard | null | def vCard():
return newFromBehavior('vcard', '3.0')
| () | [
0.04634799435734749,
-0.057534292340278625,
-0.035829540342092514,
-0.04671530798077583,
0.011603695340454578,
-0.03689808025956154,
0.02319069392979145,
0.007283614482730627,
0.06608262658119202,
0.016011429950594902,
-0.014425313100218773,
0.02319069392979145,
-0.07726892083883286,
0.06387875974178314,
-0.013089635409414768,
0.014775928109884262,
0.060906875878572464,
0.002999012591317296,
-0.01646221987903118,
-0.013189811259508133,
0.0337759368121624,
0.006624123547226191,
-0.06811953336000443,
-0.0010810636449605227,
0.024058884009718895,
0.11787350475788116,
-0.015043063089251518,
0.0113449078053236,
-0.010401585139334202,
-0.011511866934597492,
-0.025678392499685287,
-0.004883569665253162,
0.03242356330156326,
0.05920388922095299,
-0.012580408714711666,
0.03896838054060936,
0.01231327373534441,
-0.02576187252998352,
-0.016721008345484734,
0.04070476070046425,
-0.011962657794356346,
0.0059938509948551655,
0.03997013717889786,
-0.03299122303724289,
-0.016069864854216576,
0.005538885947316885,
0.04027066379785538,
0.01854921504855156,
0.02145431376993656,
0.005213314667344093,
0.04658173769712448,
0.026329535990953445,
-0.01303119957447052,
-0.06404571980237961,
-0.06294378638267517,
-0.02102021872997284,
0.057233765721321106,
0.1071213036775589,
-0.026980677619576454,
0.06858702003955841,
-0.02941828779876232,
-0.000029707076464546844,
0.007070740684866905,
-0.058435872197151184,
-0.03803340718150139,
0.026346230879426003,
0.05459580197930336,
-0.03242356330156326,
0.006298552267253399,
0.013865998014807701,
0.009057560004293919,
0.02334095723927021,
-0.004795915447175503,
0.0016977707855403423,
0.06047278270125389,
-0.043843600898981094,
-0.023307565599679947,
0.023992100730538368,
0.024659939110279083,
-0.010084361769258976,
0.04771706461906433,
0.010485065169632435,
0.006636645644903183,
-0.010468369349837303,
-0.017530761659145355,
0.0569666288793087,
-0.0023270000237971544,
-0.048885781317949295,
0.037165217101573944,
0.07646751403808594,
0.0007909712730906904,
-0.022038672119379044,
-0.0431089773774147,
0.01545211486518383,
-0.022222328931093216,
-0.015118195675313473,
0.05222497507929802,
-0.007930583320558071,
0.031121276319026947,
0.021237265318632126,
-0.06918807327747345,
0.07800354063510895,
-0.11112833768129349,
-0.008093368262052536,
-0.04905274137854576,
0.03234008327126503,
-0.023224085569381714,
0.07666786760091782,
-0.0002859183878172189,
0.004165642894804478,
0.012822500430047512,
-0.00994244683533907,
-0.013056243769824505,
0.02966872788965702,
0.0113449078053236,
-0.04300880432128906,
0.047550104558467865,
0.012254837900400162,
-0.008665204979479313,
-0.026095790788531303,
-0.006519773975014687,
-0.04000353068113327,
-0.03210633993148804,
-0.02941828779876232,
-0.006160810589790344,
0.010710461065173149,
-0.00487104756757617,
-0.024843594059348106,
0.016353696584701538,
0.04187347739934921,
-0.01253866869956255,
0.009808878414332867,
-0.018181905150413513,
-0.054028138518333435,
-0.001005931873805821,
-0.03309139981865883,
0.05736733227968216,
-0.038500893861055374,
0.000672534282784909,
0.07526540756225586,
-0.07559932768344879,
0.03143849968910217,
0.030870838090777397,
0.002786139026284218,
-0.054862938821315765,
-0.016545699909329414,
0.04371003434062004,
-0.030403349548578262,
-0.02774869278073311,
0.0041927737183868885,
0.007254396565258503,
0.052391935139894485,
0.047950807958841324,
0.05035502836108208,
0.05740072578191757,
-0.023908620700240135,
0.012129617854952812,
-0.08641830831766129,
0.04377681761980057,
0.014942888170480728,
0.0017009013099595904,
0.029251329600811005,
-0.045813724398612976,
0.04557998105883598,
0.06434624642133713,
-0.032707393169403076,
0.001867861021310091,
-0.03970300406217575,
-0.025160817429423332,
-0.0034664995037019253,
-0.022873470559716225,
-0.007291962392628193,
-0.05222497507929802,
0.006290204357355833,
0.022873470559716225,
0.03188928961753845,
-0.018565911799669266,
0.0250773373991251,
0.032807569950819016,
-0.04658173769712448,
0.0337759368121624,
0.0491529181599617,
0.012321621179580688,
0.04197365418076515,
0.02916784957051277,
0.009441567584872246,
0.08675222843885422,
0.04808437451720238,
0.05549738556146622,
-0.03362566977739334,
0.04157295078039169,
0.04103868082165718,
0.037165217101573944,
-0.003817114746198058,
-0.014099741354584694,
-0.08601760864257812,
0.010318106040358543,
0.017497370019555092,
-0.07539897412061691,
0.006223420612514019,
0.02132074534893036,
-0.00884886085987091,
-0.04297541081905365,
-0.02046925202012062,
0.012605452910065651,
0.012597104534506798,
-0.012981112115085125,
-0.07352902740240097,
0.015427070669829845,
-0.046648524701595306,
-0.014625664800405502,
-0.003024056553840637,
0.036230240017175674,
0.00023817835608497262,
-0.01938401348888874,
-0.07793676108121872,
-0.010034274309873581,
-0.0063653364777565,
0.008197718299925327,
0.007893016561865807,
0.05222497507929802,
0.012021093629300594,
-0.03773287683725357,
0.018632695078849792,
-0.030820749700069427,
0.01988489367067814,
-0.06084009259939194,
-0.03070387803018093,
-0.0801406279206276,
-0.03873463720083237,
-0.014124785549938679,
0.00024378715897910297,
-0.018081728368997574,
0.007154220715165138,
-0.07673464715480804,
-0.029067672789096832,
0.022389287129044533,
0.014316788874566555,
-0.03596310690045357,
-0.009182780049741268,
0.06992270052433014,
0.03085414133965969,
0.08534976840019226,
0.07319510728120804,
0.0034915434662252665,
-0.022823382169008255,
-0.02190510556101799,
0.004077989142388105,
0.02566169574856758,
-0.043543074280023575,
-0.0579683855175972,
-0.07125837355852127,
-0.03426011651754379,
0.04103868082165718,
-0.021587882190942764,
-0.046214427798986435,
-0.05950441583991051,
-0.018966615200042725,
0.058035172522068024,
-0.011854134500026703,
-0.018582608550786972,
-0.0036793730687350035,
0.027915650978684425,
-0.004119729157537222,
0.04968718811869621,
0.02185501717031002,
0.011637086980044842,
0.031188061460852623,
0.024910377338528633,
-0.002594135468825698,
0.03247364982962608,
0.0020911695901304483,
-0.026780325919389725,
-0.03213972970843315,
-0.0026108312886208296,
-0.03649737685918808,
-0.04568015784025192,
0.030670486390590668,
0.00536357844248414,
-0.02833305113017559,
0.004958701319992542,
-0.0068662152625620365,
0.019450798630714417,
0.026730237528681755,
0.0027110071387141943,
-0.03264060989022255,
-0.010568545199930668,
-0.012296577915549278,
-0.023107213899493217,
-0.011069424450397491,
-0.03599649667739868,
0.04153955727815628,
0.00042626881622709334,
-0.03863446041941643,
0.03304131329059601,
0.02086995542049408,
-0.035428836941719055,
-0.002443871693685651,
-0.02996925450861454,
-0.0008687118533998728,
0.0010706286411732435,
0.004925309214740992,
-0.0072126565501093864,
0.06828649342060089,
-0.06371179968118668,
0.030136214569211006,
-0.02482689917087555,
0.0006234899046830833,
-0.016170041635632515,
-0.00463730376213789,
0.014976279810070992,
0.05172409489750862,
-0.00839389581233263,
-0.0010831506224349141,
0.03569597005844116,
0.02704746089875698,
0.003247364889830351,
-0.017347106710076332,
0.07185942679643631,
0.005843587219715118,
0.007922234944999218,
-0.018565911799669266,
-0.03163885325193405,
0.03816697373986244,
-0.010752201080322266,
-0.029585247859358788,
-0.015760989859700203,
0.012254837900400162,
-0.05883657559752464,
0.03926890715956688,
-0.09516699612140656,
0.049420055001974106,
0.032022859901189804,
0.041472773998975754,
-0.010426629334688187,
-0.0012751542963087559,
0.0005514885415323079,
-0.058869969099760056,
-0.012797456234693527,
-0.017246929928660393,
0.0849490612745285,
0.0029197067487984896,
-0.046514954417943954,
-0.06858702003955841,
-0.04304219409823418,
-0.012246489524841309,
0.02916784957051277,
-0.015385330654680729,
0.004904439207166433,
-0.05529703199863434,
-0.04274166747927666,
-0.06681724637746811,
0.06444641947746277,
0.07887173444032669,
-0.012196402065455914,
-0.019868196919560432,
-0.015635769814252853,
0.018833046779036522,
-0.007717709522694349,
-0.010576893575489521,
0.026496494188904762,
0.018732871860265732,
-0.016520656645298004,
0.0018156861187890172,
-0.03749913349747658,
-0.045279454439878464,
-0.0039673782885074615,
0.018432343378663063,
-0.00072783965151757,
0.011061076074838638,
0.0010617589578032494,
-0.0010821071919053793,
-0.0367979034781456,
0.01085237693041563,
0.04140599071979523,
-0.07640073448419571,
-0.040137097239494324,
-0.03374254330992699,
0.017196843400597572,
-0.01434183306992054,
-0.005952110979706049,
0.05102286487817764,
0.019100183621048927,
-0.03329175338149071,
-0.013022852130234241,
-0.013732430525124073,
-0.024409499019384384,
0.08935680240392685,
-0.008615117520093918,
-0.02596222423017025,
-0.014016261324286461,
0.0005060964031144977,
-0.020185420289635658,
0.028466617688536644,
-0.022572943940758705,
-0.006398728117346764,
-0.031521979719400406,
-0.029585247859358788,
0.019517581909894943,
-0.0017123798606917262,
0.026396319270133972,
0.021137090399861336,
0.000644881627522409,
-0.015944644808769226,
-0.026496494188904762,
-0.020001765340566635,
0.06107383593916893,
-0.0039673782885074615,
-0.009441567584872246,
-0.06918807327747345,
-0.017130058258771896,
-0.00039705089875496924,
-0.03783305361866951,
-0.041472773998975754,
0.02774869278073311,
0.028015827760100365,
0.07212656736373901,
-0.013289987109601498,
-0.02724781259894371,
-0.0005092269275337458,
0.027615124359726906,
0.0008264502394013107,
-0.03896838054060936,
0.02749825268983841,
0.004042510408908129,
0.03210633993148804,
0.018632695078849792,
0.040036920458078384,
0.009625223465263844,
-0.07606681436300278,
0.009984186850488186,
0.0652812197804451,
-0.010919160209596157,
-0.05359404534101486,
-0.011403343640267849,
-0.002969794673845172,
-0.010025925934314728,
-0.04484535753726959,
0.01364895049482584,
0.06297717243432999,
-0.011829090304672718,
-0.016545699909329414,
-0.03576275333762169,
-0.020435860380530357,
-0.008656857535243034,
-0.011762307025492191,
-0.0011332385474815965,
-0.03466081991791725,
0.047650281339883804,
-0.05452901870012283,
0.019217055290937424,
0.014934539794921875,
0.06524782627820969,
-0.02626275084912777,
0.0013325465843081474,
-0.011829090304672718,
-0.015961341559886932,
0.01329833548516035,
-0.015869513154029846,
-0.03596310690045357,
-0.00790136493742466,
0.016170041635632515,
-0.04444465786218643,
-0.021387530490756035,
-0.05182427167892456,
0.10498422384262085,
-0.011520215310156345,
0.0019388188375160098,
-0.0209200419485569,
0.027464861050248146,
-0.008272849954664707,
-0.013331727124750614,
0.036230240017175674,
0.002840400906279683,
0.025244297459721565,
0.02666345424950123,
0.02941828779876232,
-0.015560638159513474,
-0.08581725507974625,
-0.009032516740262508,
-0.034694213420152664,
-0.04023727402091026,
-0.033992983400821686,
0.06484712660312653,
-0.014650708064436913,
0.029434984549880028,
0.008882252499461174,
0.060906875878572464,
-0.030286477878689766,
-0.0091994758695364,
-0.04841829463839531,
0.038300540298223495,
-0.06494729965925217,
0.030737269669771194,
0.05706680566072464,
0.036964863538742065,
0.058268915861845016,
0.018382256850600243,
-0.005931240972131491,
-0.03254043310880661,
-0.002247694181278348,
-0.03407646343111992,
-0.012087877839803696,
-0.05152374505996704,
-0.019901588559150696,
-0.037666093558073044,
-0.024459587410092354,
-0.02536116912961006,
0.032373473048210144,
-0.01162039116024971,
-0.019350621849298477,
-0.01703823171555996,
0.015510550700128078,
0.0002997447154484689,
-0.011586998589336872,
0.03482777997851372,
-0.0705905333161354,
0.006398728117346764,
-0.03456064686179161,
-0.017480675131082535,
0.05482954531908035,
-0.02611248753964901,
0.057434115558862686,
-0.06998948007822037,
0.050421811640262604,
0.07105801999568939,
-0.04761688783764839,
0.0048960912972688675,
0.02789895609021187,
0.00578515138477087,
-0.012271533720195293,
0.01246353704482317,
0.005284272599965334,
0.007104132790118456,
-0.034193333238363266,
0.009374783374369144,
-0.060506172478199005,
0.02729790098965168,
-0.041806694120168686,
-0.03446047008037567,
0.003234843024984002,
-0.04658173769712448,
-0.03031987138092518,
0.01731371507048607,
-0.008690249174833298,
0.010994291864335537,
0.007162568625062704,
-0.10631989687681198,
-0.031471893191337585,
-0.04371003434062004,
0.0017228147480636835,
-0.003161798231303692,
-0.017981553450226784,
-0.056899845600128174,
0.023073822259902954,
0.04157295078039169,
-0.000944887229707092,
-0.06741829961538315,
0.03763270378112793,
-0.047149401158094406,
0.05169070512056351,
0.025995615869760513,
-0.03085414133965969,
-0.01721353828907013,
-0.004307558760046959,
0.062042202800512314,
0.021721448749303818,
-0.00877372920513153,
-0.012889283709228039,
-0.02526099421083927,
0.038100190460681915,
-0.008990776725113392,
0.032557129859924316,
0.09964150935411453,
-0.030086126178503036,
0.015969689935445786,
0.047049228101968765,
0.04534623771905899,
-0.0009866270702332258,
-0.019567670300602913,
-0.02329086884856224,
-0.027331292629241943,
0.021771537140011787,
-0.08675222843885422,
-0.06264325976371765,
-0.026246055960655212,
-0.047449927777051926,
0.012079529464244843,
0.04244114086031914,
-0.032673999667167664,
0.022656423971056938,
-0.03436029329895973,
-0.0022602160461246967,
-0.022472767159342766,
-0.036363810300827026,
0.005689149722456932,
-0.031321629881858826,
0.0035124134737998247,
0.025344472378492355,
-0.0009428001940250397,
0.024893682450056076,
0.021487705409526825,
0.0033141488675028086,
0.04070476070046425,
0.025010554119944572,
0.0009532351978123188,
-0.05212479829788208,
-0.01698814332485199,
0.05599826201796532,
0.001410808996297419,
0.0015777685912325978,
-0.04614764451980591,
-0.06658350676298141,
-0.020168723538517952,
0.04317576438188553,
0.019667845219373703,
-0.03786644712090492,
0.03536204993724823,
-0.003426846582442522,
0.03866785392165184,
-0.006494729779660702,
0.04454483091831207,
-0.022923558950424194,
0.011553606949746609,
0.0018856003880500793,
-0.029050977900624275,
-0.04267488420009613,
0.02324078232049942,
0.006644993554800749,
0.013974522240459919,
0.08969071507453918,
0.0007247091853059828,
0.03205624967813492,
0.003095014253631234,
-0.04484535753726959,
-0.012355013750493526,
-0.00647803395986557,
0.026763631030917168,
-0.0056724539026618,
0.12168018519878387,
-0.030403349548578262,
-0.013590514659881592,
0.010209581814706326,
0.018365560099482536,
-0.04938666149973869,
-0.014625664800405502,
-0.009750442579388618,
-0.007888843305408955,
0.007780319079756737,
-0.004904439207166433,
-0.0020348206162452698,
0.01560237817466259,
-0.008494071662425995,
0.002214302308857441,
-0.02127065882086754,
0.011177947744727135,
0.0564657486975193,
0.07005626708269119,
0.0036021543201059103,
0.011361603625118732,
-0.03042004629969597,
-0.004541302099823952,
0.05686645209789276,
0.021304050460457802,
0.05275924503803253,
0.030820749700069427,
0.06568191945552826,
-0.05943763256072998,
-0.08908966183662415,
0.010217930190265179,
0.00009789313480723649,
0.02661336585879326,
-0.03472760319709778,
0.011762307025492191,
0.006098201032727957,
-0.051790881901979446,
-0.030486829578876495,
0.0335254967212677,
0.046214427798986435,
0.05225836858153343,
0.06384536623954773,
0.011879178695380688,
0.020936738699674606,
-0.04761688783764839,
0.043743424117565155,
-0.055063288658857346,
0.015084803104400635,
0.05513007193803787,
-0.027364684268832207,
-0.08715292811393738,
-0.03042004629969597,
-0.02210545539855957,
0.024793505668640137,
0.01913357526063919,
-0.019450798630714417,
0.09810548275709152,
0.009191128425300121,
-0.006394554395228624,
-0.009591830894351006,
-0.00811841245740652,
0.0006636645412072539,
0.010768896900117397,
-0.027665212750434875,
0.03823375701904297,
-0.016170041635632515,
-0.0041259899735450745,
0.0279824361205101,
-0.024309324100613594,
0.028967497870326042,
-0.05439545214176178,
0.03354218974709511,
0.04825133457779884,
0.028366442769765854,
-0.020101940259337425,
0.03566258028149605,
0.004105119965970516,
0.0009386262390762568,
0.04524606093764305,
0.031521979719400406,
0.001680031418800354,
0.005313490517437458,
-0.025344472378492355,
0.04381021112203598,
-0.017914770171046257,
0.042507924139499664,
0.04307558760046959,
-0.03168893977999687,
0.07633394747972488,
-0.004461996257305145,
-0.012321621179580688,
0.03304131329059601,
0.0068662152625620365,
-0.05169070512056351,
-0.015285154804587364,
-0.036764513701200485,
-0.02026890031993389,
-0.002859183819964528,
-0.013289987109601498,
-0.004057119134813547,
0.013598863035440445,
0.0012981111649423838,
0.043442897498607635,
0.005213314667344093,
-0.005939589347690344,
0.014976279810070992,
0.10237964987754822,
-0.0005869675078429282,
-0.017447281628847122,
0.009825575165450573,
0.03120475634932518,
0.008790425024926662,
-0.03127153962850571,
0.011737262830138206,
-0.015226718969643116,
0.020836563780903816,
-0.04173991084098816,
-0.022222328931093216,
-0.006753517314791679,
-0.01948419027030468,
-0.03446047008037567,
-0.03284095972776413,
-0.04958701133728027,
-0.00007558836659882218,
-0.005914545152336359,
-0.021771537140011787,
0.029785599559545517,
0.027231117710471153,
0.027464861050248146
]
|
36,401 | torch_pso.optim.AcceleratedPSO | AcceleratedPSO |
ChaoticPSO is a variation on the original Particle Swarm Optimization developed to quickly train SVMs. It simplifies
the original PSO algorithm--most notably eschewing the need for velocity states.
Original Paper:
Yang, X. S., Deb, S., and Fong, S., (2011), Accelerated Particle Swarm Optimization and Support Vector Machine for
Business Optimization and Applications, in: NDT2011, CCIS 136, Springer, pp. 53-66 (2011)
https://arxiv.org/abs/1203.6577
| class AcceleratedPSO(GenericPSO):
"""
ChaoticPSO is a variation on the original Particle Swarm Optimization developed to quickly train SVMs. It simplifies
the original PSO algorithm--most notably eschewing the need for velocity states.
Original Paper:
Yang, X. S., Deb, S., and Fong, S., (2011), Accelerated Particle Swarm Optimization and Support Vector Machine for
Business Optimization and Applications, in: NDT2011, CCIS 136, Springer, pp. 53-66 (2011)
https://arxiv.org/abs/1203.6577
"""
def __init__(self,
params: Iterable[torch.nn.Parameter],
num_particles: int = 100,
alpha: float = 0.3,
beta: float = 0.45,
decay_parameter: float = 0.7,
max_param_value: float = -10,
min_param_value: float = 10):
particle_kwargs = {'alpha': alpha,
'beta': beta,
'decay_parameter': decay_parameter,
'max_param_value': max_param_value,
'min_param_value': min_param_value,
}
super().__init__(params, num_particles, particle_class=AcceleratedParticle, particle_kwargs=particle_kwargs)
| (params: Iterable[torch.nn.parameter.Parameter], num_particles: int = 100, alpha: float = 0.3, beta: float = 0.45, decay_parameter: float = 0.7, max_param_value: float = -10, min_param_value: float = 10) | [
-0.002019689418375492,
-0.07275719940662384,
-0.04798879101872444,
0.024275854229927063,
0.009868662804365158,
-0.00026414284366182983,
-0.049431268125772476,
-0.035938818007707596,
-0.0029575203079730272,
0.004450573120266199,
0.031716931611299515,
0.012190700508654118,
-0.005932631902396679,
0.027600590139627457,
-0.050733018666505814,
0.019455865025520325,
0.0330890454351902,
0.018048569560050964,
-0.008122735656797886,
-0.014539125375449657,
0.02846255898475647,
0.022041771560907364,
-0.04341507703065872,
0.00742348562926054,
-0.009288152679800987,
0.012049971148371696,
-0.02112703025341034,
-0.010255669243633747,
-0.07353121042251587,
-0.044329822063446045,
0.0010494249872863293,
0.01270964089781046,
-0.023871256038546562,
0.02218250185251236,
0.05537709221243858,
0.007938028313219547,
0.03947465121746063,
0.0529143251478672,
-0.08922255784273148,
0.02675621397793293,
-0.008602095767855644,
-0.07796419411897659,
0.010818587616086006,
-0.024891545996069908,
-0.020634476095438004,
-0.010493149980902672,
-0.012999895960092545,
0.10589901357889175,
0.020229877904057503,
-0.026246068999171257,
0.011583804152905941,
-0.07423485815525055,
0.05977489426732063,
-0.029764307662844658,
-0.020265061408281326,
0.08915219455957413,
0.04883316904306412,
0.03479539230465889,
0.036061957478523254,
0.015277955681085587,
0.048446159809827805,
-0.007392701227217913,
0.05154221132397652,
-0.010493149980902672,
0.011082455515861511,
-0.017687950283288956,
-0.02663307450711727,
-0.013606792315840721,
-0.023167608305811882,
0.0450686514377594,
0.05615110695362091,
-0.0707869827747345,
0.010070960968732834,
0.033775102347135544,
0.026861760765314102,
-0.003980008885264397,
0.004754021298140287,
-0.017907841131091118,
0.01489974558353424,
-0.03838399425148964,
-0.0010587702272459865,
-0.04337989538908005,
-0.06258948147296906,
-0.007040877360850573,
-0.008162315934896469,
-0.02170753851532936,
-0.0025837072171270847,
-0.04091712832450867,
0.009235379286110401,
0.005629183724522591,
-0.03321218490600586,
0.02740708738565445,
0.01831243745982647,
0.015453867614269257,
0.054427169263362885,
0.03368714451789856,
0.021162211894989014,
-0.062061749398708344,
-0.0028563709929585457,
-0.02939489297568798,
-0.005075060762465,
0.08218608051538467,
-0.02394162118434906,
0.036589693278074265,
0.042746610939502716,
-0.020036375150084496,
-0.04352062568068504,
0.03894691541790962,
0.016711639240384102,
-0.03548144921660423,
-0.04242997244000435,
0.08345264941453934,
-0.05854351073503494,
-0.007427883800119162,
-0.0476369671523571,
-0.062659852206707,
-0.01323737669736147,
0.022340822964906693,
-0.07261646538972855,
0.004059168975800276,
0.008175509981811047,
0.031365107744932175,
-0.024152716621756554,
0.004360418301075697,
-0.023660162463784218,
-0.0003947025106754154,
0.02899029478430748,
0.0007239877595566213,
-0.05252731963992119,
-0.04911462590098381,
-0.03067905083298683,
-0.009912640787661076,
0.012181905098259449,
-0.003335731104016304,
0.022516734898090363,
-0.08239717781543732,
0.059528615325689316,
-0.015392298810184002,
-0.07726054638624191,
0.016685251146554947,
0.03785625845193863,
0.002559519372880459,
0.008289852179586887,
-0.011214389465749264,
0.0032917531207203865,
0.023273155093193054,
0.0530550554394722,
-0.05027564615011215,
0.01643017865717411,
-0.016280654817819595,
-0.004542927257716656,
0.003155421232804656,
-0.009323335252702236,
-0.02716081030666828,
-0.014336827211081982,
-0.028040369972586632,
0.009780706837773323,
-0.07789383083581924,
-0.03683596849441528,
-0.00927056185901165,
-0.0740237608551979,
-0.016579704359173775,
-0.049325719475746155,
0.0011610190849751234,
-0.018734626471996307,
0.01936790905892849,
0.019104041159152985,
-0.023853665217757225,
0.026334024965763092,
0.006939727813005447,
0.02323797345161438,
-0.024662859737873077,
0.031892843544483185,
0.012533728964626789,
0.0035820077173411846,
0.0591416098177433,
-0.0018349819583818316,
-0.007199198007583618,
0.04053012281656265,
-0.026369206607341766,
-0.014987701550126076,
-0.010572310537099838,
-0.02570074051618576,
-0.06174510717391968,
0.0019669157918542624,
0.034478750079870224,
0.05449753254652023,
0.02577110566198826,
-0.017503242939710617,
0.02265746332705021,
0.0036985494662076235,
-0.006473561283200979,
0.017239375039935112,
0.01308785192668438,
0.00011448022269178182,
0.03393342345952988,
-0.005119038745760918,
-0.012788801454007626,
-0.007401496637612581,
0.07740127295255661,
-0.00670664431527257,
0.0442594550549984,
0.016245471313595772,
-0.0000029590664780698717,
-0.028233874589204788,
0.03467225283384323,
0.036519329994916916,
0.06336349993944168,
-0.04788324236869812,
-0.03609713912010193,
-0.017934227362275124,
-0.02564796805381775,
0.04218369349837303,
-0.00500469608232379,
0.030643867328763008,
-0.024311035871505737,
0.006108543835580349,
-0.008417388424277306,
0.004714441020041704,
0.01159259956330061,
0.04707404598593712,
0.006781407166272402,
-0.04577229917049408,
0.05112002417445183,
0.057769495993852615,
0.012841574847698212,
0.024891545996069908,
-0.01771433651447296,
-0.01323737669736147,
-0.04478719085454941,
0.022112136706709862,
-0.0019856065046042204,
-0.031593792140483856,
0.027319131419062614,
0.06755020469427109,
0.04383726790547371,
0.0032521728426218033,
-0.033546414226293564,
-0.11307622492313385,
-0.04183186963200569,
-0.0004480258503463119,
-0.022376004606485367,
-0.005611592438071966,
-0.022903740406036377,
-0.02944766730070114,
0.0047408281825482845,
0.05017009750008583,
0.055588189512491226,
-0.005739128682762384,
0.009235379286110401,
0.020440973341464996,
-0.03697669878602028,
-0.04373171925544739,
0.023308338597416878,
-0.030942918732762337,
-0.09661086648702621,
0.020106740295886993,
0.021162211894989014,
0.019209589809179306,
0.002291253535076976,
-0.06835939735174179,
-0.028427377343177795,
-0.040811579674482346,
0.054427169263362885,
0.02740708738565445,
-0.0077049448154866695,
-0.023273155093193054,
0.010730631649494171,
-0.002748624887317419,
0.04088194668292999,
0.09224824607372284,
-0.003632582491263747,
-0.022780602797865868,
-0.012612889520823956,
0.025067457929253578,
-0.010246872901916504,
-0.034883346408605576,
0.029482848942279816,
0.014037776738405228,
0.04278179630637169,
0.04179668799042702,
-0.016113538295030594,
-0.033300139009952545,
-0.016412587836384773,
-0.021549219265580177,
-0.03495371341705322,
0.012542524375021458,
-0.0029685148037970066,
0.06255429983139038,
0.01767035946249962,
-0.048551708459854126,
0.04781287908554077,
0.027301540598273277,
-0.0025881051551550627,
0.033546414226293564,
0.04552602395415306,
-0.013844273053109646,
0.013650770299136639,
0.00786766316741705,
-0.07803455740213394,
0.09407772868871689,
-0.031118830665946007,
-0.03673042356967926,
-0.030538320541381836,
-0.009719137102365494,
0.008544924668967724,
0.056186288595199585,
0.004395600873976946,
0.03831363096833229,
-0.02833942137658596,
0.027829276397824287,
0.017459264025092125,
0.003384106792509556,
0.07036479562520981,
-0.012947122566401958,
-0.016263063997030258,
0.015981603413820267,
-0.05375870317220688,
0.040635667741298676,
0.07268683612346649,
-0.03855990618467331,
0.03300108760595322,
-0.017907841131091118,
0.014486351981759071,
-0.0044769602827727795,
-0.03848954290151596,
0.023167608305811882,
0.02176031284034252,
0.01220829226076603,
-0.011671760119497776,
-0.046088941395282745,
0.01467105932533741,
-0.0071420264430344105,
0.015752919018268585,
-0.07395339757204056,
-0.03771552816033363,
0.0029267356730997562,
0.03219189494848251,
0.03771552816033363,
-0.015937626361846924,
0.06213211268186569,
0.010396398603916168,
-0.03572772443294525,
0.05773431435227394,
0.013017486780881882,
-0.07170172780752182,
0.04728514328598976,
0.0045341313816607,
0.027794094756245613,
0.016474157571792603,
0.015119635500013828,
0.035182397812604904,
0.03602677583694458,
0.0760643407702446,
0.06589663028717041,
-0.006024985574185848,
0.0005423036636784673,
0.013958616182208061,
-0.02052892930805683,
-0.046511128544807434,
0.03866545483469963,
-0.04359098896384239,
-0.02617570385336876,
0.04320398345589638,
-0.004797999281436205,
-0.01848834939301014,
-0.015814486891031265,
-0.03891173005104065,
0.048551708459854126,
-0.017687950283288956,
-0.011610191315412521,
-0.07683835923671722,
-0.017687950283288956,
-0.023167608305811882,
0.01966696046292782,
0.015014087781310081,
-0.04612412303686142,
0.012744823470711708,
0.03556940332055092,
-0.029359711334109306,
0.07096289843320847,
-0.04834061488509178,
-0.010317238047719002,
0.00962238572537899,
0.0286912452429533,
0.0054928516037762165,
0.02311483584344387,
-0.02962357923388481,
0.12151999771595001,
-0.006768213585019112,
-0.016095947474241257,
0.0040657659992575645,
0.02230563946068287,
-0.052843961864709854,
-0.037398889660835266,
-0.01584087498486042,
0.006671462208032608,
0.024381401017308235,
-0.058473143726587296,
-0.03609713912010193,
0.009490451775491238,
-0.04369653761386871,
0.04366135597229004,
0.025260960683226585,
-0.027125628665089607,
-0.07866784185171127,
0.05622147023677826,
-0.0003559469187166542,
-0.005514840595424175,
0.12581224739551544,
-0.038454361259937286,
0.03097810037434101,
0.02283337526023388,
-0.01841798424720764,
-0.02047615498304367,
-0.04552602395415306,
-0.005866664927452803,
-0.0016106941038742661,
-0.005563216749578714,
0.012718436308205128,
0.016474157571792603,
0.03551663085818291,
0.027970006689429283,
0.027618182823061943,
0.01747685670852661,
0.015884852036833763,
-0.03479539230465889,
0.024662859737873077,
0.013633178547024727,
-0.022094545885920525,
-0.060759998857975006,
-0.009279357269406319,
-0.06114700809121132,
-0.04788324236869812,
0.02283337526023388,
0.0030828574672341347,
0.003661168273538351,
-0.005778708960860968,
-0.0011434279149398208,
0.04900908097624779,
0.028849566355347633,
0.022446369752287865,
0.018787400797009468,
0.04689813405275345,
0.017292147502303123,
0.0181365255266428,
-0.054075345396995544,
-0.006420787423849106,
-0.024434175342321396,
-0.02781168557703495,
0.08190461993217468,
0.041339315474033356,
0.05667884275317192,
0.006007394287735224,
0.010686652734875679,
-0.02001878432929516,
-0.03009854070842266,
-0.05294950678944588,
-0.013888251036405563,
-0.00842178612947464,
-0.0026430776342749596,
0.03509443998336792,
-0.00011317462485749274,
-0.019438274204730988,
0.017819885164499283,
-0.03333532065153122,
0.04119858890771866,
-0.0009856568649411201,
0.004727634601294994,
-0.004745225887745619,
0.056960299611091614,
-0.014706241898238659,
0.017459264025092125,
-0.08267863094806671,
-0.03551663085818291,
0.018681852146983147,
-0.019860463216900826,
0.0012192899594083428,
0.04264106601476669,
-0.0037645164411514997,
0.038102537393569946,
-0.05938788503408432,
0.03666005656123161,
0.04408354312181473,
-0.025208188220858574,
0.004907944239675999,
0.027090445160865784,
0.03198079764842987,
0.0016788600478321314,
0.00536971352994442,
-0.02183067798614502,
-0.012727232649922371,
0.015585802495479584,
0.027424678206443787,
-0.06153401359915733,
-0.007520237471908331,
0.013334129005670547,
0.02417030744254589,
0.03368714451789856,
-0.03479539230465889,
-0.001489754649810493,
0.016685251146554947,
-0.019332727417349815,
-0.06470043212175369,
0.04119858890771866,
-0.04753141850233078,
-0.02816350944340229,
0.018400393426418304,
-0.04964236170053482,
0.06575590372085571,
0.014468761160969734,
-0.06895750015974045,
0.02934211865067482,
-0.027020081877708435,
0.043977998197078705,
0.01901608519256115,
-0.014583103358745575,
0.08056768774986267,
-0.005413691513240337,
-0.08654870092868805,
0.03673042356967926,
0.022270457819104195,
0.03848954290151596,
0.013017486780881882,
-0.008518537506461143,
0.03537590056657791,
-0.03321218490600586,
-0.04584266245365143,
0.01964936964213848,
0.026721030473709106,
-0.009666363708674908,
-0.04893871396780014,
-0.03597399964928627,
0.03926355391740799,
0.0316641591489315,
0.017116235569119453,
-0.019139224663376808,
-0.031083647161722183,
0.055060453712940216,
-0.03479539230465889,
-0.006280058063566685,
0.0061789085157215595,
0.025436872616410255,
-0.013272559270262718,
0.004701247904449701,
-0.011698147282004356,
-0.011390301398932934,
0.03440838307142258,
-0.045279745012521744,
0.015541823580861092,
-0.009235379286110401,
-0.02986985445022583,
-0.028779201209545135,
0.03609713912010193,
0.048023972660303116,
0.004622087348252535,
-0.03585086390376091,
-0.04918499290943146,
-0.01871703565120697,
0.05474381148815155,
-0.013131829909980297,
-0.030555911362171173,
0.06498188525438309,
-0.032702039927244186,
-0.052492137998342514,
0.0019878053572028875,
0.0016271858476102352,
0.003146625589579344,
-0.02065206691622734,
-0.004758419468998909,
0.09449991583824158,
-0.01771433651447296,
-0.05520118027925491,
-0.012436977587640285,
-0.025260960683226585,
0.0042042965069413185,
0.013510040938854218,
-0.02323797345161438,
-0.03982647508382797,
0.010572310537099838,
-0.016245471313595772,
-0.04242997244000435,
-0.01984287239611149,
-0.05006455257534981,
0.022956514731049538,
0.0425003357231617,
-0.036519329994916916,
0.015533028170466423,
0.06674100458621979,
0.021267758682370186,
-0.04299288988113403,
0.02534891664981842,
-0.01824207231402397,
-0.036695241928100586,
-0.029377302154898643,
0.0313299261033535,
-0.006847374141216278,
0.00010527233098400757,
0.035006485879421234,
-0.014820585027337074,
-0.07564215362071991,
0.04295770823955536,
0.030555911362171173,
-0.010299647226929665,
0.009508042596280575,
-0.045983392745256424,
-0.028075553476810455,
0.03440838307142258,
0.036589693278074265,
-0.004837579559534788,
0.031171604990959167,
0.003386305645108223,
-0.0037996990140527487,
-0.028849566355347633,
-0.022991696372628212,
0.009727932512760162,
-0.0629413053393364,
-0.0125513207167387,
0.1058286502957344,
-0.002388005144894123,
-0.03537590056657791,
0.02047615498304367,
-0.02323797345161438,
-0.0006827584002166986,
-0.06737428903579712,
-0.05333651602268219,
0.03509443998336792,
-0.13313019275665283,
0.011337528005242348,
0.0017679154407233,
0.02728394977748394,
-0.00016010738909244537,
0.0010923035442829132,
-0.029588395729660988,
-0.023484250530600548,
0.011654169298708439,
-0.013378106988966465,
0.031541019678115845,
-0.0008900046814233065,
0.0180661603808403,
0.002212093211710453,
0.008461366407573223,
-0.015858465805649757,
-0.006486754398792982,
0.00014718885358888656,
-0.06702246516942978,
-0.026896942406892776,
0.014187301509082317,
0.048727620393037796,
0.03961537778377533,
0.020089149475097656,
-0.01018530409783125,
-0.028550514951348305,
-0.00982468482106924,
-0.011566213332116604,
-0.013985003344714642,
0.04992382228374481,
0.021039074286818504,
0.06061927229166031,
-0.0180661603808403,
-0.006667064502835274,
0.00147766072768718,
-0.014776607044041157,
0.03760998323559761,
0.03683596849441528,
-0.05463826283812523,
-0.0025199393276125193,
-0.012305043637752533,
-0.016069559380412102,
0.06934450566768646,
-0.011319936253130436,
-0.025208188220858574,
-0.06368014216423035,
0.003419289132580161,
0.047496236860752106,
-0.041163403540849686,
0.021848268806934357,
-0.026615483686327934,
-0.030415182933211327,
0.031541019678115845,
0.0556233711540699,
0.0015557216247543693,
0.008184305392205715,
-0.0014765611849725246,
-0.0039316327311098576,
0.0006657169433310628,
0.02341388538479805,
-0.014679855667054653,
-0.0503460094332695,
-0.07529032975435257,
-0.032877951860427856,
0.017459264025092125,
0.01871703565120697,
-0.0018327829893678427,
0.04865725710988045,
-0.050557106733322144,
-0.054603081196546555,
-0.043626174330711365,
0.018558714538812637,
-0.029482848942279816,
0.01144307479262352,
-0.011882854625582695,
-0.04781287908554077,
0.022815784439444542,
-0.04753141850233078,
0.05175330489873886,
-0.018998494371771812,
-0.026597892865538597,
0.05667884275317192,
-0.029007887467741966,
0.016245471313595772,
0.059704527258872986,
0.03507684916257858,
-0.01684357225894928,
0.018171709030866623,
0.05309023708105087,
-0.00903308019042015,
0.025260960683226585,
-0.01490854099392891,
0.03521757945418358,
-0.027442269027233124,
-0.010378806851804256,
0.05273841321468353,
0.020564110949635506,
-0.04337989538908005,
-0.0476369671523571,
0.018206890672445297,
-0.0163070410490036,
0.03338809683918953,
-0.0013226382434368134,
0.007810492068529129,
0.020564110949635506,
-0.044505733996629715,
-0.04352062568068504,
0.002891553333029151,
-0.044329822063446045,
0.031241968274116516,
0.0018514737021178007,
-0.038278449326753616,
0.014433578588068485,
-0.022499142214655876,
0.011047272942960262,
-0.015489050187170506,
-0.014882153831422329,
0.06959078460931778,
0.02054652012884617,
0.007493850775063038,
0.006807793863117695,
0.04091712832450867,
-0.006957319099456072,
0.028955113142728806,
0.028321830555796623,
0.010044574737548828,
0.023026879876852036,
0.04724995791912079,
-0.05164775997400284,
0.026861760765314102,
-0.004450573120266199,
-0.0793011263012886,
-0.13024523854255676,
-0.082819364964962,
-0.04865725710988045,
0.04031902924180031,
0.037926625460386276,
0.04306325316429138,
0.02388884872198105,
0.018330028280615807,
0.016034377738833427
]
|
36,402 | torch.optim.optimizer | __getstate__ | null | def __getstate__(self) -> Dict[str, Any]:
return {
'defaults': self.defaults,
'state': self.state,
'param_groups': self.param_groups,
}
| (self) -> Dict[str, Any] | [
0.004819163586944342,
-0.04743282496929169,
0.008059432730078697,
-0.04279511421918869,
-0.012235254980623722,
-0.0015918557764962316,
-0.0424557700753212,
-0.010877877473831177,
0.048450857400894165,
-0.06549349427223206,
-0.02433854341506958,
0.03001313842833042,
-0.007333612069487572,
0.03555576503276825,
-0.021944278851151466,
-0.00471311854198575,
-0.0003417010884732008,
0.011434025131165981,
-0.04856397211551666,
-0.038798391819000244,
0.014968863688409328,
-0.022905755788087845,
0.02880658023059368,
0.02020985074341297,
0.0057028732262551785,
0.0005414194893091917,
0.006970702204853296,
-0.06998038291931152,
0.0769180953502655,
0.005109020508825779,
-0.05218364670872688,
-0.019700834527611732,
0.0004910480347461998,
0.034518878906965256,
-0.00353248231112957,
-0.029277890920639038,
-0.027166415005922318,
0.05738693103194237,
-0.07804924249649048,
-0.044982001185417175,
-0.026525430381298065,
-0.05531315878033638,
-0.03845904767513275,
-0.009214146062731743,
0.028976252302527428,
0.01068935263901949,
0.010925007984042168,
0.003937810193747282,
0.06711480766534805,
-0.05274922028183937,
0.06768038123846054,
-0.036931995302438736,
-0.012178697623312473,
0.05384266376495361,
0.001600103685632348,
-0.06545578688383102,
0.02590329945087433,
0.019681982696056366,
0.014629519544541836,
0.04113609716296196,
-0.01740083284676075,
0.021303294226527214,
0.012744272127747536,
-0.04716888815164566,
-0.024809855967760086,
-0.03898691385984421,
-0.042418066412210464,
0.0049582007341086864,
-0.03992953896522522,
0.05648200958967209,
0.02539428137242794,
-0.0483754463493824,
0.012452058494091034,
-0.01114181149750948,
-0.012555747292935848,
-0.0302205141633749,
-0.037704948335886,
-0.0016790484078228474,
0.01845657080411911,
-0.006871726363897324,
-0.047244299203157425,
0.0029197768308222294,
-0.08370498567819595,
0.02997543290257454,
-0.006881152745336294,
-0.028900841251015663,
-0.013762305490672588,
-0.019238948822021484,
-0.008559023030102253,
-0.023471329361200333,
-0.02967379242181778,
0.05851807817816734,
0.00003424375245231204,
0.04539675638079643,
0.024866413325071335,
-0.018475424498319626,
-0.02162378653883934,
0.03067297488451004,
-0.014063945040106773,
-0.0619492270052433,
-0.07235579192638397,
-0.04501970857381821,
-0.03992953896522522,
-0.01257460005581379,
-0.01945575326681137,
-0.08370498567819595,
0.026676250621676445,
-0.05135413631796837,
0.017457390204072,
-0.03821396455168724,
-0.023999199271202087,
-0.025507396087050438,
-0.029900023713707924,
0.04219183698296547,
0.020700015127658844,
0.0019771531224250793,
-0.01784386672079563,
-0.02005903236567974,
-0.022453295066952705,
-0.0032190599013119936,
-0.038138553500175476,
0.033123794943094254,
-0.007097956258803606,
0.033557403832674026,
0.02575247921049595,
0.0589328333735466,
-0.01500656921416521,
-0.0007647034362889826,
0.06059185042977333,
-0.00010773893882287666,
-0.004194675479084253,
0.005811274982988834,
-0.05399348586797714,
-0.017334848642349243,
-0.014676650986075401,
0.006390988361090422,
0.08347875624895096,
0.04351150989532471,
-0.001091676065698266,
0.07744596153497696,
0.06858529895544052,
0.04581151157617569,
-0.013149600476026535,
-0.011509435251355171,
0.03067297488451004,
-0.027015594765543938,
0.09629843384027481,
0.026883626356720924,
-0.029127070680260658,
-0.018626244738698006,
0.08649514615535736,
-0.005905537400394678,
-0.01425246987491846,
0.010642221197485924,
-0.05406889319419861,
0.0020926245488226414,
-0.004611786454916,
-0.030559860169887543,
-0.019681982696056366,
-0.018748784437775612,
-0.020077884197235107,
-0.013206157833337784,
-0.012527468614280224,
-0.05410660058259964,
0.020888540893793106,
0.04290822893381119,
0.04264429584145546,
-0.07386399060487747,
0.016825832426548004,
-0.052334465086460114,
-0.07050824910402298,
-0.03465084731578827,
-0.0722803846001625,
0.033067237585783005,
-0.01364919077605009,
0.06440004706382751,
-0.019983621314167976,
-0.008662711828947067,
-0.0048144506290555,
-0.00400850735604763,
0.0286557599902153,
-0.02213280461728573,
-0.0980328619480133,
0.04645249620079994,
-0.0006091705290600657,
-0.012913944199681282,
0.03297297656536102,
0.009746728464961052,
0.009190580807626247,
0.0424557700753212,
0.007234636694192886,
-0.00006837704131612554,
0.011481156572699547,
0.016382798552513123,
-0.044680360704660416,
0.004423261620104313,
-0.014158207923173904,
-0.02307542786002159,
0.03112543374300003,
0.051768891513347626,
-0.0002531828358769417,
-0.05546397715806961,
-0.04656561091542244,
0.023000016808509827,
-0.028486087918281555,
0.007819063030183315,
0.012819682247936726,
-0.030748384073376656,
-0.017410259693861008,
0.014950011856853962,
-0.04856397211551666,
-0.03962789848446846,
0.0037139372434467077,
0.03595166653394699,
0.016326241195201874,
-0.07507055252790451,
0.07695579528808594,
0.02680821716785431,
0.0066125052981078625,
0.01108525414019823,
0.08755088597536087,
-0.0021715692710131407,
0.04358691722154617,
-0.047093477100133896,
0.003834121860563755,
-0.017617637291550636,
-0.010491401888430119,
-0.0364229790866375,
-0.06688857823610306,
-0.02394264191389084,
0.014440994709730148,
-0.03208690881729126,
-0.0043502082116901875,
0.009699597954750061,
0.037384454160928726,
0.009096318855881691,
0.02328280545771122,
-0.06259021162986755,
-0.018126653507351875,
0.025714773684740067,
0.054031189531087875,
0.005999799817800522,
0.04343609884381294,
-0.0204172283411026,
-0.03842134028673172,
-0.06609677523374557,
0.05142954736948013,
0.06451316177845001,
0.0019912924617528915,
-0.01613771729171276,
0.05308856442570686,
0.0055237747728824615,
-0.04822462797164917,
0.024357395246624947,
-0.024319691583514214,
0.0017744890647009015,
-0.01473320834338665,
0.04460495337843895,
0.0348016656935215,
-0.041814785450696945,
0.0439639687538147,
-0.0302205141633749,
-0.051580365747213364,
0.017419684678316116,
0.034330353140830994,
0.04268199950456619,
0.05093938484787941,
-0.0069848415441811085,
-0.06398529559373856,
-0.0028585062827914953,
0.18324604630470276,
0.014318454079329967,
-0.060365621000528336,
-0.013206157833337784,
-0.015911487862467766,
-0.04215412959456444,
0.0437377393245697,
-0.05425741896033287,
-0.028693465515971184,
0.007536276243627071,
0.0512787289917469,
-0.010350007563829422,
0.008290375582873821,
0.013243862427771091,
0.018588539212942123,
-0.011603697203099728,
-0.016816405579447746,
0.01654304563999176,
0.025714773684740067,
-0.0010633973870426416,
0.016580751165747643,
0.011528287082910538,
-0.03906232491135597,
-0.0013609129237011075,
0.05708529055118561,
-0.025959856808185577,
-0.09758040308952332,
-0.0042535895481705666,
0.04630167409777641,
0.035480353981256485,
0.036385275423526764,
-0.013545501977205276,
0.0021550734527409077,
0.03359510749578476,
-0.008087711408734322,
0.017023783177137375,
0.06839677691459656,
0.0025144487153738737,
-0.008478900417685509,
-0.006292012985795736,
-0.009072752669453621,
0.03365166485309601,
0.035876255482435226,
0.005684020929038525,
-0.02710985764861107,
-0.08838039636611938,
0.002698260359466076,
-0.013111894950270653,
0.007173366378992796,
0.09132137894630432,
-0.05953611060976982,
-0.011226647533476353,
-0.019587719812989235,
0.019776245579123497,
0.042116425931453705,
-0.007074390538036823,
-0.0014327879762277007,
-0.00132909941021353,
0.04728200286626816,
0.025073789060115814,
-0.12193779647350311,
-0.02729838155210018,
0.019276654347777367,
0.028297562152147293,
-0.016863537952303886,
0.02856149710714817,
-0.0018157288432121277,
0.03067297488451004,
-0.0027713135350495577,
-0.058254141360521317,
0.011773369275033474,
-0.04294593632221222,
-0.04735741391777992,
-0.005094881169497967,
-0.01310246903449297,
-0.030390188097953796,
0.007102669216692448,
0.011000418104231358,
0.05346561595797539,
-0.07080989331007004,
-0.06545578688383102,
-0.0002745391393546015,
0.040759049355983734,
0.0831771120429039,
0.04796069115400314,
-0.022302476689219475,
-0.005976234097033739,
-0.04554757475852966,
0.011452877894043922,
0.01790984906256199,
0.0814426839351654,
-0.016863537952303886,
-0.026732807978987694,
0.030710678547620773,
0.05165577679872513,
0.0022823275066912174,
0.003610248677432537,
0.009068040177226067,
0.04041970148682594,
-0.07171481102705002,
0.013554928824305534,
-0.06455086916685104,
-0.05274922028183937,
0.0006680845399387181,
0.02680821716785431,
0.04946888983249664,
-0.024470509961247444,
-0.020134441554546356,
-0.03614019230008125,
0.009068040177226067,
0.04475577175617218,
0.008969063870608807,
0.021435262635350227,
0.05829184874892235,
0.005929103121161461,
-0.005212708842009306,
0.03734675049781799,
0.014469273388385773,
0.02237788587808609,
-0.00867213774472475,
-0.0814426839351654,
0.0007358355796895921,
-0.052334465086460114,
0.01649591512978077,
0.02247214876115322,
-0.023697558790445328,
0.05497381091117859,
-0.017184030264616013,
-0.018588539212942123,
-0.016118865460157394,
0.03242625296115875,
-0.01613771729171276,
-0.003148362971842289,
-0.034669697284698486,
0.027675431221723557,
-0.053880367428064346,
0.007776645477861166,
0.07933121174573898,
0.005217422265559435,
-0.06666234880685806,
0.004251232836395502,
-0.011537713930010796,
-0.04701806977391243,
-0.04260658845305443,
0.003417010884732008,
-0.01981394924223423,
0.020982803776860237,
0.058404963463544846,
0.03385904058814049,
0.007182792294770479,
0.03459428995847702,
0.004724901169538498,
0.038949210196733475,
0.025073789060115814,
0.03267133608460426,
0.046942658722400665,
-0.029994284734129906,
-0.0062684472650289536,
0.017023783177137375,
0.013366403989493847,
0.005943242460489273,
0.017372554168105125,
-0.014789765700697899,
-0.021340999752283096,
0.04185249283909798,
-0.014572962187230587,
0.008040579967200756,
-0.024753298610448837,
0.016062308102846146,
0.07163939625024796,
-0.019069276750087738,
0.028881989419460297,
0.029786908999085426,
0.04204101487994194,
0.03791232407093048,
-0.023395920172333717,
-0.036988552659749985,
0.029654940590262413,
0.0439639687538147,
-0.024960674345493317,
-0.003610248677432537,
-0.029579531401395798,
0.03408527374267578,
-0.04762134701013565,
-0.0050241840071976185,
0.020077884197235107,
-0.051014792174100876,
-0.003989654593169689,
-0.03169100731611252,
-0.008488326333463192,
0.026789365336298943,
-0.0392131432890892,
-0.07367546856403351,
0.06406070291996002,
-0.004708405118435621,
-0.004644778091460466,
-0.01425246987491846,
-0.015034847892820835,
-0.04113609716296196,
0.023452477529644966,
-0.018635669723153114,
0.04807380586862564,
-0.050411514937877655,
-0.03595166653394699,
-0.03691314160823822,
-0.005533201154321432,
0.011556566692888737,
-0.0028490801341831684,
-0.07043284177780151,
-0.0648525059223175,
0.008332793600857258,
0.025582807138562202,
0.00196654861792922,
-0.0013609129237011075,
0.0005431869067251682,
-0.03766724094748497,
0.03459428995847702,
0.037233635783195496,
0.0026723381597548723,
-0.009313122369349003,
-0.04419019818305969,
-0.03489592671394348,
0.020549196749925613,
0.025186903774738312,
-0.015034847892820835,
0.018220916390419006,
0.011886484920978546,
0.00854959711432457,
0.027939366176724434,
0.001175923040136695,
0.007616399321705103,
-0.033161502331495285,
0.011754517443478107,
0.04645249620079994,
-0.014921733178198338,
-0.04894101992249489,
-0.06274103373289108,
-0.0227360837161541,
0.013583207502961159,
0.028693465515971184,
0.0036385273560881615,
0.008667424321174622,
0.04049511253833771,
-0.00720164505764842,
-0.01760821044445038,
-0.0454721674323082,
-0.0226229690015316,
0.036385275423526764,
-0.019172966480255127,
0.024621330201625824,
0.033293467015028,
0.03425494581460953,
0.05776397883892059,
-0.012744272127747536,
-0.016759848222136497,
0.04852626845240593,
0.004873364232480526,
-0.03828937187790871,
-0.017768455669283867,
0.027241824194788933,
-0.0021209032274782658,
-0.06311807781457901,
-0.020888540893793106,
0.10014434158802032,
-0.03827052190899849,
0.005057176109403372,
0.0234901811927557,
0.002071415539830923,
-0.1258591115474701,
0.0004495136672630906,
0.06047873571515083,
-0.00993525329977274,
-0.018626244738698006,
0.049204956740140915,
0.04038199782371521,
0.010972139425575733,
-0.0031200842931866646,
0.01633566804230213,
-0.03757297992706299,
-0.05003446340560913,
-0.02343362383544445,
-0.06489021331071854,
-0.02322624810039997,
-0.057462338358163834,
0.007663530297577381,
-0.04366232827305794,
0.04671642929315567,
-0.008686277084052563,
0.0058961110189557076,
0.020040178671479225,
0.010972139425575733,
0.026789365336298943,
-0.05029840022325516,
-0.0034900640603154898,
-0.02699674293398857,
0.011254927143454552,
-0.00551906181499362,
0.065191850066185,
-0.04645249620079994,
0.012536894530057907,
0.01764591597020626,
0.006711480673402548,
0.021133622154593468,
-0.004201745148748159,
0.04863938316702843,
0.0074278744868934155,
0.02102050743997097,
0.0437377393245697,
-0.00490164291113615,
-0.014667224138975143,
0.0788787454366684,
0.019399195909500122,
0.00011569232447072864,
-0.00839877687394619,
-0.03610248491168022,
0.045886918902397156,
-0.06918857991695404,
0.038195110857486725,
0.05972463637590408,
0.01981394924223423,
-0.03913773596286774,
0.016279110684990883,
0.03154018893837929,
0.011339763179421425,
-0.011509435251355171,
0.009746728464961052,
0.00208084168843925,
-0.008101850748062134,
-0.017287718132138252,
-0.018824195489287376,
-0.01689181663095951,
0.0131967319175601,
0.03450002521276474,
0.00558033213019371,
-0.0064145540818572044,
-0.002969264518469572,
0.029353301972150803,
0.05723610892891884,
-0.04147544130682945,
-0.0053635286167263985,
-0.020436082035303116,
-0.07582464814186096,
0.01724058762192726,
-0.04019347205758095,
0.0036903717555105686,
-0.027750840410590172,
0.02328280545771122,
0.008299801498651505,
-0.011792222037911415,
-0.03250166401267052,
-0.02217050828039646,
-0.006070496514439583,
-0.03981642425060272,
0.04253118112683296,
0.003006969578564167,
-0.04053281620144844,
0.013790584169328213,
-0.01921067014336586,
-0.012800829485058784,
-0.028335267677903175,
0.006150619592517614,
0.014968863688409328,
0.0545213520526886,
-0.056255780160427094,
0.030993467196822166,
0.03434920683503151,
0.07194104045629501,
0.013498371466994286,
-0.016967225819826126,
0.018569685518741608,
0.007036685943603516,
0.009727876633405685,
0.01941804774105549,
-0.008606154471635818,
-0.011452877894043922,
0.007277054712176323,
-0.021133622154593468,
-0.010830746032297611,
0.0467541329562664,
-0.029579531401395798,
0.002891498152166605,
-0.01588320918381214,
-0.033218059688806534,
-0.018579112365841866,
-0.033123794943094254,
-0.02695903740823269,
-0.02705330029129982,
0.050411514937877655,
0.01628853753209114,
-0.05727381631731987,
-0.11680992692708969,
0.04501970857381821,
-0.03996724262833595,
-0.014723781496286392,
0.018334031105041504,
0.04038199782371521,
-0.09064269065856934,
0.04637708514928818,
0.048300035297870636,
-0.010020089335739613,
0.06085578352212906,
-0.019493456929922104,
0.03661150485277176,
0.01956886798143387,
-0.03606478124856949,
0.010953286662697792,
0.04460495337843895,
0.023301657289266586,
0.05482299253344536,
-0.00497705303132534,
0.01704263687133789,
0.03734675049781799,
-0.022905755788087845,
0.045434460043907166,
0.06707710027694702,
0.00447510601952672,
-0.03444346785545349,
-0.02237788587808609,
0.052975449711084366,
0.04124921187758446,
-0.010547959245741367,
-0.026487724855542183,
0.007206358015537262,
0.006636070553213358,
-0.030258219689130783,
-0.029296744614839554,
-0.034122977405786514,
-0.06998038291931152,
0.025073789060115814,
-0.024904116988182068,
-0.009063326753675938,
-0.00865328498184681,
0.009068040177226067,
-0.021812312304973602,
0.03257707506418228,
-0.019851654767990112,
0.012075008824467659,
-0.01910698227584362,
0.02062460593879223,
-0.026921331882476807,
0.0018805342260748148,
-0.017570504918694496,
-0.009925827383995056,
-0.007644678000360727,
0.0204172283411026,
0.006998980883508921,
0.007564554922282696,
0.0025615799240767956,
-0.03061641752719879,
0.03238854929804802,
-0.04622626677155495,
0.02152952551841736,
0.0058961110189557076,
0.012084435671567917,
0.023018870502710342,
0.021642640233039856,
0.005759430583566427,
-0.018871325999498367,
0.03962789848446846,
0.01821148954331875,
-0.012527468614280224,
0.0048827906139194965,
-0.07872793078422546,
-0.004404409322887659,
0.004140474367886782,
-0.036385275423526764,
0.08415744453668594,
0.029579531401395798,
-0.00457643810659647,
0.055539388209581375,
0.037497568875551224,
0.05486069619655609,
0.017579931765794754,
0.025790182873606682,
-0.013969683088362217,
0.016175422817468643,
0.017523374408483505,
-0.042116425931453705,
0.01669386588037014,
-0.03174756467342377,
0.009661892428994179,
0.041965607553720474,
0.0453590527176857,
-0.05470987781882286,
0.00008513069769833237,
-0.039703309535980225,
-0.017617637291550636,
-0.01380001101642847,
0.013036485761404037,
0.0015188023680821061,
-0.04747052863240242,
-0.06436234712600708,
0.01760821044445038,
0.03206805884838104,
0.04411478713154793,
0.024828707799315453,
0.020040178671479225,
-0.004220597445964813
]
|
36,403 | torch_pso.optim.AcceleratedPSO | __init__ | null | def __init__(self,
params: Iterable[torch.nn.Parameter],
num_particles: int = 100,
alpha: float = 0.3,
beta: float = 0.45,
decay_parameter: float = 0.7,
max_param_value: float = -10,
min_param_value: float = 10):
particle_kwargs = {'alpha': alpha,
'beta': beta,
'decay_parameter': decay_parameter,
'max_param_value': max_param_value,
'min_param_value': min_param_value,
}
super().__init__(params, num_particles, particle_class=AcceleratedParticle, particle_kwargs=particle_kwargs)
| (self, params: Iterable[torch.nn.parameter.Parameter], num_particles: int = 100, alpha: float = 0.3, beta: float = 0.45, decay_parameter: float = 0.7, max_param_value: float = -10, min_param_value: float = 10) | [
0.011361190117895603,
-0.026713646948337555,
-0.04362548515200615,
-0.009017480537295341,
-0.01590009592473507,
0.05416985601186752,
-0.06386028230190277,
-0.020309055224061012,
-0.06631073355674744,
0.04421953111886978,
0.010330885648727417,
0.053761448711156845,
-0.022443918511271477,
0.03872457891702652,
-0.02314935252070427,
-0.028235897421836853,
0.04214036092162132,
0.042177487164735794,
-0.019139520823955536,
-0.04013544321060181,
-0.0036965636536478996,
0.03972703590989113,
-0.03965277969837189,
0.030612094327807426,
-0.008674046024680138,
0.018629008904099464,
-0.010126681067049503,
0.009987451136112213,
-0.05572923645377159,
0.007035769522190094,
-0.017023220658302307,
0.024708731099963188,
0.017914295196533203,
0.06968939304351807,
0.031057631596922874,
-0.0076994337141513824,
0.0013748988276347518,
0.032097216695547104,
-0.08539456129074097,
0.06560530513525009,
0.06538253277540207,
-0.04744967445731163,
0.045556142926216125,
-0.025228524580597878,
0.011435446329414845,
0.00822850875556469,
0.03343382850289345,
0.04782095551490784,
-0.022443918511271477,
-0.009755400940775871,
0.00890609622001648,
-0.04247451201081276,
0.07388485968112946,
-0.0511624813079834,
-0.04908331111073494,
0.09920620918273926,
0.07113738358020782,
0.03562438488006592,
-0.004808085039258003,
0.0023228249046951532,
0.007564844563603401,
-0.015148253180086613,
0.02936830371618271,
-0.053167399019002914,
-0.008038227446377277,
-0.04915756732225418,
-0.048266492784023285,
-0.04154631122946739,
-0.019417980685830116,
0.07618679851293564,
0.10804268717765808,
-0.014869792386889458,
-0.009671862237155437,
0.007625177502632141,
0.01569589227437973,
0.019232340157032013,
-0.029349740594625473,
0.01880536787211895,
-0.012382212094962597,
0.01284631248563528,
0.026843596249818802,
-0.010303040035068989,
-0.023409249261021614,
-0.003594461362808943,
0.012038776651024818,
-0.041137903928756714,
-0.04704126715660095,
-0.056508924812078476,
0.030259378254413605,
0.031688809394836426,
-0.035475872457027435,
0.031057631596922874,
0.022518174722790718,
-0.040024060755968094,
0.0459645539522171,
0.01896316185593605,
0.042177487164735794,
-0.01432215329259634,
0.012020212598145008,
-0.013412515632808208,
-0.0005853472393937409,
0.00966258067637682,
-0.005119032692164183,
-0.007012564223259687,
0.009579041972756386,
-0.03291403502225876,
-0.053835704922676086,
-0.028068821877241135,
0.021014487370848656,
0.0025223882403224707,
-0.027660412713885307,
0.0730680450797081,
-0.04377399757504463,
0.022054074332118034,
-0.0715457946062088,
0.0033809749875217676,
-0.010405141860246658,
-0.004012152086943388,
-0.0061354138888418674,
-0.00830740574747324,
0.032097216695547104,
0.053167399019002914,
-0.015584507957100868,
0.030407890677452087,
-0.018341267481446266,
0.031020503491163254,
0.008177457377314568,
0.001825076760724187,
-0.02287089265882969,
-0.05636041238903999,
0.016986092552542686,
-0.006288567092269659,
-0.023557761684060097,
-0.020568951964378357,
0.025228524580597878,
-0.09980025887489319,
0.020606080070137978,
-0.002194036962464452,
-0.06226377561688423,
-0.009922477416694164,
0.04904618114233017,
0.04522199183702469,
0.04511060565710068,
0.009727554395794868,
-0.051051098853349686,
0.015844404697418213,
0.04529624804854393,
-0.03350808471441269,
-0.03705381602048874,
-0.02485724352300167,
-0.0063628233037889,
0.009616170078516006,
-0.009323786944150925,
-0.00741169136017561,
-0.007323511876165867,
-0.023130787536501884,
0.018062805756926537,
-0.07451603561639786,
0.004088728688657284,
-0.0068362061865627766,
-0.03174450248479843,
0.025080012157559395,
-0.022239714860916138,
-0.0014630780788138509,
-0.051459506154060364,
0.009866785258054733,
-0.023594889789819717,
-0.041694823652505875,
0.010544371791183949,
-0.0030723479576408863,
0.03857606649398804,
-0.029813840985298157,
0.058588095009326935,
0.01265139039605856,
-0.0014967253664508462,
0.03709094226360321,
0.004719906020909548,
-0.02290802076458931,
0.0016626414144411683,
0.020216234028339386,
0.01752444915473461,
-0.023539196699857712,
0.04258589819073677,
-0.0709146186709404,
0.033842235803604126,
0.009829657152295113,
0.014953331090509892,
0.07176855951547623,
-0.01964074932038784,
-0.0004078286583535373,
0.03813052922487259,
0.0034018594305962324,
-0.016224967315793037,
0.009588324464857578,
-0.04269728064537048,
0.028588615357875824,
0.03785206750035286,
-0.013189746998250484,
-0.023724837228655815,
0.06163259968161583,
0.010609346441924572,
0.02760472148656845,
-0.026305237784981728,
-0.046113062649965286,
0.005662031006067991,
0.005309314001351595,
0.006256079766899347,
0.017431629821658134,
-0.0037568965926766396,
-0.042214617133140564,
-0.012883440591394901,
-0.025117140263319016,
0.06204100698232651,
0.004661893472075462,
-0.008353816345334053,
-0.05108822509646416,
0.003947177901864052,
-0.02190556190907955,
0.026509443297982216,
-0.008242432028055191,
0.09541914612054825,
-0.002321664709597826,
0.02753046527504921,
0.01666122116148472,
0.0360884852707386,
0.042288873344659805,
0.05287037417292595,
-0.05435549467802048,
-0.05249909311532974,
0.03254275396466255,
0.003594461362808943,
-0.0084048667922616,
-0.03493751585483551,
0.027827490121126175,
0.017598705366253853,
0.053724318742752075,
0.010089552961289883,
-0.013978718779981136,
-0.11880982667207718,
-0.02461591176688671,
0.014368563890457153,
0.03031506948173046,
0.020736027508974075,
-0.005522800609469414,
-0.015203945338726044,
0.00449017621576786,
0.031057631596922874,
0.06449145823717117,
-0.03618130460381508,
0.023557761684060097,
-0.0030746683478355408,
-0.03469618409872055,
-0.02318648062646389,
0.03270982950925827,
-0.026954980567097664,
-0.015055432915687561,
0.000688609667122364,
0.0033508085180073977,
-0.007439537439495325,
0.0035364488139748573,
-0.06768447160720825,
-0.04641008749604225,
-0.023316428065299988,
0.0838351845741272,
0.06794437021017075,
-0.012085187248885632,
-0.026509443297982216,
0.010720730759203434,
-0.026750775054097176,
0.023093659430742264,
0.1263839602470398,
-0.014749126508831978,
0.029980918392539024,
-0.016039326786994934,
0.02394760586321354,
-0.04292004927992821,
0.007485947571694851,
-0.03174450248479843,
-0.009017480537295341,
0.05030853673815727,
0.028105949983000755,
-0.04358835518360138,
-0.029145535081624985,
-0.022443918511271477,
0.04889766871929169,
-0.011556112207472324,
0.009523349814116955,
0.03402787819504738,
-0.0030004121363162994,
0.004285971634089947,
-0.029553944244980812,
0.01724598929286003,
0.023650581017136574,
0.01034016814082861,
0.0462244488298893,
-0.027456209063529968,
0.029034150764346123,
0.03943001106381416,
0.0067805140279233456,
-0.01736665517091751,
0.09972599893808365,
-0.05290750041604042,
0.007323511876165867,
-0.010711448267102242,
-0.030853427946567535,
-0.0181741900742054,
0.016605529934167862,
0.03785206750035286,
0.03148460388183594,
0.017023220658302307,
0.07834023237228394,
0.021218692883849144,
-0.007922202348709106,
0.029850969091057777,
0.024207502603530884,
-0.04162056744098663,
0.04310569167137146,
-0.04425666108727455,
0.03265414014458656,
0.040098316967487335,
0.013728104531764984,
0.015380303375422955,
-0.02474585920572281,
-0.0028983100783079863,
-0.049306079745292664,
-0.02597108669579029,
0.02394760586321354,
0.030704915523529053,
-0.03219003602862358,
-0.015306047163903713,
-0.05301888659596443,
0.03397218510508537,
-0.012307955883443356,
-0.0241889376193285,
-0.06100142002105713,
-0.01939941756427288,
-0.011899546720087528,
0.045556142926216125,
0.021422896534204483,
-0.019510801881551743,
0.047672443091869354,
0.008622994646430016,
-0.036478329449892044,
0.0526847317814827,
-0.02895989641547203,
-0.04759818688035011,
0.025525549426674843,
-0.01848049834370613,
0.0028310155030339956,
-0.037350840866565704,
0.0036246280651539564,
0.023873349651694298,
-0.002728913212195039,
0.05777128040790558,
0.059701938182115555,
-0.025878265500068665,
-0.004566752817481756,
-0.030463581904768944,
-0.03282121568918228,
-0.019900646060705185,
0.0120294950902462,
-0.03031506948173046,
-0.011491138488054276,
0.04076662287116051,
-0.0029006304685026407,
-0.004019113723188639,
0.013867334462702274,
-0.06215238943696022,
0.04462794214487076,
0.0113333435729146,
0.015788711607456207,
-0.029423996806144714,
-0.05439262464642525,
0.006803718861192465,
0.019585058093070984,
-0.0474868044257164,
-0.06824139505624771,
0.029108406975865364,
0.041806209832429886,
-0.015435995534062386,
-0.0023808374535292387,
-0.05996183678507805,
0.06415730714797974,
-0.004281330853700638,
-0.010572218336164951,
-0.004255805164575577,
0.030649222433567047,
-0.03991267830133438,
0.0829441100358963,
0.008734378963708878,
0.015073996968567371,
0.005699159111827612,
-0.0030677069444209337,
-0.05075407400727272,
-0.05617476999759674,
0.0178864486515522,
0.059107888489961624,
-0.009156710468232632,
-0.047709573060274124,
-0.02844010293483734,
0.002108178334310651,
-0.04076662287116051,
0.03943001106381416,
0.03055640310049057,
0.016354914754629135,
-0.06438007205724716,
0.06961513310670853,
0.010368013754487038,
0.020030593499541283,
0.09683001041412354,
-0.041769079864025116,
-0.007123948540538549,
-0.04321707412600517,
0.000822038680780679,
0.023594889789819717,
-0.07377348095178604,
0.007453460246324539,
-0.07893428206443787,
0.007318871095776558,
-0.02708492800593376,
-0.0018784482963383198,
-0.00525826308876276,
0.02610103413462639,
0.016308505088090897,
0.041694823652505875,
0.02760472148656845,
-0.01816490851342678,
0.021645665168762207,
0.013932309113442898,
-0.043365586549043655,
-0.05873660743236542,
-0.021125871688127518,
-0.03285834193229675,
-0.040098316967487335,
0.02422606572508812,
0.007003282196819782,
0.004854495171457529,
0.006279285065829754,
-0.009490863420069218,
0.0004240721755195409,
0.022016946226358414,
-0.010256629437208176,
0.07381060719490051,
0.011760316789150238,
0.002824053866788745,
0.019510801881551743,
-0.016503427177667618,
0.009811093099415302,
-0.019306596368551254,
-0.018935317173600197,
0.02999948151409626,
0.012642107903957367,
0.07013492286205292,
-0.050419919192790985,
0.036478329449892044,
-0.03454767167568207,
-0.03684961050748825,
-0.009551196359097958,
0.04024682939052582,
-0.02478298731148243,
0.03473331034183502,
0.023594889789819717,
-0.028477231040596962,
-0.05684307590126991,
-0.035828590393066406,
0.004965879488736391,
0.03725801780819893,
-0.015528815798461437,
0.006817642133682966,
-0.007323511876165867,
0.06768447160720825,
0.04321707412600517,
0.022351099178195,
-0.07481306046247482,
-0.04678136855363846,
0.004285971634089947,
0.0104793980717659,
-0.012586415745317936,
0.021497152745723724,
-0.004900905303657055,
0.02190556190907955,
-0.060815781354904175,
0.0509025864303112,
0.03542017936706543,
-0.010080271400511265,
-0.025432728230953217,
-0.030500710010528564,
0.010627910494804382,
-0.020884539932012558,
0.04132354259490967,
-0.05339016765356064,
-0.02186843380331993,
0.03219003602862358,
0.048303619027137756,
-0.019380852580070496,
-0.031261835247278214,
0.04700413718819618,
0.025321343913674355,
0.047189779579639435,
0.02155284583568573,
-0.01729239895939827,
0.0017183335730805993,
-0.0048127262853085995,
-0.0061354138888418674,
-0.0012681556399911642,
-0.024597346782684326,
-0.025562677532434464,
0.030927684158086777,
-0.031169015914201736,
0.04358835518360138,
0.019250905141234398,
-0.050939712673425674,
-0.01645701751112938,
-0.014563485980033875,
-0.028978459537029266,
-0.015965070575475693,
-0.041100773960351944,
0.04299430549144745,
0.0026314519345760345,
-0.04704126715660095,
0.05602625757455826,
0.07908279448747635,
0.012159443460404873,
-0.05402134358882904,
0.01183457300066948,
-0.0038125887513160706,
-0.010043143294751644,
-0.07340219616889954,
0.012623543851077557,
0.04867490008473396,
-0.015965070575475693,
-0.04908331111073494,
-0.02043900266289711,
0.017505886033177376,
-0.01366312988102436,
0.020494695752859116,
0.0016266736201941967,
-0.008683327585458755,
0.013561028055846691,
0.007792253978550434,
0.006042593624442816,
0.022852327674627304,
0.07277102023363113,
-0.05119961127638817,
-0.004886982496827841,
-0.030296506360173225,
-0.03980129212141037,
0.05450400710105896,
0.005708441138267517,
0.02533990889787674,
0.022295406088232994,
-0.01888890564441681,
-0.08739948272705078,
-0.021682793274521828,
0.024244630709290504,
-0.00007440117042278871,
-0.003594461362808943,
-0.08569158613681793,
-0.008339893072843552,
0.07782043516635895,
0.016512708738446236,
0.008799352683126926,
0.027716105803847313,
0.014739844016730785,
-0.06007321923971176,
-0.002779964357614517,
0.000676427036523819,
-0.025841137394309044,
-0.03445484861731529,
0.00882719922810793,
0.04087800532579422,
-0.011806726455688477,
-0.0726967602968216,
0.013709540478885174,
-0.01593722403049469,
-0.0031906936783343554,
0.005202570930123329,
-0.01736665517091751,
-0.0283658467233181,
-0.024244630709290504,
0.002069890033453703,
-0.00300737377256155,
-0.05127386748790741,
-0.05513518676161766,
0.03632981702685356,
0.0924488976597786,
-0.07080323249101639,
0.0241889376193285,
0.06118706241250038,
-0.009059249423444271,
0.0005931789637543261,
-0.002777643734589219,
-0.035828590393066406,
-0.03865032270550728,
-0.03723945468664169,
0.04540763050317764,
-0.03876170516014099,
-0.0008829519501887262,
0.007731921039521694,
-0.031169015914201736,
-0.053167399019002914,
0.03285834193229675,
0.0017194937681779265,
0.006297849118709564,
0.013885898515582085,
-0.0726967602968216,
0.019306596368551254,
0.04848926141858101,
0.002139504998922348,
0.010720730759203434,
0.028068821877241135,
-0.020810283720493317,
-0.04537050426006317,
-0.05654605105519295,
-0.008817916736006737,
-0.027029234915971756,
-0.03720232844352722,
0.025284215807914734,
0.09534488618373871,
0.011398318223655224,
-0.0496402308344841,
0.015361739322543144,
-0.015760866925120354,
0.027196312323212624,
-0.04522199183702469,
-0.058031175285577774,
0.006641283631324768,
-0.12593841552734375,
0.0023877990897744894,
0.013700257986783981,
0.04188046604394913,
0.005063340533524752,
-0.0391329862177372,
-0.025358472019433975,
-0.03128039836883545,
-0.01875895820558071,
0.0030677069444209337,
-0.01213159691542387,
0.032338548451662064,
0.005782696884125471,
0.018935317173600197,
0.03465905413031578,
-0.03322962298989296,
-0.03555012866854668,
-0.024485962465405464,
-0.028755690902471542,
-0.023093659430742264,
0.012317237444221973,
0.0511624813079834,
0.008725096471607685,
0.03980129212141037,
-0.016429170966148376,
-0.020587515085935593,
0.03059353120625019,
-0.028829947113990784,
0.008920019492506981,
0.017496604472398758,
0.03449197858572006,
0.07202845811843872,
-0.008237791247665882,
-0.015380303375422955,
-0.024950064718723297,
-0.01574230194091797,
0.04692988097667694,
0.030612094327807426,
-0.0629320815205574,
-0.041212160140275955,
-0.04162056744098663,
-0.021645665168762207,
0.04893479868769646,
-0.031336091458797455,
-0.03261701017618179,
-0.03772212192416191,
-0.02027192711830139,
0.04154631122946739,
-0.0039239730685949326,
-0.04188046604394913,
0.0052211349830031395,
-0.006441720295697451,
0.034046441316604614,
0.05747425556182861,
-0.029015587642788887,
0.0209587961435318,
0.03490038588643074,
-0.007407050114125013,
0.007495229598134756,
-0.046632856130599976,
0.015296765603125095,
-0.012595698237419128,
0.0038381144404411316,
-0.0059636966325342655,
-0.0015396546805277467,
0.0009345831931568682,
-0.01586296781897545,
0.01781219244003296,
-0.02732625976204872,
-0.07173143327236176,
-0.04321707412600517,
0.0012333481572568417,
-0.015593789517879486,
-0.02207263745367527,
0.009388760663568974,
-0.08212729543447495,
0.06991215795278549,
-0.03530879691243172,
0.026193853467702866,
0.010238065384328365,
-0.016958246007561684,
0.004450727719813585,
-0.012920568697154522,
0.02040187455713749,
0.04540763050317764,
0.02972102165222168,
-0.043885380029678345,
-0.03827904164791107,
0.07329080998897552,
0.0825728327035904,
0.012178007513284683,
-0.02207263745367527,
0.029498253017663956,
0.013171182945370674,
-0.03998693451285362,
0.028755690902471542,
0.02923835627734661,
-0.023557761684060097,
-0.03991267830133438,
0.007680869661271572,
0.021385768428444862,
0.042845793068408966,
-0.02673221193253994,
0.0496402308344841,
0.03183732181787491,
-0.038873091340065,
-0.03475187346339226,
0.019232340157032013,
-0.03194870427250862,
0.03684961050748825,
-0.0036872816272079945,
-0.03315536677837372,
-0.004086408298462629,
-0.008632276207208633,
0.013496054336428642,
-0.0403953418135643,
-0.0006630841526202857,
0.057585638016462326,
0.0517936609685421,
-0.00904532615095377,
-0.021107308566570282,
0.060221731662750244,
-0.009416607208549976,
-0.012233699671924114,
0.05714010074734688,
-0.007485947571694851,
0.028068821877241135,
0.04150918498635292,
-0.042882923036813736,
0.041212160140275955,
-0.02134864032268524,
-0.08999844640493393,
-0.11205251514911652,
-0.0462244488298893,
-0.012902004644274712,
0.05008576810359955,
-0.010284475982189178,
-0.004606201313436031,
0.04975161701440811,
0.061298444867134094,
0.004304535686969757
]
|
36,404 | torch.optim.optimizer | __repr__ | null | def __repr__(self) -> str:
format_string = self.__class__.__name__ + ' ('
for i, group in enumerate(self.param_groups):
format_string += '\n'
format_string += f'Parameter Group {i}\n'
for key in sorted(group.keys()):
if key != 'params':
format_string += f' {key}: {group[key]}\n'
format_string += ')'
return format_string
| (self) -> str | [
0.042550764977931976,
-0.03421037271618843,
0.03216217830777168,
0.002384946448728442,
0.020242059603333473,
-0.04867689311504364,
0.003600484924390912,
-0.07366117089986801,
0.007057965267449617,
0.010969830676913261,
-0.013829921372234821,
-0.006209163926541805,
-0.036092497408390045,
0.036332376301288605,
-0.0043570250272750854,
0.015130801126360893,
0.008612562902271748,
-0.08576580882072449,
0.0018060087459161878,
-0.028139600530266762,
0.020352773368358612,
0.061261292546987534,
0.004737601615488529,
-0.03160861134529114,
0.029025305062532425,
0.005701728630810976,
-0.0024887400213629007,
-0.023950951173901558,
-0.024006307125091553,
0.0032821844797581434,
-0.05524587631225586,
-0.06705528497695923,
-0.019153380766510963,
0.0010938693303614855,
-0.0294497050344944,
0.025168797001242638,
-0.04745905101299286,
0.03481929376721382,
-0.07281237095594406,
-0.02336048148572445,
0.042550764977931976,
-0.0070210606791079044,
-0.03271574527025223,
-0.05269947275519371,
-0.014448069967329502,
0.013719208538532257,
0.058124419301748276,
0.04709000512957573,
-0.045798350125551224,
-0.026109857484698296,
0.041923388838768005,
0.014484974555671215,
-0.04956259950995445,
-0.007828344590961933,
-0.08451106399297714,
-0.014798661693930626,
0.04284600168466568,
-0.017704881727695465,
0.07572781294584274,
0.0118555361405015,
-0.019743850454688072,
0.030501481145620346,
0.031202664598822594,
-0.0014035202329978347,
-0.03186694532632828,
-0.051186393946409225,
-0.06509935110807419,
0.00042122905142605305,
-0.006015416234731674,
0.01825844869017601,
0.034763939678668976,
-0.022714653983712196,
-0.028194956481456757,
0.01035168208181858,
-0.04077935591340065,
0.003351380117237568,
-0.019300997257232666,
-0.01571204513311386,
0.016127219423651695,
-0.04384241998195648,
-0.0014761757338419557,
-0.00016491650603711605,
-0.01593347266316414,
-0.03819604590535164,
0.04118530452251434,
-0.07993491739034653,
-0.04114839807152748,
-0.05635301023721695,
-0.005586402490735054,
-0.03518833965063095,
-0.00038144149584695697,
-0.007468526717275381,
0.0024610618129372597,
0.03042767196893692,
-0.022105731070041656,
-0.005600241478532553,
-0.024670585989952087,
-0.02372952550649643,
0.0012789678294211626,
-0.0433257557451725,
0.005125097464770079,
-0.06794098764657974,
-0.03812223672866821,
-0.019817659631371498,
-0.0072286478243768215,
-0.05432326719164848,
-0.017575716599822044,
0.017501909285783768,
-0.028766974806785583,
0.04118530452251434,
-0.002647890243679285,
0.03516988828778267,
-0.021256931126117706,
-0.024412255734205246,
0.07181595265865326,
0.005457237362861633,
-0.014927826821804047,
0.011228161863982677,
0.0331401452422142,
-0.019319450482726097,
0.014577235095202923,
0.034487154334783554,
-0.010988282971084118,
0.0022569342982023954,
-0.0588994100689888,
0.0247074905782938,
-0.04343647137284279,
0.00010415400174679235,
0.01754803955554962,
-0.10244659334421158,
0.026017596945166588,
-0.0194670669734478,
-0.08118966221809387,
-0.012695111334323883,
0.06591124832630157,
-0.02468903921544552,
0.03125802055001259,
0.02142300084233284,
0.009143063798546791,
0.13551293313503265,
0.03197765722870827,
0.002527951030060649,
-0.000516373198479414,
0.03160861134529114,
0.001337784226052463,
-0.042772192507982254,
0.05535658821463585,
0.05864107981324196,
0.026312831789255142,
-0.030575290322303772,
0.03238360583782196,
0.003266038838773966,
0.048972129821777344,
-0.03518833965063095,
0.034874651581048965,
0.008603336289525032,
0.026460450142621994,
-0.022308705374598503,
0.006896508391946554,
-0.055430397391319275,
-0.012805824168026447,
0.00031772375223226845,
-0.011680240742862225,
-0.004292442463338375,
0.03166396915912628,
0.031128855422139168,
0.018682848662137985,
-0.014826339669525623,
0.005586402490735054,
-0.02103550359606743,
-0.0023872528690844774,
-0.08082062005996704,
-0.0416281558573246,
0.05085425451397896,
0.005932381376624107,
0.07949206233024597,
-0.03081516921520233,
0.07949206233024597,
-0.020149799063801765,
-0.032199084758758545,
0.03716272488236427,
-0.03020624630153179,
-0.014392713084816933,
-0.029006853699684143,
0.019024213775992393,
-0.08369916677474976,
0.035502027720212936,
0.010324004106223583,
-0.01957778073847294,
-0.0406317375600338,
0.013645399361848831,
0.025150343775749207,
-0.005900089628994465,
0.057386331260204315,
-0.037771645933389664,
-0.039376989006996155,
0.00068503781221807,
-0.03223598748445511,
0.055061355233192444,
0.03031695820391178,
-0.00493134930729866,
0.029541967436671257,
-0.02629438042640686,
-0.009991864673793316,
0.025519387796521187,
-0.024799752980470657,
0.023175958544015884,
-0.031682420521974564,
-0.015610557980835438,
-0.007874474860727787,
0.023305123671889305,
-0.00429474888369441,
0.02066645957529545,
-0.008861667476594448,
0.009318359196186066,
0.01705905608832836,
0.0033790585584938526,
0.012086188420653343,
-0.040594831109046936,
0.004792958032339811,
0.031645517796278,
-0.03716272488236427,
0.0615934319794178,
-0.044838838279247284,
-0.043510280549526215,
-0.015536749735474586,
0.07558019459247589,
-0.023397386074066162,
-0.05967440456151962,
-0.009705855511128902,
0.04118530452251434,
-0.06421364098787308,
-0.019688494503498077,
0.04535549879074097,
-0.05805061012506485,
0.026681875810027122,
-0.062257710844278336,
-0.03149789944291115,
-0.02044503390789032,
0.016828402876853943,
-0.009110772050917149,
0.032328248023986816,
0.023046793416142464,
0.00024059934366960078,
0.01533377543091774,
-0.08237060904502869,
-0.004308587871491909,
0.02277000993490219,
0.031331829726696014,
-0.0023918659426271915,
0.022917628288269043,
0.03505917266011238,
-0.051776863634586334,
-0.015748949721455574,
-0.02385869063436985,
-0.028896139934659004,
-0.03422882407903671,
0.018092378973960876,
0.0443221777677536,
0.03127647191286087,
-0.0038518961519002914,
-0.013756112195551395,
-0.0581982284784317,
0.03697820380330086,
0.05967440456151962,
0.01705905608832836,
-0.03227289021015167,
-0.008543366566300392,
0.013045703060925007,
0.0017494988860562444,
0.1435580849647522,
0.02337893284857273,
-0.03786390647292137,
0.015730498358607292,
-0.013977538794279099,
-0.040336500853300095,
0.013220998458564281,
-0.011680240742862225,
-0.034505609422922134,
-0.04963640868663788,
0.06853146106004715,
-0.05004235729575157,
-0.018655171617865562,
0.0028670099563896656,
0.06646481156349182,
0.03330621495842934,
0.028434835374355316,
0.02288072369992733,
-0.006282973103225231,
0.0494149811565876,
0.02205037511885166,
0.0023618810810148716,
-0.025648552924394608,
-0.00772685743868351,
0.015056992881000042,
-0.032808005809783936,
0.0572018101811409,
-0.007062578108161688,
0.012815050780773163,
0.012215354479849339,
-0.003688132856041193,
-0.009281454607844353,
0.11211554706096649,
0.02264084480702877,
-0.059342265129089355,
0.0011140513233840466,
-0.02225334942340851,
-0.006029255222529173,
0.019503971561789513,
-0.0037965395022183657,
-0.011458814144134521,
0.05782918259501457,
0.04926736652851105,
-0.007145612966269255,
0.023932499811053276,
0.03380442410707474,
-0.013442425057291985,
-0.0069979955442249775,
0.05284709110856056,
0.05436016991734505,
0.03708891570568085,
0.01527841854840517,
-0.017465004697442055,
0.01096060499548912,
0.051186393946409225,
-0.015306097455322742,
-0.047754283994436264,
0.01580430567264557,
0.009493655525147915,
0.029006853699684143,
-0.03260502964258194,
-0.054729215800762177,
-0.0033652193378657103,
0.03830676153302193,
0.02666342444717884,
0.03166396915912628,
0.006158420816063881,
-0.018055474385619164,
-0.04808642342686653,
-0.03101814165711403,
0.06266365945339203,
-0.02337893284857273,
-0.028914591297507286,
-0.020998599007725716,
-0.0615934319794178,
0.031202664598822594,
-0.014881696552038193,
0.03282645717263222,
0.01692989096045494,
-0.02777055650949478,
-0.018055474385619164,
-0.010812987573444843,
0.04325195029377937,
0.026072952896356583,
-0.0006763883284293115,
0.03415501490235329,
-0.004617662169039249,
0.025371769443154335,
-0.0194670669734478,
0.05015306919813156,
0.08310869336128235,
-0.009512106887996197,
0.04354718327522278,
0.017594169825315475,
0.01240910217165947,
0.005078967195004225,
0.011412683874368668,
-0.02190275676548481,
0.08214917778968811,
0.0017391195287927985,
-0.04908284172415733,
-0.0008234292617999017,
0.00803131889551878,
-0.06912192702293396,
-0.052145905792713165,
0.06037558615207672,
0.007288617547601461,
-0.005000545177608728,
-0.02666342444717884,
-0.11514170467853546,
0.014245095662772655,
-0.018812013790011406,
0.060043446719646454,
0.013857599347829819,
-0.030243150889873505,
0.010259421542286873,
0.02372952550649643,
0.01678227260708809,
0.0013516234466806054,
0.00043016683775931597,
-0.027844363823533058,
-0.02727234736084938,
0.022345609962940216,
0.009060028940439224,
-0.03677522763609886,
-0.04041031002998352,
0.012455232441425323,
-0.0008793625165708363,
-0.076465904712677,
-0.02481820434331894,
0.009332198649644852,
-0.06277437508106232,
-0.04159124940633774,
-0.030003271996974945,
0.023526551201939583,
-0.04731143265962601,
0.03856509178876877,
0.04343647137284279,
-0.0020135960076004267,
-0.02347119338810444,
-0.017335839569568634,
-0.03834366425871849,
-0.06406603008508682,
-0.01617334969341755,
0.08030395954847336,
-0.018553683534264565,
-0.06192557141184807,
0.058604177087545395,
0.013423972763121128,
-0.008921637199819088,
0.016819177195429802,
-0.004963641054928303,
0.024061664938926697,
0.044838838279247284,
0.008750954642891884,
0.036812130361795425,
-0.04919355735182762,
0.014235869981348515,
0.04015197977423668,
0.03290026634931564,
-0.05173996090888977,
0.03136873245239258,
0.01604418456554413,
0.014060573652386665,
0.02727234736084938,
-0.04793880507349968,
0.034007396548986435,
0.01222458016127348,
0.007934444583952427,
0.037790097296237946,
0.045798350125551224,
-0.043141234666109085,
-0.0018948098877444863,
0.018535232171416283,
-0.022603940218687057,
0.04354718327522278,
-0.03092588111758232,
-0.00954901147633791,
0.004670712165534496,
0.015721270814538002,
0.05952678620815277,
0.030483027920126915,
-0.00004530158548732288,
-0.043510280549526215,
0.020371224731206894,
-0.06037558615207672,
0.012335292994976044,
-0.0355389304459095,
-0.013590042479336262,
0.0014761757338419557,
0.016237933188676834,
0.01606263779103756,
0.0005385734839364886,
0.07244332134723663,
-0.04100077971816063,
-0.05661134049296379,
0.07727780193090439,
0.006107677239924669,
-0.04284600168466568,
-0.03208836913108826,
0.033398475497961044,
0.015610557980835438,
-0.047754283994436264,
0.020297415554523468,
-0.027364607900381088,
0.09838711470365524,
0.03361990302801132,
0.037790097296237946,
-0.05668514966964722,
0.0026847945991903543,
-0.04926736652851105,
-0.07019215822219849,
-0.009359876625239849,
0.01466026995331049,
-0.021884305402636528,
0.007440848276019096,
0.0008366917609237134,
0.04325195029377937,
-0.05317923054099083,
-0.021146217361092567,
-0.006144581362605095,
0.029246730729937553,
-0.04103768616914749,
0.052625663578510284,
0.019928371533751488,
-0.004133292008191347,
0.006389073096215725,
-0.013571590185165405,
-0.048381660133600235,
0.020242059603333473,
0.015176931396126747,
-0.00017644913168624043,
0.04317814111709595,
-0.04125910997390747,
0.05454469472169876,
-0.03775319457054138,
0.058604177087545395,
0.029966367408633232,
0.007293230853974819,
0.009991864673793316,
0.019780755043029785,
-0.06325413286685944,
-0.002913140458986163,
0.015767401084303856,
-0.05244114249944687,
-0.039635319262742996,
0.017501909285783768,
0.01606263779103756,
0.007842183113098145,
0.029283635318279266,
0.04675786569714546,
0.011477266438305378,
-0.04136982560157776,
0.006919573526829481,
-0.025039630010724068,
0.037771645933389664,
-0.006149194668978453,
-0.014623365364968777,
-0.0548030249774456,
0.039376989006996155,
0.03140563890337944,
0.0015419116243720055,
0.011634109541773796,
0.01333171222358942,
-0.02481820434331894,
0.06779336929321289,
-0.055208973586559296,
0.04683167487382889,
-0.050116166472435,
0.011615658178925514,
0.015665914863348007,
0.0015742030227556825,
-0.0149739570915699,
-0.04797571152448654,
0.001205159118399024,
-0.002673262031748891,
0.07495282590389252,
0.019448615610599518,
0.050448305904865265,
-0.04358408972620964,
0.01957778073847294,
-0.004389316309243441,
-0.052514951676130295,
-0.019983729347586632,
-0.008049771189689636,
0.06535767763853073,
0.02225334942340851,
-0.00037999992491677403,
-0.011680240742862225,
0.026368189603090286,
-0.0001565553538966924,
0.032549675554037094,
0.06022797152400017,
-0.014097478240728378,
-0.0035774195566773415,
0.02153371274471283,
0.03563119098544121,
0.022179540246725082,
-0.06712909042835236,
0.008764793165028095,
-0.0032614257652312517,
-0.03275264799594879,
0.027955077588558197,
-0.020500389859080315,
-0.01247368473559618,
-0.006084611639380455,
0.024283090606331825,
0.0761706680059433,
0.008432653732597828,
0.025943787768483162,
-0.0121046407148242,
-0.01515847910195589,
0.006956478115171194,
-0.061150580644607544,
-0.026921754702925682,
0.06926954537630081,
-0.048750702291727066,
-0.018341483548283577,
0.011873988434672356,
0.011772501282393932,
-0.03397049382328987,
-0.016883760690689087,
0.02446761354804039,
0.006029255222529173,
0.028674714267253876,
0.020481938496232033,
-0.002074718941003084,
-0.011504944413900375,
-0.010785308666527271,
0.05502444878220558,
0.008058996871113777,
0.018885822966694832,
0.04413765296339989,
0.06443507224321365,
0.043141234666109085,
-0.006084611639380455,
0.013156415894627571,
0.027530677616596222,
-0.0588994100689888,
0.058973219245672226,
-0.0189688578248024,
0.03981984034180641,
-0.032678838819265366,
-0.05978511646389961,
-0.027715198695659637,
-0.02105395682156086,
-0.05782918259501457,
0.0189688578248024,
0.011458814144134521,
-0.03175622969865799,
-0.005789376795291901,
0.06284818053245544,
-0.0659850537776947,
0.027549128979444504,
-0.021718235686421394,
0.026589615270495415,
-0.029652679339051247,
-0.06842074543237686,
0.04354718327522278,
-0.050448305904865265,
0.015167705714702606,
0.019983729347586632,
-0.010932926088571548,
-0.06834693253040314,
-0.06524696946144104,
-0.03208836913108826,
0.01071150042116642,
0.0057570855133235455,
-0.06864216923713684,
0.010139482095837593,
0.010766856372356415,
-0.02553783915936947,
-0.06362317502498627,
-0.006402912084013224,
0.004721455741673708,
0.009936507791280746,
-0.023175958544015884,
-0.08333011716604233,
0.03970912843942642,
-0.04749595373868942,
-0.03321395441889763,
0.005424945615231991,
0.016284063458442688,
-0.03175622969865799,
0.011320422403514385,
0.004707616753876209,
-0.03926627337932587,
0.06063391640782356,
-0.0008603336755186319,
-0.03540976345539093,
-0.0331401452422142,
-0.05100187286734581,
0.003501304192468524,
-0.04513407126069069,
-0.003828830784186721,
0.011071317829191685,
-0.04609358683228493,
0.001982457935810089,
0.0147248525172472,
-0.012113867327570915,
-0.035114530473947525,
0.003148406045511365,
0.002161213429644704,
-0.015776628628373146,
-0.06890050321817398,
0.023877141997218132,
-0.02337893284857273,
0.00834500603377819,
0.006010802928358316,
-0.025353318080306053,
0.032199084758758545,
-0.02103550359606743,
-0.05716490373015404,
-0.004959027748554945,
0.034745484590530396,
0.0017333532450720668,
-0.02983720228075981,
-0.0058355070650577545,
0.0012939602602273226,
-0.008972380310297012,
-0.0453185960650444,
-0.04188648611307144,
0.012436780147254467,
-0.024301543831825256,
0.04675786569714546,
-0.006914960686117411,
0.06148272007703781,
-0.042772192507982254,
0.04808642342686653,
0.005996963940560818,
-0.019909920170903206,
-0.005761698354035616,
0.0019640056416392326,
0.01911647617816925,
0.0022223363630473614,
0.056537531316280365,
0.08967767655849457,
-0.006329103372991085,
0.018304578959941864,
-0.039967458695173264,
0.0017494988860562444,
0.08030395954847336,
0.02725389413535595,
-0.03422882407903671,
-0.021958114579319954,
0.025224152952432632,
0.019891468808054924,
0.026202119886875153,
-0.0036950523499399424,
-0.017492681741714478,
-0.006758117116987705,
0.0700814425945282,
0.02799198217689991,
-0.023766430094838142,
0.0269033033400774,
0.0869467481970787,
-0.019282545894384384,
0.0110805444419384,
-0.0009785430738702416,
-0.029523514211177826,
0.01490014884620905,
0.04937807843089104,
-0.06351245939731598,
-0.02190275676548481,
0.06343865394592285,
0.007399330846965313,
0.008875506930053234,
-0.006504399236291647,
-0.033435381948947906,
0.004606129601597786,
0.015748949721455574,
0.07495282590389252,
0.020149799063801765,
-0.014189738780260086,
0.008077449165284634,
0.03945079445838928,
0.025371769443154335,
0.013054928742349148,
0.009322972036898136,
-0.027899721637368202,
0.02812114730477333,
0.01089602243155241,
-0.024301543831825256,
-0.015001635998487473,
0.033398475497961044,
-0.06233152002096176,
0.03142409026622772,
0.0360371395945549,
0.0034597867634147406,
-0.0460197776556015,
-0.0409269705414772,
-0.03915556147694588,
0.07602304965257645,
0.01010257750749588,
-0.01754803955554962,
0.06096605584025383,
-0.013876051642000675,
-0.04576144739985466
]
|
36,405 | torch.optim.optimizer | __setstate__ | null | def __setstate__(self, state: Dict[str, Any]) -> None:
self.__dict__.update(state)
if '_optimizer_step_pre_hooks' not in self.__dict__:
self._optimizer_step_pre_hooks = OrderedDict()
if '_optimizer_step_post_hooks' not in self.__dict__:
self._optimizer_step_post_hooks = OrderedDict()
if '_optimizer_state_dict_pre_hooks' not in self.__dict__:
self._optimizer_state_dict_pre_hooks = OrderedDict()
if '_optimizer_state_dict_post_hooks' not in self.__dict__:
self._optimizer_state_dict_post_hooks = OrderedDict()
if '_optimizer_load_state_dict_pre_hooks' not in self.__dict__:
self._optimizer_load_state_dict_pre_hooks = OrderedDict()
if '_optimizer_load_state_dict_post_hooks' not in self.__dict__:
self._optimizer_load_state_dict_post_hooks = OrderedDict()
self._patch_step_function() # To support multiprocessing pickle/unpickle
self.defaults.setdefault('differentiable', False)
| (self, state: Dict[str, Any]) -> NoneType | [
-0.0140914311632514,
-0.010667429305613041,
0.010766284540295601,
0.04299324378371239,
-0.048349425196647644,
-0.010343900881707668,
-0.07167936861515045,
-0.0018097333377227187,
-0.030195923522114754,
-0.02909952402114868,
-0.032820094376802444,
0.07642444223165512,
-0.010990956798195839,
0.05449645221233368,
-0.06107484921813011,
-0.0009874337119981647,
-0.006731174886226654,
0.03418609872460365,
-0.06495718657970428,
-0.031130559742450714,
-0.010523638688027859,
-0.01836918666958809,
0.028146915137767792,
0.06103890389204025,
0.0038643593434244394,
-0.01540351565927267,
0.0007672550855204463,
-0.03443773090839386,
0.04033312574028969,
-0.0008880163077265024,
-0.002967917826026678,
-0.022772759199142456,
-0.0381762757897377,
0.02780541405081749,
0.06172190606594086,
-0.0612545870244503,
0.02214367687702179,
0.059133682399988174,
-0.060427796095609665,
-0.002565754810348153,
-0.018405133858323097,
-0.05622193589806557,
0.000048866171709960327,
0.012006474658846855,
0.01641903445124626,
0.010999944061040878,
-0.011017917655408382,
0.024462293833494186,
0.04730694741010666,
-0.07606496661901474,
0.01948356069624424,
-0.05877421051263809,
0.042058609426021576,
0.04159129038453102,
0.007229946553707123,
0.013246663846075535,
0.0685519352555275,
0.028829917311668396,
0.023383866995573044,
-0.016014624387025833,
-0.036001451313495636,
-0.030789058655500412,
-0.004461986944079399,
-0.05356181785464287,
-0.008294892497360706,
-0.053453974425792694,
-0.05410103127360344,
0.03975796699523926,
-0.005967289675027132,
0.021514596417546272,
-0.006888445001095533,
-0.017245827242732048,
0.026637118309736252,
-0.022628968581557274,
-0.04942785203456879,
0.02381523698568344,
-0.10863342881202698,
0.012294054962694645,
-0.014783420599997044,
-0.00984962284564972,
-0.02230544202029705,
0.008640887215733528,
-0.04313703253865242,
0.0011649245861917734,
-0.0616859570145607,
-0.04525793716311455,
0.008169075474143028,
-0.012392910197377205,
-0.01530466042459011,
-0.07128395140171051,
-0.01070337649434805,
0.04971543326973915,
-0.002707298146560788,
0.03803248330950737,
0.019016241654753685,
0.03650471568107605,
-0.013543231412768364,
-0.009355343878269196,
-0.0244083721190691,
-0.02647535502910614,
-0.03990175575017929,
-0.06988199800252914,
0.03292793780565262,
-0.01948356069624424,
0.008074713870882988,
-0.06463365256786346,
0.021712306886911392,
-0.05730035901069641,
0.0002314122102688998,
-0.05316639319062233,
0.0049158246256411076,
-0.008074713870882988,
-0.048493217676877975,
0.012680490501224995,
-0.001354772481136024,
0.014936198480427265,
-0.00812414102256298,
-0.07200290262699127,
0.0009245254914276302,
0.04087233915925026,
-0.03233480080962181,
0.04288540035486221,
-0.02025643177330494,
0.06053563952445984,
-0.01483734231442213,
0.003967708442360163,
0.02836260013282299,
0.060248058289289474,
0.02857828512787819,
-0.08577080070972443,
-0.008950934745371342,
-0.0076613170094788074,
-0.020579960197210312,
0.04806184396147728,
-0.017479484900832176,
0.015142896212637424,
-0.015439463779330254,
0.001892862026579678,
-0.004419299308210611,
-0.0040306164883077145,
0.020292378962039948,
0.009427239187061787,
0.001898478833027184,
-0.01495417207479477,
0.06934278458356857,
0.04101613163948059,
-0.00624588318169117,
0.02304236590862274,
-0.008843092247843742,
-0.00572464382275939,
0.023545630276203156,
-0.0026668573264032602,
0.0001756654673954472,
-0.00888353306800127,
-0.04878079518675804,
0.0016726834001019597,
-0.014621657319366932,
-0.02271883748471737,
-0.01230304129421711,
0.010343900881707668,
0.007202986162155867,
-0.03024984523653984,
-0.02138878032565117,
-0.05579056590795517,
-0.021532569080591202,
-0.002155728405341506,
-0.007719731889665127,
-0.04709126055240631,
-0.024642031639814377,
0.006385179702192545,
-0.046444207429885864,
-0.08045057207345963,
-0.0045496090315282345,
0.08411721885204315,
0.002314122160896659,
0.10899290442466736,
0.006753642112016678,
-0.013273624703288078,
-0.02307831309735775,
-0.007158051710575819,
0.028308678418397903,
0.011026903986930847,
-0.09001260995864868,
0.020472116768360138,
-0.015331621281802654,
-0.008640887215733528,
-0.027769464999437332,
-0.022646943107247353,
0.03265833109617233,
0.07160747796297073,
0.033934466540813446,
-0.018261345103383064,
0.009247501380741596,
-0.026619145646691322,
-0.010397822596132755,
0.036396872252225876,
-0.0022500907070934772,
-0.08720870316028595,
0.0825355276465416,
0.0714636892080307,
-0.019789114594459534,
-0.031867485493421555,
0.009472173638641834,
0.043244875967502594,
0.02002277411520481,
0.03255048766732216,
-0.012608595192432404,
0.011718894354999065,
0.020921461284160614,
0.03366485983133316,
0.007818587124347687,
-0.05442455783486366,
0.010101255029439926,
0.058738261461257935,
0.011880658566951752,
-0.0477023683488369,
0.06513692438602448,
0.06452581286430359,
0.028865864500403404,
0.012563660740852356,
0.09655506163835526,
0.023923080414533615,
0.013857772573828697,
-0.035659946501255035,
-0.0022500907070934772,
-0.020274406298995018,
-0.016221322119235992,
-0.04029718041419983,
-0.04558146744966507,
0.004221587907522917,
-0.020274406298995018,
-0.0204181969165802,
-0.002994878450408578,
-0.009130672551691532,
0.08325447887182236,
0.03104069083929062,
0.000053815976571058854,
-0.027913255617022514,
-0.020957408472895622,
0.012231146916747093,
-0.004212601110339165,
-0.007571448106318712,
0.006839017383754253,
-0.056257881224155426,
-0.06761730462312698,
-0.004996706265956163,
0.03587563335895538,
0.05582651123404503,
-0.039039015769958496,
0.031310297548770905,
0.015807924792170525,
-0.013093886896967888,
-0.04878079518675804,
0.017066089436411858,
-0.0037452830001711845,
0.025307059288024902,
0.08289500325918198,
0.042058609426021576,
0.004376611672341824,
0.0017097543459385633,
0.004488947801291943,
-0.07354864478111267,
-0.0488167442381382,
0.01202444825321436,
0.014639630913734436,
0.01267150416970253,
0.050038959830999374,
-0.022431258112192154,
-0.07128395140171051,
0.015807924792170525,
0.12538498640060425,
0.020705776289105415,
-0.034311916679143906,
0.05126117542386055,
0.0019422898767516017,
-0.017245827242732048,
0.016257269307971,
-0.025468824431300163,
-0.024444319307804108,
0.005652748979628086,
0.1096399649977684,
0.003666647942736745,
0.02909952402114868,
0.022287467494606972,
-0.04784616082906723,
-0.024857716634869576,
-0.03007010743021965,
0.04137560352683067,
0.03625308349728584,
-0.023689420893788338,
0.03914685919880867,
0.06276438385248184,
0.04468277841806412,
0.028128940612077713,
0.05201607197523117,
-0.029207367449998856,
-0.08289500325918198,
0.0510454885661602,
0.01623929664492607,
0.021532569080591202,
0.04371219500899315,
-0.048708900809288025,
-0.004291236400604248,
0.04486251622438431,
0.03193937987089157,
-0.0012458065757527947,
0.037529218941926956,
0.01682344265282154,
0.02990834414958954,
0.02002277411520481,
0.01738961599767208,
0.03947038576006889,
-0.0714636892080307,
0.028596259653568268,
0.03799653798341751,
-0.055718667805194855,
-0.01628423109650612,
-0.05255528539419174,
-0.02437242493033409,
0.05765983462333679,
-0.06351928412914276,
0.0001560066593810916,
-0.04288540035486221,
-0.022269492968916893,
-0.031130559742450714,
-0.030537424609065056,
0.05783957242965698,
-0.032622382044792175,
-0.00008326907845912501,
-0.031094612553715706,
-0.09612368792295456,
-0.040728550404310226,
0.0397220179438591,
0.05233960226178169,
-0.02872207574546337,
-0.016320178285241127,
0.021101199090480804,
-0.003259991528466344,
-0.00785004161298275,
-0.019717220216989517,
0.05090169981122017,
0.05906178802251816,
-0.059852633625268936,
0.013471336103975773,
0.02890181355178356,
-0.011260563507676125,
-0.004268769174814224,
-0.008658860810101032,
0.07175126671791077,
-0.019591402262449265,
-0.09597989916801453,
-0.017812000587582588,
-0.0009189086849801242,
0.053058553487062454,
0.054388608783483505,
-0.001773785799741745,
-0.011682947166264057,
-0.03670242801308632,
-0.014540775679051876,
-0.043568406254053116,
0.009310409426689148,
0.013408428058028221,
-0.05316639319062233,
0.032802119851112366,
0.08023488521575928,
0.0046327379532158375,
-0.02439039759337902,
-0.04364030063152313,
-0.0030869939364492893,
-0.052483391016721725,
0.023905105888843536,
-0.11992095410823822,
-0.007068182807415724,
0.04806184396147728,
0.03596550226211548,
0.020903488621115685,
-0.04910432547330856,
-0.0022377336863428354,
0.020112643018364906,
0.024174712598323822,
0.05341802537441254,
-0.015816912055015564,
0.04694747179746628,
0.041159920394420624,
0.009517108090221882,
0.020346300676465034,
0.03993770480155945,
0.02437242493033409,
0.08073814958333969,
-0.04105207696557045,
-0.034905049949884415,
0.01116170734167099,
-0.0029342169873416424,
-0.010092268697917461,
0.03195735439658165,
0.015493384562432766,
0.03537236899137497,
0.018477030098438263,
-0.011107786558568478,
-0.015430476516485214,
0.020957408472895622,
-0.019016241654753685,
0.0009818169055506587,
0.04364030063152313,
0.03370080888271332,
-0.05694088339805603,
0.020310353487730026,
0.10043739527463913,
0.006906419061124325,
-0.03893117234110832,
0.02099335566163063,
-0.004983226303011179,
-0.0457252562046051,
-0.017668209969997406,
-0.03350309655070305,
-0.010919061489403248,
0.055359192192554474,
-0.0408363938331604,
0.025073401629924774,
0.02857828512787819,
0.08950934559106827,
0.08066625148057938,
0.0247498732060194,
0.03407825529575348,
0.02309628762304783,
-0.01277934666723013,
-0.02343778870999813,
-0.02365347370505333,
0.02289857529103756,
0.021227015182375908,
-0.022988444194197655,
0.039074964821338654,
-0.023977002128958702,
0.05424482002854347,
0.03229885548353195,
-0.029009655117988586,
0.02043616957962513,
-0.0041429526172578335,
0.01219519879668951,
0.019771140068769455,
0.005558386445045471,
-0.03591158241033554,
-0.0015625940868631005,
0.0002853335172403604,
0.00039458030369132757,
-0.014891264028847218,
0.016392072662711143,
0.02536098100244999,
0.016032597050070763,
-0.022575048729777336,
0.0340602844953537,
-0.00034627580316737294,
-0.034527599811553955,
-0.027553780004382133,
0.008784676901996136,
0.034347862005233765,
-0.009256488643586636,
-0.010946022346615791,
-0.039434440433979034,
0.001505302730947733,
-0.02309628762304783,
-0.0054370635189116,
-0.031292323023080826,
0.04694747179746628,
-0.012347975745797157,
0.006614345125854015,
-0.030681215226650238,
0.004857409745454788,
0.000813874532468617,
0.01060452125966549,
-0.025396928191184998,
-0.009157632477581501,
-0.004372118040919304,
-0.02935115620493889,
-0.025055427104234695,
-0.018297292292118073,
-0.04065665602684021,
-0.018216410651803017,
-0.03875143453478813,
-0.023761317133903503,
0.04047691822052002,
0.012563660740852356,
0.028146915137767792,
-0.0011396489571779966,
0.022772759199142456,
-0.005401116330176592,
0.027499860152602196,
0.003388054436072707,
0.06901925802230835,
0.03307172656059265,
-0.03893117234110832,
-0.0279671773314476,
0.05464024469256401,
-0.013857772573828697,
0.010065307840704918,
0.03889522701501846,
-0.019573429599404335,
0.012581635266542435,
0.0661434531211853,
-0.01812654174864292,
0.004133965820074081,
-0.009750766679644585,
-0.023132234811782837,
0.022916549816727638,
0.019968852400779724,
-0.009669885039329529,
-0.043963827192783356,
0.021280936896800995,
-0.02911749854683876,
0.049859222024679184,
0.013893719762563705,
-0.016571810469031334,
0.02271883748471737,
-0.009786714799702168,
0.02365347370505333,
-0.04612067714333534,
-0.05348992347717285,
0.0386076457798481,
-0.027392016723752022,
-0.013992574997246265,
0.029548868536949158,
0.018198436126112938,
0.030789058655500412,
-0.03456354886293411,
-0.004596790298819542,
0.00992151815444231,
0.0537056066095829,
-0.04935595765709877,
0.04389193281531334,
-0.02194596640765667,
-0.015196817927062511,
-0.03238872438669205,
-0.022179625928401947,
0.12351571023464203,
-0.0006150397239252925,
0.0206338819116354,
0.03237074986100197,
-0.015834886580705643,
-0.05622193589806557,
-0.032244931906461716,
0.021029304713010788,
-0.008438682183623314,
0.029998213052749634,
0.010119229555130005,
0.014801395125687122,
0.019771140068769455,
-0.05431671440601349,
0.02059793286025524,
-0.04234618693590164,
-0.033035777509212494,
-0.044179514050483704,
-0.028524363413453102,
-0.02703254111111164,
-0.001743455184623599,
0.01872866228222847,
-0.07398001104593277,
0.06182974949479103,
0.027697570621967316,
0.012132290750741959,
0.02947697415947914,
-0.036001451313495636,
0.010325927287340164,
0.013758916407823563,
-0.014307116158306599,
0.010406809858977795,
0.018423108384013176,
-0.016410047188401222,
0.014414958655834198,
-0.01944761350750923,
0.004673178773373365,
0.06312385946512222,
0.008631899952888489,
-0.03161584958434105,
0.015843873843550682,
-0.028811944648623466,
0.0007470345590263605,
0.02724822610616684,
0.036181189119815826,
0.0021051771473139524,
-0.02611587941646576,
0.04159129038453102,
0.018000725656747818,
-0.019771140068769455,
0.005423583555966616,
-0.019609376788139343,
0.01836918666958809,
-0.03835601359605789,
0.08677733689546585,
0.021784203127026558,
-0.04554551839828491,
-0.05866636708378792,
-0.022449230775237083,
0.02192799188196659,
-0.023707395419478416,
-0.03947038576006889,
0.03799653798341751,
0.012833267450332642,
-0.027877308428287506,
0.024911636486649513,
0.00453163543716073,
-0.05233960226178169,
-0.00027634663274511695,
0.03042958304286003,
-0.01739860326051712,
-0.0015985416248440742,
-0.023545630276203156,
-0.020004799589514732,
0.08598648756742477,
-0.015331621281802654,
-0.02117309346795082,
0.010919061489403248,
-0.020184537395834923,
0.0255227442830801,
-0.02099335566163063,
-0.04256187379360199,
-0.03591158241033554,
0.01002037338912487,
0.019986825063824654,
0.0023747836239635944,
-0.03404230996966362,
-0.05492782220244408,
-0.024174712598323822,
-0.01333653274923563,
-0.00803427305072546,
-0.03429394215345383,
-0.03781680017709732,
0.03332335874438286,
-0.07160747796297073,
0.010784258134663105,
-0.04730694741010666,
-0.0255227442830801,
-0.00024039909476414323,
0.010343900881707668,
-0.07117610424757004,
0.04403572157025337,
-0.011314484290778637,
0.030483504757285118,
0.05352586880326271,
-0.010784258134663105,
-0.0011604311875998974,
0.028883839026093483,
0.032981857657432556,
0.04270566254854202,
-0.019519507884979248,
-0.02083159238100052,
0.005234858952462673,
-0.012428858317434788,
0.016005637124180794,
0.06466960161924362,
0.02212570421397686,
-0.014217247255146503,
0.01152118295431137,
-0.04601283743977547,
0.017362656071782112,
0.0069603403098881245,
0.002972411224618554,
0.0034936503507196903,
-0.010361875407397747,
0.07433948665857315,
-0.04630041494965553,
-0.06247680261731148,
0.03957822918891907,
-0.028398547321558,
0.013543231412768364,
0.05600624904036522,
0.020687801763415337,
-0.06981009989976883,
0.01872866228222847,
0.028398547321558,
0.0005029845633544028,
-0.009184593334794044,
-0.023491710424423218,
-0.009409265592694283,
-0.008820625022053719,
-0.007090650033205748,
-0.011530169285833836,
0.030537424609065056,
-0.0439278781414032,
0.037349481135606766,
-0.0016996440244838595,
-0.02363549917936325,
0.03806843236088753,
0.0065424502827227116,
-0.01926787570118904,
0.00567072257399559,
0.04256187379360199,
-0.028452469035983086,
0.014504827558994293,
0.03219101205468178,
0.0038913199678063393,
-0.03537236899137497,
-0.011700920760631561,
0.004484454169869423,
-0.003785724053159356,
0.011557130143046379,
-0.0749865472316742,
-0.036630529910326004,
-0.10417594015598297,
0.024660004302859306,
-0.04745073616504669,
0.017164945602416992,
0.022952497005462646,
-0.032262906432151794,
-0.043065138161182404,
0.015601227059960365,
0.013246663846075535,
-0.025972088798880577,
-0.02703254111111164,
0.01719190552830696,
-0.05744415149092674,
0.03587563335895538,
-0.041878871619701385,
0.00888353306800127,
0.023168182000517845,
0.05604219809174538,
0.013120847754180431,
-0.0018153501441702247,
-0.052842866629362106,
-0.01930382288992405,
0.013830811716616154,
-0.03370080888271332,
0.014262181706726551,
-0.03332335874438286,
-0.019357744604349136,
0.004987719468772411,
-0.014405972324311733,
-0.031400166451931,
-0.018018698319792747,
0.04540172964334488,
0.004311456810683012,
-0.03422204777598381,
0.00018296729831490666,
-0.039039015769958496,
-0.04971543326973915,
-0.025127321481704712,
-0.032262906432151794,
0.05065006762742996,
0.0465879961848259,
-0.009157632477581501,
0.05765983462333679,
-0.009139658883213997,
0.026744961738586426,
0.0016850404208526015,
-0.006448087748140097,
0.001492945826612413,
0.04180697724223137,
-0.028434494510293007,
-0.027949202805757523,
-0.007427657954394817,
0.028632206842303276,
0.02288060262799263,
0.044359251856803894,
0.04098018258810043,
0.010963995940983295,
0.060248058289289474,
-0.06981009989976883,
0.0018737649079412222,
-0.0027387524023652077,
-0.0042642755433917046,
-0.06395065039396286,
-0.06995388865470886,
-0.0829668939113617,
0.03643282130360603,
-0.004091278184205294,
0.061757855117321014,
0.012365949340164661,
0.02877599559724331,
-0.01334552001208067
]
|
36,406 | torch.optim.optimizer | _cuda_graph_capture_health_check | null | def _cuda_graph_capture_health_check(self) -> None:
# Note [torch.compile x capturable]
# If we are compiling, we try to take the capturable path automatically by
# setting the flag to True during tracing. Due to this, we skip all the checks
# normally required for determining whether we can use CUDA graphs and
# shunt the responsibility to torch.inductor. This saves time during tracing
# since the checks are slow without sacrificing UX since inductor will warn
# later if CUDA graphs cannot be enabled, e.g.,
# https://github.com/pytorch/pytorch/blob/d3ba8901d8640eb16f88b2bfef9df7fa383d4b47/torch/_inductor/compile_fx.py#L390.
# Thus, when compiling, inductor will determine if cudagraphs
# can be enabled based on whether there is input mutation or CPU tensors.
if not is_compiling() and torch.backends.cuda.is_built() and torch.cuda.is_available():
capturing = torch.cuda.is_current_stream_capturing()
if capturing and not all(group['capturable'] for group in self.param_groups):
raise RuntimeError("Attempting CUDA graph capture of step() for an instance of " +
self.__class__.__name__ +
" but param_groups' capturable is False.")
if (
(not getattr(self, "_warned_capturable_if_run_uncaptured", False))
and all(group['capturable'] for group in self.param_groups)
and (not capturing)
):
warnings.warn(
"This instance was constructed with capturable=True or some of all the param_groups came with capturable=True, "
"but step() is running without CUDA graph capture. If you never intend to graph-capture this "
"instance, capturable=True can impair performance, and you should set capturable=False."
)
self._warned_capturable_if_run_uncaptured = True
| (self) -> NoneType | [
-0.025649141520261765,
-0.04378945752978325,
-0.020107772201299667,
0.030594859272241592,
-0.005211955867707729,
0.04844637215137482,
0.01225599367171526,
-0.026371143758296967,
-0.03989064320921898,
-0.04292305186390877,
0.011561065912246704,
0.019223317503929138,
0.06898734718561172,
-0.015360604971647263,
-0.008248879574239254,
-0.026298943907022476,
0.025125689804553986,
0.0010942851658910513,
0.07537706941366196,
-0.03920473903417587,
-0.030378257855772972,
0.014169299975037575,
-0.02671409584581852,
-0.025486690923571587,
-0.06483583152294159,
0.03619037941098213,
0.01082101371139288,
-0.008862581104040146,
-0.016867784783244133,
0.044258758425712585,
-0.04920447617769241,
0.01633530855178833,
0.029457705095410347,
-0.013952699489891529,
0.045738860964775085,
0.03714703395962715,
0.006385210435837507,
0.009701909497380257,
-0.0948711410164833,
0.024169035255908966,
-0.0875789150595665,
-0.028735702857375145,
-0.00374313211068511,
0.01972872018814087,
-0.005658695008605719,
0.01071271300315857,
0.03169591352343559,
0.05454729497432709,
-0.057579703629016876,
-0.08786771446466446,
0.01560428086668253,
-0.006231784820556641,
0.04259815067052841,
0.11580920964479446,
0.009665809571743011,
-0.007468214258551598,
0.028591301292181015,
-0.028140049427747726,
0.0507567822933197,
-0.01750856265425682,
0.013546572998166084,
0.03510737419128418,
0.019746771082282066,
-0.041840050369501114,
0.03913253918290138,
-0.004228227771818638,
-0.016037482768297195,
-0.011326415464282036,
0.005090117920190096,
0.0020159664563834667,
-0.04158734902739525,
-0.010667587630450726,
0.009494333527982235,
0.008840018883347511,
0.027941498905420303,
-0.11523161083459854,
-0.026876546442508698,
-0.007517851889133453,
0.033735569566488266,
-0.007364426273852587,
0.07364426553249359,
0.03862713649868965,
-0.007707377430051565,
-0.045666661113500595,
0.010541237890720367,
0.010053886100649834,
0.029186954721808434,
-0.007648714818060398,
-0.04465585947036743,
-0.011479840613901615,
0.010541237890720367,
-0.008569267578423023,
0.026587745174765587,
0.08988931775093079,
0.05653280019760132,
0.08375229686498642,
-0.04541396349668503,
-0.0076306648552417755,
-0.049637675285339355,
-0.047507770359516144,
-0.014593477360904217,
0.02523398958146572,
0.02229182980954647,
0.028735702857375145,
0.017860539257526398,
-0.04877127334475517,
0.0023047674912959337,
0.006249834783375263,
0.021966928616166115,
-0.015153029002249241,
-0.043969955295324326,
-0.02324848249554634,
-0.012770420871675014,
0.004566666204482317,
0.02920500375330448,
-0.0647275298833847,
-0.03952964022755623,
-0.07451066374778748,
-0.0692039430141449,
0.03061290830373764,
-0.013194597326219082,
-0.04909617453813553,
0.018284715712070465,
-0.05378919094800949,
0.006931224837899208,
0.02427733689546585,
-0.018808167427778244,
0.015207178890705109,
0.03725533187389374,
-0.0007411807891912758,
-0.011750591918826103,
-0.05057628080248833,
-0.006980862468481064,
0.036172330379486084,
-0.004670454189181328,
-0.02267087996006012,
0.020035570487380028,
-0.0009684987599030137,
0.013456323184072971,
0.010992488823831081,
-0.020216071978211403,
-0.03577522560954094,
-0.024710537865757942,
-0.05115388333797455,
0.1045459732413292,
0.02156982757151127,
-0.017734188586473465,
0.013546572998166084,
-0.0038672261871397495,
-0.06418602913618088,
0.046027664095163345,
-0.03743583336472511,
0.00748626422137022,
-0.009855334646999836,
-0.011227140203118324,
0.028753751888871193,
-0.030630959197878838,
0.03924084082245827,
0.017021210864186287,
0.01743636280298233,
-0.01018926128745079,
-0.025558890774846077,
-0.05400579050183296,
0.046027664095163345,
0.005374406464397907,
-0.008510605432093143,
0.019151117652654648,
-0.004241765011101961,
-0.02472858875989914,
0.04848247393965721,
-0.0032535241916775703,
-0.016371408477425575,
0.04945717751979828,
0.05830170586705208,
-0.013681949116289616,
0.06519683450460434,
0.03023385815322399,
0.02442173659801483,
-0.0191330686211586,
-0.02369973435997963,
-0.016651183366775513,
0.006552173290401697,
-0.018645716831088066,
-0.033230166882276535,
0.006543148308992386,
0.06577443331480026,
0.0647636279463768,
-0.05555809661746025,
0.02413293533027172,
0.003655137959867716,
0.0016617340734228492,
0.057290904223918915,
0.04869907349348068,
0.0012195074232295156,
0.0779762789607048,
-0.038735438138246536,
-0.02045072242617607,
0.0662437379360199,
-0.010640513151884079,
-0.004329759161919355,
0.017634913325309753,
-0.030071407556533813,
0.030486557632684708,
0.010721738450229168,
-0.029385505244135857,
0.046099863946437836,
-0.03398827090859413,
0.10173016041517258,
0.03642502799630165,
-0.007405038923025131,
-0.053319890052080154,
-0.01965652033686638,
0.011209090240299702,
0.0750160664319992,
-0.02250842936336994,
-0.021822527050971985,
0.01055928785353899,
0.01309532206505537,
-0.011795717291533947,
0.031244661659002304,
0.025594990700483322,
-0.002425477374345064,
-0.03996284306049347,
-0.03732753172516823,
-0.043320152908563614,
0.008000691421329975,
-0.012779445387423038,
0.0031858363654464483,
0.010053886100649834,
-0.03848273679614067,
0.02900645323097706,
-0.010432937182486057,
-0.059348613023757935,
0.08815651386976242,
-0.028158100321888924,
0.06053991615772247,
-0.00802325364202261,
0.056027401238679886,
0.01512595359236002,
-0.023735834285616875,
-0.03909643739461899,
-0.037544135004282,
-0.0022269266191869974,
-0.02332068234682083,
0.01358267292380333,
-0.04140684753656387,
-0.03626257926225662,
0.006669498514384031,
0.01314044650644064,
0.016678258776664734,
-0.07465506345033646,
-0.03395216912031174,
-0.046533066779375076,
-0.04916837438941002,
-0.10736177861690521,
-0.07956468313932419,
-0.019530169665813446,
-0.04238155111670494,
0.07108115404844284,
-0.025360340252518654,
0.018862316384911537,
0.02943965420126915,
0.01258991938084364,
0.08295809477567673,
-0.03360921889543533,
-0.024006584659218788,
0.02640724368393421,
-0.007626152131706476,
-0.033013567328453064,
-0.02369973435997963,
0.006849999539554119,
0.06270592659711838,
-0.027399998158216476,
-0.013194597326219082,
-0.028284450992941856,
0.0011100789997726679,
-0.026371143758296967,
0.06137022003531456,
-0.017183661460876465,
0.04909617453813553,
0.09544873982667923,
0.008975394070148468,
-0.03339261934161186,
-0.02230987884104252,
-0.05422239378094673,
-0.023284582421183586,
-0.014223450794816017,
0.012815545313060284,
-0.015541105531156063,
-0.03178616240620613,
-0.04461975768208504,
0.002633053110912442,
0.03252621740102768,
-0.0089212441816926,
0.018185440450906754,
0.01306824665516615,
-0.06732673943042755,
0.021840577945113182,
-0.05512489750981331,
0.015252304263412952,
0.013654873706400394,
0.017607837915420532,
-0.04285085201263428,
0.012472594156861305,
-0.006290447432547808,
0.025215940549969673,
-0.007102700415998697,
-0.004300427623093128,
-0.0013041171478107572,
-0.04916837438941002,
0.0017294217832386494,
0.008618906140327454,
0.1103941947221756,
0.07443846762180328,
0.02135322615504265,
-0.03804953396320343,
0.011759616434574127,
-0.03494492545723915,
0.051623184233903885,
0.06895124912261963,
-0.01743636280298233,
0.05216468498110771,
0.019674569368362427,
0.05108168348670006,
-0.07115335017442703,
-0.0018772067269310355,
0.10165796428918839,
0.009629709646105766,
-0.00865951832383871,
-0.01573965512216091,
-0.058915410190820694,
-0.03604597970843315,
0.03202081471681595,
-0.00531574385240674,
0.012373318895697594,
0.005766995716840029,
-0.031984712928533554,
-0.028501050546765327,
0.027923449873924255,
-0.03526982665061951,
0.0008861453388817608,
0.08201949298381805,
0.03577522560954094,
-0.011136889457702637,
0.08555730432271957,
-0.06288642436265945,
0.013555598445236683,
0.005649670027196407,
0.006827436853200197,
-0.028681552037596703,
-0.025215940549969673,
0.04238155111670494,
-0.05974571406841278,
0.05306718870997429,
0.024006584659218788,
0.0003945631324313581,
0.008736231364309788,
0.005189393647015095,
-0.00020630659128073603,
-0.0006261115777306259,
0.06866244226694107,
0.05234518647193909,
-0.014286626130342484,
0.007400526199489832,
0.04519736021757126,
-0.03274281695485115,
-0.013564622960984707,
-0.0205951239913702,
0.024187086150050163,
0.005839195568114519,
-0.017977863550186157,
0.008528655394911766,
0.031533461064100266,
0.005586494691669941,
-0.01972872018814087,
0.032995518296957016,
0.00223031104542315,
0.017680037766695023,
0.018411066383123398,
0.059709612280130386,
0.0040838271379470825,
0.07516046613454819,
-0.0706118494272232,
-0.023681683465838432,
-0.03561277687549591,
-0.03819393739104271,
-0.04693016782402992,
0.03819393739104271,
-0.02303188107907772,
-0.04797707125544548,
0.032273516058921814,
-0.02707509696483612,
-0.03259841725230217,
-0.010685637593269348,
-0.011299340054392815,
-0.004203408490866423,
0.0559551976621151,
0.04140684753656387,
0.0054014818742871284,
-0.02693069539964199,
-0.017021210864186287,
-0.02398853562772274,
-0.0011642291210591793,
-0.014079050160944462,
-0.022869430482387543,
-0.00061877875123173,
0.016100658103823662,
-0.012869696132838726,
0.012490644119679928,
-0.03429512307047844,
0.020432673394680023,
-0.034024372696876526,
-0.038302235305309296,
0.0676516443490982,
-0.03442147374153137,
-0.01898866705596447,
0.05039577931165695,
-0.023122131824493408,
-0.0048238798044621944,
0.03561277687549591,
-0.004841929767280817,
0.043969955295324326,
-0.007874340750277042,
-0.004104133229702711,
0.010694663040339947,
0.0261364933103323,
-0.04274255037307739,
0.009395058266818523,
0.011579115875065327,
-0.04093754664063454,
-0.04530566185712814,
0.06970934569835663,
-0.008474505506455898,
-0.015775756910443306,
-0.020793674513697624,
0.007215513382107019,
0.009656784124672413,
0.03761633485555649,
0.015838932245969772,
0.07696547359228134,
-0.0677599385380745,
0.004128952044993639,
0.00802325364202261,
0.02752634882926941,
-0.011479840613901615,
0.02884400263428688,
-0.03732753172516823,
-0.00413797702640295,
-0.01609163172543049,
0.024114886298775673,
0.01460250187665224,
-0.0007609230233356357,
0.007048550061881542,
-0.022688930854201317,
-0.011136889457702637,
0.006601810920983553,
-0.034042421728372574,
0.023356782272458076,
0.038374435156583786,
-0.02693069539964199,
-0.009322858415544033,
0.04718286916613579,
-0.10396836698055267,
-0.03920473903417587,
-0.018808167427778244,
0.021587876603007317,
0.044258758425712585,
0.034096572548151016,
-0.03561277687549591,
0.024854937568306923,
0.04866297170519829,
0.003779232269152999,
0.03236376494169235,
-0.01633530855178833,
0.0043906779028475285,
-0.06862634420394897,
-0.01225599367171526,
0.0272375475615263,
-0.02642529457807541,
0.008506093174219131,
-0.00406577717512846,
-0.0021761609241366386,
0.023753885179758072,
0.001202585524879396,
-0.017616862431168556,
-0.0003968193777836859,
-0.019367719069123268,
-0.024818837642669678,
0.0006165225058794022,
0.02267087996006012,
-0.05216468498110771,
-0.06220052018761635,
0.0028361163567751646,
-0.039349138736724854,
0.008005203679203987,
-0.011579115875065327,
0.016849735751748085,
0.012048417702317238,
0.07346376031637192,
0.006344597786664963,
0.0261184424161911,
0.028446901589632034,
0.02841080166399479,
-0.00038469198625534773,
0.034096572548151016,
-0.010568312369287014,
0.0471106693148613,
-0.023880235850811005,
-0.029024504125118256,
0.009358958341181278,
0.0327608659863472,
0.03451172262430191,
-0.013465347699820995,
-0.013194597326219082,
0.008379742503166199,
-0.0009713190956972539,
-0.0003779232210945338,
-0.05978181213140488,
0.012824570760130882,
-0.036388929933309555,
0.026768244802951813,
0.03611817955970764,
0.05364479124546051,
0.019024766981601715,
0.016921935603022575,
0.021226875483989716,
-0.0007129775476641953,
0.055919099599123,
-0.015189128927886486,
-0.019457969814538956,
-0.005193905904889107,
0.0024593211710453033,
-0.02664189413189888,
0.023862184956669807,
0.023356782272458076,
0.005789557937532663,
0.03761633485555649,
0.004733629524707794,
-0.1067119762301445,
-0.021443476900458336,
0.008709155954420567,
-0.03229156509041786,
-0.006687548942863941,
-0.0011281289625912905,
-0.02178642712533474,
-0.021281026303768158,
0.06003451347351074,
0.03333846852183342,
-0.02532424032688141,
-0.026064293459057808,
-0.03916864097118378,
0.022923581302165985,
-0.070684053003788,
-0.006349110044538975,
0.06978154927492142,
0.02377193421125412,
0.06129801645874977,
0.0448724590241909,
0.014927403070032597,
0.030667059123516083,
0.016840709373354912,
-0.07891488075256348,
-0.04144294932484627,
-0.04667746648192406,
-0.03739973157644272,
-0.052056387066841125,
-0.014358825981616974,
0.031677864491939545,
-0.03211106359958649,
-0.025631090626120567,
-0.0008133810479193926,
-0.03304966911673546,
-0.043608956038951874,
-0.011118839494884014,
-0.034186821430921555,
-0.03082950972020626,
0.013672923669219017,
0.1177586168050766,
-0.008618906140327454,
-0.034096572548151016,
-0.001711371704004705,
-0.02788734994828701,
-0.017138535156846046,
0.009259683080017567,
-0.025667190551757812,
-0.03008945658802986,
-0.02230987884104252,
0.003384387120604515,
0.023880235850811005,
-0.01853741519153118,
0.030071407556533813,
-0.010108035989105701,
-0.013438273221254349,
-0.04916837438941002,
0.028952302411198616,
0.020125821232795715,
-0.03312186896800995,
0.030360208824276924,
0.028825951740145683,
0.04924057424068451,
-0.02456613816320896,
0.032562315464019775,
0.09010592103004456,
-0.015468904748558998,
-0.01868181675672531,
-0.030197758227586746,
0.002207748591899872,
-0.008460967801511288,
0.005730895325541496,
-0.03909643739461899,
-0.058843210339546204,
0.04317575320601463,
0.0012116105062887073,
0.042562052607536316,
-0.003201630199328065,
-0.03611817955970764,
-0.05833780765533447,
0.0027774537447839975,
0.04739946871995926,
0.07985348254442215,
0.012535769492387772,
0.008894168771803379,
-0.025865742936730385,
-0.025342289358377457,
0.035937678068876266,
-0.02716534584760666,
0.05256178602576256,
-0.05198418349027634,
-0.03003530763089657,
0.0290606040507555,
0.015983331948518753,
-0.020143872126936913,
-0.03104611113667488,
-0.0054601444862782955,
0.004043214488774538,
-0.06010671332478523,
-0.01008096057921648,
0.02781514823436737,
-0.020216071978211403,
-0.005640645045787096,
-0.06541343033313751,
-0.0272375475615263,
0.00025961067876778543,
0.0040026018396019936,
0.01621798239648342,
-0.058915410190820694,
-0.03326626867055893,
-0.008045815862715244,
0.04974597692489624,
-0.010622463189065456,
0.024692486971616745,
0.08793991059064865,
-0.005505269393324852,
-0.020414622500538826,
0.0003643856616690755,
0.02265283092856407,
-0.016606058925390244,
0.05093728005886078,
-0.014097100123763084,
-0.01740928739309311,
-0.022472329437732697,
0.016398483887314796,
0.024313436821103096,
0.009629709646105766,
0.05451119318604469,
0.02516178973019123,
0.027634648606181145,
-0.017878588289022446,
-0.09761475026607513,
0.0169309601187706,
-0.059276409447193146,
-0.03268866613507271,
-0.020396573469042778,
0.0046659414656460285,
-0.027057046070694923,
0.0028361163567751646,
0.022039128467440605,
-0.03841053694486618,
-0.04620816558599472,
-0.004652404226362705,
0.006863536778837442,
-0.007409551180899143,
-0.03676798194646835,
0.004923155065625906,
0.01379927434027195,
0.020035570487380028,
0.00044871331192553043,
-0.05342819169163704,
-0.000025136125259450637,
-0.06122581660747528,
-0.041984450072050095,
0.022634780034422874,
0.04667746648192406,
0.04480025917291641,
-0.02427733689546585,
-0.03149736300110817,
-0.057002101093530655,
0.03963794186711311,
0.03505322337150574,
-0.018483266234397888,
0.01733708754181862,
-0.026587745174765587,
-0.022021077573299408,
0.017310012131929398,
-0.001132641569711268,
0.006114459130913019,
0.025667190551757812,
0.02135322615504265,
0.038518838584423065,
-0.017923714593052864,
0.02841080166399479,
-0.008018741384148598,
0.0073554012924432755,
-0.029042553156614304,
-0.002405171049758792,
-0.04494465887546539,
-0.05599129945039749,
-0.013763174414634705,
-0.0013029889669269323,
-0.03776073455810547,
0.008235341869294643,
0.046533066779375076,
-0.0003327980521135032,
-0.02317628264427185,
-0.015017653815448284,
0.04541396349668503,
0.049276676028966904,
-0.053536489605903625,
0.11588141322135925,
-0.018356915563344955,
0.023898284882307053,
-0.007684814743697643,
-0.03460197150707245,
0.07234466075897217,
-0.016245057806372643,
0.015432804822921753,
-0.01060441229492426,
0.007405038923025131,
-0.01450322661548853,
0.01110981497913599,
0.024927139282226562,
0.0018693098099902272,
-0.00007061382348183542,
-0.049493275582790375,
-0.011308365501463413,
0.005306718870997429,
-0.012517719529569149,
0.010099010542035103,
0.05025137960910797,
-0.07747087627649307,
0.019981421530246735,
0.021587876603007317,
0.025883791968226433,
0.013681949116289616,
0.05924031138420105,
-0.0005451683537103236,
-0.004117670934647322,
0.025053489953279495,
-0.0030933297239243984,
-0.08007008582353592,
0.006872561760246754,
0.00333023676648736,
-0.02303188107907772,
0.017607837915420532,
-0.029999207705259323,
0.03498102352023125,
0.040359944105148315,
0.03474637493491173
]
|
36,407 | torch.optim.optimizer | _group_tensors_by_device_and_dtype | Groups a list of lists of tensors by device and dtype.
Skips this step if we are compiling since this will occur during inductor lowering. | @staticmethod
def _group_tensors_by_device_and_dtype(
tensorlistlist: TensorListList,
with_indices: bool = False,
) -> Union[
Dict[Tuple[None, None], Tuple[TensorListList, Indices]],
Dict[Tuple[torch.device, torch.dtype], Tuple[TensorListList, Indices]],
]:
"""Groups a list of lists of tensors by device and dtype.
Skips this step if we are compiling since this will occur during inductor lowering."""
if is_compiling():
return {(None, None): (tensorlistlist, list(range(len(tensorlistlist[0]))))}
else:
return _group_tensors_by_device_and_dtype(tensorlistlist, with_indices)
| (tensorlistlist: List[List[Optional[torch.Tensor]]], with_indices: bool = False) -> Union[Dict[Tuple[NoneType, NoneType], Tuple[List[List[Optional[torch.Tensor]]], List[int]]], Dict[Tuple[torch.device, torch.dtype], Tuple[List[List[Optional[torch.Tensor]]], List[int]]]] | [
-0.01934584230184555,
-0.042907122522592545,
-0.06123674288392067,
-0.008515558205544949,
0.01399186160415411,
0.02087017521262169,
0.00801685731858015,
-0.01575143076479435,
-0.01839548721909523,
0.008680223487317562,
-0.0298467967659235,
-0.03729908540844917,
-0.012815680354833603,
-0.023166082799434662,
0.05577925965189934,
-0.06816210597753525,
-0.007809848990291357,
0.03338475152850151,
0.02965860813856125,
-0.03818357363343239,
-0.028661204501986504,
-0.012288750149309635,
-0.0015219795750454068,
0.02834128402173519,
-0.016748832538723946,
0.04524066671729088,
0.04855279624462128,
-0.0315028615295887,
-0.009240086190402508,
0.003636755049228668,
-0.0014690514653921127,
-0.007207643706351519,
0.06823737919330597,
-0.020493796095252037,
-0.02982797659933567,
0.02134064771234989,
0.00979524478316307,
0.062064774334430695,
-0.04222964122891426,
0.05062287673354149,
0.058978475630283356,
-0.09778307378292084,
-0.003326243022456765,
-0.0334412083029747,
0.027212148532271385,
0.08536259084939957,
0.008520263247191906,
-0.0017360447673127055,
0.010933788493275642,
-0.008793137036263943,
0.021792301908135414,
-0.07448525726795197,
0.015600878745317459,
0.04572995752096176,
-0.03673451766371727,
-0.011987647973001003,
0.018837731331586838,
-0.011206663213670254,
-0.012890955433249474,
0.01641950197517872,
-0.018837731331586838,
0.02979033999145031,
-0.025744272395968437,
-0.032387349754571915,
-0.05374681577086449,
-0.021698206663131714,
-0.07971691340208054,
0.0005875029601156712,
-0.08415818214416504,
0.013775444589555264,
-0.04189090058207512,
-0.04448791220784187,
0.02254505828022957,
-0.026591124013066292,
0.021848758682608604,
-0.04418680816888809,
0.009381228126585484,
0.025518447160720825,
0.07211407274007797,
-0.015572650358080864,
0.0052740005776286125,
0.05333280190825462,
-0.02982797659933567,
-0.0006810094346292317,
0.05401027947664261,
0.020173875615000725,
0.007649888284504414,
0.08641645312309265,
-0.039406802505254745,
-0.12721584737300873,
-0.046520352363586426,
0.00974819716066122,
0.020569073036313057,
0.01580788753926754,
-0.009051897563040257,
0.05043468624353409,
-0.04042302444577217,
-0.030656009912490845,
-0.00696770241484046,
-0.014330602250993252,
0.0006398430559784174,
-0.02435167320072651,
-0.019853953272104263,
-0.04885390028357506,
0.0007274686358869076,
-0.03449506685137749,
-0.05209075286984444,
0.03137112781405449,
-0.021735845133662224,
0.000902719737496227,
-0.0563814640045166,
-0.0635702908039093,
0.03671570122241974,
0.011818277649581432,
0.07034509629011154,
-0.07377014309167862,
-0.00330271921120584,
-0.0050058308988809586,
-0.016485368832945824,
-0.05062287673354149,
-0.027663802728056908,
0.0259700994938612,
-0.04046066477894783,
-0.02612065151333809,
-0.006403135135769844,
0.00487880315631628,
0.07399597018957138,
0.017605094239115715,
0.008426168002188206,
0.03814593702554703,
-0.03921861574053764,
0.03643341735005379,
-0.027720259502530098,
0.04072412848472595,
0.014020089991390705,
-0.037600189447402954,
-0.02102072536945343,
-0.039331529289484024,
-0.008623766712844372,
0.024953879415988922,
0.007344081066548824,
-0.009037783369421959,
-0.016363045200705528,
0.0386916846036911,
0.0032815479207783937,
0.03379876911640167,
0.01748277060687542,
-0.039594992995262146,
-0.0047682421281933784,
-0.051526185125112534,
-0.0011973533546552062,
0.022450963035225868,
-0.007475813385099173,
-0.00016745892935432494,
-0.031088843941688538,
0.021924033761024475,
-0.03861641138792038,
-0.015516193583607674,
-0.018734227865934372,
-0.006591324228793383,
-0.037619005888700485,
0.0027616755105555058,
-0.02286497876048088,
0.018743637949228287,
-0.04572995752096176,
-0.01226052176207304,
-0.02982797659933567,
-0.026948682963848114,
-0.013003868982195854,
-0.026591124013066292,
0.0049070315435528755,
-0.014895169995725155,
0.046294525265693665,
0.018865959718823433,
-0.04373515397310257,
0.05062287673354149,
-0.03125821426510811,
-0.02102072536945343,
-0.031145300716161728,
0.017840329557657242,
0.03918097913265228,
-0.026816951110959053,
-0.02962096966803074,
0.04896681383252144,
-0.016955841332674026,
0.06089800223708153,
0.00528811477124691,
-0.02096426859498024,
0.02956451289355755,
-0.004246017429977655,
0.014725799672305584,
0.0010221021948382258,
-0.0530693344771862,
0.005857386626303196,
0.010058709420263767,
0.023542460054159164,
-0.05096161738038063,
-0.00969174038618803,
-0.004413035232573748,
0.04038538783788681,
-0.026779312640428543,
-0.04603106155991554,
0.023956475779414177,
0.05920430272817612,
-0.019722221419215202,
-0.007038273382931948,
-0.004333054646849632,
0.07377014309167862,
-0.00023406023683492094,
0.046557992696762085,
-0.013606074266135693,
-0.04350932687520981,
0.004775299225002527,
0.08686809986829758,
0.03801420331001282,
-0.028548290953040123,
-0.05472540110349655,
0.05280587077140808,
-0.042982399463653564,
-0.0626293420791626,
0.02132182940840721,
-0.02126537263393402,
0.017661549150943756,
0.0019171767635270953,
-0.02472805231809616,
0.00653957249596715,
-0.002707571256905794,
0.010952607728540897,
-0.007993333041667938,
-0.016165446490049362,
0.022469783201813698,
-0.05295642092823982,
-0.023862382397055626,
0.06078508868813515,
0.015431508421897888,
-0.020286789163947105,
0.012523986399173737,
0.021359466016292572,
0.03899278864264488,
0.030354907736182213,
-0.043208226561546326,
-0.014913988299667835,
0.034532707184553146,
-0.032199159264564514,
-0.014123594388365746,
-0.0015749078011140227,
0.025631360709667206,
0.004330702591687441,
-0.004568291362375021,
0.01040685921907425,
-0.07926525920629501,
0.0018207298126071692,
0.04516539350152016,
-0.0028698842506855726,
-0.03876696154475212,
-0.029545694589614868,
0.0028393035754561424,
-0.002999264281243086,
0.030561914667487144,
-0.07768447697162628,
0.037769559770822525,
0.0008556724642403424,
0.02297789230942726,
-0.01632540673017502,
0.025461990386247635,
-0.03801420331001282,
0.07087202370166779,
0.05954303964972496,
-0.03472089394927025,
0.025838367640972137,
0.03359175845980644,
0.0659414753317833,
0.007522860541939735,
-0.04384806752204895,
0.02134064771234989,
0.013173239305615425,
0.04264365881681442,
0.03212388604879379,
0.005551579408347607,
-0.0007568731671199203,
0.03270727023482323,
0.012580443173646927,
-0.07753392308950424,
-0.02469041384756565,
0.006525458302348852,
0.014340012334287167,
-0.0383153073489666,
0.03265081346035004,
-0.029150497168302536,
-0.02457750029861927,
-0.0020959563553333282,
-0.010096346959471703,
-0.020531434565782547,
-0.037713102996349335,
-0.047912951558828354,
0.011667726561427116,
0.003944914788007736,
-0.022074585780501366,
-0.008346187882125378,
-0.016767650842666626,
-0.009654102846980095,
0.04091231897473335,
0.07685644179582596,
0.048289332538843155,
0.030957112088799477,
0.005156382452696562,
0.05062287673354149,
-0.015506784431636333,
-0.02973388321697712,
-0.0490044504404068,
0.047912951558828354,
0.007301738485693932,
0.04373515397310257,
0.007094730157405138,
0.02096426859498024,
-0.016428912058472633,
-0.004737661220133305,
0.039444442838430405,
0.04603106155991554,
0.08912637084722519,
0.018969465047121048,
0.029018763452768326,
0.02087017521262169,
0.10064354538917542,
0.04076176509261131,
-0.013530798256397247,
0.04960665479302406,
-0.06172603368759155,
-0.011140796355903149,
0.036264047026634216,
-0.08122242987155914,
0.003674392821267247,
-0.0033568236976861954,
0.05566634610295296,
-0.03312128782272339,
-0.011818277649581432,
0.04685909301042557,
-0.03317774459719658,
-0.034081052988767624,
-0.00012776277435477823,
-0.02788962982594967,
-0.011714773252606392,
0.005057583097368479,
0.03891751170158386,
-0.018705999478697777,
-0.0641348585486412,
0.0626293420791626,
-0.0024276399053633213,
0.010397449135780334,
0.0655650943517685,
0.05020885914564133,
0.026816951110959053,
0.0021982842590659857,
0.0661296620965004,
0.07222698628902435,
-0.005189315415918827,
-0.057021308690309525,
0.002353540388867259,
0.005669197533279657,
0.06180131062865257,
0.05566634610295296,
0.00891075562685728,
0.05209075286984444,
0.0017925015417858958,
0.014575248584151268,
-0.0175956841558218,
0.010030481033027172,
0.002855770057067275,
0.07200115919113159,
-0.016193674877285957,
-0.007706345058977604,
0.0208137184381485,
0.03701680153608322,
0.05096161738038063,
0.03857877105474472,
-0.007941581308841705,
-0.034269239753484726,
0.0072546908631920815,
-0.0709473043680191,
0.04674617946147919,
-0.06454887241125107,
0.02290261723101139,
0.05668256804347038,
0.020098598673939705,
-0.026628762483596802,
0.02463395707309246,
-0.012749813497066498,
0.0054292562417685986,
-0.09665393829345703,
-0.02092663198709488,
-0.009908157400786877,
0.03536073863506317,
0.03707325831055641,
0.024935059249401093,
-0.04019719734787941,
0.003782601561397314,
-0.04347169026732445,
0.009983433410525322,
-0.028284827247262,
-0.09145991504192352,
-0.029489237815141678,
-0.07493691146373749,
-0.030449001118540764,
0.060596901923418045,
0.003973143175244331,
0.010331583209335804,
0.013624893501400948,
-0.04418680816888809,
0.010322174057364464,
-0.05299406126141548,
-0.01826375536620617,
0.011959419585764408,
0.022168679162859917,
0.012213475070893764,
0.041213419288396835,
0.05461248755455017,
-0.0000696887873345986,
0.03872932493686676,
0.06635548919439316,
0.042831845581531525,
0.05107453092932701,
-0.02295907400548458,
0.018094385042786598,
0.014010680839419365,
-0.0456923209130764,
-0.04757421091198921,
0.02632766030728817,
0.046256888657808304,
-0.04166507348418236,
0.014565838500857353,
-0.030543096363544464,
0.006774808745831251,
-0.03383640572428703,
-0.014725799672305584,
-0.020569073036313057,
-0.027249787002801895,
0.031032387167215347,
0.014330602250993252,
0.03370467200875282,
0.00392374349758029,
0.0028957603499293327,
0.02107718214392662,
0.00009835822856985033,
-0.011244300752878189,
0.015280957333743572,
0.025781910866498947,
-0.05303169786930084,
0.025179706513881683,
-0.058489181101322174,
0.016617100685834885,
0.05980650708079338,
-0.0698181688785553,
0.029357504099607468,
0.01051977276802063,
0.09356763958930969,
-0.0035897076595574617,
0.006247879005968571,
-0.022055765613913536,
0.01147012785077095,
-0.009254200384020805,
0.059016112238168716,
0.029075220227241516,
0.023711830377578735,
-0.01063268631696701,
-0.0010332759702578187,
0.023636555299162865,
-0.008647290989756584,
-0.02815309353172779,
0.01666414737701416,
0.035718295723199844,
0.0383153073489666,
0.009564712643623352,
-0.032330892980098724,
-0.030768923461437225,
-0.020663166418671608,
0.015252728946506977,
0.04102523252367973,
0.04245546832680702,
-0.013681350275874138,
-0.058602094650268555,
0.0009038959397003055,
-0.05393500626087189,
0.04215436428785324,
-0.026591124013066292,
-0.04907972738146782,
0.011112567968666553,
0.044977203011512756,
-0.01953403279185295,
-0.025104429572820663,
0.00565508333966136,
-0.03554892539978027,
-0.048326969146728516,
0.044638462364673615,
-0.06101091578602791,
0.07599077373743057,
0.014537610113620758,
-0.009428275749087334,
0.012806270271539688,
0.055365242063999176,
0.0004681204736698419,
0.032726090401411057,
-0.04362224042415619,
0.0006710118614137173,
-0.016748832538723946,
0.04896681383252144,
-0.003382699564099312,
0.06285516917705536,
0.013559026643633842,
-0.043095313012599945,
-0.031182939186692238,
-0.02269561029970646,
0.0386916846036911,
-0.060408711433410645,
-0.00015525602793786675,
-0.005551579408347607,
0.003018083283677697,
0.015017492696642876,
-0.012034694664180279,
0.024201123043894768,
0.004283654969185591,
0.01134780514985323,
0.0665060430765152,
0.005829158239066601,
0.048101142048835754,
0.003265081439167261,
0.04580523446202278,
0.032142702490091324,
0.006200831849128008,
-0.012467529624700546,
0.014565838500857353,
-0.0280966367572546,
0.04603106155991554,
-0.034532707184553146,
0.008769613690674305,
-0.022168679162859917,
-0.036207590252161026,
0.017303990200161934,
0.02967742644250393,
0.043057672679424286,
-0.00047664777957834303,
0.02442695014178753,
-0.008139180019497871,
-0.009602350182831287,
-0.06883958727121353,
0.06838793307542801,
0.017303990200161934,
0.014208279550075531,
-0.0353795550763607,
-0.010943197645246983,
-0.004859984386712313,
-0.04031011089682579,
-0.011997057124972343,
0.02600773796439171,
-0.022432144731283188,
0.011611269786953926,
0.012326388619840145,
0.004010780714452267,
-0.07648006081581116,
-0.04241783171892166,
-0.026760494336485863,
0.036000579595565796,
0.0008239155285991728,
-0.0022759123239666224,
-0.005415142513811588,
-0.013003868982195854,
-0.03701680153608322,
-0.039331529289484024,
0.0011109039187431335,
-0.07760919630527496,
-0.017360446974635124,
-0.0363769605755806,
-0.043132949620485306,
-0.0103598115965724,
-0.030825380235910416,
0.00285812234506011,
-0.0140483183786273,
0.003973143175244331,
-0.008078018203377724,
-0.002782846800982952,
-0.1260114461183548,
-0.04904208704829216,
0.0208137184381485,
0.03963262960314751,
-0.03312128782272339,
0.06628021597862244,
-0.01917647197842598,
0.01409536600112915,
0.023900019004940987,
0.012900364585220814,
-0.009155401028692722,
0.007315852679312229,
0.003305071732029319,
0.028905849903821945,
0.014340012334287167,
0.0103598115965724,
-0.030204355716705322,
-0.09266433119773865,
0.044676098972558975,
-0.003987257368862629,
-0.025029154494404793,
-0.010086937807500362,
0.0013337904820218682,
0.009842291474342346,
0.004340111743658781,
0.025668997317552567,
-0.06277989596128464,
0.0019759859424084425,
-0.016598282381892204,
0.02647821046411991,
-0.09040606021881104,
-0.013399066403508186,
0.05303169786930084,
0.014330602250993252,
0.013286152854561806,
0.021999308839440346,
-0.07260336726903915,
-0.003058073343709111,
0.026722857728600502,
0.06793627887964249,
0.016268949955701828,
0.010980836115777493,
0.04561704397201538,
0.03359175845980644,
-0.06477469950914383,
0.02474687062203884,
0.02602655626833439,
0.00885429885238409,
-0.003403870854526758,
0.05020885914564133,
0.05276823416352272,
-0.011959419585764408,
0.017134619876742363,
0.07956636697053909,
-0.0035285463090986013,
-0.029075220227241516,
-0.05732240900397301,
-0.011695954948663712,
-0.04362224042415619,
-0.0049070315435528755,
-0.057096581906080246,
0.023542460054159164,
0.01815084181725979,
0.05114980787038803,
-0.032801367342472076,
0.04392334446310997,
-0.07964164018630981,
0.006633666809648275,
-0.02805900014936924,
0.055289968848228455,
0.0019124720711261034,
-0.004391863942146301,
0.03186041861772537,
-0.03848467767238617,
-0.023598916828632355,
0.00915069691836834,
0.06405957788228989,
-0.027381518855690956,
-0.007640478666871786,
-0.03172868862748146,
0.010218669660389423,
0.03818357363343239,
0.02250741980969906,
0.015836115926504135,
-0.003707326017320156,
-0.013314381241798401,
-0.03688507154583931,
-0.01742631383240223,
-0.013229696080088615,
0.007654592860490084,
-0.02625238336622715,
0.010613867081701756,
0.00398960942402482,
0.01657005399465561,
0.04339641332626343,
0.02830364555120468,
0.016240721568465233,
0.013888358138501644,
0.02604537643492222,
-0.06552745401859283,
-0.09145991504192352,
0.09560007601976395,
-0.008604948408901691,
0.013370838016271591,
0.029489237815141678,
-0.044751375913619995,
-0.011592450551688671,
-0.02478450909256935,
-0.04192853718996048,
-0.01577024906873703,
-0.022338049486279488,
0.017473360523581505,
-0.05408555641770363,
0.04027247428894043,
-0.0456923209130764,
-0.10101992636919022,
-0.007828667759895325,
-0.0032180340494960546,
0.05935485288500786,
0.005339866504073143,
0.0004357754660304636,
-0.020493796095252037,
-0.01214760821312666,
-0.06274225562810898,
-0.0018348440062254667,
0.0038390583358705044,
0.001807791879400611,
0.008167408406734467,
-0.008308550342917442,
0.020663166418671608,
0.004434206523001194,
0.036075856536626816,
0.03137112781405449,
-0.025913642719388008,
-0.02442695014178753,
0.007725163828581572,
-0.04689673334360123,
0.016974659636616707,
0.037675462663173676,
0.044789012521505356,
-0.018075566738843918,
0.025010336190462112,
0.03963262960314751,
0.07064619660377502,
0.028378920629620552,
-0.025537265464663506,
-0.015177453868091106,
0.06451123207807541,
-0.020681986585259438,
-0.03630168363451958,
-0.01588316261768341,
0.056908395141363144,
0.044563185423612595,
-0.005979709792882204,
-0.025254981592297554,
0.009879929013550282,
0.018941236659884453,
0.031182939186692238,
-0.04019719734787941,
-0.03379876911640167,
0.05393500626087189,
-0.006873608101159334,
-0.014481153339147568,
-0.06477469950914383,
0.007094730157405138,
0.021510018035769463,
-0.03159695491194725,
0.046445079147815704,
-0.03383640572428703,
-0.009719968773424625,
-0.022168679162859917,
0.05815044045448303,
0.009089535102248192,
-0.04064885154366493,
-0.06684477627277374,
0.057134222239255905,
-0.020606709644198418,
0.04407389461994171,
-0.022300412878394127,
0.001191472401842475,
-0.04847751930356026,
-0.0006792451604269445,
0.013333200477063656,
-0.03729908540844917,
0.020286789163947105,
-0.06018288433551788,
0.01940229907631874,
-0.015666745603084564,
-0.003987257368862629
]
|
36,408 | torch.optim.optimizer | _optimizer_step_code | Entry point for `torch.profile.profiler`.
When python tracing is enabled the profiler will hook into this
function at the CPython level to inspect the optimizer's parameters and
param groups. It is called it after `step()` since many optimizers
lazily initialize state.
This is a workaround due to lack of a proper step hook on the optimizer,
and will be removed if it exists.
| def _optimizer_step_code(self) -> None:
"""Entry point for `torch.profile.profiler`.
When python tracing is enabled the profiler will hook into this
function at the CPython level to inspect the optimizer's parameters and
param groups. It is called it after `step()` since many optimizers
lazily initialize state.
This is a workaround due to lack of a proper step hook on the optimizer,
and will be removed if it exists.
"""
pass
| (self) -> NoneType | [
-0.03934168070554733,
-0.002208953257650137,
-0.015868764370679855,
0.07215021550655365,
-0.037770871073007584,
-0.0024410050828009844,
0.0036615075077861547,
-0.035878755152225494,
-0.05176537111401558,
-0.03716396540403366,
-0.01467280462384224,
0.012138087302446365,
0.012084536254405975,
0.030452318489551544,
-0.03134482353925705,
-0.01100460346788168,
-0.019563740119338036,
0.01751990057528019,
-0.01114740502089262,
-0.04269750416278839,
-0.00843418575823307,
0.0000678444339428097,
0.011486557312309742,
0.025418581441044807,
-0.04773124307394028,
0.03329048678278923,
0.027346394956111908,
-0.052015271037817,
-0.012271963059902191,
0.0008556905086152256,
-0.05023026093840599,
-0.038270674645900726,
-0.028738705441355705,
-0.032451532781124115,
0.01569918729364872,
-0.029060008004307747,
-0.02590053528547287,
-0.004391131456941366,
-0.08903643488883972,
0.001266243401914835,
-0.04680303484201431,
-0.03653921186923981,
0.004022972658276558,
0.02247331105172634,
-0.013708897866308689,
0.0063769579865038395,
0.014530004002153873,
-0.03205883130431175,
0.040091387927532196,
-0.09075005352497101,
0.013744598254561424,
-0.04141229763627052,
0.0716504156589508,
0.02572203427553177,
0.04226910322904587,
-0.024758126586675644,
0.05726321041584015,
-0.09924671053886414,
0.008068257942795753,
0.007764805573970079,
0.030309516936540604,
-0.04441111907362938,
-0.016984397545456886,
0.05729890987277031,
0.03293348476290703,
-0.050694361329078674,
-0.04680303484201431,
0.021884256973862648,
-0.02202705852687359,
0.010147797875106335,
-0.023008814081549644,
-0.048802249133586884,
0.025382881984114647,
-0.0076666297391057014,
-0.03643210977315903,
-0.05401448532938957,
-0.04601762816309929,
-0.014190851710736752,
0.05172967165708542,
-0.021812856197357178,
0.012334438040852547,
-0.002295972779393196,
-0.039662983268499374,
-0.011629357933998108,
-0.014628179371356964,
-0.04234050214290619,
0.029309909790754318,
-0.04830244556069374,
-0.041947800666093826,
-0.0004166889120824635,
-0.019456639885902405,
0.01491378154605627,
0.0062341573648154736,
0.059012521058321,
0.0005262998747639358,
0.02948841080069542,
-0.030559418722987175,
0.0167255699634552,
-0.04819534346461296,
0.017073648050427437,
0.05422868952155113,
0.0019813640974462032,
0.05172967165708542,
0.011772159487009048,
0.06379635632038116,
-0.017037946730852127,
0.019635140895843506,
0.00557816494256258,
0.02200920693576336,
0.003500856226310134,
-0.007015100214630365,
-0.03628930822014809,
-0.05062296241521835,
-0.03480774909257889,
0.02015279419720173,
-0.015440360642969608,
0.00004737953713629395,
-0.04201919957995415,
-0.006640247534960508,
0.06990110129117966,
-0.021705755963921547,
-0.022866014391183853,
-0.06165434047579765,
-0.020795399323105812,
-0.06415335834026337,
-0.02193780615925789,
0.07454213500022888,
0.041626498103141785,
-0.01760915108025074,
-0.07982577383518219,
0.04823104664683342,
-0.06261824816465378,
-0.02427617460489273,
0.005417513661086559,
0.02208060771226883,
0.002476705238223076,
0.039805784821510315,
0.008951839059591293,
-0.009701544418931007,
0.01836778223514557,
-0.012950267642736435,
-0.00391587195917964,
-0.021188100799918175,
-0.01874263398349285,
0.0766841471195221,
0.010388774797320366,
-0.0169040709733963,
0.04619612917304039,
0.024829527363181114,
-0.03887757658958435,
0.028917206451296806,
-0.0221520084887743,
0.04212630167603493,
-0.02941701002418995,
0.024883078411221504,
-0.009969295933842659,
-0.03491485118865967,
-0.011718609370291233,
-0.015886614099144936,
-0.02970261313021183,
-0.0009756210492923856,
-0.01395879965275526,
-0.01868908293545246,
-0.050872866064310074,
0.006644709967076778,
0.007885294035077095,
-0.0017448499565944076,
0.04244760423898697,
-0.06361785531044006,
0.012334438040852547,
-0.0092374412342906,
-0.06508156657218933,
0.03844917565584183,
0.05158687010407448,
0.024954479187726974,
0.10181713104248047,
0.030630819499492645,
0.030238116160035133,
-0.029256358742713928,
0.01831423118710518,
0.005337188020348549,
0.04216200113296509,
-0.03927028179168701,
0.0012026523472741246,
-0.014556779526174068,
-0.060333430767059326,
0.05961942672729492,
-0.06961549818515778,
0.04298310726881027,
0.030969971790909767,
0.018956836313009262,
0.02438327483832836,
0.02241976000368595,
-0.04219770058989525,
0.008166433311998844,
0.01106707938015461,
0.008344934321939945,
0.0025079429615288973,
0.08211059123277664,
0.02024204470217228,
-0.014056975953280926,
0.048945050686597824,
0.03530755266547203,
0.0365927629172802,
-0.01776980236172676,
0.08268178999423981,
-0.02406197227537632,
0.07996857166290283,
-0.016627393662929535,
0.04626753181219101,
0.022758912295103073,
-0.0441255159676075,
0.041947800666093826,
0.07018670439720154,
0.012057761661708355,
-0.018144654110074043,
0.01609189063310623,
0.04776694253087044,
0.012744991108775139,
0.0481596440076828,
0.030202416703104973,
-0.017243223264813423,
-0.03634285926818848,
-0.05594230070710182,
0.05733460932970047,
-0.034397196024656296,
0.013548246584832668,
-0.05426438897848129,
-0.018885435536503792,
-0.059940729290246964,
-0.03139837458729744,
-0.0319695770740509,
-0.04876654967665672,
0.013521471992135048,
0.04862374812364578,
0.06668807566165924,
-0.02231265977025032,
0.007671092636883259,
-0.03844917565584183,
-0.05440719053149223,
-0.033879540860652924,
0.02227696031332016,
-0.012628965079784393,
-0.010245973244309425,
-0.06418906152248383,
0.017814427614212036,
0.02229481004178524,
-0.0016433274140581489,
0.015502835623919964,
0.052622176706790924,
-0.0037105954252183437,
-0.02206275798380375,
-0.030934272333979607,
0.00940701737999916,
-0.06461746245622635,
-0.003545481711626053,
0.10424474626779556,
0.028381703421473503,
0.005529077257961035,
-0.002371835755184293,
-0.0439470149576664,
-0.05790581554174423,
-0.05776301398873329,
0.002172137377783656,
-0.014039125293493271,
0.006399270612746477,
0.03639641031622887,
-0.025436433032155037,
-0.004308574832975864,
-0.005417513661086559,
0.13494697213172913,
0.056156501173973083,
-0.0406268909573555,
0.026471739634871483,
-0.009594443254172802,
-0.006260932423174381,
-0.04248330369591713,
0.058334216475486755,
-0.03666416183114052,
-0.012173786759376526,
0.11588302999734879,
0.0001592566113686189,
-0.07011530548334122,
-0.02570418454706669,
-0.11017099022865295,
-0.02798900008201599,
0.0005533539806492627,
0.026739491149783134,
-0.000349193112924695,
-0.011013529263436794,
0.015235084109008312,
0.05383598431944847,
0.0656527727842331,
-0.004239405505359173,
0.08118238300085068,
-0.006720573175698519,
-0.0345756970345974,
0.03719966486096382,
-0.02754274755716324,
0.025061579421162605,
0.012441539205610752,
-0.019831491634249687,
0.01771625131368637,
0.006278782617300749,
0.0365927629172802,
0.05597800016403198,
0.021384453400969505,
-0.007822818122804165,
0.003366980468854308,
-0.028524504974484444,
-0.0182963814586401,
0.04305450990796089,
0.030291667208075523,
0.03471849858760834,
0.0038511650636792183,
-0.0994609147310257,
-0.032522931694984436,
-0.008130732923746109,
-0.007755880709737539,
0.05408588796854019,
-0.048802249133586884,
0.02777479961514473,
0.054657090455293655,
0.0007764805341139436,
-0.008170896209776402,
-0.03386169299483299,
0.06718788295984268,
-0.005743278656154871,
-0.008987539447844028,
-0.09267786145210266,
-0.045339323580265045,
-0.03741386905312538,
0.006550997029989958,
0.050837162882089615,
0.009219590574502945,
0.012075611390173435,
-0.009674768894910812,
0.012655740603804588,
-0.03116632252931595,
-0.0006615703459829092,
0.07161471247673035,
-0.003485237481072545,
-0.013512547127902508,
0.034075893461704254,
0.07589874416589737,
-0.028560204431414604,
0.01212916150689125,
-0.005694190971553326,
0.04623183235526085,
0.028310302644968033,
-0.02054549753665924,
-0.045339323580265045,
-0.024686727672815323,
0.026293238624930382,
0.03691406548023224,
0.0005159802385605872,
-0.009134802967309952,
-0.043554313480854034,
-0.005810216534882784,
0.0013454534346237779,
0.03559315577149391,
0.042054902762174606,
0.01114740502089262,
0.05030165985226631,
0.05012315884232521,
-0.04994465783238411,
-0.015833063051104546,
-0.05612080171704292,
0.03168397769331932,
-0.014440753497183323,
-0.019420938566327095,
-0.05583519861102104,
0.04030558839440346,
0.036271460354328156,
-0.028238901868462563,
-0.017439574003219604,
0.017975078895688057,
0.03859197720885277,
0.004179161041975021,
0.08982184529304504,
0.03902037814259529,
0.036092959344387054,
-0.0015284172259271145,
-0.00217660004273057,
0.00012906479241792113,
0.008572523482143879,
-0.008041482418775558,
0.017867978662252426,
-0.0008216637070290744,
-0.07932596653699875,
-0.02211630903184414,
-0.011459781788289547,
-0.02973831258714199,
-0.02036699652671814,
-0.0002687280939426273,
0.007309627253562212,
-0.03132697567343712,
0.012762841768562794,
-0.1036735400557518,
-0.04398271441459656,
0.0015786206349730492,
-0.03577165678143501,
0.027150044217705727,
0.013485771603882313,
0.0016678713727742434,
-0.05212237313389778,
-0.0006102512707002461,
0.047481339424848557,
0.032451532781124115,
0.010361999273300171,
-0.026935843750834465,
-0.02429402433335781,
-0.009282066486775875,
0.020795399323105812,
-0.012155937030911446,
-0.030488017946481705,
0.04298310726881027,
0.012673590332269669,
0.01289671752601862,
0.03552175313234329,
0.05180107057094574,
0.025400731712579727,
-0.01668986864387989,
0.029988214373588562,
-0.0078005059622228146,
-0.03580735623836517,
-0.025293631479144096,
-0.012263038195669651,
-0.014271177351474762,
-0.006876761559396982,
-0.02222340926527977,
0.0035142439883202314,
0.016190065070986748,
0.021670054644346237,
0.00871532503515482,
0.007363177835941315,
-0.01010317262262106,
0.032433681190013885,
0.03539680317044258,
0.025382881984114647,
0.01840348169207573,
-0.02400842122733593,
-0.020956050604581833,
-0.02618613839149475,
0.012530789710581303,
0.02063474804162979,
-0.015047657303512096,
-0.002069499110803008,
-0.027435647323727608,
0.0028225514106452465,
0.06897289305925369,
0.009835420176386833,
0.007099888287484646,
-0.029167108237743378,
0.0015462673036381602,
-0.003369211684912443,
-0.047374241054058075,
0.0072203767485916615,
-0.019063936546444893,
0.010674376040697098,
-0.012334438040852547,
0.03361178934574127,
0.011665058322250843,
-0.0158955380320549,
0.050837162882089615,
0.0591910220682621,
0.005212237127125263,
0.06365355849266052,
-0.021598653867840767,
-0.00195793597958982,
0.009817570447921753,
-0.01751990057528019,
-0.0316125750541687,
-0.024454675614833832,
0.03389739245176315,
0.024775978177785873,
-0.025525683537125587,
0.016770195215940475,
0.010442324914038181,
-0.0057611288502812386,
0.026757340878248215,
-0.011316981166601181,
0.056477803736925125,
0.03405804559588432,
0.03280853480100632,
0.027257144451141357,
-0.02063474804162979,
-0.0038913278840482235,
0.04837384819984436,
0.04023418948054314,
0.004371050279587507,
-0.03548605367541313,
0.04309020936489105,
-0.04241190478205681,
-0.008327084593474865,
0.02027774602174759,
0.04823104664683342,
-0.013414370827376842,
0.06665237993001938,
0.02220555953681469,
-0.009371316991746426,
-0.025115130469202995,
0.01591338962316513,
-0.04783834144473076,
0.026239687576889992,
0.0446610189974308,
-0.013432221487164497,
0.05401448532938957,
-0.07332832366228104,
0.08453820645809174,
0.05422868952155113,
0.01305736880749464,
-0.023223016411066055,
-0.024543926119804382,
0.022937415167689323,
0.0008478810777887702,
-0.011665058322250843,
0.05869121849536896,
-0.010165647603571415,
-0.021598653867840767,
0.009862195700407028,
-0.011718609370291233,
0.02443682588636875,
-0.02957766130566597,
0.01863553375005722,
0.03150547668337822,
-0.0258291345089674,
0.03859197720885277,
0.022758912295103073,
0.00038126757135614753,
0.020884649828076363,
0.00940701737999916,
0.010406624525785446,
0.048695147037506104,
0.032576482743024826,
-0.000655434385407716,
0.0011993054067716002,
-0.03570025414228439,
0.031041372567415237,
-0.026810891926288605,
0.032737135887145996,
-0.0053550382144749165,
0.0015116827562451363,
0.005230087321251631,
-0.021241651847958565,
0.004404519218951464,
-0.04433971643447876,
0.054657090455293655,
-0.09710469841957092,
-0.03719966486096382,
-0.0011580270947888494,
0.007354252506047487,
-0.028078250586986542,
0.009728319942951202,
0.02797115035355091,
0.0010269401827827096,
0.0369497649371624,
0.03284423425793648,
0.003429455915465951,
0.028774406760931015,
-0.023401517421007156,
-0.0240798220038414,
-0.0409838929772377,
-0.03862767666578293,
0.024561775848269463,
0.005903929937630892,
0.004823997151106596,
0.05501409247517586,
-0.045267924666404724,
-0.049087852239608765,
0.054799892008304596,
-0.037663768976926804,
-0.016466742381453514,
0.009371316991746426,
-0.08610901981592178,
0.0367712639272213,
0.02018849365413189,
0.05172967165708542,
0.028149651363492012,
-0.009772945195436478,
-0.00017152857617475092,
0.01385169941931963,
-0.000401627883547917,
0.026632390916347504,
-0.03191602975130081,
-0.0038935591001063585,
-0.030434468761086464,
0.0067785861901938915,
0.018073255196213722,
-0.01886758580803871,
-0.054906994104385376,
-0.016368567943572998,
-0.0635821521282196,
-0.07911176979541779,
0.026810891926288605,
0.004904322791844606,
-0.0351112000644207,
0.030969971790909767,
0.030577268451452255,
0.03571810573339462,
-0.07157900929450989,
-0.009433792904019356,
0.04944485425949097,
0.0022937413305044174,
-0.002080655423924327,
-0.04076969251036644,
-0.03662846237421036,
0.03759237006306648,
-0.03877047821879387,
0.020991750061511993,
-0.043482910841703415,
0.0037396016996353865,
0.04269750416278839,
-0.007135588675737381,
-0.028578054159879684,
-0.03662846237421036,
0.028488803654909134,
-0.01827853173017502,
0.0851094126701355,
0.03680696338415146,
-0.03591445833444595,
0.011870334856212139,
-0.0019456639420241117,
0.028381703421473503,
0.00004581068060360849,
-0.025311481207609177,
0.06679517775774002,
-0.09467707574367523,
0.007180213928222656,
-0.04241190478205681,
-0.05440719053149223,
0.019581589847803116,
0.013708897866308689,
-0.08025417476892471,
0.03502194955945015,
-0.030202416703104973,
0.010576200671494007,
0.019563740119338036,
-0.03280853480100632,
-0.08396700024604797,
-0.003009977750480175,
0.050872866064310074,
-0.017814427614212036,
-0.01881403475999832,
-0.01394094992429018,
-0.016154365614056587,
-0.04969475418329239,
-0.014940557070076466,
0.10046052187681198,
0.01600264012813568,
-0.005310412961989641,
0.037842269986867905,
-0.04480382055044174,
0.08239618688821793,
0.0024967866484075785,
0.04069828987121582,
-0.007282852195203304,
0.015324334613978863,
0.03859197720885277,
-0.06526006758213043,
0.005778979044407606,
-0.0034116057213395834,
-0.001287440420128405,
-0.013815999031066895,
0.004556245170533657,
0.015761662274599075,
-0.04291170835494995,
0.016359642148017883,
0.03482560068368912,
-0.04212630167603493,
-0.04469671845436096,
-0.00513191195204854,
-0.02191995643079281,
-0.010138873010873795,
-0.009862195700407028,
0.0015306484419852495,
0.016270391643047333,
-0.0628681480884552,
-0.05019455775618553,
-0.019063936546444893,
-0.0409838929772377,
-0.029113559052348137,
0.004806146956980228,
-0.011424081400036812,
-0.015154758468270302,
0.0781121626496315,
-0.025382881984114647,
-0.009719394147396088,
0.01012994721531868,
-0.004453606903553009,
-0.05940522626042366,
-0.03277283534407616,
0.017136123031377792,
0.03487914800643921,
0.043447211384773254,
-0.05040876194834709,
-0.029970364645123482,
-0.0791831687092781,
0.050837162882089615,
-0.023205166682600975,
0.01609189063310623,
-0.019474489614367485,
-0.0258291345089674,
-0.03859197720885277,
-0.030630819499492645,
0.017368175089359283,
-0.0027578447479754686,
-0.036200057715177536,
0.021009599789977074,
-0.02052764780819416,
0.025525683537125587,
-0.031023522838950157,
-0.01775195263326168,
-0.013610722497105598,
0.017582375556230545,
-0.00009775734361028299,
-0.09324906766414642,
-0.0029229584615677595,
-0.0024410050828009844,
0.0020427240524441004,
0.0026038873475044966,
0.027524897828698158,
-0.017421724274754524,
-0.010611901059746742,
0.0018452570075169206,
0.03366534039378166,
0.014476453885436058,
-0.05347898229956627,
0.023704970255494118,
-0.0060288808308541775,
-0.019313838332891464,
-0.05362178385257721,
-0.016716644167900085,
-0.01845703274011612,
-0.00820213370025158,
0.01377137377858162,
-0.005881617311388254,
0.010335223749279976,
0.019885042682290077,
-0.028488803654909134,
0.02034914493560791,
0.0345756970345974,
-0.0041166855953633785,
-0.0022892788983881474,
0.04862374812364578,
0.01656491868197918,
0.030166715383529663,
-0.030559418722987175,
0.043518610298633575,
-0.027453497052192688,
0.06650957465171814,
0.043590012937784195,
0.02768554911017418,
0.025204380974173546,
0.011843560263514519,
-0.060154929757118225,
0.04091249406337738,
0.009549818001687527,
-0.004998035728931427,
-0.08246759325265884,
-0.03698546439409256,
-0.03188032656908035,
0.0295062605291605,
-0.0219735074788332,
0.06279674917459488,
-0.012218412943184376,
0.04030558839440346,
0.012280887924134731
]
|
36,409 | torch.optim.optimizer | _patch_step_function | null | def _patch_step_function(self) -> None:
self._zero_grad_profile_name = f"Optimizer.zero_grad#{self.__class__.__name__}.zero_grad"
hooked = getattr(self.__class__.step, "hooked", None)
if not hooked:
self.__class__.step = self.profile_hook_step(self.__class__.step) # type: ignore[assignment]
self.__class__.step.hooked = True # type: ignore[attr-defined]
| (self) -> NoneType | [
-0.024173017591238022,
0.021742019802331924,
-0.024686608463525772,
0.08354414254426956,
-0.06577388942241669,
-0.022666484117507935,
-0.05759067460894585,
0.05851513892412186,
0.009201839566230774,
-0.020269725471735,
-0.011598597280681133,
0.009338797070086002,
0.023967580869793892,
0.0022812001407146454,
-0.03427364304661751,
0.01264289952814579,
0.006954878568649292,
0.05536511540412903,
-0.013216408900916576,
-0.01607539877295494,
0.016160998493433,
-0.013781359419226646,
0.027905112132430077,
0.03646496310830116,
-0.030764102935791016,
0.013481765054166317,
0.03793725743889809,
0.009013522416353226,
0.042628057301044464,
0.001565382699482143,
-0.04204598441720009,
-0.03937531262636185,
-0.030678505077958107,
0.00719027454033494,
0.06806793063879013,
-0.06909511238336563,
-0.004874834790825844,
0.02600482665002346,
-0.08320175111293793,
0.011444520205259323,
0.013593043200671673,
-0.003922551404684782,
-0.02109147235751152,
0.008876564912497997,
-0.020047171041369438,
-0.002788371406495571,
-0.027271684259176254,
0.031585849821567535,
0.024173017591238022,
-0.030524427071213722,
-0.01084533054381609,
-0.056358058005571365,
0.056974366307258606,
0.051222145557403564,
0.02127978950738907,
0.02427573688328266,
0.06762281805276871,
-0.09326813369989395,
-0.02220425195991993,
0.01973901502788067,
0.02107435278594494,
-0.029308928176760674,
0.015056776814162731,
-0.029154852032661438,
0.024892045184969902,
-0.047558531165122986,
-0.0035566180013120174,
0.015382051467895508,
0.042319901287555695,
0.03028475120663643,
-0.04392915219068527,
-0.014269270934164524,
0.020954513922333717,
-0.008183217607438564,
0.019122706726193428,
-0.0009918727446347475,
-0.018763191998004913,
-0.057898830622434616,
0.03817693516612053,
-0.04677102342247963,
0.010793971829116344,
0.010374538600444794,
-0.04122424125671387,
0.02785375341773033,
-0.027785275131464005,
-0.02775103598833084,
0.07628539204597473,
-0.04029977694153786,
-0.020954513922333717,
-0.01956781931221485,
0.0017740289913490415,
0.018181122839450836,
-0.01222346629947424,
-0.024498293176293373,
0.04471665993332863,
-0.016400674358010292,
-0.03223639726638794,
-0.01956781931221485,
-0.03564321622252464,
0.017684651538729668,
0.04523025080561638,
-0.01915694586932659,
0.009706870652735233,
0.03862204775214195,
0.08539307117462158,
-0.05560478940606117,
0.018352320417761803,
-0.029377406463027,
0.004703637678176165,
-0.015844283625483513,
0.010631334036588669,
-0.026158902794122696,
-0.02098875306546688,
-0.0055425032041966915,
0.01792432740330696,
0.0017301598563790321,
0.024173017591238022,
-0.0225124079734087,
0.03591713309288025,
0.02680945210158825,
0.004780676681548357,
-0.004425442777574062,
-0.07779192179441452,
-0.015356372110545635,
-0.005846377927809954,
-0.02660401538014412,
0.036601919680833817,
0.10627910494804382,
0.051222145557403564,
-0.09217247366905212,
0.013293447904288769,
0.0028611300513148308,
-0.03560897707939148,
-0.003047306789085269,
0.010425898246467113,
-0.002555115381255746,
-0.0006981628248468041,
0.014354869723320007,
0.0146887032315135,
0.01915694586932659,
-0.02047516219317913,
-0.07299840450286865,
0.00324846338480711,
-0.023094477131962776,
0.03389700874686241,
0.08737895637750626,
-0.019311023876070976,
0.0964866355061531,
-0.0029189090710133314,
-0.01922542415559292,
0.009150479920208454,
0.01685434579849243,
-0.007040477357804775,
-0.00008954406075645238,
-0.02978827990591526,
0.02621026337146759,
-0.04444274306297302,
0.04101880267262459,
-0.0038968720473349094,
-0.013678641058504581,
0.0022255610674619675,
-0.027168964967131615,
0.0044168829917907715,
-0.03328070044517517,
0.018472157418727875,
0.005944816395640373,
0.005367026198655367,
0.0010261121205985546,
-0.033400535583496094,
0.030746983364224434,
-0.009835268370807171,
-0.05036615952849388,
0.09183007478713989,
0.09278877824544907,
0.08840613812208176,
0.13866958022117615,
0.047147657722234726,
0.018489276990294456,
-0.01770177111029625,
0.034222282469272614,
0.04269653558731079,
0.011898192577064037,
-0.045093294233083725,
-0.0026064745616167784,
0.013747120276093483,
0.0039268312975764275,
-0.016357874497771263,
-0.05947384238243103,
-0.00020490142924245447,
0.027716796845197678,
0.017008423805236816,
0.018403679132461548,
0.047935161739587784,
-0.010323179885745049,
0.05954232066869736,
0.008191777393221855,
0.027305923402309418,
-0.005551062989979982,
0.06241843104362488,
0.017872968688607216,
0.006068934220820665,
-0.009278877638280392,
0.014902699738740921,
0.026330100372433662,
-0.05026344209909439,
0.04584655910730362,
0.03317797929048538,
0.055125437676906586,
-0.06087765842676163,
0.007819423452019691,
0.0010715862736105919,
-0.025508355349302292,
0.019311023876070976,
0.06704074889421463,
0.002360378857702017,
-0.057077083736658096,
0.06864999979734421,
0.05786459147930145,
-0.02292327955365181,
0.04033401608467102,
-0.015150935389101505,
-0.04995528981089592,
-0.026877930387854576,
-0.05495424196124077,
0.0237279050052166,
-0.006214451510459185,
0.02793935313820839,
-0.07566908001899719,
-0.008739607408642769,
-0.04574384167790413,
0.014286390505731106,
-0.013601602986454964,
-0.04865419119596481,
-0.014705823734402657,
0.06152820587158203,
0.04286773130297661,
-0.0003049446677323431,
-0.023710785433650017,
0.025713792070746422,
-0.01955069787800312,
-0.012574420310556889,
-0.02365942671895027,
0.03793725743889809,
0.05447489023208618,
0.00962127186357975,
0.03488995134830475,
0.010271821171045303,
0.00032982174889184535,
-0.008054818958044052,
0.033417657017707825,
0.022341210395097733,
-0.003830533241853118,
-0.018369439989328384,
0.038348130881786346,
-0.028196148574352264,
-0.0004726642509922385,
0.10758019983768463,
0.013832718133926392,
0.007691025733947754,
0.014697263948619366,
-0.04300468787550926,
-0.051016710698604584,
-0.019379502162337303,
-0.02139962650835514,
-0.027699677273631096,
0.0009902677265927196,
0.032886944711208344,
0.00762254698202014,
-0.0020062150433659554,
0.05355042591691017,
0.027819514274597168,
-0.036601919680833817,
-0.03509538620710373,
0.002195601584389806,
0.03326357901096344,
0.025748031213879585,
-0.014277830719947815,
0.044887855648994446,
0.01771889068186283,
-0.003719255095347762,
0.12743905186653137,
-0.03735518828034401,
-0.009364476427435875,
0.015630288049578667,
-0.09587032347917557,
0.002463096985593438,
0.018044164404273033,
0.08190064877271652,
0.027665436267852783,
-0.036430723965168,
0.009604152292013168,
0.08374957740306854,
0.09758229553699493,
0.048859626054763794,
0.06495214998722076,
0.03377716988325119,
-0.05211237072944641,
0.03971770778298378,
0.024121658876538277,
0.015493329614400864,
0.031089376658201218,
-0.04321012645959854,
-0.08436588943004608,
0.013438965193927288,
0.004196466878056526,
-0.0395122691988945,
0.018249601125717163,
-0.009535674005746841,
0.007840823382139206,
-0.027494240552186966,
-0.03591713309288025,
0.017667531967163086,
-0.02847006358206272,
0.004583800211548805,
0.020132768899202347,
-0.04523025080561638,
-0.020235486328601837,
-0.023471109569072723,
0.006629604380577803,
0.06604781001806259,
-0.031996723264455795,
0.031363293528556824,
0.000629684014711529,
0.0460519976913929,
-0.003892592154443264,
-0.022700723260641098,
0.07032772898674011,
-0.009544233791530132,
-0.024909164756536484,
-0.03050730749964714,
-0.06998533755540848,
-0.03612256795167923,
0.04584655910730362,
0.005110230762511492,
-0.007310112472623587,
-0.006685243453830481,
0.03345189616084099,
-0.03151737153530121,
-0.013798478990793228,
-0.0038669125642627478,
-0.008251695893704891,
0.02824750728905201,
-0.03766334429383278,
0.013053772039711475,
0.07614842802286148,
0.024806447327136993,
0.010468697175383568,
0.015818603336811066,
0.0779973566532135,
-0.004172927234321833,
-0.003004507627338171,
-0.05351618677377701,
-0.04906506463885307,
0.04677102342247963,
0.031876884400844574,
-0.027100486680865288,
-0.003413240425288677,
-0.014971178956329823,
0.023419750854372978,
-0.052557483315467834,
-0.033914126455783844,
0.006051814183592796,
-0.027288803830742836,
0.06169940158724785,
0.09333661198616028,
-0.013319127261638641,
-0.029428767040371895,
0.010973728261888027,
-0.03328070044517517,
-0.025765150785446167,
-0.006984838284552097,
-0.03827965259552002,
0.015570368617773056,
-0.026586895808577538,
-0.04838027432560921,
-0.032185036689043045,
0.04235414043068886,
0.02609042450785637,
0.04300468787550926,
0.026843691244721413,
0.04002586007118225,
-0.02158794365823269,
-0.047421570867300034,
0.0047592767514288425,
0.002865409944206476,
0.023967580869793892,
0.009424395859241486,
-0.005016072653234005,
0.08854309469461441,
-0.07683321833610535,
0.050811272114515305,
-0.02160506322979927,
-0.008859445340931416,
-0.018574876710772514,
0.026775212958455086,
-0.003122205613180995,
-0.019584938883781433,
-0.008859445340931416,
-0.017650412395596504,
0.0050417520105838776,
-0.03622528910636902,
-0.032613031566143036,
0.023111596703529358,
0.03831389173865318,
-0.0037363748997449875,
-0.027819514274597168,
-0.010297500528395176,
0.024515412747859955,
0.029651323333382607,
0.020098529756069183,
-0.02826462686061859,
0.014115193858742714,
-0.06817065179347992,
0.003588717430830002,
0.05238628387451172,
-0.006021854933351278,
-0.01402103528380394,
-0.012446022592484951,
-0.011324682272970676,
0.042730774730443954,
0.003939671441912651,
0.05714556202292442,
-0.0070533170364797115,
0.07347775995731354,
-0.01726521924138069,
-0.005435504950582981,
-0.025662431493401527,
0.014072393998503685,
-0.0316200889647007,
0.04495633393526077,
-0.0036529162898659706,
0.022906159982085228,
-0.00418362719938159,
0.04279925301671028,
-0.01679442636668682,
0.0010325319599360228,
0.0005943746073171496,
0.016537630930542946,
-0.01712826080620289,
0.03018203377723694,
0.01595556177198887,
-0.024823566898703575,
0.00852989125996828,
0.0038947321008890867,
0.015578928403556347,
0.012557300738990307,
-0.007840823382139206,
-0.062384191900491714,
-0.0718342661857605,
0.011230523698031902,
-0.005469744559377432,
0.0032570231705904007,
-0.02588498778641224,
0.01640923321247101,
-0.03595137223601341,
-0.025542594492435455,
-0.08306478708982468,
-0.0309181809425354,
0.00880808662623167,
-0.00008064984285738319,
-0.04861995205283165,
0.06026135012507439,
-0.06098037585616112,
-0.0065910848788917065,
-0.01811264455318451,
0.009107680991292,
0.010160543024539948,
0.014782861806452274,
-0.06943751126527786,
-0.003826253116130829,
0.03519810736179352,
-0.04228566214442253,
-0.001519373501650989,
-0.055844467133283615,
-0.007014797534793615,
-0.006086053792387247,
-0.08648873120546341,
0.013618722558021545,
0.008979283273220062,
0.010759731754660606,
-0.02466948889195919,
-0.02936028689146042,
0.041395436972379684,
0.022375449538230896,
0.04677102342247963,
0.039546508342027664,
-0.040984563529491425,
-0.00852133147418499,
0.049167782068252563,
0.058994490653276443,
-0.03350325673818588,
-0.02977116033434868,
-0.016802987083792686,
-0.01034029945731163,
-0.028093429282307625,
-0.0076867458410561085,
0.05033192038536072,
0.012206346727907658,
0.058583617210388184,
0.008221736177802086,
-0.024378454312682152,
-0.009741109795868397,
-0.03336629644036293,
0.011281883344054222,
0.019807495176792145,
-0.03430788218975067,
-0.04444274306297302,
0.04266229644417763,
-0.03273287042975426,
0.029942357912659645,
0.043655239045619965,
0.014132313430309296,
-0.01843791827559471,
0.01372144091874361,
0.043757956475019455,
-0.02150234393775463,
-0.014346309937536716,
0.011333242058753967,
-0.007913582026958466,
-0.021142831072211266,
-0.02222137153148651,
0.00023753585992380977,
-0.013747120276093483,
-0.04471665993332863,
0.016845785081386566,
0.008097618818283081,
0.013567362911999226,
0.024498293176293373,
0.045093294233083725,
-0.026689615100622177,
0.020937394350767136,
0.024926284328103065,
0.013832718133926392,
0.08107890188694,
0.013610162772238255,
0.061048854142427444,
0.007040477357804775,
-0.0923779085278511,
-0.04920202121138573,
-0.029805399477481842,
0.012728498317301273,
-0.028538541868329048,
-0.014714383520185947,
0.002187041798606515,
-0.04187478870153427,
-0.03584865480661392,
-0.03543778136372566,
0.03910139575600624,
-0.06122004985809326,
-0.054920002818107605,
-0.04516177251935005,
0.0029103492852300406,
-0.006805081386119127,
-0.0002677628363016993,
0.027460001409053802,
-0.001022367156110704,
0.010879569686949253,
0.03752638399600983,
-0.00048336407053284347,
0.03009643405675888,
-0.07539516687393188,
-0.01831807941198349,
0.031979601830244064,
-0.023385511711239815,
-0.005897737108170986,
-0.009929426945745945,
0.00024984063929878175,
0.015638846904039383,
-0.0632401779294014,
-0.011033647693693638,
0.04964713379740715,
0.005850657820701599,
-0.047250375151634216,
-0.004282065201550722,
-0.03978618606925011,
0.012505942024290562,
0.04481937736272812,
-0.005375585984438658,
-0.011649956926703453,
-0.04125848039984703,
-0.04197750613093376,
0.007892182096838951,
-0.02240968868136406,
-0.0164862722158432,
-0.03910139575600624,
-0.022238491103053093,
-0.01642635278403759,
0.06399344652891159,
-0.020303966477513313,
-0.05036615952849388,
-0.08498219400644302,
0.005739379674196243,
-0.053379230201244354,
-0.11511287093162537,
-0.03519810736179352,
0.030541546642780304,
-0.030764102935791016,
-0.004498201422393322,
0.04095032438635826,
0.005503984168171883,
-0.05067431554198265,
0.004699357785284519,
0.0291890911757946,
0.01895150914788246,
-0.005876337643712759,
-0.03504402935504913,
-0.034564677625894547,
0.03889596089720726,
-0.02263224497437477,
-0.03276710957288742,
-0.04023129865527153,
0.018283840268850327,
0.056049901992082596,
0.007310112472623587,
-0.008298775181174278,
-0.03975194692611694,
0.016443472355604172,
-0.015938442200422287,
0.05228356644511223,
0.023573828861117363,
-0.028504302725195885,
-0.029017893597483635,
-0.03122633509337902,
0.00962127186357975,
0.014072393998503685,
-0.018797431141138077,
0.05334498733282089,
-0.05447489023208618,
0.02925756946206093,
0.013789919205009937,
-0.0391356386244297,
0.017941446974873543,
0.007001957856118679,
-0.07368319481611252,
0.04855147376656532,
-0.039443790912628174,
-0.03930683434009552,
0.015142375603318214,
-0.01582716405391693,
-0.07635387033224106,
-0.03204808011651039,
0.013199289329349995,
0.01943086087703705,
-0.011795474216341972,
-0.06070645898580551,
-0.004207166377454996,
0.0014369848649948835,
-0.0017365796957165003,
0.06960870325565338,
-0.0006334289209917188,
-0.02804207056760788,
0.0077338251285254955,
-0.03855356574058533,
0.05293411761522293,
0.014200791716575623,
-0.004643719177693129,
0.01408095471560955,
-0.006993398070335388,
0.033948369324207306,
-0.050297681242227554,
-0.031363293528556824,
-0.001000967575237155,
0.011855392716825008,
0.03285270556807518,
0.029291808605194092,
0.030027955770492554,
0.014825661666691303,
0.012771297246217728,
-0.001117060543037951,
-0.05601566284894943,
-0.04831179603934288,
-0.004376223776489496,
-0.028692619875073433,
-0.018164003267884254,
-0.000128799001686275,
-0.07539516687393188,
0.048585712909698486,
0.01177835464477539,
-0.016306515783071518,
-0.03050730749964714,
-0.026227382943034172,
0.001190889161080122,
-0.05930264666676521,
0.0026193142402917147,
0.0032527432776987553,
0.047044940292835236,
-0.009895186871290207,
0.005799298640340567,
-0.001602831995114684,
0.022067295387387276,
-0.02864125929772854,
-0.03992314264178276,
0.04615471512079239,
0.04214870557188988,
0.00028942993958480656,
-0.07498428970575333,
-0.06409616023302078,
-0.05176997557282448,
0.04290197044610977,
-0.05998743325471878,
0.04752429202198982,
0.03295542299747467,
-0.01913982629776001,
0.010913809761404991,
0.02364230714738369,
0.007746664807200432,
-0.018198242411017418,
-0.03653344139456749,
-0.018609115853905678,
-0.009082001633942127,
0.01792432740330696,
-0.04033401608467102,
-0.015390611253678799,
-0.024583891034126282,
0.03324646130204201,
-0.034239403903484344,
-0.07429950684309006,
-0.07464189827442169,
-0.022974638268351555,
0.015621727332472801,
-0.006107453256845474,
0.010716932825744152,
-0.008178937248885632,
-0.0017151801148429513,
0.010913809761404991,
0.006389928516000509,
0.0037877338472753763,
-0.03417092189192772,
-0.003721395041793585,
0.017650412395596504,
-0.00527286808937788,
-0.0017162500880658627,
0.00629149004817009,
0.017753129824995995,
0.05618685856461525,
-0.0109994076192379,
0.019002867862582207,
0.06419888138771057,
-0.0006617834442295134,
-0.01331056747585535,
-0.017239538952708244,
-0.052762918174266815,
0.009364476427435875,
-0.006184492260217667,
0.07895606011152267,
0.04434002563357353,
-0.015698766335844994,
0.003573737572878599,
-0.011692755855619907,
-0.027186086401343346,
0.0808049887418747,
0.05762491375207901,
0.021622182801365852,
-0.003691435558721423,
0.05848089978098869,
-0.052146609872579575,
-0.005546783097088337,
-0.006385648623108864,
0.0290521327406168,
-0.03480435162782669,
-0.038108453154563904,
-0.0077338251285254955,
0.021827619522809982,
-0.004600919783115387,
0.04526448994874954,
0.03817693516612053,
0.018780311569571495,
0.0011523698922246695
]
|
36,410 | torch.optim.optimizer | _process_value_according_to_param_policy | null | @staticmethod
def _process_value_according_to_param_policy(
param: torch.Tensor,
value: torch.Tensor,
param_id: int,
param_groups: List[Dict[Any, Any]],
key: Hashable = None,
) -> torch.Tensor:
# Floating-point types are a bit special here. They are the only ones
# that are assumed to always match the type of params.
# Make sure state['step'] is not casted https://github.com/pytorch/pytorch/issues/74424
# UNLESS fused or capturable, see note [special device hosting for step]
fused = False
capturable = False
assert param_groups is not None
for pg in param_groups:
if param_id in pg["params"]:
fused = pg["fused"] if "fused" in pg else False
capturable = pg["capturable"] if "capturable" in pg else False
break
if key == "step":
if capturable or fused:
return value.to(dtype=torch.float32, device=param.device)
else:
return value
else:
if param.is_floating_point():
return value.to(dtype=param.dtype, device=param.device)
else:
return value.to(device=param.device)
| (param: torch.Tensor, value: torch.Tensor, param_id: int, param_groups: List[Dict[Any, Any]], key: Optional[Hashable] = None) -> torch.Tensor | [
0.05236690863966942,
-0.011029270477592945,
-0.061395686119794846,
0.03064473159611225,
0.01766807772219181,
0.02205854095518589,
-0.0004788239311892539,
-0.042594585567712784,
-0.03581415116786957,
0.0064396425150334835,
-0.0024098868016153574,
0.04907405748963356,
0.01984560675919056,
0.006107702385634184,
0.0032087566796690226,
0.04797644168138504,
0.028909791260957718,
0.05930667370557785,
0.03781464323401451,
-0.011277119629085064,
0.04008068889379501,
-0.01419819425791502,
-0.008156880736351013,
0.03498208522796631,
0.016207540407776833,
-0.06911440193653107,
0.04882621020078659,
-0.04004528373479843,
-0.06741487234830856,
0.0036424919962882996,
-0.0020336878951638937,
-0.0034698829986155033,
0.028484907001256943,
0.030485400930047035,
0.011861334554851055,
-0.02482028491795063,
-0.015127627179026604,
0.05098603665828705,
-0.12526986002922058,
-0.026325082406401634,
-0.037425167858600616,
-0.018146071583032608,
0.010276872664690018,
0.010400797240436077,
-0.030467696487903595,
0.03969121351838112,
-0.00909959152340889,
0.05431428924202919,
-0.0025293852668255568,
-0.00341234658844769,
0.006833544932305813,
-0.03340647369623184,
0.03841656073927879,
0.0501362681388855,
-0.003983283881098032,
0.015517104417085648,
0.004246623255312443,
-0.04447115212678909,
0.05661574378609657,
-0.005169417709112167,
0.0463477224111557,
-0.0015612260904163122,
-0.026661448180675507,
-0.02039441466331482,
0.0012768638553097844,
-0.06865411251783371,
-0.010108689777553082,
-0.01514533068984747,
-0.07148667424917221,
0.022890605032444,
-0.050030048936605453,
-0.06019184738397598,
0.03232656419277191,
0.007740848697721958,
-0.016481943428516388,
-0.021297292783856392,
0.001961767440661788,
0.018907321617007256,
0.07095556706190109,
0.006267033517360687,
0.02892749384045601,
0.0027573176193982363,
0.031034208834171295,
-0.0425591766834259,
-0.039018478244543076,
0.0076833125203847885,
-0.006532585714012384,
-0.008024103939533234,
0.02122647874057293,
-0.01850014179944992,
-0.024607842788100243,
-0.039868246763944626,
-0.025493018329143524,
0.04078882932662964,
0.05204824358224869,
0.0684770792722702,
-0.0126756951212883,
-0.025050431489944458,
-0.10183044523000717,
-0.023882001638412476,
-0.007674460764974356,
0.026626041159033775,
-0.006005906965583563,
-0.014853223226964474,
0.08894230425357819,
-0.10041416436433792,
0.0034543925430625677,
0.01404771488159895,
-0.0011850269511342049,
0.0010671882191672921,
-0.02754662185907364,
-0.029918888583779335,
-0.08660544455051422,
-0.011383340694010258,
0.013622831553220749,
0.0030892579816281796,
-0.03912470117211342,
-0.027086330577731133,
-0.05990859121084213,
0.0317777544260025,
0.0008044021087698638,
-0.019987234845757484,
-0.009860840626060963,
0.0140919741243124,
-0.022518832236528397,
0.013162541203200817,
0.05994400009512901,
-0.018340809270739555,
-0.005908538121730089,
-0.0029166489839553833,
-0.05874016135931015,
-0.021881507709622383,
-0.027422698214650154,
0.014269008301198483,
-0.0005051025655120611,
-0.037425167858600616,
-0.0463477224111557,
0.038770630955696106,
0.040363945066928864,
0.027139442041516304,
0.04330272227525711,
0.04517929255962372,
0.010551276616752148,
-0.04613528028130531,
0.08306474983692169,
-0.03838115558028221,
0.06723783165216446,
0.05658033862709999,
-0.016597017645835876,
-0.02701551839709282,
-0.011073529720306396,
0.04383382946252823,
0.02319156564772129,
-0.0014605374308302999,
0.04910946637392044,
-0.011259416118264198,
0.034380167722702026,
-0.047055862843990326,
-0.007917883805930614,
-0.0046471646055579185,
0.0075018517673015594,
-0.01130367536097765,
-0.008263101801276207,
-0.027723656967282295,
0.02701551839709282,
0.032149527221918106,
0.0009631802095100284,
0.03121124394237995,
0.014454895630478859,
-0.007147782016545534,
0.013684793375432491,
-0.03581415116786957,
0.017730040475726128,
0.04078882932662964,
0.010613239370286465,
0.06316602975130081,
-0.02374037355184555,
-0.023085344582796097,
0.007346946280449629,
-0.006461771670728922,
-0.012233108282089233,
0.01933220587670803,
-0.003985497169196606,
-0.019155170768499374,
-0.009754619561135769,
0.04185103625059128,
0.011958703398704529,
0.01350775919854641,
-0.020500635728240013,
0.012994357384741306,
-0.0226073507219553,
-0.02094322256743908,
0.024448512122035027,
-0.027422698214650154,
-0.047834813594818115,
0.0033016998786479235,
0.02563464641571045,
-0.008218842558562756,
0.028803570196032524,
0.03841656073927879,
0.014171639457345009,
-0.0760541707277298,
0.0226073507219553,
0.060793764889240265,
-0.07916998118162155,
0.0031003227923065424,
0.013472352176904678,
0.07612498104572296,
-0.02651982009410858,
-0.005120732821524143,
-0.03969121351838112,
-0.0374605730175972,
0.030733250081539154,
0.0822857990860939,
0.003974432125687599,
-0.06033347547054291,
-0.05704062804579735,
0.031866271048784256,
0.027918394654989243,
-0.02404133230447769,
0.05162335932254791,
-0.013233354315161705,
0.053393710404634476,
0.00820113904774189,
0.09035858511924744,
-0.023049937561154366,
-0.007643479388207197,
-0.05406644195318222,
-0.039018478244543076,
0.026980111375451088,
0.04879080504179001,
-0.024182960391044617,
0.009692657738924026,
0.024714063853025436,
0.050879813730716705,
-0.010604387149214745,
-0.0013852976262569427,
-0.04280702397227287,
-0.017738891765475273,
0.024342291057109833,
-0.031883977353572845,
-0.0495697557926178,
-0.013003209605813026,
0.00951562263071537,
-0.033282551914453506,
-0.00341455964371562,
0.037637609988451004,
0.03427394479513168,
-0.002107821172103286,
0.009276625700294971,
0.012613732367753983,
0.03361891582608223,
-0.03530074656009674,
0.008984518237411976,
-0.03305240720510483,
-0.02096092514693737,
-0.017057307064533234,
-0.0032729317899793386,
0.05314585939049721,
-0.04075342044234276,
-0.05204824358224869,
-0.036221329122781754,
-0.03862900286912918,
0.01765037328004837,
-0.010276872664690018,
-0.05760714039206505,
-0.0009205812239088118,
0.04383382946252823,
0.010329983197152615,
0.002766169374808669,
0.017225490882992744,
0.021102553233504295,
-0.03468112647533417,
-0.016092468053102493,
0.0022085097152739763,
0.0023147305473685265,
0.03664621338248253,
0.03464571759104729,
0.01090534683316946,
0.017597263678908348,
0.05218987166881561,
-0.026112640276551247,
-0.0684770792722702,
-0.023846594616770744,
-0.028520314022898674,
0.042063478380441666,
0.029458599165081978,
0.015694139525294304,
0.0463477224111557,
0.015056814067065716,
-0.05541190505027771,
0.015101072378456593,
0.006652084179222584,
-0.008448988199234009,
-0.017446784302592278,
-0.016942234709858894,
-0.048153478652238846,
-0.07251347601413727,
0.04075342044234276,
-0.018801100552082062,
0.04075342044234276,
0.015260403975844383,
0.001012971275486052,
0.006054591853171587,
-0.011631189845502377,
0.0331055149435997,
0.033760543912649155,
-0.02839638851583004,
0.004226706922054291,
-0.030272958800196648,
0.04022231698036194,
0.02706862799823284,
-0.011064677499234676,
-0.005758058279752731,
0.07307998090982437,
-0.03200789913535118,
-0.011126640252768993,
0.002978611271828413,
0.039266329258680344,
0.08724277466535568,
-0.004363908898085356,
0.0649009719491005,
0.01353431399911642,
0.049215685576200485,
-0.023545634001493454,
-0.05187121033668518,
0.04496685042977333,
-0.03307010978460312,
-0.018269995227456093,
0.01666783168911934,
-0.0817192867398262,
0.05898801237344742,
0.0463477224111557,
0.03969121351838112,
-0.035424672067165375,
0.007758552208542824,
-0.007422185968607664,
0.04160318896174431,
0.036221329122781754,
0.012507512234151363,
0.044577375054359436,
-0.005669540725648403,
-0.00682911928743124,
0.01751759834587574,
0.02975955791771412,
-0.007280557882040739,
0.019774792715907097,
0.05629708245396614,
0.07824940234422684,
-0.009586436673998833,
-0.028785865753889084,
-0.03616821765899658,
0.039549585431814194,
0.05098603665828705,
0.05527028068900108,
-0.015614473260939121,
0.014171639457345009,
-0.04599365219473839,
-0.025988714769482613,
-0.032397378236055374,
0.12873974442481995,
-0.039868246763944626,
-0.0037133058067411184,
0.04422330483794212,
0.05456214025616646,
0.010117541067302227,
-0.004833051469177008,
-0.01927909441292286,
0.06228085979819298,
0.013295317068696022,
0.0018677175976336002,
-0.03891225904226303,
0.02122647874057293,
0.018269995227456093,
0.025315983220934868,
0.030750952661037445,
-0.015065665356814861,
0.011091233231127262,
0.015092221088707447,
0.047834813594818115,
0.042098887264728546,
0.0380270853638649,
0.01810181327164173,
0.0652550458908081,
0.002724123653024435,
0.012171145528554916,
0.019102059304714203,
-0.03420313075184822,
-0.008776502683758736,
-0.05650952458381653,
0.016207540407776833,
0.0463477224111557,
-0.004067375790327787,
-0.02899830788373947,
0.00032585475128144026,
0.0033127644564956427,
0.03363662213087082,
0.020589152351021767,
-0.03245048597455025,
-0.05937748774886131,
-0.01408312190324068,
-0.05328748747706413,
-0.05204824358224869,
0.05073818564414978,
-0.009869692847132683,
-0.06366173177957535,
0.004155892878770828,
0.07162830233573914,
-0.051481734961271286,
-0.021970024332404137,
0.005142862442880869,
-0.05303964018821716,
-0.012091480195522308,
-0.01240129116922617,
-0.00009460299770580605,
-0.025723163038492203,
-0.0073646497912704945,
0.004226706922054291,
-0.02869734913110733,
0.015207293443381786,
0.05743010342121124,
0.008913704194128513,
-0.014649633318185806,
0.023846594616770744,
0.0014583244919776917,
-0.028626535087823868,
0.01298550609499216,
0.004525453317910433,
-0.010869939811527729,
0.01954464614391327,
-0.004109421279281378,
-0.04740993306040764,
-0.021456623449921608,
-0.046206094324588776,
0.037071097642183304,
0.01117089856415987,
0.011631189845502377,
0.06759190559387207,
0.04305487498641014,
0.012923543341457844,
-0.05187121033668518,
0.023864297196269035,
-0.0067583052441477776,
0.035991184413433075,
-0.012330477125942707,
-0.03314092382788658,
-0.004664868116378784,
0.03862900286912918,
-0.11528509110212326,
-0.02512124553322792,
0.008878297172486782,
-0.017871668562293053,
0.0446481890976429,
-0.00992280337959528,
0.04411708191037178,
-0.013994604349136353,
-0.03415002301335335,
0.00468699773773551,
0.02597101218998432,
0.009701509959995747,
0.06996417045593262,
0.01791592687368393,
-0.043444350361824036,
-0.008869445882737637,
-0.02565234899520874,
0.030007407069206238,
0.027245663106441498,
0.00627588527277112,
0.008320637978613377,
0.02313845418393612,
0.004301946610212326,
0.019792495295405388,
0.01239243894815445,
0.016774050891399384,
-0.020075751468539238,
0.030166737735271454,
0.0480472557246685,
0.019916420802474022,
-0.03314092382788658,
0.011356784962117672,
0.02152743749320507,
-0.05399562790989876,
0.011985259130597115,
0.0124366981908679,
-0.03668161854147911,
-0.013525462709367275,
0.00170727982185781,
0.02728107012808323,
0.023350896313786507,
0.03471653163433075,
-0.039301734417676926,
-0.037354353815317154,
0.07286754250526428,
0.019526943564414978,
-0.044506561011075974,
-0.02506813406944275,
0.012047220952808857,
0.007608072366565466,
0.07640823721885681,
-0.01365823857486248,
-0.0026046251878142357,
0.022270983085036278,
-0.052260685712099075,
-0.01696879044175148,
0.04146156087517738,
0.006497178692370653,
-0.017181232571601868,
0.03287537023425102,
-0.04967597872018814,
0.02073078043758869,
0.028909791260957718,
-0.015570214949548244,
-0.01808410882949829,
0.0007999762310646474,
-0.01823459006845951,
-0.03393758088350296,
0.023917406797409058,
0.019580053165555,
-0.06061673164367676,
-0.05218987166881561,
0.05187121033668518,
-0.00676715699955821,
0.03979743272066116,
-0.011312526650726795,
0.010967308655381203,
0.023085344582796097,
-0.12661531567573547,
-0.053358301520347595,
0.02177528664469719,
-0.031866271048784256,
-0.01184363104403019,
-0.018854212015867233,
0.030007407069206238,
0.06971631944179535,
0.029157638549804688,
-0.027971506118774414,
-0.031583014875650406,
-0.03884144499897957,
-0.09602370113134384,
-0.008984518237411976,
-0.010312279686331749,
0.0009321991237811744,
-0.035424672067165375,
0.020465228706598282,
0.0563678964972496,
0.042877838015556335,
0.009551029652357101,
0.04280702397227287,
-0.037885457277297974,
-0.03195479139685631,
-0.0743546336889267,
0.002788298763334751,
-0.013711349107325077,
-0.0008907065493986011,
0.03429165109992027,
-0.015410883352160454,
-0.0015678649069741368,
-0.007457592990249395,
-0.04723289608955383,
-0.00566511508077383,
0.00627588527277112,
-0.032361969351768494,
0.04436493292450905,
0.003093683859333396,
-0.01655275747179985,
-0.05884638428688049,
-0.044010862708091736,
-0.009223515167832375,
-0.014410636387765408,
-0.026289675384759903,
0.02869734913110733,
-0.0003006826154887676,
-0.02459014020860195,
-0.03427394479513168,
-0.03283996507525444,
-0.030432289466261864,
0.014800112694501877,
0.005142862442880869,
-0.011914445087313652,
-0.007904605939984322,
-0.027971506118774414,
0.01670323684811592,
0.01710156537592411,
-0.0008503205026499927,
0.02510354109108448,
0.045887432992458344,
-0.013667089864611626,
0.06996417045593262,
0.021970024332404137,
0.06313062459230423,
-0.035991184413433075,
0.013985753059387207,
-0.030786359682679176,
0.005842149723321199,
0.01713697239756584,
-0.007081393618136644,
-0.02728107012808323,
0.02790069207549095,
-0.01215344201773405,
0.00967495422810316,
-0.03602658957242966,
-0.02542220428586006,
0.07839103043079376,
0.007727570831775665,
0.024767175316810608,
-0.055022429674863815,
-0.020270489156246185,
0.030272958800196648,
0.008626023307442665,
-0.041249118745326996,
0.006236052606254816,
0.023085344582796097,
0.02590019814670086,
0.01600394956767559,
0.02983037196099758,
0.02234179712831974,
-0.05905882641673088,
-0.013985753059387207,
0.047268304973840714,
-0.06199760362505913,
-0.02427147701382637,
0.005032215733081102,
-0.05994400009512901,
-0.00743988947942853,
0.010152948088943958,
-0.05594301223754883,
0.025209762156009674,
-0.12095020711421967,
-0.02947630174458027,
-0.06681294739246368,
-0.01157807931303978,
0.020217379555106163,
0.040965862572193146,
-0.006567992735654116,
-0.004930420313030481,
0.012640288099646568,
0.010285724885761738,
-0.021952321752905846,
-0.022837495431303978,
-0.05176498740911484,
0.010241465643048286,
0.021881507709622383,
-0.02510354109108448,
-0.031583014875650406,
0.04309028014540672,
-0.009843137115240097,
-0.039903655648231506,
-0.011321378871798515,
0.03664621338248253,
0.03661080449819565,
-0.0020657754503190517,
0.04241754859685898,
-0.029865778982639313,
0.007603646721690893,
0.09595288336277008,
-0.018376216292381287,
0.039903655648231506,
0.02705092541873455,
-0.021863803267478943,
0.009745768271386623,
-0.0535353384912014,
0.010029024444520473,
0.015047961845993996,
0.013454648666083813,
-0.04744533821940422,
-0.011241712607443333,
-0.0452147014439106,
0.008395877666771412,
-0.02011115849018097,
-0.005802317056804895,
-0.011817076243460178,
-0.06323684751987457,
-0.026643743738532066,
0.002967546693980694,
0.023581041023135185,
-0.04663097858428955,
0.04411708191037178,
-0.03416772559285164,
-0.062457893043756485,
0.007192040793597698,
0.024094441905617714,
-0.028626535087823868,
0.013091727159917355,
0.03997446969151497,
0.03643377125263214,
-0.023280082270503044,
-0.012029517441987991,
-0.008935834281146526,
-0.035743337124586105,
-0.0452147014439106,
-0.012383587658405304,
-0.0303614754229784,
-0.014800112694501877,
-0.04525010660290718,
-0.04560417681932449,
-0.0805862620472908,
-0.05158795416355133,
0.041284527629613876,
0.05743010342121124,
0.04301946610212326,
-0.06316602975130081,
-0.06674213707447052,
-0.01904894970357418,
-0.06033347547054291,
0.005240231286734343,
-0.004270965699106455,
0.02591790072619915,
-0.02205854095518589,
0.04719749093055725,
-0.042311329394578934,
-0.01047161128371954,
0.014074270613491535,
-0.03912470117211342,
-0.06316602975130081,
-0.01901354268193245,
0.08193172514438629,
-0.07768288999795914,
0.027511214837431908,
-0.021881507709622383,
0.011029270477592945,
0.007342520169913769,
0.010268021374940872,
0.06341388076543808,
-0.04546254873275757,
-0.033282551914453506,
-0.010232614353299141,
0.05796120688319206,
0.0103565389290452,
0.042311329394578934,
-0.01491518598049879,
0.04503766447305679,
0.05349992960691452,
-0.05895260348916054,
-0.02867964468896389,
0.011746262200176716,
0.012330477125942707,
0.04847213998436928,
-0.038806039839982986,
-0.03855818882584572,
0.02398822084069252,
0.01129482313990593,
0.06288278102874756,
0.0068114157766103745,
-0.06472393870353699,
0.009701509959995747,
0.039266329258680344,
0.007661182899028063,
-0.03453949838876724,
0.010268021374940872,
-0.052012838423252106,
0.04227592051029205,
0.018801100552082062,
-0.0026046251878142357,
-0.018340809270739555,
0.0904294028878212,
-0.053924813866615295,
0.024660954251885414,
0.01377331092953682,
-0.04110749065876007,
-0.040930457413196564,
-0.09219975024461746,
0.023793483152985573,
0.017455635592341423,
0.012534067034721375,
0.0036845377180725336,
-0.010781422257423401,
0.03912470117211342,
0.0385935977101326
]
|
36,411 | torch.optim.optimizer | add_param_group | Add a param group to the :class:`Optimizer` s `param_groups`.
This can be useful when fine tuning a pre-trained network as frozen layers can be made
trainable and added to the :class:`Optimizer` as training progresses.
Args:
param_group (dict): Specifies what Tensors should be optimized along with group
specific optimization options.
| import math
import functools
import warnings
from collections import OrderedDict, defaultdict
from copy import deepcopy
from itertools import chain
from typing import (
Any,
Callable,
DefaultDict,
Dict,
Hashable,
Iterable,
List,
Optional,
Set,
Tuple,
TypeVar,
Union,
cast,
overload,
)
from typing_extensions import ParamSpec, Self, TypeAlias
import torch
import torch.utils.hooks as hooks
from torch.utils.hooks import RemovableHandle
from torch.utils._foreach_utils import (
Indices,
TensorListList,
_get_foreach_kernels_supported_devices,
_get_fused_kernels_supported_devices,
)
from torch._utils import is_compiling
from torch.utils._foreach_utils import _group_tensors_by_device_and_dtype
Args: TypeAlias = Tuple[Any, ...]
Kwargs: TypeAlias = Dict[str, Any]
StateDict: TypeAlias = Dict[str, Any]
GlobalOptimizerPreHook: TypeAlias = Callable[["Optimizer", Args, Kwargs], Optional[Tuple[Args, Kwargs]]]
GlobalOptimizerPostHook: TypeAlias = Callable[["Optimizer", Args, Kwargs], None]
__all__ = ['Optimizer', 'register_optimizer_step_pre_hook', 'register_optimizer_step_post_hook']
_global_optimizer_pre_hooks: Dict[int, GlobalOptimizerPreHook] = OrderedDict()
_global_optimizer_post_hooks: Dict[int, GlobalOptimizerPostHook] = OrderedDict()
_foreach_supported_types = [torch.Tensor, torch.nn.parameter.Parameter]
class _RequiredParameter:
"""Singleton class representing a required parameter for an Optimizer."""
def __repr__(self) -> str:
return "<required parameter>"
| (self, param_group: Dict[str, Any]) -> NoneType | [
-0.04646318405866623,
-0.05691549554467201,
-0.04142776504158974,
0.027923688292503357,
0.0049829669296741486,
0.05104083940386772,
-0.03740324452519417,
-0.042915504425764084,
-0.03595365583896637,
-0.028953660279512405,
-0.007386235054582357,
0.010099448263645172,
-0.04646318405866623,
0.0006455206894315779,
-0.011138956993818283,
-0.004944819491356611,
-0.01811034232378006,
0.028457747772336006,
0.05893729254603386,
-0.010118521749973297,
-0.011825605295598507,
-0.03393185883760452,
0.014123968780040741,
0.014009527862071991,
-0.03034602850675583,
0.009079013019800186,
0.035514961928129196,
-0.02616892009973526,
-0.026989083737134933,
-0.025653934106230736,
-0.056228846311569214,
-0.004959125071763992,
0.03936782106757164,
0.010318794287741184,
0.02529153600335121,
-0.012617157772183418,
0.02309807762503624,
0.09902990609407425,
-0.049514953047037125,
-0.021820148453116417,
-0.04119888320565224,
-0.07438687235116959,
0.02491006627678871,
-0.030670279636979103,
0.0038170956540852785,
0.030384177342057228,
-0.02025611698627472,
0.010252037085592747,
0.005641004536300898,
-0.05001086741685867,
0.0330735482275486,
-0.09178195893764496,
0.05733511224389076,
0.031795620918273926,
-0.012741136364638805,
0.03461850434541702,
0.08163482695817947,
-0.029335130006074905,
0.02697001025080681,
-0.014352851547300816,
0.0006288313306868076,
-0.03488553687930107,
-0.024662109091877937,
-0.015497265383601189,
0.015497265383601189,
-0.07865934818983078,
-0.05256672203540802,
0.004267708398401737,
-0.020046308636665344,
0.027332406491041183,
-0.048332393169403076,
-0.047912776470184326,
0.0674441009759903,
-0.014495903626084328,
-0.011062663048505783,
-0.05237598717212677,
-0.01496320590376854,
-0.05397816747426987,
0.05699178948998451,
-0.03772749751806259,
-0.0024843309074640274,
-0.015554485842585564,
-0.03580106794834137,
-0.011930510401725769,
-0.0016915861051529646,
-0.0328446663916111,
-0.0024461837019771338,
-0.007057216018438339,
0.004727858118712902,
-0.09330783784389496,
-0.03026973456144333,
0.01884467527270317,
0.012922334484755993,
0.05413075536489487,
0.006842638831585646,
0.025806521996855736,
-0.04753130301833153,
-0.04730242118239403,
-0.018472740426659584,
-0.030326955020427704,
0.031223412603139877,
0.04444138705730438,
0.03917708620429039,
0.02298363670706749,
0.048446834087371826,
-0.007715253625065088,
-0.02340325526893139,
0.010547677055001259,
-0.028362378478050232,
-0.023689357563853264,
-0.002394923474639654,
-0.03652586042881012,
-0.05962393805384636,
-0.013475468382239342,
0.029678454622626305,
-0.01917846128344536,
-0.04371659457683563,
-0.05291004851460457,
0.0035047661513090134,
0.014534050598740578,
-0.007715253625065088,
0.020980913192033768,
-0.02885829098522663,
-0.009965933859348297,
-0.024852845817804337,
-0.024795623496174812,
0.05435963720083237,
0.062027208507061005,
-0.05271931365132332,
-0.054741110652685165,
-0.04131332412362099,
-0.007419613655656576,
-0.042038120329380035,
0.07053401321172714,
0.030841941013932228,
-0.004553811624646187,
-0.0014591271756216884,
0.013284732587635517,
-0.03736509755253792,
-0.014381461776793003,
0.017890997231006622,
0.012645768001675606,
-0.005311985500156879,
0.015296992845833302,
0.048027217388153076,
-0.00442268094047904,
0.03366483002901077,
-0.00330449384637177,
0.01898772642016411,
-0.07652311027050018,
-0.030651206150650978,
0.030212514102458954,
0.025196168571710587,
0.0036883491557091475,
-0.021400531753897667,
0.029602160677313805,
-0.04062667489051819,
-0.02344140224158764,
-0.047722041606903076,
0.0069666169583797455,
-0.042190708220005035,
-0.02712259814143181,
-0.04997272044420242,
-0.05676290765404701,
-0.02241143025457859,
-0.013351489789783955,
0.006546998396515846,
-0.0069856904447078705,
-0.04142776504158974,
0.05794546753168106,
0.007529286667704582,
-0.07083918899297714,
0.06443047523498535,
0.05760214105248451,
-0.020237043499946594,
0.09857214242219925,
-0.0069666169583797455,
-0.011463208124041557,
-0.025615787133574486,
-0.022316060960292816,
0.04688280448317528,
-0.019664837047457695,
-0.06336236000061035,
-0.018272466957569122,
-0.00926974881440401,
0.026950936764478683,
0.008802446536719799,
-0.03963484987616539,
0.01926429197192192,
0.031643033027648926,
-0.015392360277473927,
0.015020426362752914,
0.008530648425221443,
-0.023918241262435913,
0.009574925526976585,
0.014972742646932602,
-0.00490190414711833,
0.03971114754676819,
0.05363484099507332,
0.01949317567050457,
-0.027656657621264458,
0.031948208808898926,
0.07385281473398209,
0.05924246832728386,
-0.048446834087371826,
0.0035858287010341883,
0.04009261727333069,
0.06465935707092285,
-0.01026157382875681,
0.005922339390963316,
0.0003805770829785615,
0.0019514632876962423,
0.010023154318332672,
0.09071383625268936,
0.020885545760393143,
-0.015792904421687126,
0.00016629757010377944,
0.061683882027864456,
0.02870570309460163,
-0.01515394076704979,
0.029754748567938805,
-0.006947543006390333,
-0.018024511635303497,
0.011768384836614132,
0.042762916535139084,
-0.03011714667081833,
0.022964563220739365,
-0.02191551774740219,
0.03257763385772705,
-0.03679289296269417,
0.0032949571032077074,
-0.048561275005340576,
-0.016450943425297737,
0.02298363670706749,
0.07751493901014328,
0.015716610476374626,
0.0029754748102277517,
-0.02313622459769249,
0.019970014691352844,
-0.008802446536719799,
-0.032978180795907974,
-0.055694784969091415,
-0.03847136348485947,
-0.021152574568986893,
-0.021343311294913292,
0.023613063618540764,
0.035362374037504196,
0.03698362782597542,
0.00036209955578669906,
0.02082832343876362,
-0.01576429419219494,
-0.015640316531062126,
-0.027999982237815857,
0.00573637243360281,
-0.02897273376584053,
-0.016470016911625862,
0.02996455878019333,
-0.011558575555682182,
0.014228873886168003,
-0.05214710533618927,
-0.024471374228596687,
-0.0032568098977208138,
-0.06359124183654785,
0.04470841959118843,
-0.01883513852953911,
-0.04154220595955849,
0.056495875120162964,
0.008082419633865356,
-0.019464565441012383,
0.026226140558719635,
0.10681191831827164,
0.0682070404291153,
-0.026531318202614784,
-0.005850813817232847,
-0.009527241811156273,
0.014600807800889015,
0.008525880053639412,
0.07099177688360214,
0.025234315544366837,
0.019779277965426445,
0.07911711186170578,
-0.014762933366000652,
-0.07579831779003143,
-0.01907355710864067,
-0.04028335213661194,
0.03726973012089729,
-0.020656662061810493,
-0.026149846613407135,
-0.0030946845654398203,
0.0024962518364191055,
0.04756944999098778,
0.02510080114006996,
0.08773836493492126,
-0.002056367928162217,
0.05466481298208237,
-0.004954356234520674,
-0.08049041032791138,
0.02052314765751362,
0.021457752212882042,
-0.04467026889324188,
0.03034602850675583,
0.0032162785064429045,
-0.011920972727239132,
-0.012159392237663269,
0.048141658306121826,
-0.04035964608192444,
0.01680380292236805,
-0.01852996088564396,
-0.0035023819655179977,
-0.021095354110002518,
0.06305717676877975,
-0.0032115101348608732,
-0.0059843286871910095,
0.011968657374382019,
0.047836482524871826,
-0.043220680207014084,
-0.006389641668647528,
-0.043029945343732834,
-0.004501359537243843,
0.0686648041009903,
0.009002719074487686,
0.10612527281045914,
0.0050592608749866486,
0.005030650645494461,
-0.022697532549500465,
-0.06534601002931595,
0.04550950601696968,
-0.05725881829857826,
-0.042038120329380035,
-0.010557213798165321,
-0.0342179611325264,
-0.007638959679752588,
0.0023746578954160213,
0.03759397938847542,
-0.024852845817804337,
0.018901895731687546,
0.07034327834844589,
0.032863739877939224,
-0.02214439958333969,
0.0058365087024867535,
0.04978198558092117,
0.04707353934645653,
-0.005216618068516254,
0.05252857506275177,
-0.028209790587425232,
-0.0333787240087986,
0.03683103993535042,
0.021667560562491417,
0.03736509755253792,
0.0025439357850700617,
0.015506802126765251,
-0.008325607515871525,
-0.019464565441012383,
0.01937873475253582,
0.08270294219255447,
-0.03633512556552887,
-0.04463212192058563,
-0.004012599587440491,
-0.007348088081926107,
-0.03583921492099762,
0.03763212636113167,
-0.010290184058248997,
0.009546315297484398,
0.04077926650643349,
0.0676729828119278,
-0.032787445932626724,
0.01707083359360695,
-0.06252311915159225,
0.002430686494335532,
-0.04154220595955849,
-0.01649862714111805,
-0.06404900550842285,
0.06935145705938339,
0.03219616413116455,
-0.028381453827023506,
-0.0010234155924990773,
0.004539506509900093,
0.015277919359505177,
-0.020618515089154243,
0.04676836356520653,
0.05237598717212677,
0.05313893035054207,
0.04089370742440224,
-0.023937314748764038,
-0.00852111168205738,
0.003545297309756279,
-0.036163464188575745,
0.01143459789454937,
0.02294548973441124,
-0.04550950601696968,
0.0064420937560498714,
0.013685277663171291,
-0.0070429109036922455,
0.027332406491041183,
-0.04039779305458069,
0.026569465175271034,
-0.013065386563539505,
0.062942735850811,
-0.0674441009759903,
-0.0663759782910347,
-0.015401897020637989,
-0.0324631929397583,
0.0030017010867595673,
0.04611986130475998,
0.028343304991722107,
-0.03538144752383232,
0.03808989375829697,
0.0689699798822403,
0.012855577282607555,
0.05252857506275177,
-0.027427775785326958,
0.013170290738344193,
0.02290734276175499,
0.03499997779726982,
-0.007786779664456844,
0.0003907099016942084,
0.025959111750125885,
-0.004181877244263887,
0.04119888320565224,
0.05096454545855522,
0.047798335552215576,
0.04756944999098778,
-0.005140323657542467,
0.025959111750125885,
0.00001733197677822318,
-0.0004777330032084137,
-0.027427775785326958,
0.02059944160282612,
-0.006723429076373577,
-0.019817424938082695,
-0.04554765298962593,
-0.016202986240386963,
-0.016288816928863525,
-0.02014167606830597,
-0.03503812476992607,
-0.031948208808898926,
0.035171639174222946,
0.05760214105248451,
-0.005464574322104454,
0.02532968297600746,
0.001862055971287191,
-0.002923022722825408,
-0.00947955809533596,
0.010910074226558208,
-0.0014030985767021775,
0.0011020939564332366,
-0.004553811624646187,
0.0680544525384903,
-0.08468659222126007,
0.01354222558438778,
0.04421250522136688,
-0.0070429109036922455,
0.021095354110002518,
-0.006690050009638071,
0.02248772419989109,
0.018367836251854897,
-0.03747953847050667,
-0.042839210480451584,
-0.05447407811880112,
0.0019502711948007345,
0.022392356768250465,
0.06526971608400345,
0.0045371223241090775,
-0.041999973356723785,
-0.0005286951782181859,
-0.0003844513848889619,
0.05229969322681427,
-0.01437192503362894,
0.0060034021735191345,
0.019054483622312546,
0.07610349357128143,
-0.0017452305182814598,
0.007815389893949032,
-0.00328065175563097,
-0.028572188690304756,
-0.002744208090007305,
0.0002524266019463539,
0.03868117555975914,
-0.024376006796956062,
-0.028038129210472107,
0.05168933793902397,
-0.01680380292236805,
0.03030788153409958,
0.007858305238187313,
-0.008711847476661205,
0.02275475300848484,
0.006141685415059328,
0.01869208551943302,
0.011673017404973507,
0.08293182402849197,
-0.05214710533618927,
-0.011777921579778194,
0.027427775785326958,
-0.014638954773545265,
0.018081732094287872,
0.0030541534069925547,
0.02332695946097374,
0.0338364914059639,
0.08056670427322388,
-0.006537461653351784,
0.02367028407752514,
-0.03173840045928955,
-0.05699178948998451,
-0.01093868538737297,
0.03705992177128792,
-0.01166347973048687,
0.002715597627684474,
0.060844648629426956,
-0.05023974925279617,
0.042381443083286285,
0.008420975878834724,
-0.006670976523309946,
0.006871249061077833,
-0.011701627634465694,
0.010318794287741184,
-0.011034052819013596,
0.002689371583983302,
0.03160488232970238,
-0.011596722528338432,
-0.02071388252079487,
-0.0029254069086164236,
0.06565118581056595,
0.005602857563644648,
-0.034866463392972946,
0.04768389090895653,
0.021667560562491417,
-0.00788214709609747,
-0.02912532165646553,
0.0687410980463028,
-0.023956388235092163,
-0.012922334484755993,
0.015401897020637989,
-0.03629697859287262,
0.055618491023778915,
-0.006246590055525303,
-0.03641141951084137,
0.0317002534866333,
-0.002185114426538348,
-0.04482286050915718,
-0.02996455878019333,
0.021858297288417816,
-0.0031113740988075733,
0.014648491516709328,
-0.0005829355795867741,
0.030593985691666603,
0.019741130992770195,
0.018968652933835983,
0.021801074966788292,
-0.03644956648349762,
-0.01166347973048687,
-0.10749857127666473,
0.009498631581664085,
-0.019168924540281296,
-0.012407348491251469,
-0.02044685371220112,
-0.03854765743017197,
0.015554485842585564,
0.006284737028181553,
-0.04463212192058563,
0.05413075536489487,
-0.011768384836614132,
-0.009603535756468773,
0.030098073184490204,
-0.005121250171214342,
0.016288816928863525,
0.0070429109036922455,
0.015592632815241814,
0.012168928980827332,
-0.027294259518384933,
0.00463249022141099,
0.021286088973283768,
-0.04116073623299599,
-0.0161171555519104,
-0.042495884001255035,
-0.061760179698467255,
0.01454358734190464,
0.004379765596240759,
-0.004134193528443575,
0.00718596251681447,
-0.07385281473398209,
0.015754757449030876,
-0.030441397801041603,
-0.012884187512099743,
-0.0008946690359152853,
0.02017982304096222,
0.009775198064744473,
-0.017604893073439598,
0.04554765298962593,
-0.030174367129802704,
0.0317002534866333,
-0.02878199703991413,
0.030880089849233627,
-0.025196168571710587,
-0.03211987018585205,
0.0324631929397583,
-0.010662117972970009,
-0.08689912408590317,
0.023918241262435913,
0.03894820436835289,
-0.0008761915378272533,
-0.08338959515094757,
-0.036544933915138245,
0.01960761658847332,
-0.029106248170137405,
-0.01956946961581707,
-0.07724790275096893,
-0.06042502820491791,
0.04638689011335373,
0.018596718087792397,
-0.0692751556634903,
-0.002180346054956317,
0.01822478324174881,
0.03595365583896637,
0.027542216703295708,
-0.03026973456144333,
-0.02305993065237999,
-0.03971114754676819,
0.012340591289103031,
0.10170020908117294,
-0.016870561987161636,
0.0013673356734216213,
0.013723424635827541,
0.003819479839876294,
-0.08018523454666138,
-0.02229698747396469,
-0.04047408699989319,
0.0081348717212677,
-0.06664300709962845,
0.011177104897797108,
0.03173840045928955,
-0.02305993065237999,
-0.04028335213661194,
0.07503537088632584,
-0.004682558123022318,
0.010538140311837196,
-0.05023974925279617,
0.008273155428469181,
-0.0012981939362362027,
-0.02855311520397663,
-0.08163482695817947,
0.03026973456144333,
0.0657656267285347,
0.01707083359360695,
-0.016737045720219612,
0.008015662431716919,
-0.048294246196746826,
-0.001461511361412704,
0.03728880360722542,
0.08331329375505447,
0.017242494970560074,
0.004217640496790409,
0.06034873425960541,
0.015010889619588852,
0.02517709508538246,
0.03967300057411194,
0.02571115456521511,
0.016450943425297737,
0.005135555285960436,
0.049095336347818375,
-0.01850135065615177,
0.021247942000627518,
0.00980380829423666,
0.031910061836242676,
0.032978180795907974,
-0.05424519628286362,
-0.04753130301833153,
-0.05081195756793022,
-0.028019055724143982,
0.026683906093239784,
0.0049829669296741486,
-0.005540868267416954,
-0.03696455433964729,
-0.025196168571710587,
-0.010862390510737896,
0.013275195844471455,
-0.02025611698627472,
0.02521524205803871,
-0.030174367129802704,
-0.0625612661242485,
-0.04047408699989319,
-0.0029921643435955048,
0.019512249156832695,
-0.034752022475004196,
0.01864440180361271,
-0.018482277169823647,
-0.00023365108063444495,
-0.05359669402241707,
0.013904622755944729,
0.002069480950012803,
-0.024795623496174812,
-0.003869547974318266,
-0.004611032549291849,
0.06717706471681595,
-0.004289166070520878,
-0.009717977605760098,
-0.10047949850559235,
-0.023193445056676865,
-0.02510080114006996,
0.014400535263121128,
-0.07415799051523209,
0.02658853866159916,
0.012035414576530457,
-0.08712800592184067,
-0.028991807252168655,
-0.012922334484755993,
0.05130786821246147,
-0.03902449831366539,
-0.041999973356723785,
0.0317002534866333,
0.0011444133706390858,
0.042724769562482834,
-0.0036597386933863163,
0.0019240450346842408,
-0.009722745977342129,
0.032901886850595474,
0.0043440028093755245,
0.0003331911866553128,
0.0030875320080667734,
0.018549034371972084,
-0.009002719074487686,
-0.00007897644536569715,
0.015897810459136963,
0.018119879066944122,
0.028457747772336006,
0.001013878732919693,
0.00656130351126194,
0.08186370879411697,
-0.054893698543310165,
0.05882285162806511,
-0.002930175280198455,
0.05184192955493927,
0.0032043575774878263,
-0.0016474785516038537,
-0.06450676918029785,
0.020885545760393143,
0.022697532549500465,
0.05699178948998451,
-0.030441397801041603,
-0.062027208507061005,
0.010881463997066021,
0.01151089183986187,
0.03633512556552887,
-0.022277913987636566,
-0.00045448710443452,
0.061912767589092255,
-0.0036645070649683475,
-0.02298363670706749,
-0.03974929451942444,
0.05718252435326576,
-0.01814848929643631,
0.055694784969091415,
0.0058937291614711285,
-0.0066423662938177586,
-0.020694809034466743,
0.06664300709962845,
-0.07083918899297714,
0.02191551774740219,
-0.03929152712225914,
-0.055313315242528915,
-0.11955305933952332,
-0.03822340816259384,
-0.05394002050161362,
0.0316239558160305,
-0.019369198009371758,
-0.009241138584911823,
-0.00984195526689291,
0.019521785899996758,
-0.006389641668647528
]
|
36,412 | torch.optim.optimizer | load_state_dict | Loads the optimizer state.
Args:
state_dict (dict): optimizer state. Should be an object returned
from a call to :meth:`state_dict`.
| import math
import functools
import warnings
from collections import OrderedDict, defaultdict
from copy import deepcopy
from itertools import chain
from typing import (
Any,
Callable,
DefaultDict,
Dict,
Hashable,
Iterable,
List,
Optional,
Set,
Tuple,
TypeVar,
Union,
cast,
overload,
)
from typing_extensions import ParamSpec, Self, TypeAlias
import torch
import torch.utils.hooks as hooks
from torch.utils.hooks import RemovableHandle
from torch.utils._foreach_utils import (
Indices,
TensorListList,
_get_foreach_kernels_supported_devices,
_get_fused_kernels_supported_devices,
)
from torch._utils import is_compiling
from torch.utils._foreach_utils import _group_tensors_by_device_and_dtype
Args: TypeAlias = Tuple[Any, ...]
Kwargs: TypeAlias = Dict[str, Any]
StateDict: TypeAlias = Dict[str, Any]
GlobalOptimizerPreHook: TypeAlias = Callable[["Optimizer", Args, Kwargs], Optional[Tuple[Args, Kwargs]]]
GlobalOptimizerPostHook: TypeAlias = Callable[["Optimizer", Args, Kwargs], None]
__all__ = ['Optimizer', 'register_optimizer_step_pre_hook', 'register_optimizer_step_post_hook']
_global_optimizer_pre_hooks: Dict[int, GlobalOptimizerPreHook] = OrderedDict()
_global_optimizer_post_hooks: Dict[int, GlobalOptimizerPostHook] = OrderedDict()
_foreach_supported_types = [torch.Tensor, torch.nn.parameter.Parameter]
class _RequiredParameter:
"""Singleton class representing a required parameter for an Optimizer."""
def __repr__(self) -> str:
return "<required parameter>"
| (self, state_dict: Dict[str, Any]) -> NoneType | [
-0.046539921313524246,
-0.05691603571176529,
-0.041390012949705124,
0.027847658842802048,
0.004983014427125454,
0.05104132741689682,
-0.037422675639390945,
-0.042954061180353165,
-0.0359349250793457,
-0.02895393595099449,
-0.007400610949844122,
0.010137692093849182,
-0.046463627368211746,
0.000712284934706986,
-0.011167674325406551,
-0.004944866988807917,
-0.018100978806614876,
0.028458017855882645,
0.05893785506486893,
-0.010099545121192932,
-0.011835254728794098,
-0.033913109451532364,
0.014114567078649998,
0.013961977325379848,
-0.030365392565727234,
0.009102941490709782,
0.03549622744321823,
-0.026169169694185257,
-0.0270847100764513,
-0.025692326948046684,
-0.05622938275337219,
-0.00500685628503561,
0.039406344294548035,
0.010328429751098156,
0.02529177814722061,
-0.012598204426467419,
0.02309829741716385,
0.09887826442718506,
-0.04951542615890503,
-0.021801283583045006,
-0.041199278086423874,
-0.0743875801563263,
0.024910302832722664,
-0.030670572072267532,
0.003790905699133873,
0.03038446605205536,
-0.020237237215042114,
0.010233061388134956,
0.005641058087348938,
-0.050011344254016876,
0.03303571417927742,
-0.0918591246008873,
0.057335659861564636,
0.03183406963944435,
-0.012703110463917255,
0.03463790938258171,
0.08163560181856155,
-0.02937355823814869,
0.026989340782165527,
-0.014372061938047409,
0.0006342018023133278,
-0.03486679494380951,
-0.024643270298838615,
-0.015506950207054615,
0.015487875789403915,
-0.07866010069847107,
-0.05256722494959831,
0.004293975420296192,
-0.02010372094810009,
0.0272754468023777,
-0.048332855105400085,
-0.04787508398294449,
0.06740659475326538,
-0.014486504718661308,
-0.011110452935099602,
-0.052376486361026764,
-0.01498242188245058,
-0.053940534591674805,
0.05706862732768059,
-0.037766002118587494,
-0.0024724334944039583,
-0.015545097179710865,
-0.035820480436086655,
-0.011911549605429173,
-0.0016474941512569785,
-0.032825905829668045,
-0.002412827918305993,
-0.007052515167742968,
0.004670681897550821,
-0.09338502585887909,
-0.030250949785113335,
0.018835317343473434,
0.01293199509382248,
0.0541694201529026,
0.006833166815340519,
0.025844916701316833,
-0.04760805144906044,
-0.04734101891517639,
-0.018472915515303612,
-0.030327245593070984,
0.031223710626363754,
0.04436551779508591,
0.039177458733320236,
0.02298385463654995,
0.048371002078056335,
-0.007710558827966452,
-0.023403476923704147,
0.010547777637839317,
-0.028343576937913895,
-0.023708658292889595,
-0.0024223648943006992,
-0.0365452840924263,
-0.059586361050605774,
-0.013437449000775814,
0.029697811231017113,
-0.019235866144299507,
-0.04371700808405876,
-0.05287240445613861,
0.003440425731241703,
0.01455326285213232,
-0.007686716970056295,
0.02096203900873661,
-0.028839493170380592,
-0.009966028854250908,
-0.02485308237373829,
-0.024795860052108765,
0.0543983019888401,
0.06210409477353096,
-0.05271981284022331,
-0.05474163219332695,
-0.041313719004392624,
-0.007395842112600803,
-0.04196222499012947,
0.07049653679132462,
0.03086130879819393,
-0.004537165630608797,
-0.001451988355256617,
0.01326578576117754,
-0.03736545518040657,
-0.014391136355698109,
0.017891166731715202,
0.012636352330446243,
-0.005350183695554733,
0.015287601388990879,
0.04802767559885979,
-0.004432260058820248,
0.03366515040397644,
-0.0033379043452441692,
0.01900698058307171,
-0.07652384042739868,
-0.030651498585939407,
0.03023187629878521,
0.025196408852934837,
0.0037026896607130766,
-0.021381661295890808,
0.029545221477746964,
-0.04066521301865578,
-0.023441625759005547,
-0.04772249609231949,
0.006980988662689924,
-0.04215296357870102,
-0.0271610040217638,
-0.049973197281360626,
-0.05672530084848404,
-0.022449791431427002,
-0.013351617380976677,
0.006513681728392839,
-0.006952377967536449,
-0.041428159922361374,
0.05794601887464523,
0.007577043026685715,
-0.07083986699581146,
0.06439293920993805,
0.057526398450136185,
-0.02029445767402649,
0.09857308119535446,
-0.007009598892182112,
-0.011406095698475838,
-0.025616031140089035,
-0.022335348650813103,
0.04688325151801109,
-0.019665025174617767,
-0.0633629634976387,
-0.018263105303049088,
-0.009288910776376724,
0.026951193809509277,
0.008831141516566277,
-0.03963522985577583,
0.01928354986011982,
0.03162425756454468,
-0.015430654399096966,
0.014972885139286518,
0.008549803867936134,
-0.023899395018815994,
0.009598859585821629,
0.014953811652958393,
-0.004930561408400536,
0.03967337682843208,
0.053711649030447006,
0.019474288448691368,
-0.02773321606218815,
0.032005734741687775,
0.07389166206121445,
0.059204887598752975,
-0.048371002078056335,
0.0036073208320885897,
0.04009300097823143,
0.06454553455114365,
-0.010271208360791206,
0.005927164573222399,
0.00035047996789216995,
0.0019383687758818269,
0.010042323730885983,
0.0907147005200386,
0.02088574506342411,
-0.015754908323287964,
0.0002320141502423212,
0.06172261759638786,
0.028705976903438568,
-0.015182696282863617,
0.029735958203673363,
-0.006933304015547037,
-0.01804375648498535,
0.011739886365830898,
0.042763322591781616,
-0.030136507004499435,
0.022964781150221825,
-0.02185850404202938,
0.03257794678211212,
-0.036793243139982224,
0.0033092936500906944,
-0.048638034611940384,
-0.016412952914834023,
0.022964781150221825,
0.07747752964496613,
0.01569768786430359,
0.0029683506581932306,
-0.023136446252465248,
0.019970204681158066,
-0.008802530355751514,
-0.03299756720662117,
-0.055733464658260345,
-0.038471732288599014,
-0.02115277573466301,
-0.021381661295890808,
0.023632362484931946,
0.03538178652524948,
0.03698398172855377,
0.0003284259291831404,
0.02088574506342411,
-0.015802592039108276,
-0.015640465542674065,
-0.028038395568728447,
0.0057173534296453,
-0.028973009437322617,
-0.016546469181776047,
0.02996484376490116,
-0.011587296612560749,
0.01421947218477726,
-0.052223898470401764,
-0.02443346008658409,
-0.003230614587664604,
-0.06362999230623245,
0.044708844274282455,
-0.018844854086637497,
-0.04150445759296417,
0.05653456225991249,
0.008030043914914131,
-0.019474288448691368,
0.02622639201581478,
0.10681293904781342,
0.06820768862962723,
-0.02653157152235508,
-0.005836564116179943,
-0.009527333080768585,
0.014629557728767395,
0.008502119220793247,
0.07095430791378021,
0.025272704660892487,
0.019779467955231667,
0.07911787182092667,
-0.01470585260540247,
-0.07583718746900558,
-0.019073739647865295,
-0.04032188281416893,
0.037270087748765945,
-0.020675932988524437,
-0.026169169694185257,
-0.0030541825108230114,
0.002520117675885558,
0.04760805144906044,
0.025101041421294212,
0.08773919939994812,
-0.00204565841704607,
0.05466533452272415,
-0.004983014427125454,
-0.08049117773771286,
0.020485196262598038,
0.021438881754875183,
-0.044594403356313705,
0.03038446605205536,
0.0031996197067201138,
-0.01192108727991581,
-0.012178582139313221,
0.04821841046214104,
-0.04028373584151268,
0.016803964972496033,
-0.0185396745800972,
-0.0034833415411412716,
-0.02111462876200676,
0.06301963329315186,
-0.003192467149347067,
-0.006036838516592979,
0.01195923425257206,
0.04779879003763199,
-0.04318294674158096,
-0.00640877615660429,
-0.043030355125665665,
-0.004484713077545166,
0.06866545975208282,
0.008969426155090332,
0.10612628608942032,
0.0050593093037605286,
0.0049925511702895164,
-0.02271682396531105,
-0.06530848145484924,
0.0455099418759346,
-0.05718306824564934,
-0.04207666963338852,
-0.010595462284982204,
-0.03423736244440079,
-0.007648569531738758,
0.0023544146679341793,
0.03759434074163437,
-0.024910302832722664,
0.018911611288785934,
0.07038209587335587,
0.032902199774980545,
-0.022144610062241554,
0.005831795744597912,
0.04982060566544533,
0.04707398638129234,
-0.005240509752184153,
0.05252907797694206,
-0.02821006067097187,
-0.03339811787009239,
0.0368504635989666,
0.02166776731610298,
0.037422675639390945,
0.002572570461779833,
0.015487875789403915,
-0.008292308077216148,
-0.019426602870225906,
0.019417066127061844,
0.08278002589941025,
-0.03629732504487038,
-0.044594403356313705,
-0.004034095909446478,
-0.007348157931119204,
-0.035820480436086655,
0.03763248771429062,
-0.010290281847119331,
0.00952256377786398,
0.04077965393662453,
0.06767362356185913,
-0.03276868537068367,
0.01706145890057087,
-0.06252371519804001,
0.0024044832680374384,
-0.04150445759296417,
-0.01651785708963871,
-0.0640496164560318,
0.06935211271047592,
0.03223462030291557,
-0.02843894436955452,
-0.0009882580488920212,
0.004551470745354891,
0.015239917673170567,
-0.020599639043211937,
0.046806953847408295,
0.05245278403162956,
0.05313943699002266,
0.04089409485459328,
-0.023899395018815994,
-0.008535497821867466,
0.0035739417653530836,
-0.0361638106405735,
0.011453780345618725,
0.02298385463654995,
-0.04554808884859085,
0.006451692432165146,
0.013742628507316113,
-0.007028672844171524,
0.027332667261362076,
-0.04039818048477173,
0.02656971849501133,
-0.013065511360764503,
0.06294333934783936,
-0.06740659475326538,
-0.06633846461772919,
-0.015392507426440716,
-0.03236813470721245,
0.003006498096510768,
0.04608215391635895,
0.02832450158894062,
-0.03538178652524948,
0.03809025511145592,
0.06897064298391342,
0.012865236960351467,
0.05252907797694206,
-0.0273898895829916,
0.013170416466891766,
0.02290756069123745,
0.03503846004605293,
-0.007777316961437464,
0.0003808787150774151,
0.02594028413295746,
-0.004181917291134596,
0.041199278086423874,
0.05088873580098152,
0.04779879003763199,
0.04760805144906044,
-0.005149909760802984,
0.025978432968258858,
0.00003062229370698333,
-0.00048041981062851846,
-0.027485257014632225,
0.020542416721582413,
-0.006685345433652401,
-0.019817614927887917,
-0.04554808884859085,
-0.016222214326262474,
-0.016308046877384186,
-0.02018001675605774,
-0.03503846004605293,
-0.031929440796375275,
0.03515290096402168,
0.057602692395448685,
-0.0054503208957612514,
0.025387147441506386,
0.0018596895970404148,
-0.00293735577724874,
-0.009441500529646873,
0.01089110504835844,
-0.0013697328977286816,
0.0011086610611528158,
-0.00453001307323575,
0.06805510073900223,
-0.08468740433454514,
0.013551891781389713,
0.04417477920651436,
-0.00706205191090703,
0.02103833481669426,
-0.006666271947324276,
0.022487938404083252,
0.01838708482682705,
-0.03747989609837532,
-0.042801469564437866,
-0.0545508936047554,
0.0019300240091979504,
0.022449791431427002,
0.065270334482193,
0.004556239582598209,
-0.04192407801747322,
-0.00046909478260204196,
-0.0003689576406031847,
0.052300192415714264,
-0.014372061938047409,
0.006036838516592979,
0.019073739647865295,
0.07606606930494308,
-0.0017416707705706358,
0.007829769514501095,
-0.0032401513308286667,
-0.028534313663840294,
-0.0027656920719891787,
0.0002677774173207581,
0.03873876482248306,
-0.024357164278626442,
-0.028038395568728447,
0.05172798037528992,
-0.016813501715660095,
0.03034631907939911,
0.007844075560569763,
-0.008707161992788315,
0.022774044424295425,
0.006179891526699066,
0.018692264333367348,
0.011701738461852074,
0.08300891518592834,
-0.052147600799798965,
-0.011816181242465973,
0.027408963069319725,
-0.014658167958259583,
0.018167736008763313,
0.003056566696614027,
0.023289036005735397,
0.033836811780929565,
0.08056747168302536,
-0.006585208233445883,
0.023670509457588196,
-0.0317196287214756,
-0.05706862732768059,
-0.010967399924993515,
0.03704120218753815,
-0.011634980328381062,
0.0027203920762985945,
0.06084522604942322,
-0.050202082842588425,
0.04238184913992882,
0.008444897830486298,
-0.0066948821768164635,
0.006852240767329931,
-0.01171127613633871,
0.010337966494262218,
-0.01104369480162859,
0.002672707661986351,
0.03158611059188843,
-0.011568223126232624,
-0.020733153447508812,
-0.0029111295007169247,
0.06557551771402359,
0.005626752972602844,
-0.034847721457481384,
0.04768434911966324,
0.02166776731610298,
-0.007825001142919064,
-0.029087452217936516,
0.06874175369739532,
-0.02391846850514412,
-0.01297014206647873,
0.015392507426440716,
-0.03625917807221413,
0.055657170712947845,
-0.0062514180317521095,
-0.036449916660785675,
0.0316433347761631,
-0.00222566700540483,
-0.044861435890197754,
-0.02996484376490116,
0.021877579391002655,
-0.0031161720398813486,
0.01464863121509552,
-0.0005957563407719135,
0.030594278126955032,
0.01976039446890354,
0.019026054069399834,
0.021763136610388756,
-0.03643084317445755,
-0.011692201718688011,
-0.10749959200620651,
0.009470111690461636,
-0.019178643822669983,
-0.012397930026054382,
-0.020504269748926163,
-0.038548026233911514,
0.015535560436546803,
0.006265723146498203,
-0.044632550328969955,
0.054054975509643555,
-0.011778034269809723,
-0.009579785168170929,
0.03011743351817131,
-0.005159446503967047,
0.016346193850040436,
0.007042977958917618,
0.015592781826853752,
0.012226266786456108,
-0.0272754468023777,
0.004646839573979378,
0.021286292001605034,
-0.041199278086423874,
-0.016117310151457787,
-0.04245814308524132,
-0.06187520921230316,
0.01449604146182537,
0.004384575877338648,
-0.004134233109652996,
0.007190799806267023,
-0.0738535150885582,
0.0157453715801239,
-0.030441688373684883,
-0.012884310446679592,
-0.000920903985388577,
0.020199090242385864,
0.009832512587308884,
-0.017662283033132553,
0.04554808884859085,
-0.030136507004499435,
0.0317196287214756,
-0.028782272711396217,
0.030880384147167206,
-0.025139188393950462,
-0.032120175659656525,
0.03246350213885307,
-0.010671757161617279,
-0.08682365715503693,
0.023899395018815994,
0.03892949968576431,
-0.0008630866650491953,
-0.08331409096717834,
-0.0364689901471138,
0.019607802852988243,
-0.02910652570426464,
-0.019588729366660118,
-0.07724864035844803,
-0.06034931167960167,
0.046387333422899246,
0.01862550526857376,
-0.06916137784719467,
-0.0022065932862460613,
0.018253568559885025,
0.0359349250793457,
0.0275043323636055,
-0.03030817210674286,
-0.023079223930835724,
-0.03967337682843208,
0.01229302491992712,
0.10170117765665054,
-0.016861185431480408,
0.0013578118523582816,
0.013656796887516975,
0.0037718319799751043,
-0.08018600195646286,
-0.022297201678156853,
-0.04047447443008423,
0.008139718323946,
-0.06664364039897919,
0.011148600839078426,
0.031700555235147476,
-0.0230601504445076,
-0.04036003351211548,
0.07503608614206314,
-0.004727902822196484,
0.010538240894675255,
-0.050202082842588425,
0.008258928544819355,
-0.00127794046420604,
-0.02859153412282467,
-0.08163560181856155,
0.030250949785113335,
0.06580439954996109,
0.017070995643734932,
-0.01670859567821026,
0.008010970428586006,
-0.048332855105400085,
-0.0014651016099378467,
0.037308234721422195,
0.08331409096717834,
0.017271270975470543,
0.004279670305550098,
0.06034931167960167,
0.015001495368778706,
0.025177335366606712,
0.03963522985577583,
0.02574954740703106,
0.016451099887490273,
0.005164214875549078,
0.04901950806379318,
-0.018472915515303612,
0.02126721851527691,
0.009813439100980759,
0.03191036358475685,
0.03299756720662117,
-0.0542457140982151,
-0.04753175750374794,
-0.05081244185566902,
-0.028019322082400322,
0.02668416127562523,
0.004978246055543423,
-0.005540921352803707,
-0.036945831030607224,
-0.025196408852934837,
-0.010881568305194378,
0.01324671134352684,
-0.02025631070137024,
0.025215482339262962,
-0.030212802812457085,
-0.06256186217069626,
-0.04047447443008423,
-0.003016035072505474,
0.01952197216451168,
-0.034733280539512634,
0.01857782155275345,
-0.018482452258467674,
-0.00025526026729494333,
-0.053635355085134506,
0.013914292678236961,
0.0020599637646228075,
-0.02485308237373829,
-0.003855279413983226,
-0.004584849812090397,
0.06713955849409103,
-0.004293975420296192,
-0.009746680967509747,
-0.10040416568517685,
-0.023193666711449623,
-0.025101041421294212,
0.014438820071518421,
-0.07419684529304504,
0.02664601430296898,
0.012025992386043072,
-0.08712884038686752,
-0.029049305245280266,
-0.012922458350658417,
0.05138465389609337,
-0.038986723870038986,
-0.04196222499012947,
0.0317196287214756,
0.0011515769874677062,
0.042725175619125366,
-0.003650236874818802,
0.0019121423829346895,
-0.009684691205620766,
0.032902199774980545,
0.0043464284390211105,
0.0003367706958670169,
0.0031376301776617765,
0.018530137836933136,
-0.00899803638458252,
-0.00009589024557499215,
0.015926571562886238,
0.01808190532028675,
0.028458017855882645,
0.000994218629784882,
0.0065613663755357265,
0.08186449110507965,
-0.05489422008395195,
0.05886155739426613,
-0.0029278190340846777,
0.05184242129325867,
0.0032163092400878668,
-0.0017059075180441141,
-0.06446924060583115,
0.020866669714450836,
0.02271682396531105,
0.05699233338236809,
-0.030460761860013008,
-0.06198965013027191,
0.010862494818866253,
0.011520538479089737,
0.03633547201752663,
-0.022259052842855453,
-0.0004741612356156111,
0.06187520921230316,
-0.003674078965559602,
-0.022964781150221825,
-0.03974967077374458,
0.05718306824564934,
-0.018129589036107063,
0.055695317685604095,
0.005850869230926037,
-0.006671040318906307,
-0.020714079961180687,
0.06671994179487228,
-0.07083986699581146,
0.02193479984998703,
-0.039330050349235535,
-0.0553138442337513,
-0.11955419927835464,
-0.03822377324104309,
-0.053940534591674805,
0.0316433347761631,
-0.019378919154405594,
-0.009231689386069775,
-0.00988019723445177,
0.019550582394003868,
-0.006375397089868784
]
|
36,413 | torch.optim.optimizer | profile_hook_step | null | @staticmethod
def profile_hook_step(func: Callable[_P, R]) -> Callable[_P, R]:
@functools.wraps(func)
def wrapper(*args: _P.args, **kwargs: _P.kwargs) -> R:
self, *_ = args
self = cast(Optimizer, self)
profile_name = f"Optimizer.step#{self.__class__.__name__}.step"
with torch.autograd.profiler.record_function(profile_name):
# call optimizer step pre hooks
for pre_hook in chain(_global_optimizer_pre_hooks.values(), self._optimizer_step_pre_hooks.values()):
result = pre_hook(self, args, kwargs)
if result is not None:
if isinstance(result, tuple) and len(result) == 2:
args, kwargs = result # type: ignore[assignment]
else:
raise RuntimeError(
f"{func} must return None or a tuple of (new_args, new_kwargs), but got {result}."
)
out = func(*args, **kwargs)
self._optimizer_step_code()
# call optimizer step post hooks
for post_hook in chain(self._optimizer_step_post_hooks.values(), _global_optimizer_post_hooks.values()):
post_hook(self, args, kwargs)
return out
return wrapper
| (func: Callable[~_P, ~R]) -> Callable[~_P, ~R] | [
-0.051124706864356995,
-0.024269243702292442,
-0.031671829521656036,
0.07338869571685791,
-0.026480648666620255,
0.017447618767619133,
-0.020502356812357903,
-0.021289467811584473,
-0.003834821516647935,
-0.029310498386621475,
0.0006231292500160635,
0.007641531992703676,
0.012059658765792847,
-0.011553659103810787,
-0.030547387897968292,
0.018974987789988518,
0.012696843594312668,
0.0012181473430246115,
-0.025225020945072174,
-0.029310498386621475,
0.009370364248752594,
-0.0114974370226264,
0.03212160989642143,
0.011647363193333149,
-0.03155938535928726,
0.03399568051099777,
0.052698928862810135,
-0.02614331617951393,
0.00984825287014246,
0.03333975747227669,
-0.0044345250353217125,
-0.043291084468364716,
-0.028186054900288582,
-0.0009587053791619837,
0.025150056928396225,
-0.03635701164603233,
-0.0456898957490921,
0.03513886407017708,
-0.09452823549509048,
-0.028392203152179718,
-0.03485775366425514,
-0.06143210828304291,
-0.0017534294165670872,
0.0025862206239253283,
-0.015358027070760727,
-0.025562353432178497,
-0.027904944494366646,
-0.027605092152953148,
0.04070486128330231,
-0.08500794321298599,
0.024737762287259102,
-0.054647963494062424,
0.07151462137699127,
0.0329836830496788,
0.04467789828777313,
0.018019210547208786,
0.043441008776426315,
-0.0668669193983078,
0.0005226906505413353,
0.003921497613191605,
0.04201671481132507,
-0.047901302576065063,
-0.026386946439743042,
0.067166768014431,
0.060869887471199036,
-0.057496555149555206,
-0.05580988898873329,
-0.014420990832149982,
0.004994404036551714,
0.014505323953926563,
-0.03427679091691971,
-0.023763243108987808,
0.059520553797483444,
-0.02589968591928482,
-0.019883912056684494,
-0.030022647231817245,
-0.03682553023099899,
-0.07391343265771866,
0.08800645917654037,
-0.018412765115499496,
-0.009951326996088028,
-0.017597544938325882,
-0.03178427368402481,
0.0023285355418920517,
-0.013109139166772366,
-0.05408574268221855,
0.017541320994496346,
-0.05704677850008011,
-0.028204796835780144,
-0.014955101534724236,
-0.035288792103528976,
-0.014308545738458633,
0.019883912056684494,
0.024287983775138855,
-0.010035660117864609,
-0.0049007004126906395,
-0.012856139801442623,
0.008292772807180882,
-0.03823108598589897,
-0.004408756271004677,
0.003199979430064559,
0.0329836830496788,
0.005575366783887148,
0.03176553547382355,
0.08298394829034805,
-0.02769879624247551,
0.003464692272245884,
-0.008428642526268959,
0.004008173476904631,
0.0019092117436230183,
0.013437102548778057,
-0.08800645917654037,
-0.05314870551228523,
0.0052427188493311405,
0.01114136353135109,
0.034576643258333206,
-0.036450717598199844,
-0.045090191066265106,
0.00408079382032156,
0.020464874804019928,
0.004368932452052832,
-0.02486894652247429,
-0.04677685722708702,
-0.015236211940646172,
-0.0508248545229435,
0.007735235616564751,
0.05903329327702522,
0.08036024123430252,
-0.054910335689783096,
-0.03776256740093231,
0.026237020269036293,
0.008269346319139004,
-0.012537547387182713,
0.006770088337361813,
0.029404202476143837,
0.02009006030857563,
0.02856086939573288,
0.03165309131145477,
-0.035757310688495636,
0.001905697863548994,
-0.017307063564658165,
0.0010582655668258667,
-0.005781514570116997,
0.00238358648493886,
0.05108722671866417,
0.017709989100694656,
-0.023744503036141396,
0.07612483948469162,
0.04550248757004738,
-0.04981285706162453,
0.042578935623168945,
-0.022170281037688255,
0.01432728674262762,
0.00019370300287846476,
0.0008081939304247499,
0.020895911380648613,
-0.023763243108987808,
0.028373463079333305,
-0.022563837468624115,
-0.024681540206074715,
0.0019045264925807714,
-0.031971681863069534,
0.005903329234570265,
-0.04520263522863388,
0.032683830708265305,
0.01079465914517641,
0.005861162673681974,
0.02676176093518734,
-0.03420183062553406,
0.03913063928484917,
-0.0033499051351100206,
-0.05224915221333504,
0.0919794961810112,
0.05251152068376541,
-0.005153700243681669,
0.10757178068161011,
0.0077820876613259315,
0.011469325982034206,
-0.02614331617951393,
-0.0052942559123039246,
0.04820115491747856,
0.0010998465586453676,
-0.0508248545229435,
-0.019321691244840622,
-0.032458942383527756,
0.0009323512203991413,
0.0360759012401104,
-0.04411567375063896,
-0.009838882833719254,
0.05997033044695854,
-0.01345584262162447,
0.031821757555007935,
0.03705041855573654,
-0.03853093832731247,
-0.001797938602976501,
0.019021838903427124,
-0.00369895133189857,
0.03427679091691971,
0.09430334717035294,
0.01876883953809738,
0.019162394106388092,
0.014055546373128891,
0.04816367104649544,
0.050899818539619446,
-0.018703246489167213,
0.037069160491228104,
0.011281918734312057,
0.07320128381252289,
-0.04287878796458244,
0.013680731877684593,
0.024044355377554893,
-0.024850206449627876,
0.02016502432525158,
0.07818631827831268,
0.017213359475135803,
-0.02910435199737549,
0.02747390791773796,
0.0580962598323822,
0.01655743271112442,
0.0329836830496788,
0.03067857213318348,
-0.05086233839392662,
-0.043815821409225464,
-0.04137952998280525,
0.06667951494455338,
-0.018890654668211937,
0.019049949944019318,
-0.07440069317817688,
0.009431271813809872,
-0.012462584301829338,
-0.03390197828412056,
-0.031746793538331985,
-0.00005344035889720544,
0.00017759768525138497,
0.04254145175218582,
0.0351763479411602,
0.003251516493037343,
-0.027642574161291122,
0.025880945846438408,
-0.021907910704612732,
-0.01702595129609108,
-0.0023554752115160227,
-0.006343736778944731,
0.026743018999695778,
-0.010063771158456802,
0.010429215617477894,
0.028748277574777603,
-0.014852027408778667,
0.012256436049938202,
0.029179314151406288,
-0.021851688623428345,
0.03399568051099777,
-0.014852027408778667,
0.0360759012401104,
-0.053860854357481,
0.028448425233364105,
0.0679164007306099,
-0.010185586288571358,
0.011675474233925343,
-0.00714021734893322,
-0.028841981664299965,
-0.03639449551701546,
-0.03916812315583229,
-0.010644733905792236,
-0.020296208560466766,
-0.010410474613308907,
0.04572737589478493,
-0.024138057604432106,
0.03028501756489277,
0.04355345293879509,
0.07113980501890182,
0.025768501684069633,
-0.03757515922188759,
0.012565658427774906,
0.023013614118099213,
-0.004139358177781105,
-0.023913169279694557,
0.011085140518844128,
0.014458471909165382,
-0.04535256326198578,
0.07886098325252533,
-0.005139644723385572,
-0.059520553797483444,
-0.027811240404844284,
-0.08283402025699615,
0.01711965538561344,
-0.014027435332536697,
0.061881884932518005,
0.044527970254421234,
-0.019246727228164673,
0.044378045946359634,
0.025131316855549812,
0.07046514004468918,
0.03367708995938301,
0.05888336896896362,
0.04898826405405998,
-0.0626315176486969,
0.03868086263537407,
0.010916474275290966,
-0.03133449703454971,
0.028429685160517693,
-0.03410812467336655,
-0.03772508725523949,
0.0036497567780315876,
0.0353262722492218,
-0.0010184415150433779,
-0.020071320235729218,
-0.040292564779520035,
-0.01780369132757187,
-0.03931804746389389,
-0.007763346657156944,
0.011000807397067547,
-0.02188917063176632,
0.009173586964607239,
0.010476067662239075,
-0.05712173879146576,
-0.055997297167778015,
-0.016932249069213867,
-0.002635414944961667,
0.04591478407382965,
-0.022095318883657455,
0.03714412450790405,
0.03588849678635597,
0.028073610737919807,
0.017635025084018707,
-0.041941750794649124,
0.04156693443655968,
-0.028767017647624016,
-0.0011390849249437451,
-0.015142508782446384,
-0.07803639024496078,
-0.01820661686360836,
0.026255760341882706,
0.03202790394425392,
-0.0417543426156044,
0.012190843932330608,
0.011890992522239685,
0.008124105632305145,
0.0013844713103026152,
0.01625758223235607,
0.06529270112514496,
-0.006751347333192825,
-0.015039434656500816,
0.051761891692876816,
0.05213670805096626,
-0.004251802805811167,
0.014552175998687744,
0.015479841269552708,
0.07841120660305023,
0.045015230774879456,
0.02440042793750763,
-0.09317890554666519,
-0.0329836830496788,
0.011347510851919651,
0.03883079066872597,
-0.0029938314110040665,
-0.023294726386666298,
-0.03333975747227669,
0.026162056252360344,
-0.07841120660305023,
-0.03030375763773918,
-0.0002800860384013504,
0.005875218193978071,
0.08770661056041718,
0.10764674097299576,
0.020221246406435966,
-0.03030375763773918,
-0.023032356053590775,
-0.025618575513362885,
0.021757986396551132,
0.002148156054317951,
-0.02378198504447937,
0.03976782411336899,
0.027642574161291122,
-0.027811240404844284,
-0.035513680428266525,
0.03924308717250824,
0.00520055228844285,
0.0044345250353217125,
0.0334334596991539,
0.03729404881596565,
0.016979100182652473,
0.0038160807453095913,
0.0047788857482373714,
0.032608866691589355,
-0.0013305917382240295,
-0.036694347858428955,
0.010298030450940132,
0.01510502677410841,
-0.08808142691850662,
-0.01984643191099167,
0.02754887007176876,
-0.025299983099102974,
-0.036450717598199844,
-0.029647832736372948,
-0.002257086569443345,
-0.017307063564658165,
0.03476405143737793,
-0.032702572643756866,
-0.0544605553150177,
0.00425648782402277,
-0.017925506457686424,
0.06982795149087906,
0.022001614794135094,
0.016304433345794678,
-0.016838544979691505,
-0.02321976236999035,
0.0585460364818573,
0.02841094508767128,
0.03212160989642143,
-0.02998516522347927,
-0.021458134055137634,
0.02715531550347805,
0.003930867649614811,
-0.0024409799370914698,
0.02040865272283554,
-0.017944248393177986,
0.02456909418106079,
-0.03410812467336655,
0.03227153420448303,
0.03958041965961456,
0.032702572643756866,
-0.008185013197362423,
0.0674666240811348,
-0.002569822361692786,
-0.0026728964876383543,
-0.021720504388213158,
-0.005055311601608992,
-0.02432546578347683,
0.02095213532447815,
0.009009605273604393,
-0.03348968178033829,
-0.0021200450137257576,
0.019359173253178596,
-0.02323850244283676,
-0.026724278926849365,
-0.023107318207621574,
0.05802129581570625,
0.024138057604432106,
0.05584736913442612,
0.026724278926849365,
-0.0010231266496703029,
-0.01585465669631958,
-0.0063952733762562275,
0.016697989776730537,
-0.005865848157554865,
-0.011000807397067547,
-0.03225279226899147,
-0.014973841607570648,
0.005861162673681974,
0.053860854357481,
0.027680056169629097,
0.028279758989810944,
0.017166506499052048,
0.023294726386666298,
-0.022545095533132553,
-0.07166454195976257,
-0.05138707906007767,
-0.021177023649215698,
0.027811240404844284,
0.00028140374342910945,
0.026499390602111816,
-0.0013516750186681747,
-0.025075094774365425,
-0.011113251559436321,
0.0014207814820110798,
0.019049949944019318,
0.03225279226899147,
-0.03654441982507706,
0.00819438323378563,
0.035663604736328125,
-0.041791822761297226,
-0.004673469346016645,
-0.012921731919050217,
0.012987324967980385,
0.029235536232590675,
-0.020914653316140175,
0.0026471279561519623,
0.011019548401236534,
0.004938181955367327,
0.01750384084880352,
0.00029985164292156696,
0.037781309336423874,
0.04152945429086685,
0.01907806098461151,
0.04126708582043648,
-0.02151435613632202,
0.01992139406502247,
0.029704054817557335,
0.08133476227521896,
-0.05123715102672577,
-0.01350269466638565,
0.03648819774389267,
-0.01607954502105713,
-0.02895442582666874,
-0.014964471571147442,
0.06244410574436188,
0.01008251216262579,
0.05307374149560928,
-0.01451469399034977,
-0.0017264896305277944,
-0.055772408843040466,
0.003010229440405965,
-0.00933756772428751,
0.039430491626262665,
-0.013849398121237755,
-0.05168692767620087,
0.035195089876651764,
-0.0838085412979126,
0.0709524005651474,
0.006221921648830175,
0.03705041855573654,
0.002301595639437437,
-0.01727895252406597,
-0.02934798039495945,
-0.015751581639051437,
0.02400687336921692,
0.03075353614985943,
-0.03588849678635597,
-0.06592988222837448,
0.00883156806230545,
0.0037762566935271025,
0.023126058280467987,
-0.04823863506317139,
0.04733908176422119,
0.010035660117864609,
0.045802339911460876,
-0.014917619526386261,
0.018890654668211937,
-0.03423931077122688,
-0.007524402346462011,
0.03663812577724457,
-0.008395846001803875,
0.04385330528020859,
0.02708035334944725,
0.017232099547982216,
-0.029853980988264084,
-0.006610792130231857,
0.0002677874290384352,
-0.027736278250813484,
0.02338842861354351,
-0.02040865272283554,
-0.01984643191099167,
0.042091675102710724,
-0.0136526208370924,
0.016669878736138344,
-0.02653687074780464,
0.019509097561240196,
-0.09190453588962555,
-0.03939301148056984,
-0.04456545412540436,
0.023669540882110596,
0.008030402474105358,
0.022263985127210617,
-0.025562353432178497,
0.024587836116552353,
0.01710091531276703,
0.02998516522347927,
0.008972124196588993,
0.013399620540440083,
-0.043815821409225464,
-0.011000807397067547,
-0.012996695004403591,
-0.03021005354821682,
0.026705538854002953,
0.008616049773991108,
0.05303626134991646,
0.03806241974234581,
-0.06559254974126816,
-0.033171091228723526,
0.05318618565797806,
0.0034529792610555887,
-0.031540647149086,
-0.05487285181879997,
-0.06742914021015167,
0.030041387304663658,
0.054572999477386475,
-0.025918427854776382,
0.004734376445412636,
-0.05543507635593414,
-0.019752727821469307,
-0.0038887010887265205,
0.0011010178131982684,
-0.02070850506424904,
-0.0422041192650795,
-0.00423774728551507,
-0.02440042793750763,
0.0541607066988945,
-0.027099093422293663,
0.0042845988646149635,
-0.06847862154245377,
0.02166428230702877,
-0.07698690891265869,
-0.08006039261817932,
0.0580962598323822,
-0.011544289067387581,
-0.042803823947906494,
0.004052682314068079,
0.016276322305202484,
0.010494807735085487,
-0.09467816352844238,
-0.027136575430631638,
0.00816158764064312,
-0.003396756947040558,
-0.030659832060337067,
-0.04212915897369385,
-0.063081294298172,
0.03022879548370838,
-0.023838207125663757,
-0.03082849830389023,
-0.0416044183075428,
-0.0023074522614479065,
0.06847862154245377,
0.018347173929214478,
-0.007486920803785324,
-0.02338842861354351,
-0.03212160989642143,
-0.010251178406178951,
0.07009032368659973,
0.035513680428266525,
-0.03455790504813194,
-0.027755018323659897,
-0.005387959536164999,
0.001140256179496646,
-0.0027408315800130367,
-0.040854789316654205,
0.032683830708265305,
-0.0915297195315361,
0.04216663911938667,
-0.03626330941915512,
-0.06259403377771378,
0.027904944494366646,
0.0709524005651474,
-0.07698690891265869,
0.04805122688412666,
-0.05648455396294594,
-0.009407845325767994,
0.04059241712093353,
-0.040067676454782486,
-0.09857623279094696,
-0.0017534294165670872,
0.05892084911465645,
-0.0006178583716973662,
-0.010888363234698772,
0.03125953674316406,
-0.00961399357765913,
-0.01819724775850773,
0.029722794890403748,
0.09392853081226349,
0.017709989100694656,
-0.003937895409762859,
0.058583516627550125,
-0.033395979553461075,
0.07826127856969833,
0.020071320235729218,
0.02604961208999157,
0.0464395247399807,
-0.016604285687208176,
0.028916943818330765,
-0.05187433585524559,
-0.013605768792331219,
-0.01860954426229,
-0.00878471601754427,
-0.003087535034865141,
-0.036225829273462296,
-0.0009036544943228364,
-0.05329863354563713,
0.01607954502105713,
0.037949975579977036,
-0.061094775795936584,
-0.013043547049164772,
-0.03193420171737671,
-0.04479034245014191,
-0.008840939030051231,
0.0360759012401104,
-0.028448425233364105,
0.013071658089756966,
-0.0508248545229435,
-0.08868112415075302,
-0.02252635546028614,
-0.03705041855573654,
0.004167469684034586,
-0.04047997295856476,
-0.0012275177286937833,
-0.03470782935619354,
0.05221166834235191,
0.019340431317687035,
0.010766548104584217,
0.004050340037792921,
0.020352430641651154,
-0.015864025801420212,
-0.03667560592293739,
0.027455167844891548,
0.014720842242240906,
0.0016843229532241821,
-0.09722690284252167,
-0.04040500894188881,
-0.03626330941915512,
0.04823863506317139,
-0.09557771682739258,
0.011122622527182102,
-0.007018402684479952,
-0.043665897101163864,
-0.0042845988646149635,
0.024437909945845604,
0.0029821183998137712,
-0.014570916071534157,
-0.07016528397798538,
0.04512767493724823,
0.009539030492305756,
0.01663239672780037,
-0.02378198504447937,
0.022151540964841843,
-0.020577318966388702,
0.042578935623168945,
-0.03348968178033829,
-0.04246649146080017,
-0.03082849830389023,
-0.005397329572588205,
-0.006100106984376907,
-0.016060804948210716,
-0.004853848833590746,
0.0025862206239253283,
-0.019602801650762558,
0.006587366107851267,
-0.009089252911508083,
0.06394336372613907,
-0.028373463079333305,
0.012368881143629551,
-0.010494807735085487,
0.0090189753100276,
-0.011206955648958683,
0.007664958015084267,
-0.03185923770070076,
0.001571878558024764,
0.015479841269552708,
-0.007130847312510014,
0.01844087615609169,
-0.0066857547499239445,
-0.037012938410043716,
0.03037872165441513,
0.02402561344206333,
0.02198287472128868,
0.0023379058111459017,
0.11446836590766907,
-0.005059996619820595,
0.017869284376502037,
0.005448866635560989,
0.048538487404584885,
-0.04632708057761192,
0.084408238530159,
0.04392826929688454,
0.02323850244283676,
0.027267759665846825,
0.015470471233129501,
-0.05674692615866661,
0.03838101029396057,
-0.02127072587609291,
-0.020258726552128792,
-0.041716862469911575,
-0.020596060901880264,
-0.04756397008895874,
0.050187669694423676,
-0.03176553547382355,
0.03924308717250824,
0.007158958353102207,
0.006198496092110872,
0.03348968178033829
]
|
36,414 | torch.optim.optimizer | register_load_state_dict_post_hook | Register a load_state_dict post-hook which will be called after
:meth:`~torch.optim.Optimizer.load_state_dict` is called. It should have the
following signature::
hook(optimizer) -> None
The ``optimizer`` argument is the optimizer instance being used.
The hook will be called with argument ``self`` after calling
``load_state_dict`` on ``self``. The registered hook can be used to
perform post-processing after ``load_state_dict`` has loaded the
``state_dict``.
Args:
hook (Callable): The user defined hook to be registered.
prepend (bool): If True, the provided post ``hook`` will be fired before
all the already registered post-hooks on ``load_state_dict``. Otherwise,
the provided ``hook`` will be fired after all the already registered
post-hooks. (default: False)
Returns:
:class:`torch.utils.hooks.RemoveableHandle`:
a handle that can be used to remove the added hook by calling
``handle.remove()``
| def register_load_state_dict_post_hook(
self, hook: Callable[["Optimizer"], None], prepend: bool = False
) -> RemovableHandle:
r"""Register a load_state_dict post-hook which will be called after
:meth:`~torch.optim.Optimizer.load_state_dict` is called. It should have the
following signature::
hook(optimizer) -> None
The ``optimizer`` argument is the optimizer instance being used.
The hook will be called with argument ``self`` after calling
``load_state_dict`` on ``self``. The registered hook can be used to
perform post-processing after ``load_state_dict`` has loaded the
``state_dict``.
Args:
hook (Callable): The user defined hook to be registered.
prepend (bool): If True, the provided post ``hook`` will be fired before
all the already registered post-hooks on ``load_state_dict``. Otherwise,
the provided ``hook`` will be fired after all the already registered
post-hooks. (default: False)
Returns:
:class:`torch.utils.hooks.RemoveableHandle`:
a handle that can be used to remove the added hook by calling
``handle.remove()``
"""
handle = hooks.RemovableHandle(self._optimizer_load_state_dict_post_hooks)
self._optimizer_load_state_dict_post_hooks[handle.id] = hook
if prepend:
self._optimizer_load_state_dict_post_hooks.move_to_end(handle.id, last=False) # type: ignore[attr-defined]
return handle
| (self, hook: Callable[[torch.optim.optimizer.Optimizer], NoneType], prepend: bool = False) -> torch.utils.hooks.RemovableHandle | [
-0.049541547894477844,
0.04260356351733208,
-0.06200823932886124,
0.005741001572459936,
0.008098832331597805,
0.04704820737242699,
-0.02650526911020279,
0.02981165237724781,
0.02135598473250866,
-0.06836805492639542,
0.026938892900943756,
0.023072412237524986,
-0.014652878977358341,
-0.03747234493494034,
-0.050914689898490906,
0.022982073947787285,
-0.022927870973944664,
0.027643533423542976,
-0.07324633002281189,
-0.05416686832904816,
0.01354171708226204,
-0.0035299707669764757,
0.03823118656873703,
0.018429022282361984,
-0.0027620948385447264,
-0.0583585686981678,
0.002266363240778446,
-0.004164597485214472,
0.03114866092801094,
0.05691315606236458,
0.021861879155039787,
-0.038592539727687836,
0.033931080251932144,
-0.007520666811615229,
0.01609829254448414,
-0.026180051267147064,
0.046217095106840134,
0.021066902205348015,
-0.0024120337329804897,
-0.028835998848080635,
0.007669725455343723,
-0.02598130702972412,
0.017760518938302994,
0.0013358782744035125,
0.06287548691034317,
0.04784318804740906,
-0.03626181185245514,
-0.01296355202794075,
0.0412665531039238,
-0.047662507742643356,
0.02534893900156021,
-0.08491804450750351,
0.03561137616634369,
0.03105832263827324,
0.015845345333218575,
-0.028113292530179024,
0.03620760887861252,
-0.044988494366407394,
0.03376847133040428,
-0.0016836808063089848,
0.03217851743102074,
-0.04527757689356804,
-0.03248566761612892,
-0.0026536888908594847,
0.041194282472133636,
-0.037978239357471466,
-0.04657844826579094,
-0.03510548174381256,
-0.01886264607310295,
-0.028998607769608498,
-0.024355217814445496,
-0.04325399920344353,
0.052865996956825256,
0.006626317277550697,
0.012096304446458817,
0.005090565420687199,
-0.03942365199327469,
-0.08542393893003464,
-0.0002910588518716395,
-0.004629840143024921,
-0.029016675427556038,
-0.022331638261675835,
-0.0018959760200232267,
0.04527757689356804,
-0.03693031519651413,
-0.07704053819179535,
0.04209766909480095,
-0.04227834567427635,
-0.01822124421596527,
-0.0027033749502152205,
-0.012900315225124359,
0.03154614940285683,
0.008162069134414196,
-0.005876509007066488,
0.011057413183152676,
-0.019115593284368515,
0.02193414978682995,
0.06609153002500534,
0.028980540111660957,
-0.024337150156497955,
-0.016405442729592323,
-0.037978239357471466,
0.009828811511397362,
0.03132933750748634,
0.030751172453165054,
-0.04155563935637474,
0.007484531495720148,
-0.021211443468928337,
-0.05828629806637764,
-0.03747234493494034,
0.042531292885541916,
-0.08874838799238205,
-0.014698048122227192,
0.015447856858372688,
0.03714712709188461,
0.033389050513505936,
0.002502372022718191,
-0.025746427476406097,
0.004187182057648897,
0.017760518938302994,
-0.03375040367245674,
-0.025638021528720856,
-0.036063067615032196,
0.03044402226805687,
-0.05351643264293671,
0.012403454631567001,
0.060526687651872635,
0.07313792407512665,
-0.009657168760895729,
-0.05178193747997284,
-0.0029924577102065086,
0.037978239357471466,
-0.07429425418376923,
-0.030191073194146156,
-0.003992954734712839,
-0.024210676550865173,
0.036641232669353485,
0.019007187336683273,
0.007457430008798838,
-0.047590237110853195,
0.022476179525256157,
-0.0048782704398036,
-0.035430699586868286,
0.02130178175866604,
-0.0001873109140433371,
-0.007579387165606022,
-0.038664810359478,
0.07552285492420197,
0.039279110729694366,
-0.04209766909480095,
0.019675690680742264,
-0.003907133359462023,
0.009304849430918694,
0.025132127106189728,
-0.024301014840602875,
-0.005908127408474684,
-0.04578347131609917,
0.007660691626369953,
-0.036081135272979736,
-0.02661367505788803,
0.029630975797772408,
-0.007394193205982447,
-0.016559017822146416,
-0.0594787634909153,
-0.028998607769608498,
-0.0020811695139855146,
0.0455305241048336,
-0.028835998848080635,
-0.008315644226968288,
0.02524053305387497,
-0.022458111867308617,
-0.054094597697257996,
0.034563448280096054,
0.07660691440105438,
-0.0070644584484398365,
0.09597545862197876,
-0.003455441677942872,
-0.03517775237560272,
-0.0609603151679039,
0.003979403991252184,
0.06016533449292183,
0.0005713900318369269,
-0.017137182876467705,
-0.023451833054423332,
-0.06836805492639542,
-0.028293969109654427,
-0.013071957975625992,
-0.014806454069912434,
0.006608249619603157,
0.07595647871494293,
-0.000842405017465353,
0.011509104631841183,
0.013812732882797718,
-0.050155848264694214,
-0.013586887158453465,
0.020217720419168472,
-0.024951450526714325,
0.006463708356022835,
0.026180051267147064,
-0.019693758338689804,
0.0060662198811769485,
-0.00227878475561738,
-0.02861918695271015,
0.007999460212886333,
-0.000492061662953347,
-0.006395954638719559,
-0.006707621738314629,
0.007412260863929987,
-0.011861423961818218,
0.010244367644190788,
0.03992954641580582,
-0.01134649571031332,
-0.034635718911886215,
0.07429425418376923,
-0.01067799236625433,
-0.07089753448963165,
-0.010370842181146145,
0.06609153002500534,
0.012258913367986679,
-0.033334847539663315,
0.05452822521328926,
0.048854976892471313,
0.024264879524707794,
0.009146757423877716,
-0.010488281957805157,
-0.008817022666335106,
-0.016504814848303795,
-0.029558705165982246,
0.056624073535203934,
0.02842044271528721,
-0.021626999601721764,
-0.02148245833814144,
-0.008979631587862968,
-0.025547683238983154,
0.13695292174816132,
0.0715479701757431,
0.004742763005197048,
-0.01743529923260212,
0.07646237313747406,
0.06923530250787735,
0.03230499103665352,
0.029378028586506844,
0.004801482893526554,
-0.08686935156583786,
-0.04784318804740906,
0.0730295181274414,
0.009413255378603935,
-0.0017378838965669274,
-0.004148788284510374,
0.03250373527407646,
0.015773074701428413,
0.035322293639183044,
0.022512314841151237,
0.03626181185245514,
-0.014689014293253422,
0.08556848019361496,
0.05189034342765808,
0.012701570987701416,
-0.034563448280096054,
-0.008672480471432209,
0.00017390130960848182,
0.004523692652583122,
-0.023704780265688896,
0.012213744223117828,
-0.02386738918721676,
-0.022150961682200432,
0.06446544080972672,
-0.0035006108228117228,
0.008966080844402313,
0.0018982344772666693,
0.07353541254997253,
-0.017254622653126717,
-0.06327297538518906,
-0.022331638261675835,
0.01873617246747017,
0.012837078422307968,
0.01073219534009695,
-0.0207236148416996,
0.026740148663520813,
0.037942104041576385,
0.06612766534090042,
0.012511860579252243,
0.03288315609097481,
-0.02731831558048725,
-0.041158147156238556,
0.02139212004840374,
-0.051565125584602356,
0.08267764747142792,
0.021590864285826683,
-0.022241299971938133,
0.05886446312069893,
0.02661367505788803,
0.036008864641189575,
0.05236010253429413,
0.02708343416452408,
-0.030678901821374893,
-0.06974119693040848,
0.04076065868139267,
0.022494247183203697,
0.014192153699696064,
0.037978239357471466,
-0.03557524085044861,
0.006517911329865456,
0.014029544778168201,
0.011039345525205135,
-0.028239766135811806,
0.037905968725681305,
-0.026306524872779846,
-0.04148336872458458,
0.006057186052203178,
0.0019580835942178965,
0.00878540426492691,
-0.035394564270973206,
-0.013406209647655487,
0.02079588733613491,
-0.06666969507932663,
-0.017877958714962006,
-0.05044493079185486,
0.0014047612203285098,
-0.005849407520145178,
-0.057997215539216995,
0.06439317017793655,
-0.01455350685864687,
-0.012195676565170288,
0.0035638476256281137,
-0.04007408767938614,
0.011635578237473965,
-0.014219255186617374,
0.045024629682302475,
-0.04451873525977135,
-0.06088804453611374,
-0.065043605864048,
-0.007222550455480814,
0.051854208111763,
0.008473736234009266,
-0.01998284086585045,
0.041158147156238556,
0.004040382336825132,
-0.04209766909480095,
-0.02397579699754715,
-0.013993409462273121,
0.020416464656591415,
-0.013993409462273121,
0.03819505125284195,
0.014128916896879673,
0.00536158075556159,
-0.03830345720052719,
0.009964318946003914,
0.037183262407779694,
0.04224221035838127,
-0.037942104041576385,
-0.07237908244132996,
-0.02386738918721676,
-0.004756313748657703,
0.07494468986988068,
-0.08347263187170029,
0.010858668945729733,
-0.009219028055667877,
0.01557433046400547,
-0.038592539727687836,
-0.02014544978737831,
-0.016531916335225105,
-0.04025476425886154,
0.053480297327041626,
0.09207283705472946,
-0.002954063704237342,
-0.02731831558048725,
-0.06851259618997574,
-0.043759893625974655,
-0.022964006289839745,
0.028293969109654427,
-0.07501696050167084,
0.01557433046400547,
0.053986191749572754,
0.025674156844615936,
-0.04213380441069603,
0.028980540111660957,
-0.004618547856807709,
0.02473463863134384,
0.03517775237560272,
0.04462714120745659,
0.021879946812987328,
0.04086906462907791,
-0.014941961504518986,
0.009774608537554741,
-0.03244953230023384,
-0.020886225625872612,
0.04679526016116142,
0.007552285213023424,
-0.07913638651371002,
0.006120422855019569,
0.013532683253288269,
0.0047608306631445885,
0.008830573409795761,
0.0014442842220887542,
-0.002145535545423627,
-0.04390443488955498,
-0.01133746188133955,
0.005881025921553373,
-0.009774608537554741,
0.026993095874786377,
0.0043701170943677425,
0.018537428230047226,
-0.0009316141367889941,
0.023487968370318413,
-0.02970324642956257,
-0.04086906462907791,
0.07071685791015625,
-0.0055106389336287975,
-0.0013155521592125297,
0.0016204440034925938,
0.009639101102948189,
-0.006861197296530008,
-0.033262576907873154,
-0.010434078983962536,
-0.008830573409795761,
0.04354308173060417,
0.040543846786022186,
-0.058033350855112076,
0.0025294735096395016,
0.04878270626068115,
0.041844721883535385,
-0.005704866256564856,
0.03826732188463211,
-0.026053577661514282,
-0.0025836764834821224,
-0.0334613211452961,
0.0045078834518790245,
-0.03833959251642227,
0.010163063183426857,
0.028998607769608498,
0.010289536789059639,
0.04972222447395325,
0.04614482447504997,
-0.009331950917840004,
-0.017868924885988235,
0.023758983239531517,
0.010036589577794075,
-0.023162750527262688,
0.02404806762933731,
-0.008627311326563358,
-0.0046343570575118065,
0.011536206118762493,
0.04166404530405998,
0.050300389528274536,
-0.006716655567288399,
-0.006043635308742523,
-0.014842589385807514,
0.05514252558350563,
-0.0026356212329119444,
0.02141018770635128,
-0.007285787258297205,
0.0034441493917256594,
0.06041828170418739,
-0.018573563545942307,
-0.034707989543676376,
-0.022494247183203697,
-0.050155848264694214,
-0.07682372629642487,
0.014932927675545216,
-0.014282491989433765,
-0.0001541397941764444,
0.00869958195835352,
0.016540950164198875,
-0.015773074701428413,
0.005731967743486166,
-0.0440489761531353,
0.013785631395876408,
-0.01816704124212265,
-0.00161705631762743,
0.005844890605658293,
-0.004715661518275738,
0.004959574900567532,
-0.04263969883322716,
-0.016405442729592323,
0.013993409462273121,
0.03561137616634369,
0.026306524872779846,
-0.004792449064552784,
-0.011635578237473965,
0.07053618133068085,
0.008234339766204357,
-0.021771540865302086,
0.01740819774568081,
0.021608931943774223,
0.016459645703434944,
-0.014824521727859974,
0.03750848025083542,
0.02404806762933731,
0.09120558947324753,
-0.00877637043595314,
-0.0016328655183315277,
0.027751939371228218,
-0.013135194778442383,
0.04235061630606651,
-0.014038578607141972,
0.02457202970981598,
0.007339990232139826,
0.07071685791015625,
-0.05828629806637764,
-0.02979358471930027,
-0.02719184197485447,
-0.01074122916907072,
0.04137495905160904,
-0.01388500351458788,
-0.04170018061995506,
-0.0390261635184288,
0.08795341104269028,
-0.03747234493494034,
0.04260356351733208,
-0.04155563935637474,
-0.03676770627498627,
0.0375446155667305,
-0.014508337713778019,
-0.014282491989433765,
-0.005930711980909109,
0.0030127838253974915,
0.07299338281154633,
-0.05239623785018921,
0.007114144507795572,
0.017760518938302994,
0.03192557021975517,
0.02910701371729374,
-0.09416868537664413,
0.00031364342430606484,
0.025800630450248718,
0.0442296527326107,
-0.004202991258352995,
0.03048015758395195,
-0.010163063183426857,
-0.009246129542589188,
0.012078236788511276,
0.010939973406493664,
0.007114144507795572,
0.009313883259892464,
0.023578306660056114,
0.024788841605186462,
0.004977642558515072,
-0.030986052006483078,
-0.03291929140686989,
0.02198835276067257,
0.020452599972486496,
-0.0017435300396755338,
-0.015854379162192345,
0.02018158510327339,
0.03629794716835022,
-0.01071412768214941,
0.048854976892471313,
-0.06002079322934151,
-0.037833698093891144,
-0.07198159396648407,
-0.00201454502530396,
0.008880259469151497,
-0.013099059462547302,
-0.006924434099346399,
-0.03349745646119118,
0.07834140956401825,
0.020362261682748795,
-0.008107866160571575,
-0.020579073578119278,
-0.04708434268832207,
0.04151950404047966,
-0.005650663282722235,
0.02657753974199295,
0.012087270617485046,
0.03411175683140755,
-0.014978096820414066,
-0.006097838282585144,
-0.014183119870722294,
0.024228744208812714,
0.09467457979917526,
-0.03483446314930916,
-0.007922672666609287,
-0.040471576154232025,
-0.06403181701898575,
0.028022954240441322,
0.027011163532733917,
-0.006088804453611374,
0.0195130817592144,
-0.017335927113890648,
0.026993095874786377,
0.04151950404047966,
0.010235333815217018,
-0.0035367461387068033,
-0.025800630450248718,
0.034003350883722305,
0.004855685867369175,
0.14692628383636475,
0.02195221744477749,
-0.00536158075556159,
-0.07436652481555939,
0.053986191749572754,
-0.027878412976861,
-0.0663444772362709,
0.04654231294989586,
-0.024301014840602875,
0.013803699053823948,
0.026198118925094604,
-0.015032299794256687,
-0.005126700736582279,
-0.020524870604276657,
-0.031383540481328964,
0.004751796834170818,
-0.02198835276067257,
-0.02392159402370453,
-0.06211664527654648,
0.002714667236432433,
0.049649953842163086,
-0.006779892835766077,
-0.05554001405835152,
-0.013993409462273121,
-0.018429022282361984,
0.014869690872728825,
0.02079588733613491,
-0.010163063183426857,
-0.054022327065467834,
0.016974573954939842,
-0.04592801257967949,
0.04661458358168602,
-0.0311305932700634,
-0.009011249989271164,
-0.05875605717301369,
0.035322293639183044,
-0.01354171708226204,
0.0032070111483335495,
-0.0702470988035202,
-0.004099102225154638,
-0.0225845854729414,
0.002124080201610923,
-0.04477168247103691,
-0.03582818806171417,
0.03714712709188461,
0.013505581766366959,
-0.05904513970017433,
0.024210676550865173,
0.02392159402370453,
0.05897286906838417,
0.007611005567014217,
0.0011252770200371742,
-0.1105741336941719,
0.04231448099017143,
0.03501513972878456,
0.007841368205845356,
-0.009205477312207222,
-0.024824976921081543,
0.03248566761612892,
0.016540950164198875,
0.01613442786037922,
0.07667918503284454,
-0.031365472823381424,
0.013406209647655487,
-0.010054657235741615,
-0.05828629806637764,
0.03418402746319771,
0.005808755289763212,
0.006671486422419548,
0.07920865714550018,
0.017073946073651314,
0.04347081109881401,
-0.00031731341732665896,
-0.029522569850087166,
0.0030556945130228996,
-0.04094133526086807,
0.0012590906117111444,
-0.002865983871743083,
-0.018952984362840652,
-0.05373324453830719,
0.022440044209361076,
0.01075026299804449,
-0.049541547894477844,
-0.01996477320790291,
-0.06204437464475632,
-0.05637112632393837,
0.00837888102978468,
0.04227834567427635,
-0.05514252558350563,
-0.03375040367245674,
-0.021789608523249626,
0.05387778580188751,
0.004769864492118359,
-0.013469446450471878,
0.0005146462353877723,
-0.01617959700524807,
-0.0078097498044371605,
-0.02731831558048725,
0.05376937985420227,
0.010370842181146145,
0.011102582328021526,
0.015041333623230457,
0.03873708099126816,
0.02973938174545765,
-0.00002030848372669425,
0.043037187308073044,
0.0019467913080006838,
-0.00596684729680419,
-0.08592983335256577,
-0.028004886582493782,
-0.032738614827394485,
-0.00879443809390068,
-0.018347717821598053,
0.02079588733613491,
0.02663174271583557,
0.019549217075109482,
-0.06359819322824478,
0.010813499800860882,
0.007936223410069942,
-0.0479515939950943,
-0.04513303562998772,
-0.007845885120332241,
0.029432231560349464,
0.027065366506576538,
-0.013433311134576797,
0.021916082128882408,
-0.015809210017323494,
0.0182122103869915,
-0.017155250534415245,
-0.052215561270713806,
-0.06688650697469711,
-0.01690230332314968,
-0.01071412768214941,
-0.04769864305853844,
0.03044402226805687,
-0.04155563935637474,
-0.03255793824791908,
0.029504502192139626,
-0.021139172837138176,
0.025095991790294647,
-0.05264918506145477,
0.0018361267866566777,
-0.00024179622414521873,
0.015818243846297264,
-0.011192920617759228,
-0.012593165040016174,
-0.05102309584617615,
-0.012728672474622726,
0.0008288542740046978,
0.024806909263134003,
0.04975835978984833,
0.02384932152926922,
0.0051899380050599575,
0.010199198499321938,
0.03833959251642227,
0.065043605864048,
0.02323502115905285,
0.07125888764858246,
-0.0038461550138890743,
-0.014896792359650135,
-0.045024629682302475,
-0.002303627785295248,
0.07581193745136261,
0.03844799846410751,
0.08932655304670334,
0.031510014086961746,
-0.013803699053823948,
0.02782421000301838,
-0.038520269095897675,
0.024192608892917633,
-0.006206244230270386,
-0.03423823043704033,
-0.057274509221315384,
-0.014436067081987858,
-0.06074350327253342,
0.017841823399066925,
-0.06309229880571365,
0.05651566758751869,
-0.04914405941963196,
-0.008564074523746967,
-0.06034601107239723
]
|
36,415 | torch.optim.optimizer | register_load_state_dict_pre_hook | Register a load_state_dict pre-hook which will be called before
:meth:`~torch.optim.Optimizer.load_state_dict` is called. It should have the
following signature::
hook(optimizer, state_dict) -> state_dict or None
The ``optimizer`` argument is the optimizer instance being used and the
``state_dict`` argument is a shallow copy of the ``state_dict`` the user
passed in to ``load_state_dict``. The hook may modify the state_dict inplace
or optionally return a new one. If a state_dict is returned, it will be used
to be loaded into the optimizer.
The hook will be called with argument ``self`` and ``state_dict`` before
calling ``load_state_dict`` on ``self``. The registered hook can be used to
perform pre-processing before the ``load_state_dict`` call is made.
Args:
hook (Callable): The user defined hook to be registered.
prepend (bool): If True, the provided pre ``hook`` will be fired before
all the already registered pre-hooks on ``load_state_dict``. Otherwise,
the provided ``hook`` will be fired after all the already registered
pre-hooks. (default: False)
Returns:
:class:`torch.utils.hooks.RemoveableHandle`:
a handle that can be used to remove the added hook by calling
``handle.remove()``
| def register_load_state_dict_pre_hook(
self,
hook: Callable[["Optimizer", StateDict], Optional[StateDict]],
prepend: bool = False,
) -> RemovableHandle:
r"""Register a load_state_dict pre-hook which will be called before
:meth:`~torch.optim.Optimizer.load_state_dict` is called. It should have the
following signature::
hook(optimizer, state_dict) -> state_dict or None
The ``optimizer`` argument is the optimizer instance being used and the
``state_dict`` argument is a shallow copy of the ``state_dict`` the user
passed in to ``load_state_dict``. The hook may modify the state_dict inplace
or optionally return a new one. If a state_dict is returned, it will be used
to be loaded into the optimizer.
The hook will be called with argument ``self`` and ``state_dict`` before
calling ``load_state_dict`` on ``self``. The registered hook can be used to
perform pre-processing before the ``load_state_dict`` call is made.
Args:
hook (Callable): The user defined hook to be registered.
prepend (bool): If True, the provided pre ``hook`` will be fired before
all the already registered pre-hooks on ``load_state_dict``. Otherwise,
the provided ``hook`` will be fired after all the already registered
pre-hooks. (default: False)
Returns:
:class:`torch.utils.hooks.RemoveableHandle`:
a handle that can be used to remove the added hook by calling
``handle.remove()``
"""
handle = hooks.RemovableHandle(self._optimizer_load_state_dict_pre_hooks)
self._optimizer_load_state_dict_pre_hooks[handle.id] = hook
if prepend:
self._optimizer_load_state_dict_pre_hooks.move_to_end(handle.id, last=False)
return handle
| (self, hook: Callable[[torch.optim.optimizer.Optimizer, Dict[str, Any]], Optional[Dict[str, Any]]], prepend: bool = False) -> torch.utils.hooks.RemovableHandle | [
-0.07329282909631729,
0.02387763001024723,
-0.04071418568491936,
0.0026700443122535944,
0.028328463435173035,
0.05742305517196655,
0.007150520104914904,
0.027051584795117378,
0.04206402972340584,
-0.06282242387533188,
0.0389995202422142,
-0.0019905625376850367,
0.0124860480427742,
-0.02690565586090088,
-0.05133051797747612,
0.00002424430385872256,
-0.02074015699326992,
0.021159702911973,
-0.07566417753696442,
-0.05994032695889473,
0.011856730096042156,
0.0140000618994236,
0.02743464894592762,
0.02035709284245968,
0.001984862145036459,
-0.03983861207962036,
-0.011646957136690617,
-0.005130315665155649,
0.03588028624653816,
0.029860718175768852,
0.05435854569077492,
0.0018229722045361996,
0.022983813658356667,
-0.005572663154453039,
0.0017066850559785962,
-0.034731097519397736,
0.052352022379636765,
-0.004416632000356913,
-0.020119957625865936,
-0.025446366518735886,
0.003623143071308732,
-0.031465936452150345,
0.020521262660622597,
-0.010899070650339127,
0.04286663979291916,
0.03303467109799385,
-0.027051584795117378,
-0.017082810401916504,
0.05869993194937706,
-0.03029850497841835,
0.05253443121910095,
-0.07187002152204514,
0.03823339194059372,
0.027507612481713295,
0.0006304588168859482,
-0.04056825488805771,
0.038963038474321365,
-0.03830635920166969,
0.03059036284685135,
0.02345808409154415,
0.0560002475976944,
-0.02592063508927822,
-0.03400145098567009,
0.00010716659744502977,
0.04023991525173187,
-0.08223097771406174,
-0.03536953777074814,
-0.04053177312016487,
-0.03659169003367424,
-0.04177217185497284,
-0.027872435748577118,
-0.024789685383439064,
0.04863083362579346,
0.004035848192870617,
0.012595495209097862,
0.0059511661529541016,
-0.05899178981781006,
-0.09521865844726562,
0.02457079291343689,
-0.013078885152935982,
-0.003951483406126499,
-0.022582510486245155,
-0.014720586128532887,
0.04213699325919151,
-0.03152066096663475,
-0.07402247190475464,
0.03170306980609894,
-0.04366924613714218,
0.03757671266794205,
0.015267819166183472,
-0.02987895905971527,
0.06129017099738121,
-0.0036003415007144213,
0.008641731925308704,
0.04392462223768234,
0.014793550595641136,
0.051512930542230606,
0.045931145548820496,
0.022454822435975075,
-0.015669124200940132,
0.0020042434334754944,
-0.03436627611517906,
-0.003107831347733736,
0.011546630412340164,
0.020411815494298935,
-0.03494999185204506,
0.007428697310388088,
-0.009795483201742172,
-0.023567531257867813,
-0.008605249226093292,
0.021925829350948334,
-0.1120004951953888,
-0.020685432478785515,
0.02114146016538143,
0.043340906500816345,
0.006794818211346865,
0.009503624401986599,
-0.035843804478645325,
0.004070050548762083,
0.022035276517271996,
-0.022892609238624573,
-0.03712068498134613,
-0.025336919352412224,
0.02659555710852146,
-0.04436241090297699,
0.0007136838976293802,
0.08529549092054367,
0.0581526979804039,
0.012340119108557701,
-0.07132279127836227,
0.03932785987854004,
0.022564267739653587,
-0.08157429844141006,
-0.03932785987854004,
-0.016097791492938995,
-0.04560280591249466,
0.058481037616729736,
0.02783595211803913,
0.008258667774498463,
-0.041042525321245193,
0.025501089170575142,
-0.007018271833658218,
-0.03451220318675041,
0.04158975929021835,
-0.004375589080154896,
-0.016900399699807167,
-0.01667238585650921,
0.06482894718647003,
0.042903121560811996,
-0.00947626307606697,
0.045675769448280334,
-0.011601353995501995,
0.015058046206831932,
0.016417009755969048,
-0.042246438562870026,
-0.004129333887249231,
-0.07015535980463028,
-0.032268546521663666,
-0.012723183259367943,
-0.02196231111884117,
0.03245095536112785,
0.001195933553390205,
-0.005983088165521622,
-0.06771104782819748,
-0.03701123595237732,
0.006284066941589117,
-0.003422490553930402,
-0.018131675198674202,
-0.022983813658356667,
0.024096522480249405,
0.020557744428515434,
-0.04126141965389252,
0.03983861207962036,
0.07938536256551743,
0.017931023612618446,
0.06048756092786789,
-0.010424801148474216,
-0.037193648517131805,
-0.06464654207229614,
0.0027384485583752394,
0.06526673585176468,
0.025847671553492546,
-0.018076952546834946,
-0.019080214202404022,
-0.06129017099738121,
-0.013407224789261818,
0.007729675620794296,
-0.03153889998793602,
0.04246533289551735,
0.0728185623884201,
0.021086737513542175,
0.007237165234982967,
0.001901637064293027,
-0.007228044793009758,
-0.01951800100505352,
0.031338248401880264,
-0.027215754613280296,
-0.0028729767072945833,
0.005490577779710293,
0.00034857646096497774,
-0.000901795516256243,
0.02524571307003498,
-0.009266490116715431,
0.025574054569005966,
-0.008395476266741753,
0.009280171245336533,
-0.001492351875640452,
0.0199375469237566,
-0.008482121862471104,
0.014529054053127766,
0.03144769370555878,
-0.04753636568784714,
-0.03042619302868843,
0.06293187290430069,
-0.029860718175768852,
-0.07256318628787994,
0.01343458704650402,
0.066361203789711,
0.008582448586821556,
-0.03830635920166969,
0.07081203907728195,
0.05202368274331093,
0.017064569517970085,
-0.028364945203065872,
0.002028184710070491,
-0.011418942362070084,
-0.016353165730834007,
-0.03163010627031326,
0.008732937276363373,
0.04407055303454399,
-0.010351836681365967,
-0.0392913781106472,
-0.011756403371691704,
-0.03874414414167404,
0.1056525781750679,
0.06260353326797485,
0.029787752777338028,
-0.006343350280076265,
0.07653974741697311,
0.03794153407216072,
0.023312155157327652,
0.04312201216816902,
0.02499033883213997,
-0.08690071105957031,
-0.042793672531843185,
0.051658857613801956,
-0.0003708078293129802,
0.003128352575004101,
-0.03192196413874626,
0.046478379517793655,
-0.0026267217472195625,
0.05800677090883255,
0.014100387692451477,
0.03518712520599365,
-0.0194997601211071,
0.06355207413434982,
0.04323146119713783,
0.0031420334707945585,
-0.04407055303454399,
0.0070000309497118,
-0.031338248401880264,
0.0015869776252657175,
-0.00508927321061492,
0.022710196673870087,
-0.00932577345520258,
-0.014465210027992725,
0.06439116597175598,
0.01789454184472561,
0.013352502137422562,
0.012139467522501945,
0.08077169209718704,
-0.016134273260831833,
-0.025136267766356468,
0.002818253356963396,
0.03513240069150925,
-0.034311551600694656,
-0.00989580899477005,
-0.025829428806900978,
0.050272535532712936,
0.0557083897292614,
0.05114810913801193,
0.008094497956335545,
-0.006033251062035561,
-0.02894866093993187,
-0.033107638359069824,
-0.009184405207633972,
-0.05490577965974808,
0.05198720097541809,
0.009394178166985512,
-0.022454822435975075,
0.05840807408094406,
0.021396836265921593,
0.013197451829910278,
0.020119957625865936,
0.01351667195558548,
-0.027489371597766876,
-0.0682218000292778,
0.047025613486766815,
0.010780503042042255,
0.004788294900208712,
0.0505279079079628,
-0.046770237386226654,
-0.006635208148509264,
-0.008618930354714394,
0.008235867135226727,
-0.02650435082614422,
0.0004588782321661711,
-0.018788356333971024,
-0.06876903027296066,
0.0003468663489911705,
-0.016854796558618546,
0.00983196496963501,
-0.03031674586236477,
-0.04330442473292351,
0.023312155157327652,
-0.07285504043102264,
-0.003885359037667513,
-0.017757732421159744,
0.0133889839053154,
-0.005741393193602562,
-0.035570189356803894,
0.07726939767599106,
-0.03199492767453194,
0.020028753206133842,
-0.014346643351018429,
-0.04542039334774017,
0.021725177764892578,
-0.017274342477321625,
0.029404690489172935,
-0.03699299693107605,
-0.06595990061759949,
-0.04246533289551735,
-0.021159702911973,
0.05319111421704292,
-0.018624186515808105,
-0.01399094145745039,
0.029039867222309113,
-0.0049889469519257545,
-0.03153889998793602,
-0.018332328647375107,
0.026540832594037056,
-0.011537509970366955,
-0.018751874566078186,
0.03699299693107605,
-0.00525800371542573,
-0.015094528906047344,
-0.020028753206133842,
0.008240426890552044,
0.04509205371141434,
0.020028753206133842,
-0.04133438318967819,
-0.05060087516903877,
-0.019043732434511185,
-0.0018400732660666108,
0.07814496755599976,
-0.08172022551298141,
-0.0042456211522221565,
-0.025884153321385384,
0.033125877380371094,
-0.016900399699807167,
-0.0051257554441690445,
-0.026103045791387558,
-0.04458130523562431,
0.04166272282600403,
0.057386573404073715,
-0.010142063722014427,
-0.029805993661284447,
-0.07500749826431274,
-0.07314690202474594,
-0.012568133883178234,
0.01977337710559368,
-0.05253443121910095,
-0.0025583175010979176,
0.025428125634789467,
0.009298412129282951,
-0.04180865362286568,
0.042246438562870026,
-0.020521262660622597,
0.007100356742739677,
0.05421261489391327,
0.06486543267965317,
0.04804711788892746,
0.031192319467663765,
-0.006566803902387619,
-0.023585772141814232,
-0.029860718175768852,
-0.021889347583055496,
0.04366924613714218,
0.03250567987561226,
-0.08390916138887405,
0.0098228445276618,
-0.0065440027974545956,
0.023166226223111153,
-0.00692706648260355,
-0.004423472099006176,
-0.008058016188442707,
-0.0012643377995118499,
-0.010917311534285545,
0.022965572774410248,
-0.026522591710090637,
0.05527060106396675,
-0.015413748100399971,
0.027379924431443214,
0.0006566804368048906,
0.03263336792588234,
-0.01814991608262062,
-0.02318446710705757,
0.06249408423900604,
-0.008582448586821556,
0.018897803500294685,
-0.02046654000878334,
0.023567531257867813,
-0.023786423727869987,
-0.026559075340628624,
-0.040312882512807846,
-0.016626782715320587,
0.02309326082468033,
0.04625948518514633,
-0.0706661120057106,
0.022035276517271996,
0.029842477291822433,
0.014328401535749435,
-0.02690565586090088,
0.04385165870189667,
0.004348227754235268,
0.03285226225852966,
0.002720207441598177,
-0.01268670056015253,
0.009813724085688591,
0.01720137894153595,
0.025829428806900978,
0.008810462430119514,
0.05505170673131943,
0.03429330885410309,
-0.020703673362731934,
0.00641175452619791,
0.0133889839053154,
0.012431325390934944,
-0.018140796571969986,
0.022418338805437088,
0.01855122111737728,
-0.002387306885793805,
0.02730696089565754,
0.02893042005598545,
0.02444310486316681,
-0.002971022855490446,
-0.033381253480911255,
0.011428063735365868,
0.06056052818894386,
0.0014364883536472917,
0.022582510486245155,
-0.002396427560597658,
-0.0025058742612600327,
0.05505170673131943,
-0.016918640583753586,
-0.013398104347288609,
-0.046879686415195465,
-0.0064619178883731365,
-0.07394950836896896,
-0.0007267947075888515,
-0.0010745160980150104,
0.021360354498028755,
0.017757732421159744,
0.004149855580180883,
0.004788294900208712,
0.015660002827644348,
-0.046770237386226654,
0.019846340641379356,
-0.03458516672253609,
-0.01311536692082882,
0.017420271411538124,
-0.036117423325777054,
0.02240009792149067,
-0.026832690462470055,
-0.000035520311939762905,
0.020667191594839096,
0.02183462306857109,
0.02086784504354,
0.00900199357420206,
-0.011136204935610294,
0.05953902378678322,
-0.0032309589441865683,
-0.0041635362431406975,
0.009576589800417423,
0.02592063508927822,
-0.0029299804009497166,
-0.04666079208254814,
0.03907248377799988,
0.0066944919526577,
0.09324862062931061,
-0.0138541329652071,
0.019317349418997765,
0.009658674709498882,
-0.016562938690185547,
0.043742213398218155,
-0.008400036953389645,
0.027617059648036957,
-0.0018457735422998667,
0.07267263531684875,
-0.02004699409008026,
-0.022764921188354492,
-0.026850933209061623,
-0.011628715321421623,
0.05913772061467171,
0.0006190580897964537,
-0.019992269575595856,
-0.04286663979291916,
0.07653974741697311,
-0.03653696924448013,
0.041699204593896866,
-0.027635300531983376,
-0.01953624188899994,
0.052206091582775116,
-0.009530986659228802,
-0.00948538351804018,
-0.024333657696843147,
0.0031785157043486834,
0.08179319649934769,
-0.07073907554149628,
-0.00989580899477005,
0.01749323680996895,
0.01762092486023903,
0.03029850497841835,
-0.08427398651838303,
-0.008459320291876793,
0.018350569531321526,
0.04611355811357498,
-0.035168882459402084,
0.014282799325883389,
-0.02427893504500389,
-0.006740094628185034,
-0.0016781833255663514,
0.016289321705698967,
0.019025491550564766,
0.003614022396504879,
-0.0004782594332937151,
0.027744747698307037,
0.010826106183230877,
-0.0344027578830719,
-0.027270479127764702,
0.050710320472717285,
0.010479524731636047,
0.03874414414167404,
0.03808746486902237,
0.038963038474321365,
0.027617059648036957,
-0.022418338805437088,
0.05647451430559158,
-0.09624016284942627,
-0.03339949622750282,
-0.07347524166107178,
-0.018250243738293648,
-0.005823478568345308,
-0.01379028894007206,
-0.0014285079669207335,
-0.05089273303747177,
0.08310655504465103,
0.013078885152935982,
-0.003486334579065442,
0.005381131079047918,
-0.024935614317655563,
0.032414473593235016,
-0.026103045791387558,
0.024333657696843147,
-0.007259966805577278,
0.0126319769769907,
-0.01898900792002678,
-0.0024374700151383877,
-0.003981125075370073,
0.02486265078186989,
0.10718483477830887,
-0.010835226625204086,
-0.0200834758579731,
0.005928365048021078,
-0.08879778534173965,
0.014456089586019516,
-0.002514994703233242,
0.0013247615424916148,
-0.013407224789261818,
-0.03303467109799385,
0.01718313805758953,
0.004115653224289417,
0.0278541948646307,
0.011282133869826794,
-0.006357031408697367,
0.016161635518074036,
-0.02143331989645958,
0.1505987048149109,
0.0014330681879073381,
-0.0013213412603363395,
-0.06037811562418938,
0.011209169402718544,
-0.03204965218901634,
-0.036646414548158646,
0.06223871186375618,
-0.033928487449884415,
0.04968881607055664,
-0.0032218382693827152,
-0.01296031754463911,
-0.001083066686987877,
-0.03044443391263485,
-0.028583839535713196,
0.02254602685570717,
-0.026923896744847298,
-0.03845228627324104,
-0.07756125181913376,
0.011218290776014328,
0.04793766885995865,
-0.008906228467822075,
-0.05676637217402458,
-0.004218259360641241,
-0.0049068620428442955,
0.006325109396129847,
0.007301009260118008,
0.00668537151068449,
-0.03699299693107605,
0.018897803500294685,
-0.07259966433048248,
0.06595990061759949,
-0.043450355529785156,
-0.003463533241301775,
-0.065193772315979,
0.025574054569005966,
0.004505557473748922,
0.0008864045375958085,
-0.07073907554149628,
0.01909845508635044,
-0.05921068415045738,
0.017611803486943245,
-0.07843682914972305,
0.0075746262446045876,
0.02278316207230091,
0.016818314790725708,
-0.03668289631605148,
0.014401366002857685,
0.011400701478123665,
0.06340613961219788,
0.004615004174411297,
-0.024953855201601982,
-0.09514569491147995,
0.0009816003730520606,
0.010798744857311249,
0.0011309495894238353,
0.00013687968021258712,
-0.02486265078186989,
-0.0030211859848350286,
-0.02499033883213997,
0.017101053148508072,
0.10404736548662186,
-0.0069817896001040936,
0.017967505380511284,
-0.022764921188354492,
-0.050418462604284286,
0.046770237386226654,
0.0014866514829918742,
0.018934285268187523,
0.0685136541724205,
0.008317952044308186,
0.053300559520721436,
-0.016143392771482468,
-0.05019956827163696,
0.009467142634093761,
-0.031885482370853424,
0.029185796156525612,
-0.006740094628185034,
-0.021451560780405998,
-0.04096956178545952,
-0.005910123698413372,
0.01399094145745039,
-0.030134335160255432,
-0.052753325551748276,
-0.04315849766135216,
-0.05446799099445343,
-0.007095796521753073,
0.056839339435100555,
-0.036117423325777054,
-0.029568860307335854,
-0.026996862143278122,
0.05490577965974808,
0.010734900832176208,
-0.03097342699766159,
0.013078885152935982,
0.0019415394635871053,
-0.008281469345092773,
-0.04640541598200798,
0.014519933611154556,
-0.011099723167717457,
-0.00984108541160822,
0.006972669158130884,
0.037047721445560455,
0.032268546521663666,
0.033618390560150146,
0.03152066096663475,
0.0015447951154783368,
-0.017091931775212288,
-0.08960039168596268,
-0.041991062462329865,
-0.03237799182534218,
-0.009134242311120033,
-0.015541436150670052,
0.04326794296503067,
0.026376662775874138,
0.0011463405098766088,
-0.0575689822435379,
-0.023932352662086487,
0.009713397361338139,
-0.04257477819919586,
-0.05147644877433777,
-0.020648950710892677,
0.03739430010318756,
0.03739430010318756,
-0.01732906699180603,
0.026431387290358543,
-0.011181808076798916,
0.027617059648036957,
-0.002923139836639166,
-0.04246533289551735,
-0.06595990061759949,
0.0003129492688458413,
0.006990910042077303,
-0.038853589445352554,
0.027908917516469955,
-0.06322373449802399,
-0.007301009260118008,
0.03044443391263485,
-0.006936186924576759,
0.021597489714622498,
-0.06413578987121582,
-0.03414738178253174,
-0.012258034199476242,
0.054139651358127594,
-0.003135192906484008,
-0.027270479127764702,
-0.0520966462790966,
0.034877024590969086,
-0.01781245693564415,
-0.003502295585349202,
0.03768615797162056,
0.03414738178253174,
-0.0025719983968883753,
0.01884307898581028,
0.03564315289258957,
0.036920033395290375,
0.0077798389829695225,
0.07358469069004059,
-0.0019289987394586205,
0.01646261289715767,
-0.05676637217402458,
0.011218290776014328,
0.07114037871360779,
-0.0030781894456595182,
0.07668568193912506,
0.027106307446956635,
-0.021232666447758675,
0.014164231717586517,
-0.0371389240026474,
-0.021269148215651512,
0.03589852899312973,
-0.03099166788160801,
-0.059028271585702896,
-0.020922567695379257,
-0.07062962651252747,
0.022071758285164833,
-0.03972916677594185,
0.056729890406131744,
-0.04487316310405731,
0.01017854642122984,
-0.03932785987854004
]
|
36,416 | torch.optim.optimizer | register_state_dict_post_hook | Register a state dict post-hook which will be called after
:meth:`~torch.optim.Optimizer.state_dict` is called. It should have the
following signature::
hook(optimizer, state_dict) -> state_dict or None
The hook will be called with arguments ``self`` and ``state_dict`` after generating
a ``state_dict`` on ``self``. The hook may modify the state_dict inplace or optionally
return a new one. The registered hook can be used to perform post-processing
on the ``state_dict`` before it is returned.
Args:
hook (Callable): The user defined hook to be registered.
prepend (bool): If True, the provided post ``hook`` will be fired before
all the already registered post-hooks on ``state_dict``. Otherwise,
the provided ``hook`` will be fired after all the already registered
post-hooks. (default: False)
Returns:
:class:`torch.utils.hooks.RemoveableHandle`:
a handle that can be used to remove the added hook by calling
``handle.remove()``
| def register_state_dict_post_hook(
self,
hook: Callable[["Optimizer", StateDict], Optional[StateDict]],
prepend: bool = False,
) -> RemovableHandle:
r"""Register a state dict post-hook which will be called after
:meth:`~torch.optim.Optimizer.state_dict` is called. It should have the
following signature::
hook(optimizer, state_dict) -> state_dict or None
The hook will be called with arguments ``self`` and ``state_dict`` after generating
a ``state_dict`` on ``self``. The hook may modify the state_dict inplace or optionally
return a new one. The registered hook can be used to perform post-processing
on the ``state_dict`` before it is returned.
Args:
hook (Callable): The user defined hook to be registered.
prepend (bool): If True, the provided post ``hook`` will be fired before
all the already registered post-hooks on ``state_dict``. Otherwise,
the provided ``hook`` will be fired after all the already registered
post-hooks. (default: False)
Returns:
:class:`torch.utils.hooks.RemoveableHandle`:
a handle that can be used to remove the added hook by calling
``handle.remove()``
"""
handle = hooks.RemovableHandle(self._optimizer_state_dict_post_hooks)
self._optimizer_state_dict_post_hooks[handle.id] = hook
if prepend:
self._optimizer_state_dict_post_hooks.move_to_end(handle.id, last=False)
return handle
| (self, hook: Callable[[torch.optim.optimizer.Optimizer, Dict[str, Any]], Optional[Dict[str, Any]]], prepend: bool = False) -> torch.utils.hooks.RemovableHandle | [
-0.050168514251708984,
0.03262234106659889,
-0.05324229598045349,
-0.009001790545880795,
0.005333377979695797,
0.03728790581226349,
-0.04467961937189102,
0.032658934593200684,
0.05057103559374809,
-0.07256321609020233,
0.02695048227906227,
0.046253103762865067,
-0.019650250673294067,
-0.02274232916533947,
-0.03959324210882187,
0.029383894056081772,
-0.009742791764438152,
0.031945377588272095,
-0.07201432436704636,
-0.048119328916072845,
0.024096256121993065,
-0.0014431223971769214,
0.036592643707990646,
0.03031700663268566,
-0.003581505035981536,
-0.042630430310964584,
0.0001941125374287367,
-0.010877163149416447,
0.035933975130319595,
0.059023935347795486,
0.023657144978642464,
-0.04120331630110741,
0.04804614186286926,
-0.01910136081278324,
0.028615448623895645,
-0.0303718950599432,
0.03798316419124603,
0.03178071230649948,
-0.004105237312614918,
-0.03875160962343216,
0.01143520139157772,
-0.027188334614038467,
0.004397978540509939,
0.007908585481345654,
0.06967239826917648,
0.05518170818686485,
-0.0361352376639843,
-0.007675307337194681,
0.04859503358602524,
-0.050607629120349884,
0.022943587973713875,
-0.08562678843736649,
0.03715983033180237,
0.025102553889155388,
0.011407757177948952,
-0.024791516363620758,
0.041422873735427856,
-0.047863177955150604,
0.03192708268761635,
-0.01174623891711235,
0.019796621054410934,
-0.03218322992324829,
-0.021077362820506096,
-0.030737821012735367,
0.01648498699069023,
-0.044350285083055496,
-0.040325094014406204,
-0.03919072076678276,
-0.02190069854259491,
-0.020071065053343773,
-0.026273518800735474,
-0.046619027853012085,
0.04947325587272644,
0.0010709066409617662,
0.01104183029383421,
0.009335698559880257,
-0.03679390251636505,
-0.0829189345240593,
0.004958303179591894,
-0.01999787986278534,
-0.036812201142311096,
-0.022998476400971413,
-0.01546954084187746,
0.043289098888635635,
-0.036556050181388855,
-0.0656106099486351,
0.03523871675133705,
-0.032915085554122925,
-0.020693140104413033,
-0.003803347935900092,
-0.001740437699481845,
0.017061321064829826,
0.013228241354227066,
-0.008905734866857529,
0.015625059604644775,
-0.011188200674951077,
0.01782061718404293,
0.05218110978603363,
0.028048262000083923,
-0.009523235261440277,
-0.02115054801106453,
-0.038056351244449615,
0.008910308592021465,
0.02663944475352764,
0.025925887748599052,
-0.03253085911273956,
0.005882267374545336,
-0.01331972237676382,
-0.055218301713466644,
-0.04402095079421997,
0.037617240101099014,
-0.09104249626398087,
-0.010492940433323383,
-0.001687835669144988,
0.04149605706334114,
0.04193517193198204,
0.005273914895951748,
-0.02885330095887184,
0.011233941651880741,
0.009806828573346138,
-0.039922576397657394,
-0.02691389061510563,
-0.029896190389990807,
0.03357375040650368,
-0.06078038364648819,
-0.003853662870824337,
0.06326868385076523,
0.07991833239793777,
-0.016366060823202133,
-0.047277696430683136,
-0.03242108225822449,
0.046179916709661484,
-0.06037786230444908,
-0.013136759400367737,
0.005058933049440384,
0.005543785635381937,
0.021077362820506096,
0.003435134422034025,
-0.0005408850265666842,
-0.0421181321144104,
0.015524429269134998,
-0.005909712053835392,
-0.043472062796354294,
0.02744448371231556,
-0.001259015640243888,
-0.007428306620568037,
-0.04241087660193443,
0.07194113731384277,
0.038678426295518875,
-0.044533248990774155,
0.0082562156021595,
0.0007198459352366626,
0.0195038802921772,
0.03507405146956444,
-0.022724032402038574,
-0.004539774730801582,
-0.037086647003889084,
0.003636393928900361,
-0.03600716218352318,
-0.015506133437156677,
0.0334639735519886,
-0.008933179080486298,
-0.010886311531066895,
-0.04822910577058792,
-0.02074802853167057,
0.000058283792895963416,
0.0390077605843544,
-0.018671397119760513,
-0.005310507491230965,
0.02087610401213169,
-0.00802293699234724,
-0.045191917568445206,
0.04105694591999054,
0.07816188782453537,
-0.004500895272940397,
0.08438263833522797,
0.006897713523358107,
-0.04541147127747536,
-0.06714750081300735,
-0.009116142988204956,
0.056059930473566055,
-0.0017610209761187434,
-0.022284921258687973,
-0.00957812462002039,
-0.07219728827476501,
-0.03578760474920273,
-0.016704542562365532,
-0.015478688292205334,
0.017436394467949867,
0.07501491904258728,
-0.014518131501972675,
0.01884521171450615,
0.009276235476136208,
-0.05349844694137573,
-0.013063574209809303,
0.019851509481668472,
-0.01642094925045967,
-0.0009880013531073928,
0.04149605706334114,
-0.029017966240644455,
0.0007129848236218095,
-0.009029234759509563,
-0.02451707236468792,
0.017719987779855728,
0.002064053900539875,
-0.010392311029136181,
-0.002428836887702346,
-0.013374611735343933,
-0.012011535465717316,
0.0028107725083827972,
0.03831249848008156,
-0.005109247751533985,
-0.034342195838689804,
0.0638541653752327,
-0.02318144030869007,
-0.0780155211687088,
0.024846404790878296,
0.05767000839114189,
0.003227013861760497,
-0.03280530497431755,
0.041825391352176666,
0.037178125232458115,
0.04120331630110741,
0.016027579084038734,
0.010959496721625328,
-0.012606166303157806,
-0.012459794990718365,
-0.0197234358638525,
0.059206899255514145,
0.007304806727916002,
-0.03582419827580452,
-0.018204839900135994,
-0.01188346091657877,
-0.022193439304828644,
0.13041618466377258,
0.051010146737098694,
0.004416274838149548,
-0.05426689237356186,
0.06312230974435806,
0.07197773456573486,
0.025834407657384872,
0.023089958354830742,
0.01021849550306797,
-0.06989195197820663,
-0.05024170130491257,
0.0656106099486351,
0.028395891189575195,
0.00011813992750830948,
0.010127014480531216,
0.034561753273010254,
0.018607359379529953,
0.024443887174129486,
0.012350017204880714,
0.0334639735519886,
-0.023218033835291862,
0.09536042809486389,
0.05203473940491676,
0.030829302966594696,
-0.03286019340157509,
-0.002486012876033783,
-0.0046152472496032715,
0.007199602667242289,
-0.03254915773868561,
0.006188731174916029,
-0.02186410501599312,
-0.022541068494319916,
0.06875757873058319,
-0.0006803944706916809,
-0.005452304147183895,
0.010456347838044167,
0.07808870077133179,
-0.007885714992880821,
-0.05302274227142334,
-0.03507405146956444,
0.011755387298762798,
0.02367544174194336,
0.01445409469306469,
-0.020784622058272362,
0.02470003440976143,
0.015213391743600368,
0.069160096347332,
0.005026914644986391,
0.04383798688650131,
-0.02124202996492386,
-0.031414784491062164,
0.03586079180240631,
-0.049143921583890915,
0.09880013763904572,
0.03236619383096695,
-0.019028175622224808,
0.06703772395849228,
0.030737821012735367,
0.034689828753471375,
0.04987577348947525,
0.028359299525618553,
-0.022504476830363274,
-0.07011150568723679,
0.04058124125003815,
0.02252277359366417,
0.005187007132917643,
0.04310613498091698,
-0.02859715186059475,
-0.005251044407486916,
0.022778920829296112,
0.008370567113161087,
-0.01924773119390011,
0.027920188382267952,
-0.02731640823185444,
-0.035439975559711456,
-0.0036844220012426376,
-0.006092675495892763,
0.0019211138132959604,
-0.039483461529016495,
-0.0133014265447855,
0.01946728676557541,
-0.07256321609020233,
-0.010410607792437077,
-0.0633784607052803,
-0.0012201359495520592,
0.005690156016498804,
-0.05298614874482155,
0.0447893962264061,
-0.018268877640366554,
-0.0170704685151577,
-0.02074802853167057,
-0.03262234106659889,
0.00012042696471326053,
-0.012185350991785526,
0.04292317107319832,
-0.0398859828710556,
-0.07281935960054398,
-0.05869460105895996,
-0.004327080212533474,
0.057560231536626816,
0.0067147500813007355,
-0.031048858538269997,
0.04614332318305969,
-0.007611270062625408,
-0.04376480355858803,
-0.040764205157756805,
-0.02199217863380909,
0.025194035843014717,
-0.016055023297667503,
0.035000864416360855,
0.024590257555246353,
-0.0025111702270805836,
-0.03408604860305786,
0.003583792131394148,
0.041349686682224274,
0.04822910577058792,
-0.043472062796354294,
-0.0549621507525444,
-0.0135209821164608,
-0.0046587008982896805,
0.08613908290863037,
-0.06755001842975616,
0.008494067937135696,
-0.024242626503109932,
0.015570170246064663,
-0.02810315042734146,
-0.025651443749666214,
-0.012642758898437023,
-0.025157442316412926,
0.062134310603141785,
0.08767597377300262,
-0.012066424824297428,
-0.029329003766179085,
-0.06348823755979538,
-0.04069102182984352,
-0.026621147990226746,
0.03860523924231529,
-0.07574677467346191,
0.007657011039555073,
0.05708452686667442,
0.013804575428366661,
-0.04274020716547966,
0.0332627147436142,
-0.006321379449218512,
0.01772913709282875,
0.022632550448179245,
0.04669221490621567,
0.002579781459644437,
0.04548465833067894,
-0.004663275089114904,
0.024571960791945457,
-0.031542859971523285,
-0.011398608796298504,
0.04983917996287346,
0.00630765687674284,
-0.09104249626398087,
-0.011691349558532238,
0.0004837090091314167,
0.008155585266649723,
0.0135209821164608,
-0.0037827645428478718,
-0.0018719424260780215,
-0.045996952801942825,
-0.024882998317480087,
-0.011179053224623203,
-0.0076936036348342896,
0.021644549444317818,
-0.002011451870203018,
0.016402652487158775,
-0.008196752518415451,
0.03463493660092354,
-0.03878820315003395,
-0.04083739221096039,
0.07808870077133179,
-0.00979768019169569,
0.005150414537638426,
-0.0010663325665518641,
0.005859397351741791,
-0.0019451277330517769,
-0.037178125232458115,
-0.0025546238757669926,
-0.009944051504135132,
0.02713344618678093,
0.030079154297709465,
-0.03882479667663574,
0.015899503603577614,
0.058145713061094284,
0.03366523236036301,
-0.013136759400367737,
0.056682005524635315,
-0.023876700550317764,
-0.008292808197438717,
-0.02301677316427231,
-0.0007450033444911242,
-0.03401286154985428,
0.014691947028040886,
0.03262234106659889,
0.003595227375626564,
0.04270361736416817,
0.0558769665658474,
-0.012871462851762772,
-0.012350017204880714,
0.025431888177990913,
-0.001422539004124701,
-0.02433410845696926,
0.03878820315003395,
-0.01383201964199543,
-0.004747895523905754,
0.006636990699917078,
0.03984938934445381,
0.06407371908426285,
0.004199006129056215,
0.010090421885251999,
-0.03533019870519638,
0.06202453374862671,
0.004789062310010195,
0.04804614186286926,
-0.004166987258940935,
0.0007055519381538033,
0.06432987004518509,
-0.009825125336647034,
-0.03304315730929375,
-0.03809294104576111,
-0.04237428307533264,
-0.08277256041765213,
0.014353464357554913,
-0.008951475843787193,
-0.00813271477818489,
0.006229897495359182,
0.017774876207113266,
-0.02491958998143673,
0.010547829791903496,
-0.04548465833067894,
0.008859993889927864,
-0.01372224185615778,
-0.007318528834730387,
0.006188731174916029,
-0.0036341070663183928,
0.0007289940840564668,
-0.031853895634412766,
-0.02008936181664467,
0.007195028942078352,
0.03253085911273956,
0.02171773463487625,
-0.01738150604069233,
-0.0016569606959819794,
0.06443964689970016,
0.008553531020879745,
-0.019485583528876305,
0.007936029694974422,
0.024151144549250603,
0.010502088814973831,
-0.009294531308114529,
0.020491881296038628,
0.029585152864456177,
0.09997110813856125,
0.005598674528300762,
-0.013932649046182632,
0.028359299525618553,
-0.019833212718367577,
0.04237428307533264,
-0.008306530304253101,
0.015432948246598244,
-0.003000596771016717,
0.062353864312171936,
-0.0651715025305748,
-0.030884191393852234,
-0.03172582387924194,
-0.01919284276664257,
0.031231822445988655,
-0.013081870041787624,
-0.05993875116109848,
-0.038641832768917084,
0.08328486233949661,
-0.038458868861198425,
0.04189857840538025,
-0.031542859971523285,
-0.0398859828710556,
0.03937368467450142,
-0.03231130540370941,
-0.004173848312348127,
-0.0028107725083827972,
0.000901665654964745,
0.054998744279146194,
-0.06264660507440567,
-0.012103017419576645,
0.013804575428366661,
0.026584556326270103,
0.027426186949014664,
-0.07969877868890762,
0.005552934017032385,
0.025248924270272255,
0.06103653088212013,
-0.0017095626099035144,
0.03359204903244972,
-0.013072722591459751,
-0.018543323501944542,
0.010392311029136181,
0.01791209913790226,
0.014829169027507305,
0.011197349056601524,
0.010154458694159985,
0.02984130196273327,
0.010264236479997635,
-0.03723301738500595,
-0.02513914741575718,
0.019046470522880554,
0.02717003785073757,
0.0015128771774470806,
-0.028780115768313408,
0.010739941149950027,
0.043069541454315186,
-0.008118992671370506,
0.034470271319150925,
-0.06015830859541893,
-0.039446871727705,
-0.08130885660648346,
-0.013475241139531136,
0.016942394897341728,
0.008599271066486835,
-0.0032430230639874935,
-0.012853166088461876,
0.08870057016611099,
0.0303718950599432,
-0.006252767983824015,
-0.02398647926747799,
-0.05236407369375229,
0.04427709802985191,
0.0027764670085161924,
0.012779980897903442,
0.020912695676088333,
0.04208154231309891,
-0.010977793484926224,
-0.00665986118838191,
-0.010154458694159985,
0.030609747394919395,
0.09214027971029282,
-0.026547962799668312,
-0.010950349271297455,
-0.03728790581226349,
-0.06078038364648819,
0.01112416386604309,
0.017774876207113266,
-0.006897713523358107,
0.015103613957762718,
-0.013136759400367737,
0.021479882299900055,
0.04691176861524582,
0.003961153794080019,
-0.017774876207113266,
-0.01722598820924759,
0.04800954833626747,
0.0024471331853419542,
0.13195307552814484,
0.007377991918474436,
-0.002322489395737648,
-0.07029446959495544,
0.04471621289849281,
-0.03262234106659889,
-0.07234365493059158,
0.04350865259766579,
-0.017985284328460693,
0.006746768951416016,
0.011252238415181637,
-0.011718794703483582,
0.0038765333592891693,
-0.0206199549138546,
-0.02784700319170952,
0.002260739216580987,
-0.025395294651389122,
-0.014609613455832005,
-0.07098972797393799,
0.0045283399522304535,
0.05818230286240578,
-0.0005749047268182039,
-0.06758661568164825,
-0.009271661750972271,
-0.007890288718044758,
0.016814319416880608,
0.03137819096446037,
-0.014536428265273571,
-0.05262022092938423,
0.018808620050549507,
-0.03734279423952103,
0.0332627147436142,
-0.03006085753440857,
-0.011362016201019287,
-0.05767000839114189,
0.02318144030869007,
-0.024992777034640312,
0.012322572991251945,
-0.07545403391122818,
-0.0030989395454525948,
-0.02965833805501461,
-0.014856613241136074,
-0.04544806480407715,
-0.026456482708454132,
0.051851775497198105,
0.007336825132369995,
-0.06056082621216774,
0.013777130283415318,
0.03715983033180237,
0.023382699117064476,
0.0027650317642837763,
-0.008292808197438717,
-0.1072896346449852,
0.03922731429338455,
0.043874580413103104,
0.017079615965485573,
-0.004578654654324055,
-0.03307975083589554,
0.029896190389990807,
0.022906996309757233,
0.0007604408892802894,
0.0616220124065876,
-0.025157442316412926,
0.009289957582950592,
-0.012889758683741093,
-0.06432987004518509,
0.02673092670738697,
0.020857807248830795,
0.015067021362483501,
0.07263639569282532,
0.01732661761343479,
0.03703175485134125,
-0.0017667385982349515,
-0.02283380925655365,
-0.0051915813237428665,
-0.030737821012735367,
0.0018307757563889027,
-0.008411734364926815,
-0.004512330517172813,
-0.052510444074869156,
0.01716195046901703,
0.025194035843014717,
-0.04292317107319832,
-0.007839974015951157,
-0.058548230677843094,
-0.05880437791347504,
0.007286510430276394,
0.05013192445039749,
-0.06012171506881714,
-0.017866358160972595,
0.0007592973997816443,
0.05704793334007263,
-0.003474014112725854,
-0.003759894287213683,
-0.005159562919288874,
-0.01292635127902031,
-0.0010817700531333685,
-0.017774876207113266,
0.03604375571012497,
0.022010475397109985,
0.015231688506901264,
0.00696175079792738,
0.039300501346588135,
0.026767520233988762,
-0.01769254356622696,
0.03609864413738251,
0.0035037456545978785,
0.002433410845696926,
-0.0846753790974617,
-0.03317123278975487,
-0.029640041291713715,
-0.0002815918414853513,
-0.025706332176923752,
0.02096758596599102,
0.035933975130319595,
0.034580048173666,
-0.06875757873058319,
0.033098045736551285,
0.010053829289972782,
-0.027773818001151085,
-0.0469849556684494,
0.012532981112599373,
0.03200026601552963,
0.019833212718367577,
-0.0008805104880593717,
0.027298113331198692,
-0.010136162862181664,
0.020016176626086235,
-0.014170501381158829,
-0.04489917308092117,
-0.061731792986392975,
-0.011133312247693539,
-0.01079483050853014,
-0.04885118082165718,
0.03253085911273956,
-0.04669221490621567,
-0.03714153543114662,
0.025944184511899948,
-0.042044948786497116,
0.031981971114873886,
-0.05119311064481735,
-0.000526591029483825,
-0.004365959670394659,
0.004514617379754782,
-0.008448326960206032,
-0.0133014265447855,
-0.06923328340053558,
-0.01507616974413395,
0.005960026755928993,
0.030646339058876038,
0.049765996634960175,
0.015222540125250816,
0.017171097919344902,
0.007199602667242289,
0.0487779937684536,
0.06926987320184708,
0.00836599338799715,
0.08848101645708084,
-0.009203050285577774,
-0.017033876851201057,
-0.06359801441431046,
-0.0034442825708538294,
0.06140245869755745,
0.06308571994304657,
0.09162798523902893,
0.02464514598250389,
-0.015249984338879585,
0.039117537438869476,
-0.044130727648735046,
0.02673092670738697,
-0.009262513369321823,
-0.024663442745804787,
-0.04650925099849701,
-0.02056506648659706,
-0.04647265747189522,
0.04526510089635849,
-0.061475642025470734,
0.03977620601654053,
-0.04504554718732834,
-0.01657646708190441,
-0.06491535156965256
]
|
36,417 | torch.optim.optimizer | register_state_dict_pre_hook | Register a state dict pre-hook which will be called before
:meth:`~torch.optim.Optimizer.state_dict` is called. It should have the
following signature::
hook(optimizer) -> None
The ``optimizer`` argument is the optimizer instance being used.
The hook will be called with argument ``self`` before calling ``state_dict`` on ``self``.
The registered hook can be used to perform pre-processing before the ``state_dict``
call is made.
Args:
hook (Callable): The user defined hook to be registered.
prepend (bool): If True, the provided pre ``hook`` will be fired before
all the already registered pre-hooks on ``state_dict``. Otherwise,
the provided ``hook`` will be fired after all the already registered
pre-hooks. (default: False)
Returns:
:class:`torch.utils.hooks.RemoveableHandle`:
a handle that can be used to remove the added hook by calling
``handle.remove()``
| def register_state_dict_pre_hook(
self, hook: Callable[["Optimizer"], None], prepend: bool = False
) -> RemovableHandle:
r"""Register a state dict pre-hook which will be called before
:meth:`~torch.optim.Optimizer.state_dict` is called. It should have the
following signature::
hook(optimizer) -> None
The ``optimizer`` argument is the optimizer instance being used.
The hook will be called with argument ``self`` before calling ``state_dict`` on ``self``.
The registered hook can be used to perform pre-processing before the ``state_dict``
call is made.
Args:
hook (Callable): The user defined hook to be registered.
prepend (bool): If True, the provided pre ``hook`` will be fired before
all the already registered pre-hooks on ``state_dict``. Otherwise,
the provided ``hook`` will be fired after all the already registered
pre-hooks. (default: False)
Returns:
:class:`torch.utils.hooks.RemoveableHandle`:
a handle that can be used to remove the added hook by calling
``handle.remove()``
"""
handle = hooks.RemovableHandle(self._optimizer_state_dict_pre_hooks)
self._optimizer_state_dict_pre_hooks[handle.id] = hook
if prepend:
self._optimizer_state_dict_pre_hooks.move_to_end(handle.id, last=False)
return handle
| (self, hook: Callable[[torch.optim.optimizer.Optimizer], NoneType], prepend: bool = False) -> torch.utils.hooks.RemovableHandle | [
-0.06848009675741196,
0.022654399275779724,
-0.037216667085886,
-0.0007291160291060805,
0.02131759375333786,
0.044417593628168106,
-0.0037430557422339916,
0.02525671385228634,
0.042706482112407684,
-0.05746481567621231,
0.023064352571964264,
0.0053160302340984344,
-0.0014571180799975991,
-0.022707870230078697,
-0.05678750202059746,
-0.002983304439112544,
-0.0064968750812113285,
0.010177546180784702,
-0.07913888990879059,
-0.05835602059960365,
0.009117013774812222,
-0.0007486111135222018,
0.02969490736722946,
0.0376087985932827,
-0.003787615802139044,
-0.034792594611644745,
-0.017824074253439903,
-0.008346122689545155,
0.039569444954395294,
0.030336575582623482,
0.038749538362026215,
-0.0026646992191672325,
0.032279398292303085,
-0.021139351651072502,
0.02005208469927311,
-0.036860186606645584,
0.05029954016208649,
0.0006266276468522847,
-0.01960648223757744,
-0.034133102744817734,
0.012762037105858326,
-0.024543751031160355,
-0.0015907986089587212,
0.0003640010254457593,
0.04994305595755577,
0.03864259272813797,
-0.014749421738088131,
-0.016585301607847214,
0.06687592715024948,
-0.033937036991119385,
0.04623565077781677,
-0.08569815009832382,
0.04024675861001015,
0.035844214260578156,
0.0017400752985849977,
-0.03949815034866333,
0.052973151206970215,
-0.04623565077781677,
0.03094259276986122,
-0.00008160083962138742,
0.03693148121237755,
-0.024080324918031693,
-0.02047986164689064,
-0.0184122696518898,
0.03803657367825508,
-0.08598333597183228,
-0.04120926186442375,
-0.03639676049351692,
-0.03231504559516907,
-0.042706482112407684,
-0.02842939831316471,
-0.04028240963816643,
0.05347222462296486,
0.0028585358522832394,
0.003707407508045435,
0.0017645834013819695,
-0.05849861353635788,
-0.0874805599451065,
0.0259162038564682,
-0.022725695744156837,
-0.010195370763540268,
-0.017645834013819695,
-0.017628010362386703,
0.037751391530036926,
-0.018430093303322792,
-0.07835463434457779,
0.03661064803600311,
-0.033527083694934845,
0.029534490779042244,
0.011665856465697289,
-0.02739560231566429,
0.05635972321033478,
-0.0006288556032814085,
0.016612038016319275,
0.038999076932668686,
0.026860879734158516,
0.043134260922670364,
0.03030092641711235,
0.038571298122406006,
-0.01820729300379753,
0.0009574870346114039,
-0.012664005160331726,
-0.0041039930656552315,
0.013840394094586372,
0.01314525492489338,
-0.02675393596291542,
0.002301533706486225,
-0.009562616236507893,
-0.025595370680093765,
-0.017013078555464745,
0.028928473591804504,
-0.09867407381534576,
-0.018857870250940323,
0.00429114606231451,
0.05529027804732323,
0.01379583403468132,
0.006688483990728855,
-0.04113796353340149,
0.018893519416451454,
0.023028705269098282,
-0.023456482216715813,
-0.03967639058828354,
-0.027894677594304085,
0.029552316293120384,
-0.05582500249147415,
-0.005561111494898796,
0.09054630249738693,
0.07097546756267548,
0.008533275686204433,
-0.0681949108839035,
0.01611296273767948,
0.029587963595986366,
-0.07101111114025116,
-0.026629166677594185,
-0.0022647713776677847,
-0.028696760535240173,
0.044595833867788315,
0.02215532399713993,
0.008292650803923607,
-0.041708335280418396,
0.02965926006436348,
-0.012307523749768734,
-0.04623565077781677,
0.044809725135564804,
-0.01254814863204956,
-0.01757453754544258,
-0.028571991249918938,
0.07272222638130188,
0.039605092257261276,
-0.016638774424791336,
0.0342935211956501,
-0.011104398407042027,
0.02488240785896778,
0.016665508970618248,
-0.03379444405436516,
-0.0022993055172264576,
-0.05931852012872696,
-0.02801944501698017,
-0.009446759708225727,
-0.01917870342731476,
0.037287965416908264,
-0.0019450521795079112,
-0.007953993044793606,
-0.07240138947963715,
-0.038321759551763535,
-0.001424812013283372,
0.00438695028424263,
-0.021620603278279305,
-0.02336736209690571,
0.01944606564939022,
0.02343865856528282,
-0.04277778044342995,
0.03807222470641136,
0.08805093169212341,
0.017200231552124023,
0.07218750566244125,
-0.0011763889342546463,
-0.02858981490135193,
-0.06876528263092041,
0.014749421738088131,
0.07614444941282272,
0.025221064686775208,
-0.0350777804851532,
-0.0037230036687105894,
-0.06555694341659546,
-0.028928473591804504,
0.013403704389929771,
-0.041244909167289734,
0.049230094999074936,
0.08177685737609863,
0.0033888022881001234,
0.008381770923733711,
0.008105497807264328,
-0.019125232473015785,
-0.012280787341296673,
0.02880370430648327,
-0.022832639515399933,
-0.014740509912371635,
0.005507639143615961,
-0.013911690562963486,
-0.0006600477499887347,
0.022262269631028175,
-0.016817014664411545,
0.03803657367825508,
0.0007898292969912291,
0.003983680624514818,
0.0012454572133719921,
0.005979977082461119,
-0.006813252344727516,
0.01585451513528824,
0.032154630869627,
-0.03921296447515488,
-0.02613009326159954,
0.06766019016504288,
-0.033776622265577316,
-0.07414814829826355,
0.0363432876765728,
0.0660560205578804,
0.012574885040521622,
-0.02821551077067852,
0.056110188364982605,
0.0380009263753891,
0.02607662044465542,
-0.020141204819083214,
0.005694791674613953,
-0.009990394115447998,
-0.007700000423938036,
-0.029391899704933167,
0.02420509234070778,
0.02092546410858631,
-0.017868634313344955,
-0.04431064799427986,
-0.027912501245737076,
-0.03889213129878044,
0.11200648546218872,
0.047554630786180496,
0.02698564901947975,
-0.024329861626029015,
0.06331111490726471,
0.03368750214576721,
0.020194675773382187,
0.03842870518565178,
0.039569444954395294,
-0.06837315112352371,
-0.054220836609601974,
0.055682409554719925,
0.010667708702385426,
0.001614192733541131,
-0.022297916933894157,
0.04406111314892769,
0.004202025476843119,
0.03785833343863487,
0.003059056820347905,
0.02964143641293049,
-0.02133541740477085,
0.06758888810873032,
0.042100463062524796,
0.023991204798221588,
-0.047732871025800705,
0.01654074154794216,
-0.032867591828107834,
0.00792725756764412,
-0.021210648119449615,
0.008961053565144539,
0.00866250041872263,
-0.012066898867487907,
0.07061898708343506,
0.03126342594623566,
0.005721528083086014,
0.011389583349227905,
0.07257962971925735,
-0.015426736325025558,
-0.024989351630210876,
-0.0034088543616235256,
0.028875000774860382,
-0.030996065586805344,
-0.012681828811764717,
-0.018002314493060112,
0.04199352115392685,
0.0471625030040741,
0.0555398166179657,
0.013421528041362762,
-0.0012487992644309998,
-0.029195833951234818,
-0.029356250539422035,
0.0015930266818031669,
-0.05343657732009888,
0.0711180567741394,
0.022297916933894157,
-0.026593519374728203,
0.06252685189247131,
0.032475464046001434,
0.02153148129582405,
0.02343865856528282,
0.02734212949872017,
-0.016594212502241135,
-0.06733935326337814,
0.04762592911720276,
0.01347499992698431,
0.0005358362686820328,
0.06356064975261688,
-0.0240625012665987,
-0.012227315455675125,
-0.00031108580878935754,
-0.0009669560240581632,
-0.0108637735247612,
0.002093214774504304,
-0.009455671533942223,
-0.05165416747331619,
-0.0035224827006459236,
-0.019143056124448776,
-0.0006093605770729482,
-0.045023612678050995,
-0.029106713831424713,
0.019499538466334343,
-0.08641111105680466,
0.002885272027924657,
-0.028981944546103477,
0.006051273085176945,
0.01148761622607708,
-0.03422222286462784,
0.06997731328010559,
-0.022262269631028175,
0.0019227720331400633,
-0.01989166811108589,
-0.04409676045179367,
0.016407061368227005,
-0.02108588069677353,
0.018679630011320114,
-0.04630694538354874,
-0.07158148288726807,
-0.04078148305416107,
-0.02088981494307518,
0.05582500249147415,
-0.01378692127764225,
-0.022654399275779724,
0.03903472423553467,
-0.0108637735247612,
-0.04762592911720276,
-0.03484606742858887,
0.024775464087724686,
-0.0010984085965901613,
-0.019784722477197647,
0.03978333622217178,
-0.009402199648320675,
-0.013341319747269154,
-0.02343865856528282,
0.008533275686204433,
0.04431064799427986,
0.023937731981277466,
-0.038999076932668686,
-0.047518983483314514,
-0.020426388829946518,
0.008479803800582886,
0.09011851996183395,
-0.07792685180902481,
-0.010845948942005634,
-0.03575509414076805,
0.023919908329844475,
-0.009268518537282944,
-0.002557754749432206,
-0.007512847427278757,
-0.044774074107408524,
0.04035370424389839,
0.058819446712732315,
-0.01752106472849846,
-0.025720139965415,
-0.07471852004528046,
-0.059211574494838715,
-0.014802893623709679,
0.023028705269098282,
-0.06252685189247131,
-0.005864120554178953,
0.024401158094406128,
0.0007196470396593213,
-0.03529166802763939,
0.04873102158308029,
-0.018118171021342278,
0.008395139127969742,
0.0530087985098362,
0.06302592903375626,
0.03907037153840065,
0.03885648399591446,
-0.005271470174193382,
-0.021157177165150642,
-0.028946297243237495,
-0.02046203799545765,
0.043169908225536346,
0.028286807239055634,
-0.0972481518983841,
0.00002598763967398554,
-0.011648032814264297,
0.026005323976278305,
0.001570746535435319,
-0.0011630208464339375,
-0.004598611034452915,
-0.0005207971553318202,
-0.018430093303322792,
0.015604977495968342,
-0.01923217624425888,
0.04284907504916191,
-0.014820718206465244,
0.023741668090224266,
-0.008622395806014538,
0.0376087985932827,
-0.036058101803064346,
-0.02151365764439106,
0.07471852004528046,
-0.0014548901235684752,
0.0193925928324461,
-0.021442361176013947,
0.009023438207805157,
-0.0044916667975485325,
-0.03504212945699692,
-0.029605787247419357,
-0.018946990370750427,
0.015506944619119167,
0.03579074144363403,
-0.05414953827857971,
0.025809260085225105,
0.04217176139354706,
0.018626157194375992,
-0.019802546128630638,
0.0496935211122036,
-0.009090278297662735,
0.025987500324845314,
-0.005766088142991066,
-0.010694445110857487,
0.008947685360908508,
0.0231891218572855,
0.027948148548603058,
0.0044805267825722694,
0.061100926250219345,
0.032511111348867416,
-0.03129907324910164,
-0.0007057219627313316,
0.02112152799963951,
0.017494328320026398,
-0.025595370680093765,
0.03258240967988968,
0.02005208469927311,
-0.0010867115342989564,
0.01570300944149494,
0.030764352530241013,
0.04192222282290459,
0.010159722529351711,
-0.013947338797152042,
-0.005422974471002817,
0.07147453725337982,
0.00511996541172266,
0.04024675861001015,
-0.0026669271755963564,
-0.006184953730553389,
0.05154722183942795,
-0.011665856465697289,
-0.010026042349636555,
-0.0471625030040741,
-0.013029398396611214,
-0.07208056002855301,
0.004656539298593998,
-0.004046064801514149,
0.016772454604506493,
0.010266667231917381,
0.004511719103902578,
-0.005155613645911217,
0.01989166811108589,
-0.05176111310720444,
0.022422686219215393,
-0.034168750047683716,
-0.007236574310809374,
0.02047986164689064,
-0.02217314951121807,
0.01859050989151001,
-0.032707177102565765,
-0.00867586862295866,
0.016460532322525978,
0.01537326443940401,
0.0240625012665987,
0.00877390056848526,
0.000020226147171342745,
0.05090555548667908,
-0.000924623862374574,
-0.0013223235728219151,
0.003729687537997961,
0.025844907388091087,
-0.004462702665477991,
-0.04381157457828522,
0.016870487481355667,
0.008912037126719952,
0.09332685172557831,
-0.004079484846442938,
0.006701852194964886,
0.01900046318769455,
-0.023331712931394577,
0.04641389101743698,
0.005681423936039209,
0.02673611231148243,
-0.01987384259700775,
0.06199213117361069,
-0.024312037974596024,
-0.025809260085225105,
-0.022387037053704262,
-0.03568379580974579,
0.051297686994075775,
0.005953241139650345,
-0.034774769097566605,
-0.05668055638670921,
0.07357777655124664,
-0.04744768515229225,
0.05079861357808113,
-0.01859050989151001,
-0.026165740564465523,
0.042956020683050156,
-0.017218055203557014,
-0.01023993082344532,
-0.027003472670912743,
-0.0010811415268108249,
0.06188518553972244,
-0.07471852004528046,
-0.017494328320026398,
0.005405150819569826,
0.016683334484696388,
0.027752084657549858,
-0.0775703713297844,
0.004536226857453585,
0.02447245456278324,
0.05639537051320076,
-0.03488171473145485,
0.026468750089406967,
-0.02258310280740261,
-0.006028993055224419,
0.006020081229507923,
0.017699306830763817,
0.04238564893603325,
0.00034561994834803045,
-0.009892361238598824,
0.0383930578827858,
0.007312326692044735,
-0.037751391530036926,
-0.015177199617028236,
0.05247407406568527,
0.021353241056203842,
0.03383009508252144,
0.023937731981277466,
0.05054907500743866,
0.039569444954395294,
-0.02671828866004944,
0.04873102158308029,
-0.10416389256715775,
-0.039569444954395294,
-0.07140324264764786,
-0.01736956089735031,
-0.0030300926882773638,
-0.003518026787787676,
-0.00028351417859084904,
-0.03115648217499256,
0.10787130147218704,
0.023456482216715813,
-0.0012387732276692986,
0.0012086950009688735,
-0.04177962988615036,
0.027217362076044083,
-0.01774386689066887,
0.02005208469927311,
-0.00507094943895936,
0.026415279135107994,
-0.012512500397861004,
0.010204282589256763,
0.0014292679261416197,
0.024347685277462006,
0.10573241114616394,
-0.024918057024478912,
-0.01044490747153759,
-0.0013056134339421988,
-0.09047500044107437,
0.0069870371371507645,
-0.004253269638866186,
-0.00032139034010469913,
-0.014802893623709679,
-0.03283194452524185,
0.0299087967723608,
-0.0021232927683740854,
0.013778009451925755,
-0.0005308231920935214,
-0.015150463208556175,
0.018519213423132896,
-0.0248467605561018,
0.1371740847826004,
-0.002818431705236435,
-0.01358194462954998,
-0.06142175942659378,
0.01294027827680111,
-0.03509560227394104,
-0.04324120655655861,
0.058391667902469635,
-0.024811111390590668,
0.03892777860164642,
-0.006002257112413645,
-0.0028629919979721308,
0.015328704379498959,
-0.035202547907829285,
-0.0359511598944664,
0.025007177144289017,
-0.02630833350121975,
-0.027306482195854187,
-0.0869101881980896,
0.00827037077397108,
0.04841018468141556,
0.006002257112413645,
-0.06434491276741028,
-0.013421528041362762,
-0.0009552590199746192,
0.0017445313278585672,
0.022707870230078697,
-0.0030924768652766943,
-0.03675324097275734,
0.021406713873147964,
-0.06381018459796906,
0.05571805685758591,
-0.034168750047683716,
0.0040326970629394054,
-0.06331111490726471,
0.0219236109405756,
-0.014695949852466583,
0.003997048828750849,
-0.07749907672405243,
0.018519213423132896,
-0.06331111490726471,
0.02110370434820652,
-0.0672324076294899,
0.007490567397326231,
0.01921435259282589,
0.009313078597187996,
-0.052295833826065063,
0.017654746770858765,
0.02880370430648327,
0.036058101803064346,
0.00878726877272129,
-0.03161991015076637,
-0.0962500050663948,
0.008711516857147217,
0.026825232431292534,
0.01158564817160368,
-0.005271470174193382,
-0.03030092641711235,
-0.010186458937823772,
-0.005436342675238848,
0.0021310909651219845,
0.10452037304639816,
-0.0077623846009373665,
0.0000963614002102986,
-0.02194143645465374,
-0.06466574221849442,
0.04830324277281761,
0.002126634819433093,
0.02336736209690571,
0.04388287290930748,
0.007967361249029636,
0.04284907504916191,
-0.019285649061203003,
-0.04259953647851944,
0.007004861254245043,
-0.031245602294802666,
0.026272686198353767,
-0.010248842649161816,
-0.0181716438382864,
-0.046057410538196564,
0.0030791088938713074,
0.027894677594304085,
-0.025577547028660774,
-0.03327754884958267,
-0.03548773378133774,
-0.058569908142089844,
-0.016870487481355667,
0.05079861357808113,
-0.02880370430648327,
-0.022636575624346733,
-0.009321991354227066,
0.04848148301243782,
-0.003362066112458706,
-0.03598680719733238,
0.011202431283891201,
0.003852228168398142,
-0.008796180598437786,
-0.0342935211956501,
0.002010778523981571,
-0.009330903179943562,
-0.00255998270586133,
0.010819213464856148,
0.04726944491267204,
0.012271875515580177,
0.014927662909030914,
0.038535650819540024,
0.006519155111163855,
-0.00772673636674881,
-0.09282778203487396,
-0.04185092821717262,
-0.021246297284960747,
-0.002004094421863556,
-0.02363472245633602,
0.0430629625916481,
0.03889213129878044,
0.010525115765631199,
-0.057143982499837875,
-0.009687384590506554,
0.008359490893781185,
-0.02363472245633602,
-0.06865833699703217,
-0.0037452836986631155,
0.03465000167489052,
0.027324305847287178,
-0.007575231604278088,
0.02801944501698017,
-0.012182755395770073,
0.037216667085886,
0.00972303282469511,
-0.044203706085681915,
-0.07001296430826187,
0.009001157246530056,
0.002039742423221469,
-0.03700277954339981,
0.0350777804851532,
-0.07008425891399384,
0.008283738978207111,
0.02507847361266613,
-0.00907245371490717,
0.024294214323163033,
-0.07357777655124664,
-0.03297453746199608,
-0.013403704389929771,
0.046378243714571,
-0.015025694854557514,
-0.04035370424389839,
-0.060708798468112946,
0.03211898356676102,
-0.011353935115039349,
0.00958935171365738,
0.03530949354171753,
0.0233851857483387,
0.013724537566304207,
0.012699653394520283,
0.04341944679617882,
0.03051481582224369,
0.014241435565054417,
0.08092129975557327,
-0.00579282408580184,
0.005271470174193382,
-0.06031666696071625,
0.022208796814084053,
0.06345370411872864,
0.01669224537909031,
0.06783843040466309,
0.033313196152448654,
-0.03361620381474495,
0.01106875017285347,
-0.04370463266968727,
-0.016210995614528656,
0.04135185480117798,
-0.024757640436291695,
-0.05372175946831703,
-0.023688195273280144,
-0.052117593586444855,
0.03463217616081238,
-0.04135185480117798,
0.04338379576802254,
-0.0539712980389595,
0.010409259237349033,
-0.04912314936518669
]
|
36,418 | torch.optim.optimizer | register_step_post_hook | Register an optimizer step post hook which will be called after optimizer step.
It should have the following signature::
hook(optimizer, args, kwargs) -> None
The ``optimizer`` argument is the optimizer instance being used.
Args:
hook (Callable): The user defined hook to be registered.
Returns:
:class:`torch.utils.hooks.RemovableHandle`:
a handle that can be used to remove the added hook by calling
``handle.remove()``
| def register_step_post_hook(self, hook: OptimizerPostHook) -> RemovableHandle:
r"""Register an optimizer step post hook which will be called after optimizer step.
It should have the following signature::
hook(optimizer, args, kwargs) -> None
The ``optimizer`` argument is the optimizer instance being used.
Args:
hook (Callable): The user defined hook to be registered.
Returns:
:class:`torch.utils.hooks.RemovableHandle`:
a handle that can be used to remove the added hook by calling
``handle.remove()``
"""
handle = hooks.RemovableHandle(self._optimizer_step_post_hooks)
self._optimizer_step_post_hooks[handle.id] = hook
return handle
| (self, hook: Callable[[typing_extensions.Self, Tuple[Any, ...], Dict[str, Any]], NoneType]) -> torch.utils.hooks.RemovableHandle | [
-0.006582796573638916,
0.046182502061128616,
-0.07124277949333191,
0.04854533076286316,
-0.013201394118368626,
0.004076769575476646,
0.001075130421668291,
0.00022626965073868632,
-0.03506648167967796,
-0.004213258624076843,
0.036838602274656296,
0.0009973765118047595,
-0.043676476925611496,
-0.04228026047348976,
-0.016360778361558914,
0.01027471199631691,
-0.021963540464639664,
0.05266237258911133,
-0.03198764845728874,
0.011885729618370533,
0.016092276200652122,
-0.004873328376561403,
0.019529113546013832,
-0.019421711564064026,
-0.0008138995035551488,
-0.0068647246807813644,
0.0205136239528656,
-0.009290201589465141,
-0.0010650616604834795,
0.04543069377541542,
0.014266455546021461,
-0.07185138016939163,
0.02182033844292164,
-0.029445821419358253,
0.005580385681241751,
-0.02296595089137554,
0.003508438356220722,
0.04006063565611839,
-0.033777669072151184,
-0.0153852179646492,
0.003732190700247884,
0.006493296008557081,
0.03590779006481171,
-0.010435814037919044,
0.04117044806480408,
0.01572532206773758,
-0.008404141291975975,
-0.0579250305891037,
0.030663033947348595,
-0.034654777497053146,
0.020638925954699516,
-0.10876158624887466,
0.050227947533130646,
0.021641336381435394,
0.0417790561914444,
0.00009495494305156171,
0.02488127164542675,
-0.03884342312812805,
0.017783844843506813,
0.014427557587623596,
0.03232775256037712,
-0.038700222969055176,
-0.009263350628316402,
0.010364213027060032,
0.0453948937356472,
-0.017748042941093445,
-0.017336338758468628,
-0.010856468230485916,
0.011384524405002594,
-0.0014857162022963166,
-0.04854533076286316,
-0.06329508870840073,
0.034189373254776,
0.008162489160895348,
0.017730142921209335,
-0.0020831353031098843,
0.025615179911255836,
-0.06422589719295502,
0.02330605499446392,
0.021856138482689857,
-0.022464744746685028,
-0.01800759695470333,
-0.0007400612230412662,
0.02484547160565853,
-0.0011959568364545703,
-0.04643310606479645,
0.01013151090592146,
-0.05595600977540016,
-0.04944033920764923,
-0.034081973135471344,
-0.011080221273005009,
-0.04822312667965889,
0.007177978288382292,
0.013093993067741394,
-0.022894348949193954,
-0.046540506184101105,
0.0015461293514817953,
0.04449988529086113,
0.008874021470546722,
-0.02114013023674488,
-0.016530830413103104,
0.019171109423041344,
0.04543069377541542,
0.05996565520763397,
0.06730473041534424,
-0.019457511603832245,
0.0177569929510355,
-0.04206546023488045,
-0.04779352247714996,
-0.025346675887703896,
0.048688530921936035,
-0.04700591415166855,
-0.022769048810005188,
0.004801727365702391,
-0.005459559615701437,
0.03744720667600632,
-0.01901000738143921,
-0.016253376379609108,
0.017694342881441116,
0.030126027762889862,
-0.010713267140090466,
-0.02461276762187481,
-0.02554357796907425,
0.005683312192559242,
-0.05198216810822487,
-0.014427557587623596,
0.06845034658908844,
0.07926206290721893,
-0.07238838821649551,
-0.03239935263991356,
0.00522238202393055,
0.04643310606479645,
-0.05173156410455704,
-0.04475048929452896,
-0.039058227092027664,
0.030537733808159828,
0.043712276965379715,
0.010605866089463234,
0.005119455978274345,
-0.04607510194182396,
-0.014884012751281261,
0.009017223492264748,
-0.029606923460960388,
-0.029642723500728607,
0.011277123354375362,
0.004148370120674372,
-0.045896101742982864,
0.10575435310602188,
0.04582449793815613,
-0.0590706430375576,
-0.014901912771165371,
-0.0018996582366526127,
0.0486169308423996,
0.0033607615623623133,
0.019976617768406868,
0.0034950131084769964,
-0.022321542724967003,
0.06118286773562431,
-0.04675531014800072,
-0.011196572333574295,
0.033455464988946915,
-0.025740480050444603,
-0.0060547408647835255,
-0.008757670409977436,
0.0021032728254795074,
-0.01274493895471096,
0.07453641295433044,
-0.0013917401665821671,
-0.022769048810005188,
0.04890333488583565,
0.021712936460971832,
-0.023843059316277504,
0.008332541212439537,
0.06612332165241241,
-0.028855115175247192,
0.12050411105155945,
0.03916562721133232,
-0.0038843422662466764,
-0.011697777546942234,
-0.00029255630215629935,
0.03245305269956589,
0.018580403178930283,
0.012109481729567051,
-0.030376631766557693,
-0.045860301703214645,
-0.056170813739299774,
-0.035513985902071,
-0.027476798743009567,
-0.04940453916788101,
0.027190396562218666,
-0.0005006460705772042,
0.04986994341015816,
0.055240001529455185,
-0.07213778793811798,
-0.029768025502562523,
0.0017374376766383648,
-0.01863410323858261,
0.021838238462805748,
0.08119528740644455,
-0.010212060995399952,
0.00029395477031357586,
0.023735659196972847,
0.0006142004276625812,
0.05688682198524475,
0.006949750706553459,
-0.0041215200908482075,
0.01151877548545599,
0.01244958583265543,
-0.05595600977540016,
0.011778328567743301,
0.04575289785861969,
-0.0006444070022553205,
-0.02146233431994915,
0.0615408718585968,
-0.00904854852706194,
-0.0503353476524353,
-0.03517388179898262,
0.04603930190205574,
0.03411777317523956,
0.014293305575847626,
-0.0038507794961333275,
0.00668124807998538,
-0.015018263831734657,
0.016432378441095352,
0.03401036933064461,
-0.01716628670692444,
-0.009352851659059525,
-0.048974934965372086,
0.03050193190574646,
-0.01868780329823494,
-0.05570540577173233,
-0.014669209718704224,
-0.028174906969070435,
-0.0149556128308177,
0.12795059382915497,
0.05813983455300331,
-0.009017223492264748,
-0.0391298271715641,
0.05001314729452133,
0.04471468925476074,
0.005499835126101971,
-0.03639109805226326,
0.015770072117447853,
-0.036552198231220245,
-0.038700222969055176,
0.1103368028998375,
0.0020808978006243706,
-0.01667403243482113,
0.053378380835056305,
0.01958281360566616,
0.015188315883278847,
0.008363866247236729,
0.003063170937821269,
0.023485057055950165,
-0.0364626981317997,
0.07661283761262894,
0.07704243808984756,
0.03512018173933029,
-0.0022196241188794374,
0.019797615706920624,
-0.01591327413916588,
-0.017935995012521744,
0.017506390810012817,
0.02550777792930603,
-0.03862862288951874,
-0.029087817296385765,
0.03819901496171951,
-0.015698472037911415,
0.037160806357860565,
-0.0012664388632401824,
0.10167311131954193,
-0.0020775413140654564,
-0.08942937850952148,
-0.026617590337991714,
0.012243733741343021,
0.028711913153529167,
-0.007768684532493353,
0.037125006318092346,
-0.019833415746688843,
-0.024648569524288177,
0.08484692871570587,
0.004528749268501997,
0.029016217216849327,
-0.03433257341384888,
-0.1109096109867096,
0.05312778055667877,
-0.01291499100625515,
0.07969167083501816,
0.006166617386043072,
-0.012771788984537125,
0.00244785170070827,
0.02396836131811142,
0.04070504382252693,
0.05563380569219589,
0.06562211364507675,
0.020710526034235954,
-0.08162488788366318,
-0.004300521686673164,
0.014382806606590748,
0.00786266103386879,
0.003251123009249568,
-0.01260173786431551,
-0.0007484519155696034,
0.027584200724959373,
-0.018473001196980476,
0.014194854535162449,
0.0338134691119194,
-0.021551834419369698,
-0.026814492419362068,
-0.030645133927464485,
-0.0037926039658486843,
-0.00559381116181612,
-0.04983414337038994,
-0.008967997506260872,
0.01902790740132332,
-0.06118286773562431,
-0.020638925954699516,
-0.0299112256616354,
-0.013980052433907986,
-0.02584788203239441,
-0.04485788941383362,
0.04328267276287079,
-0.0021737548522651196,
-0.047113314270973206,
0.010301562026143074,
-0.0006393726216629148,
-0.011975230649113655,
-0.03524548560380936,
0.015358367934823036,
-0.02400416135787964,
-0.024505367502570152,
-0.05044275149703026,
-0.01926060952246189,
0.03644479811191559,
0.03567508980631828,
-0.05506100133061409,
0.04514429345726967,
-0.025955282151699066,
-0.008189339190721512,
0.01929640956223011,
0.0048196273855865,
0.046218305826187134,
0.017515340819954872,
0.048688530921936035,
0.062077876180410385,
0.02366405725479126,
-0.02919521927833557,
-0.0034614503383636475,
0.03805581480264664,
0.07145757973194122,
-0.02146233431994915,
-0.09888067841529846,
-0.05531160160899162,
-0.054631397128105164,
0.031146340072155,
-0.07611162960529327,
0.0036561149172484875,
0.02518557384610176,
0.013389346189796925,
-0.04693431034684181,
-0.03443997725844383,
-0.005580385681241751,
-0.009585554711520672,
0.07056257128715515,
0.09852267801761627,
-0.01893840730190277,
-0.04263826459646225,
-0.03367026895284653,
0.005795188248157501,
0.0012843389995396137,
0.0017967320745810866,
-0.04231606051325798,
0.03277525678277016,
0.04543069377541542,
-0.010659566149115562,
-0.03392086923122406,
0.021963540464639664,
0.027297798544168472,
0.016512930393218994,
0.04195805639028549,
0.019869215786457062,
0.02674289233982563,
0.035621389746665955,
-0.034726377576589584,
0.03773361071944237,
-0.03109264001250267,
-0.058999042958021164,
0.03984583541750908,
-0.00306988344527781,
-0.05191056430339813,
-0.0021916551049798727,
0.005329783074557781,
-0.0058667887933552265,
-0.024791769683361053,
-0.0017710005631670356,
-0.014087453484535217,
-0.09551544487476349,
0.0065290960483253,
-0.03606889396905899,
0.002539590233936906,
-0.0049762544222176075,
0.014069553464651108,
0.002868506358936429,
-0.012243733741343021,
0.0029378696344792843,
-0.024755969643592834,
-0.05559800565242767,
0.06744793802499771,
0.008650269359350204,
0.004016356077045202,
-0.019350111484527588,
0.00912462454289198,
0.03784101456403732,
-0.02457696758210659,
0.0026380412746220827,
0.002902069129049778,
0.05452399328351021,
0.025006573647260666,
-0.02271534688770771,
-0.011026520282030106,
0.045896101742982864,
0.07747204601764679,
-0.03293636068701744,
0.027620000764727592,
-0.036874402314424515,
-0.03612259402871132,
-0.018473001196980476,
0.0046227253042161465,
-0.07646963745355606,
-0.005114980973303318,
0.03614049404859543,
0.014964562840759754,
0.04356907680630684,
0.06372469663619995,
-0.02486337162554264,
0.007714984007179737,
-0.0035934641491621733,
0.015832722187042236,
0.01762274280190468,
0.013729449361562729,
-0.008990373462438583,
-0.017354238778352737,
-0.011867829598486423,
0.008216189220547676,
0.048402126878499985,
-0.015510519035160542,
0.02026302181184292,
-0.05330678075551987,
-0.003738903207704425,
-0.025006573647260666,
0.03730400651693344,
0.03402826935052872,
0.0021983676124364138,
0.04639730602502823,
0.001781069440767169,
-0.06318768858909607,
-0.05248337239027023,
-0.0983794704079628,
-0.05910644307732582,
0.046576306223869324,
-0.01831189915537834,
0.012879190035164356,
0.025113973766565323,
0.005531160160899162,
-0.0020450972951948643,
0.0013179018860682845,
-0.008390716277062893,
0.025113973766565323,
0.018419301137328148,
0.005401384085416794,
0.0186162032186985,
-0.00716455327346921,
-0.00489570340141654,
-0.013568348251283169,
-0.017542190849781036,
-0.008914297446608543,
0.016083326190710068,
-0.004618250299245119,
-0.015412067994475365,
0.023431355133652687,
0.02520347572863102,
-0.0018895893590524793,
0.00949605368077755,
0.019690215587615967,
-0.0013257332611829042,
0.05656461790204048,
-0.02396836131811142,
0.014821361750364304,
0.04038283973932266,
0.06254328042268753,
-0.003206372493878007,
0.00272082956507802,
0.02835390903055668,
-0.01809709705412388,
0.020925328135490417,
0.0005235807038843632,
0.016799332574009895,
0.035567689687013626,
0.08098047971725464,
-0.020692626014351845,
-0.023270253092050552,
-0.055490605533123016,
-0.04070504382252693,
-0.03401036933064461,
0.012941841036081314,
-0.08183969557285309,
-0.03927302733063698,
0.056851018220186234,
-0.06275808811187744,
0.045287493616342545,
-0.009997258894145489,
-0.05287717655301094,
-0.00644854549318552,
-0.012181082740426064,
0.015958024188876152,
0.029982827603816986,
0.015331516973674297,
0.01819554902613163,
-0.027816902846097946,
0.006582796573638916,
-0.017515340819954872,
0.0068647246807813644,
0.02119383029639721,
-0.10346312820911407,
0.04220866039395332,
0.021945638582110405,
0.004307234659790993,
0.00279690558090806,
0.04890333488583565,
-0.015635820105671883,
0.012306383810937405,
0.016557680442929268,
0.0023740134201943874,
0.002649228787049651,
0.016718782484531403,
0.061111267656087875,
0.01614597626030445,
0.0063635194674134254,
-0.015358367934823036,
-0.02019141986966133,
-0.0173810888081789,
0.008851646445691586,
-0.04149265214800835,
-0.05448819324374199,
-0.030645133927464485,
0.026062684133648872,
0.0003157706232741475,
0.04077664390206337,
-0.043067868798971176,
-0.039022427052259445,
-0.022554246708750725,
0.012306383810937405,
-0.0008575312094762921,
0.03307956084609032,
-0.00786266103386879,
0.00159311736933887,
0.03272155672311783,
0.033437564969062805,
0.01621757633984089,
-0.029016217216849327,
-0.06447650492191315,
0.015662670135498047,
0.014248555526137352,
0.0030788336880505085,
0.031880248337984085,
0.004188645631074905,
0.00019913967116735876,
-0.0078089600428938866,
-0.04360487684607506,
0.0014946663286536932,
0.05438079312443733,
-0.05409438908100128,
0.0177569929510355,
-0.08935777097940445,
-0.043998681008815765,
0.018831005319952965,
0.004591400269418955,
-0.006032365839928389,
-0.01931431144475937,
-0.022500544786453247,
-0.0022509496193379164,
0.03963103145360947,
-0.014597609639167786,
-0.009370752610266209,
-0.043712276965379715,
-0.0032108474988490343,
0.022643746808171272,
0.07109957188367844,
-0.008874021470546722,
0.009505003690719604,
-0.058999042958021164,
0.06637392193078995,
-0.054273393005132675,
-0.0788324624300003,
0.04700591415166855,
-0.015063013881444931,
-0.04038283973932266,
0.01961861364543438,
0.014982463791966438,
0.02835390903055668,
-0.010328412987291813,
-0.031916048377752304,
-0.02486337162554264,
0.000282627297565341,
0.008847171440720558,
-0.0351380817592144,
-0.026259586215019226,
-0.028067506849765778,
-0.005625136196613312,
-0.040597643703222275,
-0.04167165607213974,
-0.018741505220532417,
0.04582449793815613,
0.038163214921951294,
-0.035281285643577576,
-0.007522556930780411,
0.012583836913108826,
-0.0459677018225193,
0.04389127716422081,
0.023771459236741066,
-0.004801727365702391,
-0.034726377576589584,
0.03941623121500015,
-0.04074084386229515,
0.03356286510825157,
-0.06318768858909607,
-0.00040778881520964205,
-0.030072327703237534,
0.006712573114782572,
-0.015966974198818207,
-0.0598224513232708,
0.04446408525109291,
0.031593844294548035,
-0.06891575455665588,
0.022894348949193954,
-0.00506575545296073,
-0.015188315883278847,
-0.006461970508098602,
0.01261963788419962,
-0.13059982657432556,
0.036838602274656296,
0.08384451270103455,
-0.016459230333566666,
-0.02182033844292164,
-0.006282968446612358,
0.03567508980631828,
0.028479211032390594,
-0.0019846840295940638,
0.043676476925611496,
-0.013013442046940327,
-0.011679877527058125,
0.035352885723114014,
-0.028192806988954544,
0.041600052267313004,
0.01352359727025032,
0.0035666138865053654,
0.058354634791612625,
0.02427266538143158,
0.018544603139162064,
-0.003996218554675579,
-0.002228574361652136,
-0.017667492851614952,
-0.0009364039869979024,
-0.029481621459126472,
-0.052447572350502014,
0.007625482976436615,
-0.03277525678277016,
-0.0006018940475769341,
-0.017354238778352737,
-0.02898041531443596,
-0.037232406437397,
-0.05377218499779701,
-0.03823481872677803,
-0.02744099870324135,
0.04646890610456467,
-0.036247894167900085,
0.0006762917619198561,
-0.034654777497053146,
-0.014803461730480194,
-0.004146132618188858,
-0.034081973135471344,
-0.01988711766898632,
-0.03082413598895073,
-0.012288483791053295,
-0.020030317828059196,
0.08398771286010742,
0.002499314723536372,
0.033491265028715134,
0.028694013133645058,
0.014884012751281261,
0.012198982760310173,
-0.02087162807583809,
0.08341491222381592,
0.0027163545601069927,
0.004882278386503458,
-0.031916048377752304,
-0.014320156536996365,
0.006112916860729456,
-0.01213633269071579,
-0.026062684133648872,
0.02958902344107628,
-0.010462664067745209,
0.011885729618370533,
-0.047113314270973206,
0.04174325615167618,
-0.0012384697329252958,
-0.0012485386105254292,
-0.04754291847348213,
0.00015718609211035073,
0.01508986484259367,
0.012807589955627918,
-0.004631675314158201,
0.04446408525109291,
-0.021551834419369698,
0.011706727556884289,
-0.022590046748518944,
-0.09043178707361221,
-0.034959081560373306,
-0.02364615723490715,
-0.027566300705075264,
-0.05749542638659477,
-0.005526685155928135,
-0.005705687217414379,
-0.03963103145360947,
0.0022509496193379164,
0.011474025435745716,
0.015188315883278847,
-0.038986627012491226,
0.0357108898460865,
0.0036001766566187143,
-0.005692262202501297,
0.009164899587631226,
0.04697011411190033,
-0.015537369064986706,
-0.02672499231994152,
0.009710855782032013,
0.03460107743740082,
0.05670781806111336,
0.03264995664358139,
0.00010033898433903232,
0.02579418197274208,
0.017479540780186653,
0.07990647107362747,
-0.0064082699827849865,
0.1333206593990326,
0.007768684532493353,
-0.02205304056406021,
0.005580385681241751,
-0.007137702777981758,
0.016378678381443024,
0.06583692133426666,
0.03952363133430481,
0.039738431572914124,
0.02992912568151951,
0.0077284094877541065,
-0.02523927576839924,
0.059213846921920776,
-0.02303755097091198,
-0.010462664067745209,
-0.04013223946094513,
-0.00887849647551775,
-0.07339079678058624,
0.020298821851611137,
-0.059607651084661484,
0.05498940125107765,
-0.04163585230708122,
0.011384524405002594,
-0.03576458990573883
]
|
36,419 | torch.optim.optimizer | register_step_pre_hook | Register an optimizer step pre hook which will be called before
optimizer step. It should have the following signature::
hook(optimizer, args, kwargs) -> None or modified args and kwargs
The ``optimizer`` argument is the optimizer instance being used. If
args and kwargs are modified by the pre-hook, then the transformed
values are returned as a tuple containing the new_args and new_kwargs.
Args:
hook (Callable): The user defined hook to be registered.
Returns:
:class:`torch.utils.hooks.RemovableHandle`:
a handle that can be used to remove the added hook by calling
``handle.remove()``
| def register_step_pre_hook(self, hook: OptimizerPreHook) -> RemovableHandle:
r"""Register an optimizer step pre hook which will be called before
optimizer step. It should have the following signature::
hook(optimizer, args, kwargs) -> None or modified args and kwargs
The ``optimizer`` argument is the optimizer instance being used. If
args and kwargs are modified by the pre-hook, then the transformed
values are returned as a tuple containing the new_args and new_kwargs.
Args:
hook (Callable): The user defined hook to be registered.
Returns:
:class:`torch.utils.hooks.RemovableHandle`:
a handle that can be used to remove the added hook by calling
``handle.remove()``
"""
handle = hooks.RemovableHandle(self._optimizer_step_pre_hooks)
self._optimizer_step_pre_hooks[handle.id] = hook
return handle
| (self, hook: Callable[[typing_extensions.Self, Tuple[Any, ...], Dict[str, Any]], Optional[Tuple[Tuple[Any, ...], Dict[str, Any]]]]) -> torch.utils.hooks.RemovableHandle | [
-0.04024837538599968,
0.043611545115709305,
-0.02319490909576416,
0.043136317282915115,
0.01818670891225338,
0.030433036386966705,
0.024986162781715393,
0.00757170282304287,
-0.005314357578754425,
0.006612102501094341,
0.04331909865140915,
-0.03083515539765358,
-0.010902886278927326,
-0.03348547965288162,
-0.03293713554739952,
-0.011990433558821678,
-0.027197813615202904,
0.024236761033535004,
-0.0430632047355175,
-0.0032854885794222355,
0.01313281524926424,
0.009568585082888603,
0.014165527187287807,
-0.006475016940385103,
0.011935599148273468,
0.005876409355551004,
0.00610945513471961,
0.00008253704436356202,
0.01125017087906599,
0.019246838986873627,
0.04858319088816643,
-0.010610437020659447,
0.03297369182109833,
-0.03573368489742279,
-0.006726340856403112,
-0.0263752993196249,
0.01710830256342888,
0.008147463202476501,
-0.03933447226881981,
-0.011926460079848766,
0.004546677228063345,
-0.005451443139463663,
0.034746669232845306,
-0.015563801862299442,
0.02652152255177498,
-0.006251110229641199,
0.005200119689106941,
-0.052385035902261734,
0.05245814844965935,
-0.01660565473139286,
0.042916979640722275,
-0.10213802009820938,
0.051580797880887985,
0.027581652626395226,
0.018369490280747414,
-0.02696019783616066,
0.04642637446522713,
-0.04225896671414375,
0.015956781804561615,
0.02933635003864765,
0.056844890117645264,
-0.01719055324792862,
-0.01114050205796957,
0.007037068717181683,
0.054651521146297455,
-0.0742456391453743,
-0.01571916602551937,
-0.012758113443851471,
0.002170524327084422,
-0.025790398940443993,
-0.05563853681087494,
-0.055455755442380905,
0.04971643164753914,
0.012191493064165115,
0.020635975524783134,
0.004843696486204863,
0.005570251028984785,
-0.0791076198220253,
0.05786846578121185,
-0.005401178728789091,
0.004210817161947489,
-0.018561409786343575,
-0.013215066865086555,
0.02352391555905342,
0.013799965381622314,
-0.04891219735145569,
0.003452276112511754,
-0.06276699900627136,
0.00884203054010868,
-0.004057738464325666,
-0.03918824717402458,
0.008494746871292591,
-0.008467329666018486,
0.03809155896306038,
0.019466176629066467,
-0.006991373375058174,
0.02867833897471428,
0.026247352361679077,
0.029153570532798767,
-0.009650836698710918,
0.010820635594427586,
0.03615408390760422,
0.03019542060792446,
0.047011274844408035,
0.06225520744919777,
-0.01826896145939827,
0.012474803254008293,
-0.03502083942294121,
-0.015271352604031563,
-0.009239579550921917,
0.030177142471075058,
-0.06667850911617279,
-0.03730560094118118,
0.01485095638781786,
0.017044328153133392,
0.008065211586654186,
-0.00982447899878025,
-0.028861120343208313,
0.013516655191779137,
0.03842056542634964,
-0.008339383639395237,
-0.04989921301603317,
-0.012136658653616905,
0.01342526450753212,
-0.054432183504104614,
-0.02184232883155346,
0.09702015668153763,
0.0791076198220253,
-0.041308507323265076,
-0.05845336243510246,
0.048729415982961655,
0.031292106956243515,
-0.062072429805994034,
-0.04807140305638313,
-0.05457840859889984,
-0.003095853142440319,
0.07168670743703842,
0.02690536342561245,
0.00808348972350359,
-0.04891219735145569,
-0.0017284228233620524,
0.009020242840051651,
-0.0446716770529747,
0.009806200861930847,
-0.021403655409812927,
-0.010455072857439518,
-0.0188447218388319,
0.09343764930963516,
0.044415783137083054,
-0.038128115236759186,
0.026064570993185043,
-0.0191006138920784,
0.04730372503399849,
-0.0067811752669513226,
0.010701827704906464,
0.0037036000285297632,
-0.057831909507513046,
0.01854313351213932,
-0.008951699361205101,
-0.002226501004770398,
0.02928151562809944,
-0.014074137434363365,
0.018616244196891785,
-0.03615408390760422,
-0.00422681076452136,
-0.01740989089012146,
0.04511035233736038,
-0.005972369108349085,
-0.04569524899125099,
0.054359070956707,
0.07837649434804916,
-0.031237272545695305,
0.035441234707832336,
0.07881516963243484,
-0.0010658417595550418,
0.08459104597568512,
0.03246190771460533,
-0.01787598244845867,
-0.02518722228705883,
0.011039972305297852,
0.05618688091635704,
0.03449077531695366,
0.0039389305748045444,
-0.018442602828145027,
-0.05600409954786301,
-0.05494396761059761,
-0.012355995364487171,
-0.047230612486600876,
-0.004455287009477615,
0.03332097828388214,
0.03374137356877327,
0.04353843629360199,
0.029775025323033333,
-0.030542705208063126,
-0.03776255622506142,
0.016788434237241745,
-0.03598957881331444,
0.006141441874206066,
0.040065594017505646,
0.0030295951291918755,
-0.00716958474367857,
0.063534677028656,
0.0069228303618729115,
0.06214554235339165,
0.01646856777369976,
0.01985001750290394,
0.01227374467998743,
0.02610112726688385,
-0.03922480344772339,
0.018141014501452446,
0.03606269136071205,
-0.038822684437036514,
-0.023651862516999245,
0.058416809886693954,
-0.03598957881331444,
-0.05139801651239395,
-0.002775986446067691,
0.055894430726766586,
0.041893403977155685,
0.008828322403132915,
0.01644115149974823,
0.004249658435583115,
-0.022244447842240334,
-0.028586948290467262,
0.035331565886735916,
-0.018533993512392044,
-0.005734753794968128,
-0.06708062440156937,
-0.025333447381854057,
0.00374015630222857,
-0.043574992567300797,
-0.051800135523080826,
-0.04445233941078186,
-0.03354031220078468,
0.09394943714141846,
0.06916432827711105,
0.015883669257164,
-0.00651157321408391,
0.05333549529314041,
0.011177058331668377,
0.008115476928651333,
-0.001633605221286416,
0.057502903044223785,
-0.04083327576518059,
-0.05106901004910469,
0.09870173782110214,
-0.0196489579975605,
-0.012502220459282398,
0.019173726439476013,
0.03562401607632637,
-0.007165015209466219,
0.024565767496824265,
-0.0031735352240502834,
0.04185684770345688,
-0.04262452945113182,
0.06382712721824646,
0.07080935686826706,
0.018579687923192978,
-0.038603346794843674,
0.02357874996960163,
-0.050776563584804535,
-0.02314007468521595,
0.035112231969833374,
0.03163938969373703,
-0.011332422494888306,
-0.021275708451867104,
0.046572599560022354,
0.022829346358776093,
0.041089169681072235,
0.016505124047398567,
0.11164263635873795,
-0.006493295077234507,
-0.043245986104011536,
0.0028331056237220764,
0.02873317338526249,
-0.029775025323033333,
-0.05344516411423683,
0.022134779021143913,
0.0017112870700657368,
0.007398060988634825,
0.06909121572971344,
0.00777733139693737,
-0.016980355605483055,
-0.05794157832860947,
-0.10052955150604248,
0.013361291028559208,
-0.0076630935072898865,
0.0640464648604393,
0.002264199545606971,
-0.022079944610595703,
0.002910787472501397,
0.04101605713367462,
0.015764862298965454,
0.007941834628582,
0.056844890117645264,
0.034253161400556564,
-0.07194260507822037,
0.007142167538404465,
-0.010509907267987728,
0.011259309947490692,
0.01868021860718727,
-0.025497950613498688,
-0.013946190476417542,
-0.01638631708920002,
-0.028714895248413086,
0.010235736146569252,
-0.01937478594481945,
-0.014275196008384228,
-0.049423981457948685,
-0.04013870656490326,
-0.020215578377246857,
0.010107789188623428,
-0.04854663461446762,
-0.047340277582407,
0.013891356065869331,
-0.0699320137500763,
0.001425691763870418,
0.015042876824736595,
0.0038909504655748606,
-0.015508968383073807,
-0.023176630958914757,
0.0683600977063179,
-0.014576785266399384,
-0.01555466279387474,
0.005606807302683592,
-0.011451229453086853,
0.0011823646491393447,
-0.04068705067038536,
0.0013799965381622314,
-0.030542705208063126,
-0.042003072798252106,
-0.011113084852695465,
-0.04013870656490326,
0.02738059312105179,
-0.00030016066739335656,
-0.043026648461818695,
0.03401554375886917,
-0.028056884184479713,
-0.01256619393825531,
0.009303553029894829,
0.041198838502168655,
0.01011692825704813,
0.009687392972409725,
0.05571164935827255,
0.015042876824736595,
-0.0034774085506796837,
-0.005158993881195784,
0.0059221042320132256,
0.04445233941078186,
0.04397710785269737,
-0.01536274328827858,
-0.08751554042100906,
-0.04697471857070923,
-0.04470823332667351,
0.042112741619348526,
-0.08736931532621384,
-0.023432524874806404,
-0.0031255551148205996,
0.04218585416674614,
-0.03842056542634964,
-0.0162766482681036,
-0.014668175019323826,
-0.01490579079836607,
0.050447557121515274,
0.05037444457411766,
-0.03434455022215843,
-0.0430632047355175,
-0.04825418442487717,
-0.035112231969833374,
0.017035190016031265,
-0.0056753503158688545,
-0.025534505024552345,
0.022847624495625496,
0.005579390097409487,
-0.04192996025085449,
-0.038932353258132935,
0.04606081172823906,
0.00019163446268066764,
-0.015646053478121758,
0.05516330525279045,
0.04638981819152832,
0.06477759033441544,
0.024236761033535004,
-0.02131226472556591,
-0.009184745140373707,
-0.029902972280979156,
-0.0645948052406311,
0.043574992567300797,
0.024181926622986794,
-0.0640464648604393,
-0.004238234367221594,
-0.012703279964625835,
0.033649981021881104,
-0.04094294458627701,
0.004181115422397852,
-0.016477707773447037,
-0.034198325127363205,
0.0038178381510078907,
-0.011643149890005589,
-0.018561409786343575,
0.026923641562461853,
-0.006260249298065901,
0.016587376594543457,
-0.022829346358776093,
0.01428433507680893,
-0.013160232454538345,
-0.028422445058822632,
0.05476118624210358,
0.010299709625542164,
0.020891867578029633,
-0.05424940213561058,
0.020489750429987907,
0.01985001750290394,
-0.026192517951130867,
-0.02834933251142502,
-0.009888452477753162,
0.022427229210734367,
0.02825794368982315,
-0.05424940213561058,
0.010564741678535938,
0.03163938969373703,
0.06057362258434296,
-0.05622343719005585,
0.025534505024552345,
-0.008736931718885899,
0.005570251028984785,
0.01358976773917675,
-0.006237401627004147,
-0.03776255622506142,
0.013361291028559208,
0.038713015615940094,
0.012237188406288624,
0.07066313177347183,
0.042916979640722275,
-0.05063033849000931,
0.0312189944088459,
0.00003862676749122329,
0.04386743903160095,
0.021330542862415314,
0.013891356065869331,
0.013927912339568138,
-0.008161171339452267,
0.01280380878597498,
0.0009881597943603992,
0.019996240735054016,
0.0009321831166744232,
-0.017556115984916687,
-0.0204531941562891,
0.011524342000484467,
-0.006324222777038813,
0.04039460048079491,
0.04913153499364853,
-0.007256405893713236,
0.050776563584804535,
0.010052954778075218,
-0.03940758481621742,
-0.09153672307729721,
-0.053298939019441605,
-0.06492381542921066,
0.03970003500580788,
-0.00016421730106230825,
0.03776255622506142,
0.029446018859744072,
0.003294627647846937,
0.016888964921236038,
0.0017684062477201223,
-0.013598906807601452,
0.036574479192495346,
-0.026064570993185043,
0.0076905107125639915,
0.03856679052114487,
-0.04138161987066269,
0.016532542183995247,
-0.004137705080211163,
-0.0034591304138302803,
0.015572940930724144,
0.00392293743789196,
0.008065211586654186,
0.0044484324753284454,
0.020690809935331345,
0.020416637882590294,
-0.02674086019396782,
0.03412521257996559,
0.008325674571096897,
0.011634010821580887,
0.04046771302819252,
-0.0747939869761467,
0.01555466279387474,
0.012538776732981205,
0.08598018437623978,
-0.016075588762760162,
0.025497950613498688,
0.012355995364487171,
-0.009097924456000328,
0.02131226472556591,
0.005538264289498329,
0.031145881861448288,
0.020654253661632538,
0.0812278762459755,
0.02416364848613739,
-0.03275435417890549,
-0.050666894763708115,
-0.046828493475914,
-0.0023898615036159754,
0.029446018859744072,
-0.06371745467185974,
-0.059659719467163086,
0.04876597225666046,
-0.08195900171995163,
0.05461496487259865,
-0.012355995364487171,
-0.04459856450557709,
0.02164127118885517,
-0.008325674571096897,
-0.005318927112966776,
0.020142465829849243,
0.013004868291318417,
0.06057362258434296,
-0.05574820563197136,
-0.022573454305529594,
-0.01657823659479618,
-0.006570977158844471,
0.015673471614718437,
-0.10243047028779984,
0.025205500423908234,
0.012694140896201134,
0.02513238787651062,
-0.04043115675449371,
0.03750666230916977,
-0.03798189386725426,
0.018415186554193497,
0.004089724738150835,
0.011615732684731483,
0.02039835974574089,
0.002041435334831476,
0.02529689110815525,
0.027526818215847015,
0.02244550734758377,
-0.009979842230677605,
-0.02039835974574089,
0.022957293316721916,
0.014878373593091965,
-0.006580116227269173,
0.020599419251084328,
0.024072257801890373,
0.02657635696232319,
-0.005625085439532995,
0.07022446393966675,
-0.11076528578996658,
-0.04982610046863556,
-0.04185684770345688,
-0.01600247621536255,
-0.014750426635146141,
0.02975674718618393,
-0.008608984760940075,
0.00025417981669306755,
0.06020806357264519,
0.010756662115454674,
0.011396395042538643,
0.003511680057272315,
-0.04123539477586746,
0.012264605611562729,
-0.019411342218518257,
0.009458917193114758,
0.005328066181391478,
-0.014951486140489578,
0.0036556199193000793,
0.0054971384815871716,
-0.033229585736989975,
0.0003295769856777042,
0.08049675077199936,
-0.04061393812298775,
0.01541757769882679,
-0.02454748935997486,
-0.08561462163925171,
-0.0038178381510078907,
-0.013653741218149662,
0.0006340215913951397,
-0.05231192335486412,
-0.025973180308938026,
0.000508930825162679,
-0.005506277550011873,
-0.01569174975156784,
-0.008092628791928291,
-0.02507755346596241,
-0.02281106822192669,
-0.007471173536032438,
0.07881516963243484,
-0.01873505301773548,
0.003744725836440921,
-0.05538264289498329,
0.0271795354783535,
-0.07384352385997772,
-0.03794533759355545,
0.0736972987651825,
-0.03673898056149483,
0.011780235916376114,
-0.02546139433979988,
0.006374487653374672,
0.039955925196409225,
-0.03637341782450676,
-0.045768361538648605,
-0.008266271091997623,
-0.0069228303618729115,
-0.009166467003524303,
-0.06357122957706451,
-0.017802869901061058,
-0.017848564311861992,
-0.01262102834880352,
-0.04284386709332466,
-0.02911701425909996,
0.0015182247152552009,
0.03661103546619415,
0.04408677667379379,
-0.00523210596293211,
0.0011777951149269938,
0.016039032489061356,
-0.09190228581428528,
0.07940007001161575,
-0.002926780842244625,
0.014293474145233631,
-0.058782368898391724,
0.04532968997955322,
-0.03712281957268715,
0.040065594017505646,
-0.06920088827610016,
0.02652152255177498,
-0.07969252020120621,
0.0341617688536644,
-0.058087803423404694,
-0.016952937468886375,
0.02164127118885517,
0.04836385324597359,
-0.06090262904763222,
0.013973607681691647,
-0.003084429306909442,
-0.012374273501336575,
-0.002659463556483388,
-0.007955542765557766,
-0.12341373413801193,
-0.003054727567359805,
0.056588999927043915,
-0.02222616970539093,
-0.019977962598204613,
-0.007398060988634825,
-0.010052954778075218,
-0.0018792172195389867,
-0.014997181482613087,
0.10038332641124725,
-0.004503266885876656,
-0.01605731062591076,
0.031730782240629196,
-0.037049710750579834,
0.06605705618858337,
-0.0012200631899759173,
0.015847112983465195,
0.034033823758363724,
0.01474128756672144,
0.029683634638786316,
-0.026082849130034447,
-0.026868807151913643,
0.004480419214814901,
0.004880252759903669,
-0.013160232454538345,
-0.051690466701984406,
-0.00005794014941784553,
-0.0032215151004493237,
-0.025516226887702942,
-0.00696852570399642,
-0.008672958239912987,
-0.07201571762561798,
-0.04876597225666046,
-0.034362826496362686,
-0.048144515603780746,
0.06795797497034073,
-0.012136658653616905,
-0.005629654973745346,
-0.03341236710548401,
-0.010509907267987728,
-0.00210769334807992,
-0.0742456391453743,
-0.001486237975768745,
-0.008814613334834576,
-0.02394431084394455,
-0.04704783111810684,
0.029299793764948845,
-0.03412521257996559,
0.010583019815385342,
0.01915544830262661,
0.025973180308938026,
0.023706695064902306,
0.025004440918564796,
0.06496036797761917,
-0.0010030107805505395,
-0.01937478594481945,
-0.04309976100921631,
-0.028422445058822632,
0.014485394582152367,
-0.00783216580748558,
-0.013544072397053242,
0.05446873977780342,
0.013781687244772911,
0.0024332720786333084,
-0.0613413043320179,
-0.0033974419347941875,
-0.010985137894749641,
-0.010912025347352028,
-0.063534677028656,
-0.005721045192331076,
0.04138161987066269,
0.03503911942243576,
-0.007274684030562639,
0.052019473165273666,
-0.015079432167112827,
0.027142979204654694,
-0.009189315140247345,
-0.08831977844238281,
-0.040284931659698486,
0.004539823159575462,
-0.011286727152764797,
-0.031621113419532776,
-0.003970917314291,
-0.03034164570271969,
0.0018609390826895833,
0.010180901736021042,
0.015755722299218178,
0.017537837848067284,
-0.059769388288259506,
-0.004766014404594898,
-0.017802869901061058,
0.035221900790929794,
0.011186197400093079,
0.005748462397605181,
-0.018698496744036674,
0.03147488832473755,
-0.015262213535606861,
-0.012986590154469013,
0.042003072798252106,
0.05289682000875473,
-0.016532542183995247,
0.032096344977617264,
0.0236701387912035,
0.059440381824970245,
-0.022847624495625496,
0.12611889839172363,
0.006493295077234507,
-0.0036373420152813196,
-0.0065252818167209625,
0.01904577948153019,
0.019301673397421837,
0.010637854225933552,
0.02432815171778202,
0.028440723195672035,
-0.0012863213196396828,
-0.002871946431696415,
-0.024931328371167183,
0.009705671109259129,
0.03845712170004845,
0.005570251028984785,
-0.05450529605150223,
-0.012182353995740414,
-0.07501332461833954,
0.01285864319652319,
-0.04156440123915672,
0.0667150691151619,
-0.04642637446522713,
0.03575196489691734,
-0.02109292708337307
]
|
36,420 | torch.optim.optimizer | state_dict | Returns the state of the optimizer as a :class:`dict`.
It contains two entries:
* ``state``: a Dict holding current optimization state. Its content
differs between optimizer classes, but some common characteristics
hold. For example, state is saved per parameter, and the parameter
itself is NOT saved. ``state`` is a Dictionary mapping parameter ids
to a Dict with state corresponding to each parameter.
* ``param_groups``: a List containing all parameter groups where each
parameter group is a Dict. Each parameter group contains metadata
specific to the optimizer, such as learning rate and weight decay,
as well as a List of parameter IDs of the parameters in the group.
NOTE: The parameter IDs may look like indices but they are just IDs
associating state with param_group. When loading from a state_dict,
the optimizer will zip the param_group ``params`` (int IDs) and the
optimizer ``param_groups`` (actual ``nn.Parameter`` s) in order to
match state WITHOUT additional verification.
A returned state dict might look something like:
.. code-block:: text
{
'state': {
0: {'momentum_buffer': tensor(...), ...},
1: {'momentum_buffer': tensor(...), ...},
2: {'momentum_buffer': tensor(...), ...},
3: {'momentum_buffer': tensor(...), ...}
},
'param_groups': [
{
'lr': 0.01,
'weight_decay': 0,
...
'params': [0]
},
{
'lr': 0.001,
'weight_decay': 0.5,
...
'params': [1, 2, 3]
}
]
}
| import math
import functools
import warnings
from collections import OrderedDict, defaultdict
from copy import deepcopy
from itertools import chain
from typing import (
Any,
Callable,
DefaultDict,
Dict,
Hashable,
Iterable,
List,
Optional,
Set,
Tuple,
TypeVar,
Union,
cast,
overload,
)
from typing_extensions import ParamSpec, Self, TypeAlias
import torch
import torch.utils.hooks as hooks
from torch.utils.hooks import RemovableHandle
from torch.utils._foreach_utils import (
Indices,
TensorListList,
_get_foreach_kernels_supported_devices,
_get_fused_kernels_supported_devices,
)
from torch._utils import is_compiling
from torch.utils._foreach_utils import _group_tensors_by_device_and_dtype
Args: TypeAlias = Tuple[Any, ...]
Kwargs: TypeAlias = Dict[str, Any]
StateDict: TypeAlias = Dict[str, Any]
GlobalOptimizerPreHook: TypeAlias = Callable[["Optimizer", Args, Kwargs], Optional[Tuple[Args, Kwargs]]]
GlobalOptimizerPostHook: TypeAlias = Callable[["Optimizer", Args, Kwargs], None]
__all__ = ['Optimizer', 'register_optimizer_step_pre_hook', 'register_optimizer_step_post_hook']
_global_optimizer_pre_hooks: Dict[int, GlobalOptimizerPreHook] = OrderedDict()
_global_optimizer_post_hooks: Dict[int, GlobalOptimizerPostHook] = OrderedDict()
_foreach_supported_types = [torch.Tensor, torch.nn.parameter.Parameter]
class _RequiredParameter:
"""Singleton class representing a required parameter for an Optimizer."""
def __repr__(self) -> str:
return "<required parameter>"
| (self) -> Dict[str, Any] | [
-0.046501681208610535,
-0.056954070925712585,
-0.04138993099331856,
0.027904823422431946,
0.004997309762984514,
0.05104122310876846,
-0.037384454160928726,
-0.04299212247133255,
-0.035934850573539734,
-0.02889665588736534,
-0.007386290468275547,
0.01015674602240324,
-0.046463534235954285,
0.0007045348174870014,
-0.01116765197366476,
-0.004935320001095533,
-0.018158163875341415,
0.028477035462856293,
0.058937735855579376,
-0.010061376728117466,
-0.01182569470256567,
-0.03393211215734482,
0.014105001464486122,
0.014009633101522923,
-0.03032718412578106,
0.009055239148437977,
0.035515230149030685,
-0.02616911754012108,
-0.0270655807107687,
-0.025692274793982506,
-0.05615297332406044,
-0.0050020781345665455,
0.03932997211813927,
0.010337946005165577,
0.025291727855801582,
-0.012655400671064854,
0.023060103878378868,
0.09903065115213394,
-0.04951532557606697,
-0.02185846120119095,
-0.04119919240474701,
-0.07438743114471436,
0.02489117905497551,
-0.030689584091305733,
0.0037837454583495855,
0.03036533109843731,
-0.020256269723176956,
0.01023303996771574,
0.005626741796731949,
-0.05004939064383507,
0.03309287130832672,
-0.09185894578695297,
0.057335544377565384,
0.03179585933685303,
-0.01274123229086399,
0.034618765115737915,
0.08163543790578842,
-0.029373498633503914,
0.027008360251784325,
-0.014352959580719471,
0.0006294320919550955,
-0.03494301810860634,
-0.024681368842720985,
-0.015487845055758953,
0.015449697151780128,
-0.07865994423627853,
-0.052681561559438705,
0.0043011195957660675,
-0.020084606483578682,
0.027294466271996498,
-0.048294611275196075,
-0.04791313782334328,
0.06740646064281464,
-0.014486475847661495,
-0.011139040812849998,
-0.05237638205289841,
-0.015020539052784443,
-0.05394042655825615,
0.056954070925712585,
-0.037727780640125275,
-0.002522496972233057,
-0.015583213418722153,
-0.03580133616924286,
-0.011987821198999882,
-0.0016927908873185515,
-0.03288305923342705,
-0.0024509704671800137,
-0.007090648170560598,
0.0047278935089707375,
-0.09338483959436417,
-0.03021274134516716,
0.018844816833734512,
0.012951042503118515,
0.0541311614215374,
0.00679500587284565,
0.02586393803358078,
-0.04753166064620018,
-0.04734092578291893,
-0.0184919536113739,
-0.030346257612109184,
0.03122364729642868,
0.044441722333431244,
0.03917738050222397,
0.023002883419394493,
0.048447199165821075,
-0.007715311832726002,
-0.02338435687124729,
0.010509609244763851,
-0.02834351919591427,
-0.023708609864115715,
-0.0024163995403796434,
-0.03658335655927658,
-0.05962438881397247,
-0.013485106639564037,
0.029697751626372337,
-0.019178606569767,
-0.0437169224023819,
-0.052872296422719955,
0.0034952557180076838,
0.014553233981132507,
-0.007643785327672958,
0.021000145003199577,
-0.02885850891470909,
-0.009927861392498016,
-0.02485303208231926,
-0.02481488510966301,
0.0543600469827652,
0.06210396811366081,
-0.052719708532094955,
-0.054665226489305496,
-0.04123733937740326,
-0.007367216981947422,
-0.041962143033742905,
0.07053454220294952,
0.030861247330904007,
-0.004537156317383051,
-0.0015270881121978164,
0.013275295495986938,
-0.037308160215616226,
-0.014400644227862358,
0.017891131341457367,
0.012655400671064854,
-0.005331099499017,
0.015316181816160679,
0.04802757874131203,
-0.004448940511792898,
0.03366508334875107,
-0.003323592245578766,
0.018968794494867325,
-0.07652368396520615,
-0.030651437118649483,
0.030231814831495285,
0.025196358561515808,
0.0036788401193916798,
-0.021381618455052376,
0.029545161873102188,
-0.04066513106226921,
-0.023441577330231667,
-0.04772239923477173,
0.0069571323692798615,
-0.042152877897024155,
-0.0271800234913826,
-0.04997309669852257,
-0.05672518536448479,
-0.02244974486529827,
-0.013389738276600838,
0.006566121242940426,
-0.006961900740861893,
-0.04150437191128731,
0.05790775641798973,
0.0075245751067996025,
-0.07083972543478012,
0.0643928125500679,
0.057526279240846634,
-0.02023719623684883,
0.09857288748025894,
-0.006966669112443924,
-0.011434683576226234,
-0.025615980848670006,
-0.02233530394732952,
0.04684500768780708,
-0.01968405954539776,
-0.06336283683776855,
-0.018272604793310165,
-0.009293660521507263,
0.026893917471170425,
0.00881681777536869,
-0.039635151624679565,
0.019235827028751373,
0.031624194234609604,
-0.015449697151780128,
0.014925170689821243,
0.008506870828568935,
-0.02391842007637024,
0.009565460495650768,
0.014963318593800068,
-0.004925783257931471,
0.039711445569992065,
0.05363524705171585,
0.019474247470498085,
-0.02769501321017742,
0.03198659420013428,
0.07385336607694626,
0.059242915362119675,
-0.048370905220508575,
0.0036049294285476208,
0.040092919021844864,
0.0646216943860054,
-0.01025211438536644,
0.00597960501909256,
0.00032604107400402427,
0.001931212143972516,
0.010089987888932228,
0.09063822776079178,
0.020866628736257553,
-0.01580256037414074,
0.00020861859957221895,
0.061722494661808014,
0.028705919161438942,
-0.015154055319726467,
0.029754972085356712,
-0.00700004817917943,
-0.017996037378907204,
0.01180662028491497,
0.0428776778280735,
-0.030117373913526535,
0.022964736446738243,
-0.0218966081738472,
0.0325397327542305,
-0.036831315606832504,
0.0032806764356791973,
-0.048637937754392624,
-0.016365235671401024,
0.022964736446738243,
0.07743922621011734,
0.015707192942500114,
0.0029516550712287426,
-0.023136399686336517,
0.019912943243980408,
-0.008864502422511578,
-0.032997503876686096,
-0.05573335289955139,
-0.038509801030159,
-0.021114585921168327,
-0.0214006919413805,
0.02361324056982994,
0.03541986271739006,
0.0369839072227478,
0.0003638904308900237,
0.020847555249929428,
-0.01580256037414074,
-0.015602286905050278,
-0.02803833968937397,
0.005745952483266592,
-0.028953878208994865,
-0.01643199287354946,
0.030002931132912636,
-0.011530051939189434,
0.014219444245100021,
-0.05222379416227341,
-0.024433409795165062,
-0.0032735238783061504,
-0.0636298656463623,
0.04470875486731529,
-0.018816204741597176,
-0.04150437191128731,
0.05649629980325699,
0.008030028082430363,
-0.019483786076307297,
0.026188191026449203,
0.1068127229809761,
0.06820755451917648,
-0.026531517505645752,
-0.00588423665612936,
-0.009503471665084362,
0.01465813908725977,
0.008540249429643154,
0.07099231332540512,
0.025234505534172058,
0.01979850046336651,
0.07911770790815353,
-0.014763044193387032,
-0.07583703100681305,
-0.01910231076180935,
-0.040283653885126114,
0.037346307188272476,
-0.020675892010331154,
-0.02616911754012108,
-0.003039871109649539,
0.0025654127821326256,
0.04760795831680298,
0.02508191578090191,
0.0877390205860138,
-0.0020563832949846983,
0.054627079516649246,
-0.004968699067831039,
-0.08041471987962723,
0.02046607993543148,
0.021457912400364876,
-0.04463246092200279,
0.030422553420066833,
0.0032163027208298445,
-0.011911526322364807,
-0.012216704897582531,
0.04821831360459328,
-0.040283653885126114,
0.016765782609581947,
-0.018549174070358276,
-0.003442802932113409,
-0.021076438948512077,
0.06301950663328171,
-0.003190076444298029,
-0.00602728920057416,
0.011882915161550045,
0.04779869318008423,
-0.04322100430727005,
-0.0064421421848237514,
-0.0430302694439888,
-0.0045013935305178165,
0.06862717121839523,
0.00902662891894579,
0.10612607002258301,
0.005030688364058733,
0.004983004182577133,
-0.02271677739918232,
-0.06534650176763535,
0.04550984874367714,
-0.057182952761650085,
-0.042076583951711655,
-0.01060497760772705,
-0.03423729166388512,
-0.007643785327672958,
0.0023710993118584156,
0.0375942625105381,
-0.024872105568647385,
0.018940184265375137,
0.07038195431232452,
0.03294027969241142,
-0.022125491872429848,
0.00583655247464776,
0.04982050508260727,
0.04699759930372238,
-0.005259572993963957,
0.05252896994352341,
-0.02822907641530037,
-0.033378977328538895,
0.036793168634176254,
0.02162957563996315,
0.03740352764725685,
0.00258687068708241,
0.015440160408616066,
-0.008287522941827774,
-0.019407490268349648,
0.01934073306620121,
0.08277986198663712,
-0.03631632775068283,
-0.04463246092200279,
-0.0040603140369057655,
-0.00734814302995801,
-0.03580133616924286,
0.03763240948319435,
-0.010271187871694565,
0.009546387009322643,
0.04077957198023796,
0.06767348945140839,
-0.03278769180178642,
0.017109109088778496,
-0.06252358853816986,
0.002435473259538412,
-0.04154251888394356,
-0.016489213332533836,
-0.0640876367688179,
0.06939012557268143,
0.03219640627503395,
-0.02838166616857052,
-0.001011502230539918,
0.004506161902099848,
0.015230350196361542,
-0.02061866968870163,
0.04680686071515083,
0.05237638205289841,
0.053139328956604004,
0.04093215987086296,
-0.023899346590042114,
-0.008502102456986904,
0.0035262503661215305,
-0.03612558916211128,
0.011406073346734047,
0.022964736446738243,
-0.04550984874367714,
0.0064421421848237514,
0.013685380108654499,
-0.0070095849223434925,
0.027370760217308998,
-0.04039809852838516,
0.026550590991973877,
-0.01308455877006054,
0.06294321268796921,
-0.06744460761547089,
-0.06633833050727844,
-0.015392476692795753,
-0.032444365322589874,
0.002975497394800186,
0.046082060784101486,
0.028324445709586143,
-0.035400789231061935,
0.0380520336329937,
0.06897050142288208,
0.01287474762648344,
0.05252896994352341,
-0.027408907189965248,
0.013179927133023739,
0.022926587611436844,
0.03507653623819351,
-0.007777301594614983,
0.0003987595555372536,
0.025959307327866554,
-0.004160450771450996,
0.04119919240474701,
0.05096492916345596,
0.04783684015274048,
0.04753166064620018,
-0.005087909754365683,
0.02597838081419468,
0.0000015366995285148732,
-0.0005260169273242354,
-0.027447056025266647,
0.020523302257061005,
-0.006718710996210575,
-0.019817575812339783,
-0.04554799571633339,
-0.016231719404459,
-0.01626986637711525,
-0.020103679969906807,
-0.03503838926553726,
-0.03194844722747803,
0.03515283018350601,
0.05760257691144943,
-0.005469383671879768,
0.025310801342129707,
0.0018978331936523318,
-0.00294211832806468,
-0.009484397247433662,
0.01091015711426735,
-0.0013530406868085265,
0.0010800482705235481,
-0.004527619574218988,
0.06809311360120773,
-0.0846872329711914,
0.01353279035538435,
0.044250983744859695,
-0.007066806312650442,
0.021095512434840202,
-0.006694869138300419,
0.02248789370059967,
0.018434731289744377,
-0.037422601133584976,
-0.042801383882761,
-0.05447448790073395,
0.001964591210708022,
0.02248789370059967,
0.06527020037174225,
0.004582456778734922,
-0.041962143033742905,
-0.0005182682070881128,
-0.00036299636121839285,
0.05233823508024216,
-0.014381569810211658,
0.006036826409399509,
0.019054627045989037,
0.0760277733206749,
-0.0017476278590038419,
0.00780591182410717,
-0.00324252899736166,
-0.028534255921840668,
-0.0027609181124716997,
0.0002659887250047177,
0.03875776007771492,
-0.024376189336180687,
-0.02803833968937397,
0.05168972909450531,
-0.016794392839074135,
0.03032718412578106,
0.007853596471250057,
-0.008654691278934479,
0.022773997858166695,
0.0061417315155267715,
0.018701763823628426,
0.011682641692459583,
0.08300874382257462,
-0.05214749649167061,
-0.011835231445729733,
0.027427980676293373,
-0.014639065600931644,
0.018110478296875954,
0.0030446394812315702,
0.023327136412262917,
0.03383674472570419,
0.08064360916614532,
-0.006532742641866207,
0.023670462891459465,
-0.0317004919052124,
-0.056992217898368835,
-0.010919693857431412,
0.03707927465438843,
-0.011625420302152634,
0.0026917760260403156,
0.06084510684013367,
-0.050240129232406616,
0.0424199104309082,
0.008392428047955036,
-0.006651952862739563,
0.006899910978972912,
-0.011663568206131458,
0.010337946005165577,
-0.011034135706722736,
0.002660781145095825,
0.03160512074828148,
-0.011530051939189434,
-0.020752185955643654,
-0.0029158920515328646,
0.06557538360357285,
0.005612436216324568,
-0.03486672416329384,
0.04768425226211548,
0.02166772447526455,
-0.007820216938853264,
-0.02912554144859314,
0.06870347261428833,
-0.02395656891167164,
-0.012960579246282578,
0.015382939949631691,
-0.03624003008008003,
0.05569520592689514,
-0.006265710573643446,
-0.03643076866865158,
0.03171956539154053,
-0.00219466770067811,
-0.04486134275794029,
-0.029964784160256386,
0.021915681660175323,
-0.0030732499435544014,
0.014639065600931644,
-0.0006198952905833721,
0.030651437118649483,
0.01976035349071026,
0.019006943330168724,
0.021801240742206573,
-0.03643076866865158,
-0.011644493788480759,
-0.1074993759393692,
0.00953208189457655,
-0.019235827028751373,
-0.012397905811667442,
-0.02046607993543148,
-0.03856702148914337,
0.015535528771579266,
0.006299089640378952,
-0.04463246092200279,
0.0540548674762249,
-0.011749399825930595,
-0.00963221862912178,
0.03006015159189701,
-0.00512605719268322,
0.016317550092935562,
0.0070620374754071236,
0.01557367667555809,
0.012226241640746593,
-0.027294466271996498,
0.004663520026952028,
0.0212862491607666,
-0.04123733937740326,
-0.016069592908024788,
-0.0424962043762207,
-0.061798788607120514,
0.014534159563481808,
0.0043416512198746204,
-0.004124687984585762,
0.0071764797903597355,
-0.07377707213163376,
0.015745339915156364,
-0.030422553420066833,
-0.012884284369647503,
-0.0008946757880039513,
0.02019904926419258,
0.009851566515862942,
-0.017681321129202843,
0.04554799571633339,
-0.03013644739985466,
0.0317767858505249,
-0.028801288455724716,
0.030861247330904007,
-0.025139138102531433,
-0.032101038843393326,
0.032444365322589874,
-0.010652662254869938,
-0.0868234857916832,
0.023899346590042114,
0.038967572152614594,
-0.0008952718344517052,
-0.08339022099971771,
-0.03654520958662033,
0.01956961676478386,
-0.02908739261329174,
-0.01960776373744011,
-0.07721033692359924,
-0.06034918874502182,
0.046387240290641785,
0.01863500475883484,
-0.06927567720413208,
-0.0021708256099373102,
0.018205847591161728,
0.03591577708721161,
0.027485202997922897,
-0.03032718412578106,
-0.023060103878378868,
-0.039673298597335815,
0.012302536517381668,
0.10170096904039383,
-0.016918372362852097,
0.0013053563889116049,
0.013723528012633324,
0.0037885138299316168,
-0.08010954409837723,
-0.022297155112028122,
-0.04043624550104141,
0.008130164816975594,
-0.06664350628852844,
0.011110430583357811,
0.0317004919052124,
-0.023079177364706993,
-0.040283653885126114,
0.07499779015779495,
-0.004701666999608278,
0.010557292960584164,
-0.05020197853446007,
0.00831136479973793,
-0.0012922432506456971,
-0.028591476380825043,
-0.08163543790578842,
0.03025088831782341,
0.06580426543951035,
0.017061425372958183,
-0.016727635636925697,
0.00799664855003357,
-0.048332758247852325,
-0.001448409166187048,
0.037308160215616226,
0.08331392705440521,
0.017261698842048645,
0.004260587971657515,
0.06031104177236557,
0.015049150213599205,
0.025120064616203308,
0.039673298597335815,
0.025730421766638756,
0.016489213332533836,
0.0051689730025827885,
0.04909570515155792,
-0.018463341519236565,
0.021305324509739876,
0.00978480838239193,
0.03189122676849365,
0.03297842666506767,
-0.05432190001010895,
-0.04753166064620018,
-0.050850484520196915,
-0.028019266203045845,
0.026703180745244026,
0.004954393953084946,
-0.005550446920096874,
-0.03692668303847313,
-0.025196358561515808,
-0.0108529357239604,
0.013294368982315063,
-0.020256269723176956,
0.025196358561515808,
-0.03021274134516716,
-0.06259988248348236,
-0.04047439247369766,
-0.002994571113958955,
0.01953146979212761,
-0.034733209758996964,
0.01860639452934265,
-0.018501490354537964,
-0.00026345549849793315,
-0.05363524705171585,
0.013876116834580898,
0.0021052598021924496,
-0.024757662788033485,
-0.0038767296355217695,
-0.00465875118970871,
0.06713942438364029,
-0.004282045643776655,
-0.009665598161518574,
-0.10040395706892014,
-0.023174546658992767,
-0.02508191578090191,
0.014438791200518608,
-0.0741204023361206,
0.026588737964630127,
0.012035504914820194,
-0.0871286615729332,
-0.02897295169532299,
-0.01293196901679039,
0.05130825564265251,
-0.03898664563894272,
-0.041962143033742905,
0.03171956539154053,
0.0011527667520567775,
0.04268694296479225,
-0.0036979136057198048,
0.0018584936624392867,
-0.009656060487031937,
0.03290213271975517,
0.00435834052041173,
0.00033259764313697815,
0.0031352394726127386,
0.01853010058403015,
-0.008983712643384933,
-0.00007800845196470618,
0.015897929668426514,
0.01805325783789158,
0.028496108949184418,
0.0009679903159849346,
0.006561352871358395,
0.08186431974172592,
-0.054894112050533295,
0.05882329121232033,
-0.0029349657706916332,
0.05180417001247406,
0.003271139692515135,
-0.001661796122789383,
-0.0645454004406929,
0.020866628736257553,
0.022735850885510445,
0.056954070925712585,
-0.030422553420066833,
-0.06202767416834831,
0.010900620371103287,
0.011558662168681622,
0.036373548209667206,
-0.022297155112028122,
-0.00048369713476859033,
0.06187508627772331,
-0.003638308495283127,
-0.022964736446738243,
-0.039749592542648315,
0.057182952761650085,
-0.018158163875341415,
0.05565705895423889,
0.005860394332557917,
-0.006647184491157532,
-0.02069496549665928,
0.06671980768442154,
-0.07083972543478012,
0.021915681660175323,
-0.03936811909079552,
-0.05531373247504234,
-0.11955395340919495,
-0.03822369500994682,
-0.0539785735309124,
0.03173863887786865,
-0.01937888003885746,
-0.009265050292015076,
-0.009851566515862942,
0.019550543278455734,
-0.006384921260178089
]
|
36,422 | torch.optim.optimizer | zero_grad | Resets the gradients of all optimized :class:`torch.Tensor` s.
Args:
set_to_none (bool): instead of setting to zero, set the grads to None.
This will in general have lower memory footprint, and can modestly improve performance.
However, it changes certain behaviors. For example:
1. When the user tries to access a gradient and perform manual ops on it,
a None attribute or a Tensor full of 0s will behave differently.
2. If the user requests ``zero_grad(set_to_none=True)`` followed by a backward pass, ``.grad``\ s
are guaranteed to be None for params that did not receive a gradient.
3. ``torch.optim`` optimizers have a different behavior if the gradient is 0 or None
(in one case it does the step with a gradient of 0 and in the other it skips
the step altogether).
| import math
import functools
import warnings
from collections import OrderedDict, defaultdict
from copy import deepcopy
from itertools import chain
from typing import (
Any,
Callable,
DefaultDict,
Dict,
Hashable,
Iterable,
List,
Optional,
Set,
Tuple,
TypeVar,
Union,
cast,
overload,
)
from typing_extensions import ParamSpec, Self, TypeAlias
import torch
import torch.utils.hooks as hooks
from torch.utils.hooks import RemovableHandle
from torch.utils._foreach_utils import (
Indices,
TensorListList,
_get_foreach_kernels_supported_devices,
_get_fused_kernels_supported_devices,
)
from torch._utils import is_compiling
from torch.utils._foreach_utils import _group_tensors_by_device_and_dtype
Args: TypeAlias = Tuple[Any, ...]
Kwargs: TypeAlias = Dict[str, Any]
StateDict: TypeAlias = Dict[str, Any]
GlobalOptimizerPreHook: TypeAlias = Callable[["Optimizer", Args, Kwargs], Optional[Tuple[Args, Kwargs]]]
GlobalOptimizerPostHook: TypeAlias = Callable[["Optimizer", Args, Kwargs], None]
__all__ = ['Optimizer', 'register_optimizer_step_pre_hook', 'register_optimizer_step_post_hook']
_global_optimizer_pre_hooks: Dict[int, GlobalOptimizerPreHook] = OrderedDict()
_global_optimizer_post_hooks: Dict[int, GlobalOptimizerPostHook] = OrderedDict()
_foreach_supported_types = [torch.Tensor, torch.nn.parameter.Parameter]
class _RequiredParameter:
"""Singleton class representing a required parameter for an Optimizer."""
def __repr__(self) -> str:
return "<required parameter>"
| (self, set_to_none: bool = True) -> NoneType | [
-0.046501681208610535,
-0.056954070925712585,
-0.04138993099331856,
0.027904823422431946,
0.004997309762984514,
0.05104122310876846,
-0.037384454160928726,
-0.04299212247133255,
-0.035934850573539734,
-0.02889665588736534,
-0.007386290468275547,
0.01015674602240324,
-0.046463534235954285,
0.0007045348174870014,
-0.01116765197366476,
-0.004935320001095533,
-0.018158163875341415,
0.028477035462856293,
0.058937735855579376,
-0.010061376728117466,
-0.01182569470256567,
-0.03393211215734482,
0.014105001464486122,
0.014009633101522923,
-0.03032718412578106,
0.009055239148437977,
0.035515230149030685,
-0.02616911754012108,
-0.0270655807107687,
-0.025692274793982506,
-0.05615297332406044,
-0.0050020781345665455,
0.03932997211813927,
0.010337946005165577,
0.025291727855801582,
-0.012655400671064854,
0.023060103878378868,
0.09903065115213394,
-0.04951532557606697,
-0.02185846120119095,
-0.04119919240474701,
-0.07438743114471436,
0.02489117905497551,
-0.030689584091305733,
0.0037837454583495855,
0.03036533109843731,
-0.020256269723176956,
0.01023303996771574,
0.005626741796731949,
-0.05004939064383507,
0.03309287130832672,
-0.09185894578695297,
0.057335544377565384,
0.03179585933685303,
-0.01274123229086399,
0.034618765115737915,
0.08163543790578842,
-0.029373498633503914,
0.027008360251784325,
-0.014352959580719471,
0.0006294320919550955,
-0.03494301810860634,
-0.024681368842720985,
-0.015487845055758953,
0.015449697151780128,
-0.07865994423627853,
-0.052681561559438705,
0.0043011195957660675,
-0.020084606483578682,
0.027294466271996498,
-0.048294611275196075,
-0.04791313782334328,
0.06740646064281464,
-0.014486475847661495,
-0.011139040812849998,
-0.05237638205289841,
-0.015020539052784443,
-0.05394042655825615,
0.056954070925712585,
-0.037727780640125275,
-0.002522496972233057,
-0.015583213418722153,
-0.03580133616924286,
-0.011987821198999882,
-0.0016927908873185515,
-0.03288305923342705,
-0.0024509704671800137,
-0.007090648170560598,
0.0047278935089707375,
-0.09338483959436417,
-0.03021274134516716,
0.018844816833734512,
0.012951042503118515,
0.0541311614215374,
0.00679500587284565,
0.02586393803358078,
-0.04753166064620018,
-0.04734092578291893,
-0.0184919536113739,
-0.030346257612109184,
0.03122364729642868,
0.044441722333431244,
0.03917738050222397,
0.023002883419394493,
0.048447199165821075,
-0.007715311832726002,
-0.02338435687124729,
0.010509609244763851,
-0.02834351919591427,
-0.023708609864115715,
-0.0024163995403796434,
-0.03658335655927658,
-0.05962438881397247,
-0.013485106639564037,
0.029697751626372337,
-0.019178606569767,
-0.0437169224023819,
-0.052872296422719955,
0.0034952557180076838,
0.014553233981132507,
-0.007643785327672958,
0.021000145003199577,
-0.02885850891470909,
-0.009927861392498016,
-0.02485303208231926,
-0.02481488510966301,
0.0543600469827652,
0.06210396811366081,
-0.052719708532094955,
-0.054665226489305496,
-0.04123733937740326,
-0.007367216981947422,
-0.041962143033742905,
0.07053454220294952,
0.030861247330904007,
-0.004537156317383051,
-0.0015270881121978164,
0.013275295495986938,
-0.037308160215616226,
-0.014400644227862358,
0.017891131341457367,
0.012655400671064854,
-0.005331099499017,
0.015316181816160679,
0.04802757874131203,
-0.004448940511792898,
0.03366508334875107,
-0.003323592245578766,
0.018968794494867325,
-0.07652368396520615,
-0.030651437118649483,
0.030231814831495285,
0.025196358561515808,
0.0036788401193916798,
-0.021381618455052376,
0.029545161873102188,
-0.04066513106226921,
-0.023441577330231667,
-0.04772239923477173,
0.0069571323692798615,
-0.042152877897024155,
-0.0271800234913826,
-0.04997309669852257,
-0.05672518536448479,
-0.02244974486529827,
-0.013389738276600838,
0.006566121242940426,
-0.006961900740861893,
-0.04150437191128731,
0.05790775641798973,
0.0075245751067996025,
-0.07083972543478012,
0.0643928125500679,
0.057526279240846634,
-0.02023719623684883,
0.09857288748025894,
-0.006966669112443924,
-0.011434683576226234,
-0.025615980848670006,
-0.02233530394732952,
0.04684500768780708,
-0.01968405954539776,
-0.06336283683776855,
-0.018272604793310165,
-0.009293660521507263,
0.026893917471170425,
0.00881681777536869,
-0.039635151624679565,
0.019235827028751373,
0.031624194234609604,
-0.015449697151780128,
0.014925170689821243,
0.008506870828568935,
-0.02391842007637024,
0.009565460495650768,
0.014963318593800068,
-0.004925783257931471,
0.039711445569992065,
0.05363524705171585,
0.019474247470498085,
-0.02769501321017742,
0.03198659420013428,
0.07385336607694626,
0.059242915362119675,
-0.048370905220508575,
0.0036049294285476208,
0.040092919021844864,
0.0646216943860054,
-0.01025211438536644,
0.00597960501909256,
0.00032604107400402427,
0.001931212143972516,
0.010089987888932228,
0.09063822776079178,
0.020866628736257553,
-0.01580256037414074,
0.00020861859957221895,
0.061722494661808014,
0.028705919161438942,
-0.015154055319726467,
0.029754972085356712,
-0.00700004817917943,
-0.017996037378907204,
0.01180662028491497,
0.0428776778280735,
-0.030117373913526535,
0.022964736446738243,
-0.0218966081738472,
0.0325397327542305,
-0.036831315606832504,
0.0032806764356791973,
-0.048637937754392624,
-0.016365235671401024,
0.022964736446738243,
0.07743922621011734,
0.015707192942500114,
0.0029516550712287426,
-0.023136399686336517,
0.019912943243980408,
-0.008864502422511578,
-0.032997503876686096,
-0.05573335289955139,
-0.038509801030159,
-0.021114585921168327,
-0.0214006919413805,
0.02361324056982994,
0.03541986271739006,
0.0369839072227478,
0.0003638904308900237,
0.020847555249929428,
-0.01580256037414074,
-0.015602286905050278,
-0.02803833968937397,
0.005745952483266592,
-0.028953878208994865,
-0.01643199287354946,
0.030002931132912636,
-0.011530051939189434,
0.014219444245100021,
-0.05222379416227341,
-0.024433409795165062,
-0.0032735238783061504,
-0.0636298656463623,
0.04470875486731529,
-0.018816204741597176,
-0.04150437191128731,
0.05649629980325699,
0.008030028082430363,
-0.019483786076307297,
0.026188191026449203,
0.1068127229809761,
0.06820755451917648,
-0.026531517505645752,
-0.00588423665612936,
-0.009503471665084362,
0.01465813908725977,
0.008540249429643154,
0.07099231332540512,
0.025234505534172058,
0.01979850046336651,
0.07911770790815353,
-0.014763044193387032,
-0.07583703100681305,
-0.01910231076180935,
-0.040283653885126114,
0.037346307188272476,
-0.020675892010331154,
-0.02616911754012108,
-0.003039871109649539,
0.0025654127821326256,
0.04760795831680298,
0.02508191578090191,
0.0877390205860138,
-0.0020563832949846983,
0.054627079516649246,
-0.004968699067831039,
-0.08041471987962723,
0.02046607993543148,
0.021457912400364876,
-0.04463246092200279,
0.030422553420066833,
0.0032163027208298445,
-0.011911526322364807,
-0.012216704897582531,
0.04821831360459328,
-0.040283653885126114,
0.016765782609581947,
-0.018549174070358276,
-0.003442802932113409,
-0.021076438948512077,
0.06301950663328171,
-0.003190076444298029,
-0.00602728920057416,
0.011882915161550045,
0.04779869318008423,
-0.04322100430727005,
-0.0064421421848237514,
-0.0430302694439888,
-0.0045013935305178165,
0.06862717121839523,
0.00902662891894579,
0.10612607002258301,
0.005030688364058733,
0.004983004182577133,
-0.02271677739918232,
-0.06534650176763535,
0.04550984874367714,
-0.057182952761650085,
-0.042076583951711655,
-0.01060497760772705,
-0.03423729166388512,
-0.007643785327672958,
0.0023710993118584156,
0.0375942625105381,
-0.024872105568647385,
0.018940184265375137,
0.07038195431232452,
0.03294027969241142,
-0.022125491872429848,
0.00583655247464776,
0.04982050508260727,
0.04699759930372238,
-0.005259572993963957,
0.05252896994352341,
-0.02822907641530037,
-0.033378977328538895,
0.036793168634176254,
0.02162957563996315,
0.03740352764725685,
0.00258687068708241,
0.015440160408616066,
-0.008287522941827774,
-0.019407490268349648,
0.01934073306620121,
0.08277986198663712,
-0.03631632775068283,
-0.04463246092200279,
-0.0040603140369057655,
-0.00734814302995801,
-0.03580133616924286,
0.03763240948319435,
-0.010271187871694565,
0.009546387009322643,
0.04077957198023796,
0.06767348945140839,
-0.03278769180178642,
0.017109109088778496,
-0.06252358853816986,
0.002435473259538412,
-0.04154251888394356,
-0.016489213332533836,
-0.0640876367688179,
0.06939012557268143,
0.03219640627503395,
-0.02838166616857052,
-0.001011502230539918,
0.004506161902099848,
0.015230350196361542,
-0.02061866968870163,
0.04680686071515083,
0.05237638205289841,
0.053139328956604004,
0.04093215987086296,
-0.023899346590042114,
-0.008502102456986904,
0.0035262503661215305,
-0.03612558916211128,
0.011406073346734047,
0.022964736446738243,
-0.04550984874367714,
0.0064421421848237514,
0.013685380108654499,
-0.0070095849223434925,
0.027370760217308998,
-0.04039809852838516,
0.026550590991973877,
-0.01308455877006054,
0.06294321268796921,
-0.06744460761547089,
-0.06633833050727844,
-0.015392476692795753,
-0.032444365322589874,
0.002975497394800186,
0.046082060784101486,
0.028324445709586143,
-0.035400789231061935,
0.0380520336329937,
0.06897050142288208,
0.01287474762648344,
0.05252896994352341,
-0.027408907189965248,
0.013179927133023739,
0.022926587611436844,
0.03507653623819351,
-0.007777301594614983,
0.0003987595555372536,
0.025959307327866554,
-0.004160450771450996,
0.04119919240474701,
0.05096492916345596,
0.04783684015274048,
0.04753166064620018,
-0.005087909754365683,
0.02597838081419468,
0.0000015366995285148732,
-0.0005260169273242354,
-0.027447056025266647,
0.020523302257061005,
-0.006718710996210575,
-0.019817575812339783,
-0.04554799571633339,
-0.016231719404459,
-0.01626986637711525,
-0.020103679969906807,
-0.03503838926553726,
-0.03194844722747803,
0.03515283018350601,
0.05760257691144943,
-0.005469383671879768,
0.025310801342129707,
0.0018978331936523318,
-0.00294211832806468,
-0.009484397247433662,
0.01091015711426735,
-0.0013530406868085265,
0.0010800482705235481,
-0.004527619574218988,
0.06809311360120773,
-0.0846872329711914,
0.01353279035538435,
0.044250983744859695,
-0.007066806312650442,
0.021095512434840202,
-0.006694869138300419,
0.02248789370059967,
0.018434731289744377,
-0.037422601133584976,
-0.042801383882761,
-0.05447448790073395,
0.001964591210708022,
0.02248789370059967,
0.06527020037174225,
0.004582456778734922,
-0.041962143033742905,
-0.0005182682070881128,
-0.00036299636121839285,
0.05233823508024216,
-0.014381569810211658,
0.006036826409399509,
0.019054627045989037,
0.0760277733206749,
-0.0017476278590038419,
0.00780591182410717,
-0.00324252899736166,
-0.028534255921840668,
-0.0027609181124716997,
0.0002659887250047177,
0.03875776007771492,
-0.024376189336180687,
-0.02803833968937397,
0.05168972909450531,
-0.016794392839074135,
0.03032718412578106,
0.007853596471250057,
-0.008654691278934479,
0.022773997858166695,
0.0061417315155267715,
0.018701763823628426,
0.011682641692459583,
0.08300874382257462,
-0.05214749649167061,
-0.011835231445729733,
0.027427980676293373,
-0.014639065600931644,
0.018110478296875954,
0.0030446394812315702,
0.023327136412262917,
0.03383674472570419,
0.08064360916614532,
-0.006532742641866207,
0.023670462891459465,
-0.0317004919052124,
-0.056992217898368835,
-0.010919693857431412,
0.03707927465438843,
-0.011625420302152634,
0.0026917760260403156,
0.06084510684013367,
-0.050240129232406616,
0.0424199104309082,
0.008392428047955036,
-0.006651952862739563,
0.006899910978972912,
-0.011663568206131458,
0.010337946005165577,
-0.011034135706722736,
0.002660781145095825,
0.03160512074828148,
-0.011530051939189434,
-0.020752185955643654,
-0.0029158920515328646,
0.06557538360357285,
0.005612436216324568,
-0.03486672416329384,
0.04768425226211548,
0.02166772447526455,
-0.007820216938853264,
-0.02912554144859314,
0.06870347261428833,
-0.02395656891167164,
-0.012960579246282578,
0.015382939949631691,
-0.03624003008008003,
0.05569520592689514,
-0.006265710573643446,
-0.03643076866865158,
0.03171956539154053,
-0.00219466770067811,
-0.04486134275794029,
-0.029964784160256386,
0.021915681660175323,
-0.0030732499435544014,
0.014639065600931644,
-0.0006198952905833721,
0.030651437118649483,
0.01976035349071026,
0.019006943330168724,
0.021801240742206573,
-0.03643076866865158,
-0.011644493788480759,
-0.1074993759393692,
0.00953208189457655,
-0.019235827028751373,
-0.012397905811667442,
-0.02046607993543148,
-0.03856702148914337,
0.015535528771579266,
0.006299089640378952,
-0.04463246092200279,
0.0540548674762249,
-0.011749399825930595,
-0.00963221862912178,
0.03006015159189701,
-0.00512605719268322,
0.016317550092935562,
0.0070620374754071236,
0.01557367667555809,
0.012226241640746593,
-0.027294466271996498,
0.004663520026952028,
0.0212862491607666,
-0.04123733937740326,
-0.016069592908024788,
-0.0424962043762207,
-0.061798788607120514,
0.014534159563481808,
0.0043416512198746204,
-0.004124687984585762,
0.0071764797903597355,
-0.07377707213163376,
0.015745339915156364,
-0.030422553420066833,
-0.012884284369647503,
-0.0008946757880039513,
0.02019904926419258,
0.009851566515862942,
-0.017681321129202843,
0.04554799571633339,
-0.03013644739985466,
0.0317767858505249,
-0.028801288455724716,
0.030861247330904007,
-0.025139138102531433,
-0.032101038843393326,
0.032444365322589874,
-0.010652662254869938,
-0.0868234857916832,
0.023899346590042114,
0.038967572152614594,
-0.0008952718344517052,
-0.08339022099971771,
-0.03654520958662033,
0.01956961676478386,
-0.02908739261329174,
-0.01960776373744011,
-0.07721033692359924,
-0.06034918874502182,
0.046387240290641785,
0.01863500475883484,
-0.06927567720413208,
-0.0021708256099373102,
0.018205847591161728,
0.03591577708721161,
0.027485202997922897,
-0.03032718412578106,
-0.023060103878378868,
-0.039673298597335815,
0.012302536517381668,
0.10170096904039383,
-0.016918372362852097,
0.0013053563889116049,
0.013723528012633324,
0.0037885138299316168,
-0.08010954409837723,
-0.022297155112028122,
-0.04043624550104141,
0.008130164816975594,
-0.06664350628852844,
0.011110430583357811,
0.0317004919052124,
-0.023079177364706993,
-0.040283653885126114,
0.07499779015779495,
-0.004701666999608278,
0.010557292960584164,
-0.05020197853446007,
0.00831136479973793,
-0.0012922432506456971,
-0.028591476380825043,
-0.08163543790578842,
0.03025088831782341,
0.06580426543951035,
0.017061425372958183,
-0.016727635636925697,
0.00799664855003357,
-0.048332758247852325,
-0.001448409166187048,
0.037308160215616226,
0.08331392705440521,
0.017261698842048645,
0.004260587971657515,
0.06031104177236557,
0.015049150213599205,
0.025120064616203308,
0.039673298597335815,
0.025730421766638756,
0.016489213332533836,
0.0051689730025827885,
0.04909570515155792,
-0.018463341519236565,
0.021305324509739876,
0.00978480838239193,
0.03189122676849365,
0.03297842666506767,
-0.05432190001010895,
-0.04753166064620018,
-0.050850484520196915,
-0.028019266203045845,
0.026703180745244026,
0.004954393953084946,
-0.005550446920096874,
-0.03692668303847313,
-0.025196358561515808,
-0.0108529357239604,
0.013294368982315063,
-0.020256269723176956,
0.025196358561515808,
-0.03021274134516716,
-0.06259988248348236,
-0.04047439247369766,
-0.002994571113958955,
0.01953146979212761,
-0.034733209758996964,
0.01860639452934265,
-0.018501490354537964,
-0.00026345549849793315,
-0.05363524705171585,
0.013876116834580898,
0.0021052598021924496,
-0.024757662788033485,
-0.0038767296355217695,
-0.00465875118970871,
0.06713942438364029,
-0.004282045643776655,
-0.009665598161518574,
-0.10040395706892014,
-0.023174546658992767,
-0.02508191578090191,
0.014438791200518608,
-0.0741204023361206,
0.026588737964630127,
0.012035504914820194,
-0.0871286615729332,
-0.02897295169532299,
-0.01293196901679039,
0.05130825564265251,
-0.03898664563894272,
-0.041962143033742905,
0.03171956539154053,
0.0011527667520567775,
0.04268694296479225,
-0.0036979136057198048,
0.0018584936624392867,
-0.009656060487031937,
0.03290213271975517,
0.00435834052041173,
0.00033259764313697815,
0.0031352394726127386,
0.01853010058403015,
-0.008983712643384933,
-0.00007800845196470618,
0.015897929668426514,
0.01805325783789158,
0.028496108949184418,
0.0009679903159849346,
0.006561352871358395,
0.08186431974172592,
-0.054894112050533295,
0.05882329121232033,
-0.0029349657706916332,
0.05180417001247406,
0.003271139692515135,
-0.001661796122789383,
-0.0645454004406929,
0.020866628736257553,
0.022735850885510445,
0.056954070925712585,
-0.030422553420066833,
-0.06202767416834831,
0.010900620371103287,
0.011558662168681622,
0.036373548209667206,
-0.022297155112028122,
-0.00048369713476859033,
0.06187508627772331,
-0.003638308495283127,
-0.022964736446738243,
-0.039749592542648315,
0.057182952761650085,
-0.018158163875341415,
0.05565705895423889,
0.005860394332557917,
-0.006647184491157532,
-0.02069496549665928,
0.06671980768442154,
-0.07083972543478012,
0.021915681660175323,
-0.03936811909079552,
-0.05531373247504234,
-0.11955395340919495,
-0.03822369500994682,
-0.0539785735309124,
0.03173863887786865,
-0.01937888003885746,
-0.009265050292015076,
-0.009851566515862942,
0.019550543278455734,
-0.006384921260178089
]
|
36,423 | torch_pso.optim.AutotuningPSO | AutotuningPSO |
Autotuning Particle Swarm Optimization is a modification of Particle Swarm Optimization where the coefficients
change over time, as prescribed by Axel Thevenot in his Medium Article entitled ["Particle Swarm Optimization
Visually Explained"](https://towardsdatascience.com/particle-swarm-optimization-visually-explained-46289eeb2e14).
| class AutotuningPSO(ParticleSwarmOptimizer):
"""
Autotuning Particle Swarm Optimization is a modification of Particle Swarm Optimization where the coefficients
change over time, as prescribed by Axel Thevenot in his Medium Article entitled ["Particle Swarm Optimization
Visually Explained"](https://towardsdatascience.com/particle-swarm-optimization-visually-explained-46289eeb2e14).
"""
def __init__(self,
params: Iterable[torch.nn.Parameter],
num_total_iterations: int = 1000,
inertial_weight: float = .9,
cognitive_coefficient: float = 1.,
social_coefficient: float = 1.,
num_particles: int = 100,
max_param_value: float = 10.,
min_param_value: float = -10.,
):
super().__init__(params, inertial_weight, cognitive_coefficient, social_coefficient, num_particles,
max_param_value, min_param_value)
self.num_total_iterations = num_total_iterations
self.current_step = 0
@torch.no_grad()
def step(self, closure: Callable[[], torch.Tensor], n: Optional[int] = None) -> torch.Tensor:
"""
Performs a single optimization step. This is a standard PSO step, followed by a weight adjustment.
:param n: integer representing which "step number" this step should be treated as in calculating
the weight decays
:param closure: A callable that reevaluates the model and returns the loss.
:return: the final loss after the step (as calculated by the closure)
"""
# Calculate the new coefficients for the swarm
n = n if n is not None else self.current_step
w_t = 0.4 * (n - self.num_total_iterations) / self.num_total_iterations ** 2 + 0.4
cognitive_t = -3 * n / self.num_total_iterations + 3.5
social_t = 3 * n / self.num_total_iterations + 0.5
self.inertial_weight = w_t
self.cognitive_coefficient = cognitive_t
self.social_coefficient = social_t
# Update the step number
for particle in self.particles:
particle_loss = particle.step(closure, self.best_known_global_param_groups)
if particle_loss < self.best_known_global_loss_value:
self.best_known_global_param_groups = clone_param_groups(particle.position)
self.best_known_global_loss_value = particle_loss
# Update the particle coefficients
particle.inertial_weight = w_t
particle.cognitive_coefficient = cognitive_t
particle.social_coefficient = social_t
# set the module's parameters to be the best performing ones
for master_group, best_group in zip(self.param_groups, self.best_known_global_param_groups):
clone = clone_param_group(best_group)['params']
for i in range(len(clone)):
master_group['params'][i].data = clone[i].data
return closure() # loss = closure()
| (params: Iterable[torch.nn.parameter.Parameter], num_total_iterations: int = 1000, inertial_weight: float = 0.9, cognitive_coefficient: float = 1.0, social_coefficient: float = 1.0, num_particles: int = 100, max_param_value: float = 10.0, min_param_value: float = -10.0) | [
-0.010412860661745071,
-0.05247150734066963,
-0.0580560602247715,
0.057745806872844696,
0.0020869350992143154,
0.016036193817853928,
-0.05115293338894844,
-0.033526696264743805,
-0.027302248403429985,
-0.016530659049749374,
-0.012051383033394814,
0.00500767445191741,
-0.014184371568262577,
0.023036273196339607,
-0.03657105192542076,
0.035465776920318604,
0.020825721323490143,
0.03302253410220146,
0.0008659205050207675,
-0.004527752287685871,
0.015464164316654205,
-0.027883972972631454,
-0.0312773622572422,
0.041884131729602814,
-0.04599498212337494,
-0.010364383459091187,
-0.0026977453380823135,
0.0026710829697549343,
-0.0789981260895729,
-0.03455440700054169,
-0.0027244077064096928,
-0.012865796685218811,
0.008507714606821537,
0.002966792555525899,
0.05115293338894844,
-0.019080549478530884,
0.0254795141518116,
0.07671000808477402,
-0.10424494743347168,
-0.04680939391255379,
-0.01683121547102928,
-0.04502544179558754,
0.0004508361453190446,
-0.004404135979712009,
0.0006453501409851015,
0.004644096828997135,
-0.005157953128218651,
0.07178474962711334,
0.010790981352329254,
-0.02377312257885933,
0.022144295275211334,
-0.05534134805202484,
0.04285367205739021,
0.012235595844686031,
0.01400015875697136,
0.08012279123067856,
0.05398399010300636,
-0.020651204511523247,
0.0458010733127594,
-0.04808918759226799,
0.06732486188411713,
-0.036881305277347565,
0.028795341029763222,
0.013786859810352325,
0.0030176935251802206,
-0.0028213616460561752,
-0.0312773622572422,
-0.0008004765259101987,
-0.00556515995413065,
0.04285367205739021,
0.0590256005525589,
-0.0580560602247715,
0.0467706136405468,
-0.009346365928649902,
0.0023656778503209352,
-0.01796557754278183,
0.015279951505362988,
-0.07841639965772629,
0.023210790008306503,
-0.03185908868908882,
-0.008052030578255653,
-0.0319366492331028,
-0.05770702660083771,
0.0042829434387385845,
-0.017442025244235992,
-0.05188978463411331,
-0.008798575960099697,
-0.03893673047423363,
-0.0071988352574408054,
-0.05856022238731384,
-0.012662193737924099,
0.043008796870708466,
0.02202795073390007,
0.028523869812488556,
0.06298132240772247,
0.02689504250884056,
-0.026235753670334816,
-0.08392339199781418,
0.003875736379995942,
-0.05037730187177658,
0.025498904287815094,
0.05328592285513878,
-0.019070852547883987,
0.05057121068239212,
0.07942472398281097,
-0.02722468599677086,
-0.007431524805724621,
0.019759226590394974,
-0.008454389870166779,
-0.021950388327240944,
-0.03368182107806206,
0.045490819960832596,
-0.09563543647527695,
-0.001753655611537397,
-0.026856260374188423,
-0.02928011119365692,
-0.021039020270109177,
0.01152783166617155,
-0.0024614199064671993,
0.035717856138944626,
0.0127397570759058,
0.023986421525478363,
-0.0217758696526289,
-0.03544638678431511,
0.008604668080806732,
0.0038927034474909306,
0.02708894945681095,
0.021853433921933174,
-0.02693382278084755,
-0.05324714258313179,
-0.0383743979036808,
-0.02689504250884056,
-0.020166434347629547,
0.00525005953386426,
-0.006525004748255014,
-0.061430059373378754,
0.023172007873654366,
0.006743151228874922,
-0.015212084166705608,
-0.0021305643022060394,
0.029299501329660416,
0.00882281456142664,
-0.006103254854679108,
0.007067947182804346,
0.016666393727064133,
-0.017102686688303947,
0.04343539476394653,
-0.014494623988866806,
0.0319366492331028,
-0.021271709352731705,
0.0018227352993562818,
0.017083296552300453,
0.005439119879156351,
0.01254584826529026,
-0.009554817341268063,
0.020728766918182373,
0.012671888805925846,
-0.03922758996486664,
-0.03653227165341377,
-0.01336995791643858,
-0.055069874972105026,
-0.05840509384870529,
-0.026041846722364426,
-0.0014264358906075358,
-0.016307665035128593,
0.018149789422750473,
0.0622444748878479,
0.012778538279235363,
0.0010943684028461576,
0.02635210007429123,
0.005826936103403568,
-0.034942224621772766,
0.04231072962284088,
0.03106406331062317,
0.0091088293120265,
0.1158018708229065,
0.006874039303511381,
-0.03238263726234436,
-0.006379573605954647,
-0.018498824909329414,
-0.028698386624455452,
-0.040681902319192886,
0.011818693950772285,
-0.1054859608411789,
0.0031825152691453695,
0.034166593104600906,
0.04983435943722725,
-0.013069400563836098,
0.004663487896323204,
0.021814651787281036,
-0.017519589513540268,
-0.02441301941871643,
0.028174834325909615,
0.03616384416818619,
0.010121998377144337,
0.03567907586693764,
0.018149789422750473,
0.010538900271058083,
0.051036588847637177,
-0.0026638114359229803,
-0.02266784757375717,
0.037656936794519424,
0.043241485953330994,
0.015842285007238388,
-0.031180409714579582,
0.028213616460561752,
0.00010225617734249681,
0.07632219791412354,
-0.01655004918575287,
-0.006040234584361315,
-0.04250463843345642,
-0.009928090497851372,
0.07294819504022598,
0.016889387741684914,
0.046499140560626984,
-0.044560063630342484,
0.005085237789899111,
0.014688531868159771,
0.03883977606892586,
-0.023036273196339607,
-0.03238263726234436,
-0.016656698659062386,
-0.04642158001661301,
0.024626318365335464,
0.057551898062229156,
-0.0017766822129487991,
0.006544395349919796,
-0.021756479516625404,
0.012342245317995548,
-0.010790981352329254,
0.017723193392157555,
-0.0204766858369112,
-0.028019707649946213,
0.01684091053903103,
0.053712520748376846,
0.018886640667915344,
-0.05456571653485298,
-0.03544638678431511,
-0.044366154819726944,
-0.06596750766038895,
-0.04157387837767601,
-0.050299737602472305,
-0.01495030801743269,
-0.012836710549890995,
-0.029784271493554115,
0.025208042934536934,
0.05592307075858116,
0.04634401574730873,
0.0038805841468274593,
0.026003064587712288,
0.011760520748794079,
-0.015182998031377792,
-0.04231072962284088,
0.021116582676768303,
-0.03631897270679474,
-0.07077642530202866,
0.03990627080202103,
0.044366154819726944,
0.023462869226932526,
-0.026759305968880653,
-0.040681902319192886,
-0.014038939960300922,
-0.048748474568128586,
0.041108500212430954,
-0.015493250451982021,
-0.01135331392288208,
-0.03247959166765213,
-0.012090165168046951,
-0.005439119879156351,
0.01288518775254488,
0.08849962055683136,
0.03531064838171005,
-0.025227433070540428,
-0.02815544418990612,
0.0038854319136589766,
0.003669709200039506,
-0.017151163890957832,
0.04518056660890579,
0.03292557969689369,
-0.0008410760201513767,
0.05382886528968811,
-0.030986500903964043,
-0.049524106085300446,
-0.03185908868908882,
-0.023617995902895927,
0.014436451718211174,
0.003618808463215828,
-0.03389512002468109,
0.06243837997317314,
0.00683040963485837,
-0.04126362502574921,
0.020728766918182373,
0.05600063502788544,
0.00392663711681962,
0.049756795167922974,
0.0541778989136219,
-0.020728766918182373,
0.02187282405793667,
-0.0003853921953123063,
-0.03593115508556366,
0.06980688869953156,
-0.023792512714862823,
-0.03496161475777626,
-0.041302409023046494,
0.005943280644714832,
-0.0013064552331343293,
0.05918072536587715,
-0.019245371222496033,
0.0161234512925148,
-0.04126362502574921,
0.03721094876527786,
-0.019313238561153412,
0.018343698233366013,
0.056427232921123505,
-0.0032309922389686108,
-0.048011623322963715,
0.0037230339366942644,
-0.057202864438295364,
0.03885916620492935,
0.07616706937551498,
-0.01641431264579296,
0.012167727574706078,
-0.0005941462586633861,
0.03909185528755188,
-0.016239795833826065,
-0.06569603830575943,
0.0638732984662056,
0.024859007447957993,
-0.0047895279712975025,
-0.0438619926571846,
-0.03841317817568779,
-0.027651283890008926,
-0.015948934480547905,
0.012070774100720882,
-0.028775949031114578,
0.0010489211417734623,
0.034690145403146744,
0.01271067000925541,
0.05654357746243477,
-0.022183077409863472,
0.09036113321781158,
0.03327461704611778,
-0.02770945616066456,
0.06992322951555252,
0.005880260374397039,
-0.0644938051700592,
0.04940776154398918,
0.002928011119365692,
0.018750905990600586,
-0.02018582448363304,
0.030908938497304916,
0.038878556340932846,
-0.012167727574706078,
0.04995070397853851,
0.07810615003108978,
0.022629065439105034,
0.014048635959625244,
-0.0055360738188028336,
-0.017490502446889877,
-0.057978495955467224,
-0.008279872126877308,
-0.053945209830999374,
-0.007480001542717218,
0.08376826345920563,
0.04207804054021835,
0.0035969936288893223,
-0.008832510560750961,
-0.03205299377441406,
0.04037164896726608,
-0.0393439382314682,
-0.02425789274275303,
-0.07046617567539215,
0.014349193312227726,
-0.02164013497531414,
-0.024955961853265762,
0.022726019844412804,
-0.027457375079393387,
-0.013651124201714993,
0.04428859055042267,
-0.022842364385724068,
0.07504240423440933,
-0.023889467120170593,
-0.02076754905283451,
0.005880260374397039,
0.021504398435354233,
-0.005856022238731384,
0.011518136598169804,
-0.07077642530202866,
0.08764642477035522,
-0.03395329415798187,
0.0319366492331028,
0.010005653835833073,
0.05960732325911522,
0.004988283850252628,
-0.044366154819726944,
0.022590283304452896,
-0.002772884676232934,
0.03501978889107704,
-0.07504240423440933,
-0.03335217759013176,
-0.004697421565651894,
-0.0774080827832222,
0.035368822515010834,
0.03405024856328964,
-0.020631812512874603,
-0.10789041966199875,
0.04106971621513367,
0.07100911438465118,
0.016627611592411995,
0.11719800531864166,
-0.05285932496190071,
-0.01130483765155077,
0.018537607043981552,
0.0054488154128193855,
-0.0002993454982060939,
-0.056427232921123505,
0.005720286630094051,
-0.012381026521325111,
0.01393229141831398,
0.0003160094784107059,
0.035039179027080536,
0.038723431527614594,
0.06895369291305542,
0.03922758996486664,
-0.00770784355700016,
-0.03800597041845322,
-0.022551503032445908,
-0.002308717230334878,
-0.038432568311691284,
0.006253533530980349,
-0.06988444924354553,
-0.030404776334762573,
-0.02902803011238575,
-0.055845510214567184,
0.002937706420198083,
-0.002758341608569026,
0.03151005133986473,
0.02912498451769352,
0.01851821504533291,
0.02751554735004902,
0.045103006064891815,
0.04114728048443794,
-0.007673909887671471,
0.0233853068202734,
-0.015221779234707355,
0.019759226590394974,
-0.03560151159763336,
-0.00809565931558609,
-0.061236150562763214,
0.015241170302033424,
0.03203360363841057,
0.011828389018774033,
0.03767632693052292,
-0.009549969807267189,
0.0007441220222972333,
0.0038442264776676893,
-0.03699764981865883,
-0.041496314108371735,
-0.038626477122306824,
-0.034263547509908676,
0.001319786417298019,
0.03866525739431381,
0.00735396146774292,
0.010984889231622219,
0.0003717580111697316,
-0.035039179027080536,
0.03538821265101433,
-0.00444291764870286,
0.006137188524007797,
0.004593196325004101,
0.04200047627091408,
-0.0022602402605116367,
0.0312967523932457,
-0.06302010267972946,
0.0025765527971088886,
-0.01422315277159214,
-0.05743555352091789,
-0.0072715505957603455,
0.047817718237638474,
0.00504645612090826,
0.011052756570279598,
-0.02732163853943348,
0.02737981267273426,
0.033138878643512726,
-0.008740403689444065,
0.006985536310821772,
0.0214462261646986,
-0.01573563553392887,
0.03959601745009422,
0.0169378649443388,
-0.04250463843345642,
-0.03573724627494812,
0.06713095307350159,
0.026856260374188423,
-0.08361313492059708,
-0.011818693950772285,
0.00577361136674881,
0.025343777611851692,
0.06015026569366455,
-0.035465776920318604,
0.012109555304050446,
0.04506422206759453,
-0.04556838423013687,
-0.038781601935625076,
0.03986748680472374,
-0.032498981803655624,
-0.054333027452230453,
0.005788154434412718,
-0.058172404766082764,
0.09028357267379761,
0.017432330176234245,
-0.0680617168545723,
0.025557076558470726,
0.0015124825295060873,
0.023462869226932526,
-0.004193260800093412,
0.018401870504021645,
0.1106051355600357,
0.022338204085826874,
-0.09214509278535843,
0.038199879229068756,
0.012225900776684284,
0.017471112310886383,
0.004309605807065964,
0.014213457703590393,
0.043008796870708466,
-0.03156822547316551,
-0.04250463843345642,
0.008958550170063972,
0.003485496621578932,
-0.016443399712443352,
-0.0021572266705334187,
-0.011876866221427917,
0.0387040413916111,
0.030230259522795677,
-0.009520883671939373,
-0.0095160361379385,
-0.061236150562763214,
-0.026759305968880653,
-0.019817398861050606,
-0.027748236432671547,
0.020069479942321777,
0.037521202117204666,
-0.031005891039967537,
-0.018237048760056496,
0.013815945945680141,
0.0014700650935992599,
0.049679234623909,
-0.08531952649354935,
-0.005623332690447569,
-0.02396703138947487,
0.023559823632240295,
-0.014814572408795357,
0.04041042923927307,
0.04010017588734627,
-0.021077800542116165,
-0.04231072962284088,
-0.012691279873251915,
-0.0033158271107822657,
0.07845517992973328,
-0.009685705415904522,
-0.056970175355672836,
0.027011387050151825,
-0.0528981052339077,
-0.039751142263412476,
0.022105513140559196,
0.00008672838885104284,
-0.0101607795804739,
-0.051618315279483795,
0.024820225313305855,
0.04273732751607895,
0.004336268175393343,
0.007804797496646643,
-0.03637714311480522,
-0.0461113266646862,
-0.03424415737390518,
0.04467640817165375,
-0.013864423148334026,
-0.00888583529740572,
-0.021756479516625404,
0.014514015056192875,
-0.03622201830148697,
-0.016656698659062386,
-0.034690145403146744,
0.0014991513453423977,
0.05437180772423744,
-0.052393946796655655,
0.034884050488471985,
0.046266451478004456,
0.04002261534333229,
-0.015163606964051723,
0.04273732751607895,
-0.03990627080202103,
-0.050648774951696396,
-0.02138805389404297,
0.03885916620492935,
-0.03982870653271675,
0.0245099738240242,
0.05541891232132912,
0.005720286630094051,
-0.09672132134437561,
0.010344992391765118,
0.010606768541038036,
-0.011198188178241253,
0.007945381104946136,
-0.024102766066789627,
-0.034166593104600906,
0.011876866221427917,
0.034942224621772766,
0.0012385874288156629,
-0.004612586926668882,
-0.023462869226932526,
0.008565886877477169,
-0.04995070397853851,
-0.03864586725831032,
0.011285446584224701,
-0.02990061603486538,
-0.0036018413957208395,
0.10315906256437302,
-0.032886799424886703,
-0.010664940811693668,
0.04075946658849716,
-0.013069400563836098,
-0.0203215591609478,
-0.0312967523932457,
-0.020166434347629547,
0.0312967523932457,
-0.10331419110298157,
0.0001620949769858271,
-0.016462789848446846,
-0.03715277463197708,
-0.01879938133060932,
0.009685705415904522,
-0.004930111113935709,
0.028911685571074486,
0.01009291224181652,
0.015454469248652458,
0.011256360448896885,
-0.021465618163347244,
-0.05925828963518143,
0.015667768195271492,
0.0196719691157341,
-0.018498824909329414,
0.0035921460948884487,
-0.01741294004023075,
-0.04556838423013687,
-0.006563786417245865,
0.04328026995062828,
0.028504477813839912,
0.00851256214082241,
-0.008405912667512894,
0.010364383459091187,
-0.02577037550508976,
0.014436451718211174,
0.016656698659062386,
0.014669141732156277,
0.03234385699033737,
-0.00517734419554472,
0.06569603830575943,
-0.04770137369632721,
0.015386600978672504,
-0.0009410598431713879,
-0.016559744253754616,
0.029008639976382256,
0.012662193737924099,
-0.03893673047423363,
0.005473053548485041,
-0.023947639390826225,
-0.0028625670820474625,
0.02976488135755062,
-0.04254341870546341,
-0.05518622323870659,
-0.0106455497443676,
0.0008689502719789743,
0.030850766226649284,
-0.034205373376607895,
0.010664940811693668,
-0.017616543918848038,
-0.07294819504022598,
0.012691279873251915,
0.031684570014476776,
-0.011731434613466263,
-0.003529125824570656,
-0.004142359830439091,
0.018537607043981552,
0.018392175436019897,
-0.02012765221297741,
-0.009540274739265442,
-0.004229618702083826,
-0.00927365105599165,
-0.031684570014476776,
0.030365996062755585,
0.018401870504021645,
0.025906110182404518,
0.047042082995176315,
-0.06507553160190582,
-0.043357834219932556,
-0.017587456852197647,
0.03845195844769478,
-0.03891734033823013,
-0.0009865070460364223,
-0.01478548627346754,
-0.03529125824570656,
-0.017209336161613464,
-0.014727314002811909,
0.06228325515985489,
-0.009894156828522682,
-0.024878397583961487,
0.04688695818185806,
0.006917668506503105,
0.010180170647799969,
0.009312432259321213,
0.021213537082076073,
0.004964045248925686,
0.026119409129023552,
0.021717697381973267,
-0.007373352535068989,
0.0044138310477137566,
-0.015842285007238388,
0.03593115508556366,
-0.01631736010313034,
-0.0023474988993257284,
0.03476770594716072,
0.02012765221297741,
-0.029241329059004784,
-0.02577037550508976,
0.05072633549571037,
-0.05115293338894844,
0.03550455719232559,
0.006714065093547106,
0.016656698659062386,
0.03397268429398537,
-0.01485335361212492,
-0.031917259097099304,
0.031917259097099304,
-0.009899004362523556,
0.07236646860837936,
0.020205214619636536,
-0.06713095307350159,
-0.001966954441741109,
-0.006844953168183565,
0.0025692812632769346,
-0.042039256542921066,
-0.025828547775745392,
0.05634966865181923,
0.03938271850347519,
0.006951602175831795,
-0.005085237789899111,
0.039751142263412476,
-0.0035727552603930235,
0.07376261055469513,
0.022919926792383194,
0.013631733134388924,
0.032111167907714844,
0.025595858693122864,
-0.04362930357456207,
0.030133305117487907,
-0.02061242237687111,
-0.06724730134010315,
-0.12317036837339401,
-0.062011782079935074,
-0.05235516279935837,
0.043396614491939545,
0.044947877526283264,
0.02057364024221897,
0.018925422802567482,
0.0312773622572422,
0.02957097254693508
]
|
36,425 | torch_pso.optim.AutotuningPSO | __init__ | null | def __init__(self,
params: Iterable[torch.nn.Parameter],
num_total_iterations: int = 1000,
inertial_weight: float = .9,
cognitive_coefficient: float = 1.,
social_coefficient: float = 1.,
num_particles: int = 100,
max_param_value: float = 10.,
min_param_value: float = -10.,
):
super().__init__(params, inertial_weight, cognitive_coefficient, social_coefficient, num_particles,
max_param_value, min_param_value)
self.num_total_iterations = num_total_iterations
self.current_step = 0
| (self, params: Iterable[torch.nn.parameter.Parameter], num_total_iterations: int = 1000, inertial_weight: float = 0.9, cognitive_coefficient: float = 1.0, social_coefficient: float = 1.0, num_particles: int = 100, max_param_value: float = 10.0, min_param_value: float = -10.0) | [
-0.023959707468748093,
-0.024771900847554207,
-0.044744476675987244,
0.03682558983564377,
-0.01714835688471794,
0.036013394594192505,
-0.07106693089008331,
-0.04422762617468834,
-0.031343284994363785,
0.011822952888906002,
0.0086572440341115,
0.06623068451881409,
-0.023664364591240883,
0.05349401384592056,
-0.030475713312625885,
-0.010041664354503155,
0.04374769330024719,
0.02528875134885311,
-0.036013394594192505,
-0.006188360508531332,
-0.01433336827903986,
0.041384950280189514,
-0.03241390362381935,
0.08365592360496521,
-0.0223906971514225,
-0.0028403697069734335,
-0.0018308963626623154,
-0.0021193174179643393,
-0.029848109930753708,
0.013770370744168758,
-0.052866410464048386,
0.01412109099328518,
-0.017674436792731285,
0.04777174070477486,
0.02838985249400139,
-0.014665629714727402,
-0.001587469014339149,
0.052017297595739365,
-0.12692368030548096,
0.0445229671895504,
0.01878197304904461,
-0.04795633256435394,
0.015616265125572681,
0.010576973669230938,
-0.008809530176222324,
-0.0016370774246752262,
0.03187859430909157,
0.03928063064813614,
-0.006792890839278698,
-0.043415430933237076,
-0.012026000767946243,
-0.030364960432052612,
0.0383576825261116,
-0.017628289759159088,
-0.0578872412443161,
0.07826591283082962,
0.04854701831936836,
0.0071113076992332935,
0.010060123167932034,
-0.006571383215487003,
-0.008777227252721786,
-0.059142451733350754,
0.04348926618695259,
-0.023369021713733673,
0.006959021091461182,
-0.03278307989239693,
-0.06279732286930084,
-0.012330573052167892,
0.0028842096216976643,
0.04507673531770706,
0.09214703738689423,
-0.002320058410987258,
0.032358527183532715,
0.013659616932272911,
-0.011767575517296791,
0.02763303741812706,
-0.01786825619637966,
-0.005583830177783966,
0.0015147869708016515,
0.006972865201532841,
0.02778070792555809,
0.01177680492401123,
-0.019732609391212463,
-0.02647012285888195,
-0.02573176473379135,
-0.07261747866868973,
-0.033078424632549286,
-0.06549232453107834,
0.020120246335864067,
0.028316017240285873,
-0.049543801695108414,
0.045039817690849304,
0.018560467287898064,
-0.006640604697167873,
0.06999631226062775,
0.05729655548930168,
-0.0014501806581392884,
-0.03854227066040039,
-0.014471810311079025,
-0.04710721969604492,
-0.009478666819632053,
0.010041664354503155,
0.009067955426871777,
-0.01244132686406374,
0.028906702995300293,
-0.056927379220724106,
-0.02342439815402031,
-0.04913770407438278,
0.028020674362778664,
0.004441683180630207,
-0.0613575242459774,
0.06327725201845169,
-0.07147302478551865,
0.010650809854269028,
-0.033078424632549286,
0.025787143036723137,
-0.007535863202065229,
-0.0306787621229887,
-0.003761009545996785,
0.042861662805080414,
0.031638626009225845,
0.04149570316076279,
-0.02543642185628414,
0.018274351954460144,
-0.017508307471871376,
0.022759875282645226,
0.03660408407449722,
0.003449514741078019,
-0.023479774594306946,
-0.07379885017871857,
0.0222614835947752,
-0.05803491547703743,
-0.0076004695147275925,
-0.027854543179273605,
0.004229404963552952,
-0.04629502817988396,
0.005611518397927284,
-0.0229998417198658,
-0.03311534225940704,
0.03217393532395363,
0.05161120370030403,
0.06065608561038971,
0.028463689610362053,
0.035551924258470535,
0.012109066359698772,
0.0354965440928936,
0.023221349343657494,
-0.011887558735907078,
-0.016225410625338554,
-0.04611043632030487,
0.005533067975193262,
-0.013327356427907944,
-0.011610674671828747,
0.002110087778419256,
-0.027023890987038612,
0.005002373363822699,
0.031490955501794815,
-0.04843626543879509,
-0.01222904957830906,
-0.0077619850635528564,
-0.02429196797311306,
-0.005809952039271593,
-0.011582986451685429,
0.012672063894569874,
-0.06024998798966408,
-0.004905464127659798,
-0.02342439815402031,
-0.03182321786880493,
-0.040240492671728134,
-0.0035095063503831625,
0.018874268978834152,
-0.07021781802177429,
0.032653868198394775,
0.012856652960181236,
0.024771900847554207,
0.04740256443619728,
0.02515953779220581,
-0.017674436792731285,
-0.006622145418077707,
0.030217288061976433,
0.013133537024259567,
-0.03689942508935928,
0.030494172126054764,
-0.08985812962055206,
0.03346606343984604,
0.020046411082148552,
0.0383576825261116,
0.03592110052704811,
-0.00026001149672083557,
0.005620747804641724,
0.034684352576732635,
0.008255762048065662,
-0.006040689069777727,
0.012330573052167892,
-0.014637941494584084,
0.03259849175810814,
0.07224830240011215,
0.005653051193803549,
0.007115922402590513,
0.040831178426742554,
-0.0007643155986443162,
0.027263857424259186,
0.004231712315231562,
-0.047070302069187164,
-0.028260640799999237,
0.023664364591240883,
-0.03128790855407715,
0.04393228143453598,
0.02720848098397255,
-0.019548019394278526,
-0.016511524096131325,
-0.020840145647525787,
0.07893043756484985,
0.02750382386147976,
-0.0028542140498757362,
-0.05644744634628296,
-0.030807973816990852,
-0.01906808651983738,
0.027891460806131363,
-0.016760719940066338,
0.06818733364343643,
-0.03318917751312256,
0.0286851953715086,
-0.043858446180820465,
0.03466589376330376,
0.014970201998949051,
0.044744476675987244,
-0.05013448745012283,
-0.07184220105409622,
0.025233374908566475,
0.008061942644417286,
-0.03712093457579613,
-0.00894797220826149,
0.03568113595247269,
0.011075365357100964,
0.0445229671895504,
-0.040941935032606125,
-0.003954828251153231,
-0.10226254165172577,
-0.006783661432564259,
-0.042123306542634964,
0.007466642186045647,
-0.0048085544258356094,
-0.0017201426671817899,
-0.027023890987038612,
0.019824903458356857,
0.025233374908566475,
0.057518064975738525,
-0.035718053579330444,
0.023904331028461456,
0.008477269671857357,
-0.018994251266121864,
-0.041975636035203934,
-0.00019598205108195543,
-0.004097884986549616,
-0.025565635412931442,
0.00012625628733076155,
0.0015101722674444318,
0.012459785677492619,
0.005699198227375746,
-0.06228047236800194,
-0.01832973025739193,
-0.026562418788671494,
0.07922577857971191,
0.01860661432147026,
-0.000008512924978276715,
-0.052312642335891724,
0.049506884068250656,
-0.021560044959187508,
0.028869785368442535,
0.12360107898712158,
0.0378408320248127,
0.030069617554545403,
-0.009187938645482063,
0.020434049889445305,
-0.03547808527946472,
-0.014628712087869644,
0.0015528585063293576,
-0.05596751347184181,
0.030364960432052612,
0.04086809977889061,
-0.036308739334344864,
-0.030032699927687645,
-0.04481831192970276,
0.00996782910078764,
-0.011093824170529842,
0.025067243725061417,
0.018708137795329094,
-0.028168346732854843,
-0.0018193594878539443,
-0.02982965111732483,
0.018542006611824036,
0.0328938364982605,
0.017231423407793045,
0.04570434242486954,
-0.03477664664387703,
-0.014176467433571815,
0.024218132719397545,
0.010327777825295925,
0.009390986524522305,
0.06501239538192749,
-0.06896261125802994,
-0.017794420942664146,
-0.034684352576732635,
-0.025122620165348053,
0.00044416828313842416,
0.015966985374689102,
0.027466906234622,
0.011638362891972065,
0.002136622555553913,
0.055044565349817276,
0.04289858043193817,
0.02951584942638874,
0.04467064142227173,
0.0008346902905032039,
-0.05485997721552849,
0.026137862354516983,
-0.05338326096534729,
0.043415430933237076,
0.06338800489902496,
-0.007305126171559095,
0.02298138290643692,
-0.023202890530228615,
0.0026188623160123825,
-0.0415695384144783,
-0.044006116688251495,
0.04537208005785942,
0.03880069777369499,
-0.046184275299310684,
-0.028629818931221962,
-0.00930330716073513,
0.013124307617545128,
-0.0029972707852721214,
-0.01569933071732521,
-0.06623068451881409,
0.011656821705400944,
0.025657929480075836,
0.04422762617468834,
0.04718105494976044,
-0.03606877475976944,
0.07922577857971191,
-0.013705764897167683,
-0.02152312733232975,
0.04884235933423042,
-0.013188914395868778,
-0.051278941333293915,
0.03634565696120262,
-0.01281050592660904,
0.014351828023791313,
-0.05807183310389519,
-0.029885027557611465,
0.028629818931221962,
0.015376298688352108,
0.056927379220724106,
0.04814092069864273,
0.028703656047582626,
-0.020286377519369125,
-0.032801538705825806,
-0.018560467287898064,
-0.03370602801442146,
0.00044243776937946677,
-0.03138020262122154,
-0.004575510509312153,
0.059290122240781784,
0.020840145647525787,
0.004395535681396723,
0.010115500539541245,
-0.03573651239275932,
0.05135277658700943,
0.028629818931221962,
-0.014850218780338764,
-0.0625758171081543,
-0.03577343001961708,
0.01090923510491848,
0.01207214780151844,
-0.024974949657917023,
-0.08734771609306335,
0.020563261583447456,
0.01932651177048683,
-0.022944465279579163,
0.011887558735907078,
-0.036013394594192505,
0.034389007836580276,
0.011066135950386524,
-0.028998998925089836,
0.0020374057348817587,
0.04086809977889061,
-0.02501186728477478,
0.06386794149875641,
-0.010484679602086544,
0.0021193174179643393,
0.0014767154352739453,
0.0066544488072395325,
-0.03269078582525253,
-0.03942830115556717,
0.012265967205166817,
0.08779072761535645,
0.002007409930229187,
-0.07863509654998779,
-0.044006116688251495,
0.005177733488380909,
-0.07095617055892944,
0.03492431715130806,
0.05585676059126854,
-0.0012909722281619906,
-0.0442645438015461,
0.0492115393280983,
0.04481831192970276,
0.014268762432038784,
0.02501186728477478,
-0.046331945806741714,
-0.0022323783487081528,
-0.014434892684221268,
0.01628078706562519,
-0.03114023618400097,
-0.037287063896656036,
-0.011998312547802925,
-0.06807658076286316,
0.01685301400721073,
0.0076004695147275925,
0.06069300323724747,
0.006972865201532841,
0.0497283898293972,
0.053752440959215164,
0.013105848804116249,
0.025694847106933594,
0.0131704555824399,
-0.0184866301715374,
0.008209615014493465,
-0.0395759716629982,
-0.09480512887239456,
-0.031011022627353668,
-0.0001916557375807315,
-0.022482991218566895,
0.024033542722463608,
0.0011606060434132814,
-0.019861821085214615,
0.02397816628217697,
-0.028629818931221962,
0.005311560817062855,
0.04256632179021835,
-0.012773588299751282,
0.035865724086761475,
-0.0064883180893957615,
-0.007028242107480764,
0.025565635412931442,
-0.010087812319397926,
-0.00396636500954628,
-0.07826591283082962,
-0.003500276943668723,
0.025214914232492447,
-0.012182901613414288,
0.05419545620679855,
-0.0445229671895504,
0.009077184833586216,
-0.00753124849870801,
-0.050540585070848465,
-0.009783239103853703,
0.040646590292453766,
-0.01178603433072567,
0.052718739956617355,
0.05478614196181297,
-0.0024734982289373875,
-0.00611452478915453,
-0.02532566897571087,
-0.032063182443380356,
0.029645061120390892,
0.006317573133856058,
-0.016539212316274643,
0.0111307417973876,
0.03913295641541481,
0.04976530745625496,
0.02503032609820366,
-0.0660460963845253,
-0.010364696383476257,
0.00032678095158189535,
-0.014840989373624325,
-0.004363232292234898,
0.015930067747831345,
-0.01818205788731575,
-0.010300089605152607,
-0.04729181155562401,
0.05821950361132622,
0.02296292409300804,
-0.018643531948328018,
-0.013484257273375988,
-0.04803016781806946,
0.008472654037177563,
0.01084462832659483,
0.013105848804116249,
-0.039502136409282684,
0.017120668664574623,
0.020470967516303062,
0.04784557968378067,
-0.016825325787067413,
-0.015228627249598503,
0.030955646187067032,
0.011915246956050396,
0.05371552333235741,
0.03114023618400097,
-0.005371551960706711,
-0.000005777432761533419,
0.010872316546738148,
-0.02255682833492756,
0.020434049889445305,
0.01412109099328518,
-0.02048942632973194,
0.02065555565059185,
-0.0410526879131794,
0.04876852408051491,
0.03588418290019035,
-0.03976055979728699,
-0.02036021277308464,
-0.014434892684221268,
-0.003954828251153231,
-0.03461051732301712,
-0.02109857089817524,
0.050245240330696106,
0.022501450031995773,
-0.04433837905526161,
0.06711671501398087,
0.04511365666985512,
0.0018274353351444006,
-0.01271821092814207,
0.031472496688365936,
0.020600179210305214,
-0.023498233407735825,
-0.08978429436683655,
0.009146406315267086,
0.03795158490538597,
-0.007535863202065229,
-0.03023574687540531,
-0.02925742417573929,
0.06623068451881409,
-0.0016855321591719985,
-0.0018297426868230104,
0.005191577598452568,
-0.027023890987038612,
0.017231423407793045,
-0.008112705312669277,
-0.01613311469554901,
0.0058837877586483955,
0.05689046159386635,
-0.03226622939109802,
0.02676546573638916,
-0.0012044459581375122,
-0.03027266450226307,
0.07981646806001663,
-0.018828121945261955,
0.001586315338499844,
-0.02194768190383911,
-0.018292812630534172,
-0.10750488191843033,
-0.02968197874724865,
0.05596751347184181,
0.022427614778280258,
-0.027116186916828156,
-0.0509466789662838,
0.009257159195840359,
0.08587099611759186,
0.023941248655319214,
-0.029478929936885834,
0.024181215092539787,
-0.008398818783462048,
-0.01860661432147026,
-0.0022508371621370316,
-0.012358262203633785,
-0.02456885203719139,
-0.06693212687969208,
0.012026000767946243,
0.031767841428518295,
0.028555983677506447,
-0.061726704239845276,
0.03564421832561493,
-0.012616687454283237,
-0.03665946051478386,
0.00989399291574955,
0.017674436792731285,
0.0004767598584294319,
-0.027023890987038612,
-0.00603607390075922,
-0.012653605081140995,
0.005583830177783966,
-0.02255682833492756,
0.039502136409282684,
0.08771689236164093,
-0.076198510825634,
0.025990189984440804,
0.014481039717793465,
-0.0077619850635528564,
-0.013059701770544052,
0.01569933071732521,
-0.0494699664413929,
-0.020452508702874184,
-0.022759875282645226,
0.027466906234622,
-0.05194346234202385,
-0.006202204618602991,
0.04526132717728615,
0.0036802515387535095,
-0.0954696461558342,
0.020877063274383545,
-0.012081378139555454,
0.04961763694882393,
0.00509466789662838,
-0.05759190022945404,
-0.034536682069301605,
0.054490797221660614,
-0.01714835688471794,
0.0205263439565897,
0.02910975180566311,
0.00301803695037961,
-0.022003058344125748,
-0.04906386882066727,
-0.05412161722779274,
-0.03328147158026695,
-0.03304150700569153,
0.02067401446402073,
0.10322240740060806,
-0.0070928484201431274,
-0.03961288928985596,
-0.002766533987596631,
-0.03405674919486046,
0.027688413858413696,
-0.06781815737485886,
-0.03588418290019035,
0.007881968282163143,
-0.10853858292102814,
0.00859263725578785,
0.020046411082148552,
0.01818205788731575,
-0.0037863904144614935,
-0.037471652030944824,
0.003936369437724352,
0.002678853925317526,
-0.017859026789665222,
0.014970201998949051,
-0.008523416705429554,
0.010493909008800983,
-0.023350561037659645,
0.002055864781141281,
0.05740731209516525,
-0.03558884188532829,
-0.031195612624287605,
-0.019603395834565163,
-0.055635251104831696,
-0.019308052957057953,
0.015966985374689102,
0.06346184015274048,
0.0141026321798563,
0.006188360508531332,
0.04057275503873825,
0.012192131020128727,
0.037877749651670456,
0.0017916710348799825,
-0.02822372317314148,
-0.010364696383476257,
0.05777648836374283,
0.07021781802177429,
-0.03520120307803154,
-0.030014239251613617,
-0.001175026991404593,
0.02809450961649418,
-0.0007123997784219682,
0.020027952268719673,
-0.008269606158137321,
-0.029423553496599197,
-0.04068350791931152,
-0.04345234856009483,
0.0005280987825244665,
-0.05046674981713295,
-0.014527187682688236,
-0.03143557906150818,
-0.007448183372616768,
0.04012973979115486,
0.014508728869259357,
-0.04718105494976044,
-0.010493909008800983,
-0.016797637566924095,
0.023904331028461456,
0.041975636035203934,
-0.015930067747831345,
-0.010789251886308193,
0.03389061614871025,
0.015376298688352108,
0.0006345261353999376,
-0.051574286073446274,
0.014951743185520172,
-0.018874268978834152,
0.0010279323905706406,
-0.05216497182846069,
0.01214598398655653,
0.007226675748825073,
-0.00827883556485176,
0.04670112207531929,
-0.04160645604133606,
-0.08306524157524109,
-0.05419545620679855,
0.010641580447554588,
-0.01628078706562519,
0.006123754195868969,
0.015939297154545784,
-0.07154686003923416,
0.058847106993198395,
-0.025824060663580894,
0.035441167652606964,
0.03256157413125038,
-0.028186805546283722,
0.015579347498714924,
-0.015819313004612923,
0.030346501618623734,
0.03405674919486046,
-0.0024711908772587776,
-0.04422762617468834,
-0.038099255412817,
0.10432994365692139,
0.07283898442983627,
0.026543958112597466,
-0.043710775673389435,
-0.0021493129897862673,
0.02619323879480362,
-0.047328729182481766,
0.05312483757734299,
0.03143557906150818,
-0.003096487605944276,
-0.03621644526720047,
0.031786300241947174,
-0.0032764622010290623,
0.04939613118767738,
0.004635501652956009,
0.016373081132769585,
0.014637941494584084,
-0.05585676059126854,
-0.026433205232024193,
0.01980644464492798,
-0.014924054965376854,
0.060582246631383896,
0.014351828023791313,
-0.028463689610362053,
-0.016539212316274643,
-0.02517799660563469,
0.011241495609283447,
-0.01685301400721073,
-0.021430831402540207,
0.03597647696733475,
0.04729181155562401,
0.006705210544168949,
-0.030604926869273186,
0.06944254040718079,
-0.02776224911212921,
0.02659933641552925,
0.04171720892190933,
0.01497943140566349,
0.014887137338519096,
0.05308791622519493,
-0.03682558983564377,
0.0395759716629982,
-0.0090264230966568,
-0.06767047941684723,
-0.106397345662117,
-0.048214755952358246,
-0.04315700754523277,
0.07040240615606308,
0.0010250480845570564,
-0.0031680159736424685,
0.05629977211356163,
0.08336058259010315,
-0.0032441590446978807
]
|
36,445 | torch_pso.optim.ChaoticPSO | ChaoticPSO |
ChaoticPSO is a variation on the original Particle Swarm Optimization inspired by techniques in training
Hopfield Networks. It introduces some chaos-like mechanics into the optimization, theoretically improving
convergence speed in some contexts.
Original Paper:
Sun, Yanxia & Qi, Guoyuan & Wang, Zenghui & Van Wyk, Barend & Hamam, Yskandar. (2009). Chaotic particle
swarm optimization. 505-510. 10.1145/1543834.1543902.
https://www.researchgate.net/publication/220741402_Chaotic_particle_swarm_optimization
| class ChaoticPSO(GenericPSO):
"""
ChaoticPSO is a variation on the original Particle Swarm Optimization inspired by techniques in training
Hopfield Networks. It introduces some chaos-like mechanics into the optimization, theoretically improving
convergence speed in some contexts.
Original Paper:
Sun, Yanxia & Qi, Guoyuan & Wang, Zenghui & Van Wyk, Barend & Hamam, Yskandar. (2009). Chaotic particle
swarm optimization. 505-510. 10.1145/1543834.1543902.
https://www.researchgate.net/publication/220741402_Chaotic_particle_swarm_optimization
"""
def __init__(self,
params: Iterable[torch.nn.Parameter],
num_particles: int = 100,
a: float = 0.02,
b: float = 0.01,
c: float = 0.01,
beta: float = .001,
k: float = 15.,
epsilon: float = 1.,
i0: float = 0.2,
z: float = 0.7,
max_param_value: float = -10,
min_param_value: float = 10):
particle_kwargs = {'a': a,
'b': b,
'c': c,
'beta': beta,
'k': k,
'epsilon': epsilon,
'i0': i0,
'z':z,
'max_param_value': max_param_value,
'min_param_value': min_param_value,
}
super().__init__(params, num_particles, particle_class=ChaoticParticle, particle_kwargs=particle_kwargs)
| (params: Iterable[torch.nn.parameter.Parameter], num_particles: int = 100, a: float = 0.02, b: float = 0.01, c: float = 0.01, beta: float = 0.001, k: float = 15.0, epsilon: float = 1.0, i0: float = 0.2, z: float = 0.7, max_param_value: float = -10, min_param_value: float = 10) | [
-0.02440446987748146,
-0.06061124429106712,
-0.051866162568330765,
0.03970836475491524,
-0.004157024901360273,
0.008549562655389309,
-0.06679679453372955,
-0.01604153960943222,
-0.033487267792224884,
-0.021187273785471916,
0.03606458008289337,
0.054745640605688095,
-0.015854906290769577,
0.02383568324148655,
-0.048311252146959305,
0.014539589174091816,
0.017454616725444794,
0.01932094432413578,
-0.0026484092231839895,
-0.031300999224185944,
0.021720509976148605,
0.020245222374796867,
-0.013197610154747963,
0.008820625022053719,
-0.01878770813345909,
0.016743633896112442,
-0.02042296715080738,
0.006629910320043564,
-0.093138687312603,
-0.031069928780198097,
-0.006972070783376694,
0.008736195974051952,
-0.01589934341609478,
0.03860634192824364,
0.04301443323493004,
-0.014957291074097157,
0.02683958411216736,
0.058691591024398804,
-0.14845311641693115,
0.01944536715745926,
0.0024773289915174246,
-0.052008356899023056,
0.012966540642082691,
-0.026057502254843712,
-0.0015941556775942445,
-0.021418342366814613,
0.007278681732714176,
0.12214677035808563,
-0.0005793395102955401,
-0.0673300251364708,
0.021045077592134476,
-0.0819762647151947,
0.040099404752254486,
-0.02507990226149559,
-0.009944865480065346,
0.08169186860322952,
0.04344101995229721,
0.0391751267015934,
0.03547801822423935,
0.003290515160188079,
0.03231414780020714,
0.003797090146690607,
0.0531814806163311,
-0.0010620298562571406,
-0.0010209261672571301,
-0.011135760694742203,
-0.04710258170962334,
-0.00010831371764652431,
-0.008953933604061604,
0.04464969038963318,
0.06789881736040115,
-0.051297377794981,
0.0325629897415638,
0.01852109096944332,
0.01225555781275034,
-0.022822532802820206,
-0.0030039004050195217,
-0.01862773671746254,
0.019960829988121986,
-0.016530338674783707,
-0.009616035968065262,
-0.026661837473511696,
-0.06405951082706451,
-0.0140419015660882,
-0.013899704441428185,
-0.03881963714957237,
0.0016519230557605624,
-0.0343048982322216,
0.0269817803055048,
-0.0184855405241251,
-0.06189101189374924,
0.009598261676728725,
0.017347969114780426,
0.015694934874773026,
0.05463899299502373,
0.04923552647233009,
0.003221638733521104,
-0.06924968212842941,
0.005336811300367117,
-0.05047974735498428,
-0.0037748718168586493,
0.05154621973633766,
-0.009847105480730534,
0.03138986974954605,
0.04041934758424759,
-0.04287223517894745,
-0.038037557154893875,
0.03215417638421059,
-0.000900947954505682,
-0.012228895910084248,
-0.06349072605371475,
0.08162077516317368,
-0.06381066888570786,
-0.014895079657435417,
-0.03163871541619301,
-0.05563436821103096,
-0.04123697429895401,
-0.0022407053038477898,
-0.03505142778158188,
0.004161468707025051,
-0.005807837005704641,
0.03423380106687546,
-0.02015634998679161,
-0.005510113202035427,
-0.00917167216539383,
0.04393870756030083,
0.005598986055701971,
-0.0001688582997303456,
-0.06235315278172493,
-0.051475122570991516,
-0.008931715972721577,
-0.015534964390099049,
0.02852816693484783,
0.008109642192721367,
0.011953390203416348,
-0.06043349951505661,
0.02602195367217064,
-0.022271521389484406,
-0.031994204968214035,
0.005225720349699259,
0.025257647037506104,
-0.0025039908941835165,
0.010495876893401146,
-0.01556162629276514,
0.004710257984697819,
0.008122973144054413,
0.0435832180082798,
-0.07351557165384293,
-0.015846019610762596,
-0.010780270211398602,
-0.005661197006702423,
0.014299632050096989,
-0.003652671817690134,
-0.020334094762802124,
-0.02166718617081642,
-0.02358683943748474,
0.02550649084150791,
-0.07156037539243698,
-0.05389246344566345,
-0.01206892542541027,
-0.07202251255512238,
-0.026341896504163742,
-0.025186549872159958,
-0.008305162191390991,
-0.03661559149622917,
0.022395944222807884,
0.027639439329504967,
-0.02044074237346649,
0.03643784672021866,
0.018574412912130356,
-0.012539951130747795,
-0.019480915740132332,
0.023480191826820374,
0.021027302369475365,
0.01796119101345539,
0.05161731690168381,
-0.013295370154082775,
-0.015223909169435501,
0.012504401616752148,
-0.031603164970874786,
-0.032118625938892365,
-0.03306067734956741,
-0.010709171183407307,
-0.06469939649105072,
0.003790424671024084,
0.02797715552151203,
0.06729447841644287,
0.017756784334778786,
-0.022271521389484406,
0.02591530606150627,
0.004539177753031254,
-0.006038906518369913,
-0.0010309243807569146,
0.01645924150943756,
0.03096328116953373,
0.03519362583756447,
0.02495547942817211,
-0.009527163580060005,
0.015597174875438213,
0.09121903777122498,
-0.013117624446749687,
0.045289576053619385,
0.015250571072101593,
-0.013259820640087128,
0.000036069857742404565,
0.02140056900680065,
0.022982504218816757,
0.08034100383520126,
-0.0410592295229435,
-0.024724410846829414,
-0.031745363026857376,
-0.04123697429895401,
0.05755402147769928,
-0.008940602652728558,
0.05058639496564865,
-0.027870507910847664,
-0.009491614066064358,
-0.012513289228081703,
0.001072028069756925,
0.014699559658765793,
0.03889073431491852,
0.01055808737874031,
-0.04408090561628342,
0.046924833208322525,
0.03889073431491852,
0.0314609669148922,
0.021311696618795395,
0.003637118963524699,
0.012539951130747795,
-0.04617830365896225,
0.008314049802720547,
0.005483451299369335,
-0.023213572800159454,
0.03849969431757927,
0.06235315278172493,
0.04646269604563713,
-0.006110004615038633,
0.006363291759043932,
-0.1085670068860054,
-0.06253089755773544,
-0.02166718617081642,
-0.013686410151422024,
-0.019836407154798508,
-0.010638073086738586,
-0.027035104110836983,
-0.01806783862411976,
0.05051529407501221,
0.04319217801094055,
0.0029461330268532038,
0.024440018460154533,
0.015268346294760704,
-0.03821530193090439,
-0.038570791482925415,
0.005523444153368473,
-0.02877701073884964,
-0.08261615037918091,
0.003474926110357046,
0.007154259830713272,
0.018272247165441513,
-0.021347245201468468,
-0.06743667274713516,
-0.026910681277513504,
-0.018609963357448578,
0.06373956799507141,
0.0031349877826869488,
-0.020191898569464684,
-0.04287223517894745,
0.0022040451876819134,
-0.03753986954689026,
0.02893698215484619,
0.08176296949386597,
0.007083161734044552,
-0.0007804142078384757,
-0.009758233092725277,
-0.005794506054371595,
-0.005927815102040768,
-0.022111551836133003,
0.04081038758158684,
-0.00788746029138565,
0.03071443736553192,
0.029630189761519432,
-0.007394216489046812,
-0.023480191826820374,
-0.03394940868020058,
-0.010184821672737598,
-0.01739240624010563,
0.00924277026206255,
0.006581030320376158,
0.04941327124834061,
0.02054738998413086,
-0.05314593017101288,
0.02081400901079178,
0.0003463261527940631,
-0.005519000347703695,
0.052150554955005646,
0.03613567724823952,
-0.0228936318308115,
0.025435393676161766,
0.017303531989455223,
-0.06928522884845734,
0.08816181123256683,
-0.048311252146959305,
-0.011500139720737934,
-0.01556162629276514,
0.0011347944382578135,
0.03562021628022194,
0.05822945386171341,
-0.014264083467423916,
0.04344101995229721,
-0.019978603348135948,
0.03316732496023178,
0.02330244705080986,
0.02314247563481331,
0.08041210472583771,
0.011277957819402218,
-0.0014830647269263864,
0.027710536494851112,
-0.046533793210983276,
0.025542041286826134,
0.08844620734453201,
-0.03551356866955757,
0.008314049802720547,
0.0013397573493421078,
0.020174123346805573,
0.01892990432679653,
-0.057198528200387955,
0.014104112051427364,
0.0328829325735569,
0.01862773671746254,
-0.05183061212301254,
-0.045538417994976044,
0.012788794934749603,
-0.005452346056699753,
0.007580849342048168,
-0.03631342202425003,
-0.0076252855360507965,
-0.003988166805356741,
0.028137126937508583,
0.03252744302153587,
-0.04838234931230545,
0.07323118299245834,
0.013757508248090744,
-0.022715885192155838,
0.06327743083238602,
0.029185825958848,
-0.05894043669104576,
0.050337549299001694,
-0.019765309989452362,
0.00743420934304595,
0.0321008525788784,
0.02724839746952057,
0.02683958411216736,
0.03686443343758583,
0.06359737366437912,
0.0871664360165596,
0.04251674562692642,
0.007052056025713682,
-0.012228895910084248,
-0.031745363026857376,
-0.051475122570991516,
0.05879823863506317,
-0.046924833208322525,
-0.0009087243233807385,
0.04589391127228737,
0.0037615408655256033,
-0.007132041733711958,
-0.005159065593034029,
-0.02358683943748474,
0.04560951888561249,
-0.01656588912010193,
-0.023391319438815117,
-0.06260199844837189,
-0.017232434824109077,
-0.041983507573604584,
0.009633811190724373,
0.017507940530776978,
-0.04017050191760063,
0.02673293650150299,
0.013961915858089924,
-0.037077728658914566,
0.07184476405382156,
-0.022431492805480957,
-0.02875923551619053,
-0.004910221789032221,
0.009820443578064442,
-0.0173835176974535,
0.025026578456163406,
-0.02561313845217228,
0.10323463380336761,
-0.003663780866190791,
-0.0025062127970159054,
0.012228895910084248,
0.04941327124834061,
-0.05136847496032715,
-0.043369922786951065,
-0.012771020643413067,
0.03510475158691406,
0.043369922786951065,
-0.08695314079523087,
-0.0223426204174757,
0.020618487149477005,
-0.08816181123256683,
0.04870229214429855,
0.03250966593623161,
-0.030856633558869362,
-0.07198696583509445,
0.05161731690168381,
0.017454616725444794,
0.0005904486170038581,
0.10373232513666153,
-0.04518292844295502,
-0.0008398478967137635,
-0.0025861982721835375,
0.004732476081699133,
-0.0239956546574831,
-0.06644129753112793,
0.017765671014785767,
-0.023800134658813477,
-0.02218264900147915,
0.02987903356552124,
0.02412007562816143,
0.001764124957844615,
0.05883378908038139,
0.05360806733369827,
0.030056778341531754,
0.0027395037468522787,
-0.02794160693883896,
0.015481640584766865,
-0.003765984671190381,
-0.009669359773397446,
-0.08396701514720917,
-0.008514013141393661,
-0.06142887473106384,
-0.043512120842933655,
0.038855183869600296,
-0.006696565076708794,
-0.003523806342855096,
-0.010469214990735054,
0.014619574882090092,
0.03176313638687134,
0.042410098016262054,
0.01473510917276144,
0.017427954822778702,
0.02424449846148491,
0.01604153960943222,
0.01919652335345745,
-0.03402050584554672,
0.0011353499721735716,
-0.020387418568134308,
-0.017179111018776894,
0.054887838661670685,
0.04923552647233009,
0.05897598713636398,
-0.012948766350746155,
0.02906140312552452,
-0.01713467389345169,
-0.032260823994874954,
-0.029523542150855064,
-0.00992709118872881,
-0.026964005082845688,
0.007558631245046854,
0.045716166496276855,
0.023657936602830887,
-0.02659074030816555,
0.003643784439191222,
-0.021418342366814613,
0.05072858929634094,
-0.013526438735425472,
0.0014264083001762629,
-0.01755237579345703,
0.045822810381650925,
0.0023306889925152063,
0.003497144440189004,
-0.07038725167512894,
-0.0027528346981853247,
-0.0071986960247159,
-0.04066818952560425,
0.0004482521617319435,
0.03750431910157204,
-0.016130411997437477,
0.040917035192251205,
-0.04923552647233009,
0.04795575886964798,
0.038570791482925415,
-0.02303582802414894,
-0.010975790210068226,
0.021542765200138092,
0.0040548210963606834,
0.0013797500869259238,
-0.009180559776723385,
-0.030607789754867554,
-0.018414443358778954,
0.033380620181560516,
0.0037237699143588543,
-0.05904708430171013,
0.020494066178798676,
-0.00022940289636608213,
0.02550649084150791,
-0.0030372277833521366,
-0.037077728658914566,
-0.013473115861415863,
0.04287223517894745,
-0.02481328323483467,
-0.042978882789611816,
0.03396718204021454,
-0.04795575886964798,
-0.01755237579345703,
0.004061486572027206,
-0.04621385410428047,
0.07131152600049973,
0.018609963357448578,
-0.0782080590724945,
0.02195158042013645,
-0.03505142778158188,
0.041308075189590454,
-0.01397969014942646,
-0.033380620181560516,
0.07220025360584259,
-0.013944141566753387,
-0.09356527775526047,
0.04827570170164108,
0.018876580521464348,
0.037077728658914566,
0.036651138216257095,
0.013739733956754208,
0.010282582603394985,
-0.01547275297343731,
-0.0350869782269001,
0.03533582389354706,
0.02081400901079178,
-0.0029439113568514585,
-0.03517585247755051,
-0.04870229214429855,
0.05040864646434784,
0.04464969038963318,
0.016494790092110634,
-0.021827157586812973,
-0.021062852814793587,
0.05015980452299118,
-0.02383568324148655,
-0.004808017984032631,
0.024191174656152725,
0.05101298168301582,
-0.03439377248287201,
0.009251657873392105,
-0.009047250263392925,
-0.0011281289625912905,
0.050230901688337326,
-0.03643784672021866,
0.012113361619412899,
0.009082799777388573,
-0.015650499612092972,
-0.033238425850868225,
0.029345795512199402,
0.0701739564538002,
0.009953753091394901,
-0.020174123346805573,
-0.05588321387767792,
-0.0066610160283744335,
0.06853869557380676,
-0.007358667440712452,
-0.035424694418907166,
0.044471945613622665,
-0.034464869648218155,
-0.08375371992588043,
-0.0043369922786951065,
0.006101117469370365,
0.003932620864361525,
-0.033380620181560516,
-0.0080252131447196,
0.06988956779241562,
0.02138279378414154,
-0.011624561622738838,
-0.006812099367380142,
-0.03128322213888168,
0.0007748596835881472,
0.006803212221711874,
-0.017605699598789215,
-0.025168774649500847,
0.00008241563045885414,
-0.009438290260732174,
-0.031034380197525024,
-0.01752571389079094,
-0.02413785085082054,
0.030536692589521408,
0.043760962784290314,
-0.01794341765344143,
0.00726535078138113,
0.05851384624838829,
0.018538864329457283,
-0.0003432711528148502,
0.030785536393523216,
-0.021151725202798843,
-0.0383930467069149,
-0.028279323130846024,
0.016503676772117615,
-0.01878770813345909,
-0.011277957819402218,
0.030252298340201378,
-0.011126874014735222,
-0.09271209686994553,
0.02550649084150791,
0.014584025368094444,
-0.013277594931423664,
0.0134908901527524,
-0.029559090733528137,
-0.009989301674067974,
0.030234524980187416,
0.03634897246956825,
0.00014233533875085413,
0.03945951908826828,
-0.005510113202035427,
0.005123516544699669,
-0.040277149528265,
-0.03354059159755707,
-0.0024106744676828384,
-0.05360806733369827,
-0.007523081731051207,
0.10814041644334793,
-0.01576603390276432,
-0.032847385853528976,
0.04575171321630478,
-0.012744358740746975,
-0.002037408761680126,
-0.07010285556316376,
-0.051866162568330765,
0.026501866057515144,
-0.12968318164348602,
-0.005950033664703369,
-0.014761771075427532,
0.022982504218816757,
-0.008945046924054623,
-0.010184821672737598,
-0.021471666172146797,
-0.05005315691232681,
-0.00351047539152205,
-0.004421421326696873,
0.02683958411216736,
-0.014308519661426544,
0.028332646936178207,
0.032669637352228165,
0.015846019610762596,
-0.022520365193486214,
-0.00875841360539198,
-0.01656588912010193,
-0.0435832180082798,
-0.009367192164063454,
0.004594723228365183,
0.03928177431225777,
0.005865604151040316,
0.01234443113207817,
0.023871231824159622,
-0.031034380197525024,
-0.011526801623404026,
-0.0039792791940271854,
-0.010398116894066334,
0.06580141931772232,
-0.004585836082696915,
0.05069304257631302,
-0.02342686802148819,
0.01179341971874237,
0.008882835507392883,
-0.01083359308540821,
0.013090962544083595,
0.02699955366551876,
-0.0506574921309948,
0.015001727268099785,
-0.015241684392094612,
-0.015250571072101593,
0.0684320479631424,
-0.029932357370853424,
-0.035264723002910614,
-0.05783841386437416,
-0.005705633200705051,
0.02029854618012905,
0.003988166805356741,
0.006314411759376526,
-0.010104836896061897,
-0.03576241061091423,
0.01726798340678215,
0.0657658651471138,
0.008078536950051785,
-0.003421602537855506,
0.010024851188063622,
0.015063938684761524,
0.04824015125632286,
0.00951827596873045,
-0.018307795748114586,
-0.03521139919757843,
-0.05471009016036987,
-0.04152137041091919,
0.033505041152238846,
-0.008100755512714386,
-0.008100755512714386,
0.060078006237745285,
-0.05204390734434128,
-0.06196211278438568,
-0.04699593409895897,
0.03231414780020714,
-0.015526076778769493,
0.014743996784090996,
-0.01589934341609478,
-0.050230901688337326,
0.03524694964289665,
-0.04472079128026962,
0.030216749757528305,
-0.008442915044724941,
-0.020511841401457787,
0.06999621540307999,
-0.0077008274383842945,
0.003281627781689167,
0.06629910320043564,
0.03274073824286461,
-0.01103800069540739,
-0.01515281107276678,
0.04041934758424759,
0.023266896605491638,
0.057376276701688766,
-0.007420878391712904,
0.018414443358778954,
-0.007420878391712904,
-0.021684961393475533,
0.051332924515008926,
0.021347245201468468,
-0.02070736140012741,
-0.040277149528265,
0.029576865956187248,
-0.040348246693611145,
0.022538140416145325,
-0.007318674586713314,
-0.012362205423414707,
0.011580124497413635,
-0.030074553564190865,
-0.04440084844827652,
0.008905054070055485,
-0.05300373211503029,
0.04642714560031891,
-0.005012425594031811,
-0.04781356081366539,
-0.006803212221711874,
-0.03151429072022438,
-0.0018452213844284415,
-0.01179341971874237,
-0.029096951708197594,
0.07259129732847214,
0.003439377062022686,
0.021880481392145157,
0.02410230226814747,
0.04649824649095535,
-0.0005954477237537503,
0.05015980452299118,
0.03496255725622177,
0.014290745370090008,
0.028279323130846024,
0.04177021235227585,
-0.051297377794981,
0.007896347902715206,
0.01055808737874031,
-0.06224650517106056,
-0.10323463380336761,
-0.07877684384584427,
-0.04141472280025482,
0.058442749083042145,
0.04717367887496948,
0.02452889084815979,
0.022111551836133003,
0.03439377248287201,
0.0019063213840126991
]
|
36,447 | torch_pso.optim.ChaoticPSO | __init__ | null | def __init__(self,
params: Iterable[torch.nn.Parameter],
num_particles: int = 100,
a: float = 0.02,
b: float = 0.01,
c: float = 0.01,
beta: float = .001,
k: float = 15.,
epsilon: float = 1.,
i0: float = 0.2,
z: float = 0.7,
max_param_value: float = -10,
min_param_value: float = 10):
particle_kwargs = {'a': a,
'b': b,
'c': c,
'beta': beta,
'k': k,
'epsilon': epsilon,
'i0': i0,
'z':z,
'max_param_value': max_param_value,
'min_param_value': min_param_value,
}
super().__init__(params, num_particles, particle_class=ChaoticParticle, particle_kwargs=particle_kwargs)
| (self, params: Iterable[torch.nn.parameter.Parameter], num_particles: int = 100, a: float = 0.02, b: float = 0.01, c: float = 0.01, beta: float = 0.001, k: float = 15.0, epsilon: float = 1.0, i0: float = 0.2, z: float = 0.7, max_param_value: float = -10, min_param_value: float = 10) | [
-0.00826474279165268,
-0.02839309722185135,
-0.03286003693938255,
0.010697145015001297,
-0.019838998094201088,
0.042209867388010025,
-0.06716685742139816,
-0.010281194932758808,
-0.07508798688650131,
0.027416519820690155,
0.022696392610669136,
0.07436459511518478,
-0.02969520166516304,
0.044741734862327576,
-0.03465043008327484,
-0.016439061611890793,
0.03372810781002045,
0.025825059041380882,
-0.00933174416422844,
-0.04629702493548393,
-0.012596046552062035,
0.02502932958304882,
-0.03412597253918648,
0.0510714054107666,
0.0027669707778841257,
-0.016619909554719925,
-0.002525086747482419,
0.014296014793217182,
-0.04853953793644905,
0.004121068399399519,
-0.026584619656205177,
0.026060162112116814,
0.012813063338398933,
0.08196020126342773,
0.02481231279671192,
-0.019929422065615654,
0.005407347809523344,
0.03323981910943985,
-0.11964887380599976,
0.06271800398826599,
0.04741828143596649,
-0.0406184047460556,
0.03535573557019234,
-0.022569799795746803,
0.020598558709025383,
0.003137708641588688,
0.03475894033908844,
0.07407524436712265,
-0.042716238647699356,
-0.03465043008327484,
0.005032088607549667,
-0.02947818487882614,
0.05888402834534645,
-0.040690746158361435,
-0.04832252115011215,
0.07472629100084305,
0.07302632182836533,
0.026982484385371208,
-0.001432088203728199,
0.011004585772752762,
0.001106562209315598,
0.007459969725459814,
0.048503369092941284,
-0.03649507835507393,
-0.006257332395762205,
-0.03190154582262039,
-0.04438003897666931,
-0.02738035097718239,
-0.021177271381020546,
0.08159850537776947,
0.10641081631183624,
-0.012740724720060825,
0.009630142711102962,
0.014151336625218391,
0.02473997324705124,
0.02569846622645855,
-0.026078246533870697,
0.020399626344442368,
-0.0004815071588382125,
0.012912529520690441,
0.013970489613711834,
0.01467579510062933,
-0.030852627009153366,
-0.029279252514243126,
-0.008526971563696861,
-0.03240791708230972,
-0.034560006111860275,
-0.04593532904982567,
0.035735517740249634,
0.030436677858233452,
-0.06156057491898537,
0.016619909554719925,
0.01669224724173546,
-0.02345595322549343,
0.05472452938556671,
0.043837495148181915,
0.04365664720535278,
-0.033872783184051514,
0.0011845527915284038,
-0.042318373918533325,
0.0020955733489245176,
0.002730801235884428,
-0.000025290428311564028,
-0.018401259556412697,
0.007233910262584686,
-0.05779894441366196,
-0.04741828143596649,
-0.00812910683453083,
0.019875168800354004,
0.018166156485676765,
-0.054073479026556015,
0.07942833751440048,
-0.04723743349313736,
0.021755985915660858,
-0.06376691907644272,
-0.022063426673412323,
-0.021575137972831726,
-0.026693128049373627,
-0.005687661934643984,
-0.0026697649154812098,
0.024884650483727455,
0.04354814067482948,
-0.016619909554719925,
0.035916365683078766,
-0.011221603490412235,
0.058341484516859055,
0.00013252749340608716,
-0.007197740487754345,
-0.029622862115502357,
-0.06789024919271469,
0.027470774948596954,
-0.019712405279278755,
0.0024730931036174297,
-0.023492123931646347,
0.011547129601240158,
-0.08174318820238113,
0.004439812619239092,
-0.02513783797621727,
-0.037652503699064255,
0.01000992301851511,
0.05197564512491226,
0.029767541214823723,
0.03982267528772354,
-0.0026629832573235035,
-0.02964094653725624,
-0.000686091196257621,
0.045971497893333435,
-0.05754575505852699,
-0.04347579926252365,
-0.027072908356785774,
-0.016511399298906326,
0.024866566061973572,
-0.010344491340219975,
-0.01332847960293293,
-0.021755985915660858,
-0.04173966124653816,
0.03732697665691376,
-0.08854306489229202,
0.004444333724677563,
-0.018573064357042313,
-0.03414405509829521,
0.007568478584289551,
-0.013138589449226856,
0.013880065642297268,
-0.0625009834766388,
0.0205804742872715,
-0.012189138680696487,
-0.04076308384537697,
0.013518369756639004,
0.0007753847748972476,
0.009150896221399307,
-0.023582547903060913,
0.036296144127845764,
0.029568608850240707,
-0.0049009742215275764,
0.03356534242630005,
-0.0008567662443965673,
-0.03137708455324173,
-0.0034971435088664293,
-0.003488101065158844,
0.00044562018592841923,
-0.03150367736816406,
0.038882266730070114,
-0.06611794233322144,
0.03257068246603012,
-0.0006194035522639751,
0.02929733693599701,
0.05892019718885422,
-0.028989896178245544,
-0.002773752436041832,
0.04513959959149361,
-0.0037209426518529654,
-0.01208967249840498,
0.028863301500678062,
-0.011682764627039433,
0.04014820232987404,
0.05725640058517456,
-0.005190330557525158,
-0.011149263940751553,
0.07038594782352448,
-0.005538462661206722,
0.007034977898001671,
-0.01951347291469574,
-0.04293325915932655,
-0.002423360012471676,
0.012921571731567383,
0.017280003055930138,
0.045971497893333435,
-0.0027014133520424366,
-0.034777022898197174,
-0.031141983345150948,
-0.03150367736816406,
0.06575624644756317,
0.009702482260763645,
-0.0007561696693301201,
-0.053675614297389984,
-0.014305057935416698,
-0.01431410014629364,
0.01347315777093172,
-0.0043674735352396965,
0.09078557044267654,
0.01223435066640377,
0.032353661954402924,
0.02743460424244404,
0.02846543677151203,
0.04756296053528786,
0.03873758763074875,
-0.026186754927039146,
-0.044343870133161545,
0.03110581450164318,
0.007532309275120497,
-0.013201885856688023,
-0.02182832360267639,
0.025662297382950783,
0.011601383797824383,
0.04658638313412666,
-0.007360503543168306,
0.0001202354978886433,
-0.12377220392227173,
-0.03338449448347092,
-0.005366657394915819,
0.018627319484949112,
0.002234600018709898,
-0.007324334233999252,
-0.007523266598582268,
-0.018880505114793777,
0.03161218762397766,
0.05533941462635994,
-0.0228410717099905,
0.021737899631261826,
-0.002570298733189702,
-0.010190770961344242,
-0.020236864686012268,
0.031069643795490265,
-0.021719815209507942,
-0.02351020835340023,
0.01057055126875639,
0.0007861225749365985,
0.009205150417983532,
0.0064562647603452206,
-0.06977106630802155,
-0.029948389157652855,
0.002556735184043646,
0.09367913752794266,
0.03244408592581749,
-0.024938905611634254,
-0.034722767770290375,
0.022750647738575935,
-0.04615234583616257,
0.027705876156687737,
0.08478143066167831,
0.008074852637946606,
0.03367385268211365,
-0.01577896624803543,
0.01102267112582922,
-0.03569934889674187,
0.009973754175007343,
-0.026421857997775078,
-0.02025494910776615,
0.04438003897666931,
0.027127163484692574,
-0.031087730079889297,
-0.02356446348130703,
-0.016095450147986412,
0.03902694582939148,
-0.009349828585982323,
0.005800691898912191,
0.03338449448347092,
0.00021998434385750443,
0.0026381167117506266,
-0.046080008149147034,
-0.003271083813160658,
0.011375323869287968,
-0.0006295762723311782,
0.04767146706581116,
-0.04459705576300621,
-0.005506813991814852,
0.048611875623464584,
0.010109389200806618,
-0.03942481055855751,
0.07573904097080231,
-0.07624541223049164,
0.024830397218465805,
-0.0038294512778520584,
-0.026982484385371208,
0.006537646520882845,
0.029622862115502357,
0.03009306639432907,
0.03841206431388855,
0.01459441427141428,
0.08564949780702591,
0.04206518828868866,
0.025318685919046402,
0.039569489657878876,
0.03645890951156616,
-0.03257068246603012,
0.052047982811927795,
-0.05067354068160057,
0.033601511269807816,
0.04897357150912285,
0.004412685055285692,
0.006573815830051899,
0.0023487601429224014,
0.011293942108750343,
-0.017252875491976738,
-0.03701953589916229,
0.017931055277585983,
0.02940584532916546,
-0.03182920441031456,
-0.03640465438365936,
-0.0458991602063179,
0.037869520485401154,
-0.014531116932630539,
-0.01940496452152729,
-0.04915441945195198,
-0.01183648593723774,
-0.019748574122786522,
0.051722459495067596,
0.02700057066977024,
-0.03425256535410881,
0.05016716942191124,
0.013418903574347496,
-0.029206912964582443,
0.05443517491221428,
-0.011709892190992832,
-0.035464245826005936,
0.041703492403030396,
-0.02868245355784893,
0.0006007536430843174,
-0.0007612560293637216,
0.00021136581199243665,
0.03260685130953789,
0.026403771713376045,
0.051650118082761765,
0.07277313619852066,
0.008404899388551712,
0.002421099226921797,
-0.027416519820690155,
-0.03971416875720024,
-0.00950354989618063,
0.05693087354302406,
-0.032353661954402924,
-0.004534757696092129,
0.028772877529263496,
0.0056153228506445885,
-0.012333816848695278,
0.012216266244649887,
-0.043728988617658615,
0.042318373918533325,
0.01265030074864626,
0.005773564800620079,
-0.02788672409951687,
-0.04441620782017708,
-0.015652373433113098,
0.03884609788656235,
-0.041305627673864365,
-0.0721944272518158,
0.02727184258401394,
0.01825658045709133,
-0.02519209310412407,
0.006447222549468279,
-0.05816064029932022,
0.03662167116999626,
0.004292873665690422,
-0.029948389157652855,
-0.02665695920586586,
0.03993118554353714,
-0.0412694588303566,
0.07718582451343536,
0.015589077025651932,
0.01555290725082159,
0.009892372414469719,
0.025210177525877953,
-0.03859291225671768,
-0.04141413792967796,
0.005452559795230627,
0.06351373344659805,
-0.007717677857726812,
-0.06959021836519241,
-0.03204622119665146,
-0.0026697649154812098,
-0.07537734508514404,
0.034560006111860275,
0.03662167116999626,
0.010335449129343033,
-0.052445847541093826,
0.05718405917286873,
0.015598119236528873,
0.0009618839831091464,
0.07027743756771088,
-0.040473729372024536,
-0.009449295699596405,
-0.03960565850138664,
0.010679059661924839,
0.003350204788148403,
-0.05848616361618042,
0.004041947424411774,
-0.07280930876731873,
-0.018509767949581146,
-0.010534381493926048,
-0.008879625238478184,
-0.0019599376246333122,
0.04325878247618675,
0.040799252688884735,
0.047165095806121826,
0.0358801931142807,
-0.016095450147986412,
0.020725153386592865,
0.013057207688689232,
-0.04293325915932655,
-0.09042387455701828,
-0.0203092023730278,
-0.03164835646748543,
-0.027127163484692574,
0.03266110643744469,
0.00233293604105711,
-0.0021532184910029173,
-0.0070440201088786125,
-0.007925652898848057,
0.007242952473461628,
0.0231123436242342,
-0.0020944431889802217,
0.05371178314089775,
0.0047156051732599735,
-0.004787944257259369,
0.02316659688949585,
-0.017641698941588402,
0.017198622226715088,
-0.03329407051205635,
-0.01650235801935196,
0.026023991405963898,
0.023691056296229362,
0.06836045533418655,
-0.07016892731189728,
0.047092754393815994,
-0.021231526508927345,
-0.05892019718885422,
-0.014531116932630539,
0.05219266191124916,
-0.020001761615276337,
0.04427153244614601,
0.046767231076955795,
-0.008111021481454372,
-0.06051165983080864,
-0.02463146485388279,
-0.00029472532332874835,
0.048611875623464584,
-0.02823033556342125,
0.005827818997204304,
-0.016782671213150024,
0.04398217424750328,
0.04336729273200035,
0.0142508028075099,
-0.04781614616513252,
-0.04228220507502556,
-0.00233293604105711,
0.007025935221463442,
-0.001632150961086154,
0.003800063394010067,
-0.029007980599999428,
0.019079437479376793,
-0.05410964787006378,
0.04466939717531204,
0.04658638313412666,
-0.005018525291234255,
-0.020652813836932182,
-0.016972562298178673,
0.011510959826409817,
-0.012451368384063244,
0.011438620276749134,
-0.0619584396481514,
-0.012351902201771736,
0.02428785338997841,
0.028429267928004265,
-0.027072908356785774,
-0.013247097842395306,
0.042426884174346924,
0.026186754927039146,
0.026729298755526543,
-0.002595165278762579,
-0.01575183868408203,
0.026855891570448875,
-0.0013529672287404537,
-0.01195403654128313,
0.005538462661206722,
-0.024993160739541054,
0.0007358242874033749,
0.013427945785224438,
-0.018681572750210762,
0.04155881330370903,
0.017099155113101006,
-0.058232977986335754,
-0.010670017451047897,
-0.009774820879101753,
-0.023040004074573517,
-0.027072908356785774,
-0.050311844795942307,
0.029767541214823723,
-0.01321997120976448,
-0.04694807901978493,
0.06698600947856903,
0.06438180059194565,
0.030346253886818886,
-0.035464245826005936,
0.01195403654128313,
0.00712540140375495,
0.005407347809523344,
-0.057943619787693024,
0.016918307170271873,
0.03515680506825447,
-0.019368793815374374,
-0.04792465642094612,
-0.03678443282842636,
0.03150367736816406,
-0.007333376444876194,
0.01431410014629364,
0.0011161697329953313,
0.005140597466379404,
0.007464491296559572,
0.00549777178093791,
0.005276233423501253,
0.03437915816903114,
0.07631774991750717,
-0.0715433731675148,
0.008924837224185467,
-0.030165405943989754,
-0.02143045887351036,
0.05892019718885422,
-0.0028347885236144066,
0.014576328918337822,
0.03392703831195831,
-0.016999689862132072,
-0.09078557044267654,
-0.022678308188915253,
0.049009740352630615,
0.018383175134658813,
-0.011312027461826801,
-0.09498123824596405,
-0.0021837367676198483,
0.07631774991750717,
0.02233469858765602,
0.009259405545890331,
0.05070970952510834,
-0.0021792154293507338,
-0.07215825468301773,
-0.0075865634717047215,
-0.016330553218722343,
-0.028212249279022217,
-0.05219266191124916,
-0.0007335637346841395,
0.03535573557019234,
0.016276298090815544,
-0.05512239784002304,
0.030436677858233452,
-0.03260685130953789,
-0.010127474553883076,
0.01620395854115486,
-0.01113117951899767,
-0.02721758745610714,
-0.019133692607283592,
0.015706628561019897,
-0.0018887287005782127,
-0.027308011427521706,
-0.03483127802610397,
0.03982267528772354,
0.08000704646110535,
-0.05273520573973656,
0.028320759534835815,
0.04810550436377525,
-0.007514224387705326,
0.025463365018367767,
0.01428697258234024,
-0.04228220507502556,
-0.034614261239767075,
-0.03336641192436218,
0.03036433830857277,
-0.01605023816227913,
-0.010389703325927258,
0.0026290742680430412,
-0.031033474951982498,
-0.07016892731189728,
0.02052622102200985,
-0.0023193724919110537,
0.014078998006880283,
0.0019655891228467226,
-0.06684133410453796,
0.017759250476956367,
0.05942657217383385,
0.009055951610207558,
0.008716861717402935,
0.05533941462635994,
-0.019278371706604958,
-0.03210047632455826,
-0.057726603001356125,
-0.028881385922431946,
-0.03374619036912918,
-0.04452471807599068,
0.01967623643577099,
0.10264918953180313,
-0.0003280691453255713,
-0.05208415538072586,
0.01669224724173546,
-0.019658152014017105,
0.0312504917383194,
-0.0616329163312912,
-0.06561156362295151,
-0.0019599376246333122,
-0.1281125545501709,
0.006266374606639147,
0.015824178233742714,
0.05240967869758606,
-0.0044465940445661545,
-0.06062016636133194,
-0.017424682155251503,
-0.0413779653608799,
-0.01802147924900055,
0.00521745765581727,
-0.017361383885145187,
0.01841934397816658,
0.02322085201740265,
0.024721888825297356,
0.027416519820690155,
-0.03685677424073219,
-0.012415198609232903,
-0.018916675820946693,
-0.035229142755270004,
-0.01170084998011589,
0.004986877087503672,
0.061054203659296036,
0.0019418527372181416,
0.023257020860910416,
0.01956772804260254,
-0.004611617885529995,
0.009214193560183048,
-0.026566535234451294,
0.002590644173324108,
0.02929733693599701,
0.04166732355952263,
0.05201181396842003,
-0.007301728241145611,
-0.02260596863925457,
-0.01924220100045204,
-0.012813063338398933,
0.02761545218527317,
0.03535573557019234,
-0.0559181272983551,
-0.02700057066977024,
-0.0409439317882061,
-0.03971416875720024,
0.06362224370241165,
-0.036476992070674896,
-0.027705876156687737,
-0.0464417040348053,
-0.01610449329018593,
0.021303866058588028,
0.010706187225878239,
-0.03676635026931763,
-0.006935511250048876,
-0.0043584308587014675,
0.02998455800116062,
0.07085615396499634,
-0.005940848961472511,
0.006790833082050085,
0.051433101296424866,
0.008328039199113846,
0.020218778401613235,
-0.039569489657878876,
0.004995919298380613,
-0.017099155113101006,
-0.0077131567522883415,
-0.020381541922688484,
0.01501940656453371,
-0.013590709306299686,
-0.0003495448036119342,
0.023763395845890045,
-0.025011245161294937,
-0.06774556636810303,
-0.058630842715501785,
0.011773188598453999,
0.013852938078343868,
-0.015896517783403397,
-0.001040439703501761,
-0.09548761695623398,
0.07465395331382751,
-0.045754481106996536,
0.01951347291469574,
0.012804021127521992,
-0.010073220357298851,
0.007966343313455582,
-0.014639626257121563,
0.019133692607283592,
0.06203078106045723,
0.02081557735800743,
-0.05584578588604927,
-0.053856462240219116,
0.08507078140974045,
0.07884962111711502,
0.02119535766541958,
-0.011610426008701324,
0.021213442087173462,
0.009955668821930885,
-0.04998632147908211,
0.029279252514243126,
0.03595253452658653,
-0.017017774283885956,
-0.025662297382950783,
-0.000327503978041932,
-0.005533941555768251,
0.03689294308423996,
-0.03428873419761658,
0.025969738140702248,
0.029062233865261078,
-0.04000352323055267,
-0.044343870133161545,
0.01388910785317421,
-0.0462246872484684,
0.049009740352630615,
-0.0028212249744683504,
-0.031413257122039795,
-0.007392152212560177,
-0.013699217699468136,
0.000014782184734940529,
-0.02795906364917755,
-0.00814267061650753,
0.04112477973103523,
0.04438003897666931,
-0.007875919342041016,
0.000392213580198586,
0.0657200738787651,
-0.005814255215227604,
0.008725903928279877,
0.045465126633644104,
-0.016176830977201462,
0.01935070939362049,
0.06134355813264847,
-0.03902694582939148,
0.024703804403543472,
-0.0035988702438771725,
-0.07761985808610916,
-0.09910456836223602,
-0.05378412455320358,
-0.015010363422334194,
0.0619584396481514,
0.01895284466445446,
-0.01607736572623253,
0.04723743349313736,
0.05971593037247658,
-0.007378588430583477
]
|
36,467 | torch_pso.optim.GenerationalPSO | GenerationalPSO |
Generational PSO is a modification of the naive Particle Swarm Optimization Algorithm, where a certain percentage of
randomly-chosen, low-performing particles are re-initialized after each step.
This is a sample algorithm designed by Andrew Sansom with the sole purpose of demonstrating an example of
alternate PSO algorithms.
| class GenerationalPSO(ParticleSwarmOptimizer):
"""
Generational PSO is a modification of the naive Particle Swarm Optimization Algorithm, where a certain percentage of
randomly-chosen, low-performing particles are re-initialized after each step.
This is a sample algorithm designed by Andrew Sansom with the sole purpose of demonstrating an example of
alternate PSO algorithms.
"""
def __init__(self,
params: Iterable[torch.nn.Parameter],
inertial_weight: float = .9,
cognitive_coefficient: float = 1.,
social_coefficient: float = 1.,
num_particles: int = 100,
max_param_value: float = 10.,
min_param_value: float = -10.,
generational_turnover_ratio: float = .05,
keep_top_performers: Union[float, int] = .5):
super().__init__(params, inertial_weight, cognitive_coefficient, social_coefficient, num_particles,
max_param_value, min_param_value)
self.generational_turnover_ratio = generational_turnover_ratio
if isinstance(keep_top_performers, float):
keep_top_performers = round(num_particles*keep_top_performers)
self.keep_top_performers = keep_top_performers
if round(num_particles*generational_turnover_ratio) > num_particles-keep_top_performers:
raise ValueError(f'The generational turnover ratio is higher than the number of bottom performers. '
f'Turnover: {round(num_particles*generational_turnover_ratio)}, '
f'Bottom Performers: {num_particles-keep_top_performers}')
@torch.no_grad()
def step(self, closure: Callable[[], torch.Tensor]) -> torch.Tensor:
"""
Performs a single optimization step.
:param closure: A callable that reevaluates the model and returns the loss.
:return: the final loss after the step (as calculated by the closure)
"""
losses = {}
for i, particle in enumerate(self.particles):
particle_loss = particle.step(closure, self.best_known_global_param_groups)
losses[i] = particle_loss
if particle_loss < self.best_known_global_loss_value:
self.best_known_global_param_groups = clone_param_groups(particle.position)
self.best_known_global_loss_value = particle_loss
# set the module's parameters to be the best performing ones
for master_group, best_group in zip(self.param_groups, self.best_known_global_param_groups):
clone = clone_param_group(best_group)['params']
for i in range(len(clone)):
master_group['params'][i].data = clone[i].data
# Respawn a certain proportion of the worst performing particles, chosen at random
best_performers_indices = list(sorted(losses, key=losses.get, reverse=True))
bottom_performers = best_performers_indices[self.keep_top_performers:]
indices_to_respawn = random.sample(bottom_performers, round(self.generational_turnover_ratio * len(losses)))
for index in indices_to_respawn:
self.particles[index] = Particle(self.param_groups,
self.inertial_weight,
self.cognitive_coefficient,
self.social_coefficient,
max_param_value=self.max_param_value,
min_param_value=self.min_param_value)
return closure() # loss = closure()
| (params: Iterable[torch.nn.parameter.Parameter], inertial_weight: float = 0.9, cognitive_coefficient: float = 1.0, social_coefficient: float = 1.0, num_particles: int = 100, max_param_value: float = 10.0, min_param_value: float = -10.0, generational_turnover_ratio: float = 0.05, keep_top_performers: Union[float, int] = 0.5) | [
-0.01354048028588295,
-0.04629090800881386,
-0.06698153913021088,
0.04523884132504463,
0.012595568783581257,
0.007559289690107107,
-0.0422385036945343,
-0.021197183057665825,
-0.03974471986293793,
-0.0031756809912621975,
0.007223213091492653,
0.03549749031662941,
0.00770541001111269,
0.04106954112648964,
-0.04297884926199913,
0.034737665206193924,
0.015157544985413551,
0.02382734790444374,
-0.00035769029636867344,
-0.02121666632592678,
-0.0029613710939884186,
-0.011923415586352348,
-0.018937189131975174,
0.015177027322351933,
-0.04894055426120758,
-0.010335574857890606,
-0.034289561212062836,
0.020456841215491295,
-0.07695668935775757,
-0.013667117804288864,
0.0010240597184747458,
-0.02943836711347103,
0.015878405421972275,
0.02334028109908104,
0.03298421949148178,
-0.007213471457362175,
0.022366145625710487,
0.08806182444095612,
-0.0970238745212555,
-0.03446490690112114,
-0.025230104103684425,
-0.041731953620910645,
0.01776822656393051,
-0.021138735115528107,
-0.00957574974745512,
-0.0030953148379921913,
0.01590762846171856,
0.08400942385196686,
-0.0045297290198504925,
-0.031484052538871765,
0.0328868068754673,
-0.041576091200113297,
0.0364326573908329,
0.010335574857890606,
0.002127267885953188,
0.06815050542354584,
0.059110525995492935,
-0.00034429592778906226,
0.05840915068984032,
-0.05268123373389244,
0.08307425677776337,
-0.024158554151654243,
0.022931143641471863,
0.00848958920687437,
0.02659389190375805,
-0.006434163544327021,
-0.04710918292403221,
-0.008216830901801586,
0.004239923786371946,
0.048862624913454056,
0.06717636436223984,
-0.03427007794380188,
0.0385173074901104,
0.006234465632587671,
-0.008411657996475697,
-0.022463558241724968,
0.011582468636333942,
-0.08112598210573196,
0.03134767338633537,
-0.030354054644703865,
0.006034767720848322,
-0.028249923139810562,
-0.041926782578229904,
-0.018946930766105652,
-0.024489760398864746,
-0.060435350984334946,
-0.015644611790776253,
-0.03590662404894829,
0.004729426931589842,
-0.07824254781007767,
-0.0042691477574408054,
0.04730400815606117,
0.03452335298061371,
0.010452471673488617,
0.05794156715273857,
0.023866314440965652,
-0.019073568284511566,
-0.060045696794986725,
0.024353381246328354,
-0.060396384447813034,
0.02540544793009758,
0.06269534677267075,
-0.023301314562559128,
0.05860397592186928,
0.0635136216878891,
-0.008002521470189095,
-0.008942562155425549,
0.026515962556004524,
-0.020690632984042168,
-0.025873033329844475,
-0.05412295460700989,
0.04500504955649376,
-0.07859323173761368,
0.002656953874975443,
-0.03220491111278534,
-0.026847166940569878,
-0.0528760626912117,
0.012205914594233036,
-0.00026636512484401464,
0.029672160744667053,
0.014368494972586632,
0.0314256027340889,
-0.043251603841781616,
-0.02895130030810833,
0.006073733326047659,
-0.006599766202270985,
0.026613375172019005,
0.008158382959663868,
-0.04169299080967903,
-0.036062486469745636,
-0.02221028320491314,
-0.009264026768505573,
-0.012839103117585182,
0.006117569282650948,
-0.0037528560496866703,
-0.07419013977050781,
0.018489087000489235,
0.009385793469846249,
-0.015342630445957184,
-0.0174857284873724,
0.03329594433307648,
0.010355058126151562,
0.004334901925176382,
0.023223385214805603,
0.028834404423832893,
-0.0018898224225267768,
0.048823658376932144,
-0.016433661803603172,
0.024294933304190636,
-0.009444241411983967,
0.02195700816810131,
-0.00313915079459548,
0.009731611236929893,
0.01614142209291458,
-0.008377563208341599,
0.004831710830330849,
0.0036116065457463264,
-0.03873161971569061,
-0.06179914250969887,
-0.024236485362052917,
-0.04765469580888748,
-0.051278479397296906,
-0.011485055088996887,
-0.0020481194369494915,
-0.016998659819364548,
0.02565872296690941,
0.06440982222557068,
0.00957574974745512,
0.013774272985756397,
0.01791434735059738,
-0.0033778140787035227,
-0.033256977796554565,
0.026009410619735718,
-0.0003278573858551681,
-0.015878405421972275,
0.09679008275270462,
-0.0004992443136870861,
-0.025171654298901558,
-0.028444750234484673,
-0.024431312456727028,
-0.0033047539182007313,
-0.06717636436223984,
0.012410483323037624,
-0.1102721095085144,
-0.007549548055976629,
0.054629504680633545,
0.0496419332921505,
-0.0043154191225767136,
-0.008377563208341599,
0.02811354398727417,
-0.04091368243098259,
-0.021840112283825874,
0.011748070828616619,
0.02166476845741272,
0.016472626477479935,
0.036257315427064896,
-0.003747985465452075,
0.009916696697473526,
0.03008129633963108,
0.022190801799297333,
-0.021937526762485504,
0.06234465539455414,
0.021976491436362267,
-0.02540544793009758,
-0.031386639922857285,
0.014826338738203049,
-0.009678034111857414,
0.07235876470804214,
-0.003852705005556345,
0.0074423933401703835,
-0.04905745014548302,
-0.018391674384474754,
0.06581258028745651,
0.011835743673145771,
0.06140948832035065,
-0.04332953691482544,
0.0028176861815154552,
0.014163927175104618,
0.021742699667811394,
-0.012069535441696644,
-0.017514951527118683,
-0.017310382798314095,
-0.06292913854122162,
0.03352973610162735,
0.06596843898296356,
0.011397382244467735,
-0.014456166885793209,
-0.029828021302819252,
0.029613712802529335,
-0.017154522240161896,
0.020028220489621162,
-0.023866314440965652,
-0.016160903498530388,
-0.008231443352997303,
0.0577077716588974,
0.013949616812169552,
-0.022229766473174095,
-0.018440380692481995,
-0.054629504680633545,
-0.04165402427315712,
-0.054083988070487976,
-0.03446490690112114,
-0.02649647928774357,
-0.01191367395222187,
-0.008616226725280285,
0.03206853196024895,
0.05646087974309921,
0.029652677476406097,
0.011095400899648666,
0.04664159566164017,
0.0228921789675951,
-0.021255630999803543,
-0.04823917895555496,
0.00994105078279972,
-0.013296945951879025,
-0.060240525752305984,
0.02388579584658146,
0.0367443822324276,
0.02240511029958725,
-0.02076856419444084,
-0.030958019196987152,
-0.012215656228363514,
-0.06651395559310913,
0.04710918292403221,
-0.014387978240847588,
-0.008630838245153427,
-0.03341284021735191,
-0.01658952422440052,
-0.006424421910196543,
0.01102721132338047,
0.0867370069026947,
0.02733423560857773,
-0.026379583403468132,
-0.028912333771586418,
0.010169971734285355,
0.0037285026628524065,
-0.01590762846171856,
0.030841123312711716,
0.04469332471489906,
0.018157880753278732,
0.05607122555375099,
-0.022229766473174095,
-0.04017333686351776,
-0.026106825098395348,
-0.008031745441257954,
0.024002693593502045,
-0.01336513552814722,
-0.03091905266046524,
0.06374741345643997,
0.030899571254849434,
-0.0336855985224247,
0.006190629675984383,
0.03588714450597763,
0.00898639764636755,
0.0589936301112175,
0.045667462050914764,
-0.0004916338948532939,
0.023125970736145973,
-0.005084985867142677,
-0.03608196973800659,
0.0815935730934143,
-0.02801612950861454,
-0.027840785682201385,
-0.025541827082633972,
0.017602624371647835,
0.009517301805317402,
0.05104468762874603,
-0.04204367846250534,
0.02895130030810833,
-0.015147803351283073,
0.028620094060897827,
-0.005367485340684652,
0.049953658133745193,
0.059110525995492935,
0.021742699667811394,
-0.04769366234540939,
0.003877058392390609,
-0.06409809738397598,
0.039510928094387054,
0.05077192932367325,
-0.03125026077032089,
0.031133363023400307,
-0.007213471457362175,
0.026087341830134392,
-0.003572641173377633,
-0.0741511732339859,
0.02850319817662239,
0.025463895872235298,
-0.01935606822371483,
-0.037991274148225784,
-0.05790260061621666,
-0.04235539957880974,
-0.0018545100465416908,
0.023320797830820084,
-0.010959021747112274,
0.014748407527804375,
0.03830299898982048,
0.02462613955140114,
0.07122877240180969,
-0.03781593218445778,
0.08720459043979645,
0.008026874624192715,
-0.02363252080976963,
0.06787774711847305,
0.010510919615626335,
-0.058954667299985886,
0.05790260061621666,
0.0005990932113490999,
0.0010502395452931523,
-0.04145919531583786,
0.032126981765031815,
0.03534162789583206,
-0.009887472726404667,
0.05174606665968895,
0.07656703144311905,
0.009867990389466286,
0.009790059179067612,
0.01988210156559944,
-0.012176690623164177,
-0.0483560748398304,
0.006098086945712566,
-0.04075782001018524,
-0.008421399630606174,
0.07582668960094452,
0.024431312456727028,
0.004064579494297504,
-0.025191137567162514,
-0.03573128208518028,
0.029652677476406097,
-0.05135641247034073,
-0.02624320425093174,
-0.0686570554971695,
0.006356232799589634,
-0.01995028927922249,
-0.007856400683522224,
0.013082636520266533,
-0.027977164834737778,
0.0054308040998876095,
0.045121945440769196,
-0.02334028109908104,
0.06982601433992386,
-0.014066513627767563,
-0.007291402667760849,
0.008913337253034115,
0.01640443690121174,
-0.0027738502249121666,
0.030412502586841583,
-0.05599329620599747,
0.09554318338632584,
-0.03536111116409302,
0.030100779607892036,
0.018820293247699738,
0.05918845906853676,
0.008884113281965256,
-0.0503043457865715,
0.044537466019392014,
0.002963806502521038,
0.04683642461895943,
-0.08712665736675262,
-0.025230104103684425,
0.013306687586009502,
-0.0470702163875103,
0.005698691122233868,
0.014456166885793209,
-0.026847166940569878,
-0.11151900142431259,
0.057435013353824615,
0.054824333637952805,
0.015693319961428642,
0.11915622651576996,
-0.054083988070487976,
-0.012722206301987171,
0.00792459025979042,
-0.011114883236587048,
0.010627815499901772,
-0.06573464721441269,
-0.004914512392133474,
0.0212751142680645,
0.0354585237801075,
-0.004437186289578676,
0.02482096664607525,
0.02698354609310627,
0.07278738915920258,
0.0361209362745285,
-0.004113286267966032,
-0.029750090092420578,
-0.04278402030467987,
0.01004333421587944,
-0.035224732011556625,
-0.006224724464118481,
-0.0554477795958519,
-0.025931481271982193,
-0.03304266929626465,
-0.03481559455394745,
0.02343769371509552,
-0.023963727056980133,
0.01576150767505169,
0.030996983870863914,
0.004118156619369984,
0.021723216399550438,
0.05622708797454834,
0.03719248250126839,
0.015440043993294239,
0.02388579584658146,
0.0017510080942884088,
0.008625967428088188,
-0.018099432811141014,
-0.00873799342662096,
-0.05303192511200905,
0.005596407223492861,
0.041030578315258026,
0.027606993913650513,
0.04621297866106033,
0.005606148391962051,
0.0029857244808226824,
0.007500841747969389,
-0.035770248621702194,
-0.028620094060897827,
-0.036705415695905685,
-0.037543173879384995,
-0.0036408305168151855,
0.04488815367221832,
0.004293501377105713,
0.011095400899648666,
-0.0032024697866290808,
-0.02649647928774357,
0.0390043742954731,
-0.017310382798314095,
0.015508233569562435,
0.006877394858747721,
0.04745987057685852,
-0.0026058119256049395,
0.03052939847111702,
-0.07516427338123322,
-0.02343769371509552,
-0.02614578977227211,
-0.044186774641275406,
-0.0025083983782678843,
0.037250932306051254,
0.0030246900860220194,
0.03623783215880394,
-0.03824454918503761,
0.028366819024086,
0.03423111140727997,
-0.02063218504190445,
-0.01110514160245657,
0.004359255079180002,
0.007052739150822163,
0.019424257799983025,
0.021723216399550438,
-0.05081089586019516,
-0.05279812961816788,
0.05299295857548714,
0.03481559455394745,
-0.08852941542863846,
0.00197627698071301,
0.02328183315694332,
0.013228757306933403,
0.04944710433483124,
-0.06561774760484695,
0.02018408291041851,
0.03769903630018234,
-0.03573128208518028,
-0.03904334083199501,
0.03927713260054588,
-0.04558952897787094,
-0.016472626477479935,
0.007111187558621168,
-0.0641760304570198,
0.08494459837675095,
0.029555262997746468,
-0.06881291419267654,
0.016121938824653625,
-0.009044845588505268,
0.025269068777561188,
-0.006176017690449953,
0.009882601909339428,
0.10107627511024475,
0.01144608948379755,
-0.09094526618719101,
0.036315761506557465,
0.018878741189837456,
0.020690632984042168,
0.010335574857890606,
0.012790395878255367,
0.001725437119603157,
-0.02111925184726715,
-0.027957681566476822,
0.022931143641471863,
-0.008484718389809132,
-0.02033994346857071,
-0.0067458865232765675,
-0.01792408898472786,
0.025424931198358536,
0.026165273040533066,
-0.0120890187099576,
-0.009453983046114445,
-0.0609419010579586,
-0.02682768553495407,
-0.016677195206284523,
-0.016082972288131714,
0.0137840136885643,
0.0435243621468544,
-0.02924354001879692,
-0.0056353723630309105,
-0.002532751765102148,
0.013686600141227245,
0.02801612950861454,
-0.07216393947601318,
-0.003475227626040578,
0.0026252944953739643,
0.0063367499969899654,
-0.022073905915021896,
0.012848843820393085,
0.04543367028236389,
-0.02801612950861454,
-0.04368022456765175,
-0.014329529367387295,
0.006950455252081156,
0.08813975751399994,
-0.018323484808206558,
-0.0564219132065773,
0.02308700606226921,
-0.052213650196790695,
-0.044537466019392014,
0.02402217499911785,
-0.015352372080087662,
-0.002430467400699854,
-0.03629627823829651,
0.009570878930389881,
0.04952503740787506,
0.01762210763990879,
0.01381323765963316,
-0.04356332868337631,
-0.029029231518507004,
-0.023944245651364326,
0.025970445945858955,
-0.006755628157407045,
-0.00502166710793972,
-0.022288214415311813,
0.025541827082633972,
-0.026613375172019005,
-0.021606320515275,
-0.039803165942430496,
-0.010520661249756813,
0.053928129374980927,
-0.06530603021383286,
0.0349714569747448,
0.0628512054681778,
0.04788849130272865,
-0.01021867897361517,
0.06331878900527954,
-0.025678206235170364,
-0.05653880909085274,
-0.010023851878941059,
0.046057116240262985,
-0.012654016725718975,
0.027490098029375076,
0.021976491436362267,
0.006010414566844702,
-0.0876721739768982,
0.026360100135207176,
0.020320462062954903,
-0.028620094060897827,
0.016511593014001846,
-0.030100779607892036,
-0.01334565319120884,
0.01728115975856781,
0.04406987875699997,
0.021430976688861847,
-0.011163590475916862,
-0.01565435342490673,
0.004573564976453781,
-0.054083988070487976,
-0.01955089531838894,
0.006137052085250616,
-0.05509709194302559,
-0.020943908020853996,
0.10279075056314468,
-0.038965411484241486,
-0.025444412603974342,
0.03506886959075928,
-0.003935506567358971,
-0.02521062083542347,
-0.04543367028236389,
-0.043056778609752655,
0.03134767338633537,
-0.12087070196866989,
-0.00623933644965291,
-0.025970445945858955,
-0.039413511753082275,
-0.04461539536714554,
0.0050508915446698666,
-0.029418885707855225,
0.012011087499558926,
0.01236177608370781,
0.031776294112205505,
0.013939875178039074,
-0.01083238422870636,
-0.05291502922773361,
0.028425266966223717,
0.006687438581138849,
-0.03836144506931305,
-0.011280486360192299,
-0.03275042772293091,
-0.06199396774172783,
0.002099261386319995,
0.07239773124456406,
0.03686127811670303,
0.0005068547325208783,
0.009064328856766224,
0.02353510819375515,
-0.0359455905854702,
-0.010004369542002678,
0.013102118857204914,
-0.009497818537056446,
0.04356332868337631,
-0.010423247702419758,
0.0577077716588974,
-0.02776285447180271,
0.037640586495399475,
0.0013516126200556755,
-0.010169971734285355,
0.028931817039847374,
0.011397382244467735,
-0.037348344922065735,
-0.007340108975768089,
0.010023851878941059,
-0.001954358769580722,
0.03993954509496689,
-0.03908230736851692,
-0.061331555247306824,
-0.02131407894194126,
-0.0026691306848078966,
0.029321471229195595,
-0.0230480395257473,
-0.0072719198651611805,
-0.0023038298822939396,
-0.08245080709457397,
0.023768899962306023,
0.04788849130272865,
0.01989184133708477,
-0.033062152564525604,
-0.011660398915410042,
0.025619758293032646,
0.03602352365851402,
-0.015508233569562435,
-0.010754453018307686,
0.0025546697434037924,
-0.011777295731008053,
-0.027139408513903618,
0.026866650208830833,
0.02318441867828369,
0.02452872507274151,
0.025424931198358536,
-0.052213650196790695,
-0.049797795712947845,
-0.04368022456765175,
0.01639469712972641,
-0.03580921143293381,
-0.0042691477574408054,
-0.006424421910196543,
-0.0402902327477932,
0.007778469938784838,
-0.03947196155786514,
0.05529191717505455,
-0.01738831400871277,
-0.0009430847130715847,
0.061370521783828735,
-0.008129158988595009,
-0.011212296783924103,
0.014709442853927612,
0.03023715876042843,
0.015011424198746681,
0.008163253776729107,
-0.009780318476259708,
0.03134767338633537,
0.010715488344430923,
-0.023905279114842415,
0.0008097499376162887,
-0.029126644134521484,
-0.007413169369101524,
0.03376352787017822,
0.01518676895648241,
-0.025424931198358536,
-0.029769573360681534,
0.06269534677267075,
-0.06386430561542511,
0.03945247828960419,
-0.0019848006777465343,
0.01538159605115652,
0.027996648102998734,
-0.019872359931468964,
-0.046446770429611206,
0.0270809605717659,
-0.021840112283825874,
0.05973397567868233,
0.01504064816981554,
-0.05700639635324478,
-0.010257644578814507,
-0.022970110177993774,
0.011562985368072987,
-0.036257315427064896,
-0.0402902327477932,
0.03072422556579113,
0.03499094024300575,
0.0004149207379668951,
0.000128692394355312,
0.04636883735656738,
0.0074764881283044815,
0.06530603021383286,
0.003399732057005167,
0.03374404460191727,
0.036354728043079376,
0.0137840136885643,
-0.019531412050127983,
0.01541082002222538,
-0.013949616812169552,
-0.06624119728803635,
-0.11744174361228943,
-0.04629090800881386,
-0.04742090404033661,
0.04800538718700409,
0.03421163186430931,
0.027197856456041336,
0.010569367557764053,
0.02191804349422455,
0.0241780374199152
]
|
36,469 | torch_pso.optim.GenerationalPSO | __init__ | null | def __init__(self,
params: Iterable[torch.nn.Parameter],
inertial_weight: float = .9,
cognitive_coefficient: float = 1.,
social_coefficient: float = 1.,
num_particles: int = 100,
max_param_value: float = 10.,
min_param_value: float = -10.,
generational_turnover_ratio: float = .05,
keep_top_performers: Union[float, int] = .5):
super().__init__(params, inertial_weight, cognitive_coefficient, social_coefficient, num_particles,
max_param_value, min_param_value)
self.generational_turnover_ratio = generational_turnover_ratio
if isinstance(keep_top_performers, float):
keep_top_performers = round(num_particles*keep_top_performers)
self.keep_top_performers = keep_top_performers
if round(num_particles*generational_turnover_ratio) > num_particles-keep_top_performers:
raise ValueError(f'The generational turnover ratio is higher than the number of bottom performers. '
f'Turnover: {round(num_particles*generational_turnover_ratio)}, '
f'Bottom Performers: {num_particles-keep_top_performers}')
| (self, params: Iterable[torch.nn.parameter.Parameter], inertial_weight: float = 0.9, cognitive_coefficient: float = 1.0, social_coefficient: float = 1.0, num_particles: int = 100, max_param_value: float = 10.0, min_param_value: float = -10.0, generational_turnover_ratio: float = 0.05, keep_top_performers: Union[float, int] = 0.5) | [
-0.023207401856780052,
-0.029792265966534615,
-0.05479210987687111,
0.03588656708598137,
-0.020075345411896706,
0.013216898776590824,
-0.05547134950757027,
-0.01757536083459854,
-0.06116942688822746,
0.013490481302142143,
0.0029457362834364176,
0.09856542199850082,
-0.014999905601143837,
0.036867693066596985,
-0.04701857268810272,
0.003997616469860077,
0.03082999587059021,
0.020245155319571495,
-0.010037672705948353,
-0.019981006160378456,
-0.008565983735024929,
0.0009705128031782806,
-0.03281111642718315,
0.08422588557004929,
-0.025490406900644302,
-0.012188603170216084,
-0.02858472615480423,
0.01307538989931345,
-0.04267897829413414,
0.022056465968489647,
-0.05445249006152153,
0.0034386576153337955,
-0.015179149806499481,
0.07373538613319397,
0.026905491948127747,
0.0014457457000389695,
-0.00009964560013031587,
0.060565657913684845,
-0.13848969340324402,
0.04071672633290291,
0.005075439810752869,
-0.03781108558177948,
0.0521128810942173,
-0.021980993449687958,
-0.005556568969041109,
0.013726329430937767,
0.046414803713560104,
0.06267885118722916,
-0.01669800840318203,
-0.05471663922071457,
0.029924340546131134,
-0.027792278677225113,
0.024811165407299995,
-0.002464607125148177,
-0.0747542455792427,
0.07049012184143066,
0.07049012184143066,
0.03092433512210846,
0.025565877556800842,
-0.018414979800581932,
0.015452733263373375,
-0.037112973630428314,
0.043886516243219376,
-0.02579229138791561,
0.02360362559556961,
-0.016914987936615944,
-0.071131631731987,
-0.024509280920028687,
-0.00522638252004981,
0.05181099474430084,
0.09675411134958267,
-0.0018030547071248293,
0.020848926156759262,
0.019905535504221916,
-0.019547047093510628,
-0.004351387731730938,
-0.008665040135383606,
-0.009254658594727516,
-0.0071084462106227875,
-0.009429186582565308,
0.032075271010398865,
0.008877302519977093,
0.0047735548578202724,
-0.0327167771756649,
-0.026905491948127747,
-0.08249004930257797,
-0.03737712278962135,
-0.051358167082071304,
0.010037672705948353,
0.004174502100795507,
-0.06011283025145531,
0.04720725119113922,
0.0233017411082983,
-0.00327828130684793,
0.07728253304958344,
0.06611279398202896,
-0.00720278499647975,
-0.03966012969613075,
-0.015131981112062931,
-0.04573556408286095,
-0.013962176628410816,
0.030188489705324173,
-0.014613116160035133,
-0.011028232984244823,
0.033980920910835266,
-0.05426381155848503,
-0.02126401849091053,
-0.01062257494777441,
0.002724039601162076,
-0.017377249896526337,
-0.06784863024950027,
0.039207302033901215,
-0.07562217116355896,
0.012613128870725632,
-0.02399984933435917,
-0.0010070691350847483,
-0.03330167755484581,
-0.020075345411896706,
0.006896183360368013,
0.022131936624646187,
0.03318846970796585,
0.03954692184925079,
-0.02818850241601467,
0.019433841109275818,
-0.010481066070497036,
0.01052823569625616,
0.019528180360794067,
0.004025917965918779,
-0.02599983662366867,
-0.05030157044529915,
0.0131697291508317,
-0.0467921607196331,
-0.031962063163518906,
-0.030414903536438942,
-0.003966956399381161,
-0.06222602352499962,
0.011735775507986546,
-0.005551851820200682,
-0.0023903152905404568,
0.005679209716618061,
0.06147131323814392,
0.05366004258394241,
0.036622412502765656,
0.03988654166460037,
0.011282947845757008,
0.010009371675550938,
0.02888661064207554,
-0.017235741019248962,
-0.01290557999163866,
-0.01679234765470028,
-0.004499971866607666,
-0.006773542612791061,
-0.019962139427661896,
-0.009735788218677044,
-0.0068631647154688835,
-0.03149036690592766,
0.023075327277183533,
-0.04532046988606453,
-0.011471626348793507,
-0.020094214007258415,
-0.025697952136397362,
-0.0016096597537398338,
0.0005678030429407954,
0.015047075226902962,
-0.043509162962436676,
0.0005669186357408762,
0.008113157004117966,
-0.020282892510294914,
-0.026641342788934708,
0.005287702661007643,
-0.007476368453353643,
-0.07079201191663742,
0.008768812753260136,
0.002069562440738082,
-0.004952799063175917,
0.04992421716451645,
0.005650908220559359,
-0.025396067649126053,
-0.016764046624302864,
0.013462180271744728,
0.024754561483860016,
-0.06679203361272812,
0.036433733999729156,
-0.1089804470539093,
0.03962239250540733,
0.029905473813414574,
0.046263862401247025,
0.03401865437626839,
-0.030490374192595482,
0.0239621140062809,
0.027830014005303383,
-0.009183905087411404,
0.0011155590182170272,
0.01287727802991867,
0.009315979667007923,
0.018782900646328926,
0.05426381155848503,
0.0023502211552113295,
-0.016745178028941154,
0.0475468710064888,
0.0005285933730192482,
0.015075377188622952,
0.0131697291508317,
-0.053358156234025955,
0.0010837196605280042,
0.019179124385118484,
-0.01172634121030569,
0.044037461280822754,
0.030188489705324173,
-0.018320640549063683,
-0.03805636614561081,
-0.012707467190921307,
0.05920717492699623,
0.009858428500592709,
0.004900912754237652,
-0.07354670763015747,
-0.026754548773169518,
-0.013216898776590824,
0.017943283542990685,
-0.03409412503242493,
0.06924484670162201,
-0.010830121114850044,
-0.017113100737333298,
-0.0015813580248504877,
0.05520720034837723,
0.022396085783839226,
0.012547091580927372,
-0.04249029979109764,
-0.030207358300685883,
0.01913195475935936,
0.016669707372784615,
-0.04437708109617233,
-0.014537644572556019,
0.026565872132778168,
0.017377249896526337,
0.03824504464864731,
-0.04818837717175484,
0.0009286498534493148,
-0.09713146835565567,
-0.0035943170078098774,
-0.02839604765176773,
0.013537650927901268,
-0.009254658594727516,
0.014858397655189037,
-0.013216898776590824,
-0.0012452752562239766,
0.025226257741451263,
0.04479217156767845,
-0.027339451014995575,
0.03360356390476227,
0.025018710643053055,
-0.022490425035357475,
-0.04550914838910103,
-0.003061301540583372,
-0.00826409924775362,
-0.025301728397607803,
-0.0022924384102225304,
-0.012839541770517826,
0.0016910271951928735,
-0.014981037937104702,
-0.046188391745090485,
-0.008136741816997528,
-0.0263394583016634,
0.08316928893327713,
0.002863189671188593,
-0.012131999246776104,
-0.053282685577869415,
0.027377186343073845,
-0.055961914360523224,
0.017339514568448067,
0.07033918052911758,
0.014915000647306442,
0.019660254940390587,
-0.016056504100561142,
0.008155609481036663,
-0.027490394189953804,
-0.01932063326239586,
-0.012679166160523891,
-0.03737712278962135,
0.04275444895029068,
0.029509248211979866,
-0.03628279268741608,
-0.00958484597504139,
-0.026924360543489456,
0.02120741456747055,
-0.002613191260024905,
0.023282872512936592,
0.0020931472536176443,
-0.0033702619839459658,
0.018707429990172386,
-0.04256577044725418,
0.007075427565723658,
0.03833938390016556,
0.009315979667007923,
0.05252797156572342,
-0.034509219229221344,
0.018339507281780243,
0.024113057181239128,
0.034811101853847504,
-0.0074999528005719185,
0.08430135995149612,
-0.06886748969554901,
-0.005669775884598494,
-0.029792265966534615,
-0.006028264295309782,
0.0018101301975548267,
0.029848869889974594,
-0.0010589556768536568,
0.01782064326107502,
0.018537620082497597,
0.05407513305544853,
0.04528273642063141,
0.04343368858098984,
0.029792265966534615,
0.027848882600665092,
-0.03824504464864731,
0.025339463725686073,
-0.041094083338975906,
0.04803743585944176,
0.05426381155848503,
-0.0013242841232568026,
0.02122628130018711,
-0.011764077469706535,
0.01753762550652027,
-0.04018842801451683,
-0.07977308332920074,
0.01667914167046547,
0.034433744847774506,
-0.04486764222383499,
-0.02132062055170536,
-0.05607512220740318,
0.009646166115999222,
0.0029929056763648987,
-0.007264105603098869,
-0.034263934940099716,
0.0621882900595665,
0.02835831232368946,
0.07781083136796951,
0.0471695140004158,
-0.02413192391395569,
0.07833912968635559,
-0.01922629401087761,
-0.005608455277979374,
0.06403733789920807,
-0.02154703438282013,
-0.0330941304564476,
0.04728272184729576,
0.005245250184088945,
0.01765083335340023,
-0.04833931848406792,
-0.025094183161854744,
0.017603663727641106,
0.03416959568858147,
0.061244897544384,
0.07090521603822708,
0.015575374476611614,
-0.017207439988851547,
-0.020716851577162743,
-0.00039357063360512257,
-0.02373570017516613,
0.030339432880282402,
-0.0466034822165966,
-0.003971673082560301,
0.05992415174841881,
0.007113162893801928,
0.011933887377381325,
-0.001149756950326264,
-0.03969786316156387,
0.034811101853847504,
-0.013688593171536922,
-0.023113062605261803,
-0.07698065042495728,
-0.020584776997566223,
0.0036179018206894398,
0.032320551574230194,
0.011235778219997883,
-0.08279193192720413,
0.025075314566493034,
0.03560354933142662,
-0.017009327188134193,
0.020131949335336685,
-0.010358425788581371,
0.03360356390476227,
0.015348960645496845,
-0.020735718309879303,
-0.0008903245907276869,
0.032056402415037155,
-0.02849038690328598,
0.06856560707092285,
-0.010028239339590073,
0.03566015511751175,
0.01622631400823593,
0.022830044850707054,
-0.03284884989261627,
-0.05264117941260338,
0.036962032318115234,
0.07894290238618851,
0.029886605218052864,
-0.05505625903606415,
-0.034999780356884,
0.00830183457583189,
-0.07422594726085663,
0.012537657283246517,
0.0285281240940094,
-0.020207419991493225,
-0.04486764222383499,
0.051018547266721725,
0.0608675442636013,
0.022792309522628784,
0.023113062605261803,
-0.0378488190472126,
-0.026603607460856438,
-0.02337721176445484,
0.018971579149365425,
-0.013518783263862133,
-0.04286765679717064,
-0.0027476241812109947,
-0.013924441300332546,
0.013764064759016037,
-0.01652819849550724,
0.06460336595773697,
0.01085842214524746,
0.050980813801288605,
0.0467921607196331,
0.020679116249084473,
0.014348967000842094,
-0.019773460924625397,
-0.0006521185277961195,
0.0074810851365327835,
-0.05162231996655464,
-0.07743347436189651,
-0.026811152696609497,
-0.012962182983756065,
-0.025207389146089554,
0.036886561661958694,
-0.010952761396765709,
-0.01553763821721077,
0.03981107100844383,
-0.01763196475803852,
-0.003082527779042721,
0.037131842225790024,
-0.011764077469706535,
0.029848869889974594,
-0.010669744573533535,
-0.0060376981273293495,
0.0029292269609868526,
-0.003412714460864663,
0.0073584443889558315,
-0.06856560707092285,
-0.02107533998787403,
0.027886617928743362,
0.0020872510503977537,
0.046528011560440063,
-0.020565908402204514,
-0.0027782844845205545,
-0.008679190650582314,
-0.04332048445940018,
-0.010160313919186592,
0.03492430970072746,
-0.02632058970630169,
0.05067892745137215,
0.034471482038497925,
-0.004952799063175917,
-0.0014127270551398396,
-0.03977333754301071,
0.008532965555787086,
0.04275444895029068,
-0.03360356390476227,
-0.010348991490900517,
0.013896139338612556,
0.05060345679521561,
0.016726309433579445,
0.020320627838373184,
-0.0661882609128952,
-0.01858478970825672,
0.00720278499647975,
0.01679234765470028,
0.008334853686392307,
0.008334853686392307,
-0.002620266517624259,
0.008150892332196236,
-0.03360356390476227,
0.029150761663913727,
0.03107527643442154,
-0.026641342788934708,
-0.027320584282279015,
-0.07939572632312775,
0.0061980742029845715,
0.00536317378282547,
0.017292344942688942,
-0.06230149790644646,
0.0015589524991810322,
0.03135829418897629,
0.05150911211967468,
-0.04332048445940018,
0.012575392611324787,
0.03535826876759529,
-0.0010265265591442585,
0.039395980536937714,
-0.010292388498783112,
-0.0006126140942797065,
0.027716808021068573,
-0.02162250690162182,
-0.010462198406457901,
0.015962164849042892,
-0.016499897465109825,
0.002340787323191762,
0.017848944291472435,
-0.03756580129265785,
0.05298079922795296,
0.034528084099292755,
-0.041094083338975906,
-0.02133948914706707,
0.024339471012353897,
-0.013613122515380383,
-0.04777328670024872,
-0.029509248211979866,
0.060339245945215225,
0.009179187938570976,
-0.06018830090761185,
0.0815843939781189,
0.05298079922795296,
0.021754581481218338,
-0.013641423545777798,
0.03605637699365616,
-0.004919780418276787,
-0.008075420744717121,
-0.07071653753519058,
0.03149036690592766,
0.018433846533298492,
-0.016499897465109825,
-0.03520732745528221,
-0.04954686015844345,
0.05547134950757027,
-0.0029480946250259876,
0.008830133825540543,
-0.005146194249391556,
-0.008891453966498375,
-0.01763196475803852,
-0.022245144471526146,
-0.012207470834255219,
0.003082527779042721,
0.04475443810224533,
-0.031735651195049286,
0.0386035330593586,
-0.015226319432258606,
-0.03177338466048241,
0.07298067212104797,
-0.04705630987882614,
0.004900912754237652,
-0.014735756441950798,
-0.004962232895195484,
-0.08626361191272736,
-0.029546985402703285,
0.05494305118918419,
0.022113069891929626,
-0.022358350455760956,
-0.04966006800532341,
0.01168860588222742,
0.09056547284126282,
0.015698015689849854,
-0.02845265157520771,
0.020754586905241013,
-0.004608461633324623,
-0.03737712278962135,
-0.0019233369966968894,
-0.00965088326483965,
0.02118854597210884,
-0.06113169342279434,
0.004900912754237652,
0.030339432880282402,
0.02649039961397648,
-0.03086773119866848,
0.041660115122795105,
-0.0189244095236063,
-0.03541487082839012,
0.022773442789912224,
0.017235741019248962,
0.0029669625218957663,
-0.03364129737019539,
0.02386777475476265,
0.0023938529193401337,
-0.0035872417502105236,
-0.038980886340141296,
0.02639606036245823,
0.07392406463623047,
-0.07218822836875916,
0.03871673718094826,
0.013886705040931702,
-0.002344324951991439,
0.0032995075453072786,
0.04328274726867676,
-0.028131898492574692,
-0.016009334474802017,
-0.024924371391534805,
0.027697939425706863,
-0.024924371391534805,
0.009391450323164463,
0.04037710651755333,
0.013452745974063873,
-0.08799944818019867,
0.019603651016950607,
-0.0036556373815983534,
0.010198049247264862,
0.010415028780698776,
-0.05701851099729538,
-0.016424424946308136,
0.04098087549209595,
0.005344306118786335,
0.012264073826372623,
0.03824504464864731,
0.00011077465751441196,
-0.02590549737215042,
-0.058112844824790955,
-0.033980920910835266,
-0.02398098260164261,
-0.060226038098335266,
0.010339558124542236,
0.0990937203168869,
-0.019603651016950607,
-0.029660191386938095,
0.013735762797296047,
-0.012131999246776104,
0.03066018596291542,
-0.07294294238090515,
-0.03605637699365616,
0.0014764058869332075,
-0.1378859281539917,
0.012962182983756065,
0.01320746447890997,
0.03486770763993263,
-0.036980900913476944,
-0.00591034023091197,
-0.003924503922462463,
-0.024773430079221725,
-0.004044786095619202,
0.039395980536937714,
0.000525645271409303,
0.01898101344704628,
-0.039282772690057755,
0.025660216808319092,
0.034509219229221344,
-0.04932044446468353,
-0.014575380831956863,
-0.024735694751143456,
-0.07139577716588974,
-0.018509317189455032,
0.036584675312042236,
0.05264117941260338,
0.003398563712835312,
0.017830077558755875,
0.05845246464014053,
-0.0071084462106227875,
0.006481091491878033,
0.0005020605167374015,
-0.036433733999729156,
0.018933843821287155,
0.048226114362478256,
0.060905277729034424,
-0.0035259213764220476,
-0.01195275504142046,
-0.000024561313693993725,
0.03520732745528221,
0.0165470652282238,
0.03279224783182144,
-0.0040518613532185555,
-0.039320509880781174,
-0.017433853819966316,
-0.04558461904525757,
0.010698046535253525,
-0.04245256260037422,
-0.03573562577366829,
-0.036471471190452576,
-0.013462180271744728,
0.043999724090099335,
-0.0023667304776608944,
-0.055660028010606766,
0.005155628081411123,
-0.03284884989261627,
0.012424450367689133,
0.06396186351776123,
0.017188571393489838,
-0.03811296820640564,
0.012301810085773468,
0.029905473813414574,
-0.00054628198267892,
-0.07260331511497498,
0.015414997935295105,
-0.02590549737215042,
-0.013565952889621258,
-0.025565877556800842,
-0.01062257494777441,
-0.002142675220966339,
0.005084873642772436,
0.04067898914217949,
-0.04256577044725418,
-0.09750882536172867,
-0.04362236708402634,
0.008320702239871025,
-0.004129691049456596,
-0.012254640460014343,
0.008320702239871025,
-0.0852070152759552,
0.07335802912712097,
-0.05166005343198776,
0.0361318476498127,
0.02354702167212963,
-0.013981044292449951,
0.05426381155848503,
-0.053358156234025955,
0.0015412638895213604,
0.03545260801911354,
0.0061603388749063015,
-0.0359431728720665,
-0.03047150745987892,
0.06826372444629669,
0.07788630574941635,
0.029848869889974594,
-0.04018842801451683,
-0.022018730640411377,
-0.0005557158729061484,
-0.0213017538189888,
0.04954686015844345,
0.018443280830979347,
0.020471569150686264,
-0.022169671952724457,
0.06607505679130554,
-0.02128288522362709,
0.046414803713560104,
-0.017905548214912415,
0.024452676996588707,
0.020471569150686264,
-0.05505625903606415,
-0.04056578502058983,
0.04490537941455841,
-0.025679083541035652,
0.058226048946380615,
-0.0005386169068515301,
-0.015424431301653385,
0.0033419602550566196,
-0.03094320185482502,
-0.004731102380901575,
-0.022377219051122665,
-0.041245024651288986,
0.017235741019248962,
0.051169492304325104,
-0.0053348722867667675,
-0.03590543568134308,
0.08573531359434128,
-0.016330085694789886,
0.028943214565515518,
0.01819799840450287,
0.032169610261917114,
-0.006561279762536287,
0.07392406463623047,
-0.029358306899666786,
0.018952710554003716,
-0.0131697291508317,
-0.07562217116355896,
-0.11599927395582199,
-0.04762234166264534,
-0.027792278677225113,
0.058301523327827454,
0.001682772533968091,
0.0013502273941412568,
0.051395904272794724,
0.06558449566364288,
-0.00003049435508728493
]
|
36,489 | torch_pso.optim.GenericPSO | GenericPSO | null | class GenericPSO(Optimizer):
def __init__(self, params: Iterable[torch.nn.Parameter], num_particles: int, particle_class: Type[GenericParticle],
particle_args: Optional[List] = None, particle_kwargs: Optional[Dict] = None):
defaults = {}
super().__init__(params, defaults)
if particle_args is None:
particle_args = []
if particle_kwargs is None:
particle_kwargs = {}
self.particles = [particle_class(self.param_groups, *particle_args, **particle_kwargs)
for _ in range(num_particles)]
self.best_known_global_param_groups = clone_param_groups(self.param_groups)
self.best_known_global_loss_value = torch.inf
@torch.no_grad()
def step(self, closure: Callable[[], torch.Tensor], particle_step_kwargs: Optional[Dict] = None) -> torch.Tensor:
"""
Performs a single optimization step.
:param particle_step_kwargs: Dict of keyword arguments to pass to the particle step function, if needed.
:param closure: A callable that reevaluates the model and returns the loss.
:return: the final loss after the step (as calculated by the closure)
"""
if particle_step_kwargs is None:
particle_step_kwargs = {}
for particle in self.particles:
particle_loss = particle.step(closure, self.best_known_global_param_groups, **particle_step_kwargs)
if particle_loss < self.best_known_global_loss_value:
self.best_known_global_param_groups = clone_param_groups(particle.position)
self.best_known_global_loss_value = particle_loss
# set the module's parameters to be the best performing ones
for master_group, best_group in zip(self.param_groups, self.best_known_global_param_groups):
clone = clone_param_group(best_group)['params']
for i in range(len(clone)):
master_group['params'][i].data = clone[i].data
return closure() # loss = closure()
subclasses = []
def __init_subclass__(cls, **kwargs):
super().__init_subclass__(**kwargs)
cls.subclasses.append(cls)
| (params: Iterable[torch.nn.parameter.Parameter], num_particles: int, particle_class: Type[torch_pso.optim.GenericPSO.GenericParticle], particle_args: Optional[List] = None, particle_kwargs: Optional[Dict] = None) | [
-0.03926391527056694,
-0.05866891145706177,
-0.046034857630729675,
0.047510091215372086,
-0.0004613060737028718,
0.008260363712906837,
-0.05280580371618271,
-0.04838010296225548,
-0.021844808012247086,
-0.025060061365365982,
0.0029481034725904465,
0.008293461985886097,
-0.02681899257004261,
0.00998619757592678,
-0.04985533654689789,
0.026724426075816154,
-0.020180441439151764,
0.009248580783605576,
0.009262765757739544,
-0.016095178201794624,
-0.0005898571107536554,
0.0051207635551691055,
-0.012615139596164227,
-0.024473749101161957,
-0.028842711821198463,
-0.018771404400467873,
0.015508867800235748,
-0.004009609576314688,
-0.05344885215163231,
-0.04599703103303909,
-0.003751916578039527,
-0.018166180700063705,
-0.005574681330472231,
0.03372232988476753,
0.027405304834246635,
-0.0265163816511631,
-0.006756759714335203,
0.09456626325845718,
-0.09222102165222168,
0.012492204084992409,
-0.04970403015613556,
-0.06740683317184448,
-0.0152913648635149,
-0.012690792791545391,
0.0055841379798948765,
-0.007503833156079054,
0.0005348904523998499,
0.060446757823228836,
-0.008260363712906837,
-0.04123089089989662,
0.01446863915771246,
-0.052730150520801544,
0.041798289865255356,
-0.008284005336463451,
0.01242600753903389,
0.062073297798633575,
0.0628676563501358,
-0.013683739118278027,
0.02941010892391205,
-0.016605837270617485,
0.060446757823228836,
-0.017220517620444298,
0.011035882867872715,
-0.004042707849293947,
0.015111689455807209,
-0.04951489716768265,
-0.060257624834775925,
-0.00797666423022747,
0.007631497923284769,
0.05522669851779938,
0.01710703782737255,
-0.058139339089393616,
0.0500444695353508,
0.0013168352888897061,
0.0020296284928917885,
-0.03381689637899399,
0.009158742614090443,
-0.08601747453212738,
0.049325764179229736,
-0.024473749101161957,
-0.022166332229971886,
-0.05394059792160988,
-0.056966718286275864,
-0.017485301941633224,
-0.04993098974227905,
-0.051935791969299316,
-0.009555920958518982,
-0.05212492495775223,
0.027272911742329597,
-0.0618085116147995,
-0.018790317699313164,
0.03880999609827995,
0.019840002059936523,
0.022809384390711784,
0.0369943231344223,
0.03075294941663742,
-0.025551805272698402,
-0.058933697640895844,
-0.008274548687040806,
-0.0588202178478241,
0.03306036815047264,
0.04058784246444702,
-0.0038984944112598896,
0.04830444976687431,
0.06653682887554169,
-0.01862955465912819,
0.008988523855805397,
0.02273373119533062,
-0.006657465361058712,
-0.0017045569838955998,
-0.02057761885225773,
0.0312257818877697,
-0.07830087095499039,
0.005177502986043692,
-0.039150435477495193,
-0.008931783959269524,
-0.04251699522137642,
0.0018842328572645783,
-0.030204465612769127,
0.006761488039046526,
-0.005877293646335602,
0.040171749889850616,
-0.04841792955994606,
0.01078055426478386,
-0.011262842454016209,
0.008931783959269524,
0.05170883610844612,
0.01242600753903389,
-0.03790216147899628,
-0.056172363460063934,
-0.02076675184071064,
-0.009073633700609207,
-0.009385702200233936,
0.02778356894850731,
0.0021525647025555372,
-0.04361396282911301,
-0.012047742493450642,
0.023357868194580078,
-0.0444839708507061,
-0.031320348381996155,
0.024398095905780792,
0.004747226368635893,
-0.010515769012272358,
0.011631650850176811,
0.045051369816064835,
-0.008057045750319958,
0.03544343635439873,
-0.01088457740843296,
0.013825587928295135,
-0.035216476768255234,
-0.018251288682222366,
0.017693348228931427,
0.0049458155408501625,
0.01920640841126442,
-0.03487603738903999,
0.003274356946349144,
-0.005598322954028845,
-0.03644583746790886,
-0.06910903006792068,
-0.006217732094228268,
-0.059917185455560684,
-0.05375146493315697,
-0.010704901069402695,
-0.03160404786467552,
-0.02470070868730545,
-0.0074092671275138855,
0.029069669544696808,
-0.0152913648635149,
0.0029575598891824484,
0.029561415314674377,
-0.011886979453265667,
-0.059311963617801666,
0.07852783054113388,
0.0312257818877697,
-0.0010715540265664458,
0.10772988945245743,
0.015924958512187004,
-0.02617594227194786,
-0.008047589100897312,
-0.01685170829296112,
0.022563511505723,
-0.04285743087530136,
-0.022147418931126595,
-0.07523692399263382,
-0.007210677955299616,
0.05136839672923088,
0.02859683893620968,
-0.012132852338254452,
-0.022695904597640038,
0.030053159222006798,
-0.02290394902229309,
-0.000702154531609267,
-0.012161222286522388,
0.008581888861954212,
0.025476152077317238,
0.044559624046087265,
0.009631574153900146,
0.027443131431937218,
0.03445994853973389,
0.07682563364505768,
-0.04153350368142128,
0.05556713789701462,
0.0213908888399601,
0.02437918446958065,
-0.05692889168858528,
0.02500332146883011,
0.036861930042505264,
0.08616878092288971,
-0.04187394306063652,
-0.011953175999224186,
-0.03219035640358925,
-0.002094642724841833,
0.047812703996896744,
0.04168481007218361,
0.05832847207784653,
0.006865511182695627,
-0.017201604321599007,
0.02880488522350788,
0.02173132821917534,
0.016889534890651703,
-0.00980652216821909,
-0.0500444695353508,
-0.03088534250855446,
0.043235696852207184,
0.09063231199979782,
-0.008430582471191883,
0.013995807617902756,
-0.03941522166132927,
0.03642692416906357,
-0.024738535284996033,
0.005082936957478523,
-0.034573428332805634,
-0.0019397905562072992,
0.016237027943134308,
0.07308080792427063,
0.029977506026625633,
-0.0032530794851481915,
-0.019168581813573837,
-0.048682715743780136,
-0.02061544544994831,
-0.05151970311999321,
-0.04826662316918373,
-0.0705842599272728,
-0.022563511505723,
-0.023168735206127167,
0.02468179538846016,
0.05719367787241936,
0.04459745064377785,
0.03071512281894684,
0.04142002388834953,
0.024322444573044777,
0.0031183226965367794,
-0.06317026913166046,
0.028729232028126717,
-0.02976946160197258,
-0.014175483025610447,
0.0213908888399601,
0.0037802865263074636,
-0.012577312998473644,
-0.029353369027376175,
-0.06786075234413147,
-0.016501814126968384,
-0.056361496448516846,
0.048190969973802567,
-0.00605696951970458,
-0.015253539197146893,
0.0009107913356274366,
-0.021182844415307045,
0.016028981655836105,
0.029655981808900833,
0.10016459226608276,
0.06388896703720093,
-0.014856360852718353,
-0.007333613932132721,
0.010960230603814125,
0.016728771850466728,
-0.018913254141807556,
0.03497060388326645,
0.05314624309539795,
-0.014241679571568966,
0.06317026913166046,
-0.01601952500641346,
-0.04206307604908943,
-0.058139339089393616,
-0.029145322740077972,
0.019423911347985268,
0.004562822170555592,
-0.01997239515185356,
0.04043653607368469,
0.016861164942383766,
-0.012217961251735687,
0.01907401531934738,
0.04754791781306267,
0.012728619389235973,
0.06252721697092056,
0.030525991693139076,
-0.0543188638985157,
0.04251699522137642,
0.008761564269661903,
-0.05492408946156502,
0.05564279109239578,
-0.031793177127838135,
-0.03432755544781685,
-0.03691866993904114,
0.014166026376187801,
-0.01776900142431259,
0.053713638335466385,
-0.02799161523580551,
0.040171749889850616,
-0.007376168854534626,
0.0474722646176815,
-0.0003558055905159563,
0.029031842947006226,
0.049287937581539154,
0.023111995309591293,
-0.021353062242269516,
-0.005248427856713533,
-0.06494811177253723,
0.023471347987651825,
0.06978990137577057,
-0.02536267228424549,
0.047207482159137726,
0.00499309878796339,
0.002756606787443161,
0.003144328249618411,
-0.0342140756547451,
0.009768695570528507,
-0.0055037569254636765,
-0.02532484568655491,
-0.04104175791144371,
-0.02519245259463787,
-0.00896015390753746,
0.020180441439151764,
0.010128047317266464,
-0.02761334925889969,
0.007953022606670856,
0.06033327803015709,
0.046034857630729675,
0.03937739506363869,
-0.040171749889850616,
0.05972805246710777,
0.04792618378996849,
-0.008416397497057915,
0.0789060965180397,
-0.005655062850564718,
-0.05704237148165703,
0.014988753013312817,
-0.008780477568507195,
0.02453048899769783,
-0.005418647080659866,
0.014619944617152214,
0.012378724291920662,
-0.006402136292308569,
0.009111459366977215,
0.07610692828893661,
0.0015449763741344213,
0.015858763828873634,
-0.00016416113066952676,
-0.023017428815364838,
-0.06052241101861,
0.03968000411987305,
-0.029239889234304428,
-0.009787608869373798,
0.06717987358570099,
0.059614572674036026,
0.0007399810128845274,
0.005830010399222374,
-0.039831310510635376,
0.011631650850176811,
-0.035386696457862854,
-0.03676736354827881,
-0.04648877680301666,
0.03440320864319801,
-0.0177500881254673,
-0.025589631870388985,
-0.0008676454890519381,
-0.006194090470671654,
-0.008388027548789978,
0.022790471091866493,
-0.020369574427604675,
0.08314266055822372,
-0.023130908608436584,
0.0033405532594770193,
0.006099523976445198,
0.02782139554619789,
-0.01079946756362915,
0.03160404786467552,
-0.01552778109908104,
0.09055665880441666,
-0.004846521187573671,
0.03629453480243683,
-0.00012219735071994364,
0.01689899154007435,
-0.023830698803067207,
-0.04993098974227905,
0.014241679571568966,
-0.011376322247087955,
0.05972805246710777,
-0.09320451319217682,
-0.04039870947599411,
-0.01766497828066349,
-0.06305678933858871,
0.0355001762509346,
0.019840002059936523,
-0.0036904485896229744,
-0.1011480763554573,
0.048796191811561584,
0.04251699522137642,
0.018364768475294113,
0.11529519408941269,
-0.046867042779922485,
0.037183456122875214,
0.013712109066545963,
0.029542502015829086,
0.012690792791545391,
-0.03222818300127983,
0.02799161523580551,
0.021617848426103592,
0.010496855713427067,
0.02944793552160263,
0.025457238778471947,
0.03512191027402878,
0.04906097799539566,
0.0021431080531328917,
0.0035036802291870117,
-0.0268379058688879,
-0.04206307604908943,
-0.0013783033937215805,
-0.029523588716983795,
-0.009404615499079227,
-0.061732858419418335,
-0.030166639015078545,
-0.059765879064798355,
-0.03493277728557587,
0.005097121931612492,
-0.03205796331167221,
0.008657542057335377,
0.028256399556994438,
0.009787608869373798,
0.040814802050590515,
0.03402494266629219,
0.037713028490543365,
0.008293461985886097,
0.043235696852207184,
-0.00026183034060522914,
-0.006350124720484018,
-0.020804578438401222,
0.0056928894482553005,
-0.07898174226284027,
-0.0037093618884682655,
0.04073914885520935,
0.015168429352343082,
0.06339722871780396,
0.006789857987314463,
0.03056381829082966,
-0.01200991589576006,
-0.041268717497587204,
-0.04860706254839897,
-0.030469251796603203,
-0.01948065124452114,
-0.021466542035341263,
0.05545365810394287,
0.025627458468079567,
-0.03162296116352081,
-0.012709706090390682,
-0.041306544095277786,
0.0474722646176815,
-0.013740478083491325,
0.007636226247996092,
-0.01657746732234955,
0.04039870947599411,
-0.00003612726868595928,
-0.0010727361077442765,
-0.04247916862368584,
-0.04546746239066124,
0.014969839714467525,
-0.016435617581009865,
0.009503909386694431,
0.034100595861673355,
-0.02029392123222351,
0.07436691224575043,
-0.031301435083150864,
0.03502734377980232,
0.02286612242460251,
-0.0009143375791609287,
0.032625362277030945,
0.034441035240888596,
0.028350966051220894,
0.000026929221348837018,
0.05969022586941719,
-0.029372282326221466,
-0.03124469518661499,
0.050611864775419235,
0.025476152077317238,
-0.05522669851779938,
0.009201297536492348,
0.01883760094642639,
0.03809129074215889,
0.05904717743396759,
-0.04104175791144371,
0.027518782764673233,
0.013948524370789528,
-0.03873434290289879,
-0.03010989911854267,
0.04463527724146843,
-0.04134437069296837,
-0.025608545169234276,
0.03642692416906357,
-0.06687726080417633,
0.07739303261041641,
-0.0010018113534897566,
-0.026554208248853683,
0.02025609463453293,
0.0035438707564026117,
0.035216476768255234,
-0.015906045213341713,
0.025551805272698402,
0.07814956456422806,
0.0025698381941765547,
-0.06547768414020538,
0.02975054830312729,
0.008260363712906837,
-0.003988332115113735,
0.0011619830038398504,
0.01837422512471676,
0.0023818877525627613,
-0.010506312362849712,
-0.011404692195355892,
0.05008229613304138,
-0.02076675184071064,
-0.005366635508835316,
-0.013825587928295135,
-0.024568315595388412,
0.022336551919579506,
0.021806981414556503,
-0.010146960616111755,
0.014194396324455738,
-0.032625362277030945,
-0.012208504602313042,
-0.01685170829296112,
0.0008652813266962767,
0.022620251402258873,
0.04902315139770508,
0.0008599619613960385,
0.007328885607421398,
-0.0015296093188226223,
0.02078566513955593,
0.04104175791144371,
-0.07822521775960922,
0.012047742493450642,
0.0014267686055973172,
-0.005395005457103252,
-0.030053159222006798,
0.02613811567425728,
0.02878597192466259,
-0.024587228894233704,
-0.045845724642276764,
0.01007130742073059,
-0.014979296363890171,
0.09101057797670364,
-0.02515462599694729,
-0.0327199287712574,
0.05363798514008522,
-0.017523128539323807,
-0.0361432284116745,
0.012397637590765953,
0.005016740411520004,
0.007877370342612267,
-0.042554821819067,
0.01079946756362915,
0.040663495659828186,
0.017456931993365288,
-0.04232786223292351,
-0.044219184666872025,
-0.01578311063349247,
0.016605837270617485,
0.02453048899769783,
-0.010440115816891193,
-0.03483821079134941,
-0.02324438840150833,
0.007262689061462879,
-0.009437713772058487,
-0.01121555920690298,
-0.0042933085933327675,
0.011745130643248558,
0.034611254930496216,
-0.04055001586675644,
0.024625055491924286,
0.03725910931825638,
0.047358784824609756,
0.006496702320873737,
0.047850530594587326,
-0.025589631870388985,
-0.048985324800014496,
-0.0008357293554581702,
0.02222307212650776,
-0.0519736185669899,
-0.0006229552673175931,
0.01766497828066349,
-0.0018511347007006407,
-0.10916730016469955,
0.012350354343652725,
0.0289751049131155,
-0.01227470114827156,
0.0031466924119740725,
-0.05787455663084984,
-0.02842661924660206,
0.02173132821917534,
0.022601338103413582,
-0.017740631476044655,
-0.00008695663564139977,
-0.001027817139402032,
0.027064865455031395,
-0.02551397867500782,
-0.05337320268154144,
-0.000269218347966671,
-0.05027142912149429,
0.003104137722402811,
0.10198026150465012,
-0.04614833742380142,
-0.045883551239967346,
0.017333997413516045,
-0.01612354815006256,
-0.02239329181611538,
-0.04316004365682602,
-0.01421330962330103,
0.038185857236385345,
-0.1255083531141281,
0.010279352776706219,
-0.006600725464522839,
-0.06615856289863586,
-0.011338495649397373,
0.007097198162227869,
-0.01875249110162258,
0.019423911347985268,
-0.03805346414446831,
0.012473290786147118,
0.03510299697518349,
-0.03300362825393677,
-0.04698052257299423,
0.006964805535972118,
0.019518477842211723,
-0.003827569540590048,
-0.0038488470017910004,
-0.008974338881671429,
-0.05802586302161217,
0.003948141820728779,
0.06729335337877274,
0.06683943420648575,
0.009447170421481133,
0.013844501227140427,
0.052427537739276886,
-0.036218881607055664,
0.016634207218885422,
0.03355211019515991,
0.01839313842356205,
0.05919848382472992,
-0.02859683893620968,
0.06657464802265167,
-0.022658077999949455,
0.017485301941633224,
-0.020728925243020058,
0.01071435771882534,
0.02483310177922249,
-0.026365075260400772,
-0.039188262075185776,
-0.03945304825901985,
-0.028540099039673805,
0.024908754974603653,
0.017617695033550262,
-0.03822368383407593,
-0.02978837490081787,
-0.04350048303604126,
0.010648161172866821,
0.02286612242460251,
-0.0340060293674469,
0.03650257736444473,
-0.039339568465948105,
-0.09237232804298401,
0.002591115655377507,
0.04221438243985176,
0.01813781075179577,
-0.018099984154105186,
-0.007839543744921684,
0.015480497851967812,
0.024303531274199486,
-0.02581659145653248,
-0.0002245948853669688,
0.0029197335243225098,
-0.016870621591806412,
-0.017523128539323807,
0.03028011880815029,
0.03468690812587738,
0.001747111789882183,
0.026913559064269066,
-0.07047078013420105,
-0.03568930923938751,
-0.06665030121803284,
0.01200991589576006,
-0.042554821819067,
-0.019594131037592888,
-0.03056381829082966,
-0.0575341172516346,
0.006595997139811516,
0.009976740926504135,
0.05575627088546753,
-0.01807161420583725,
-0.02842661924660206,
0.0611654594540596,
-0.015234625898301601,
0.001193308038637042,
0.007380897179245949,
0.04119306430220604,
0.007697694003582001,
-0.001019542571157217,
0.005617236252874136,
0.023755045607686043,
0.01895108073949814,
-0.03385472297668457,
0.008893957361578941,
-0.005820553749799728,
-0.028388792648911476,
0.02123958431184292,
0.03854520991444588,
-0.016369421035051346,
-0.005286254454404116,
0.0853365957736969,
-0.06301896274089813,
0.020010221749544144,
0.017712261527776718,
0.030034245923161507,
0.013229820877313614,
-0.036218881607055664,
-0.07478300482034683,
0.024284617975354195,
-0.005376092158257961,
0.046715736389160156,
0.001183260465040803,
-0.06752031296491623,
0.006577083840966225,
-0.004142002668231726,
0.023093082010746002,
-0.0152913648635149,
-0.041117411106824875,
0.024757448583841324,
0.01398635096848011,
-0.0006406864849850535,
0.014062004163861275,
0.042100902646780014,
-0.014761794358491898,
0.054999738931655884,
0.03152839466929436,
0.031812090426683426,
0.02485201507806778,
0.03822368383407593,
-0.03750498220324516,
0.004969457164406776,
-0.037221282720565796,
-0.08087307214736938,
-0.1026611402630806,
-0.050460558384656906,
-0.04611051082611084,
0.06873076409101486,
0.03160404786467552,
0.010241527110338211,
-0.007475463207811117,
0.01773117482662201,
0.008879772387444973
]
|
36,491 | torch_pso.optim.GenericPSO | __init__ | null | def __init__(self, params: Iterable[torch.nn.Parameter], num_particles: int, particle_class: Type[GenericParticle],
particle_args: Optional[List] = None, particle_kwargs: Optional[Dict] = None):
defaults = {}
super().__init__(params, defaults)
if particle_args is None:
particle_args = []
if particle_kwargs is None:
particle_kwargs = {}
self.particles = [particle_class(self.param_groups, *particle_args, **particle_kwargs)
for _ in range(num_particles)]
self.best_known_global_param_groups = clone_param_groups(self.param_groups)
self.best_known_global_loss_value = torch.inf
| (self, params: Iterable[torch.nn.parameter.Parameter], num_particles: int, particle_class: Type[torch_pso.optim.GenericPSO.GenericParticle], particle_args: Optional[List] = None, particle_kwargs: Optional[Dict] = None) | [
0.0008138269768096507,
-0.04137692227959633,
-0.04727191850543022,
0.01220040861517191,
-0.01111841481178999,
0.03680643066763878,
-0.05633828043937683,
-0.027777383103966713,
-0.035183440893888474,
0.019270675256848335,
0.008502042852342129,
0.03630274534225464,
-0.030445056036114693,
0.004362951964139938,
-0.018627077341079712,
-0.004274340346455574,
0.02647152915596962,
0.03553788736462593,
-0.022106245160102844,
-0.05950963869690895,
0.006347383838146925,
0.055554766207933426,
-0.017675668001174927,
0.03604157269001007,
0.019252020865678787,
-0.0208190456032753,
0.0028985298704355955,
-0.0010446832748129964,
-0.03734742850065231,
-0.010204317048192024,
-0.00965399295091629,
0.023076308891177177,
-0.01139824092388153,
0.08611175417900085,
-0.002020576037466526,
-0.0162392295897007,
-0.02205028012394905,
0.08790263533592224,
-0.08424624800682068,
0.061636313796043396,
0.019494537264108658,
-0.06018121913075447,
0.019121436402201653,
-0.025949187576770782,
0.028355689719319344,
0.023169582709670067,
0.06286755204200745,
0.04063072055578232,
-0.04727191850543022,
-0.02063249610364437,
-0.017246602103114128,
-0.022087590768933296,
0.055815935134887695,
-0.04768233001232147,
-0.03180687502026558,
0.081559918820858,
0.0716354250907898,
0.02863551490008831,
-0.030930088832974434,
0.0007724360330030322,
0.02348671853542328,
0.013739450834691525,
0.01955050230026245,
-0.023691924288868904,
-0.0031433773692697287,
-0.03727280721068382,
-0.0524580255150795,
-0.028355689719319344,
-0.011304966174066067,
0.06965798884630203,
0.07417251169681549,
-0.025669360533356667,
-0.0036960334982722998,
0.004519187845289707,
0.037925735116004944,
0.029101891443133354,
-0.008082304149866104,
-0.03477302938699722,
0.02024073898792267,
0.04354090988636017,
0.013039886020123959,
-0.002197799040004611,
-0.02471795305609703,
-0.014000621624290943,
-0.011706049554049969,
-0.026508839800953865,
-0.054883185774087906,
-0.05279381573200226,
0.040332239121198654,
-0.008777204900979996,
-0.043914008885622025,
0.05570400506258011,
0.005801723338663578,
-0.03203073516488075,
0.05111486092209816,
0.021938350051641464,
0.027161765843629837,
-0.025277605280280113,
0.011332948692142963,
-0.04630185663700104,
0.0007292962400242686,
-0.01763835921883583,
-0.010502798482775688,
-0.022572621703147888,
0.012144443579018116,
-0.04738384857773781,
-0.024120992049574852,
0.0006587567622773349,
-0.00001558535404910799,
0.04208581522107124,
-0.027740072458982468,
0.08200763911008835,
-0.05066714063286781,
0.05025672912597656,
-0.0607781819999218,
0.003619081573560834,
-0.02080039121210575,
-0.001164192333817482,
0.000028893480703118257,
-0.00266300980001688,
-0.01027893740683794,
0.0566367581486702,
-0.04137692227959633,
0.031508393585681915,
-0.017041396349668503,
0.017451807856559753,
0.009448787197470665,
-0.013431642204523087,
-0.006039575207978487,
-0.0615990050137043,
0.024494092911481857,
-0.02363595925271511,
-0.01930798590183258,
-0.015045304782688618,
0.002749289385974407,
-0.09558852016925812,
-0.020371325314044952,
-0.010708004236221313,
-0.06357644498348236,
-0.006921026855707169,
0.05652482807636261,
0.0332992821931839,
0.04555565491318703,
0.020110154524445534,
-0.008296837098896503,
0.017787598073482513,
0.036992982029914856,
-0.04783157259225845,
-0.04018299654126167,
-0.024270232766866684,
-0.013823398388922215,
-0.00192963273730129,
-0.012974593788385391,
0.008478724397718906,
-0.03423203527927399,
-0.019960913807153702,
0.041488852351903915,
-0.07984365522861481,
-0.017526427283883095,
-0.01665896736085415,
-0.04201119393110275,
-0.01830993965268135,
0.010120369493961334,
0.007121569011360407,
-0.06570311635732651,
0.004113440401852131,
-0.012685440480709076,
-0.04854046553373337,
-0.0010977336205542088,
0.014802789315581322,
0.015381095930933952,
-0.034996889531612396,
0.06559118628501892,
0.009262236766517162,
-0.007821133360266685,
0.05477125197649002,
-0.005256062839180231,
-0.02589322254061699,
-0.0076998756267130375,
0.01940126158297062,
0.032161321491003036,
-0.04313049837946892,
0.0391010046005249,
-0.08312693983316422,
0.014037932269275188,
0.04193657264113426,
0.01036288496106863,
0.057159099727869034,
-0.04272008687257767,
0.018664386123418808,
0.01277871523052454,
0.02048325538635254,
-0.019998222589492798,
0.04119037091732025,
-0.0009828883921727538,
0.06219596788287163,
0.005335346795618534,
0.007485342677682638,
-0.04376477003097534,
0.08118681609630585,
0.0003089744132012129,
0.031172603368759155,
-0.006580572109669447,
-0.046749576926231384,
-0.034586478024721146,
0.02770276367664337,
0.005853024777024984,
0.05290574952960014,
-0.011967220343649387,
-0.04604068771004677,
-0.019252020865678787,
-0.033840276300907135,
0.06682242453098297,
0.018104735761880875,
0.027422936633229256,
-0.017946166917681694,
-0.02296437695622444,
-0.009182953275740147,
-0.01152882631868124,
-0.014261792413890362,
0.08305232226848602,
-0.01198587566614151,
0.00549391470849514,
0.03296348825097084,
0.0021464978344738483,
0.03773918375372887,
0.024736609309911728,
-0.048913564532995224,
-0.025538776069879532,
0.04525717347860336,
0.0023190570063889027,
-0.008548680692911148,
-0.012722750194370747,
0.0145696010440588,
0.014914719387888908,
0.018048768863081932,
0.02447543852031231,
0.01688282936811447,
-0.06782979518175125,
-0.004980900790542364,
-0.004223038908094168,
0.0069536734372377396,
-0.02671404555439949,
-0.018748333677649498,
0.01740517094731331,
0.009271563962101936,
0.03219863027334213,
0.048241984099149704,
0.011873945593833923,
0.03236652910709381,
0.0018864928279072046,
-0.0015133916167542338,
-0.040742650628089905,
0.018291285261511803,
-0.007494669873267412,
-0.012349649332463741,
-0.024251576513051987,
0.0001559446391183883,
-0.01664964109659195,
0.014131207019090652,
-0.06555388122797012,
0.007965710014104843,
0.002625699620693922,
0.09394687414169312,
0.011043795384466648,
0.00274695735424757,
-0.022535311058163643,
0.009257572703063488,
-0.030762191861867905,
0.015343786217272282,
0.0773811861872673,
0.04436172917485237,
0.058464955538511276,
-0.005806386936455965,
0.018841609358787537,
-0.0312099140137434,
-0.009924491867423058,
-0.024848539382219315,
0.0038079640362411737,
0.0441005602478981,
0.06607621908187866,
-0.031116638332605362,
-0.0012195744784548879,
-0.03365372493863106,
0.04301856458187103,
0.007480678614228964,
-0.00309907179325819,
0.0441005602478981,
-0.01543706189841032,
-0.010763969272375107,
-0.05003286898136139,
0.022106245160102844,
0.022498000413179398,
0.014849427156150341,
0.024736609309911728,
-0.022348761558532715,
-0.007485342677682638,
0.08096295595169067,
0.014084570109844208,
-0.029866749420762062,
0.06443457305431366,
-0.056487519294023514,
0.014560273848474026,
-0.00828750990331173,
0.002115017268806696,
-0.019252020865678787,
0.025520121678709984,
-0.00015113512927200645,
0.03962334617972374,
0.02387847565114498,
0.08044061809778214,
0.03214266523718834,
0.03389624133706093,
0.05167451500892639,
0.03337389975786209,
-0.006468641571700573,
0.04022030904889107,
-0.07092653214931488,
0.019606467336416245,
0.03768321871757507,
0.014317757450044155,
-0.001704605994746089,
-0.014093897305428982,
0.007877098396420479,
-0.03464244306087494,
-0.00786310713738203,
0.020949631929397583,
0.00701430207118392,
-0.02104290761053562,
-0.00771853094920516,
-0.012732078321278095,
0.011920582503080368,
-0.01389801874756813,
-0.02589322254061699,
-0.033597759902477264,
-0.03387758880853653,
-0.007135560270398855,
0.02671404555439949,
0.05462201312184334,
-0.044996000826358795,
0.0245687123388052,
0.017964821308851242,
-0.049062807112932205,
0.0707399845123291,
-0.0012242383090779185,
-0.040071066468954086,
0.034008171409368515,
-0.028094518929719925,
-0.00014290066610556096,
-0.03846673294901848,
0.012666785158216953,
0.02104290761053562,
-0.0035304699558764696,
0.05402505025267601,
0.08894731849431992,
0.005839033517986536,
0.022908411920070648,
-0.010167007334530354,
-0.018179355189204216,
-0.030762191861867905,
0.03344852104783058,
-0.038839831948280334,
0.0012370635522529483,
0.029530959203839302,
0.002877542981877923,
0.0007374578271992505,
0.03667584806680679,
-0.050480589270591736,
0.019960913807153702,
-0.0014434352051466703,
0.0036843742709606886,
-0.033597759902477264,
-0.050480589270591736,
-0.008492715656757355,
0.026844630017876625,
-0.04469752311706543,
-0.07469485700130463,
0.02330016903579235,
0.025538776069879532,
-0.05786799266934395,
-0.00212201289832592,
-0.04462290182709694,
0.06335257738828659,
-0.011827307753264904,
-0.005209425464272499,
0.009434795938432217,
0.04645109549164772,
-0.007923736236989498,
0.08999200165271759,
0.01872967928647995,
0.024867193773388863,
0.0034255352802574635,
0.02770276367664337,
-0.05387581139802933,
-0.04122767969965935,
0.024829883128404617,
0.037925735116004944,
0.013347694650292397,
-0.07961979508399963,
-0.02656480483710766,
-0.011696722358465195,
-0.0748814046382904,
0.014858754351735115,
0.030445056036114693,
0.0038802523631602526,
-0.05417429283261299,
0.04186195135116577,
0.002856555860489607,
0.003141045570373535,
0.07835125178098679,
-0.019848983734846115,
0.0106054013594985,
-0.036918360739946365,
-0.0019681088160723448,
0.016211247071623802,
-0.04555565491318703,
0.006016256753355265,
-0.04193657264113426,
0.029754819348454475,
-0.0016626321012154222,
-0.02063249610364437,
0.004435240291059017,
0.057569511234760284,
0.03729146346449852,
0.03801900893449783,
0.03419472277164459,
-0.036004263907670975,
0.0031736919190734625,
0.005013547372072935,
-0.050144799053668976,
-0.09596162289381027,
0.000745036406442523,
-0.05607710778713226,
-0.028933996334671974,
0.05436084046959877,
-0.013608865439891815,
0.008226880803704262,
0.004813005216419697,
-0.023505374789237976,
0.025576086714863777,
0.018608421087265015,
-0.013347694650292397,
0.06346451491117477,
0.03430665284395218,
-0.003066425444558263,
0.012442924082279205,
-0.03721684217453003,
0.017190637066960335,
-0.04704805836081505,
-0.02315092831850052,
0.035519231110811234,
0.009635337628424168,
0.06566581130027771,
-0.03354179486632347,
0.047570399940013885,
-0.04895087704062462,
-0.03969796746969223,
0.0014585924800485373,
0.03635871037840843,
-0.031172603368759155,
-0.013002576306462288,
0.02764679677784443,
-0.0071588787250220776,
-0.049473218619823456,
-0.0499209389090538,
-0.016276538372039795,
0.040593408048152924,
-0.05454739183187485,
-0.00032442313386127353,
-0.03807497397065163,
0.059061918407678604,
0.047234609723091125,
0.014149862341582775,
-0.06868793070316315,
-0.08603712916374207,
-0.0036890378687530756,
0.015399751253426075,
-0.01822599209845066,
0.0007741849403828382,
-0.01345029752701521,
0.04760771244764328,
-0.031321845948696136,
0.06290485709905624,
0.022852446883916855,
-0.01997956819832325,
-0.023430753499269485,
-0.012536199763417244,
0.008777204900979996,
-0.015586301684379578,
0.02964288927614689,
-0.06443457305431366,
-0.01328240241855383,
0.03796304389834404,
0.037496667355298996,
-0.008343474939465523,
0.0024811229668557644,
0.02846761979162693,
0.038989074528217316,
0.052308786660432816,
-0.01290930062532425,
0.003348583122715354,
0.003201674437150359,
0.0020299036987125874,
-0.01506396010518074,
0.023449409753084183,
-0.050219420343637466,
0.012545526959002018,
0.02837434411048889,
-0.022777827456593513,
0.06081549450755119,
0.016752243041992188,
-0.044809453189373016,
-0.005242071580141783,
-0.011799325235188007,
-0.0044492315500974655,
-0.01740517094731331,
-0.030911432579159737,
0.021453317254781723,
-0.002250266494229436,
-0.023953095078468323,
0.07096384465694427,
0.06290485709905624,
0.025986498221755028,
-0.0191400907933712,
0.012937283143401146,
-0.01511059794574976,
-0.0044492315500974655,
-0.047159988433122635,
0.026937905699014664,
0.030351780354976654,
-0.018020786345005035,
-0.038653284311294556,
-0.04771964251995087,
0.017246602103114128,
0.012377631850540638,
0.014961357228457928,
0.03876521438360214,
-0.0031363817397505045,
0.02130407840013504,
0.008455405943095684,
-0.0034628454595804214,
0.012181753292679787,
0.08111219853162766,
-0.02731100656092167,
-0.0017384183593094349,
-0.040332239121198654,
-0.004752376116812229,
0.042421605437994,
-0.010092386975884438,
0.012079150415956974,
0.02829972468316555,
-0.031116638332605362,
-0.08932042121887207,
-0.015959402546286583,
0.04951052740216255,
0.005088167265057564,
-0.029661543667316437,
-0.07010570913553238,
-0.008007683791220188,
0.09387225657701492,
0.014327085576951504,
0.013198453933000565,
0.04544372484087944,
0.008502042852342129,
-0.06059163063764572,
-0.02988540381193161,
-0.04585413634777069,
-0.012732078321278095,
-0.052159544080495834,
-0.0007666063611395657,
0.04820467159152031,
0.023337479680776596,
-0.07730656862258911,
0.0012545527424663305,
-0.0008330649579875171,
0.011873945593833923,
0.022871103137731552,
0.013870036229491234,
-0.03063160739839077,
-0.03128453344106674,
-0.011202363297343254,
0.0018573442939668894,
-0.03557519614696503,
-0.03872790187597275,
0.007676556706428528,
0.06421071290969849,
-0.04596606642007828,
-0.004924935754388571,
0.041153062134981155,
0.02262858673930168,
0.04342897608876228,
0.03626543655991554,
-0.0007829295354895294,
-0.00472672563046217,
-0.02505374513566494,
0.024587368592619896,
-0.014681531116366386,
-0.008049657568335533,
0.0002707898383960128,
-0.052644576877355576,
-0.06674779951572418,
0.06338988989591599,
0.005792395677417517,
-0.0003693118633236736,
0.01613662578165531,
-0.1006627008318901,
-0.016024695709347725,
0.056823309510946274,
0.011845962144434452,
0.00811961479485035,
0.01981167308986187,
-0.010446833446621895,
-0.007597272749990225,
-0.018925556913018227,
-0.008516034111380577,
-0.01723727397620678,
-0.05029403790831566,
0.03630274534225464,
0.10551301389932632,
-0.02697521634399891,
-0.04861508309841156,
0.007354757282882929,
-0.009551390074193478,
0.012004530988633633,
-0.05570400506258011,
-0.06212134659290314,
-0.005615172907710075,
-0.1439424306154251,
0.013254419900476933,
0.006916363257914782,
0.020166119560599327,
-0.010838589631021023,
-0.0474211610853672,
-0.03835480287671089,
-0.009877854026854038,
-0.04156346991658211,
-0.005666474346071482,
-0.017843564972281456,
0.005941636394709349,
0.007438704837113619,
0.005694456864148378,
0.015875454992055893,
-0.02022208459675312,
-0.029829438775777817,
-0.02313227392733097,
-0.04988362640142441,
-0.0017279247986152768,
0.03676912188529968,
0.07562761008739471,
0.02397175133228302,
0.03785111382603645,
0.015353113412857056,
-0.016770897433161736,
0.012573509477078915,
-0.024270232766866684,
0.020669804885983467,
0.005391312297433615,
0.0017582393484190106,
0.055069733411073685,
-0.007629919331520796,
-0.027516212314367294,
0.0024508084170520306,
0.016920138150453568,
0.02654614858329296,
0.009462778456509113,
-0.03335524722933769,
-0.038914453238248825,
-0.05850226432085037,
0.004199719987809658,
0.04880163446068764,
-0.054398152977228165,
-0.034008171409368515,
-0.00802633911371231,
-0.005568535067141056,
0.004906280431896448,
-0.0036377364303916693,
-0.029232477769255638,
0.014877409674227238,
-0.026937905699014664,
0.03307541832327843,
0.06036777049303055,
-0.02255396731197834,
-0.007042285054922104,
0.023169582709670067,
-0.009681975468993187,
0.03604157269001007,
-0.04805543273687363,
-0.003989850636571646,
0.0004605467838700861,
-0.006837079301476479,
0.0035048192366957664,
0.04230967536568642,
0.02339344471693039,
-0.02089366689324379,
-0.005041529890149832,
-0.03070622682571411,
-0.07021763920783997,
-0.08461935073137283,
0.007247490342706442,
-0.015922093763947487,
-0.024680642411112785,
0.000033028929465217516,
-0.11581061035394669,
0.0658150464296341,
-0.03402682766318321,
0.0574575811624527,
-0.01789953000843525,
0.01648174412548542,
0.012834680266678333,
-0.010083059780299664,
-0.0047943503595888615,
0.021005596965551376,
0.06152438372373581,
-0.05111486092209816,
-0.04525717347860336,
0.06312871724367142,
0.13304787874221802,
0.013254419900476933,
-0.0424589142203331,
-0.004339633043855429,
0.027180420234799385,
-0.04760771244764328,
0.030575642362236977,
0.034493204206228256,
-0.011510171927511692,
-0.0324784591794014,
0.04294394701719284,
-0.024120992049574852,
0.04850315302610397,
-0.02389713004231453,
0.05051790177822113,
0.01647241786122322,
-0.042570844292640686,
-0.04883894324302673,
0.0216398686170578,
-0.038504041731357574,
0.06312871724367142,
-0.00480834161862731,
-0.06503153592348099,
0.006468641571700573,
-0.032497111707925797,
-0.0029591587372124195,
-0.046152617782354355,
-0.01689215563237667,
0.003975859377533197,
0.010474815964698792,
0.0074247135780751705,
-0.008329483680427074,
0.05693523958325386,
-0.005209425464272499,
0.014364395290613174,
0.03738473728299141,
0.019774362444877625,
0.02887803129851818,
0.02048325538635254,
-0.02596784196794033,
0.024773918092250824,
-0.015082615427672863,
-0.05566669628024101,
-0.0948423221707344,
-0.0624198280274868,
-0.050405967980623245,
0.05238340422511101,
-0.014233809895813465,
-0.006235453300178051,
0.04536910355091095,
0.04279470443725586,
-0.005475259851664305
]
|
36,511 | torch_pso.optim.ImprovedSineCosineAlgorithm | ImprovedSineCosineAlgorithm |
The Improved Sine Cosine Algorithm is a variation on the original Sine Cosine Algorithm, specifically attempting to
improve its resilience against local optima and unbalanced exploitation. It also demonstrates better behavior in
high-dimensional optimization problems.
Original Paper:
Long, W., Wu, T., Liang, X., & Xu, S. (2019). Solving high-dimensional global optimization problems using an
improved sine cosine algorithm. Expert systems with applications, 123, 108-126.
https://e-tarjome.com/storage/panel/fileuploads/2019-08-22/1566462251_E11587-e-tarjome.pdf
| class ImprovedSineCosineAlgorithm(GenericPSO):
"""
The Improved Sine Cosine Algorithm is a variation on the original Sine Cosine Algorithm, specifically attempting to
improve its resilience against local optima and unbalanced exploitation. It also demonstrates better behavior in
high-dimensional optimization problems.
Original Paper:
Long, W., Wu, T., Liang, X., & Xu, S. (2019). Solving high-dimensional global optimization problems using an
improved sine cosine algorithm. Expert systems with applications, 123, 108-126.
https://e-tarjome.com/storage/panel/fileuploads/2019-08-22/1566462251_E11587-e-tarjome.pdf
"""
def __init__(self,
params: Iterable[torch.nn.Parameter],
num_particles: int = 100,
a_start: float = 2,
a_end: float = 0,
max_time_steps: int = 1000,
w_end: float = 0,
w_start: float = .1,
k: float = 15.,
max_param_value: float = -10,
min_param_value: float = 10):
particle_kwargs = {
'max_param_value': max_param_value,
'min_param_value': min_param_value,
}
super().__init__(params, num_particles, particle_class=ImprovedSCAParticle, particle_kwargs=particle_kwargs)
self.max_param_value = max_param_value
self.min_param_value = min_param_value
self.magnitude = max_param_value - min_param_value
self.w_end = w_end
self.w_start = w_start
self.a_start = a_start
self.a_end = a_end
self.k = k
self.max_time_steps = max_time_steps
self.current_time_step = 0
def w(self) -> float:
"""
Calculate the inertial weight of the particle at the current time step.
"""
return self.w_end + (self.w_start - self.w_end) * (
self.max_time_steps - self.current_time_step) / self.max_time_steps
def r1(self):
"""Calculate the r1 value for the current timestep"""
return (self.a_start - self.a_end) * math.exp(
-self.current_time_step ** 2 / (self.k * self.max_time_steps) ** 2) + self.a_end
@torch.no_grad()
def step(self, closure: Callable[[], torch.Tensor]) -> torch.Tensor:
"""
Performs a single optimization step.
:param closure: A callable that reevaluates the model and returns the loss.
:return: the final loss after the step (as calculated by the closure)
"""
r3 = 2 * torch.rand((1,))
r2 = 2 * torch.pi * torch.rand((1,))
use_sine = torch.rand((1,)).item() < .5
r1 = self.r1()
w = self.w()
self.current_time_step += 1
return super().step(closure, particle_step_kwargs={'r1': r1,
'r2': r2,
'r3': r3,
'use_sine': use_sine,
'w': w
})
| (params: Iterable[torch.nn.parameter.Parameter], num_particles: int = 100, a_start: float = 2, a_end: float = 0, max_time_steps: int = 1000, w_end: float = 0, w_start: float = 0.1, k: float = 15.0, max_param_value: float = -10, min_param_value: float = 10) | [
-0.031025270000100136,
-0.06205054000020027,
-0.021354051306843758,
0.05303696170449257,
0.014419786632061005,
0.0021506373304873705,
-0.0751260295510292,
-0.03305622562766075,
-0.014477814547717571,
-0.012224419973790646,
0.022321172058582306,
0.015947839245200157,
0.03452625125646591,
0.022553281858563423,
-0.06870433688163757,
0.054971206933259964,
0.028684834018349648,
0.0007277592085301876,
-0.006765017285943031,
-0.018355973064899445,
0.005430389195680618,
-0.007770824246108532,
-0.025996236130595207,
0.0109478197991848,
-0.039439231157302856,
0.0205803532153368,
0.018501041457057,
0.010415902361273766,
-0.0882788822054863,
-0.05914917215704918,
-0.0005624418263323605,
0.02425541542470455,
0.005599635653197765,
-0.012862720526754856,
0.0823214128613472,
-0.036595892161130905,
0.034777700901031494,
0.03197304904460907,
-0.08061927556991577,
0.027504945173859596,
-0.025145167484879494,
-0.01645074225962162,
0.03537731617689133,
-0.0028022355400025845,
-0.024081334471702576,
-0.01868479512631893,
-0.050677184015512466,
0.09942013025283813,
0.02483568899333477,
-0.0026837631594389677,
0.02326895110309124,
-0.08309511095285416,
0.04119938984513283,
0.00004801608884008601,
-0.027253493666648865,
0.07226334512233734,
0.05837547406554222,
-0.007079332135617733,
0.03613167256116867,
-0.016789235174655914,
0.07837555557489395,
-0.010880121029913425,
0.058646269142627716,
0.021586159244179726,
-0.003447789466008544,
-0.011653818190097809,
-0.0011901643592864275,
-0.000369319663150236,
0.011779543943703175,
0.06038708984851837,
0.0604257732629776,
-0.04526130482554436,
0.03746630251407623,
-0.003537248121574521,
0.008442973718047142,
-0.011789215728640556,
-0.026673220098018646,
-0.04769844934344292,
0.024371471256017685,
-0.04870425537228584,
0.013046474196016788,
-0.023191582411527634,
-0.047543711960315704,
-0.010406231507658958,
-0.016073565930128098,
-0.012514556758105755,
0.03323030844330788,
-0.026557166129350662,
0.007229235954582691,
0.0028215779457241297,
-0.0371374785900116,
0.035319291055202484,
0.01952619105577469,
0.03226318582892418,
0.056982818990945816,
0.020502982661128044,
-0.013046474196016788,
-0.10885923355817795,
0.01440044492483139,
-0.05102534964680672,
0.06448768824338913,
0.04692475125193596,
-0.0002644473861437291,
0.04762107878923416,
0.0713735967874527,
-0.004980677738785744,
-0.015638360753655434,
0.011257298290729523,
0.028239957988262177,
-0.01446814276278019,
-0.03851079195737839,
0.06410083919763565,
-0.09292107075452805,
-0.028143245726823807,
-0.07187649607658386,
-0.047156862914562225,
-0.023152897134423256,
0.03315293788909912,
-0.02992274984717369,
0.01393622625619173,
0.02483568899333477,
0.007930398918688297,
-0.05678939446806908,
-0.01009675208479166,
0.018075507134199142,
-0.005401375703513622,
0.05029033496975899,
0.030232230201363564,
-0.02253394015133381,
-0.061276841908693314,
-0.0011617551790550351,
-0.009492301382124424,
0.05156693607568741,
0.021199312061071396,
-0.011054202914237976,
-0.03415874391794205,
0.03642180934548378,
-0.004622842650860548,
-0.03709879517555237,
0.02346237562596798,
0.00400872016325593,
0.007108345627784729,
-0.011798886582255363,
-0.002012822311371565,
0.0123694883659482,
0.02922642230987549,
0.030386969447135925,
-0.028530094772577286,
-0.002020075684413314,
-0.01865578070282936,
-0.007234071381390095,
0.019796984270215034,
0.01491301879286766,
0.005739868152886629,
-0.001641689334064722,
-0.04317231848835945,
0.03386860713362694,
-0.01887821964919567,
-0.056286491453647614,
0.024313444271683693,
-0.05048375949263573,
-0.010135437361896038,
-0.023945936933159828,
-0.020406270399689674,
-0.03980673477053642,
0.030096832662820816,
0.005788224283605814,
0.012108366005122662,
0.0013152856845408678,
0.008530015125870705,
0.0018556651193648577,
-0.028878258541226387,
0.019980737939476967,
0.03088987246155739,
-0.0022074556909501553,
0.06027103587985039,
0.03408137336373329,
-0.009100616909563541,
-0.000014761831153009553,
-0.05470041185617447,
-0.011711846105754375,
-0.04189571738243103,
-0.029110368341207504,
-0.08201193064451218,
-0.008824987336993217,
0.06618981808423996,
0.045145247131586075,
-0.021992351859807968,
0.02156681753695011,
-0.00044366714428178966,
-0.02381053939461708,
-0.034874413162469864,
0.004683287814259529,
0.023404348641633987,
0.003890247782692313,
0.044564973562955856,
0.026711905375123024,
0.013056145049631596,
0.012620939873158932,
0.024990428239107132,
-0.02669256366789341,
0.06410083919763565,
0.01904262974858284,
-0.032437268644571304,
-0.0227273628115654,
-0.012582255527377129,
0.008520343340933323,
0.07477786391973495,
-0.042166512459516525,
0.03802723065018654,
-0.03516454994678497,
-0.01795945316553116,
0.016499098390340805,
0.01679890602827072,
0.05969076231122017,
-0.0305610504001379,
0.007780495565384626,
0.01948750577867031,
0.02839469723403454,
0.011914941482245922,
0.023771855980157852,
-0.035570740699768066,
-0.023346321657299995,
0.016208961606025696,
0.077601857483387,
0.006233100313693285,
0.03456493467092514,
-0.024874374270439148,
0.02185695432126522,
-0.05059981718659401,
-0.0057205259799957275,
0.010183793492615223,
-0.05137351155281067,
0.004685705527663231,
0.04502919316291809,
0.012282447889447212,
-0.005430389195680618,
-0.003401851048693061,
-0.07489391416311264,
-0.05470041185617447,
-0.05427487939596176,
-0.048278722912073135,
-0.03647983819246292,
0.019274739548563957,
-0.04653790220618248,
0.005618977826088667,
0.0637526735663414,
0.045880261808633804,
-0.030386969447135925,
0.013075487688183784,
0.014429458416998386,
-0.03572548180818558,
-0.01804649457335472,
0.02522253803908825,
-0.019003944471478462,
-0.048820313066244125,
0.036112330853939056,
0.0334043875336647,
0.011189599521458149,
-0.01792076788842678,
-0.0335397869348526,
-0.038994353264570236,
-0.03618970140814781,
0.04916847497224808,
-0.016566798090934753,
-0.007524208165705204,
-0.03357847034931183,
0.0031697419472038746,
-0.01192461233586073,
0.03162488341331482,
0.06441031396389008,
0.022379199042916298,
-0.04936189949512482,
-0.02234051562845707,
0.022649994120001793,
0.027756396681070328,
-0.029013656079769135,
0.04626711085438728,
-0.010696367360651493,
0.01728246733546257,
0.036054302006959915,
-0.0007888087420724332,
-0.018771834671497345,
-0.032727405428886414,
-0.024855032563209534,
-0.012785350903868675,
0.005454567261040211,
-0.02880088984966278,
0.07156702131032944,
-0.004975841846317053,
-0.06038708984851837,
0.020947858691215515,
0.03911040723323822,
0.016121922060847282,
0.10437179356813431,
0.03870421648025513,
-0.0468473844230175,
0.0001246680476469919,
0.005841415841132402,
-0.0663832426071167,
0.07265019416809082,
0.005614142399281263,
-0.027350205928087234,
-0.02816258929669857,
-0.0037234192714095116,
-0.019922710955142975,
0.0298647228628397,
-0.013810500502586365,
0.056247808039188385,
-0.05094797909259796,
0.0030343448743224144,
-0.005164430942386389,
0.025996236130595207,
0.04286283999681473,
-0.007064825389534235,
-0.01855906844139099,
0.00022198469378054142,
-0.05323038622736931,
0.03719550743699074,
0.07528076320886612,
-0.015367566607892513,
-0.003897501155734062,
0.015193484723567963,
0.010435244999825954,
0.02087048999965191,
-0.06077393889427185,
0.007354961708188057,
0.02742757648229599,
-0.01590915396809578,
-0.06781458854675293,
-0.0375630147755146,
0.0113636814057827,
-0.004040151368826628,
0.0010287759359925985,
-0.06166369095444679,
-0.019642245024442673,
0.022998157888650894,
0.029555244371294975,
0.0394972562789917,
-0.03504849597811699,
0.07953610271215439,
0.03891698271036148,
-0.028588121756911278,
0.054429616779088974,
-0.020851146429777145,
-0.06433294713497162,
0.06274686753749847,
-0.046770013868808746,
0.04119938984513283,
0.008641233667731285,
0.01641205884516239,
0.01837531477212906,
0.012417844496667385,
0.04692475125193596,
0.06789195537567139,
0.033327020704746246,
-0.019671259447932243,
-0.047350287437438965,
-0.019825998693704605,
-0.0744296982884407,
0.0302128866314888,
-0.014265047386288643,
-0.03350109979510307,
0.06727299839258194,
0.008989397436380386,
-0.012359817512333393,
-0.025454647839069366,
0.003010166808962822,
0.03232121095061302,
-0.0130271315574646,
-0.04464234411716461,
-0.05748572200536728,
0.020619038492441177,
-0.004971006419509649,
0.004562397487461567,
0.01500973105430603,
0.01994205266237259,
0.015087100677192211,
-0.021992351859807968,
-0.0277177132666111,
0.07694421708583832,
-0.024178046733140945,
-0.07114148139953613,
0.01590915396809578,
0.04100596532225609,
-0.007093838881701231,
0.01764030195772648,
-0.042359936982393265,
0.10584181547164917,
-0.020541667938232422,
0.012649954296648502,
0.0033607485238462687,
0.06274686753749847,
-0.03315293788909912,
-0.038839612156152725,
0.009932341054081917,
0.024274758994579315,
0.033365704119205475,
-0.08874310553073883,
-0.01430373266339302,
-0.023771855980157852,
-0.05237932130694389,
0.03046433813869953,
0.03011617437005043,
-0.017243782058358192,
-0.1035207211971283,
0.060889992862939835,
0.010889791883528233,
0.013278583064675331,
0.12936222553253174,
-0.05822073668241501,
-0.017466221004724503,
-0.004381061997264624,
-0.0030609406530857086,
-0.03479704633355141,
-0.05651860311627388,
-0.03744695708155632,
-0.025686755776405334,
-0.031798966228961945,
0.02918773703277111,
-0.0032954677008092403,
0.01795945316553116,
0.037427615374326706,
0.03682800009846687,
0.021586159244179726,
-0.0018786342116072774,
-0.025725441053509712,
0.018230246379971504,
-0.011818229220807552,
0.012330804020166397,
-0.04951664060354233,
-0.03924580663442612,
-0.06456505507230759,
-0.03729221969842911,
-0.0342361144721508,
0.014661567285656929,
0.009564835578203201,
-0.02963261306285858,
0.03344307467341423,
0.00849616527557373,
0.03394597768783569,
0.04092859849333763,
-0.012253434397280216,
0.025648072361946106,
0.006605442147701979,
0.00022485583031084388,
-0.018713807687163353,
-0.02762100100517273,
-0.031199350953102112,
0.006310469936579466,
0.019265066832304,
0.03568679839372635,
0.03609298914670944,
-0.02454555220901966,
0.024816347286105156,
-0.025706099346280098,
-0.03334636241197586,
-0.04943927004933357,
-0.04139281436800957,
-0.03398466110229492,
0.0112959835678339,
0.0780273899435997,
-0.0026837631594389677,
-0.011963297612965107,
0.04259204491972923,
0.0020962366834282875,
0.042321253567934036,
0.009526150301098824,
-0.007669276557862759,
-0.020444955676794052,
0.035029154270887375,
-0.00003290480890427716,
0.0026982699055224657,
-0.051799047738313675,
0.022166432812809944,
-0.014061952009797096,
-0.07624788582324982,
0.01200198195874691,
0.022998157888650894,
-0.031160665675997734,
0.0368666835129261,
-0.06495190411806107,
0.025357935577630997,
0.03543534502387047,
0.0175339188426733,
0.018065836280584335,
0.044410236179828644,
-0.012504885904490948,
0.01629600301384926,
0.015628689900040627,
-0.010986504144966602,
-0.011518421582877636,
0.0371374785900116,
0.032882142812013626,
-0.06618981808423996,
-0.023036843165755272,
0.01686660572886467,
-0.0019233636558055878,
0.050135597586631775,
-0.025648072361946106,
-0.012775680050253868,
0.03147014603018761,
-0.031702253967523575,
-0.004961335100233555,
0.05489383637905121,
0.011547435075044632,
-0.06595771014690399,
0.004828355740755796,
-0.08239877969026566,
0.03591890633106232,
0.004499534610658884,
-0.05930391326546669,
0.04839477688074112,
-0.021276680752635002,
0.03475835919380188,
-0.029690641909837723,
-0.02263065241277218,
0.07056120783090591,
0.005372361745685339,
-0.08294036984443665,
0.0006509938975796103,
0.001942706061527133,
0.005367526318877935,
0.01600586622953415,
0.017833726480603218,
0.030909214168787003,
-0.046770013868808746,
-0.04688606783747673,
0.032630693167448044,
0.015609347261488438,
-0.0002952743961941451,
-0.019922710955142975,
-0.030038805678486824,
0.05485515296459198,
0.018965259194374084,
0.013114172033965588,
-0.02624768763780594,
-0.06340450793504715,
0.04638316482305527,
-0.0039023368153721094,
-0.012678967788815498,
0.04580289125442505,
0.030735133215785027,
-0.006402346771210432,
0.008181851357221603,
0.010454587638378143,
0.01731148175895214,
0.05787257105112076,
-0.043443113565444946,
0.009298876859247684,
0.011305654421448708,
-0.001785548753105104,
0.0437912791967392,
0.014796964824199677,
0.07129622250795364,
-0.00882015097886324,
-0.02307552844285965,
-0.037911176681518555,
-0.01930375210940838,
0.05934259667992592,
-0.023694485425949097,
-0.03404268994927406,
0.0318763367831707,
-0.055512793362140656,
-0.05841416120529175,
0.016141263768076897,
0.03965199738740921,
-0.021141283214092255,
-0.011479736305773258,
0.01940046437084675,
0.042321253567934036,
0.020657723769545555,
-0.00705031817778945,
-0.01246620062738657,
-0.06205054000020027,
-0.005971977487206459,
0.030773818492889404,
-0.04889767989516258,
-0.05559016391634941,
-0.03775643929839134,
0.021586159244179726,
-0.04038700833916664,
-0.012379160150885582,
-0.026383085176348686,
0.041973087936639786,
0.03895566985011101,
-0.04564815014600754,
0.024971086531877518,
0.008737945929169655,
0.051992472261190414,
-0.01945849135518074,
0.01625731773674488,
-0.04951664060354233,
-0.05470041185617447,
-0.01840432919561863,
0.016528112813830376,
-0.007350126281380653,
0.019371451810002327,
0.044758398085832596,
0.0015776174841448665,
-0.10096751898527145,
-0.012388831004500389,
0.02518385276198387,
-0.009864643216133118,
-0.012872392311692238,
-0.011131572537124157,
-0.00608803192153573,
0.001292316592298448,
0.021586159244179726,
-0.0075919064693152905,
0.018636438995599747,
0.0075532216578722,
0.01366543211042881,
-0.030831845477223396,
-0.02400396391749382,
0.017620960250496864,
-0.016208961606025696,
-0.027156781405210495,
0.10429441928863525,
-0.008162508718669415,
-0.032050419598817825,
0.019864682108163834,
-0.03143145889043808,
-0.020058106631040573,
-0.05504857748746872,
-0.025628728792071342,
0.06077393889427185,
-0.10499075055122375,
-0.007388811092823744,
-0.0478145033121109,
-0.017205098643898964,
-0.0014917855150997639,
0.001954795094206929,
-0.03965199738740921,
0.01635402999818325,
0.027949821203947067,
-0.004726808052510023,
0.050135597586631775,
-0.03882027044892311,
0.004758239723742008,
0.020348243415355682,
0.028762204572558403,
-0.04259204491972923,
0.022224459797143936,
-0.03516454994678497,
-0.02918773703277111,
-0.006383004132658243,
0.022475911304354668,
0.05021296814084053,
0.042166512459516525,
-0.01520315557718277,
0.05195378512144089,
-0.0222438033670187,
0.008336590602993965,
0.013036802411079407,
-0.014419786632061005,
0.03431348502635956,
-0.02176024205982685,
0.0661124512553215,
-0.03245661035180092,
0.021586159244179726,
-0.0012107157381251454,
-0.05787257105112076,
0.021392734721302986,
-0.006677976343780756,
-0.08456513285636902,
0.03334636241197586,
0.021973008289933205,
-0.00202370248734951,
0.03406203165650368,
-0.02551267482340336,
-0.05647991597652435,
-0.02922642230987549,
0.009216670878231525,
0.03412006050348282,
-0.004966170527040958,
0.011885927990078926,
-0.04657658934593201,
-0.058839693665504456,
0.021005887538194656,
0.021837610751390457,
-0.005662498530000448,
-0.009385917335748672,
0.012766008265316486,
0.010261163115501404,
0.028491409495472908,
0.005391704384237528,
-0.010319190099835396,
-0.026963356882333755,
-0.019642245024442673,
-0.02458423748612404,
0.026518480852246284,
-0.0045382194221019745,
0.003222933504730463,
0.07725369185209274,
-0.0647197961807251,
-0.04951664060354233,
-0.02829798497259617,
0.02454555220901966,
-0.03818197175860405,
0.0280658770352602,
-0.010435244999825954,
-0.010338532738387585,
-0.010648011229932308,
-0.03636378049850464,
0.050174281001091,
-0.008452645502984524,
-0.05075455456972122,
0.045686837285757065,
0.025299908593297005,
0.03088987246155739,
0.022282486781477928,
0.02176024205982685,
-0.009003904648125172,
0.0006552250706590712,
0.01846235617995262,
-0.004876711871474981,
0.02547398954629898,
-0.015667373314499855,
0.04301758110523224,
-0.016315346583724022,
-0.032050419598817825,
0.04986480250954628,
0.010067738592624664,
-0.06058051437139511,
-0.002385164378210902,
0.04317231848835945,
-0.05338512733578682,
0.019574547186493874,
0.0029255435802042484,
-0.020541667938232422,
0.04816266894340515,
-0.019661586731672287,
0.0015244258102029562,
0.025532016530632973,
-0.014419786632061005,
0.024216732010245323,
0.000035020388168049976,
-0.04820135235786438,
-0.031605541706085205,
0.003974870778620243,
0.02825930155813694,
-0.01366543211042881,
-0.025628728792071342,
0.04646053537726402,
0.04665395990014076,
-0.008694425225257874,
0.006803702097386122,
0.04266941547393799,
-0.014864662662148476,
0.05524200201034546,
0.03226318582892418,
-0.010638340376317501,
0.030000120401382446,
0.019439149647951126,
-0.04630579426884651,
-0.0044584316201508045,
0.006155730690807104,
-0.06394609808921814,
-0.0882788822054863,
-0.04297889396548271,
-0.0008740363991819322,
0.061083417385816574,
0.07725369185209274,
0.025648072361946106,
0.025783468037843704,
-0.005000019911676645,
0.03578351065516472
]
|
36,513 | torch_pso.optim.ImprovedSineCosineAlgorithm | __init__ | null | def __init__(self,
params: Iterable[torch.nn.Parameter],
num_particles: int = 100,
a_start: float = 2,
a_end: float = 0,
max_time_steps: int = 1000,
w_end: float = 0,
w_start: float = .1,
k: float = 15.,
max_param_value: float = -10,
min_param_value: float = 10):
particle_kwargs = {
'max_param_value': max_param_value,
'min_param_value': min_param_value,
}
super().__init__(params, num_particles, particle_class=ImprovedSCAParticle, particle_kwargs=particle_kwargs)
self.max_param_value = max_param_value
self.min_param_value = min_param_value
self.magnitude = max_param_value - min_param_value
self.w_end = w_end
self.w_start = w_start
self.a_start = a_start
self.a_end = a_end
self.k = k
self.max_time_steps = max_time_steps
self.current_time_step = 0
| (self, params: Iterable[torch.nn.parameter.Parameter], num_particles: int = 100, a_start: float = 2, a_end: float = 0, max_time_steps: int = 1000, w_end: float = 0, w_start: float = 0.1, k: float = 15.0, max_param_value: float = -10, min_param_value: float = 10) | [
-0.007608690764755011,
-0.03279251232743263,
-0.060869526118040085,
0.014830422587692738,
-0.013948515988886356,
0.03923582658171654,
-0.06083352863788605,
-0.03236055746674538,
-0.0728202536702156,
0.028005020692944527,
0.01922195591032505,
0.06770879775285721,
0.0018391794292256236,
0.019293947145342827,
-0.03486229106783867,
0.027897031977772713,
0.02777104638516903,
0.017314158380031586,
-0.03173062577843666,
-0.026799149811267853,
0.011635762639343739,
0.0037076056469231844,
-0.06029358506202698,
0.04931475594639778,
-0.002818950219079852,
-0.012913626618683338,
0.008634581230580807,
0.003041676478460431,
-0.08084739744663239,
-0.02391945570707321,
-0.011545771732926369,
0.032738517969846725,
0.016090288758277893,
0.042547475546598434,
0.04650705307722092,
-0.017107181251049042,
0.009538985788822174,
0.0016456999583169818,
-0.1207311600446701,
0.061589449644088745,
0.022011658176779747,
-0.038371916860342026,
0.028706947341561317,
-0.01887999102473259,
0.007298223674297333,
-0.0004485460522118956,
0.009215019643306732,
0.06724084913730621,
-0.010249909944832325,
-0.025665270164608955,
0.0017458143411204219,
-0.058313798159360886,
0.04063967615365982,
-0.021111754700541496,
-0.05442621186375618,
0.1015092059969902,
0.056909944862127304,
0.030074801295995712,
0.024459397420287132,
-0.025863248854875565,
0.028832932934165,
-0.01762012578547001,
0.07325220853090286,
0.0004575450730044395,
-0.026259206235408783,
-0.015892310068011284,
-0.04704699665307999,
-0.028814934194087982,
-0.01994187943637371,
0.08444701880216599,
0.11050824820995331,
-0.024243421852588654,
0.023001553490757942,
0.023109542205929756,
0.018349047750234604,
0.029282884672284126,
-0.028167003765702248,
-0.004481523297727108,
-0.007010254543274641,
-0.022461609914898872,
0.03811994567513466,
0.031640633940696716,
-0.04481523483991623,
-0.024531390517950058,
-0.001581581775099039,
-0.054174236953258514,
-0.02937287651002407,
-0.052734389901161194,
0.02901291474699974,
0.005835879128426313,
-0.03470030799508095,
0.047802913933992386,
0.03151464834809303,
0.013462567701935768,
0.06094151735305786,
0.0533103309571743,
-0.002953935880213976,
-0.0889105424284935,
-0.03540223464369774,
-0.06205739825963974,
0.027159111574292183,
0.026007233187556267,
0.017917094752192497,
0.011554771102964878,
0.034556325525045395,
-0.03923582658171654,
-0.0262772049754858,
-0.02413543313741684,
0.001052887993864715,
0.019869886338710785,
-0.02391945570707321,
0.09884548932313919,
-0.07933556288480759,
0.02319953218102455,
-0.08271919935941696,
-0.013669545762240887,
0.012922625057399273,
0.006542304065078497,
-0.014731433242559433,
0.0033971385564655066,
0.02665516547858715,
0.01658523641526699,
-0.03540223464369774,
0.011563769541680813,
0.0037481014151126146,
0.02813100814819336,
0.02321753092110157,
0.010924837552011013,
-0.022767579182982445,
-0.078399658203125,
0.011797744780778885,
-0.035834189504384995,
-0.004261046648025513,
-0.022389618679881096,
0.004461275413632393,
-0.08235923945903778,
0.046867016702890396,
-0.007838166318833828,
-0.046327073127031326,
0.012670652009546757,
0.022749580442905426,
0.04009973630309105,
0.031856611371040344,
0.01762012578547001,
-0.02197566255927086,
0.001653574057854712,
0.03797595947980881,
-0.02048182114958763,
-0.017350153997540474,
0.011770747601985931,
-0.01941993460059166,
-0.012409679591655731,
-0.007550196722149849,
-0.006821274291723967,
0.00299668125808239,
-0.0648650974035263,
0.03736402466893196,
-0.05521812662482262,
-0.021813679486513138,
-0.006573800928890705,
-0.049710713326931,
-0.014920412562787533,
-0.010267907753586769,
-0.007896659895777702,
-0.05194247514009476,
0.0315326452255249,
-0.010204914957284927,
-0.0007322971359826624,
-0.002521981718018651,
0.004935975186526775,
0.021831678226590157,
-0.02287556603550911,
0.004085565451532602,
-0.0013836028520017862,
0.01662123203277588,
0.04737096279859543,
0.045643143355846405,
-0.015991298481822014,
0.007959653623402119,
0.0027537071146070957,
-0.0047829910181462765,
-0.017116179689764977,
0.0009544609929434955,
-0.08977445214986801,
-0.0017773109721019864,
0.01868201233446598,
0.0031699128448963165,
0.04909877851605415,
-0.02922889031469822,
0.018187064677476883,
0.0427994467318058,
-0.02303754910826683,
-0.0043397885747253895,
0.002656967379152775,
-0.024459397420287132,
0.040747664868831635,
0.03515025973320007,
0.003482629545032978,
0.03194660320878029,
0.08264721184968948,
-0.009565982036292553,
0.04211552068591118,
-0.012283693067729473,
-0.0297328382730484,
0.01478542760014534,
0.001250866916961968,
0.01205871719866991,
0.03952379524707794,
-0.03160463646054268,
-0.004096814431250095,
-0.07048050314188004,
-0.03883986920118332,
0.05766586586833,
-0.011356792412698269,
0.03462831676006317,
-0.06000561639666557,
-0.02359548956155777,
-0.00008239748422056437,
0.031154686585068703,
-0.008868556469678879,
0.05878174677491188,
-0.003685107920318842,
0.01660323329269886,
0.0058988723903894424,
0.06698887795209885,
0.016990192234516144,
0.047262974083423615,
-0.05219445005059242,
-0.053454313427209854,
-0.0022126396652311087,
0.0038628391921520233,
-0.018268056213855743,
-0.049602724611759186,
0.008283618837594986,
0.049602724611759186,
0.06965259462594986,
-0.02174168825149536,
0.004101313650608063,
-0.10554077476263046,
-0.044743239879608154,
-0.02325352653861046,
-0.0019201707327738404,
-0.033440444618463516,
0.0016018296591937542,
-0.05082659423351288,
-0.01606329157948494,
0.030524753034114838,
0.05068260803818703,
-0.02757306769490242,
0.025827253237366676,
0.009448994882404804,
-0.02195766381919384,
-0.02575526013970375,
0.030740730464458466,
-0.019473928958177567,
-0.011284799315035343,
0.009682970121502876,
0.011950728483498096,
0.011122817173600197,
0.0024747366551309824,
-0.051078565418720245,
-0.02739308588206768,
-0.01752113550901413,
0.09215019643306732,
0.021147750318050385,
-0.008909052237868309,
-0.03410637378692627,
0.019473928958177567,
-0.02703312411904335,
0.03732803091406822,
0.06616096198558807,
0.022587597370147705,
-0.006875268649309874,
-0.03155064582824707,
0.014263482764363289,
0.00415530800819397,
0.000156358364620246,
-0.045103203505277634,
-0.02629520371556282,
0.052734389901161194,
0.04575113207101822,
-0.03155064582824707,
-0.01660323329269886,
-0.017089182510972023,
0.02519731968641281,
-0.029678843915462494,
0.02051781676709652,
0.0212557390332222,
0.010177917778491974,
-0.006177843082696199,
-0.056873951107263565,
0.010861844755709171,
0.04258346930146217,
-0.014857419766485691,
0.07422410696744919,
0.0006681789527647197,
0.0013284836895763874,
0.002081028651446104,
-0.005871875211596489,
-0.042331498116254807,
0.07818368077278137,
-0.061589449644088745,
0.0069292630068957806,
0.01234668679535389,
-0.014245484955608845,
0.005390426609665155,
-0.0001424379734089598,
0.02609722502529621,
0.07573594152927399,
-0.025899244472384453,
0.028202999383211136,
0.032414551824331284,
0.012760642915964127,
0.03660810738801956,
-0.002308254363015294,
-0.03394439071416855,
0.037651993334293365,
-0.0435553677380085,
0.0239554513245821,
0.07854364812374115,
-0.017008190974593163,
0.010456888005137444,
0.005538910627365112,
-0.00025197319337166846,
-0.0019325444009155035,
-0.05874575302004814,
0.021813679486513138,
0.03732803091406822,
0.002958435332402587,
-0.07069648057222366,
-0.05500214919447899,
0.028454972431063652,
0.006321827415376902,
-0.014038506895303726,
-0.07465606182813644,
-0.04247548058629036,
0.0037953462451696396,
0.038371916860342026,
0.03883986920118332,
-0.029984811320900917,
0.07710380107164383,
0.03394439071416855,
-0.021867673844099045,
0.061589449644088745,
0.014677438884973526,
-0.03732803091406822,
0.047082990407943726,
-0.04117961972951889,
0.011041825637221336,
-0.03630213811993599,
-0.011581768281757832,
0.012769641354680061,
0.011482778936624527,
0.08070341497659683,
0.06932862848043442,
0.03236055746674538,
0.0031699128448963165,
-0.0445992574095726,
-0.03050675429403782,
-0.05518212914466858,
0.054534200578927994,
-0.016432251781225204,
-0.038191936910152435,
0.03862389177083969,
0.0029674344696104527,
0.007455707062035799,
-0.018430039286613464,
-0.04323140159249306,
0.05676596239209175,
0.01186973787844181,
-0.027159111574292183,
-0.05475017800927162,
-0.029282884672284126,
0.005318434443324804,
0.02505333535373211,
-0.005367929115891457,
-0.0548221692442894,
0.01943793334066868,
0.010438889265060425,
-0.022425614297389984,
0.028886927291750908,
-0.039127837866544724,
-0.011266801506280899,
-0.006965259090065956,
0.012166705913841724,
-0.031838614493608475,
0.031658630818128586,
-0.05806182324886322,
0.09359004348516464,
0.0012249946594238281,
0.019077971577644348,
0.013048612512648106,
-0.00022835070558357984,
-0.04841484874486923,
-0.04189954325556755,
0.005259940400719643,
0.05219445005059242,
0.017926093190908432,
-0.06522506475448608,
-0.01776411011815071,
-0.018286054953932762,
-0.05493015795946121,
0.03173062577843666,
0.046363066881895065,
0.0020202849991619587,
-0.06738483160734177,
0.06619695574045181,
0.004940474405884743,
0.0007086746045388281,
0.09294211119413376,
-0.029678843915462494,
-0.025683268904685974,
-0.05010667070746422,
0.0034466334618628025,
-0.018268056213855743,
-0.04884680360555649,
-0.0299668125808239,
-0.03754400834441185,
-0.038731880486011505,
-0.005349930841475725,
-0.005966365337371826,
0.02175968512892723,
0.05986163392663002,
0.038191936910152435,
0.04395132511854172,
0.000650180852971971,
-0.027321094647049904,
0.009502989239990711,
0.011887735687196255,
-0.031100692227482796,
-0.07645586878061295,
-0.0025917242746800184,
-0.05928569287061691,
-0.0277890432626009,
0.014281480573117733,
0.0201218593865633,
-0.009772960096597672,
-0.010168918408453465,
0.02791503071784973,
-0.010672864504158497,
0.02814900502562523,
-0.006834772881120443,
0.042151518166065216,
0.01250866986811161,
0.019113967195153236,
-0.009395000524818897,
-0.03245054930448532,
-0.01814207062125206,
-0.038911860436201096,
-0.005939368158578873,
0.01868201233446598,
0.02609722502529621,
0.058889735490083694,
-0.05194247514009476,
0.04081965982913971,
-0.05010667070746422,
-0.05007067322731018,
-0.028958920389413834,
0.02049981988966465,
-0.030758729204535484,
0.05583006143569946,
0.04265546426177025,
-0.018286054953932762,
-0.046543050557374954,
0.020409829914569855,
0.014209488406777382,
0.034214362502098083,
-0.01097883190959692,
-0.008576087653636932,
-0.021003765985369682,
0.053418319672346115,
0.020445825532078743,
0.03227056562900543,
-0.06785278022289276,
-0.0028054516296833754,
-0.01197772566229105,
-0.017512137070298195,
0.011878736317157745,
0.02521531842648983,
-0.015559344552457333,
0.03392639011144638,
-0.06241736188530922,
0.038371916860342026,
0.05932169035077095,
-0.022821571677923203,
0.004006823990494013,
-0.019005978479981422,
0.005030464846640825,
-0.01696319505572319,
0.000017066544387489557,
-0.02287556603550911,
-0.0239554513245821,
0.03336844965815544,
0.034718308597803116,
-0.032594531774520874,
-0.053814277052879333,
0.05896172672510147,
0.023721477016806602,
0.045607149600982666,
0.0022171391174197197,
-0.014641442336142063,
0.004252047743648291,
0.00290444097481668,
-0.020013870671391487,
0.03572620078921318,
0.006960759405046701,
-0.03083072043955326,
-0.00045220190077088773,
-0.03605016693472862,
0.04996268451213837,
0.016099287196993828,
-0.05964565649628639,
-0.0010005810763686895,
0.011212807148694992,
0.01289562787860632,
-0.02737508900463581,
-0.06274132430553436,
0.04387933388352394,
0.0017131927888840437,
-0.05129454284906387,
0.024765366688370705,
0.03822793439030647,
0.02397345006465912,
-0.01902397722005844,
0.01206771656870842,
0.0073027233593165874,
-0.01838504523038864,
-0.06209339573979378,
0.013822529464960098,
0.04153958335518837,
0.004166556987911463,
-0.04567914083600044,
-0.01789909601211548,
0.0558660589158535,
0.01598230004310608,
0.048522837460041046,
-0.028778938576579094,
-0.02814900502562523,
-0.018430039286613464,
0.00851309485733509,
0.00135885551571846,
0.03246854618191719,
0.04920676723122597,
-0.06518906354904175,
0.02885093167424202,
0.0058583770878612995,
-0.0212557390332222,
0.0735761746764183,
0.010609871707856655,
0.006114849355071783,
0.016090288758277893,
0.0005722828791476786,
-0.044023316353559494,
-0.004935975186526775,
0.0479109026491642,
0.028922922909259796,
-0.015775322914123535,
-0.08027146011590958,
0.009925943799316883,
0.05863776430487633,
0.00827012024819851,
-0.0301107969135046,
0.04665103927254677,
-0.006092351861298084,
-0.08804663270711899,
0.0012249946594238281,
0.02141772210597992,
-0.015280374325811863,
-0.04751494526863098,
0.009197021834552288,
0.029498862102627754,
0.012175705283880234,
-0.047298967838287354,
0.01786310039460659,
-0.033296458423137665,
0.003554621944203973,
0.049602724611759186,
-0.022191639989614487,
-0.03880387172102928,
-0.024549389258027077,
0.02757306769490242,
-0.03264852613210678,
0.0042767953127622604,
-0.03797595947980881,
0.035474225878715515,
0.07782372087240219,
-0.0507546029984951,
-0.0019224205752834678,
0.02247960865497589,
-0.008099138736724854,
0.00378409749828279,
0.015838315710425377,
-0.04186354577541351,
-0.014560450799763203,
-0.03462831676006317,
0.02575526013970375,
-0.01225669588893652,
0.00684827147051692,
0.02537730149924755,
-0.012670652009546757,
-0.08041545003652573,
0.016153281554579735,
0.003016929142177105,
0.03614015504717827,
0.016117285937070847,
-0.04521119222044945,
0.0197439007461071,
0.055974047631025314,
0.018187064677476883,
0.018169067800045013,
0.04553515836596489,
-0.012283693067729473,
0.004393782466650009,
-0.049782704561948776,
-0.013516562059521675,
-0.012310690246522427,
-0.008828060701489449,
-0.0035298746079206467,
0.11626763641834259,
-0.015631336718797684,
-0.019347941502928734,
0.020463822409510612,
-0.022731581702828407,
0.015181384980678558,
-0.050322648137807846,
-0.03434034809470177,
0.021669695153832436,
-0.11583568155765533,
0.010051931254565716,
-0.015028401277959347,
0.04153958335518837,
-0.003678358858451247,
-0.05208646133542061,
-0.04211552068591118,
-0.024405404925346375,
0.02379346825182438,
0.006623295601457357,
0.018250059336423874,
0.00748720346018672,
0.01398451253771782,
0.032018594443798065,
0.04657904431223869,
-0.029714839532971382,
-0.0014061004621908069,
-0.02084178291261196,
-0.04823486879467964,
-0.008094638586044312,
0.007815668359398842,
0.047298967838287354,
0.0481988750398159,
0.008828060701489449,
0.0063038296066224575,
-0.01289562787860632,
0.021525710821151733,
-0.00926901400089264,
0.00684827147051692,
0.03426835313439369,
0.013606552965939045,
0.06983257085084915,
-0.03284650668501854,
-0.04081965982913971,
-0.010168918408453465,
-0.030434763059020042,
-0.008283618837594986,
0.021345729008316994,
-0.0627773255109787,
-0.02120174467563629,
-0.010843846946954727,
-0.03423235937952995,
0.05424622818827629,
-0.048342857509851456,
-0.04553515836596489,
-0.03686007857322693,
0.02994881384074688,
0.019671907648444176,
0.02084178291261196,
-0.030200786888599396,
-0.04809088632464409,
-0.01618027873337269,
0.015154387801885605,
0.05356230214238167,
0.005336432252079248,
-0.03196460008621216,
0.02010386250913143,
0.010717860423028469,
0.008760567754507065,
-0.0558660589158535,
-0.005043963436037302,
-0.006276832427829504,
-0.005264440085738897,
-0.029822828248143196,
0.019491925835609436,
-0.03977577015757561,
-0.007014753762632608,
0.05608203634619713,
-0.03955979272723198,
-0.045463163405656815,
-0.06720484793186188,
0.044023316353559494,
0.0043397885747253895,
0.009889948181807995,
0.01994187943637371,
-0.06119349226355553,
0.05536211282014847,
-0.045103203505277634,
0.03158663958311081,
-0.0021136500872671604,
-0.012463673949241638,
0.03122667782008648,
-0.006002361420542002,
0.03700406476855278,
0.05259040743112564,
0.015190384350717068,
-0.035114265978336334,
-0.017494138330221176,
0.053418319672346115,
0.03372841328382492,
0.022749580442905426,
-0.021849675104022026,
0.04103563353419304,
-0.0038290927186608315,
-0.03232455998659134,
0.037436019629240036,
0.012823635712265968,
-0.051078565418720245,
-0.019329944625496864,
-0.006375821772962809,
-0.005813381634652615,
0.06454113125801086,
-0.013291586190462112,
-0.00028318862314336,
0.02849096991121769,
-0.04240348935127258,
-0.01940193586051464,
0.023271525278687477,
-0.029084905982017517,
0.02469337359070778,
0.007307222578674555,
0.0024184926878660917,
0.001384727656841278,
0.005120455287396908,
0.03572620078921318,
-0.0239554513245821,
-0.03504227101802826,
0.024225423112511635,
0.04063967615365982,
-0.017989085987210274,
-0.003001180710271001,
0.048018891364336014,
-0.02411743439733982,
0.025845250114798546,
0.026025231927633286,
-0.002998931100592017,
0.0427994467318058,
0.06076153740286827,
-0.05939368158578873,
0.0025534783490002155,
-0.002942686900496483,
-0.061229486018419266,
-0.11439583450555801,
-0.04179155454039574,
-0.01822306215763092,
0.06648492813110352,
0.04812688007950783,
-0.02757306769490242,
0.059969622641801834,
0.050358641892671585,
0.0025939741171896458
]
|
36,524 | torch_pso.optim.ImprovedSineCosineAlgorithm | r1 | Calculate the r1 value for the current timestep | def r1(self):
"""Calculate the r1 value for the current timestep"""
return (self.a_start - self.a_end) * math.exp(
-self.current_time_step ** 2 / (self.k * self.max_time_steps) ** 2) + self.a_end
| (self) | [
-0.012714950367808342,
0.009407644160091877,
0.021031981334090233,
0.0828511118888855,
0.045681606978178024,
-0.024294953793287277,
-0.02979235164821148,
-0.03619416058063507,
-0.04621361196041107,
0.05667640268802643,
0.032541051506996155,
0.007124450523406267,
0.07008296251296997,
0.08292204141616821,
-0.04685201868414879,
0.018620219081640244,
0.01434643566608429,
0.007496855221688747,
-0.04621361196041107,
-0.013309023343026638,
0.027859395369887352,
-0.007638723589479923,
-0.02014530450105667,
0.04550426825881004,
-0.049086444079875946,
0.0030147021170705557,
0.013504092581570148,
-0.01945369690656662,
-0.08270924538373947,
-0.03720497339963913,
-0.01886848919093609,
-0.0356798879802227,
0.018230082467198372,
-0.03491734340786934,
0.04053887724876404,
-0.045468803495168686,
-0.03129970282316208,
-0.0047392891719937325,
-0.08334764838218689,
0.008685002103447914,
0.03968766704201698,
0.031015966087579727,
-0.01167753804475069,
-0.0018841888522729278,
-0.02617470920085907,
-0.04550426825881004,
0.01549911592155695,
0.005439764354377985,
0.034952811896800995,
-0.005444197449833155,
0.03507694602012634,
0.03027115762233734,
-0.015605517663061619,
-0.02085464634001255,
-0.01846061833202839,
0.06820320338010788,
0.008653968572616577,
-0.02035810612142086,
-0.0633796826004982,
-0.022894002497196198,
0.027593392878770828,
0.004313684068620205,
0.04571707174181938,
0.045078665018081665,
0.04202849417924881,
0.024702824652194977,
0.002020515501499176,
0.010515990667045116,
0.022291062399744987,
0.04199302941560745,
-0.018708886578679085,
0.006969282403588295,
-0.00867170188575983,
-0.06433729082345963,
-0.006641211453825235,
0.047703228890895844,
-0.04564613848924637,
0.005825468804687262,
0.03147703781723976,
-0.03912019357085228,
-0.011580003425478935,
0.010294320993125439,
0.032345980405807495,
-0.054796647280454636,
-0.019790632650256157,
-0.014364168979227543,
-0.06015217676758766,
-0.0204467736184597,
-0.009363310411572456,
-0.024401353672146797,
0.011429267935454845,
-0.014284368604421616,
0.0008772561559453607,
0.043766383081674576,
0.05788228288292885,
0.004251617006957531,
-0.06579144299030304,
-0.03601682558655739,
-0.0027752993628382683,
-0.050398726016283035,
0.015871521085500717,
0.025022028014063835,
-0.052207548171281815,
0.014816374517977238,
0.01510011125355959,
0.006712145637720823,
-0.007434787694364786,
-0.010808594524860382,
0.0110391303896904,
0.024046683683991432,
-0.06185459718108177,
0.048199769109487534,
-0.07816945761442184,
-0.013663694262504578,
-0.11420401185750961,
0.016492193564772606,
-0.018886223435401917,
0.06235113367438316,
0.012528747320175171,
0.041673824191093445,
0.08682342618703842,
-0.00822393037378788,
0.011251932941377163,
0.04490133002400398,
-0.0245609562844038,
-0.017884276807308197,
0.042773302644491196,
0.009797782637178898,
-0.05947830155491829,
-0.04600080847740173,
0.045965343713760376,
0.055186785757541656,
0.02558950148522854,
0.05582519248127937,
0.010861794464290142,
0.03562668710947037,
0.03961673378944397,
0.014603571966290474,
0.02135118469595909,
0.03392426669597626,
0.018389683216810226,
-0.0005713525461032987,
0.05117900297045708,
-0.014319835230708122,
0.02796579711139202,
-0.004996425472199917,
0.02557176910340786,
0.08547567576169968,
-0.014240034855902195,
0.02204279415309429,
0.018833022564649582,
0.03472227603197098,
0.09689607471227646,
-0.017192669212818146,
0.04685201868414879,
-0.008649535477161407,
0.022007325664162636,
0.022787602618336678,
-0.0441565215587616,
-0.054725710302591324,
-0.0403260737657547,
0.00574123440310359,
-0.006330874748528004,
-0.03268291801214218,
0.032931189984083176,
0.004353584721684456,
-0.048377104103565216,
0.030554894357919693,
-0.014417369849979877,
-0.03670843318104744,
0.03422573581337929,
-0.03482867777347565,
0.019028091803193092,
-0.011846005916595459,
-0.03642469644546509,
0.009265775792300701,
-0.009921916760504246,
0.05085980147123337,
-0.011987874284386635,
0.014683373272418976,
0.026848582550883293,
-0.03037755750119686,
-0.07203365117311478,
-0.060329511761665344,
0.009478578343987465,
0.03922659531235695,
0.032753851264715195,
-0.0025137297343462706,
0.01208540890365839,
-0.009478578343987465,
0.02326640859246254,
0.005195927806198597,
-0.0009731281315907836,
-0.030040621757507324,
-0.002546980045735836,
-0.015906987711787224,
0.015827186405658722,
0.008587467484176159,
0.06277673691511154,
0.019134491682052612,
-0.041673824191093445,
0.007026916369795799,
-0.03848178684711456,
0.005466364324092865,
0.008192896842956543,
-0.03050169348716736,
-0.006619044579565525,
0.03401293605566025,
-0.003506808076053858,
0.007957926951348782,
-0.05997484177350998,
-0.0036043424624949694,
-0.021297983825206757,
0.006619044579565525,
-0.036672964692115784,
-0.009159374982118607,
-0.04571707174181938,
-0.014044965617358685,
0.02927807904779911,
0.039581265300512314,
0.020038902759552002,
-0.0403260737657547,
0.035555753856897354,
-0.055505987256765366,
0.048589907586574554,
-0.034349869936704636,
-0.0015949105145409703,
-0.0087781036272645,
-0.07320406287908554,
0.0010224495781585574,
0.03241691738367081,
-0.03028889000415802,
0.010152452625334263,
-0.05667640268802643,
0.023727480322122574,
0.05394543707370758,
-0.021723588928580284,
0.008693869225680828,
-0.05582519248127937,
0.039368465542793274,
-0.029668215662240982,
0.04816430062055588,
0.013202622532844543,
0.044688526540994644,
-0.039368465542793274,
-0.028905674815177917,
0.03078543022274971,
0.04383731633424759,
-0.017299070954322815,
0.0024427955504506826,
-0.012980952858924866,
-0.02738058939576149,
-0.012378012761473656,
0.03340999409556389,
0.028107665479183197,
0.0030634694267064333,
0.05699560418725014,
0.031938109546899796,
0.0260683074593544,
0.022610265761613846,
0.06568504124879837,
0.007341686636209488,
-0.047986965626478195,
-0.01595132052898407,
-0.04270236939191818,
0.06784853339195251,
-0.02707911841571331,
0.01128739956766367,
0.016873465850949287,
0.032541051506996155,
0.12434759736061096,
0.012537614442408085,
-0.04000687226653099,
-0.023230940103530884,
0.008188462816178799,
0.009753447957336903,
0.058520689606666565,
0.0032164212316274643,
-0.03901379182934761,
-0.021209316328167915,
-0.012386878952383995,
-0.002899434184655547,
0.029526347294449806,
0.01564985141158104,
-0.06373435258865356,
-0.02645844593644142,
0.014240034855902195,
-0.032452382147312164,
0.050114989280700684,
0.0016093190060928464,
0.02388708107173443,
0.019613297656178474,
0.027256455272436142,
0.01776900887489319,
0.1185309961438179,
-0.010010584257543087,
0.004260483663529158,
-0.06295407563447952,
0.012847951613366604,
0.06284767389297485,
0.016066590324044228,
-0.01593358814716339,
-0.05529318377375603,
-0.003642026335000992,
-0.08136149495840073,
-0.01164207048714161,
0.048199769109487534,
0.04983125254511833,
0.06458555907011032,
-0.03489961102604866,
-0.06015217676758766,
0.027912596240639687,
-0.011810539290308952,
-0.0052757286466658115,
-0.020907847210764885,
-0.02326640859246254,
0.055612388998270035,
0.027256455272436142,
0.05085980147123337,
0.01924089342355728,
-0.02016303688287735,
0.048873644322156906,
0.035768553614616394,
-0.025837771594524384,
0.017494140192866325,
-0.027522457763552666,
-0.00611807219684124,
0.005661433562636375,
-0.024188552051782608,
-0.015889253467321396,
-0.05908816307783127,
-0.02936674654483795,
0.007026916369795799,
0.049937654286623,
-0.057811349630355835,
-0.02257479913532734,
0.04043247550725937,
-0.0008744852966628969,
-0.014878442510962486,
-0.03262971714138985,
0.052313949912786484,
-0.0161286573857069,
0.01470110658556223,
0.013575026765465736,
0.03841085359454155,
0.030767695978283882,
0.07284939289093018,
-0.04068074747920036,
0.05284595489501953,
-0.012697216123342514,
-0.044582124799489975,
-0.011987874284386635,
-0.0027043651789426804,
-0.0027952496893703938,
0.007204251829534769,
0.06373435258865356,
-0.03982953727245331,
-0.035041481256484985,
-0.0027797326911240816,
-0.050788864493370056,
-0.005776701495051384,
0.03438533842563629,
-0.06979922205209732,
0.02777072787284851,
0.00011693054693751037,
0.01874435506761074,
-0.07533209025859833,
0.04972485452890396,
-0.0035223248414695263,
0.006596877705305815,
-0.04965391755104065,
0.012652882374823093,
-0.013841030187904835,
0.01766260899603367,
-0.005798868369311094,
0.03873005509376526,
0.024649623781442642,
-0.022432930767536163,
-0.01756507344543934,
-0.05990390479564667,
0.03117556683719158,
0.012307078577578068,
-0.08199989795684814,
0.04763229563832283,
0.005630399566143751,
0.027416056022047997,
0.007377153728157282,
-0.06263487040996552,
0.030661294236779213,
0.010551457293331623,
0.03883645683526993,
-0.01439076941460371,
0.014115899801254272,
-0.03296665474772453,
-0.05323609337210655,
0.01996796950697899,
0.013060754165053368,
-0.0011083463905379176,
-0.07504834979772568,
0.012307078577578068,
-0.01208540890365839,
0.018833022564649582,
-0.024046683683991432,
-0.038552720099687576,
0.010391855612397194,
-0.05944283306598663,
0.07632516324520111,
-0.012927751988172531,
-0.03477547690272331,
0.03172530606389046,
-0.08710715919733047,
-0.0026954985223710537,
-0.01394743099808693,
-0.017671475186944008,
-0.029047543182969093,
-0.028551002964377403,
-0.03020022250711918,
-0.0595492348074913,
-0.01509124506264925,
0.0333213247358799,
-0.055399585515260696,
0.03259425237774849,
-0.025944173336029053,
0.027806194499135017,
0.05015045776963234,
0.01137606706470251,
0.030909564346075058,
0.03142383694648743,
-0.025146164000034332,
0.040964484214782715,
-0.0010534832254052162,
-0.030554894357919693,
-0.044369325041770935,
-0.02518163062632084,
-0.029419947415590286,
0.013220355845987797,
0.0016048855613917112,
-0.02096104808151722,
0.04734855890274048,
-0.013778962194919586,
0.045575205236673355,
0.011748472228646278,
0.04394371807575226,
-0.01876208744943142,
-0.014479437842965126,
-0.07362966984510422,
-0.008104229345917702,
-0.05185287818312645,
-0.05337796360254288,
-0.02227333001792431,
-0.006947115063667297,
0.02237972989678383,
0.027912596240639687,
-0.012369145639240742,
0.014319835230708122,
-0.03289572149515152,
-0.08086495101451874,
-0.030253423377871513,
0.005218094680458307,
-0.05273955687880516,
0.03498828038573265,
0.07327499985694885,
-0.01664292998611927,
0.008148563094437122,
0.022025059908628464,
0.013415425084531307,
0.028639670461416245,
0.032647453248500824,
-0.04915738105773926,
-0.044475723057985306,
0.02177678979933262,
-0.012617415748536587,
-0.00811752863228321,
-0.0115268025547266,
-0.0071820844896137714,
0.006658945232629776,
-0.03340999409556389,
0.005523998290300369,
0.04405011981725693,
-0.048199769109487534,
-0.0762542337179184,
-0.053697165101766586,
0.0330730564892292,
0.03993593901395798,
0.02626337669789791,
0.03961673378944397,
-0.05465477705001831,
0.00037157314363867044,
-0.040077805519104004,
-0.025004295632243156,
-0.025713637471199036,
0.04341171309351921,
0.009141640737652779,
0.07859505712985992,
-0.10391855984926224,
-0.02697271853685379,
0.07589956372976303,
0.010985929518938065,
0.02879927307367325,
0.04816430062055588,
-0.0059274365194141865,
0.03160117194056511,
-0.020499974489212036,
0.020624110475182533,
0.011216465383768082,
0.0034048401284962893,
-0.09512272477149963,
-0.05217208340764046,
-0.07412620633840561,
0.022716667503118515,
0.010604658164083958,
-0.027930328622460365,
0.01514444500207901,
0.03507694602012634,
-0.00019534605962689966,
-0.002895000856369734,
-0.009141640737652779,
0.0009836574317887425,
-0.048589907586574554,
-0.0249688271433115,
-0.06391168385744095,
-0.011996741406619549,
0.010108118876814842,
-0.027948062866926193,
-0.026937250047922134,
0.02697271853685379,
-0.028018997982144356,
-0.03280705213546753,
-0.01563211716711521,
0.06284767389297485,
-0.0017933044582605362,
-0.013317890465259552,
0.011110064573585987,
0.03301985561847687,
-0.04876724258065224,
0.039581265300512314,
-0.08788743615150452,
-0.055718790739774704,
-0.04791603237390518,
0.007275186013430357,
0.009310109540820122,
-0.05107260122895241,
0.07263658940792084,
-0.023000404238700867,
-0.011225332506000996,
0.00035661045694723725,
0.029863284900784492,
0.032558783888816833,
0.024809226393699646,
0.015286313369870186,
0.026156974956393242,
-0.055186785757541656,
0.026919517666101456,
0.020624110475182533,
-0.012333679012954235,
0.043482646346092224,
0.01674933172762394,
0.018283281475305557,
0.03340999409556389,
-0.01803501322865486,
0.02296493761241436,
-0.012972086668014526,
0.08994452655315399,
-0.04316344112157822,
-0.05784681439399719,
-0.012298211455345154,
0.02106744796037674,
0.020127570256590843,
-0.0014929425669834018,
0.025500833988189697,
-0.058520689606666565,
0.013140554539859295,
0.001273490022867918,
-0.05025685951113701,
-0.05224301666021347,
-0.0025026460643857718,
0.03129970282316208,
-0.059832971543073654,
-0.07973000407218933,
-0.01925862766802311,
0.014594705775380135,
-0.035342950373888016,
0.021333452314138412,
-0.07575768977403641,
0.009451977908611298,
0.029313545674085617,
0.005373263265937567,
0.02856873720884323,
-0.04802243411540985,
0.02386934868991375,
-0.06816773861646652,
-0.0395103320479393,
-0.062422070652246475,
-0.02324867434799671,
-0.03028889000415802,
-0.013557293452322483,
0.0301824901252985,
-0.004916624631732702,
-0.012936619110405445,
0.03943939879536629,
0.003229721449315548,
-0.042986106127500534,
0.0001760885352268815,
0.0169443991035223,
-0.052207548171281815,
0.03408386930823326,
0.015153312124311924,
-0.0036841435357928276,
-0.0107731269672513,
-0.016704997047781944,
0.04734855890274048,
-0.010046051815152168,
-0.00019146683916915208,
0.020517708733677864,
0.011172131635248661,
0.027522457763552666,
-0.031140100210905075,
-0.00018010628991760314,
0.018496084958314896,
0.05461931228637695,
-0.03830445185303688,
0.025429900735616684,
-0.03550255298614502,
-0.013353357091546059,
0.003240804886445403,
0.005936303175985813,
0.08661062270402908,
-0.038765523582696915,
0.04142555594444275,
-0.03358732908964157,
0.008649535477161407,
0.03482867777347565,
-0.03571535274386406,
-0.08859677612781525,
0.023816147819161415,
0.025004295632243156,
-0.03340999409556389,
0.04493679478764534,
-0.04149648919701576,
0.024330420419573784,
-0.0038925125263631344,
0.04656828194856644,
-0.05848522111773491,
0.02076597884297371,
0.01474544033408165,
-0.0042937337420880795,
-0.04405011981725693,
-0.005453064106404781,
0.021989593282341957,
0.02738058939576149,
-0.036672964692115784,
0.036850299686193466,
0.03057262673974037,
0.0417092926800251,
-0.027646591886878014,
-0.028320467099547386,
-0.007177651394158602,
-0.0010196786606684327,
-0.03759510815143585,
-0.028941141441464424,
-0.0513208732008934,
-0.013051887042820454,
-0.05284595489501953,
-0.026121508330106735,
-0.0005561127909459174,
-0.011003662832081318,
0.01168640423566103,
-0.011393801309168339,
-0.037169504910707474,
-0.013468625023961067,
-0.03172530606389046,
-0.07107603549957275,
0.04731309041380882,
0.04965391755104065,
0.03677936643362045,
-0.015871521085500717,
0.0065392437390983105,
-0.0009276859345845878,
0.012670615687966347,
0.03186717629432678,
-0.045894406735897064,
0.018371950834989548,
-0.014621305279433727,
-0.026210175827145576,
0.03802071511745453,
-0.03929752856492996,
0.012307078577578068,
0.055399585515260696,
0.0029969685710966587,
0.03477547690272331,
0.001700203400105238,
0.0011925806757062674,
-0.0403260737657547,
0.02266346663236618,
0.03523654863238335,
-0.0008506558369845152,
-0.021297983825206757,
0.02718552015721798,
0.0190635584294796,
-0.005289028864353895,
0.02638751082122326,
-0.020003436133265495,
0.008246096782386303,
0.00942537747323513,
-0.007545622531324625,
0.04642641544342041,
0.03089183010160923,
-0.013291290029883385,
-0.016616329550743103,
-0.007900292985141277,
0.018726620823144913,
0.0856175422668457,
0.0032962223049253225,
0.02667124755680561,
-0.01133173331618309,
0.023000404238700867,
-0.01936502754688263,
0.012049942277371883,
-0.015348381362855434,
0.055186785757541656,
-0.10115212947130203,
-0.016013389453291893,
0.036353763192892075,
-0.004659488331526518,
-0.04053887724876404,
0.05334249511361122,
0.031831707805395126,
-0.004836823791265488,
-0.052313949912786484,
0.017733542248606682,
-0.06373435258865356,
0.0017522956477478147,
0.035467084497213364,
0.011118930764496326,
0.032558783888816833,
0.0003926317149307579,
-0.014922776259481907,
-0.02417081780731678,
0.047596827149391174,
0.0050141592510044575,
0.016421260312199593,
0.0026777649763971567,
0.008113095536828041,
-0.03929752856492996,
0.01148246880620718,
0.0095317792147398,
-0.031530238687992096,
0.03819805011153221,
0.017733542248606682,
-0.05717293918132782,
0.04213489592075348,
0.014222300611436367,
0.026600314304232597,
0.010719926096498966,
0.004938791505992413,
-0.023124540224671364,
0.0071111503057181835,
0.020907847210764885,
-0.004176249261945486,
0.047490425407886505,
0.0018088213400915265,
-0.039262063801288605,
0.022007325664162636,
0.0828511118888855,
-0.023496944457292557,
0.011943540535867214,
0.010108118876814842,
0.014967110008001328
]
|
36,532 | torch_pso.optim.ImprovedSineCosineAlgorithm | step |
Performs a single optimization step.
:param closure: A callable that reevaluates the model and returns the loss.
:return: the final loss after the step (as calculated by the closure)
| def r1(self):
"""Calculate the r1 value for the current timestep"""
return (self.a_start - self.a_end) * math.exp(
-self.current_time_step ** 2 / (self.k * self.max_time_steps) ** 2) + self.a_end
| (self, closure: Callable[[], torch.Tensor]) -> torch.Tensor | [
-0.012714950367808342,
0.009407644160091877,
0.021031981334090233,
0.0828511118888855,
0.045681606978178024,
-0.024294953793287277,
-0.02979235164821148,
-0.03619416058063507,
-0.04621361196041107,
0.05667640268802643,
0.032541051506996155,
0.007124450523406267,
0.07008296251296997,
0.08292204141616821,
-0.04685201868414879,
0.018620219081640244,
0.01434643566608429,
0.007496855221688747,
-0.04621361196041107,
-0.013309023343026638,
0.027859395369887352,
-0.007638723589479923,
-0.02014530450105667,
0.04550426825881004,
-0.049086444079875946,
0.0030147021170705557,
0.013504092581570148,
-0.01945369690656662,
-0.08270924538373947,
-0.03720497339963913,
-0.01886848919093609,
-0.0356798879802227,
0.018230082467198372,
-0.03491734340786934,
0.04053887724876404,
-0.045468803495168686,
-0.03129970282316208,
-0.0047392891719937325,
-0.08334764838218689,
0.008685002103447914,
0.03968766704201698,
0.031015966087579727,
-0.01167753804475069,
-0.0018841888522729278,
-0.02617470920085907,
-0.04550426825881004,
0.01549911592155695,
0.005439764354377985,
0.034952811896800995,
-0.005444197449833155,
0.03507694602012634,
0.03027115762233734,
-0.015605517663061619,
-0.02085464634001255,
-0.01846061833202839,
0.06820320338010788,
0.008653968572616577,
-0.02035810612142086,
-0.0633796826004982,
-0.022894002497196198,
0.027593392878770828,
0.004313684068620205,
0.04571707174181938,
0.045078665018081665,
0.04202849417924881,
0.024702824652194977,
0.002020515501499176,
0.010515990667045116,
0.022291062399744987,
0.04199302941560745,
-0.018708886578679085,
0.006969282403588295,
-0.00867170188575983,
-0.06433729082345963,
-0.006641211453825235,
0.047703228890895844,
-0.04564613848924637,
0.005825468804687262,
0.03147703781723976,
-0.03912019357085228,
-0.011580003425478935,
0.010294320993125439,
0.032345980405807495,
-0.054796647280454636,
-0.019790632650256157,
-0.014364168979227543,
-0.06015217676758766,
-0.0204467736184597,
-0.009363310411572456,
-0.024401353672146797,
0.011429267935454845,
-0.014284368604421616,
0.0008772561559453607,
0.043766383081674576,
0.05788228288292885,
0.004251617006957531,
-0.06579144299030304,
-0.03601682558655739,
-0.0027752993628382683,
-0.050398726016283035,
0.015871521085500717,
0.025022028014063835,
-0.052207548171281815,
0.014816374517977238,
0.01510011125355959,
0.006712145637720823,
-0.007434787694364786,
-0.010808594524860382,
0.0110391303896904,
0.024046683683991432,
-0.06185459718108177,
0.048199769109487534,
-0.07816945761442184,
-0.013663694262504578,
-0.11420401185750961,
0.016492193564772606,
-0.018886223435401917,
0.06235113367438316,
0.012528747320175171,
0.041673824191093445,
0.08682342618703842,
-0.00822393037378788,
0.011251932941377163,
0.04490133002400398,
-0.0245609562844038,
-0.017884276807308197,
0.042773302644491196,
0.009797782637178898,
-0.05947830155491829,
-0.04600080847740173,
0.045965343713760376,
0.055186785757541656,
0.02558950148522854,
0.05582519248127937,
0.010861794464290142,
0.03562668710947037,
0.03961673378944397,
0.014603571966290474,
0.02135118469595909,
0.03392426669597626,
0.018389683216810226,
-0.0005713525461032987,
0.05117900297045708,
-0.014319835230708122,
0.02796579711139202,
-0.004996425472199917,
0.02557176910340786,
0.08547567576169968,
-0.014240034855902195,
0.02204279415309429,
0.018833022564649582,
0.03472227603197098,
0.09689607471227646,
-0.017192669212818146,
0.04685201868414879,
-0.008649535477161407,
0.022007325664162636,
0.022787602618336678,
-0.0441565215587616,
-0.054725710302591324,
-0.0403260737657547,
0.00574123440310359,
-0.006330874748528004,
-0.03268291801214218,
0.032931189984083176,
0.004353584721684456,
-0.048377104103565216,
0.030554894357919693,
-0.014417369849979877,
-0.03670843318104744,
0.03422573581337929,
-0.03482867777347565,
0.019028091803193092,
-0.011846005916595459,
-0.03642469644546509,
0.009265775792300701,
-0.009921916760504246,
0.05085980147123337,
-0.011987874284386635,
0.014683373272418976,
0.026848582550883293,
-0.03037755750119686,
-0.07203365117311478,
-0.060329511761665344,
0.009478578343987465,
0.03922659531235695,
0.032753851264715195,
-0.0025137297343462706,
0.01208540890365839,
-0.009478578343987465,
0.02326640859246254,
0.005195927806198597,
-0.0009731281315907836,
-0.030040621757507324,
-0.002546980045735836,
-0.015906987711787224,
0.015827186405658722,
0.008587467484176159,
0.06277673691511154,
0.019134491682052612,
-0.041673824191093445,
0.007026916369795799,
-0.03848178684711456,
0.005466364324092865,
0.008192896842956543,
-0.03050169348716736,
-0.006619044579565525,
0.03401293605566025,
-0.003506808076053858,
0.007957926951348782,
-0.05997484177350998,
-0.0036043424624949694,
-0.021297983825206757,
0.006619044579565525,
-0.036672964692115784,
-0.009159374982118607,
-0.04571707174181938,
-0.014044965617358685,
0.02927807904779911,
0.039581265300512314,
0.020038902759552002,
-0.0403260737657547,
0.035555753856897354,
-0.055505987256765366,
0.048589907586574554,
-0.034349869936704636,
-0.0015949105145409703,
-0.0087781036272645,
-0.07320406287908554,
0.0010224495781585574,
0.03241691738367081,
-0.03028889000415802,
0.010152452625334263,
-0.05667640268802643,
0.023727480322122574,
0.05394543707370758,
-0.021723588928580284,
0.008693869225680828,
-0.05582519248127937,
0.039368465542793274,
-0.029668215662240982,
0.04816430062055588,
0.013202622532844543,
0.044688526540994644,
-0.039368465542793274,
-0.028905674815177917,
0.03078543022274971,
0.04383731633424759,
-0.017299070954322815,
0.0024427955504506826,
-0.012980952858924866,
-0.02738058939576149,
-0.012378012761473656,
0.03340999409556389,
0.028107665479183197,
0.0030634694267064333,
0.05699560418725014,
0.031938109546899796,
0.0260683074593544,
0.022610265761613846,
0.06568504124879837,
0.007341686636209488,
-0.047986965626478195,
-0.01595132052898407,
-0.04270236939191818,
0.06784853339195251,
-0.02707911841571331,
0.01128739956766367,
0.016873465850949287,
0.032541051506996155,
0.12434759736061096,
0.012537614442408085,
-0.04000687226653099,
-0.023230940103530884,
0.008188462816178799,
0.009753447957336903,
0.058520689606666565,
0.0032164212316274643,
-0.03901379182934761,
-0.021209316328167915,
-0.012386878952383995,
-0.002899434184655547,
0.029526347294449806,
0.01564985141158104,
-0.06373435258865356,
-0.02645844593644142,
0.014240034855902195,
-0.032452382147312164,
0.050114989280700684,
0.0016093190060928464,
0.02388708107173443,
0.019613297656178474,
0.027256455272436142,
0.01776900887489319,
0.1185309961438179,
-0.010010584257543087,
0.004260483663529158,
-0.06295407563447952,
0.012847951613366604,
0.06284767389297485,
0.016066590324044228,
-0.01593358814716339,
-0.05529318377375603,
-0.003642026335000992,
-0.08136149495840073,
-0.01164207048714161,
0.048199769109487534,
0.04983125254511833,
0.06458555907011032,
-0.03489961102604866,
-0.06015217676758766,
0.027912596240639687,
-0.011810539290308952,
-0.0052757286466658115,
-0.020907847210764885,
-0.02326640859246254,
0.055612388998270035,
0.027256455272436142,
0.05085980147123337,
0.01924089342355728,
-0.02016303688287735,
0.048873644322156906,
0.035768553614616394,
-0.025837771594524384,
0.017494140192866325,
-0.027522457763552666,
-0.00611807219684124,
0.005661433562636375,
-0.024188552051782608,
-0.015889253467321396,
-0.05908816307783127,
-0.02936674654483795,
0.007026916369795799,
0.049937654286623,
-0.057811349630355835,
-0.02257479913532734,
0.04043247550725937,
-0.0008744852966628969,
-0.014878442510962486,
-0.03262971714138985,
0.052313949912786484,
-0.0161286573857069,
0.01470110658556223,
0.013575026765465736,
0.03841085359454155,
0.030767695978283882,
0.07284939289093018,
-0.04068074747920036,
0.05284595489501953,
-0.012697216123342514,
-0.044582124799489975,
-0.011987874284386635,
-0.0027043651789426804,
-0.0027952496893703938,
0.007204251829534769,
0.06373435258865356,
-0.03982953727245331,
-0.035041481256484985,
-0.0027797326911240816,
-0.050788864493370056,
-0.005776701495051384,
0.03438533842563629,
-0.06979922205209732,
0.02777072787284851,
0.00011693054693751037,
0.01874435506761074,
-0.07533209025859833,
0.04972485452890396,
-0.0035223248414695263,
0.006596877705305815,
-0.04965391755104065,
0.012652882374823093,
-0.013841030187904835,
0.01766260899603367,
-0.005798868369311094,
0.03873005509376526,
0.024649623781442642,
-0.022432930767536163,
-0.01756507344543934,
-0.05990390479564667,
0.03117556683719158,
0.012307078577578068,
-0.08199989795684814,
0.04763229563832283,
0.005630399566143751,
0.027416056022047997,
0.007377153728157282,
-0.06263487040996552,
0.030661294236779213,
0.010551457293331623,
0.03883645683526993,
-0.01439076941460371,
0.014115899801254272,
-0.03296665474772453,
-0.05323609337210655,
0.01996796950697899,
0.013060754165053368,
-0.0011083463905379176,
-0.07504834979772568,
0.012307078577578068,
-0.01208540890365839,
0.018833022564649582,
-0.024046683683991432,
-0.038552720099687576,
0.010391855612397194,
-0.05944283306598663,
0.07632516324520111,
-0.012927751988172531,
-0.03477547690272331,
0.03172530606389046,
-0.08710715919733047,
-0.0026954985223710537,
-0.01394743099808693,
-0.017671475186944008,
-0.029047543182969093,
-0.028551002964377403,
-0.03020022250711918,
-0.0595492348074913,
-0.01509124506264925,
0.0333213247358799,
-0.055399585515260696,
0.03259425237774849,
-0.025944173336029053,
0.027806194499135017,
0.05015045776963234,
0.01137606706470251,
0.030909564346075058,
0.03142383694648743,
-0.025146164000034332,
0.040964484214782715,
-0.0010534832254052162,
-0.030554894357919693,
-0.044369325041770935,
-0.02518163062632084,
-0.029419947415590286,
0.013220355845987797,
0.0016048855613917112,
-0.02096104808151722,
0.04734855890274048,
-0.013778962194919586,
0.045575205236673355,
0.011748472228646278,
0.04394371807575226,
-0.01876208744943142,
-0.014479437842965126,
-0.07362966984510422,
-0.008104229345917702,
-0.05185287818312645,
-0.05337796360254288,
-0.02227333001792431,
-0.006947115063667297,
0.02237972989678383,
0.027912596240639687,
-0.012369145639240742,
0.014319835230708122,
-0.03289572149515152,
-0.08086495101451874,
-0.030253423377871513,
0.005218094680458307,
-0.05273955687880516,
0.03498828038573265,
0.07327499985694885,
-0.01664292998611927,
0.008148563094437122,
0.022025059908628464,
0.013415425084531307,
0.028639670461416245,
0.032647453248500824,
-0.04915738105773926,
-0.044475723057985306,
0.02177678979933262,
-0.012617415748536587,
-0.00811752863228321,
-0.0115268025547266,
-0.0071820844896137714,
0.006658945232629776,
-0.03340999409556389,
0.005523998290300369,
0.04405011981725693,
-0.048199769109487534,
-0.0762542337179184,
-0.053697165101766586,
0.0330730564892292,
0.03993593901395798,
0.02626337669789791,
0.03961673378944397,
-0.05465477705001831,
0.00037157314363867044,
-0.040077805519104004,
-0.025004295632243156,
-0.025713637471199036,
0.04341171309351921,
0.009141640737652779,
0.07859505712985992,
-0.10391855984926224,
-0.02697271853685379,
0.07589956372976303,
0.010985929518938065,
0.02879927307367325,
0.04816430062055588,
-0.0059274365194141865,
0.03160117194056511,
-0.020499974489212036,
0.020624110475182533,
0.011216465383768082,
0.0034048401284962893,
-0.09512272477149963,
-0.05217208340764046,
-0.07412620633840561,
0.022716667503118515,
0.010604658164083958,
-0.027930328622460365,
0.01514444500207901,
0.03507694602012634,
-0.00019534605962689966,
-0.002895000856369734,
-0.009141640737652779,
0.0009836574317887425,
-0.048589907586574554,
-0.0249688271433115,
-0.06391168385744095,
-0.011996741406619549,
0.010108118876814842,
-0.027948062866926193,
-0.026937250047922134,
0.02697271853685379,
-0.028018997982144356,
-0.03280705213546753,
-0.01563211716711521,
0.06284767389297485,
-0.0017933044582605362,
-0.013317890465259552,
0.011110064573585987,
0.03301985561847687,
-0.04876724258065224,
0.039581265300512314,
-0.08788743615150452,
-0.055718790739774704,
-0.04791603237390518,
0.007275186013430357,
0.009310109540820122,
-0.05107260122895241,
0.07263658940792084,
-0.023000404238700867,
-0.011225332506000996,
0.00035661045694723725,
0.029863284900784492,
0.032558783888816833,
0.024809226393699646,
0.015286313369870186,
0.026156974956393242,
-0.055186785757541656,
0.026919517666101456,
0.020624110475182533,
-0.012333679012954235,
0.043482646346092224,
0.01674933172762394,
0.018283281475305557,
0.03340999409556389,
-0.01803501322865486,
0.02296493761241436,
-0.012972086668014526,
0.08994452655315399,
-0.04316344112157822,
-0.05784681439399719,
-0.012298211455345154,
0.02106744796037674,
0.020127570256590843,
-0.0014929425669834018,
0.025500833988189697,
-0.058520689606666565,
0.013140554539859295,
0.001273490022867918,
-0.05025685951113701,
-0.05224301666021347,
-0.0025026460643857718,
0.03129970282316208,
-0.059832971543073654,
-0.07973000407218933,
-0.01925862766802311,
0.014594705775380135,
-0.035342950373888016,
0.021333452314138412,
-0.07575768977403641,
0.009451977908611298,
0.029313545674085617,
0.005373263265937567,
0.02856873720884323,
-0.04802243411540985,
0.02386934868991375,
-0.06816773861646652,
-0.0395103320479393,
-0.062422070652246475,
-0.02324867434799671,
-0.03028889000415802,
-0.013557293452322483,
0.0301824901252985,
-0.004916624631732702,
-0.012936619110405445,
0.03943939879536629,
0.003229721449315548,
-0.042986106127500534,
0.0001760885352268815,
0.0169443991035223,
-0.052207548171281815,
0.03408386930823326,
0.015153312124311924,
-0.0036841435357928276,
-0.0107731269672513,
-0.016704997047781944,
0.04734855890274048,
-0.010046051815152168,
-0.00019146683916915208,
0.020517708733677864,
0.011172131635248661,
0.027522457763552666,
-0.031140100210905075,
-0.00018010628991760314,
0.018496084958314896,
0.05461931228637695,
-0.03830445185303688,
0.025429900735616684,
-0.03550255298614502,
-0.013353357091546059,
0.003240804886445403,
0.005936303175985813,
0.08661062270402908,
-0.038765523582696915,
0.04142555594444275,
-0.03358732908964157,
0.008649535477161407,
0.03482867777347565,
-0.03571535274386406,
-0.08859677612781525,
0.023816147819161415,
0.025004295632243156,
-0.03340999409556389,
0.04493679478764534,
-0.04149648919701576,
0.024330420419573784,
-0.0038925125263631344,
0.04656828194856644,
-0.05848522111773491,
0.02076597884297371,
0.01474544033408165,
-0.0042937337420880795,
-0.04405011981725693,
-0.005453064106404781,
0.021989593282341957,
0.02738058939576149,
-0.036672964692115784,
0.036850299686193466,
0.03057262673974037,
0.0417092926800251,
-0.027646591886878014,
-0.028320467099547386,
-0.007177651394158602,
-0.0010196786606684327,
-0.03759510815143585,
-0.028941141441464424,
-0.0513208732008934,
-0.013051887042820454,
-0.05284595489501953,
-0.026121508330106735,
-0.0005561127909459174,
-0.011003662832081318,
0.01168640423566103,
-0.011393801309168339,
-0.037169504910707474,
-0.013468625023961067,
-0.03172530606389046,
-0.07107603549957275,
0.04731309041380882,
0.04965391755104065,
0.03677936643362045,
-0.015871521085500717,
0.0065392437390983105,
-0.0009276859345845878,
0.012670615687966347,
0.03186717629432678,
-0.045894406735897064,
0.018371950834989548,
-0.014621305279433727,
-0.026210175827145576,
0.03802071511745453,
-0.03929752856492996,
0.012307078577578068,
0.055399585515260696,
0.0029969685710966587,
0.03477547690272331,
0.001700203400105238,
0.0011925806757062674,
-0.0403260737657547,
0.02266346663236618,
0.03523654863238335,
-0.0008506558369845152,
-0.021297983825206757,
0.02718552015721798,
0.0190635584294796,
-0.005289028864353895,
0.02638751082122326,
-0.020003436133265495,
0.008246096782386303,
0.00942537747323513,
-0.007545622531324625,
0.04642641544342041,
0.03089183010160923,
-0.013291290029883385,
-0.016616329550743103,
-0.007900292985141277,
0.018726620823144913,
0.0856175422668457,
0.0032962223049253225,
0.02667124755680561,
-0.01133173331618309,
0.023000404238700867,
-0.01936502754688263,
0.012049942277371883,
-0.015348381362855434,
0.055186785757541656,
-0.10115212947130203,
-0.016013389453291893,
0.036353763192892075,
-0.004659488331526518,
-0.04053887724876404,
0.05334249511361122,
0.031831707805395126,
-0.004836823791265488,
-0.052313949912786484,
0.017733542248606682,
-0.06373435258865356,
0.0017522956477478147,
0.035467084497213364,
0.011118930764496326,
0.032558783888816833,
0.0003926317149307579,
-0.014922776259481907,
-0.02417081780731678,
0.047596827149391174,
0.0050141592510044575,
0.016421260312199593,
0.0026777649763971567,
0.008113095536828041,
-0.03929752856492996,
0.01148246880620718,
0.0095317792147398,
-0.031530238687992096,
0.03819805011153221,
0.017733542248606682,
-0.05717293918132782,
0.04213489592075348,
0.014222300611436367,
0.026600314304232597,
0.010719926096498966,
0.004938791505992413,
-0.023124540224671364,
0.0071111503057181835,
0.020907847210764885,
-0.004176249261945486,
0.047490425407886505,
0.0018088213400915265,
-0.039262063801288605,
0.022007325664162636,
0.0828511118888855,
-0.023496944457292557,
0.011943540535867214,
0.010108118876814842,
0.014967110008001328
]
|
36,533 | torch_pso.optim.ImprovedSineCosineAlgorithm | w |
Calculate the inertial weight of the particle at the current time step.
| def w(self) -> float:
"""
Calculate the inertial weight of the particle at the current time step.
"""
return self.w_end + (self.w_start - self.w_end) * (
self.max_time_steps - self.current_time_step) / self.max_time_steps
| (self) -> float | [
0.03131381422281265,
-0.006306254304945469,
-0.006267879623919725,
0.050791144371032715,
0.022376757115125656,
-0.0020978208631277084,
-0.033650413155555725,
-0.01490646693855524,
-0.06846059113740921,
0.0753168836236,
0.007184610236436129,
-0.0382724404335022,
0.042638637125492096,
0.014821189455688,
-0.03581645339727402,
0.04059198126196861,
0.017737671732902527,
-0.0036797143984586,
-0.04761882871389389,
-0.008352909237146378,
0.032439474016427994,
-0.025395572185516357,
-0.0041807182133197784,
0.0061058527790009975,
-0.036703336983919144,
0.007321053650230169,
-0.030529262498021126,
-0.003662658855319023,
-0.0669938251376152,
-0.038579437881708145,
-0.010292966850101948,
-0.0017641736194491386,
0.061672523617744446,
-0.03817010670900345,
0.0796830803155899,
-0.008911474607884884,
0.01780589483678341,
0.0008938123937696218,
-0.11802374571561813,
-0.016978705301880836,
0.018590444698929787,
0.0007227248861454427,
0.021336372941732407,
0.044719401746988297,
-0.009073501452803612,
-0.019528495147824287,
0.040387317538261414,
0.023331861943006516,
0.03409385308623314,
-0.009533998556435108,
0.04666372388601303,
-0.005717840977013111,
0.028192665427923203,
-0.009406083263456821,
-0.01017357874661684,
0.05137103050947189,
0.02415052428841591,
-0.05171213671565056,
0.001586157246492803,
-0.039056990295648575,
0.05215558037161827,
-0.013584669679403305,
0.07470288872718811,
-0.016023598611354828,
-0.012433426454663277,
0.018675722181797028,
0.012365204282104969,
0.019067997112870216,
-0.001981630688533187,
0.060171641409397125,
0.06354862451553345,
-0.015307269990444183,
0.004263863433152437,
-0.001957113388925791,
-0.02273492142558098,
0.008792086504399776,
-0.0100883012637496,
-0.03278058394789696,
0.027408115565776825,
-0.023826470598578453,
0.018709832802414894,
0.005913978908210993,
-0.028943106532096863,
0.0030145514756441116,
0.0401485413312912,
-0.03636222705245018,
-0.03595289960503578,
-0.023144250735640526,
-0.03153553605079651,
-0.013985472731292248,
-0.0588754303753376,
0.0696885883808136,
0.05348590388894081,
0.033189915120601654,
0.0615701898932457,
0.0002470375911798328,
-0.044821735471487045,
-0.055737223476171494,
-0.005994992330670357,
0.012424898333847523,
0.005798854399472475,
0.06890403479337692,
-0.012484592385590076,
0.013763751834630966,
0.022274423390626907,
-0.010156523436307907,
-0.011324821971356869,
-0.05386112630367279,
-0.002441061893478036,
0.010096829384565353,
-0.024576909840106964,
0.03690800443291664,
-0.06023986637592316,
0.010659659281373024,
-0.057033438235521317,
0.006208185572177172,
-0.04315029829740524,
0.0674031525850296,
0.053827013820409775,
0.04008031636476517,
0.036703336983919144,
-0.01911916397511959,
-0.020295990630984306,
-0.041990529745817184,
0.005850020796060562,
0.013593196868896484,
0.023894691839814186,
-0.01743920147418976,
-0.003364188363775611,
0.024781575426459312,
-0.0037777831312268972,
0.020313046872615814,
0.0015712337335571647,
0.002441061893478036,
0.015784822404384613,
0.0004570328746922314,
0.02841438725590706,
-0.009551054798066616,
0.05092758685350418,
0.03269530460238457,
0.020227769389748573,
0.04649316892027855,
0.05184858292341232,
0.019272662699222565,
-0.017447730526328087,
0.05730632692575455,
0.01297067292034626,
0.02640184387564659,
-0.0023238055873662233,
0.009917746298015118,
-0.006834973581135273,
-0.005487592425197363,
0.03126264736056328,
-0.020125435665249825,
0.022376757115125656,
-0.015392547473311424,
0.005359676666557789,
-0.0202789343893528,
-0.02679411880671978,
-0.04516284167766571,
-0.04325263202190399,
-0.011836485005915165,
0.0005212573450990021,
0.020381268113851547,
-0.0016053447034209967,
0.06644804775714874,
-0.00301668350584805,
0.03690800443291664,
0.04083075746893883,
0.014932050369679928,
0.012262871488928795,
-0.02546379342675209,
0.00005036688889958896,
0.021097596734762192,
0.025634348392486572,
0.056965216994285583,
0.018914498388767242,
-0.0017535139340907335,
0.009107613004744053,
0.01694459468126297,
0.030648652464151382,
-0.042161084711551666,
-0.02479862980544567,
-0.053929347544908524,
-0.004830957390367985,
0.02735694870352745,
-0.00102439324837178,
0.03238830715417862,
0.0017119412077590823,
0.000924725434742868,
0.0000098352011264069,
-0.04809638112783432,
0.00395046966150403,
-0.015759238973259926,
0.001970971003174782,
0.04270685836672783,
0.0690745934844017,
-0.026009567081928253,
0.022410867735743523,
-0.009337861090898514,
-0.013064478524029255,
-0.011358932591974735,
-0.04315029829740524,
-0.013073005713522434,
-0.0040762536227703094,
-0.008954113349318504,
-0.00889441929757595,
0.011964401230216026,
-0.05652177706360817,
-0.0022747712209820747,
-0.0443100705742836,
-0.01619415357708931,
0.008817669935524464,
-0.014283942990005016,
0.04772116243839264,
-0.0653223916888237,
-0.042092859745025635,
-0.018044671043753624,
0.009030862711369991,
0.02640184387564659,
-0.019630828872323036,
-0.02641889825463295,
0.02820972166955471,
0.003035870846360922,
0.04656139016151428,
-0.03984154015779495,
-0.0020274671260267496,
-0.005393787287175655,
-0.0353730134665966,
-0.027987999841570854,
-0.0037927066441625357,
0.03179136663675308,
-0.008689753711223602,
-0.007824189960956573,
0.019374996423721313,
0.028448497876524925,
-0.0840492770075798,
-0.005798854399472475,
-0.03216658532619476,
-0.017481841146945953,
-0.014582413248717785,
-0.019392050802707672,
-0.017822949215769768,
0.048812709748744965,
-0.03963687643408775,
0.0005207243375480175,
0.06897225975990295,
0.03436674177646637,
0.0002952725626528263,
0.030750984326004982,
-0.022939587011933327,
-0.03683978319168091,
-0.037146780639886856,
0.011810902506113052,
0.015085549093782902,
0.038954656571149826,
0.025583181530237198,
0.04536750912666321,
-0.02877255156636238,
0.009397555142641068,
-0.012552814558148384,
-0.029505936428904533,
0.004886387847363949,
0.02774922363460064,
-0.026009567081928253,
0.03769255429506302,
-0.04526517540216446,
-0.009883635677397251,
-0.04840337857604027,
0.04437829181551933,
0.0759308859705925,
-0.006779543124139309,
0.011444210074841976,
-0.06716437637805939,
-0.025975456461310387,
-0.05481623113155365,
0.04335496574640274,
0.04468528926372528,
-0.02130226232111454,
0.027476336807012558,
-0.03153553605079651,
-0.030989760532975197,
-0.009022335521876812,
0.013772279024124146,
-0.05007481575012207,
-0.016415875405073166,
0.027851557359099388,
0.0110775176435709,
0.05109814181923866,
-0.027493393048644066,
-0.045196954160928726,
0.013038895092904568,
0.028192665427923203,
0.015503408387303352,
0.07477111369371414,
-0.004086913075298071,
0.0016799622680991888,
-0.07340667396783829,
0.03728322312235832,
0.015017327852547169,
0.07354311645030975,
-0.023690026253461838,
-0.04669783264398575,
0.02764689177274704,
-0.053724680095911026,
0.05082525312900543,
0.07101891189813614,
-0.009883635677397251,
0.02527618408203125,
-0.0626276284456253,
-0.07231512665748596,
-0.021438706666231155,
-0.010830213315784931,
0.07361134141683578,
0.011538014747202396,
-0.020517712458968163,
0.014829717576503754,
0.008178090676665306,
-0.022769032046198845,
0.07408889383077621,
0.01656937412917614,
0.022410867735743523,
0.058568429201841354,
0.013584669679403305,
-0.007640843745321035,
-0.07163290679454803,
0.009099084883928299,
0.029505936428904533,
0.04072842374444008,
-0.03030754253268242,
-0.07443000376224518,
-0.029028384014964104,
0.01288539543747902,
0.002699025673791766,
-0.06730082631111145,
-0.012007039971649647,
0.05178035795688629,
0.04144475236535072,
0.01434363704174757,
-0.038101885467767715,
0.03690800443291664,
0.04386662691831589,
-0.006455489434301853,
0.08063818514347076,
0.007747440133243799,
-0.041512977331876755,
0.03851121664047241,
-0.031467314809560776,
0.06078564003109932,
0.007726120762526989,
-0.005547286476939917,
0.023314805701375008,
-0.038681771606206894,
0.010463520884513855,
-0.027987999841570854,
0.01920444145798683,
-0.011810902506113052,
-0.0380677729845047,
-0.0318254791200161,
-0.016398819163441658,
-0.08254840224981308,
0.042365748435258865,
-0.034810181707143784,
0.0802970826625824,
-0.0007397803128696978,
0.005244552157819271,
0.019835492596030235,
0.024730408564209938,
-0.02176276035606861,
0.022103868424892426,
-0.04468528926372528,
-0.0316208116710186,
-0.034315574914216995,
0.0003848136984743178,
-0.002671310445293784,
0.05062058940529823,
-0.02043243497610092,
-0.001278093084692955,
0.01646704040467739,
-0.056658219546079636,
0.004223356954753399,
0.0046774582006037235,
-0.06556116789579391,
0.021711593493819237,
0.03174019977450371,
0.013414114713668823,
-0.003973920829594135,
-0.0657317191362381,
0.023127196356654167,
0.010165050625801086,
0.000055663407692918554,
-0.017012815922498703,
-0.015324326232075691,
-0.007402067072689533,
-0.04021676257252693,
0.02916482649743557,
0.00889441929757595,
-0.009926274418830872,
-0.029557103291153908,
0.055532559752464294,
0.020108381286263466,
-0.03414501994848251,
-0.041990529745817184,
0.027118172496557236,
-0.05918242782354355,
-0.056453555822372437,
0.018351668491959572,
0.057613324373960495,
-0.018436945974826813,
0.04154708608984947,
-0.055430226027965546,
0.008314534090459347,
-0.0669938251376152,
0.004656138829886913,
-0.013661419041454792,
-0.05730632692575455,
-0.03153553605079651,
-0.059045981615781784,
-0.02234264463186264,
0.004651875235140324,
-0.0014070749748498201,
-0.0046859863214194775,
0.09946741163730621,
0.041137754917144775,
0.036976225674152374,
-0.03643045201897621,
0.008156770840287209,
-0.00984099693596363,
0.03392329812049866,
0.05123458430171013,
-0.02935243770480156,
-0.044071294367313385,
-0.03748789057135582,
-0.02176276035606861,
0.024593966081738472,
-0.0034835764672607183,
0.04195641726255417,
-0.021745704114437103,
0.01864161156117916,
-0.014932050369679928,
0.040387317538261414,
0.04175175353884697,
0.04536750912666321,
0.022888420149683952,
-0.02367297001183033,
-0.041137754917144775,
-0.04717538505792618,
-0.056453555822372437,
-0.03426440805196762,
-0.015963904559612274,
0.03095564991235733,
0.018402835354208946,
0.06672094017267227,
-0.003941942006349564,
0.02015954628586769,
-0.03170609101653099,
-0.06460606306791306,
-0.07224690169095993,
0.028994273394346237,
-0.06962036341428757,
0.026725897565484047,
0.0842539444565773,
0.0034196185879409313,
-0.019954882562160492,
-0.026163067668676376,
-0.056760553270578384,
0.011989984661340714,
-0.02623128890991211,
0.031689032912254333,
0.0014838245697319508,
0.09639742970466614,
0.04676605761051178,
0.0035517984069883823,
-0.0763402134180069,
0.05113225057721138,
-0.011955873109400272,
-0.07811398059129715,
0.015145243145525455,
0.08575482666492462,
-0.056010112166404724,
-0.04147886484861374,
-0.03813599422574043,
0.002965517109259963,
0.030136987566947937,
-0.009380499832332134,
-0.010292966850101948,
-0.06436728686094284,
-0.01894860900938511,
0.06375329196453094,
-0.020415378734469414,
-0.019460273906588554,
0.044446513056755066,
0.058090876787900925,
0.0025412626564502716,
-0.096943199634552,
-0.021813925355672836,
0.04703894257545471,
0.0011373856104910374,
0.05614655464887619,
0.05764743685722351,
-0.008698281832039356,
0.013431170023977757,
0.006029102951288223,
-0.014795606955885887,
-0.0355776771903038,
-0.010574381798505783,
-0.04734594002366066,
-0.017584173008799553,
-0.010386771522462368,
0.05027947947382927,
0.058261431753635406,
-0.025583181530237198,
-0.03395741060376167,
0.008450977504253387,
0.04031909257173538,
-0.060273975133895874,
-0.06320751458406448,
0.07811398059129715,
0.04857393354177475,
-0.0501430369913578,
-0.015844516456127167,
0.006297726649791002,
-0.0200742706656456,
-0.025702569633722305,
0.016987232491374016,
0.0019869604147970676,
-0.05778387933969498,
-0.07408889383077621,
-0.0010712957009673119,
0.07483933120965958,
0.023536527529358864,
-0.02650417573750019,
0.011776790954172611,
0.019289718940854073,
-0.004157267045229673,
0.0023792358115315437,
-0.04250219091773033,
-0.0676078200340271,
-0.05181447044014931,
0.0005231227842159569,
-0.0054193707183003426,
-0.06498128175735474,
0.07402066886425018,
-0.04110364615917206,
0.0545092336833477,
0.03400857746601105,
-0.043423186987638474,
-0.0016309277852997184,
-0.019835492596030235,
0.012910978868603706,
-0.008698281832039356,
-0.028567885980010033,
-0.049665484577417374,
0.05007481575012207,
0.0615701898932457,
0.004020823165774345,
0.0019315301906317472,
-0.004771263338625431,
-0.010804630815982819,
0.06525416672229767,
-0.025719625875353813,
-0.08022885769605637,
0.09121257066726685,
-0.01021621748805046,
-0.05229202285408974,
-0.00645975349470973,
0.011051934212446213,
0.021046429872512817,
-0.03339457884430885,
0.007807134184986353,
-0.018812166526913643,
0.10826802253723145,
0.05433867871761322,
-0.025617292150855064,
-0.006498128175735474,
-0.008988224901258945,
0.024679241701960564,
-0.029130715876817703,
-0.020295990630984306,
-0.05215558037161827,
-0.0101394671946764,
-0.007935049943625927,
0.005193385761231184,
-0.035543568432331085,
0.03301936015486717,
0.026862340047955513,
-0.0262142326682806,
-0.0018228016560897231,
-0.010497632436454296,
0.039534542709589005,
-0.028994273394346237,
-0.049767814576625824,
-0.02783450111746788,
-0.005722105037420988,
-0.016833733767271042,
-0.006549294572323561,
-0.012552814558148384,
-0.008685490116477013,
0.04768704995512962,
0.017550062388181686,
-0.018726889044046402,
-0.020995264872908592,
0.012842757627367973,
0.03540712222456932,
0.005193385761231184,
-0.013465281575918198,
0.03854532539844513,
-0.021046429872512817,
-0.03151847794651985,
-0.03595289960503578,
0.033752743154764175,
-0.039432208985090256,
-0.01151243131607771,
-0.014445969834923744,
0.001937926048412919,
0.021455761045217514,
-0.024372244253754616,
-0.04932437464594841,
0.05236024409532547,
0.006297726649791002,
-0.014428914524614811,
0.01619415357708931,
0.0011896179057657719,
-0.03293408080935478,
0.021711593493819237,
-0.02725461684167385,
0.06443550437688828,
-0.053554125130176544,
-0.0017833609599620104,
-0.03301936015486717,
-0.002976176794618368,
0.006690002046525478,
-0.010437938384711742,
-0.07470288872718811,
-0.044924065470695496,
0.0963292047381401,
-0.02386058121919632,
-0.022325590252876282,
-0.0399438738822937,
0.018624555319547653,
0.02716933935880661,
0.09557876735925674,
-0.003507027868181467,
-0.023877635598182678,
-0.011469793505966663,
-0.0030593222472816706,
-0.02300780825316906,
-0.012169066816568375,
-0.032610028982162476,
0.01490646693855524,
-0.048812709748744965,
-0.029608268290758133,
0.015068493783473969,
0.013704057782888412,
-0.011094572953879833,
-0.025787847116589546,
0.01637323573231697,
-0.025583181530237198,
0.026470065116882324,
-0.03278058394789696,
-0.04045553877949715,
0.01997193694114685,
-0.06000109016895294,
-0.01528168749064207,
0.024747464805841446,
-0.04031909257173538,
-0.03187664598226547,
-0.02280314266681671,
-0.02375824749469757,
-0.06494717299938202,
0.03153553605079651,
0.0005295185837894678,
0.009005280211567879,
-0.022496145218610764,
-0.031092094257473946,
0.029744712635874748,
-0.00829321425408125,
0.02053476683795452,
0.012851284816861153,
0.0008687622030265629,
0.0690745934844017,
-0.016893427819013596,
0.0018697042251005769,
-0.00511237233877182,
0.0586707629263401,
-0.011231016367673874,
-0.02774922363460064,
0.03301936015486717,
0.029113661497831345,
0.015221993438899517,
-0.057886213064193726,
-0.025327349081635475,
-0.0636509582400322,
0.033087581396102905,
0.06191129982471466,
-0.0798877477645874,
0.006707057356834412,
0.012689257971942425,
0.07122357934713364,
-0.022871363908052444,
-0.0055003841407597065,
0.026845285668969154,
-0.0032362723723053932,
-0.00063051882898435,
-0.003767123445868492,
-0.00019254008657298982,
0.05150747299194336,
-0.03325813636183739,
0.023229528218507767,
0.01117132231593132,
0.017754727974534035,
0.05109814181923866,
-0.0038694562390446663,
-0.0013846897054463625,
0.0034601252991706133,
0.04727771878242493,
-0.012706313282251358,
0.019085053354501724,
-0.005282926838845015,
0.008109868504106998,
-0.03568001091480255,
-0.004877860192209482,
0.004240412265062332,
0.0005316504975780845,
-0.08909769356250763,
-0.0034835764672607183,
-0.005432162433862686,
0.000607067602686584,
-0.0334969125688076,
0.02015954628586769,
-0.05737454816699028,
-0.014028111472725868,
-0.014795606955885887,
0.0031701826956123114,
0.06375329196453094,
0.038784101605415344,
0.0010206623701378703,
0.017959393560886383,
-0.010079773142933846,
-0.0052317604422569275,
0.0006278539076447487,
0.05171213671565056,
-0.022769032046198845,
-0.029642378911376,
0.050791144371032715,
0.022956641390919685,
0.003630679799243808,
-0.0001526996202301234,
0.03704444691538811,
-0.04987014830112457,
0.07402066886425018,
0.026453008875250816,
0.012612508609890938,
-0.01847105659544468,
0.06856292486190796,
-0.013320310041308403,
0.038681771606206894,
-0.03011993318796158,
-0.04802815988659859,
-0.0017737672897055745,
-0.017072509974241257,
-0.012655147351324558,
0.03748789057135582,
0.08602771162986755,
-0.0482669360935688,
0.06245707347989082,
-0.010284438729286194,
0.0329681932926178
]
|
36,535 | torch_pso.optim.ParticleSwarmOptimizer | ParticleSwarmOptimizer |
Algorithm from Wikipedia: https://en.wikipedia.org/wiki/Particle_swarm_optimization
Let S be the number of particles in the swarm, each having a position xi ∈ ℝn in the search-space
and a velocity vi ∈ ℝn. Let pi be the best known position of particle i and let g be the best known
position of the entire swarm.
The values blo and bup represent the lower and upper boundaries of the search-space respectively.
The w parameter is the inertia weight. The parameters φp and φg are often called cognitive coefficient and
social coefficient.
The termination criterion can be the number of iterations performed, or a solution where the adequate
objective function value is found. The parameters w, φp, and φg are selected by the practitioner and control
the behaviour and efficacy of the PSO method.
for each particle i = 1, ..., S do
Initialize the particle's position with a uniformly distributed random vector: xi ~ U(blo, bup)
Initialize the particle's best known position to its initial position: pi ← xi
if f(pi) < f(g) then
update the swarm's best known position: g ← pi
Initialize the particle's velocity: vi ~ U(-|bup-blo|, |bup-blo|)
while a termination criterion is not met do:
for each particle i = 1, ..., S do
for each dimension d = 1, ..., n do
Pick random numbers: rp, rg ~ U(0,1)
Update the particle's velocity: vi,d ← w vi,d + φp rp (pi,d-xi,d) + φg rg (gd-xi,d)
Update the particle's position: xi ← xi + vi
if f(xi) < f(pi) then
Update the particle's best known position: pi ← xi
if f(pi) < f(g) then
Update the swarm's best known position: g ← pi
:param params:iterable of parameters to optimize or dicts defining parameter groups
:param inertial_weight: float representing inertial weight of the particles
:param cognitive_coefficient: float representing cognitive coefficient of the particles
:param social_coefficient: float representing social coefficient of the particles
:param num_particles: int representing the number of particles in the swarm
:param max_param_value: Maximum value of the parameters in the search space
:param min_param_value: Minimum value of the parameters in the search space
| class ParticleSwarmOptimizer(GenericPSO):
r"""
Algorithm from Wikipedia: https://en.wikipedia.org/wiki/Particle_swarm_optimization
Let S be the number of particles in the swarm, each having a position xi ∈ ℝn in the search-space
and a velocity vi ∈ ℝn. Let pi be the best known position of particle i and let g be the best known
position of the entire swarm.
The values blo and bup represent the lower and upper boundaries of the search-space respectively.
The w parameter is the inertia weight. The parameters φp and φg are often called cognitive coefficient and
social coefficient.
The termination criterion can be the number of iterations performed, or a solution where the adequate
objective function value is found. The parameters w, φp, and φg are selected by the practitioner and control
the behaviour and efficacy of the PSO method.
for each particle i = 1, ..., S do
Initialize the particle's position with a uniformly distributed random vector: xi ~ U(blo, bup)
Initialize the particle's best known position to its initial position: pi ← xi
if f(pi) < f(g) then
update the swarm's best known position: g ← pi
Initialize the particle's velocity: vi ~ U(-|bup-blo|, |bup-blo|)
while a termination criterion is not met do:
for each particle i = 1, ..., S do
for each dimension d = 1, ..., n do
Pick random numbers: rp, rg ~ U(0,1)
Update the particle's velocity: vi,d ← w vi,d + φp rp (pi,d-xi,d) + φg rg (gd-xi,d)
Update the particle's position: xi ← xi + vi
if f(xi) < f(pi) then
Update the particle's best known position: pi ← xi
if f(pi) < f(g) then
Update the swarm's best known position: g ← pi
:param params:iterable of parameters to optimize or dicts defining parameter groups
:param inertial_weight: float representing inertial weight of the particles
:param cognitive_coefficient: float representing cognitive coefficient of the particles
:param social_coefficient: float representing social coefficient of the particles
:param num_particles: int representing the number of particles in the swarm
:param max_param_value: Maximum value of the parameters in the search space
:param min_param_value: Minimum value of the parameters in the search space
"""
def __init__(self,
params: Iterable[torch.nn.Parameter],
inertial_weight: float = .9,
cognitive_coefficient: float = 1.,
social_coefficient: float = 1.,
num_particles: int = 100,
max_param_value: float = 10.,
min_param_value: float = -10.):
self.num_particles = num_particles
self.inertial_weight = inertial_weight
self.cognitive_coefficient = cognitive_coefficient
self.social_coefficient = social_coefficient
self.max_param_value = max_param_value
self.min_param_value = min_param_value
kwargs = {'inertial_weight': inertial_weight,
'cognitive_coefficient': cognitive_coefficient,
'social_coefficient': social_coefficient,
'max_param_value': max_param_value,
'min_param_value': min_param_value}
super().__init__(params, num_particles, Particle, particle_kwargs=kwargs)
# defaults = {}
# super().__init__(params, defaults)
# # print('self.param_groups', self.param_groups)
# self.particles = [Particle(self.param_groups,
# self.inertial_weight,
# self.cognitive_coefficient,
# self.social_coefficient,
# max_param_value=self.max_param_value,
# min_param_value=self.min_param_value)
# for _ in range(self.num_particles)]
#
# self.best_known_global_param_groups = clone_param_groups(self.param_groups)
# self.best_known_global_loss_value = torch.inf
# @torch.no_grad()
# def step(self, closure: Callable[[], torch.Tensor]) -> torch.Tensor:
# """
# Performs a single optimization step.
#
# :param closure: A callable that reevaluates the model and returns the loss.
# :return: the final loss after the step (as calculated by the closure)
# """
# for particle in self.particles:
# particle_loss = particle.step(closure, self.best_known_global_param_groups)
# if particle_loss < self.best_known_global_loss_value:
# self.best_known_global_param_groups = clone_param_groups(particle.position)
# self.best_known_global_loss_value = particle_loss
#
# # set the module's parameters to be the best performing ones
# for master_group, best_group in zip(self.param_groups, self.best_known_global_param_groups):
# clone = clone_param_group(best_group)['params']
# for i in range(len(clone)):
# master_group['params'][i].data = clone[i].data
#
# return closure() # loss = closure()
| (params: Iterable[torch.nn.parameter.Parameter], inertial_weight: float = 0.9, cognitive_coefficient: float = 1.0, social_coefficient: float = 1.0, num_particles: int = 100, max_param_value: float = 10.0, min_param_value: float = -10.0) | [
0.021514832973480225,
-0.05019456520676613,
-0.06540992110967636,
0.04508253186941147,
0.004883102141320705,
-0.0003836543473880738,
-0.06178721785545349,
-0.037092458456754684,
-0.042264871299266815,
-0.020911049097776413,
-0.0074164788238704205,
0.008025294169783592,
-0.02234000340104103,
0.014068164862692356,
-0.0408359169960022,
0.03731384500861168,
0.00867939367890358,
0.026747625321149826,
-0.013404002413153648,
-0.00956997461616993,
-0.02280290424823761,
-0.008850465528666973,
-0.021514832973480225,
0.024151355028152466,
-0.01505434513092041,
-0.01811351627111435,
-0.00032704960904084146,
-0.0006195074529387057,
-0.054099034518003464,
-0.02123306691646576,
0.0024654509034007788,
-0.01869717426598072,
0.004005099646747112,
0.0017232998507097363,
0.031819410622119904,
-0.01574869640171528,
0.0372735932469368,
0.07478869706392288,
-0.11310885101556778,
-0.016171345487236977,
-0.022581517696380615,
-0.05663492903113365,
0.013353686779737473,
-0.012598956935107708,
0.01708708330988884,
0.01658393070101738,
0.013645515777170658,
0.09161414206027985,
0.012337317690253258,
-0.012588893994688988,
0.016201533377170563,
-0.06585269421339035,
0.03465719521045685,
-0.016131093725562096,
-0.02286328375339508,
0.07869316637516022,
0.05377701669931412,
0.016070714220404625,
0.053132981061935425,
-0.058808550238609314,
0.07575475424528122,
-0.01683550700545311,
0.04186234995722771,
0.01247820071876049,
-0.020357580855488777,
0.00636991998180747,
-0.04612908884882927,
-0.010536029003560543,
-0.016614120453596115,
0.06227024644613266,
0.041741590946912766,
-0.05051658675074577,
0.04914800822734833,
-0.0020931174512952566,
0.008151082322001457,
-0.013102110475301743,
0.014521002769470215,
-0.05957334488630295,
0.019713543355464935,
-0.04967128857970238,
0.02378908544778824,
-0.01922045275568962,
-0.03177915886044502,
-0.038601916283369064,
-0.01743929088115692,
-0.03437542915344238,
-0.003693144768476486,
-0.018526101484894753,
0.025741320103406906,
-0.05458206310868263,
-0.03749497979879379,
0.043230924755334854,
0.04403597116470337,
0.035502493381500244,
0.06291428208351135,
0.02956528402864933,
-0.0044378116726875305,
-0.08469074964523315,
0.02443312108516693,
-0.05168389901518822,
0.014953713864088058,
0.04979204386472702,
-0.008749835193157196,
0.023869588971138,
0.06126393750309944,
-0.04443849250674248,
-0.01425936259329319,
0.007260501384735107,
-0.0012943616602569818,
-0.005655442364513874,
-0.05852678418159485,
0.0665772333741188,
-0.07655979692935944,
0.01247820071876049,
-0.05454181134700775,
-0.013826650567352772,
-0.0600966215133667,
0.023084670305252075,
-0.01399772334843874,
0.03582451120018959,
0.00010322502930648625,
0.0362270325422287,
-0.04657186195254326,
-0.017992759123444557,
0.01650342531502247,
0.0059673972427845,
0.02692876197397709,
0.030853357166051865,
-0.03177915886044502,
-0.04190260171890259,
-0.0316181480884552,
-0.029847050085663795,
-0.004505737219005823,
0.015990210697054863,
-0.007954852655529976,
-0.07490945607423782,
0.00555481156334281,
-0.003990005236119032,
-0.021595336496829987,
-0.010304578579962254,
0.03948746621608734,
0.003605092875659466,
0.004289381206035614,
-0.004098183009773493,
0.021575210615992546,
-0.020387768745422363,
0.052690207958221436,
-0.047537919133901596,
0.0017648099455982447,
-0.008080640807747841,
0.003132128855213523,
0.0071095554158091545,
0.008870591409504414,
-0.004244097508490086,
-0.003288106294348836,
-0.009247956797480583,
0.03411379083991051,
-0.07764660567045212,
-0.04258688911795616,
-0.02135382406413555,
-0.06078091263771057,
-0.06601370126008987,
-0.00961022637784481,
0.0015094596892595291,
-0.023044418543577194,
0.020216697826981544,
0.039728980511426926,
0.024513626471161842,
0.01532604731619358,
0.02445324696600437,
-0.004666746128350496,
-0.04790018871426582,
-0.015386425890028477,
0.01631222851574421,
-0.022521138191223145,
0.10304578393697739,
0.004986248444765806,
-0.04141957312822342,
-0.008598889224231243,
-0.0008824049727991223,
-0.016755003482103348,
-0.04918825998902321,
0.022641895338892937,
-0.08992354571819305,
-0.009680667892098427,
0.0540185309946537,
0.04596807807683945,
0.00803032610565424,
-0.004639072809368372,
0.026345103979110718,
-0.031215626746416092,
-0.0410371795296669,
0.005796325393021107,
0.030249573290348053,
-0.012186371721327305,
0.053696513175964355,
0.030712474137544632,
0.011803975328803062,
0.03644841909408569,
0.02898162603378296,
-0.012900848872959614,
0.04111768305301666,
0.011834164150059223,
-0.01423923671245575,
-0.03387227654457092,
0.019049381837248802,
-0.008513352833688259,
0.06621496379375458,
-0.0030365297570824623,
0.00595230283215642,
-0.0527707114815712,
-0.02493627369403839,
0.043794456869363785,
-0.0025660814717411995,
0.07551323622465134,
-0.03270496055483818,
0.011260569095611572,
0.010133505798876286,
0.009373744949698448,
-0.002459161449223757,
-0.004105730447918177,
-0.0301489420235157,
-0.04154033213853836,
0.01063665933907032,
0.04596807807683945,
0.004528379067778587,
0.011039181612432003,
-0.01689588651061058,
0.01993493176996708,
-0.030430708080530167,
0.03687106817960739,
-0.036106277257204056,
-0.006395077798515558,
0.009499533101916313,
0.05856703594326973,
0.02016638219356537,
-0.024111103266477585,
0.0038491222076117992,
-0.06995842605829239,
-0.05349525064229965,
-0.0337112657725811,
-0.04194285348057747,
-0.017640553414821625,
-0.013363749720156193,
-0.025016779080033302,
0.012538578361272812,
0.06210923567414284,
0.051643647253513336,
0.013001479208469391,
0.029706167057156563,
-0.004206361249089241,
-0.01838521845638752,
-0.0632362961769104,
0.013232930563390255,
-0.034979213029146194,
-0.04419698193669319,
0.030169067904353142,
0.046008333563804626,
0.02121294103562832,
-0.018938688561320305,
-0.05587013438344002,
-0.018978940322995186,
-0.026043212041258812,
0.057721737772226334,
-0.012840470299124718,
0.002847847295925021,
-0.02284315787255764,
0.0002635265118442476,
-0.01890849880874157,
0.012417822144925594,
0.07064271718263626,
0.046853628009557724,
-0.026264598593115807,
-0.007210185751318932,
-0.004772408399730921,
-0.0018415407976135612,
-0.02047833614051342,
0.029786672443151474,
0.027814311906695366,
0.008080640807747841,
0.04713539406657219,
-0.017529858276247978,
-0.038179267197847366,
-0.037615735083818436,
-0.016805317252874374,
0.00832215417176485,
-0.012830407358705997,
-0.031416889280080795,
0.045887574553489685,
0.012880722992122173,
-0.055749379098415375,
0.0024654509034007788,
0.014531065709888935,
-0.0006333441124297678,
0.057721737772226334,
0.03715283423662186,
-0.0028981626965105534,
0.008759898133575916,
0.019612913951277733,
-0.04415672644972801,
0.07309810072183609,
-0.03153764456510544,
0.01401784922927618,
-0.024513626471161842,
0.01376627292484045,
0.020156318321824074,
0.06802631914615631,
-0.02902187965810299,
0.031014366075396538,
-0.011471893638372421,
0.02811620384454727,
-0.018978940322995186,
0.04657186195254326,
0.060418639332056046,
0.014561254531145096,
-0.040674906224012375,
0.01377633586525917,
-0.04508253186941147,
0.025640688836574554,
0.07688181102275848,
-0.015215354040265083,
0.018274525180459023,
0.009288208559155464,
0.019753796979784966,
-0.0024717403575778008,
-0.06746278703212738,
0.03200054541230202,
0.030974112451076508,
0.0030742662493139505,
-0.04822220653295517,
-0.02652623876929283,
-0.014088290743529797,
-0.000498750654514879,
0.012800218537449837,
0.0028654576744884253,
0.007330942898988724,
0.025036904960870743,
0.027733806520700455,
0.060941919684410095,
-0.043271180242300034,
0.08871597796678543,
0.02234000340104103,
-0.03765598684549332,
0.07740509510040283,
0.014078227803111076,
-0.0684690922498703,
0.054219793528318405,
-0.01170334406197071,
0.002797531895339489,
-0.01857641711831093,
0.027874689549207687,
0.03276534005999565,
-0.0025484710931777954,
0.05953308939933777,
0.07941770553588867,
0.015688318759202957,
0.006822757888585329,
-0.013595200143754482,
-0.009816519916057587,
-0.023165175691246986,
0.011492019519209862,
-0.027291031554341316,
-0.02284315787255764,
0.0818730965256691,
0.02431236393749714,
-0.0027824374847114086,
-0.026043212041258812,
-0.03300685063004494,
0.04246613383293152,
-0.056836191564798355,
-0.011019055731594563,
-0.07197103649377823,
-0.016473237425088882,
-0.04049377143383026,
-0.0036101245786994696,
0.021957607939839363,
-0.03942708671092987,
0.00896115880459547,
0.02284315787255764,
-0.016221661120653152,
0.06299478560686111,
-0.0035547777079045773,
-0.00724037503823638,
0.0007434089202433825,
0.0027145117055624723,
-0.003821448888629675,
0.03373139351606369,
-0.048946745693683624,
0.07941770553588867,
-0.007577487733215094,
0.01299141626805067,
0.020991552621126175,
0.05953308939933777,
-0.014993966557085514,
-0.030994240194559097,
0.03260432928800583,
0.038118887692689896,
0.03848116099834442,
-0.09910105913877487,
-0.031376637518405914,
-0.004158561583608389,
-0.07551323622465134,
0.0064051407389342785,
0.031899914145469666,
-0.00960016343742609,
-0.11359187215566635,
0.05876829847693443,
0.05699719861149788,
0.0053636133670806885,
0.1346035599708557,
-0.05852678418159485,
-0.024674635380506516,
-0.009806456975638866,
0.013957470655441284,
-0.02706964500248432,
-0.049510277807712555,
-0.005434054881334305,
0.015909705311059952,
0.02445324696600437,
0.012568768113851547,
0.026707373559474945,
0.006696969736367464,
0.07796862721443176,
0.02590232901275158,
-0.03051121160387993,
-0.02435261756181717,
-0.035059716552495956,
-0.010697037912905216,
-0.043311432003974915,
-0.02648598700761795,
-0.06891186535358429,
-0.008442911319434643,
-0.04055415093898773,
-0.050597090274095535,
0.0259627066552639,
-0.017741182819008827,
0.014158732257783413,
0.008045420050621033,
0.03367101401090622,
0.008432848379015923,
0.0684690922498703,
0.020971426740288734,
0.020367642864584923,
0.017308471724390984,
-0.017026705667376518,
0.026184095069766045,
-0.041157934814691544,
0.0037258497904986143,
-0.05180465802550316,
-0.011824101209640503,
0.05281096324324608,
0.015165038406848907,
0.05051658675074577,
0.001967329066246748,
0.012005235999822617,
-0.011502083390951157,
-0.03795788064599037,
-0.043915215879678726,
-0.019381463527679443,
-0.03825977072119713,
0.0020440600346773863,
0.04186234995722771,
0.011190127581357956,
0.01298135332763195,
-0.016634246334433556,
-0.008156114257872105,
0.03467732295393944,
-0.026606742292642593,
0.017157524824142456,
-0.005494433455169201,
0.04202335700392723,
-0.010344830341637135,
-0.011381326243281364,
-0.0843687355518341,
-0.00017170104547403753,
0.0008622788591310382,
-0.037011951208114624,
0.013595200143754482,
0.05043607950210571,
-0.001334614004008472,
0.04137932136654854,
-0.05639341473579407,
0.02437274344265461,
0.047739177942276,
-0.00266168056987226,
-0.03220180794596672,
0.026667121797800064,
0.0020490915048867464,
0.014983903616666794,
0.005464244168251753,
-0.040151629596948624,
-0.03326849266886711,
0.06520865857601166,
0.024111103266477585,
-0.07257482409477234,
-0.002345951972529292,
-0.005388771183788776,
0.017449354752898216,
0.04971154034137726,
-0.04290890693664551,
0.0019283348228782415,
0.015587687492370605,
-0.04319067299365997,
-0.03489870950579643,
0.03584463521838188,
-0.03805851191282272,
-0.03063196875154972,
0.010817795060575008,
-0.0464913584291935,
0.0726553276181221,
0.011210254393517971,
-0.07696232199668884,
0.029686041176319122,
-0.01691601239144802,
0.022460760548710823,
-0.013182614929974079,
-0.003773649223148823,
0.09225817769765854,
0.0011295790318399668,
-0.08461024612188339,
0.04604858532547951,
0.009484438225626945,
0.023104796186089516,
-0.005129647441208363,
0.02288340963423252,
0.01189454272389412,
-0.02344694174826145,
-0.05405878275632858,
0.023587822914123535,
0.007683150004595518,
-0.03677043691277504,
-0.026848256587982178,
-0.011954921297729015,
0.025761445984244347,
0.03834027796983719,
0.0014163763262331486,
0.010827858000993729,
-0.0582047663629055,
-0.02594258077442646,
-0.011381326243281364,
-0.017721056938171387,
0.0353817343711853,
0.053656261414289474,
-0.04319067299365997,
0.009469344280660152,
0.015960020944476128,
0.004012647084891796,
0.04359319806098938,
-0.06963640451431274,
-0.01425936259329319,
0.015879515558481216,
-0.0008553605293855071,
-0.013363749720156193,
0.013917218893766403,
0.05707770213484764,
-0.034013159573078156,
-0.03467732295393944,
-0.033932656049728394,
0.007059239782392979,
0.07796862721443176,
-0.02284315787255764,
-0.02853885106742382,
0.02286328375339508,
-0.051643647253513336,
-0.060338135808706284,
0.015094596892595291,
-0.0186367966234684,
-0.004966122563928366,
-0.04141957312822342,
0.005489401984959841,
0.05321348458528519,
0.03562324866652489,
-0.008925938047468662,
-0.02382933720946312,
-0.024171480908989906,
-0.010505839250981808,
0.03151752054691315,
0.004817692097276449,
-0.027733806520700455,
-0.012125993147492409,
0.02081041783094406,
-0.015154975466430187,
-0.006047901697456837,
-0.03153764456510544,
0.01600027270615101,
0.06174696609377861,
-0.0519254133105278,
0.038622044026851654,
0.04286865517497063,
0.04033276438713074,
0.004986248444765806,
0.060418639332056046,
-0.02702939137816429,
-0.051080115139484406,
-0.03805851191282272,
0.05031532421708107,
-0.019965119659900665,
0.019572660326957703,
0.041661087423563004,
-0.007844159379601479,
-0.0933852419257164,
0.011854290030896664,
0.021655716001987457,
-0.01668456196784973,
0.010988866910338402,
-0.03065209463238716,
-0.018978940322995186,
0.014410308562219143,
0.030933860689401627,
0.011783848516643047,
0.0006452940287999809,
-0.019421715289354324,
0.01039514597505331,
-0.0498322956264019,
-0.031356509774923325,
0.014138606376945972,
-0.04009125009179115,
0.0047019668854773045,
0.11487995088100433,
-0.03848116099834442,
-0.03202067315578461,
0.047376908361911774,
0.01666443608701229,
-0.0127197140827775,
-0.03417416661977768,
-0.04407622292637825,
0.029243266209959984,
-0.12864622473716736,
0.0065862759947776794,
-0.028820617124438286,
-0.023487193509936333,
-0.02849859930574894,
0.016412857919931412,
-0.007718370761722326,
0.0019547503907233477,
0.013081984594464302,
0.03336912393569946,
0.0014339867047965527,
-0.03795788064599037,
-0.0009691989398561418,
0.039648476988077164,
0.022984039038419724,
-0.02326580509543419,
-0.002475513843819499,
-0.012367506511509418,
-0.04302966594696045,
0.013585137203335762,
0.037535231560468674,
0.0582047663629055,
0.016382670029997826,
-0.007441636174917221,
0.021454453468322754,
-0.05900981277227402,
-0.015507183037698269,
0.011512146331369877,
0.003144707763567567,
0.037615735083818436,
-0.004138435237109661,
0.04190260171890259,
-0.01796257123351097,
0.01788206584751606,
0.005866766907274723,
-0.015215354040265083,
0.005876829847693443,
-0.01677512936294079,
-0.030974112451076508,
-0.0008698261808604002,
-0.0020314811263233423,
0.018495913594961166,
0.05498458445072174,
-0.03111499547958374,
-0.052126675844192505,
-0.022078363224864006,
0.006712064146995544,
0.017077021300792694,
-0.01953240856528282,
0.00006371964263962582,
-0.012105867266654968,
-0.06480613350868225,
0.008890717290341854,
0.07921644300222397,
0.000988696119748056,
0.0016100903740152717,
0.019109759479761124,
0.034938961267471313,
0.028780365362763405,
-0.02051858976483345,
-0.023426814004778862,
0.008639140985906124,
0.005454181227833033,
-0.039648476988077164,
0.02173621952533722,
0.021092183887958527,
-0.00002977645090140868,
0.04890649393200874,
-0.04665236920118332,
-0.05204617232084274,
-0.032926347106695175,
0.03512009605765343,
-0.025519931688904762,
-0.018395282328128815,
-0.014309678226709366,
-0.05913056805729866,
0.01424929965287447,
-0.0378975011408329,
0.05321348458528519,
-0.01683550700545311,
-0.00764289777725935,
0.045887574553489685,
-0.02483564428985119,
0.009982559829950333,
0.019502218812704086,
0.05039582774043083,
-0.012357443571090698,
0.008649203926324844,
0.03431504964828491,
0.0347578264772892,
0.012880722992122173,
0.0034264735877513885,
0.01449081301689148,
-0.006002617999911308,
-0.01085804682224989,
0.042224619537591934,
0.005162352230399847,
-0.02799544669687748,
-0.023567697033286095,
0.051080115139484406,
-0.07052195817232132,
0.026646995916962624,
0.007793843746185303,
0.012508389540016651,
0.03948746621608734,
-0.04077553749084473,
-0.029203014448285103,
0.025680940598249435,
-0.050597090274095535,
0.06677849590778351,
0.009620290249586105,
-0.0975714772939682,
0.00529820378869772,
-0.012287002056837082,
0.007622771430760622,
-0.058406028896570206,
-0.03993023931980133,
0.03570375218987465,
0.04512278363108635,
0.01060647051781416,
-0.010037907399237156,
0.02077016606926918,
-0.00002822375245159492,
0.0776868611574173,
0.022963913157582283,
0.027733806520700455,
0.031899914145469666,
0.019522346556186676,
-0.027049517259001732,
0.02803569845855236,
-0.008593857288360596,
-0.0540185309946537,
-0.10457536578178406,
-0.05144238844513893,
-0.040171753615140915,
0.04319067299365997,
0.05430029705166817,
0.01741916500031948,
0.028840743005275726,
0.02183685079216957,
0.03165840357542038
]
|
36,537 | torch_pso.optim.ParticleSwarmOptimizer | __init__ | null | def __init__(self,
params: Iterable[torch.nn.Parameter],
inertial_weight: float = .9,
cognitive_coefficient: float = 1.,
social_coefficient: float = 1.,
num_particles: int = 100,
max_param_value: float = 10.,
min_param_value: float = -10.):
self.num_particles = num_particles
self.inertial_weight = inertial_weight
self.cognitive_coefficient = cognitive_coefficient
self.social_coefficient = social_coefficient
self.max_param_value = max_param_value
self.min_param_value = min_param_value
kwargs = {'inertial_weight': inertial_weight,
'cognitive_coefficient': cognitive_coefficient,
'social_coefficient': social_coefficient,
'max_param_value': max_param_value,
'min_param_value': min_param_value}
super().__init__(params, num_particles, Particle, particle_kwargs=kwargs)
# defaults = {}
# super().__init__(params, defaults)
# # print('self.param_groups', self.param_groups)
# self.particles = [Particle(self.param_groups,
# self.inertial_weight,
# self.cognitive_coefficient,
# self.social_coefficient,
# max_param_value=self.max_param_value,
# min_param_value=self.min_param_value)
# for _ in range(self.num_particles)]
#
# self.best_known_global_param_groups = clone_param_groups(self.param_groups)
# self.best_known_global_loss_value = torch.inf
| (self, params: Iterable[torch.nn.parameter.Parameter], inertial_weight: float = 0.9, cognitive_coefficient: float = 1.0, social_coefficient: float = 1.0, num_particles: int = 100, max_param_value: float = 10.0, min_param_value: float = -10.0) | [
0.006610782351344824,
-0.028511619195342064,
-0.038723625242710114,
0.026629479601979256,
0.0005683688796125352,
0.019883593544363976,
-0.05743321031332016,
-0.020181754603981972,
-0.03583519160747528,
0.000036724140954902396,
-0.008455651812255383,
0.041295260190963745,
-0.03533204644918442,
0.043121494352817535,
-0.039469026029109955,
0.010510165244340897,
0.026666749268770218,
0.02323790267109871,
-0.017181511968374252,
-0.0334126353263855,
-0.011590998619794846,
0.004947604611515999,
-0.04174250364303589,
0.049531951546669006,
-0.017871009185910225,
-0.02627541497349739,
-0.011236932128667831,
-0.003566281870007515,
-0.024281464517116547,
0.012690465897321701,
-0.03264860063791275,
0.006433749571442604,
0.0006044742767699063,
0.0625019446015358,
0.012448210269212723,
-0.015653438866138458,
0.0005969037883915007,
0.06921055912971497,
-0.12880542874336243,
0.03397168964147568,
0.011935746297240257,
-0.05691142752766609,
0.030375124886631966,
-0.009508531540632248,
0.014507383108139038,
0.021374396979808807,
0.03100871667265892,
0.07297483831644058,
-0.025362296029925346,
-0.0182623453438282,
0.006023778580129147,
-0.03602154180407524,
0.0451713502407074,
-0.026815829798579216,
-0.07804357260465622,
0.05858858302235603,
0.07256487011909485,
0.022697485983371735,
0.008702565915882587,
-0.013929696753621101,
0.03305857256054878,
-0.00731891393661499,
0.036189258098602295,
-0.03738190233707428,
-0.012215272523462772,
-0.03205227851867676,
-0.06976961344480515,
-0.017321275547146797,
-0.012560021132230759,
0.06943418085575104,
0.07841627299785614,
-0.029387466609477997,
0.021765733137726784,
0.019175462424755096,
0.004509680904448032,
0.010761738754808903,
0.010612658224999905,
-0.024188289418816566,
0.011059899814426899,
0.0030608063098043203,
0.019454987719655037,
-0.002760316012427211,
-0.016482697799801826,
-0.0225856751203537,
-0.02215706929564476,
-0.056277837604284286,
-0.03879816457629204,
-0.040549859404563904,
0.045134078711271286,
0.006662028841674328,
-0.04341965541243553,
0.05512246489524841,
0.03274177387356758,
0.007495947182178497,
0.07282575964927673,
0.03864908590912819,
0.0019170802552253008,
-0.03795958682894707,
0.017871009185910225,
-0.05318441987037659,
-0.024020573124289513,
0.02469143457710743,
-0.010752420872449875,
-0.008590755984187126,
0.02726307138800621,
-0.05542062595486641,
-0.013100436888635159,
-0.011544411070644855,
0.015532310120761395,
0.015262102708220482,
-0.07323572784662247,
0.06019119545817375,
-0.06548354774713516,
0.028325268998742104,
-0.04509681090712547,
-0.011646903119981289,
-0.03069191984832287,
-0.0035755992867052555,
0.00039803292020224035,
0.013482455164194107,
0.0014150987844914198,
0.06648984551429749,
-0.030617380514740944,
0.0050827087834477425,
-0.013538360595703125,
0.03220135718584061,
0.017749881371855736,
-0.007174492347985506,
-0.023070186376571655,
-0.03887270390987396,
0.0009381580748595297,
-0.04722120612859726,
-0.024579625576734543,
-0.017181511968374252,
0.013575630262494087,
-0.0959332138299942,
0.00003115546496701427,
-0.007435383275151253,
-0.018141217529773712,
0.029443372040987015,
0.06570716947317123,
0.05031462386250496,
0.03160503879189491,
0.018057359382510185,
-0.006033095996826887,
0.012112779542803764,
0.04375508800148964,
-0.030468299984931946,
-0.03648741915822029,
-0.03406486287713051,
-0.00624274043366313,
0.0017749881371855736,
-0.029387466609477997,
0.0005945744342170656,
-0.013463820330798626,
-0.013100436888635159,
0.026927640661597252,
-0.08795741200447083,
-0.009326839819550514,
-0.017740562558174133,
-0.04845111817121506,
-0.013314739800989628,
-0.0007710250210948288,
0.008926186710596085,
-0.048786550760269165,
0.01299794390797615,
0.008609390817582607,
-0.026200873777270317,
-0.003028194885700941,
-0.0037246798165142536,
-0.010659245774149895,
-0.056799620389938354,
0.015727978199720383,
0.018085312098264694,
-0.007593781221657991,
0.05996757745742798,
-0.00119497231207788,
-0.017461037263274193,
-0.0219707190990448,
0.01651996746659279,
0.026927640661597252,
-0.05173088610172272,
0.04099709913134575,
-0.08035431802272797,
0.01977178268134594,
0.031455956399440765,
0.04196612164378166,
0.04856292903423309,
-0.0331144742667675,
0.007850012741982937,
0.031698212027549744,
0.002133712638169527,
-0.021858908236026764,
0.03285358473658562,
-0.014796226285398006,
0.05102275311946869,
0.051134563982486725,
0.00044724109466187656,
-0.024654164910316467,
0.05996757745742798,
0.00922434777021408,
0.005143272690474987,
-0.009680906310677528,
-0.03026331402361393,
-0.015476405620574951,
0.0063452329486608505,
-0.011590998619794846,
0.06276283413171768,
-0.008749153465032578,
-0.030710555613040924,
-0.030412394553422928,
-0.015830470249056816,
0.07931075245141983,
0.004106698092073202,
0.02899613045156002,
-0.051171835511922836,
-0.03823911398649216,
-0.009634318761527538,
-0.003095746971666813,
-0.011395330540835857,
0.05255082994699478,
-0.026443129405379295,
0.028492985293269157,
0.0022723108995705843,
0.031083256006240845,
0.010528801009058952,
0.04304695501923561,
-0.0396181084215641,
-0.02806437946856022,
0.023536061868071556,
0.021467572078108788,
-0.02806437946856022,
-0.011367377825081348,
0.02098306082189083,
0.022734755650162697,
0.04975557327270508,
-0.008115562610328197,
-0.0013230881886556745,
-0.10472895950078964,
-0.011740078218281269,
-0.02933156117796898,
0.010566070675849915,
-0.0005945744342170656,
-0.012327082455158234,
-0.007794107776135206,
0.008096926845610142,
0.05691142752766609,
0.048935629427433014,
-0.0032704505138099194,
0.01952952705323696,
-0.0019310566131025553,
0.002110418863594532,
-0.04778025671839714,
0.020181754603981972,
-0.014721686020493507,
-0.043866898864507675,
-0.023293806239962578,
0.022697485983371735,
0.0015071092639118433,
-0.010929454118013382,
-0.07945983111858368,
-0.017200147733092308,
-0.017861690372228622,
0.0959332138299942,
0.029778802767395973,
-0.00412300368770957,
-0.03238770738244057,
0.03756825253367424,
-0.022641580551862717,
0.014898719266057014,
0.10756148397922516,
0.03799685835838318,
0.026815829798579216,
-0.024188289418816566,
0.020125849172472954,
-0.037176914513111115,
-0.010100194253027439,
-0.0005823451792821288,
-0.011348742991685867,
0.05355712026357651,
0.05318441987037659,
-0.029722897335886955,
-0.0219707190990448,
-0.020722171291708946,
0.040736209601163864,
0.007645027246326208,
0.004390882793813944,
0.010733786039054394,
-0.005674371495842934,
0.006657369900494814,
-0.05542062595486641,
0.012476162984967232,
0.012336400337517262,
0.01431171502918005,
0.036189258098602295,
-0.01611931435763836,
0.00655953586101532,
0.05001646280288696,
0.02262294478714466,
-0.013678123243153095,
0.06947144865989685,
-0.04632672294974327,
0.011153074912726879,
-0.011907794512808323,
-0.01962270215153694,
-0.0077149090357124805,
0.020479915663599968,
0.022287514060735703,
0.021430302411317825,
0.017591483891010284,
0.07491288334131241,
0.02543683722615242,
0.056985970586538315,
0.05214085802435875,
0.019082287326455116,
-0.02586544305086136,
0.050389163196086884,
-0.04774298518896103,
0.03499661386013031,
0.06801791489124298,
-0.003605881240218878,
0.017721928656101227,
-0.013780616223812103,
0.015541628003120422,
-0.030952811241149902,
-0.04435141012072563,
0.02416965365409851,
0.04792933538556099,
-0.017721928656101227,
-0.01658518984913826,
-0.03460527956485748,
0.020628996193408966,
-0.011935746297240257,
-0.014367620460689068,
-0.031120525673031807,
0.00971817597746849,
0.00408573355525732,
0.0408480204641819,
0.054227981716394424,
-0.05691142752766609,
0.050761863589286804,
-0.007747520226985216,
-0.04226428270339966,
0.05035189166665077,
-0.019846323877573013,
-0.04763117805123329,
0.04245063289999962,
0.0011425612028688192,
-0.0015653438167646527,
-0.03236907348036766,
-0.008367135189473629,
0.024579625576734543,
0.016948573291301727,
0.07215489447116852,
0.06779429316520691,
0.024300100281834602,
-0.009010044857859612,
-0.02642449364066124,
-0.007579804863780737,
-0.012494797818362713,
0.04010261967778206,
-0.04472411051392555,
0.005590513814240694,
0.048972900956869125,
0.022045258432626724,
-0.0007582133985124528,
0.004849770572036505,
-0.026722654700279236,
0.04472411051392555,
-0.01990222930908203,
-0.009923161938786507,
-0.05739593878388405,
-0.03598427399992943,
-0.003824843093752861,
0.019883593544363976,
-0.029722897335886955,
-0.08937367796897888,
0.02636859007179737,
0.028660699725151062,
-0.03756825253367424,
0.015038481913506985,
-0.04144434258341789,
0.04069893807172775,
0.008795741945505142,
-0.03289085626602173,
-0.01555094588547945,
0.05948306620121002,
-0.022101163864135742,
0.06037754565477371,
0.002818550681695342,
0.024300100281834602,
0.013640853576362133,
0.03471709042787552,
-0.037270091474056244,
-0.039319947361946106,
0.024281464517116547,
0.0717821940779686,
0.010128146968781948,
-0.0903427004814148,
-0.04450048878788948,
-0.008301912806928158,
-0.09041724354028702,
-0.0035523055121302605,
0.027952568605542183,
-0.005343599244952202,
-0.05668780952692032,
0.0541534423828125,
0.05978122726082802,
0.01794554851949215,
0.06727251410484314,
-0.051693614572286606,
-0.006657369900494814,
-0.01686471700668335,
-0.003452142234891653,
-0.0037666086573153734,
-0.0519917756319046,
0.005879356991499662,
-0.018830712884664536,
0.024654164910316467,
0.010510165244340897,
0.019659973680973053,
-0.00620547030121088,
0.05016554147005081,
0.04807841777801514,
0.01730263978242874,
-0.000809459772426635,
-0.029909247532486916,
0.012308447621762753,
-0.0007296784897334874,
-0.058066800236701965,
-0.09257890284061432,
-0.010584705509245396,
-0.01147918775677681,
-0.051693614572286606,
0.04118344932794571,
-0.006634076125919819,
0.01311907172203064,
0.028642065823078156,
-0.014116046950221062,
0.02150484174489975,
0.049531951546669006,
-0.0027649749536067247,
0.04591675102710724,
0.012187319807708263,
-0.01943635195493698,
0.02482188120484352,
-0.030132869258522987,
0.02107623592019081,
-0.05683688819408417,
-0.013016579672694206,
0.04576767235994339,
0.0028744558803737164,
0.08445402979850769,
-0.03583519160747528,
0.007300279103219509,
-0.02441190928220749,
-0.03846273571252823,
-0.02605179324746132,
0.04576767235994339,
-0.021858908236026764,
0.03106462024152279,
0.04722120612859726,
-0.0009230170981027186,
-0.01299794390797615,
-0.054451603442430496,
0.0010272568324580789,
0.05411617085337639,
-0.03853727504611015,
-0.0022094175219535828,
-0.008730518631637096,
0.054265253245830536,
0.04740755632519722,
0.015383230522274971,
-0.08587028831243515,
-0.04267425462603569,
-0.006410455796867609,
-0.002014914294704795,
0.0025949301198124886,
0.010267909616231918,
-0.010193370282649994,
0.019492257386446,
-0.06704889237880707,
0.04852565750479698,
0.041108909994363785,
-0.02664811536669731,
-0.033375367522239685,
-0.029126575216650963,
0.01304453145712614,
-0.016874033957719803,
0.019697243347764015,
-0.060265738517045975,
-0.00925230048596859,
0.0334126353263855,
0.03223862871527672,
-0.04737028479576111,
-0.009690223261713982,
0.02750532701611519,
0.006005143281072378,
0.04323330521583557,
-0.0020032674074172974,
-0.005818793084472418,
0.013091119937598705,
-0.01571866124868393,
-0.014842813834547997,
0.013249517418444157,
-0.02435600385069847,
-0.011674855835735798,
0.01751694269478321,
-0.03954356536269188,
0.05765683203935623,
0.01117170974612236,
-0.05050097405910492,
-0.012560021132230759,
-0.0033892488572746515,
-0.012476162984967232,
-0.032443612813949585,
-0.014414208009839058,
0.05706050992012024,
0.015187562443315983,
-0.047854796051979065,
0.07595644891262054,
0.0625019446015358,
0.022939741611480713,
-0.021858908236026764,
0.014870766550302505,
-0.006988142151385546,
-0.031083256006240845,
-0.07349661737680435,
0.021057602018117905,
0.017843056470155716,
-0.025585917755961418,
-0.04371781647205353,
-0.04013988748192787,
0.032350439578294754,
0.009755446575582027,
0.02103896625339985,
0.00881903525441885,
-0.017563531175255775,
-0.0352761410176754,
-0.007481970824301243,
-0.01555094588547945,
0.009783399291336536,
0.06488722562789917,
-0.04155614972114563,
0.04144434258341789,
-0.016165902838110924,
-0.022734755650162697,
0.060452088713645935,
-0.03697193041443825,
0.003051488660275936,
-0.0022641581017524004,
-0.018215756863355637,
-0.09332431107759476,
-0.020256293937563896,
0.060414817184209824,
0.001466345158405602,
-0.034120768308639526,
-0.06742159277200699,
-0.006671346258372068,
0.09720040112733841,
0.008306571282446384,
-0.0022117469925433397,
0.034922074526548386,
0.005166566465049982,
-0.04778025671839714,
0.0013417232548817992,
-0.03199637308716774,
-0.006936895661056042,
-0.06183107942342758,
0.006941554602235556,
0.028735240921378136,
0.02323790267109871,
-0.04759390652179718,
0.028642065823078156,
-0.017992136999964714,
-0.012066191993653774,
0.022324783727526665,
0.008232031017541885,
-0.02689037099480629,
-0.00951319094747305,
0.01801077090203762,
0.009070608764886856,
-0.015988869592547417,
-0.03149322792887688,
0.027207165956497192,
0.09049177914857864,
-0.054414331912994385,
0.03879816457629204,
0.02899613045156002,
0.010174734517931938,
-0.0003869683714583516,
0.03441892936825752,
-0.03391578420996666,
-0.025846807286143303,
-0.025548648089170456,
0.024430545046925545,
-0.04069893807172775,
-0.008930845186114311,
0.016901986673474312,
-0.010854913853108883,
-0.08929913491010666,
0.015895694494247437,
0.01295135635882616,
0.015429818071424961,
0.01475895568728447,
-0.08087609708309174,
-0.010575388558208942,
0.03490344062447548,
0.0030584768392145634,
0.022753391414880753,
0.01293272152543068,
-0.01990222930908203,
-0.025269120931625366,
-0.051507264375686646,
-0.030207408592104912,
-0.028548888862133026,
-0.0643654465675354,
0.012205954641103745,
0.12246952205896378,
-0.021430302411317825,
-0.03794095292687416,
0.015560262836515903,
-0.016389522701501846,
0.014153316617012024,
-0.05959487706422806,
-0.05974395573139191,
0.004435140639543533,
-0.146695077419281,
0.00563244242221117,
0.001267183106392622,
0.024803245440125465,
-0.017954865470528603,
-0.025380931794643402,
-0.015802519395947456,
0.00006231092993402854,
-0.0024551672395318747,
0.024430545046925545,
-0.028977496549487114,
-0.0017167535843327641,
0.01086423173546791,
0.015308690257370472,
0.032480884343385696,
-0.028977496549487114,
-0.032816316932439804,
-0.01590501144528389,
-0.02707672119140625,
-0.015280737541615963,
0.012280494906008244,
0.06883785873651505,
-0.005515973549336195,
0.007300279103219509,
0.037176914513111115,
-0.010836279019713402,
0.00408573355525732,
0.011460552923381329,
-0.020740805193781853,
0.0014919682871550322,
0.040400777012109756,
0.04409051686525345,
-0.015336642041802406,
-0.01803872361779213,
-0.0002888432063627988,
0.02834390476346016,
0.013389280065894127,
0.0076170749962329865,
-0.01794554851949215,
-0.04356873780488968,
-0.015700025483965874,
-0.015010529197752476,
0.03406486287713051,
-0.05411617085337639,
-0.024467814713716507,
-0.03298402950167656,
0.003997217398136854,
0.02163528837263584,
0.0040461341850459576,
-0.025660457089543343,
-0.004178909119218588,
-0.024710070341825485,
0.02992788329720497,
0.07878897339105606,
-0.003100405680015683,
-0.0010936441831290722,
0.0396181084215641,
0.03134414553642273,
0.00803170446306467,
-0.04945741221308708,
-0.010435625910758972,
-0.0115257753059268,
-0.014954623766243458,
-0.03331946209073067,
0.0005960302660241723,
0.010752420872449875,
-0.02122531644999981,
0.02497096173465252,
-0.04233882203698158,
-0.0792362168431282,
-0.05527154356241226,
-0.010333132930099964,
-0.007649686187505722,
-0.03570474684238434,
-0.00037794202216900885,
-0.08646661043167114,
0.06585624814033508,
-0.02590271271765232,
0.05743321031332016,
0.004460764117538929,
-0.007006776984781027,
0.025287756696343422,
-0.023480156436562538,
0.005432115867733955,
0.0448731891810894,
0.027710312977433205,
-0.04628945142030716,
-0.035294774919748306,
0.08669023215770721,
0.08050339668989182,
0.021765733137726784,
-0.03140005096793175,
-0.0008979762787930667,
0.022567039355635643,
-0.03734463080763817,
0.05612875893712044,
0.022790661081671715,
-0.002650835318490863,
-0.03503388538956642,
0.03648741915822029,
-0.026759926229715347,
0.03686011955142021,
-0.022977011278271675,
0.020461279898881912,
0.03512706235051155,
-0.05512246489524841,
-0.021914813667535782,
0.03317037969827652,
-0.036468785256147385,
0.07819265127182007,
0.004267425276339054,
-0.06332188099622726,
-0.004910334479063749,
-0.01417195238173008,
0.006019119638949633,
-0.02819482423365116,
-0.015886375680565834,
0.021430302411317825,
0.048972900956869125,
0.002811562502756715,
-0.027225801721215248,
0.06533446907997131,
-0.022101163864135742,
0.04599129408597946,
0.041481610387563705,
0.021765733137726784,
0.010463577695190907,
0.05109729617834091,
-0.0513581857085228,
0.03706510737538338,
0.0021500184666365385,
-0.07017958164215088,
-0.09317522495985031,
-0.061905622482299805,
-0.026480399072170258,
0.0724157840013504,
0.01583978906273842,
0.0031306876335293055,
0.0491965189576149,
0.05325895920395851,
-0.007230397779494524
]
|
36,557 | torch_pso.optim.RingTopologyPSO | RingTopologyPSO |
Ring Topology PSO is a modification of the naive Particle Swarm Optimization Algorithm, where instead of feeding
each particle the global optimum, each particle only receives the minimum of itself and two other particles. These
two particles are the same through the entire iteration.
This is called a "ring" because the network graph showing these connections has a single cycle.
| class RingTopologyPSO(ParticleSwarmOptimizer):
"""
Ring Topology PSO is a modification of the naive Particle Swarm Optimization Algorithm, where instead of feeding
each particle the global optimum, each particle only receives the minimum of itself and two other particles. These
two particles are the same through the entire iteration.
This is called a "ring" because the network graph showing these connections has a single cycle.
"""
def __init__(self,
params: Iterable[torch.nn.Parameter],
num_neighbors: int = 2,
inertial_weight: float = .9,
cognitive_coefficient: float = 1.,
social_coefficient: float = 1.,
num_particles: int = 100,
max_param_value: float = 10.,
min_param_value: float = -10.):
super().__init__(params, inertial_weight, cognitive_coefficient, social_coefficient, num_particles,
max_param_value, min_param_value)
self.losses = {i: (particle.position, torch.inf) for i, particle in enumerate(self.particles)}
self.num_neighbors = num_neighbors
def _find_minimum_of_neighbors(self, particle_index: int) -> List[Dict]:
neighbors = [(particle_index + i) % len(self.particles) for i in range(self.num_neighbors)]
best = sorted([self.losses[n] for n in neighbors],
key=lambda x: x[1],
reverse=True)[0]
return clone_param_groups(best[0])
@torch.no_grad()
def step(self, closure: Callable[[], torch.Tensor]) -> torch.Tensor:
"""
Performs a single optimization step.
:param closure: A callable that reevaluates the model and returns the loss.
:return: the final loss after the step (as calculated by the closure)
"""
losses = {}
for i, particle in enumerate(self.particles):
particle_loss = particle.step(closure, self._find_minimum_of_neighbors(i))
losses[i] = (particle.position, particle_loss)
if particle_loss < self.best_known_global_loss_value:
self.best_known_global_param_groups = clone_param_groups(particle.position)
self.best_known_global_loss_value = particle_loss
# set the module's parameters to be the best performing ones
for master_group, best_group in zip(self.param_groups, self.best_known_global_param_groups):
clone = clone_param_group(best_group)['params']
for i in range(len(clone)):
master_group['params'][i].data = clone[i].data
self.losses = losses
return closure() # loss = closure()
| (params: Iterable[torch.nn.parameter.Parameter], num_neighbors: int = 2, inertial_weight: float = 0.9, cognitive_coefficient: float = 1.0, social_coefficient: float = 1.0, num_particles: int = 100, max_param_value: float = 10.0, min_param_value: float = -10.0) | [
-0.011235138401389122,
-0.06249130144715309,
-0.04205341637134552,
0.03147358074784279,
0.014340708963572979,
0.020988719537854195,
-0.02750376984477043,
-0.017056895419955254,
-0.023685911670327187,
-0.03525345027446747,
-0.01757923886179924,
0.005028745159506798,
-0.01281166635453701,
0.0208747535943985,
-0.03812159225344658,
0.022375304251909256,
0.003713388927280903,
0.03105570748448372,
0.008685151115059853,
-0.0029987276066094637,
0.012944626621901989,
-0.033392008394002914,
-0.01474908646196127,
0.029194263741374016,
-0.05348799377679825,
-0.012564740143716335,
-0.015489865094423294,
-0.006424827501177788,
-0.07909233123064041,
-0.02645908296108246,
-0.0025761041324585676,
-0.03662104159593582,
0.01182396151125431,
0.0001543288235552609,
0.016563042998313904,
-0.013001609593629837,
0.03713388741016388,
0.09398387372493744,
-0.1129022166132927,
-0.04254726693034172,
-0.03202441707253456,
-0.04786567762494087,
-0.013751884922385216,
-0.019925037398934364,
0.02695293538272381,
0.002261510817334056,
0.027066901326179504,
0.07278621941804886,
0.0003013863752130419,
-0.017759686335921288,
0.014834561385214329,
-0.04380089417099953,
0.03401882201433182,
0.007892138324677944,
-0.008077332749962807,
0.04687797278165817,
0.051702529191970825,
0.007778172381222248,
0.039052315056324005,
-0.03614618256688118,
0.06104773283004761,
-0.02068481035530567,
0.033069103956222534,
0.026819974184036255,
0.0016667512245476246,
-0.01524293888360262,
-0.054665643721818924,
-0.007303314749151468,
-0.004843550734221935,
0.03426574543118477,
0.049233268946409225,
-0.057704731822013855,
0.02735181525349617,
-0.0077211894094944,
0.004815059248358011,
-0.03415178135037422,
0.03365792706608772,
-0.06955718249082565,
0.02710488997399807,
-0.045624349266290665,
0.004081403836607933,
-0.03795064240694046,
-0.03969812020659447,
-0.00878961943089962,
-0.027731701731681824,
-0.04558635875582695,
-0.0065008047968149185,
-0.017398793250322342,
0.015983717516064644,
-0.06982310861349106,
-0.01182396151125431,
0.0489293597638607,
0.004995505325496197,
0.03436071798205376,
0.053108107298612595,
0.030352916568517685,
-0.017142370343208313,
-0.0696711540222168,
0.017550747841596603,
-0.05838852748274803,
0.0010939538478851318,
0.05496955290436745,
-0.06260526925325394,
0.055501390248537064,
0.05439972132444382,
-0.031739503145217896,
0.005232933908700943,
0.02980208210647106,
-0.015489865094423294,
-0.010380393825471401,
-0.04121766611933708,
0.02826354280114174,
-0.08813362568616867,
0.0019564146641641855,
-0.026971928775310516,
0.0071418629959225655,
-0.03641210496425629,
0.016857456415891647,
0.01281166635453701,
0.01567980833351612,
0.029593145474791527,
0.04961315542459488,
-0.04155956581234932,
-0.027731701731681824,
0.0068616969510912895,
0.016714997589588165,
0.030276939272880554,
0.015337910503149033,
-0.050220973789691925,
-0.04425675794482231,
-0.02653506025671959,
0.011738487519323826,
-0.024103786796331406,
0.003708640346303582,
-0.004485032986849546,
-0.07871244847774506,
-0.010408884845674038,
0.015271429903805256,
-0.014283725991845131,
-0.009050792083144188,
0.03318307176232338,
-0.014720595441758633,
-0.02011498063802719,
-0.004117018077522516,
0.0006588653195649385,
-0.02011498063802719,
0.02794063836336136,
-0.034626640379428864,
0.06564435362815857,
0.0064485701732337475,
0.013371998444199562,
0.00928347185254097,
0.002972610527649522,
0.024540657177567482,
-0.008761128410696983,
0.02759874239563942,
-0.004230984020978212,
-0.040115997195243835,
-0.03342999517917633,
-0.017132872715592384,
-0.05447569862008095,
-0.07293817400932312,
0.005489357281476259,
-0.028358513489365578,
-0.038729410618543625,
0.017683709040284157,
0.04402882605791092,
-0.002699567237868905,
-0.0007146611460484564,
0.004197743721306324,
0.0007918255869299173,
-0.05166453868150711,
0.010940725915133953,
0.015470870770514011,
-0.00021546677453443408,
0.09831458330154419,
0.0005475705256685615,
-0.010769776999950409,
-0.033790890127420425,
-0.04516848549246788,
0.008818111382424831,
-0.055159494280815125,
0.03244229033589363,
-0.0911727175116539,
-0.006116169970482588,
0.04642210900783539,
0.06332705169916153,
-0.03548138216137886,
0.004698718897998333,
0.027579747140407562,
-0.03808360546827316,
-0.016278129070997238,
-0.001080895308405161,
0.036924950778484344,
0.004126515239477158,
0.035462386906147,
0.023363009095191956,
0.01774069108068943,
0.036602046340703964,
0.007654709275811911,
-0.03390485420823097,
0.05166453868150711,
0.02095073089003563,
0.0177311934530735,
-0.022812174633145332,
0.00429508974775672,
0.006970914080739021,
0.08311913162469864,
-0.0196401234716177,
0.019488168880343437,
-0.05010700598359108,
-0.010902737267315388,
0.08220740407705307,
0.0037252602633088827,
0.05101873353123665,
-0.025034509599208832,
-0.004480284173041582,
0.031093696132302284,
0.00920274667441845,
-0.020646821707487106,
-0.04034392908215523,
-0.03808360546827316,
-0.04000202938914299,
0.03225234895944595,
0.029783088713884354,
-0.006723987869918346,
0.0024977526627480984,
-0.0454723946750164,
0.03153056651353836,
-0.02077978290617466,
0.04699193686246872,
-0.028852365911006927,
-0.02890934981405735,
-0.01666751317679882,
0.04342100769281387,
0.031834475696086884,
-0.026060201227664948,
-0.03078978694975376,
-0.03436071798205376,
-0.051702529191970825,
-0.03130263462662697,
-0.03886236995458603,
-0.031739503145217896,
-0.018054097890853882,
0.02579428069293499,
0.015964722260832787,
0.05914830043911934,
0.006315610371530056,
0.02267921343445778,
0.03992605209350586,
-0.014093782752752304,
-0.011814464814960957,
-0.02710488997399807,
-0.006244381424039602,
-0.006173152942210436,
-0.08691798895597458,
0.002352920826524496,
0.04995505139231682,
0.006405833177268505,
-0.029137281700968742,
-0.05223437026143074,
-0.020912742242217064,
-0.04968913272023201,
0.027636731043457985,
0.013001609593629837,
0.00956838671118021,
-0.020931735634803772,
0.00012784065620508045,
-0.0003926481294911355,
0.007051639724522829,
0.09466767311096191,
0.03287916257977486,
-0.020570844411849976,
-0.020323919132351875,
0.005275671370327473,
0.010010004974901676,
-0.028852365911006927,
0.04820757359266281,
0.06378291547298431,
0.007773424033075571,
0.04714389145374298,
-0.024046804755926132,
-0.04494055360555649,
-0.02324904315173626,
0.008632916957139969,
0.02908029779791832,
0.002401593839749694,
-0.05371592566370964,
0.04870142787694931,
0.0024277111515402794,
-0.006543541792780161,
0.02013397589325905,
0.03584227338433266,
0.005527345929294825,
0.06689798086881638,
0.058768413960933685,
-0.0010838632006198168,
0.039622142910957336,
-0.000565377704333514,
-0.04383888095617294,
0.07992808520793915,
-0.047447800636291504,
-0.013049094937741756,
-0.025414394214749336,
0.011890442110598087,
0.00260696979239583,
0.04551038146018982,
-0.008955820463597775,
0.03316407650709152,
-0.026668019592761993,
0.021216651424765587,
-0.021881451830267906,
0.05018298327922821,
0.029118286445736885,
0.007906383834779263,
-0.024768589064478874,
0.013609427958726883,
-0.045624349266290665,
0.016819467768073082,
0.06313710659742355,
-0.022052401676774025,
0.037076905369758606,
-0.028035610914230347,
0.05333603918552399,
-0.021064696833491325,
-0.05607122182846069,
0.04938522353768349,
0.02915627509355545,
-0.019564146175980568,
-0.02416077069938183,
-0.03422775864601135,
-0.01931721903383732,
-0.023951832205057144,
0.010646314360201359,
-0.023685911670327187,
0.01783566363155842,
0.0645046979188919,
0.00012554056593216956,
0.0368109866976738,
-0.03755176439881325,
0.1010497659444809,
0.008984311483800411,
-0.013125072233378887,
0.061959460377693176,
0.01586025394499302,
-0.042433302849531174,
0.044484689831733704,
0.0006279996014200151,
-0.014435680583119392,
-0.0006185024394653738,
0.03267022222280502,
0.057704731822013855,
-0.02710488997399807,
0.04239531233906746,
0.07039293646812439,
0.017949629575014114,
0.00213567353785038,
-0.005574831739068031,
-0.007849400863051414,
-0.03342999517917633,
-0.007659458089619875,
-0.02416077069938183,
-0.005061985459178686,
0.07962417602539062,
0.012384294532239437,
0.008751630783081055,
-0.012431779876351357,
-0.01668650656938553,
0.035937245935201645,
-0.057286858558654785,
-0.046612050384283066,
-0.06883540004491806,
-0.006738233845680952,
-0.02414177544414997,
-0.03189145773649216,
0.01240328885614872,
-0.026971928775310516,
-0.0135904336348176,
0.05094275623559952,
-0.016458574682474136,
0.058844391256570816,
-0.016980918124318123,
0.015375899150967598,
-0.0004917746991850436,
-0.00147918239235878,
-0.013580936007201672,
0.03755176439881325,
-0.05960416421294212,
0.08767776191234589,
-0.014682606793940067,
0.04182548448443413,
-0.002045450499281287,
0.05709691345691681,
0.01962112821638584,
-0.06655608117580414,
0.04228134825825691,
0.023628929629921913,
0.04475060850381851,
-0.09284421801567078,
-0.03738081455230713,
0.011064189486205578,
-0.07688899338245392,
0.01195692177861929,
0.017759686335921288,
-0.005161705426871777,
-0.11943626403808594,
0.060743823647499084,
0.07248231023550034,
0.04532044008374214,
0.1018095314502716,
-0.05493156239390373,
0.0024787583388388157,
0.04786567762494087,
0.019079791381955147,
0.016145169734954834,
-0.07612922042608261,
0.037399809807538986,
0.0422433577477932,
0.025566348806023598,
0.010332908481359482,
0.024274736642837524,
-0.0017569742631167173,
0.07571134716272354,
0.026326121762394905,
-0.006648010574281216,
-0.05181649327278137,
-0.0261931624263525,
-0.009435426443815231,
-0.04516848549246788,
-0.00698515959084034,
-0.05709691345691681,
-0.029783088713884354,
-0.007915881462395191,
-0.07624318450689316,
0.0065055531449615955,
-0.017531754449009895,
0.040609847754240036,
0.013656913302838802,
0.028795383870601654,
0.013580936007201672,
0.0736219733953476,
0.04980309680104256,
0.01018095389008522,
0.0154423788189888,
-0.0020240817684680223,
0.011349104344844818,
-0.03390485420823097,
-0.002248452277854085,
-0.05128465220332146,
0.0075122518464922905,
0.028149576857686043,
-0.019421689212322235,
0.056147199124097824,
0.00981056410819292,
-0.025908246636390686,
0.0006950732786208391,
-0.03132162615656853,
-0.030086996033787727,
-0.057704731822013855,
-0.026990924030542374,
0.01617366075515747,
0.039546165615320206,
-0.018025606870651245,
-0.006405833177268505,
-0.029783088713884354,
-0.019678112119436264,
0.04680199548602104,
-0.02488255500793457,
-0.006700245197862387,
-0.016306620091199875,
0.04748579114675522,
-0.008737385272979736,
0.003734757425263524,
-0.07419180124998093,
-0.0009853302035480738,
0.005313660018146038,
-0.04634613171219826,
-0.00907453428953886,
0.02750376984477043,
0.0019433560082688928,
-0.00878961943089962,
-0.04740981385111809,
0.01928872801363468,
0.018054097890853882,
-0.01384685654193163,
0.019564146175980568,
0.002021707594394684,
0.00793012697249651,
0.017132872715592384,
0.018092086538672447,
-0.052614256739616394,
-0.03920426964759827,
0.03202441707253456,
0.03491155430674553,
-0.05147459730505943,
0.034626640379428864,
-0.0010642752749845386,
0.017949629575014114,
0.07069684565067291,
-0.045700326561927795,
0.013723393902182579,
0.025889253243803978,
-0.0533740296959877,
-0.03620316833257675,
0.02801661565899849,
-0.025072498247027397,
-0.05743881314992905,
0.020969724282622337,
-0.03981208801269531,
0.09679503738880157,
0.03785567358136177,
-0.045624349266290665,
0.03293614462018013,
0.023780884221196175,
0.017218347638845444,
0.0023790381383150816,
0.024920543655753136,
0.10386092215776443,
0.03728584200143814,
-0.08577833324670792,
0.02414177544414997,
0.042509280145168304,
0.029954036697745323,
0.0026022212114185095,
-0.009592129848897457,
0.012137368321418762,
-0.017104381695389748,
-0.05363994836807251,
0.00849995668977499,
-0.010057490319013596,
-0.002105994848534465,
0.030124984681606293,
-0.01523344125598669,
0.015575339086353779,
0.04277519881725311,
0.006828456651419401,
0.013087083585560322,
-0.037741705775260925,
-0.024426691234111786,
-0.01906079612672329,
-0.010066987946629524,
0.009416432119905949,
0.037323832511901855,
-0.017683709040284157,
-0.013049094937741756,
0.027902649715542793,
0.009046043269336224,
0.04592825844883919,
-0.09580732882022858,
-0.009046043269336224,
0.012365300208330154,
0.02241329289972782,
-0.02258424274623394,
0.008343253284692764,
0.04494055360555649,
-0.03350597247481346,
-0.057856686413288116,
-0.03261324018239975,
0.01838649809360504,
0.09185651689767838,
-0.00878487154841423,
-0.03443669527769089,
0.023704906925559044,
-0.03597523644566536,
-0.036602046340703964,
0.016724495217204094,
-0.004831679165363312,
-0.013552444986999035,
-0.018937332555651665,
0.03287916257977486,
0.03943220153450966,
0.008670905604958534,
-0.0061351642943918705,
-0.03500652313232422,
-0.004981259349733591,
-0.014198251068592072,
0.03350597247481346,
-0.013903839513659477,
-0.03337301313877106,
-0.01914627104997635,
0.030049007385969162,
-0.04091375693678856,
0.005365894176065922,
-0.04509250819683075,
0.006296616047620773,
0.08615821599960327,
-0.06780970841646194,
0.03671601414680481,
0.05379190295934677,
0.05291816592216492,
-0.004841176327317953,
0.041103702038526535,
-0.00207275478169322,
-0.05390587076544762,
-0.01272619143128395,
0.04425675794482231,
-0.04425675794482231,
0.021045701578259468,
0.03969812020659447,
0.013666410930454731,
-0.09064088016748428,
0.008879843167960644,
0.016961924731731415,
-0.02038090117275715,
0.000020867779312538914,
-0.031188666820526123,
-0.02759874239563942,
0.00878961943089962,
0.008115321397781372,
0.002929873298853636,
-0.013827862218022346,
-0.007194097153842449,
0.009554141201078892,
-0.042927153408527374,
-0.0407618023455143,
0.002528618322685361,
-0.03671601414680481,
-0.0012928006472066045,
0.10553242266178131,
-0.016980918124318123,
0.005954718217253685,
0.038976337760686874,
0.01578427664935589,
-0.030675821006298065,
-0.021805474534630775,
-0.010152461938560009,
0.023287031799554825,
-0.10819162428379059,
-0.00575052946805954,
-0.007075382862240076,
-0.04281318932771683,
-0.042015425860881805,
-0.007037394214421511,
-0.01635410636663437,
-0.0023137452080845833,
-0.022242344915866852,
0.04946120083332062,
-0.01569880172610283,
-0.0338478721678257,
-0.03350597247481346,
0.0033026367891579866,
-0.01849096640944481,
-0.03491155430674553,
-0.008922579698264599,
-0.030979730188846588,
-0.028852365911006927,
0.0021392349153757095,
0.055729322135448456,
0.02505350299179554,
-0.001142033259384334,
0.0033287538681179285,
0.01474908646196127,
-0.04771372303366661,
-0.006101923994719982,
0.032803185284137726,
0.028453486040234566,
0.021748492494225502,
-0.007944372482597828,
0.058616459369659424,
-0.03073280304670334,
0.03270821273326874,
-0.012232339940965176,
-0.004750953521579504,
0.023192059248685837,
-0.011899938806891441,
-0.040951747447252274,
-0.006980411242693663,
-0.02799762226641178,
0.02243228815495968,
0.031834475696086884,
-0.05394385755062103,
-0.05405782535672188,
-0.029346218332648277,
0.023932838812470436,
0.014939029701054096,
-0.038976337760686874,
-0.006842702627182007,
-0.011548544280230999,
-0.08532246947288513,
-0.011719493195414543,
0.05519748479127884,
0.0002863986883312464,
-0.007284320425242186,
0.0023410494904965162,
0.02596523053944111,
0.04197743907570839,
-0.024540657177567482,
-0.010665308684110641,
0.009905535727739334,
-0.0037062659393996,
-0.024122782051563263,
0.012279825285077095,
0.036659032106399536,
0.030618837103247643,
0.009335706010460854,
-0.05709691345691681,
-0.04277519881725311,
-0.054095812141895294,
0.023875854909420013,
-0.04763774573802948,
0.019079791381955147,
-0.011026200838387012,
-0.05299414321780205,
-0.0036017971578985453,
-0.026250144466757774,
0.041445598006248474,
-0.009991010650992393,
-0.013476467691361904,
0.02898532710969448,
0.01921275071799755,
-0.011918933130800724,
0.003998303785920143,
0.048511482775211334,
-0.0037300088442862034,
0.019678112119436264,
0.016819467768073082,
0.018272532150149345,
-0.018519457429647446,
-0.016696004197001457,
0.016696004197001457,
-0.04190146178007126,
-0.009905535727739334,
0.03234732151031494,
0.041027724742889404,
-0.014996012672781944,
-0.018832864239811897,
0.06773373484611511,
-0.05588127672672272,
0.0025666069705039263,
-0.0014221994206309319,
0.004660730250179768,
0.0518924705684185,
-0.007602475117892027,
-0.007445772178471088,
0.060325946658849716,
0.0025357413105666637,
0.07738284766674042,
0.024122782051563263,
-0.04889136925339699,
0.011681504547595978,
0.004577630199491978,
-0.008922579698264599,
-0.041521575301885605,
-0.038387514650821686,
0.04334503039717674,
0.02670600824058056,
0.005945221055299044,
0.020494867116212845,
0.022565247491002083,
-0.014483165927231312,
0.07992808520793915,
0.0271808672696352,
0.05082878842949867,
0.029023315757513046,
-0.0016453826101496816,
-0.04034392908215523,
0.015337910503149033,
-0.02144458331167698,
-0.060667846351861954,
-0.11715694516897202,
-0.05234833434224129,
-0.031834475696086884,
0.038482483476400375,
0.04634613171219826,
0.014141268096864223,
0.030523866415023804,
0.009848552756011486,
0.016790974885225296
]
|
36,559 | torch_pso.optim.RingTopologyPSO | __init__ | null | def __init__(self,
params: Iterable[torch.nn.Parameter],
num_neighbors: int = 2,
inertial_weight: float = .9,
cognitive_coefficient: float = 1.,
social_coefficient: float = 1.,
num_particles: int = 100,
max_param_value: float = 10.,
min_param_value: float = -10.):
super().__init__(params, inertial_weight, cognitive_coefficient, social_coefficient, num_particles,
max_param_value, min_param_value)
self.losses = {i: (particle.position, torch.inf) for i, particle in enumerate(self.particles)}
self.num_neighbors = num_neighbors
| (self, params: Iterable[torch.nn.parameter.Parameter], num_neighbors: int = 2, inertial_weight: float = 0.9, cognitive_coefficient: float = 1.0, social_coefficient: float = 1.0, num_particles: int = 100, max_param_value: float = 10.0, min_param_value: float = -10.0) | [
-0.014046115800738335,
-0.04514823108911514,
-0.03407483920454979,
0.013720974326133728,
-0.023595988750457764,
0.020790481939911842,
-0.05722491815686226,
-0.029039787128567696,
-0.029801547527313232,
0.02062326669692993,
-0.021124912425875664,
0.06294740736484528,
-0.007315685506910086,
0.03905414789915085,
-0.042101189494132996,
-0.008054221048951149,
0.03886835277080536,
0.029039787128567696,
-0.02209104783833027,
-0.021626560017466545,
-0.019508494064211845,
0.010413819923996925,
-0.036991823464632034,
0.05258003994822502,
-0.02948569692671299,
-0.011677227914333344,
-0.022146785631775856,
0.01714889518916607,
-0.04537118598818779,
-0.00873237382620573,
-0.03961153328418732,
0.008588382974267006,
0.001913690473884344,
0.058339688926935196,
0.032960064709186554,
0.005406640004366636,
0.00516046117991209,
0.05592435225844383,
-0.10151848942041397,
0.06684911251068115,
0.000845368136651814,
-0.05272867530584335,
0.021645139902830124,
-0.011528591625392437,
0.011417114175856113,
0.01173296570777893,
0.032216884195804596,
0.060457754880189896,
-0.021477924659848213,
-0.02894688956439495,
-0.010218735784292221,
-0.01378600299358368,
0.056593213230371475,
-0.03316444158554077,
-0.05205981060862541,
0.09044510126113892,
0.07639898359775543,
0.04198971390724182,
0.025806952267885208,
-0.020400311797857285,
-0.00027477365802042186,
-0.027274733409285545,
0.03736341372132301,
-0.029913024976849556,
0.019824346527457237,
-0.030451830476522446,
-0.05454946681857109,
-0.021050594747066498,
-0.0021436118986457586,
0.05116799473762512,
0.1214357316493988,
-0.017659831792116165,
0.002452496439218521,
0.011305637657642365,
0.005151171702891588,
0.00941517110913992,
0.014111144468188286,
0.0025268145836889744,
0.0015455837128683925,
0.005950090941041708,
0.01613631285727024,
-0.0074596768245100975,
-0.02786927856504917,
-0.027441948652267456,
-0.0323469415307045,
-0.06179548054933548,
-0.024636441841721535,
-0.06034627556800842,
0.00469829561188817,
0.03764210641384125,
-0.06458240747451782,
0.05336037650704384,
0.005806099623441696,
-0.015653245151042938,
0.054623786360025406,
0.06588297337293625,
0.019155483692884445,
-0.03747488930821419,
0.03466938063502312,
-0.04860402271151543,
-0.010079389438033104,
0.018570229411125183,
-0.015123728662729263,
0.007120600435882807,
0.017121026292443275,
-0.05811673402786255,
-0.021273549646139145,
-0.013442281633615494,
0.026550132781267166,
-0.014557053335011005,
-0.06432229280471802,
0.053769126534461975,
-0.06933876127004623,
0.014241200871765614,
-0.039834488183259964,
-0.00781733263283968,
-0.01854236051440239,
-0.0051836855709552765,
-0.012281062081456184,
0.025546837598085403,
0.014696399681270123,
0.05900855362415314,
-0.0416552796959877,
0.012504016049206257,
0.0010509040439501405,
0.03602568805217743,
0.013470151461660862,
0.00026316146249882877,
-0.012903476133942604,
-0.06194411590695381,
0.0034674026537686586,
-0.04161812365055084,
-0.002524492098018527,
-0.019545653834939003,
-0.0019044006476178765,
-0.0837564691901207,
0.005248714238405228,
-0.01874673366546631,
-0.014557053335011005,
0.010692513547837734,
0.0600118450820446,
0.046374477446079254,
0.009271180257201195,
0.015309523791074753,
-0.0026104224380105734,
0.02948569692671299,
0.0187095757573843,
-0.041915394365787506,
0.004203616175800562,
-0.030247457325458527,
0.004254709929227829,
0.00922008603811264,
-0.021682297810912132,
0.008082090876996517,
-0.03340597450733185,
-0.031882453709840775,
0.03897983208298683,
-0.07149399071931839,
0.009382656775414944,
-0.004126975778490305,
-0.018802473321557045,
-0.012290352024137974,
0.003976017236709595,
-0.0001833275891840458,
-0.07773670554161072,
0.0009202667861245573,
-0.0023433417081832886,
-0.041766759008169174,
0.001420171931385994,
-0.005820034071803093,
-0.006614308804273605,
-0.06967319548130035,
0.02138502709567547,
0.027218995615839958,
-0.010302343405783176,
0.05811673402786255,
0.012476147152483463,
-0.027813538908958435,
-0.02645723521709442,
0.0030331064481288195,
0.04366187006235123,
-0.05807957425713539,
0.03426063433289528,
-0.0917828232049942,
0.03710329905152321,
0.029262742027640343,
0.03511529043316841,
0.029745809733867645,
-0.03039609268307686,
0.023967579007148743,
0.03544972091913223,
-0.007041637785732746,
-0.007557219360023737,
0.025714054703712463,
0.006906935945153236,
0.034149155020713806,
0.06216707080602646,
0.0011867667781189084,
-0.03288574889302254,
0.04321596026420593,
0.003409341676160693,
0.03091632016003132,
-0.030804842710494995,
-0.04908708855509758,
-0.011593619361519814,
0.033424556255340576,
-0.02116207219660282,
0.03853392228484154,
0.026271440088748932,
-0.03284858912229538,
-0.019099745899438858,
-0.003982984460890293,
0.0708622857928276,
0.006423868704587221,
0.009285114705562592,
-0.0381251722574234,
-0.026587290689349174,
-0.0048631890676915646,
0.010311633348464966,
-0.02576979249715805,
0.047600727528333664,
-0.028816834092140198,
0.021124912425875664,
0.012392539530992508,
0.013916059397161007,
0.03606284782290459,
0.02983870729804039,
-0.03461364284157753,
-0.01201165933161974,
0.03580273315310478,
0.005318387411534786,
-0.002028651302680373,
-0.02562115713953972,
0.012085977010428905,
0.013665236532688141,
0.05845116451382637,
-0.03749346733093262,
0.003936535678803921,
-0.10203871876001358,
0.0008767210529185832,
-0.03165949881076813,
-0.004161812365055084,
-0.00952200312167406,
-0.00507220858708024,
0.00470758555456996,
0.005165106151252985,
0.03089774027466774,
0.05651889741420746,
-0.027479108422994614,
0.0365830734372139,
-0.0023073439951986074,
-0.016563640907406807,
-0.028129391372203827,
-0.0015281654195860028,
0.0013864965876564384,
-0.05811673402786255,
-0.015931937843561172,
0.00701841339468956,
0.005824679043143988,
-0.018848922103643417,
-0.06684911251068115,
-0.0215336624532938,
-0.02116207219660282,
0.06900433450937271,
0.015625376254320145,
0.008151764050126076,
-0.032941486686468124,
0.03403767943382263,
-0.03002450242638588,
0.011807284317910671,
0.08702646940946579,
0.03596995025873184,
0.019471336156129837,
-0.0243577491492033,
0.017604093998670578,
-0.018570229411125183,
-0.008718439377844334,
-0.02892831154167652,
-0.002652226248756051,
0.04826958850026131,
0.04362471029162407,
-0.025751212611794472,
-0.029169844463467598,
-0.03673170879483223,
0.04028039798140526,
-0.01120345015078783,
0.016898073256015778,
0.014975092373788357,
-0.009456975385546684,
-0.004482308868318796,
-0.038571082055568695,
0.024785079061985016,
0.039277102798223495,
0.024246271699666977,
0.05265435576438904,
-0.03853392228484154,
0.009359432384371758,
0.05068492889404297,
0.011686516925692558,
-0.021050594747066498,
0.07193990051746368,
-0.06480535864830017,
-0.007924164645373821,
-0.0374191515147686,
-0.02591842971742153,
-0.020716164261102676,
0.053769126534461975,
0.032402679324150085,
0.028482401743531227,
0.013191458769142628,
0.07662193477153778,
0.04113505408167839,
0.03572841361165047,
0.0487154982984066,
0.018235797062516212,
-0.03602568805217743,
0.029448537155985832,
-0.05982604995369911,
0.03322017937898636,
0.06554853916168213,
0.006377419922500849,
0.0033675378654152155,
-0.021254969760775566,
0.012661942280828953,
-0.04555698111653328,
-0.049718793481588364,
0.036973241716623306,
0.041580963879823685,
-0.030804842710494995,
-0.03056330792605877,
-0.025323884561657906,
-0.006879067048430443,
-0.010989785194396973,
-0.03390762209892273,
-0.055181171745061874,
0.016851624473929405,
0.031046375632286072,
0.053769126534461975,
0.04752640798687935,
-0.03039609268307686,
0.0571877583861351,
-0.014519893564283848,
-0.029615752398967743,
0.05919434875249863,
-0.026234280318021774,
-0.053434696048498154,
0.037530627101659775,
-0.014046115800738335,
-0.0018869823543354869,
-0.02367030642926693,
-0.023168660700321198,
0.05183685943484306,
0.02207246795296669,
0.06814967840909958,
0.05670469254255295,
0.010311633348464966,
-0.014696399681270123,
-0.031863875687122345,
-0.017743440344929695,
-0.02045604959130287,
0.009359432384371758,
-0.033814724534749985,
-0.009299049153923988,
0.049012769013643265,
-0.008263240568339825,
0.0053927055560052395,
0.019675711169838905,
-0.031863875687122345,
0.03639727830886841,
-0.003836670657619834,
-0.03175239637494087,
-0.05897139385342598,
-0.05603582784533501,
0.008518709801137447,
0.04347607493400574,
-0.025212407112121582,
-0.06881853938102722,
0.00489570340141654,
0.036137163639068604,
-0.019564233720302582,
-0.004881768487393856,
-0.04875265806913376,
0.03727051615715027,
0.0018358887173235416,
-0.03108353540301323,
0.007998483255505562,
0.06417366117238998,
-0.020010141655802727,
0.07543284446001053,
0.00916899275034666,
0.021440764889121056,
0.005318387411534786,
0.029708649963140488,
-0.011417114175856113,
-0.050239019095897675,
0.03478085994720459,
0.08509419858455658,
-0.002875180449336767,
-0.050424814224243164,
-0.04414493590593338,
-0.006126596126705408,
-0.06513979285955429,
0.02385610155761242,
0.04734061285853386,
-0.010850438848137856,
-0.06023479998111725,
0.03171524032950401,
0.06094082072377205,
0.03831096738576889,
0.027757801115512848,
-0.062092751264572144,
-0.005211554933339357,
-0.0028566010296344757,
-0.0003692679456435144,
-0.011417114175856113,
-0.05016469955444336,
0.024636441841721535,
-0.032049670815467834,
0.015402421355247498,
-0.007789463270455599,
0.03831096738576889,
-0.02786927856504917,
0.0708622857928276,
0.03227262571454048,
0.006001184694468975,
0.0075479294173419476,
-0.010135127231478691,
-0.023930421099066734,
0.01385103166103363,
-0.05492105707526207,
-0.09847144782543182,
-0.02967149205505848,
-0.006205559242516756,
-0.06647751480340958,
0.02928132191300392,
-0.01692594215273857,
-0.005025759804993868,
0.015857620164752007,
-0.024060476571321487,
0.027088938280940056,
0.04555698111653328,
0.004951441660523415,
0.037159036844968796,
0.018430883064866066,
0.0007826622459106147,
0.020511789247393608,
0.000913299445528537,
0.0010154867777600884,
-0.03158518299460411,
-0.029745809733867645,
0.020883379504084587,
-0.023205818608403206,
0.054289355874061584,
-0.030990637838840485,
0.0012216033646836877,
0.0024780433159321547,
-0.06588297337293625,
-0.01993582397699356,
0.04340175539255142,
-0.01217887457460165,
0.018226508051156998,
0.044405050575733185,
-0.01040453091263771,
-0.013033532537519932,
-0.05369481071829796,
-0.01175154559314251,
0.03630438074469566,
-0.04786084219813347,
0.004928217269480228,
-0.0025059126783162355,
0.04046619310975075,
0.03481801971793175,
0.03307154402136803,
-0.07520989328622818,
-0.026475815102458,
0.0012935990234836936,
0.004424247890710831,
0.0006746687577106059,
0.021979570388793945,
-0.022183945402503014,
0.012680521234869957,
-0.04184107482433319,
0.037883639335632324,
0.0007246012100949883,
-0.009312983602285385,
-0.013089271262288094,
-0.043736185878515244,
0.0070091234520077705,
0.00750612560659647,
0.028816834092140198,
-0.041952554136514664,
0.0011838637292385101,
0.02610422484576702,
0.01617347076535225,
-0.02487797662615776,
0.014584922231733799,
0.03498523309826851,
0.0077430144883692265,
0.06034627556800842,
-0.01692594215273857,
-0.016061993315815926,
0.010934046469628811,
-0.020771902054548264,
-0.020344574004411697,
-0.006865132134407759,
-0.007478256244212389,
-0.026048485189676285,
0.029894445091485977,
-0.018681706860661507,
0.051985494792461395,
0.02859387919306755,
-0.046002887189388275,
-0.009958622045814991,
0.004410313442349434,
-0.01883034221827984,
-0.02861245907843113,
-0.04080062359571457,
0.07338909804821014,
0.01674014702439308,
-0.045482661575078964,
0.07684489339590073,
0.06253866106271744,
0.03526392579078674,
-0.016637958586215973,
0.00849083997309208,
0.007529349997639656,
-0.011054813861846924,
-0.08256737887859344,
0.009057515300810337,
0.018886080011725426,
-0.021793775260448456,
-0.03842244669795036,
-0.05912002921104431,
0.035746995359659195,
-0.0002037941012531519,
0.013358674012124538,
0.022481217980384827,
-0.019192643463611603,
0.004510178230702877,
0.00710666598752141,
-0.008100669831037521,
0.002364243846386671,
0.047563567757606506,
-0.042955849319696426,
0.02666161023080349,
-0.02383752353489399,
-0.03440926969051361,
0.07595307379961014,
-0.04042903333902359,
-0.004524112679064274,
0.010571746155619621,
-0.010042229667305946,
-0.07825693488121033,
-0.03511529043316841,
0.06997046619653702,
0.014798587188124657,
-0.0333130769431591,
-0.07959465682506561,
0.000005601978955382947,
0.1105852946639061,
0.019099745899438858,
-0.030061662197113037,
0.04767504706978798,
-0.019155483692884445,
-0.044405050575733185,
0.0020983244758099318,
-0.014863614924252033,
-0.009568451903760433,
-0.05105651915073395,
0.01580188050866127,
0.03466938063502312,
0.016851624473929405,
-0.06421081721782684,
0.03961153328418732,
-0.017018839716911316,
-0.01692594215273857,
0.030284615233540535,
-0.01016299705952406,
-0.010711092501878738,
-0.01545816008001566,
0.00507220858708024,
-0.010692513547837734,
-0.015774011611938477,
-0.03348029404878616,
0.04715481773018837,
0.10820712149143219,
-0.08568874001502991,
0.043178800493478775,
0.05046197399497032,
0.010822569951415062,
0.012262482196092606,
0.020734742283821106,
-0.03208683058619499,
-0.018551649525761604,
-0.02751626819372177,
0.024933714419603348,
-0.04994174838066101,
-0.008467615582048893,
0.03749346733093262,
0.014417706988751888,
-0.07877715677022934,
0.014185463078320026,
-0.008351493626832962,
0.02155224233865738,
-0.003362892894074321,
-0.06305889040231705,
-0.015578926540911198,
0.04507391154766083,
-0.015829749405384064,
-0.002237670822069049,
0.02383752353489399,
-0.003692679340019822,
-0.027274733409285545,
-0.05194833502173424,
-0.047600727528333664,
-0.023242978379130363,
-0.028185131028294563,
0.03578415513038635,
0.09921462833881378,
0.0005263229249976575,
-0.027962176129221916,
-0.016415005549788475,
-0.007784818299114704,
0.03069336526095867,
-0.05867411941289902,
-0.05388060584664345,
0.00030685236561112106,
-0.1204695999622345,
0.003553332993760705,
0.036471594125032425,
0.01617347076535225,
-0.0005646431818604469,
-0.05841400846838951,
-0.010283763520419598,
-0.025212407112121582,
0.004714552778750658,
0.05087072402238846,
-0.03208683058619499,
0.01650790311396122,
0.0020251674577593803,
0.007682631257921457,
0.03730767220258713,
-0.02807365357875824,
-0.019991561770439148,
-0.030135979875922203,
-0.03208683058619499,
-0.01706528849899769,
0.026364337652921677,
0.05243140086531639,
-0.012095266953110695,
0.02861245907843113,
0.023428773507475853,
-0.01879318244755268,
0.017864206805825233,
0.00970779825001955,
-0.016368556767702103,
-0.0032514159101992846,
0.0550696924328804,
0.0731661468744278,
-0.0028612460009753704,
-0.011797994375228882,
-0.007715145125985146,
0.029039787128567696,
0.014417706988751888,
0.022815648466348648,
-0.022834228351712227,
-0.03879403695464134,
-0.05101935938000679,
-0.031863875687122345,
0.003692679340019822,
-0.02876109443604946,
-0.016229210421442986,
-0.04630016162991524,
0.01157504040747881,
0.03316444158554077,
0.0009237504564225674,
-0.05581287294626236,
0.013451571576297283,
-0.025695474818348885,
0.02770206332206726,
0.07714216411113739,
0.010934046469628811,
0.00013056467287242413,
0.010116548277437687,
0.04213834926486015,
0.008518709801137447,
-0.05109367519617081,
0.014724268577992916,
-0.02259269542992115,
0.0016048059333115816,
-0.03860824182629585,
-0.0109433364123106,
0.010441689752042294,
0.020530369132757187,
0.03500381484627724,
-0.0275348462164402,
-0.07840556651353836,
-0.06525126844644547,
-0.00781733263283968,
0.0023944354616105556,
-0.009317629039287567,
0.018040712922811508,
-0.08539146929979324,
0.07639898359775543,
-0.04288152977824211,
0.01236466970294714,
0.031046375632286072,
-0.029262742027640343,
0.027813538908958435,
-0.011175580322742462,
-0.00010262281284667552,
0.025119509547948837,
0.02134786732494831,
-0.05722491815686226,
-0.023967579007148743,
0.10345076024532318,
0.08903305232524872,
-0.0005919318646192551,
-0.03583989292383194,
0.0009522003238089383,
0.026029905304312706,
-0.04604004696011543,
0.0536576509475708,
0.05336037650704384,
-0.017390429973602295,
-0.03580273315310478,
0.03710329905152321,
-0.011444984003901482,
0.03905414789915085,
-0.01696310006082058,
0.0025268145836889744,
0.017827048897743225,
-0.07119671255350113,
-0.02454354427754879,
0.022889968007802963,
-0.021050594747066498,
0.058191053569316864,
0.012531885877251625,
-0.02950427681207657,
-0.002991302637383342,
-0.02207246795296669,
-0.008620896376669407,
-0.02861245907843113,
-0.02119923010468483,
0.018282245844602585,
0.05098219960927963,
-0.015290943905711174,
-0.008602317422628403,
0.07056501507759094,
-0.0017127994215115905,
0.03299722447991371,
0.05116799473762512,
0.035171028226614,
-0.0035393983125686646,
0.06160968542098999,
-0.043699029833078384,
0.042807210236787796,
-0.006999833509325981,
-0.06829831004142761,
-0.08464828878641129,
-0.04819527268409729,
0.004445150028914213,
0.052542880177497864,
0.01438054721802473,
-0.010125838220119476,
0.053954921662807465,
0.05484674125909805,
-0.01995440386235714
]
|
36,563 | torch_pso.optim.RingTopologyPSO | _find_minimum_of_neighbors | null | def _find_minimum_of_neighbors(self, particle_index: int) -> List[Dict]:
neighbors = [(particle_index + i) % len(self.particles) for i in range(self.num_neighbors)]
best = sorted([self.losses[n] for n in neighbors],
key=lambda x: x[1],
reverse=True)[0]
return clone_param_groups(best[0])
| (self, particle_index: int) -> List[Dict] | [
0.028026778250932693,
-0.05845081806182861,
-0.054643403738737106,
-0.023972591385245323,
-0.0035980918910354376,
0.021169912070035934,
0.04399675503373146,
-0.002423699479550123,
0.04579469934105873,
0.0000030554449494957225,
-0.04618249088525772,
-0.00010087271948577836,
-0.0424455888569355,
-0.05605355650186539,
0.026193581521511078,
-0.055101703852415085,
0.007055168505758047,
0.016816066578030586,
-0.02762136049568653,
-0.009210057556629181,
-0.005442306865006685,
-0.004243677482008934,
-0.03379077836871147,
-0.007464994210749865,
-0.009033788926899433,
-0.0017891308525577188,
0.01403982937335968,
0.02347903698682785,
-0.02113465964794159,
-0.03768632188439369,
-0.006892119999974966,
-0.007539908401668072,
0.007592789363116026,
-0.021487196907401085,
-0.02113465964794159,
0.02231566235423088,
0.003349111881107092,
0.03719276934862137,
-0.054008837789297104,
0.019160445779561996,
-0.009148363955318928,
-0.054643403738737106,
-0.039025966078042984,
-0.024906815961003304,
0.027180686593055725,
0.033896539360284805,
0.007306352257728577,
0.11958092451095581,
0.016736745834350586,
-0.0014068473828956485,
-0.020782120525836945,
0.009077856317162514,
0.03407280892133713,
0.0031684362329542637,
-0.04322117194533348,
0.006380939390510321,
0.03758056089282036,
-0.007592789363116026,
0.03456636145710945,
-0.003265384119004011,
0.008531422354280949,
0.007619229611009359,
0.03877919167280197,
0.01661335863173008,
-0.0016954878810793161,
-0.08383356034755707,
-0.054008837789297104,
-0.013819493353366852,
-0.05489018186926842,
0.025858670473098755,
0.042093049734830856,
-0.030353529378771782,
0.0278328824788332,
-0.03377315029501915,
0.013810680247843266,
-0.0014674398116767406,
0.06920322775840759,
-0.013951695524156094,
0.0659598782658577,
0.018702145665884018,
-0.03379077836871147,
-0.02340853027999401,
-0.052140384912490845,
-0.03130538389086723,
-0.02746271714568138,
-0.01291170809417963,
0.008535828441381454,
0.02504783123731613,
0.05929690971970558,
-0.02543562464416027,
-0.0357121080160141,
0.06779307872056961,
0.017336061224341393,
0.016419462859630585,
0.007570755667984486,
0.06959102302789688,
0.03758056089282036,
-0.004441980272531509,
0.034601613879203796,
-0.06317482888698578,
-0.027797628194093704,
0.02136380970478058,
-0.06141213700175285,
0.02074686624109745,
-0.009227684698998928,
-0.02309124544262886,
-0.0027806442230939865,
0.0161550585180521,
-0.02254481054842472,
0.05383256822824478,
-0.044349294155836105,
-0.04865025728940964,
-0.0691327229142189,
0.013211364857852459,
0.009412767365574837,
0.009738865308463573,
-0.01753877103328705,
0.02464241348206997,
0.04237508028745651,
-0.00034923304338008165,
0.012850013561546803,
0.036240916699171066,
-0.04678180441260338,
0.018279099836945534,
-0.04896754026412964,
0.04241033270955086,
0.03595888614654541,
-0.008826673030853271,
0.0038492754101753235,
-0.01660454459488392,
0.054784420877695084,
0.0024942071177065372,
-0.014833040535449982,
0.01357271708548069,
-0.053233254700899124,
-0.07255233824253082,
-0.02191024273633957,
-0.055031199008226395,
0.0010989273432642221,
-0.051682084798812866,
0.03192232549190521,
-0.006244331132620573,
-0.0021747194696217775,
0.008963281288743019,
-0.03301519155502319,
-0.04202254116535187,
-0.0019852302502840757,
-0.021540077403187752,
0.02598205767571926,
-0.014418807812035084,
0.02268582582473755,
0.01965399831533432,
-0.03176368400454521,
-0.031252503395080566,
-0.015784893184900284,
-0.04071814939379692,
0.03320908918976784,
-0.09856965392827988,
0.013079163618385792,
-0.03715751692652702,
0.02635222300887108,
-0.05319799855351448,
0.0352361835539341,
-0.015573370270431042,
-0.05062447115778923,
0.02083500102162361,
-0.014207285828888416,
-0.03305044770240784,
-0.016675051301717758,
0.0024347163271158934,
-0.004071814939379692,
0.02050008997321129,
-0.04942584037780762,
0.002893015742301941,
-0.020094672217965126,
0.03743954747915268,
-0.0028709820471704006,
-0.0524224154651165,
0.017723852768540382,
-0.013819493353366852,
-0.005605355836451054,
-0.04741637408733368,
0.028114913031458855,
-0.09158939868211746,
-0.012982215732336044,
0.04188152775168419,
0.04865025728940964,
0.015705572441220284,
-0.0063412790186703205,
0.02020043320953846,
-0.005239597521722317,
-0.015044563449919224,
-0.00838159304112196,
0.03393179178237915,
-0.02892575040459633,
0.0372985303401947,
-0.017574023455381393,
0.05584203451871872,
-0.04456081613898277,
0.002558104693889618,
-0.022280408069491386,
0.011695451103150845,
-0.05023667961359024,
-0.0063060251995921135,
0.0028423385228961706,
0.023725813254714012,
-0.04092967510223389,
0.021540077403187752,
-0.019530611112713814,
0.015088630840182304,
-0.035377196967601776,
-0.013114416971802711,
0.03652294725179672,
-0.030935218557715416,
-0.01224188506603241,
-0.018420115113258362,
0.02894337847828865,
-0.0016778609715402126,
-0.010435127653181553,
-0.035923633724451065,
-0.0004081730148755014,
-0.0653253123164177,
0.045124877244234085,
0.030441664159297943,
0.0286260936409235,
0.005208750255405903,
-0.03010675311088562,
-0.03930799663066864,
-0.03156978636980057,
-0.03613515570759773,
0.045900460332632065,
-0.05700540915131569,
0.003977070562541485,
-0.05006041005253792,
0.022967856377363205,
0.04928482696413994,
-0.015291339717805386,
0.012964588589966297,
-0.04900279641151428,
0.020782120525836945,
-0.030935218557715416,
-0.02910201996564865,
0.01613743230700493,
0.022368542850017548,
0.002624205546453595,
0.008284645155072212,
0.010461567901074886,
-0.03814462199807167,
0.01754758320748806,
0.037933100014925,
-0.017591651529073715,
0.04378523305058479,
-0.025647146627306938,
-0.021275674924254417,
0.015529302880167961,
-0.05975520610809326,
-0.047451626509428024,
0.023672932758927345,
-0.017115725204348564,
-0.001921332674100995,
-0.036082275211811066,
-0.006085688713937998,
-0.006843646056950092,
-0.04382048547267914,
-0.014445248991250992,
0.0502014234662056,
-0.03768632188439369,
0.06109485402703285,
-0.017970629036426544,
0.01575845293700695,
0.056758634746074677,
0.049179065972566605,
0.02409597858786583,
-0.012109683826565742,
-0.010902240872383118,
-0.06631241738796234,
-0.03338535875082016,
0.02222752757370472,
0.03509516641497612,
0.017027590423822403,
-0.00489587290212512,
0.02099364437162876,
-0.02129330113530159,
0.011254779063165188,
-0.009033788926899433,
0.0255766399204731,
0.009906320832669735,
-0.03814462199807167,
0.016428275033831596,
-0.02464241348206997,
-0.02138143591582775,
-0.008090749382972717,
0.022597692906856537,
-0.0643734559416771,
-0.001493880175985396,
0.045512668788433075,
0.03407280892133713,
0.014577450230717659,
0.007015508133918047,
0.02481868304312229,
0.042234063148498535,
-0.06285754591226578,
-0.03003624640405178,
-0.030794203281402588,
0.0055304416455328465,
0.0411764495074749,
0.036699216812849045,
-0.005455526988953352,
0.020394328981637955,
-0.01636658050119877,
0.010514448396861553,
0.011783585883677006,
0.07960310578346252,
-0.04685231298208237,
0.02222752757370472,
-0.07445604354143143,
0.024748174473643303,
-0.012673744931817055,
0.056124065071344376,
0.05527797341346741,
0.018226219341158867,
0.022721080109477043,
-0.02629934251308441,
-0.0011997312540188432,
-0.03144639730453491,
0.016428275033831596,
0.009835813194513321,
-0.01470083836466074,
-0.048544496297836304,
-0.02161058597266674,
-0.05926165357232094,
-0.025700027123093605,
-0.028502704575657845,
0.02815016731619835,
0.01228595245629549,
0.03104097954928875,
0.038955461233854294,
0.018772654235363007,
-0.0011088424362242222,
-0.0649375170469284,
0.029542692005634308,
-0.031869444996118546,
0.018702145665884018,
0.05185835435986519,
0.0013165094424039125,
-0.02245667763054371,
0.0617646761238575,
0.011951041407883167,
-0.0433974415063858,
-0.013228992000222206,
-0.010373433120548725,
0.043009646236896515,
-0.006685003638267517,
0.0033931792713701725,
0.058697592467069626,
0.05309223756194115,
0.01763571798801422,
-0.038179874420166016,
0.005499594379216433,
0.05834505707025528,
0.02980709634721279,
0.006367719266563654,
-0.024272248148918152,
0.005459934007376432,
-0.02370818704366684,
0.02527698129415512,
0.015141511335968971,
-0.019548237323760986,
0.03892020508646965,
-0.00008179985889000818,
-0.04604147747159004,
0.02964845485985279,
-0.03292705863714218,
-0.015961162745952606,
0.007742618210613728,
-0.049496348947286606,
-0.010725971311330795,
-0.000001871997937996639,
-0.035694483667612076,
-0.049496348947286606,
-0.021258046850562096,
-0.05552475154399872,
0.014524569734930992,
0.027638986706733704,
-0.052774954587221146,
-0.006354499142616987,
0.07156523317098618,
-0.07621873915195465,
0.04716959595680237,
0.0022848874796181917,
0.012224258854985237,
-0.054643403738737106,
0.04167000204324722,
0.009835813194513321,
0.002912845928221941,
-0.005627389531582594,
0.0466407909989357,
0.00834193266928196,
-0.05122378468513489,
-0.037474799901247025,
0.03874393552541733,
-0.060425031930208206,
-0.048086196184158325,
0.020006537437438965,
-0.02714543417096138,
-0.08200035989284515,
0.004250287543982267,
0.0643734559416771,
0.006358906161040068,
0.007451774086803198,
-0.0784749835729599,
0.03564160317182541,
0.05615931749343872,
0.011695451103150845,
0.020094672217965126,
-0.008954467251896858,
-0.01555574405938387,
0.06363312900066376,
-0.014031016267836094,
-0.026457984000444412,
0.007385673001408577,
-0.09871067106723785,
0.0139164412394166,
0.003569448133930564,
-0.02113465964794159,
-0.010241231881082058,
-0.016331328079104424,
-0.046676043421030045,
-0.06521955132484436,
0.01949535682797432,
-0.041916780173778534,
-0.0286260936409235,
0.000504294759593904,
-0.029771842062473297,
-0.014577450230717659,
-0.04586520791053772,
-0.012294766493141651,
0.03969578817486763,
-0.0035584315191954374,
0.024607159197330475,
0.08143629878759384,
0.03414331376552582,
0.03736903890967369,
0.045265890657901764,
0.022738708183169365,
0.027674240991473198,
-0.012109683826565742,
0.028608467429876328,
0.01606692373752594,
-0.00279827113263309,
0.013079163618385792,
-0.09370462596416473,
0.04875601828098297,
-0.02473054826259613,
0.04530114680528641,
0.022209899500012398,
-0.09955675899982452,
-0.009597850032150745,
0.005896199494600296,
-0.005019261036068201,
0.07932107150554657,
0.042234063148498535,
0.019407222047448158,
-0.0074297403916716576,
-0.06458497792482376,
-0.009104296565055847,
0.007910073734819889,
-0.03336773067712784,
-0.015873027965426445,
-0.010047336108982563,
0.03789784386754036,
0.009245311841368675,
-0.05552475154399872,
-0.11633757501840591,
0.015881842002272606,
0.02956032007932663,
0.0011677824659273028,
-0.00662771612405777,
0.07050762325525284,
-0.005283664911985397,
-0.042939141392707825,
-0.04843873530626297,
0.06546632200479507,
0.0012658321065828204,
-0.019001804292201996,
-0.012612050399184227,
-0.04657028242945671,
-0.03252163901925087,
-0.06613614410161972,
-0.031146740540862083,
0.002822508104145527,
0.019706878811120987,
0.04304490238428116,
-0.005080955568701029,
0.039731044322252274,
0.0414937324821949,
0.04033035784959793,
0.02917252853512764,
0.12451645731925964,
-0.002617595484480262,
0.014365927316248417,
0.027409836649894714,
0.011043256148695946,
0.0018574350979179144,
-0.025470877066254616,
-0.011413420550525188,
-0.021857362240552902,
-0.002262854017317295,
0.022668199613690376,
0.04977837949991226,
0.04597096890211105,
0.008187697269022465,
0.0012878656852990389,
0.05161157622933388,
0.009421580471098423,
0.019389595836400986,
-0.0030626747757196426,
0.026634253561496735,
0.036840230226516724,
-0.024166487157344818,
0.05778099596500397,
0.027727121487259865,
0.06997881084680557,
-0.03832089155912399,
-0.014172031544148922,
0.021028896793723106,
0.03454873338341713,
-0.04981363192200661,
-0.056899648159742355,
0.007676517125219107,
0.008610743097960949,
0.019548237323760986,
-0.007037541829049587,
0.019389595836400986,
-0.014048643410205841,
0.0036685995291918516,
0.058697592467069626,
0.05069497972726822,
0.03134063631296158,
0.026969164609909058,
0.01935434155166149,
-0.020006537437438965,
0.02058822475373745,
0.004223847296088934,
0.051823101937770844,
0.03312095254659653,
-0.004750451073050499,
0.037087008357048035,
-0.08905112743377686,
-0.06148264557123184,
0.08051969856023788,
0.03290943056344986,
-0.01871977373957634,
-0.0517878457903862,
0.049954649060964584,
-0.006283991504460573,
-0.040048327296972275,
-0.0521051324903965,
0.0318341888487339,
0.05668812617659569,
0.06218772009015083,
-0.055348481982946396,
0.047909926623106,
-0.029736587777733803,
-0.10371670871973038,
-0.048086196184158325,
-0.03870868310332298,
0.019830267876386642,
-0.0463235080242157,
0.007152116857469082,
0.03562397509813309,
0.019706878811120987,
-0.04477233812212944,
-0.00838600005954504,
-0.007196183782070875,
-0.015467609278857708,
0.04258660227060318,
-0.029577946290373802,
-0.05259868502616882,
0.018543504178524017,
0.043961502611637115,
-0.03525381162762642,
0.08143629878759384,
-0.03446060046553612,
0.0037038533482700586,
0.10498584806919098,
-0.02832643687725067,
0.0026264088228344917,
0.020182806998491287,
0.018367234617471695,
0.026193581521511078,
0.02152245119214058,
0.035853125154972076,
0.0004902483196929097,
-0.02409597858786583,
0.06701749563217163,
-0.011739518493413925,
0.013466955162584782,
0.021081779152154922,
-0.004115882329642773,
-0.019001804292201996,
0.0021890413481742144,
0.0005442306865006685,
0.046605534851551056,
0.052387163043022156,
-0.03453110530972481,
-0.008553455583751202,
-0.03461924195289612,
0.013502209447324276,
-0.003899952629581094,
0.016022857278585434,
0.015414728783071041,
0.011016815900802612,
-0.03049454465508461,
-0.0701550841331482,
0.03245113044977188,
0.02504783123731613,
0.040823910385370255,
0.034055180847644806,
-0.020323822274804115,
-0.008892773650586605,
0.005878572817891836,
0.03026539646089077,
-0.030212515965104103,
0.015467609278857708,
-0.05069497972726822,
0.018155712634325027,
-0.0482272133231163,
-0.008152443915605545,
0.0646907389163971,
0.004618248902261257,
0.013757799752056599,
-0.013590343296527863,
-0.012797133065760136,
-0.07156523317098618,
0.010338179767131805,
0.07064863294363022,
-0.05414985120296478,
-0.061341628432273865,
0.014436434954404831,
-0.02612307295203209,
0.02769186720252037,
0.001975314924493432,
-0.009562595747411251,
0.009368699975311756,
-0.04103543609380722,
0.011386980302631855,
0.0418110191822052,
0.0421283021569252,
-0.010937494225800037,
0.00667178351432085,
-0.043961502611637115,
-0.060883328318595886,
-0.0009391835192218423,
0.023496665060520172,
0.005689083598554134,
-0.016252005472779274,
0.007777872029691935,
0.04678180441260338,
-0.03074132278561592,
0.02277396060526371,
-0.015414728783071041,
0.02067635953426361,
-0.021645838394761086,
-0.005195530131459236,
-0.0029304728377610445,
-0.0402245968580246,
-0.06179992854595184,
-0.019671626389026642,
0.04382048547267914,
0.015573370270431042,
-0.02356717176735401,
-0.008416847325861454,
0.04290388524532318,
0.014639144763350487,
0.05943792313337326,
-0.0323101170361042,
0.03322671726346016,
-0.056829143315553665,
-0.012955775484442711,
0.10519737005233765,
0.01088461373001337,
0.025611892342567444,
0.018543504178524017,
-0.005102988798171282,
-0.0030362342949956656,
0.014075083658099174,
-0.023055991157889366,
0.027568479999899864,
0.08390406519174576,
-0.015511676669120789,
-0.01880790665745735,
0.03431958332657814,
0.027180686593055725,
-0.03691073879599571,
0.03301519155502319,
-0.003886732505634427,
0.03001861833035946,
0.0024765802081674337,
0.013740172609686852,
0.005402646493166685,
0.05605355650186539,
-0.05711117014288902,
0.04914380982518196,
-0.05961419269442558,
-0.01974213309586048,
0.03354400023818016,
0.013722545467317104,
0.022914975881576538,
0.005230783950537443,
-0.004014527425169945,
-0.04315066337585449,
0.0453716516494751,
0.014277792535722256,
-0.03839140012860298,
0.05964944511651993,
0.013590343296527863,
-0.02487156353890896,
-0.004534521140158176,
0.019565865397453308,
-0.004338421858847141,
-0.013431701809167862,
0.00830667931586504,
0.07840447127819061,
0.001389220473356545,
0.02480105496942997,
0.06867442280054092,
-0.06758155673742294,
-0.06959102302789688,
-0.02723356895148754,
0.012717812322080135,
0.02028856799006462,
-0.053938329219818115,
-0.019777387380599976,
0.0694500058889389,
0.02894337847828865,
0.06285754591226578,
0.04491335526108742,
-0.038814444094896317,
0.0015071004163473845,
-0.03532431647181511,
0.014674398116767406,
-0.04942584037780762,
-0.014612704515457153,
0.04678180441260338,
0.01864926517009735,
-0.005918233189731836,
-0.02215701900422573,
-0.008209731429815292,
-0.02901388518512249,
0.03227486461400986,
0.024994950741529465,
0.0678635835647583,
0.0069185602478682995,
-0.06539581716060638,
-0.03285655006766319,
-0.02340853027999401,
0.011228338815271854,
-0.004494860768318176,
-0.020641105249524117,
-0.04089441895484924,
0.013625597581267357,
-0.03768632188439369,
0.07093066722154617,
-0.08066071569919586,
0.0357121080160141,
-0.005107395816594362,
-0.0005034684436395764
]
|
36,580 | torch_pso.optim.SineCosineAlgorithm | SineCosineAlgorithm |
The Sine Cosine Algorithm is an algorithm, conceived by Seyedali Mirjalili, similar to PSO, although the author
does not use particle terminology in the paper. Each particle moves towards a destination (the best candidate
solution) in a step size determined by several random parameters. The "sine" and "cosine" in the name come from the
use of sine and cosine functions to determine whether the particle's step will explore or exploit the currently
best solution.
Original Paper:
Seyedali Mirjalili , SCA: A Sine Cosine Algorithm for Solving Optimization Problems, Knowledge-Based Systems (2016),
doi: 10.1016/j.knosys.2015.12.022
https://dl.programstore.ir/files/Uploades/Lib/PDF/SCA.pdf
| class SineCosineAlgorithm(GenericPSO):
"""
The Sine Cosine Algorithm is an algorithm, conceived by Seyedali Mirjalili, similar to PSO, although the author
does not use particle terminology in the paper. Each particle moves towards a destination (the best candidate
solution) in a step size determined by several random parameters. The "sine" and "cosine" in the name come from the
use of sine and cosine functions to determine whether the particle's step will explore or exploit the currently
best solution.
Original Paper:
Seyedali Mirjalili , SCA: A Sine Cosine Algorithm for Solving Optimization Problems, Knowledge-Based Systems (2016),
doi: 10.1016/j.knosys.2015.12.022
https://dl.programstore.ir/files/Uploades/Lib/PDF/SCA.pdf
"""
def __init__(self,
params: Iterable[torch.nn.Parameter],
num_particles: int = 100,
max_movement_radius: float = 2,
max_param_value: float = -10,
min_param_value: float = 10):
particle_kwargs = {
'max_param_value': max_param_value,
'min_param_value': min_param_value,
}
super().__init__(params, num_particles, particle_class=SCAParticle, particle_kwargs=particle_kwargs)
self.max_param_value = max_param_value
self.min_param_value = min_param_value
self.max_movement_radius = max_movement_radius
self.magnitude = max_param_value-min_param_value
self.initial_movement_radius = max_movement_radius
@torch.no_grad()
def step(self, closure: Callable[[], torch.Tensor]) -> torch.Tensor:
"""
Performs a single optimization step.
:param closure: A callable that reevaluates the model and returns the loss.
:return: the final loss after the step (as calculated by the closure)
"""
r3 = 2 * torch.rand((1,))
r2 = 2*torch.pi*torch.rand((1,))
use_sine = torch.rand((1,)).item() < .5
r1 = self.max_movement_radius*torch.rand((1,))
# self.max_movement_radius *= .99
return super().step(closure, particle_step_kwargs={'r1': r1, 'r2': r2, 'r3': r3, 'use_sine': use_sine})
| (params: Iterable[torch.nn.parameter.Parameter], num_particles: int = 100, max_movement_radius: float = 2, max_param_value: float = -10, min_param_value: float = 10) | [
-0.03699101507663727,
-0.05758395045995712,
0.0032438640482723713,
0.022709432989358902,
0.008589924313127995,
0.01443412248045206,
-0.06524910032749176,
-0.01838110201060772,
0.008532721549272537,
-0.02122216485440731,
0.01083989255130291,
0.022842904552817345,
0.0294784065335989,
0.016970105469226837,
-0.05579160153865814,
0.037906255573034286,
0.036266449838876724,
0.003181894775480032,
0.0027671759016811848,
-0.005415179301053286,
-0.0031961952336132526,
0.0242348350584507,
-0.027705125510692596,
-0.03157583624124527,
-0.04202484339475632,
0.019544221460819244,
0.011964877136051655,
0.009500398300588131,
-0.07474473118782043,
-0.05834665149450302,
0.005691658705472946,
0.02797207236289978,
-0.006907213944941759,
-0.01016299519687891,
0.07272357493638992,
-0.018724318593740463,
0.044732432812452316,
0.02932586707174778,
-0.05213063582777977,
0.034626640379428864,
-0.04599089175462723,
-0.020440395921468735,
0.03300590068101883,
0.008041732013225555,
-0.02303357981145382,
-0.023128917440772057,
-0.06246523931622505,
0.10143927484750748,
0.01608346402645111,
-0.004771650303155184,
0.004330713767558336,
-0.08877843618392944,
0.04862220957875252,
-0.006249384023249149,
-0.00950993224978447,
0.07081682235002518,
0.04145281761884689,
0.019143803045153618,
0.04778324067592621,
0.013661887496709824,
0.09053265303373337,
-0.003958896733820438,
0.05773648992180824,
0.001515868934802711,
0.015482837334275246,
-0.02804834209382534,
0.00308417365886271,
-0.005138700362294912,
0.011040101759135723,
0.051863692700862885,
0.0511772595345974,
-0.04236805811524391,
0.0442366786301136,
-0.0006125445361249149,
0.03495078906416893,
-0.023967890068888664,
-0.02993602678179741,
-0.03792532533407211,
0.033635128289461136,
-0.045266326516866684,
0.008728163316845894,
-0.04274940863251686,
-0.0430544912815094,
0.007074054796248674,
-0.0091142812743783,
-0.00849935319274664,
0.034092750400304794,
-0.02122216485440731,
0.022518757730722427,
0.022003933787345886,
-0.036781273782253265,
0.021241232752799988,
0.0055295848287642,
0.01702730730175972,
0.04072825238108635,
0.04568580910563469,
0.014968013390898705,
-0.09800712019205093,
0.0315949022769928,
-0.044808704406023026,
0.06391437351703644,
0.06997784972190857,
0.011202176101505756,
0.0469442680478096,
0.06856685131788254,
-0.007302865386009216,
-0.013671421445906162,
0.012965923175215721,
0.024806860834360123,
0.0016040562186390162,
-0.04149095341563225,
0.05849919468164444,
-0.0636092945933342,
-0.011602594517171383,
-0.06852871924638748,
-0.0799311026930809,
-0.024940334260463715,
0.017933014780282974,
-0.054418738931417465,
-0.0078987255692482,
0.024844996631145477,
0.029344934970140457,
-0.05228317528963089,
-0.006459127180278301,
0.038001593202352524,
0.014538994058966637,
0.034321561455726624,
0.026065317913889885,
-0.020516665652394295,
-0.042940083891153336,
0.009772110730409622,
-0.044884972274303436,
0.06032967567443848,
0.008075100369751453,
-0.005682125221937895,
-0.034988924860954285,
0.043016355484724045,
-0.024787792935967445,
-0.033635128289461136,
0.02331959269940853,
0.011268911883234978,
0.02556956186890602,
-0.014977547340095043,
-0.014605730772018433,
0.0097911786288023,
0.04599089175462723,
0.019887438043951988,
-0.0403469018638134,
-0.005543885286897421,
-0.0254170224070549,
0.00374915380962193,
0.01947748474776745,
0.009285888634622097,
0.001004024758003652,
-0.0037920556496828794,
-0.0388214997947216,
0.027628855779767036,
-0.042863816022872925,
-0.061473727226257324,
0.04656291753053665,
-0.03485545143485069,
0.0028148447163403034,
-0.04145281761884689,
-0.010077191516757011,
-0.04801204800605774,
0.00023119384422898293,
0.016817564144730568,
0.007193226832896471,
-0.0029316332656890154,
0.009328790940344334,
-0.016455281525850296,
-0.043168894946575165,
0.0007162242545746267,
0.03676220402121544,
0.0029030318837612867,
0.036857541650533676,
0.01845737174153328,
-0.012660842388868332,
-0.00019961324869655073,
-0.07607945799827576,
-0.015101486817002296,
-0.04057571291923523,
0.00026351926499046385,
-0.05746954679489136,
0.006764207500964403,
0.07199900597333908,
0.04396973177790642,
-0.005691658705472946,
0.034226223826408386,
-0.014720136299729347,
-0.038192268460989,
-0.028296219184994698,
-0.022099271416664124,
0.03310123831033707,
-0.00212483829818666,
0.02879197522997856,
0.012088816612958908,
0.007207527756690979,
-0.012994524091482162,
0.012861051596701145,
-0.027018694207072258,
0.06582112610340118,
0.020459463819861412,
-0.04297821968793869,
-0.014596196822822094,
-0.0117360670119524,
0.0026384699158370495,
0.089998759329319,
-0.03832574188709259,
0.00819427240639925,
-0.019000796601176262,
-0.01045854203402996,
0.02707589790225029,
0.006277985405176878,
0.05888054519891739,
-0.04168162867426872,
0.020306922495365143,
0.00396843021735549,
0.02768605947494507,
0.02063107118010521,
0.02856316603720188,
-0.028830111026763916,
-0.02183232642710209,
0.0010052165016531944,
0.06467707455158234,
0.01994463987648487,
0.02820088155567646,
-0.032433874905109406,
0.02535981871187687,
-0.0667363703250885,
-0.010563413612544537,
-0.00821810681372881,
-0.0562492236495018,
0.00909044686704874,
0.05399925634264946,
0.004092369228601456,
0.013814427889883518,
0.017341921105980873,
-0.09823593497276306,
-0.05079590901732445,
-0.05918562412261963,
-0.050223883241415024,
-0.02534075267612934,
0.012279491871595383,
-0.02774326130747795,
0.0240632276982069,
0.06330420821905136,
0.03950792923569679,
-0.044732432812452316,
0.010477609932422638,
0.028467828407883644,
-0.03382580354809761,
-0.016560152173042297,
0.01270851120352745,
-0.008084634318947792,
-0.07371508330106735,
0.010553879663348198,
0.036724068224430084,
0.013537948951125145,
-0.01634087599813938,
-0.0511772595345974,
-0.05228317528963089,
-0.009600503370165825,
0.05144420638680458,
-0.009614803828299046,
-0.002688522217795253,
-0.04057571291923523,
0.00986744835972786,
-0.01049667689949274,
0.019115202128887177,
0.09518513083457947,
0.01956328935921192,
-0.04179603233933449,
-0.018295299261808395,
0.02595091238617897,
0.015492371283471584,
-0.05647803470492363,
0.04885102063417435,
0.009719675406813622,
0.015463769435882568,
0.043397706001996994,
0.024330172687768936,
-0.03254827857017517,
-0.028525030240416527,
-0.007565043866634369,
-0.023720011115074158,
0.018543176352977753,
-0.012965923175215721,
0.04881288483738899,
0.015053818002343178,
-0.06963463127613068,
0.017475394532084465,
0.0261797234416008,
0.0031699773389846087,
0.08580390363931656,
0.051406070590019226,
-0.04625783488154411,
0.011955343186855316,
0.003784905420616269,
-0.06223642826080322,
0.0624271035194397,
0.001352603198029101,
-0.050147611647844315,
-0.03231946751475334,
-0.006473427638411522,
-0.008237174712121487,
0.01626460626721382,
-0.018342968076467514,
0.03500799089670181,
-0.039050307124853134,
0.024272970855236053,
0.0010636108927428722,
0.03741050139069557,
0.042940083891153336,
-0.006459127180278301,
0.008604224771261215,
-0.00014956096129026264,
-0.06189321354031563,
0.0442366786301136,
0.06669823080301285,
-0.02063107118010521,
-0.020440395921468735,
-0.011106838472187519,
0.017933014780282974,
0.03803972899913788,
-0.027933936566114426,
-0.010191597044467926,
0.02781953103840351,
-0.01863851398229599,
-0.04095706343650818,
-0.024787792935967445,
0.013337739743292332,
-0.008327744901180267,
-0.012498768046498299,
-0.04911796748638153,
-0.00982931349426508,
0.019696762785315514,
0.03554188087582588,
0.04995693638920784,
-0.025683967396616936,
0.07607945799827576,
0.03283429145812988,
-0.026580141857266426,
0.04221551865339279,
-0.01804742030799389,
-0.06368555873632431,
0.05617295205593109,
-0.05281706899404526,
0.03352072462439537,
-0.008356346748769283,
0.03367326408624649,
0.040537577122449875,
0.02219460904598236,
0.029459338635206223,
0.0779099389910698,
0.04130027815699577,
-0.018362034112215042,
-0.05045269429683685,
-0.017065443098545074,
-0.07977855950593948,
0.042253654450178146,
-0.043245166540145874,
-0.017685137689113617,
0.04881288483738899,
-0.013919299468398094,
-0.005934769753366709,
-0.04717307910323143,
-0.010735020972788334,
0.04538073018193245,
-0.0047454326413571835,
-0.0415290892124176,
-0.051253531128168106,
0.0169796384871006,
-0.03052712045609951,
-0.0030984741169959307,
0.015187290497124195,
0.026084385812282562,
0.01305172685533762,
-0.015663979575037956,
-0.024654321372509003,
0.04850780591368675,
-0.030774999409914017,
-0.058461058884859085,
0.02318612113595009,
0.03845921531319618,
-0.006130211986601353,
0.003908844199031591,
-0.02474965900182724,
0.09861728549003601,
-0.00682617723941803,
0.004335480276495218,
0.008265775628387928,
0.0717320591211319,
-0.05460941791534424,
-0.032662685960531235,
-0.01267037633806467,
0.04080452024936676,
0.03367326408624649,
-0.08336325734853745,
-0.011850472539663315,
-0.0055009834468364716,
-0.05296960845589638,
0.03710541874170303,
0.03676220402121544,
-0.020364126190543175,
-0.095413938164711,
0.056668709963560104,
-0.011602594517171383,
0.008380181156098843,
0.1109730452299118,
-0.0359041653573513,
-0.033635128289461136,
0.016579220071434975,
0.014348318800330162,
-0.03435969725251198,
-0.06185507774353027,
-0.04431294649839401,
-0.011659796349704266,
-0.03338725119829178,
0.020059045404195786,
0.008203806355595589,
0.009023710153996944,
0.024883130565285683,
0.035808827728033066,
0.027247505262494087,
0.010906629264354706,
-0.013890698552131653,
0.0026122520212084055,
-0.007231362164020538,
-0.004330713767558336,
-0.07565997540950775,
-0.023834416642785072,
-0.07001598179340363,
-0.03403554856777191,
-0.018362034112215042,
0.007121723610907793,
-0.008423082530498505,
-0.022633163258433342,
0.008647126145660877,
0.023281458765268326,
0.03878336399793625,
0.04114773869514465,
-0.021546313539147377,
0.04778324067592621,
-0.0151205537840724,
0.0013085094979032874,
-0.00522927101701498,
-0.030488986521959305,
-0.018953127786517143,
-0.0017661303281784058,
0.023662809282541275,
0.03622831404209137,
0.02385348454117775,
-0.015969058498740196,
0.02175605669617653,
-0.006077776197344065,
-0.03382580354809761,
-0.037010081112384796,
-0.047516293823719025,
-0.04202484339475632,
0.01605486311018467,
0.04843153432011604,
-0.004144805017858744,
-0.005882333964109421,
0.028105543926358223,
-0.018476439639925957,
0.03357792645692825,
0.025188211351633072,
-0.0030555722769349813,
-0.023357728496193886,
0.02932586707174778,
-0.018543176352977753,
-0.006926281377673149,
-0.05399925634264946,
0.030336445197463036,
-0.019134270027279854,
-0.08427850157022476,
0.003405938157811761,
0.005453314632177353,
-0.012622707523405552,
0.01784721203148365,
-0.0670795813202858,
0.017313320189714432,
0.042863816022872925,
0.01054434571415186,
0.01151678990572691,
0.03676220402121544,
-0.03134702518582344,
0.009748276323080063,
0.01245109923183918,
0.01045854203402996,
-0.007274264004081488,
0.013271003030240536,
0.031899984925985336,
-0.04236805811524391,
0.0009521849569864571,
0.004385532811284065,
-0.005977671593427658,
0.025474224239587784,
-0.031995322555303574,
-0.023891620337963104,
0.04088079184293747,
-0.02917332574725151,
-0.010649217292666435,
0.05415179580450058,
0.009319256991147995,
-0.06391437351703644,
-0.005386578384786844,
-0.08366833627223969,
0.025474224239587784,
0.01402417104691267,
-0.053427230566740036,
0.037601176649332047,
-0.022385284304618835,
0.038363877683877945,
-0.03148049861192703,
-0.004106670152395964,
0.07901585847139359,
0.002640853403136134,
-0.07726164907217026,
0.0066069005988538265,
-0.010935230180621147,
-0.01720844954252243,
0.03510332852602005,
0.0028124612290412188,
0.03157583624124527,
-0.035274937748909,
-0.05335095897316933,
0.028067409992218018,
0.0006196948233991861,
-0.0011190258665010333,
-0.016836632043123245,
-0.04191043972969055,
0.08023618161678314,
0.03373046591877937,
0.016788963228464127,
-0.007040686905384064,
-0.0511772595345974,
0.06727025657892227,
-0.003713402198627591,
-0.006034874357283115,
0.06441012769937515,
0.006397157441824675,
0.01537796575576067,
0.022156473249197006,
-0.009543300606310368,
0.034912653267383575,
0.037772782146930695,
-0.03651432693004608,
0.03001229837536812,
0.008952206932008266,
0.002483546268194914,
0.017084509134292603,
-0.006120678503066301,
0.09571901708841324,
0.010401339270174503,
-0.02206113561987877,
-0.0511772595345974,
-0.02610345371067524,
0.07161765545606613,
-0.018752919510006905,
-0.04297821968793869,
0.037696514278650284,
-0.052321311086416245,
-0.05525771155953407,
0.015311229042708874,
0.051634881645441055,
-0.027476316317915916,
0.010744554921984673,
0.00877106562256813,
0.058461058884859085,
0.013194733299314976,
-0.027133099734783173,
0.014548528008162975,
-0.05533398315310478,
-0.015663979575037956,
0.0201734509319067,
-0.035446543246507645,
-0.06345675140619278,
-0.025397954508662224,
0.01879105344414711,
-0.058232247829437256,
-0.012651308439671993,
-0.023681877180933952,
0.02646573632955551,
0.05468568578362465,
-0.05754581466317177,
0.02497846819460392,
0.02776232920587063,
0.0449993796646595,
-0.008680494502186775,
0.021927664056420326,
-0.06105424091219902,
-0.043092627078294754,
-0.03558001667261124,
-0.003565628780052066,
0.002650387119501829,
0.02085988223552704,
0.04957558587193489,
0.008866403251886368,
-0.1124984472990036,
-0.006635501515120268,
0.0403469018638134,
-0.0009801903506740928,
-0.00791302602738142,
-0.0034559904597699642,
-0.013614218682050705,
-0.00230121286585927,
0.008656660094857216,
0.00011596933472901583,
0.014653399586677551,
0.019181938841938972,
0.009848381392657757,
-0.03935538977384567,
-0.04213925078511238,
0.019696762785315514,
-0.018905458971858025,
-0.03823040425777435,
0.08633778989315033,
-0.007941627874970436,
-0.01981116645038128,
-0.005863266531378031,
-0.03504612669348717,
-0.030870337039232254,
-0.06467707455158234,
-0.023224255070090294,
0.04816459119319916,
-0.08603271096944809,
-0.0156258437782526,
-0.03786811977624893,
-0.0025407487992197275,
-0.012212755158543587,
0.010191597044467926,
-0.045190054923295975,
0.009638638235628605,
0.0221183393150568,
-0.0020497599616646767,
0.0527789331972599,
-0.02879197522997856,
0.002724273828789592,
0.032891497015953064,
0.01275618001818657,
-0.042940083891153336,
0.023071715608239174,
-0.03931725397706032,
-0.044427353888750076,
-0.01271804515272379,
0.025016603991389275,
0.041948575526475906,
0.018314365297555923,
0.00825624167919159,
0.06761347502470016,
-0.016379011794924736,
0.011669330298900604,
0.03939352557063103,
-0.05079590901732445,
0.03718169033527374,
-0.01720844954252243,
0.0706261470913887,
-0.029135191813111305,
0.032147862017154694,
0.011860005557537079,
-0.043168894946575165,
0.01942981593310833,
0.013785826973617077,
-0.09671053290367126,
0.03962233290076256,
0.037448637187480927,
-0.008566089905798435,
0.040537577122449875,
-0.010954298079013824,
-0.045571405440568924,
-0.054266199469566345,
0.014577129855751991,
0.05438060685992241,
-0.025474224239587784,
0.011593060567975044,
-0.05316028371453285,
-0.049384910613298416,
0.021546313539147377,
-0.0027409580070525408,
-0.011411919258534908,
0.013795360922813416,
-0.0003858196141663939,
0.0008067950257100165,
0.038592688739299774,
0.01080175768584013,
-0.02173698879778385,
-0.03037458099424839,
-0.02421576716005802,
-0.023376796394586563,
0.03495078906416893,
-0.0009277546778321266,
-0.013604684732854366,
0.060634758323431015,
-0.052397582679986954,
-0.06074916198849678,
-0.012946855276823044,
0.004104286432266235,
-0.0201734509319067,
0.03920285031199455,
0.0006399541161954403,
-0.007307632360607386,
0.008623291738331318,
-0.04785950854420662,
0.02114589512348175,
0.0018102239118888974,
-0.04130027815699577,
0.03714355453848839,
0.02310985140502453,
0.03399741277098656,
0.013680955395102501,
0.012555970810353756,
0.009962785989046097,
-0.009352625347673893,
0.01920100674033165,
0.0012018504785373807,
0.0388214997947216,
-0.00523403799161315,
0.012022079899907112,
-0.002662304323166609,
-0.039927415549755096,
0.06010086461901665,
0.016035795211791992,
-0.044808704406023026,
-0.020268788561224937,
0.0461815670132637,
-0.0504145585000515,
0.019925571978092194,
-0.009810245595872402,
-0.020516665652394295,
0.06021527200937271,
-0.011650263331830502,
0.009047544561326504,
0.009181017056107521,
-0.0037372366059571505,
0.01994463987648487,
-0.0015528122894465923,
-0.0718083307147026,
-0.04221551865339279,
-0.002031884156167507,
0.014853608794510365,
0.00881873443722725,
-0.045342594385147095,
0.040232494473457336,
0.05068150535225868,
-0.010973365977406502,
0.005844199098646641,
0.042406193912029266,
-0.017113111913204193,
0.0388214997947216,
0.054037388414144516,
0.01615973375737667,
0.026122521609067917,
0.002122454810887575,
-0.06353302299976349,
-0.0000824521848699078,
0.016226470470428467,
-0.05289333686232567,
-0.09030383825302124,
-0.04553326964378357,
0.001349027967080474,
0.05335095897316933,
0.06761347502470016,
0.0515967458486557,
0.038287606090307236,
-0.010191597044467926,
0.03239573910832405
]
|
36,582 | torch_pso.optim.SineCosineAlgorithm | __init__ | null | def __init__(self,
params: Iterable[torch.nn.Parameter],
num_particles: int = 100,
max_movement_radius: float = 2,
max_param_value: float = -10,
min_param_value: float = 10):
particle_kwargs = {
'max_param_value': max_param_value,
'min_param_value': min_param_value,
}
super().__init__(params, num_particles, particle_class=SCAParticle, particle_kwargs=particle_kwargs)
self.max_param_value = max_param_value
self.min_param_value = min_param_value
self.max_movement_radius = max_movement_radius
self.magnitude = max_param_value-min_param_value
self.initial_movement_radius = max_movement_radius
| (self, params: Iterable[torch.nn.parameter.Parameter], num_particles: int = 100, max_movement_radius: float = 2, max_param_value: float = -10, min_param_value: float = 10) | [
0.005535936914384365,
-0.02995370514690876,
-0.029841868206858635,
-0.010549967177212238,
-0.03228364512324333,
0.05532208830118179,
-0.06035475805401802,
-0.025815732777118683,
-0.05841624736785889,
0.033010587096214294,
0.008345844224095345,
0.07198581844568253,
-0.00942227616906166,
0.02531246468424797,
-0.017744820564985275,
0.02695274166762829,
0.047605328261852264,
0.010167856700718403,
-0.02102537639439106,
-0.008923669345676899,
-0.005922706797719002,
0.028369346633553505,
-0.05155690759420395,
0.021416805684566498,
-0.002320619998499751,
-0.021659119054675102,
-0.006817403715103865,
0.019002988934516907,
-0.05204153433442116,
-0.029674112796783447,
-0.01901230774819851,
0.03599290922284126,
0.005559236276894808,
0.055508483201265335,
0.02896581031382084,
-0.0054567186161875725,
0.010400851257145405,
0.03828556835651398,
-0.09431596100330353,
0.06766144931316376,
0.014613381586968899,
-0.03828556835651398,
0.02687818370759487,
-0.004233500454574823,
0.020428910851478577,
-0.0011381754884496331,
0.017111077904701233,
0.04958111792802811,
-0.021230410784482956,
-0.01736271008849144,
-0.013616167940199375,
-0.036142025142908096,
0.04518219083547592,
-0.024007698521018028,
-0.04234898462891579,
0.0763474628329277,
0.06233054772019386,
0.059571899473667145,
0.022870687767863274,
-0.0007228637696243823,
0.030550168827176094,
0.004692498594522476,
0.04905921220779419,
-0.05140778794884682,
-0.014492224901914597,
-0.04160340502858162,
-0.039180267602205276,
-0.019441016018390656,
-0.007479106541723013,
0.08626368641853333,
0.09088628739118576,
-0.00018304589320905507,
0.02387722209095955,
0.017427949234843254,
0.043989259749650955,
0.016104543581604958,
-0.012898546643555164,
0.008201387710869312,
-0.012367320246994495,
-0.018322646617889404,
0.029543636366724968,
0.01238595973700285,
-0.020652584731578827,
0.0011643873294815421,
-0.028201589360833168,
-0.05017758160829544,
-0.03828556835651398,
-0.04089510068297386,
0.04391470178961754,
0.016551891341805458,
-0.04074598476290703,
0.050326697528362274,
0.009673909284174442,
-0.030922960489988327,
0.028984449803829193,
0.07284323126077652,
0.032432761043310165,
-0.06210687384009361,
-0.006575089879333973,
-0.04249810054898262,
0.004750747233629227,
0.03955305740237236,
-0.0013921390054747462,
-0.0009220736101269722,
0.02598348818719387,
-0.02982322871685028,
-0.02723233588039875,
-0.020838981494307518,
0.0014620372094213963,
0.03151942417025566,
-0.012488476932048798,
0.10572334378957748,
-0.05785706266760826,
0.04630056023597717,
-0.07474446296691895,
-0.012031808495521545,
-0.006435293238610029,
-0.015769032761454582,
-0.015116648748517036,
-0.014613381586968899,
0.028891252353787422,
0.05107227712869644,
-0.017176315188407898,
0.023280758410692215,
0.027157777920365334,
0.05856536328792572,
-0.003762852633371949,
0.009138023480772972,
-0.02307572215795517,
-0.046449676156044006,
0.020167957991361618,
-0.0553593672811985,
-0.006393354386091232,
-0.028891252353787422,
0.00042230155668221414,
-0.09893856197595596,
0.013112900778651237,
-0.02941315807402134,
-0.040559589862823486,
-0.007297371048480272,
0.020596666261553764,
0.055769436061382294,
0.026859544217586517,
0.003222306724637747,
-0.05129595100879669,
0.0279033575206995,
0.03504229336977005,
-0.012283442541956902,
-0.013047662563621998,
-0.01435242872685194,
-0.01955285482108593,
0.0011253608390688896,
-0.002989312633872032,
0.006612368859350681,
0.006113761570304632,
-0.049842070788145065,
0.03496773540973663,
-0.08275945484638214,
-0.005344881676137447,
0.025946209207177162,
-0.03696216270327568,
-0.005535936914384365,
-0.013355214148759842,
-0.01758638396859169,
-0.0615849643945694,
-0.005149166565388441,
-0.003569467691704631,
-0.043504633009433746,
-0.011453983373939991,
0.0279033575206995,
0.010838879272341728,
-0.04969295486807823,
0.004051764961332083,
-0.0007560654194094241,
0.022553816437721252,
0.034445829689502716,
0.03373752534389496,
-0.028201589360833168,
-0.0031757077667862177,
-0.008699994534254074,
0.00886309053748846,
-0.040149521082639694,
0.0634116381406784,
-0.08208843320608139,
0.01936645805835724,
0.036980804055929184,
0.0011760370107367635,
0.04525674879550934,
-0.02201327122747898,
0.005079268477857113,
0.03580651432275772,
-0.009179962798953056,
-0.025331104174256325,
-0.007395228836685419,
-0.04089510068297386,
0.028648938983678818,
0.04272177442908287,
-0.011575140058994293,
0.006840703077614307,
0.05647773668169975,
-0.005801549647003412,
0.04085782170295715,
-0.01408215519040823,
-0.01808033138513565,
-0.006523831281810999,
-0.0032875449396669865,
0.006933900527656078,
0.04879825562238693,
0.00883513130247593,
-0.029114926233887672,
-0.04089510068297386,
0.0042544701136648655,
0.066990427672863,
-0.00926384050399065,
0.00814546924084425,
-0.059571899473667145,
-0.023728106170892715,
-0.015414881519973278,
0.02057802677154541,
-0.008909689262509346,
0.06967451423406601,
-0.0040354556404054165,
0.017959175631403923,
-0.011081193573772907,
0.03217180818319321,
0.03459494560956955,
0.023634908720850945,
-0.0727313980460167,
-0.03701808303594589,
-0.0047088079154491425,
0.028779415413737297,
-0.039441220462322235,
-0.04454844817519188,
0.020540747791528702,
0.013774603605270386,
0.024883756414055824,
-0.0021994630806148052,
-0.0009634300949983299,
-0.12615226209163666,
-0.04257265850901604,
-0.023951780050992966,
-0.02044755034148693,
-0.029040368273854256,
0.0029683432076126337,
-0.023504432290792465,
0.012861266732215881,
0.028406625613570213,
0.05002846568822861,
-0.0290217287838459,
0.022553816437721252,
0.015032771043479443,
-0.012814668007194996,
-0.04290816932916641,
0.028276147320866585,
-0.002264701295644045,
-0.026747707277536392,
-0.02749328874051571,
0.02320619858801365,
0.0012441878207027912,
0.0020911209285259247,
-0.08164108544588089,
-0.046673353761434555,
-0.008802512660622597,
0.0919300988316536,
0.0397394523024559,
-0.008872410282492638,
-0.03914298862218857,
0.009496834129095078,
-0.054129160940647125,
0.01620705984532833,
0.11124064028263092,
-0.0036416957154870033,
0.0071715544909238815,
-0.03405439853668213,
0.040820542722940445,
-0.014827736653387547,
-0.012870586477220058,
-0.042647216469049454,
0.013131540268659592,
0.02669178880751133,
0.055993109941482544,
-0.020652584731578827,
-0.01241391897201538,
-0.016188420355319977,
0.031631261110305786,
-0.019310539588332176,
0.01878863386809826,
0.03017737902700901,
-0.017921896651387215,
0.007050397340208292,
-0.05722332000732422,
0.006244238466024399,
0.017399989068508148,
0.0048975334502756596,
0.06844431161880493,
-0.018406523391604424,
0.0030102820601314306,
0.036850325763225555,
-0.0032083268743008375,
-0.05192969739437103,
0.05901271104812622,
-0.06669219583272934,
-0.009408296085894108,
-0.000048237034206977114,
0.0027469987981021404,
0.009962822310626507,
-0.000243333081016317,
0.01889115199446678,
0.038099173456430435,
0.0038607101887464523,
0.06896621733903885,
0.03850924223661423,
0.011808134615421295,
0.033010587096214294,
0.01283330749720335,
-0.006668287329375744,
0.034930456429719925,
-0.05942278355360031,
0.0383974052965641,
0.054390113800764084,
-0.012507116422057152,
-0.01345773134380579,
-0.03759590536355972,
-0.006365395151078701,
-0.007698120549321175,
-0.03329017758369446,
0.005484677851200104,
0.047791723161935806,
-0.034706782549619675,
-0.006668287329375744,
-0.052078813314437866,
0.036142025142908096,
0.015079369768500328,
-0.03397984057664871,
-0.03267507255077362,
-0.02316891960799694,
0.011444663628935814,
0.05696236714720726,
0.04503307491540909,
-0.02874213643372059,
0.06400810182094574,
0.01665440946817398,
-0.014072835445404053,
0.05882631614804268,
-0.0052097453735768795,
-0.03261915594339371,
0.04946928098797798,
-0.03219044581055641,
0.006570430006831884,
-0.08723293989896774,
-0.0067987642250955105,
0.04380286484956741,
0.007730740122497082,
0.045331306755542755,
0.049618396908044815,
0.01727883331477642,
0.00010368231596658006,
-0.05472562462091446,
-0.023895861580967903,
-0.041677962988615036,
0.04182707890868187,
-0.02518198825418949,
-0.022702932357788086,
0.03386800363659859,
-0.012497796677052975,
0.0072647519409656525,
-0.010680443607270718,
-0.055284809321165085,
0.0656483843922615,
0.002891455078497529,
-0.015647875145077705,
-0.0482017919421196,
-0.04119333252310753,
-0.007404548581689596,
0.008448361419141293,
0.002910094801336527,
-0.06859342753887177,
0.00024974040570668876,
0.028648938983678818,
-0.02173367701470852,
0.011575140058994293,
-0.06274061650037766,
0.025256546214222908,
0.000772957515437156,
0.023187559098005295,
-0.024436406791210175,
0.03110935539007187,
-0.03681304678320885,
0.08275945484638214,
0.01366276666522026,
0.011062554083764553,
0.023858582600951195,
0.017521146684885025,
-0.04887281358242035,
-0.05181786045432091,
0.012814668007194996,
0.0754154846072197,
0.02374674566090107,
-0.0665057972073555,
-0.007516385521739721,
0.007502405904233456,
-0.053681809455156326,
0.060280200093984604,
0.030419692397117615,
-0.00027129234513267875,
-0.09759651124477386,
0.06967451423406601,
0.003429671283811331,
0.010904117487370968,
0.06766144931316376,
-0.007194853853434324,
-0.04070870578289032,
-0.01593678817152977,
0.022255584597587585,
0.0028448563534766436,
-0.060056526213884354,
-0.007157574873417616,
-0.019441016018390656,
-0.013047662563621998,
-0.03507957234978676,
-0.0004409410757943988,
0.01753978617489338,
0.04835090786218643,
0.02723233588039875,
0.04100693762302399,
0.02848118357360363,
-0.0008661550818942487,
0.013196778483688831,
0.010503368452191353,
-0.031407587230205536,
-0.08216299116611481,
0.01883523166179657,
-0.053010787814855576,
-0.013914399780333042,
0.027195056900382042,
0.002684090519323945,
-0.009692548774182796,
-0.011901332065463066,
-0.007884516380727291,
0.014324469491839409,
0.02838798612356186,
0.005018690135329962,
0.022777490317821503,
0.019478294998407364,
-0.01776346005499363,
0.0017521146219223738,
-0.008560198359191418,
-0.004559691995382309,
-0.01323405746370554,
-0.033718887716531754,
0.02540566213428974,
0.01990700513124466,
0.06061571091413498,
-0.04249810054898262,
0.03932938352227211,
-0.04678519070148468,
-0.04671063274145126,
-0.0028634958434849977,
0.012152965180575848,
-0.05398004129528999,
0.054800182580947876,
0.022572455927729607,
-0.02784743905067444,
-0.05852808430790901,
-0.026673149317502975,
-0.017213594168424606,
0.037204477936029434,
-0.017427949234843254,
0.007325330283492804,
-0.021808234974741936,
0.040596868842840195,
0.018322646617889404,
0.009235881268978119,
-0.06658035516738892,
-0.021304968744516373,
-0.013439091853797436,
-0.0017323101637884974,
-0.015340322628617287,
-0.02499559335410595,
-0.0037418832071125507,
0.011733576655387878,
-0.05629134178161621,
0.018061691895127296,
0.0490964911878109,
-0.020522108301520348,
-0.004683178849518299,
-0.020596666261553764,
-0.00231013516895473,
-0.0014364077942445874,
0.00982302613556385,
-0.024044977501034737,
-0.014566782861948013,
0.017698222771286964,
0.03647753596305847,
-0.019273260608315468,
-0.020633945241570473,
0.03712991997599602,
0.01714835688471794,
0.04178979992866516,
0.007325330283492804,
-0.025461580604314804,
0.011211670003831387,
0.002910094801336527,
-0.016999240964651108,
0.023467153310775757,
-0.00876989308744669,
-0.04208803176879883,
-0.006728865671902895,
-0.03824828937649727,
0.04838818684220314,
0.037111278623342514,
-0.039664894342422485,
-0.02201327122747898,
0.009384997189044952,
-0.0002340133214602247,
-0.02726961486041546,
-0.04007496312260628,
0.05632862076163292,
0.0028192270547151566,
-0.056626856327056885,
0.041305169463157654,
0.03932938352227211,
-0.010158536955714226,
-0.041081495583057404,
0.007204173598438501,
0.011276908218860626,
-0.010522007942199707,
-0.06728865951299667,
0.01401691697537899,
0.016989920288324356,
0.000019404029444558546,
-0.05204153433442116,
-0.0526752769947052,
0.06486552208662033,
0.016906041651964188,
0.041901636868715286,
0.006877982057631016,
-0.004818315152078867,
-0.018443802371621132,
0.013140860013663769,
-0.001407283591106534,
0.058938153088092804,
0.04145428538322449,
-0.027418730780482292,
0.02370946668088436,
-0.02508879080414772,
-0.015433521009981632,
0.050513092428445816,
0.012404599227011204,
0.02326211892068386,
0.017782099545001984,
0.009729827754199505,
-0.0879039615392685,
-0.037297673523426056,
0.060690268874168396,
0.03565739840269089,
-0.017241554334759712,
-0.09588167816400528,
0.001251177629455924,
0.09215377271175385,
0.018443802371621132,
-0.012507116422057152,
0.03759590536355972,
0.006775464862585068,
-0.0732160285115242,
0.01191997155547142,
0.008797852322459221,
-0.021099934354424477,
-0.03696216270327568,
0.014464265666902065,
0.036086104810237885,
0.004541052505373955,
-0.06307613104581833,
0.036496177315711975,
0.0006815073429606855,
-0.028853973373770714,
0.04119333252310753,
0.00748842628672719,
-0.04682246968150139,
-0.015163247473537922,
0.0406341478228569,
-0.019441016018390656,
-0.014445626176893711,
-0.05271255597472191,
0.03148214519023895,
0.10117530077695847,
-0.07291779667139053,
0.012441878207027912,
0.0553593672811985,
-0.009333738125860691,
0.03289875015616417,
0.0256666149944067,
-0.041677962988615036,
-0.01687808334827423,
-0.05949734151363373,
0.01990700513124466,
-0.03325289860367775,
0.008001012727618217,
0.03576923534274101,
-0.0015051410300657153,
-0.09289935231208801,
0.026449475437402725,
0.0027283593080937862,
0.019441016018390656,
-0.007646861951798201,
-0.06378442794084549,
0.014678619801998138,
0.03985128924250603,
-0.0076375422067940235,
0.014389707706868649,
0.04589049145579338,
-0.016132501885294914,
-0.00995350256562233,
-0.05066220834851265,
-0.0258902907371521,
-0.01151922158896923,
-0.019403737038373947,
0.026263080537319183,
0.10438130050897598,
-0.027027299627661705,
-0.038546521216630936,
0.0016542571829631925,
-0.024399127811193466,
0.0009739148081280291,
-0.06579750031232834,
-0.0252192672342062,
0.0033061844296753407,
-0.11578868329524994,
0.00215402920730412,
0.008597477339208126,
0.0459650494158268,
-0.02370946668088436,
-0.03638433665037155,
-0.04589049145579338,
-0.025014232844114304,
-0.016850123181939125,
0.011323506943881512,
-0.0007869371329434216,
0.030550168827176094,
0.013336574658751488,
0.04767988622188568,
0.02039163187146187,
-0.03496773540973663,
0.001206908724270761,
-0.04357919096946716,
-0.05692508816719055,
-0.010186496190726757,
0.039664894342422485,
0.032973308116197586,
0.02637491747736931,
0.025237906724214554,
0.02695274166762829,
-0.011882692575454712,
0.027735602110624313,
0.007726080249994993,
-0.049879349768161774,
0.016551891341805458,
0.012041128240525723,
0.07604923099279404,
-0.01830400712788105,
-0.034837257117033005,
-0.008187408559024334,
-0.016906041651964188,
0.03558284044265747,
0.014426986686885357,
-0.08208843320608139,
-0.051221393048763275,
-0.014594742096960545,
-0.013821202330291271,
0.0464123971760273,
-0.014473585411906242,
-0.04749349132180214,
-0.03985128924250603,
0.019962923601269722,
0.03452038764953613,
-0.01096003595739603,
-0.014874335378408432,
-0.0256666149944067,
0.0011399229988455772,
0.04268449544906616,
0.033010587096214294,
-0.004492123611271381,
-0.006151041015982628,
0.035415083169937134,
0.019757889211177826,
0.02995370514690876,
-0.06926444917917252,
0.012777389027178288,
0.016952641308307648,
0.016906041651964188,
-0.017176315188407898,
0.019720610231161118,
-0.017381349578499794,
-0.012358000501990318,
0.039664894342422485,
-0.023672187700867653,
-0.060951221734285355,
-0.03808053582906723,
0.018937749788165092,
0.02102537639439106,
-0.0037745023146271706,
0.015256444923579693,
-0.09498698264360428,
0.0665057972073555,
-0.041305169463157654,
0.011938611045479774,
0.01448290515691042,
0.002369548659771681,
0.03362568840384483,
-0.02781016007065773,
0.03276827186346054,
0.033476572483778,
0.024212732911109924,
-0.050960440188646317,
-0.020559387281537056,
0.07686936855316162,
0.0562540628015995,
0.032339561730623245,
-0.029114926233887672,
0.007623562589287758,
0.008592817932367325,
-0.04223714768886566,
0.04201347380876541,
0.03638433665037155,
-0.0064772325567901134,
-0.038770195096731186,
0.018592918291687965,
-0.010009421035647392,
0.062293268740177155,
-0.023150280117988586,
0.019441016018390656,
0.06889165937900543,
-0.043280959129333496,
-0.05025213956832886,
0.016579851508140564,
-0.029580915346741676,
0.03709264099597931,
0.01017717644572258,
-0.05424099788069725,
0.0042544701136648655,
-0.0005201590247452259,
0.010083978995680809,
-0.018993668258190155,
-0.04540586471557617,
0.024119535461068153,
0.04156612604856491,
-0.018686115741729736,
-0.015340322628617287,
0.03985128924250603,
-0.014436306431889534,
0.010270373895764351,
0.05405459925532341,
0.02473464049398899,
0.03959033638238907,
0.04857458174228668,
-0.053234461694955826,
0.007083016913384199,
-0.006598389241844416,
-0.05237704515457153,
-0.10296469181776047,
-0.04943200200796127,
-0.021901432424783707,
0.06214415282011032,
0.01794985495507717,
-0.0046575493179261684,
0.07340241968631744,
0.03289875015616417,
-0.0013583548134192824
]
|
36,603 | rfc3987 | <lambda> | null | _bmp = lambda s: _re.sub(r'\\U[0-9A-F]{8}-\\U[0-9A-F]{8}', '', s)
| (s) | [
-0.01242479681968689,
-0.03350798785686493,
0.012701865285634995,
0.04221833497285843,
-0.08990877866744995,
-0.063968226313591,
-0.00884455069899559,
0.023516200482845306,
0.09309506416320801,
0.011221280321478844,
0.022459877654910088,
0.026910291984677315,
-0.014892439357936382,
0.03761206939816475,
-0.003355128224939108,
0.0579419806599617,
-0.0063942247070372105,
0.029715612530708313,
0.016398999840021133,
-0.033837009221315384,
-0.03515308350324631,
0.0019622088875621557,
0.02081478200852871,
0.05548299476504326,
-0.018147995695471764,
0.08034990727901459,
-0.008351022377610207,
-0.022962063550949097,
-0.03629599139094353,
-0.04405391588807106,
0.01787092722952366,
-0.008303401060402393,
-0.0025585556868463755,
0.0202433280646801,
0.037335000932216644,
-0.01184468436986208,
0.04183736443519592,
0.013836115598678589,
-0.05378594994544983,
-0.03304043784737587,
0.005995938554406166,
-0.03255556523799896,
0.027118094265460968,
-0.0022078908514231443,
0.024018388241529465,
0.021074533462524414,
0.026806391775608063,
-0.019827725365757942,
-0.024728376418352127,
-0.02484959363937378,
0.03726573288440704,
0.01652887649834156,
-0.010987503454089165,
0.030875837430357933,
0.016901187598705292,
0.021853789687156677,
-0.018269214779138565,
0.07328465580940247,
0.019793091341853142,
0.008082611486315727,
-0.056452736258506775,
-0.0404866561293602,
-0.029126841574907303,
-0.004283741116523743,
0.019862359389662743,
0.011455057188868523,
0.0005828182329423726,
-0.04343051090836525,
0.008857537992298603,
0.00006402477447409183,
-0.03830473870038986,
0.020104793831706047,
-0.008411630988121033,
0.003030438208952546,
0.05503275990486145,
-0.010078372433781624,
-0.029403910040855408,
0.0022133023012429476,
-0.012069802731275558,
-0.01360233873128891,
0.07439292967319489,
0.00824712123721838,
0.02554226666688919,
-0.004896322265267372,
0.027066143229603767,
-0.07723288238048553,
0.07750995457172394,
-0.015463894233107567,
-0.034997232258319855,
0.03816620633006096,
0.02436472475528717,
-0.07013300061225891,
-0.028468802571296692,
0.0461665615439415,
-0.015316701494157314,
0.006589038763195276,
0.0041170669719576836,
0.03425261005759239,
0.01713496446609497,
-0.07363099604845047,
-0.004000178538262844,
0.005913684144616127,
-0.045508526265621185,
-0.036192093044519424,
-0.010208248160779476,
0.0011970230843871832,
0.018702134490013123,
-0.013169419020414352,
-0.03279799968004227,
0.0033356468193233013,
-0.03989788517355919,
-0.017767027020454407,
0.00019332572992425412,
-0.03288458660244942,
0.050599660724401474,
-0.052504509687423706,
-0.03309238702058792,
-0.04675533249974251,
0.035534054040908813,
-0.005753503646701574,
-0.023256449028849602,
-0.004891993477940559,
-0.08201231807470322,
0.015117557719349861,
-0.0019925131928175688,
0.01629509963095188,
0.03830473870038986,
0.039724718779325485,
0.031499240547418594,
0.020503079518675804,
-0.033854324370622635,
0.07688654959201813,
-0.03930911421775818,
-0.027620280161499977,
0.010312148369848728,
-0.057006873190402985,
-0.013117468915879726,
-0.031031688675284386,
0.03071998618543148,
0.04107542708516121,
-0.04000178724527359,
0.011004820466041565,
0.03865107521414757,
0.04111006110906601,
0.014450861141085625,
-0.004017495550215244,
0.07723288238048553,
0.014961706474423409,
0.013100151903927326,
-0.03574185445904732,
-0.0010449601104483008,
0.05150013417005539,
0.012494063936173916,
0.02718736045062542,
0.02136891894042492,
-0.034962598234415054,
0.037889137864112854,
0.001872377935796976,
-0.00041046206024475396,
-0.00009706872515380383,
0.05049576237797737,
0.04446951672434807,
-0.04419244825839996,
-0.05281621217727661,
-0.0023356021847575903,
-0.024001071229577065,
0.08790002763271332,
0.010511292144656181,
0.04526609182357788,
0.019256271421909332,
-0.00954155158251524,
-0.0407290905714035,
-0.06199410930275917,
0.060470230877399445,
0.01715228147804737,
0.026165669783949852,
-0.008801259100437164,
0.027551013976335526,
0.005285950377583504,
0.04990699142217636,
0.050045523792505264,
0.04349977895617485,
-0.03574185445904732,
0.02074551396071911,
0.03823547437787056,
-0.03432187810540199,
0.030477551743388176,
0.00929911620914936,
-0.0030455905944108963,
-0.0695442333817482,
0.000661826110444963,
0.04994162172079086,
-0.0348760150372982,
-0.002290145494043827,
0.05323181301355362,
-0.006649647373706102,
0.019464071840047836,
-0.004357337485998869,
-0.07013300061225891,
-0.12329554557800293,
-0.039101313799619675,
0.005519726779311895,
-0.02140355296432972,
-0.0202606450766325,
-0.001549852779135108,
-0.07841042429208755,
0.004472061060369015,
0.02036454528570175,
-0.03719646483659744,
0.007407256867736578,
0.05382058396935463,
-0.0012641256907954812,
0.00035878224298357964,
0.022182809188961983,
0.010571900755167007,
-0.057110775262117386,
-0.05160403624176979,
0.07279978692531586,
0.007835847325623035,
0.05610639974474907,
-0.06268677860498428,
0.0026083416305482388,
-0.012987593188881874,
-0.012840400449931622,
-0.004130054730921984,
0.01763715036213398,
-0.006753548048436642,
0.05499812588095665,
0.03979398310184479,
-0.009463625960052013,
0.025282513350248337,
-0.0813196450471878,
0.04405391588807106,
0.048279210925102234,
-0.019412122666835785,
0.0011374966707080603,
-0.02377595379948616,
-0.06840132176876068,
0.03878961130976677,
-0.012121752835810184,
-0.003974203485995531,
-0.022200126200914383,
0.03892814368009567,
0.024226190522313118,
0.0750856027007103,
0.009489601477980614,
-0.021628670394420624,
0.07224564999341965,
-0.023879854008555412,
-0.015818888321518898,
-0.007333660498261452,
-0.024070339277386665,
-0.015498527325689793,
0.01126457192003727,
-0.007584754377603531,
-0.05967365950345993,
-0.028157101944088936,
-0.022875480353832245,
0.023031331598758698,
0.022252075374126434,
0.015308042988181114,
-0.007809872273355722,
0.010788360610604286,
0.044954389333724976,
-0.009714719839394093,
-0.0038161876145750284,
-0.009221190586686134,
0.0579419806599617,
-0.032139964401721954,
-0.02774149738252163,
0.024520576000213623,
-0.023031331598758698,
0.002031476004049182,
0.0039806971326470375,
-0.03608819097280502,
0.02143818698823452,
-0.028053199872374535,
-0.05271231010556221,
0.016979113221168518,
-0.034495048224925995,
0.04872944951057434,
0.02318718284368515,
0.03364652395248413,
0.01013032253831625,
0.09184825420379639,
-0.01960260607302189,
0.04408854991197586,
-0.10923431068658829,
-0.012684549205005169,
-0.029178792610764503,
0.015844862908124924,
-0.04917968437075615,
-0.04571632668375969,
-0.014944390393793583,
-0.03806230425834656,
0.057699546217918396,
0.016000714153051376,
0.005524056032299995,
-0.02084941603243351,
-0.01362831424921751,
-0.050703562796115875,
0.02090136520564556,
0.01961992308497429,
0.003770731156691909,
-0.054097652435302734,
0.017498616129159927,
-0.07439292967319489,
0.02658127248287201,
0.005905025638639927,
0.0580458827316761,
-0.004870347213000059,
-0.03917057812213898,
0.027966616675257683,
0.011507007293403149,
-0.015749620273709297,
0.07591681182384491,
0.04391537979245186,
0.04530072212219238,
0.02656395733356476,
0.01103945355862379,
0.04332660883665085,
-0.09219459444284439,
-0.002746875863522291,
0.0174553245306015,
-0.004831384401768446,
-0.057110775262117386,
-0.048937249928712845,
-0.0026841023936867714,
0.017732392996549606,
0.004420110955834389,
-0.03594965860247612,
-0.023031331598758698,
-0.007961394265294075,
-0.025299830362200737,
0.03837400674819946,
-0.019983576610684395,
-0.005632285960018635,
-0.03868570923805237,
0.007935418747365475,
-0.014338302426040173,
-0.009680085815489292,
0.05842684954404831,
-0.025178613141179085,
0.01802677847445011,
0.010771043598651886,
0.011186646297574043,
-0.044365618377923965,
0.002668950241059065,
-0.04758654162287712,
-0.0260098185390234,
0.07020226866006851,
-0.029161475598812103,
0.014277693815529346,
-0.007151834201067686,
0.03532625362277031,
0.021091850474476814,
-0.03239971399307251,
0.00709122559055686,
0.03349067270755768,
0.017360081896185875,
0.03016584925353527,
-0.004041305743157864,
-0.0012792778434231877,
-0.054721057415008545,
0.014615370891988277,
-0.012736499309539795,
-0.009403017349541187,
0.02090136520564556,
0.017767027020454407,
-0.01851164922118187,
0.0026841023936867714,
0.06788181513547897,
-0.020139427855610847,
-0.07771775871515274,
-0.03761206939816475,
-0.0035650942008942366,
0.005000223405659199,
-0.002034722827374935,
-0.08242791891098022,
-0.023377666249871254,
0.027568330988287926,
0.030529500916600227,
-0.050149425864219666,
0.005887708626687527,
0.005606310907751322,
-0.015489868819713593,
-0.044954389333724976,
0.044815853238105774,
-0.019238954409956932,
-0.011065429076552391,
-0.01622583344578743,
-0.006290324032306671,
0.09323360025882721,
-0.009809961542487144,
0.04789824038743973,
-0.02786271646618843,
-0.0007554449839517474,
0.04093689098954201,
0.037854503840208054,
0.007125859148800373,
-0.047205571085214615,
0.013775506988167763,
-0.04509292170405388,
0.0052426583133637905,
0.026390789076685905,
0.0637604221701622,
-0.007350977510213852,
0.045508526265621185,
0.012762474827468395,
0.014918414875864983,
0.0075544496066868305,
-0.04287637397646904,
0.005840087775141001,
-0.09531161189079285,
-0.006021914072334766,
-0.008428948000073433,
-0.0021451173815876245,
-0.07051397114992142,
-0.03482406586408615,
-0.00534222973510623,
-0.048937249928712845,
0.01066714245826006,
-0.03833937272429466,
0.011359814554452896,
0.019342854619026184,
-0.012242970988154411,
0.019533339887857437,
-0.04419244825839996,
0.01859823241829872,
0.04010568559169769,
-0.051777202636003494,
-0.03527430072426796,
-0.027447111904621124,
-0.0753626748919487,
0.02829563617706299,
0.006130144000053406,
0.003251227317377925,
0.03868570923805237,
-0.012225653976202011,
0.05440935492515564,
0.036226727068424225,
0.026373472064733505,
0.009004730731248856,
-0.03245166689157486,
0.052954744547605515,
0.02774149738252163,
-0.06864375621080399,
0.03830473870038986,
-0.002616999903693795,
0.04796750843524933,
-0.0007814201526343822,
0.052989378571510315,
-0.09531161189079285,
-0.06417602300643921,
0.10029885172843933,
-0.017628492787480354,
0.05163867026567459,
-0.025351781398057938,
-0.03598428890109062,
0.02088405005633831,
-0.01738605834543705,
0.06123217195272446,
0.01103945355862379,
0.03063340298831463,
-0.029958046972751617,
0.02308328077197075,
0.05745711177587509,
-0.023498885333538055,
-0.019325537607073784,
0.008472239598631859,
-0.03937838226556778,
-0.04820994287729263,
0.038477908819913864,
0.01911773718893528,
-0.025143979117274284,
-0.021715255454182625,
-0.04561242461204529,
0.04419244825839996,
0.029369276016950607,
0.00031819602008908987,
0.019550656899809837,
-0.028728555887937546,
-0.001163471839390695,
-0.03314433619379997,
0.006433187518268824,
-0.0006066288333386183,
0.017230207100510597,
-0.051915738731622696,
-0.01703106425702572,
0.005987280048429966,
-0.019360171630978584,
0.056418102234601974,
-0.10542462021112442,
0.03858180716633797,
0.03233044594526291,
-0.06095510348677635,
-0.006008926313370466,
0.013186736032366753,
0.01958528906106949,
-0.04287637397646904,
0.005974292755126953,
-0.00767133804038167,
-0.03927448019385338,
-0.0867224857211113,
0.02252914384007454,
0.022477194666862488,
0.05451325699687004,
-0.02895367331802845,
0.01729947328567505,
-0.013957332819700241,
-0.04450415074825287,
-0.01567169465124607,
-0.009792644530534744,
-0.03650379553437233,
-0.013134785927832127,
-0.013195394538342953,
-0.029109524562954903,
-0.038477908819913864,
0.005203695502132177,
0.007026287727057934,
-0.02434740774333477,
0.028001250699162483,
-0.005056502763181925,
-0.03465089574456215,
0.0020899202208966017,
0.012234312482178211,
-0.02715272642672062,
0.011983218602836132,
0.0029438543133437634,
-0.011238597333431244,
-0.057630278170108795,
-0.030512183904647827,
0.012121752835810184,
-0.034546997398138046,
0.01715228147804737,
0.017005087807774544,
-0.01587083749473095,
-0.06213264539837837,
-0.006788181606680155,
0.03193216025829315,
0.0028875747229903936,
-0.01765446737408638,
0.018875300884246826,
-0.0008939792751334608,
-0.03688476234674454,
0.07086030393838882,
-0.021888423711061478,
0.03137802332639694,
-0.03951691463589668,
0.0174033734947443,
-0.0638989582657814,
-0.014407569542527199,
0.010035079903900623,
0.03896277770400047,
0.011957244016230106,
0.0017630656948313117,
-0.035568688064813614,
0.049629922956228256,
-0.005294608883559704,
-0.015862179920077324,
-0.04152566194534302,
0.013697581365704536,
0.026148352771997452,
0.004519682377576828,
-0.11865464597940445,
0.05028795823454857,
-0.07300759106874466,
0.022771580144762993,
-0.022944746538996696,
0.012303579598665237,
0.006779523566365242,
0.006918057799339294,
0.06549210101366043,
-0.034512363374233246,
-0.12066339701414108,
-0.008034991100430489,
0.030269749462604523,
-0.015541818924248219,
0.08256645500659943,
0.006285994779318571,
-0.004294564016163349,
0.021057216450572014,
0.04395001381635666,
-0.056452736258506775,
0.029213424772024155,
-0.05042649433016777,
0.021836472675204277,
0.02656395733356476,
-0.008615103550255299,
-0.009325091727077961,
0.04273783788084984,
0.00011729419929906726,
0.05915415659546852,
-0.02379327081143856,
-0.060470230877399445,
-0.045369990170001984,
0.06327555328607559,
-0.0021537758875638247,
-0.019914308562874794,
0.015948763117194176,
0.07013300061225891,
0.047725073993206024,
0.029958046972751617,
0.04225296899676323,
0.06878229230642319,
0.03144729137420654,
-0.022355975583195686,
-0.00651111314073205,
-0.04419244825839996,
0.015437918715178967,
-0.017178256064653397,
0.058115147054195404,
0.036746229976415634,
0.008277425542473793,
0.049041152000427246,
-0.0042144740000367165,
-0.020555030554533005,
-0.04467732086777687,
-0.05745711177587509,
0.032191913574934006,
-0.041387129575014114,
0.023914488032460213,
-0.052469875663518906,
0.008831563405692577,
0.020000893622636795,
0.007307685445994139,
0.011074087582528591,
0.05569079890847206,
0.0022295366507023573,
-0.040832992643117905,
-0.013775506988167763,
-0.04457341879606247,
0.0029070561286062002,
0.04014031961560249,
-0.00407377490773797,
0.026771757751703262,
-0.05108453333377838,
0.030235115438699722,
-0.047274839133024216,
0.018875300884246826,
0.04814067855477333,
-0.051153797656297684,
0.049006517976522446,
0.01588815450668335,
-0.033404089510440826,
0.062340445816516876,
-0.0260271355509758,
-0.03979398310184479,
-0.05319717898964882,
-0.009766669943928719,
-0.007632375229150057,
0.031135588884353638,
0.028659287840127945,
0.019464071840047836,
0.0005484552239067852,
0.05953512713313103,
0.008000357076525688,
0.011680175550282001,
-0.0001746560592437163,
-0.0260098185390234,
-0.07757922261953354,
-0.009420334361493587,
-0.002712242305278778,
0.04117932915687561,
0.030875837430357933,
-0.0011374966707080603,
0.07757922261953354,
-0.008749308064579964,
-0.056348834186792374,
-0.031585827469825745,
-0.021057216450572014,
0.014329643920063972,
-0.028659287840127945,
-0.05160403624176979,
0.0013626149157062173,
0.007870481349527836,
0.004301057662814856,
0.011507007293403149,
0.06275604665279388,
0.04124859347939491,
0.026286887004971504,
-0.00812157429754734,
-0.013134785927832127,
-0.02895367331802845,
-0.025784701108932495,
0.052504509687423706,
-0.05087672919034958,
0.052920110523700714,
0.016373025253415108,
-0.020139427855610847,
-0.031135588884353638,
-0.013732214458286762,
-0.0033118361607193947,
0.019845042377710342,
-0.016641436144709587,
0.055240560322999954,
0.026425421237945557,
-0.010563242249190807,
0.054097652435302734,
-0.012727840803563595,
0.0021407881285995245,
-0.003266379702836275,
-0.04419244825839996,
-0.009195216000080109,
0.017178256064653397,
0.022736946120858192,
-0.020710881799459457,
-0.000403697689762339,
-0.004396300297230482,
0.048383112996816635,
0.033802375197410583,
0.011706150136888027,
-0.036226727068424225,
0.004192827735096216,
0.0075544496066868305,
-0.012632598169147968,
-0.03071998618543148,
-0.03189752623438835,
0.030512183904647827,
-0.014502812176942825,
0.00988788716495037,
0.026200303807854652,
0.03570722043514252,
0.03420066088438034,
-0.03809693828225136,
0.013100151903927326,
-0.02784539945423603,
-0.027308577671647072,
0.0019860193133354187,
0.014364277943968773,
-0.009351067245006561,
0.03179362788796425,
-0.04498901963233948,
0.03233044594526291,
-0.044850487262010574,
-0.017247524112462997,
-0.020381862297654152,
-0.04450415074825287,
0.009714719839394093,
-0.019914308562874794,
-0.013879407197237015,
-0.000919413345400244,
-0.028607336804270744,
0.09323360025882721,
-0.007610729429870844,
0.013671605847775936,
0.04928358644247055,
0.05146550014615059,
-0.021091850474476814,
0.012364188209176064,
0.032746050506830215,
0.028174417093396187,
-0.06576917320489883,
0.06618477404117584,
0.030927788466215134,
-0.06074729934334755,
0.060539498925209045,
0.002614835277199745,
0.0004902816144749522,
0.0023139561526477337,
-0.006234044674783945,
0.025923235341906548,
0.0031126930844038725,
0.02147281914949417,
0.012615282088518143,
0.008082611486315727,
0.000920495658647269,
-0.011065429076552391
]
|
36,604 | rfc3987 | _i2u | null | def _i2u(dic):
for (name, iname) in [('authority', 'iauthority'), ('path', 'ipath'),
('query', 'iquery'), ('fragment', 'ifragment')]:
if dic.get(name) is None:
dic[name] = dic.get(iname)
return dic
| (dic) | [
0.006827628705650568,
0.009012277238070965,
-0.025159474462270737,
-0.03602990508079529,
-0.025063445791602135,
-0.0360875204205513,
0.04455723613500595,
-0.01904245838522911,
0.038180943578481674,
-0.01950339414179325,
-0.01776527799665928,
0.05481308326125145,
-0.05001165717840195,
0.030210575088858604,
0.010928046889603138,
0.03460868075489998,
-0.03385965898633003,
0.07755263894796371,
-0.020338842645287514,
-0.003065710887312889,
0.03391727805137634,
-0.04367377609014511,
0.049473900347948074,
0.012301255017518997,
-0.0294999647885561,
-0.030364220961928368,
0.0157390758395195,
-0.03720145300030708,
0.04636257514357567,
-0.011821111664175987,
0.010918444022536278,
-0.03293778747320175,
0.047899030148983,
0.005968173034489155,
0.028309211134910583,
-0.006664379965513945,
0.011523423716425896,
0.022893201559782028,
-0.04325124993920326,
0.010687975212931633,
-0.05619589611887932,
-0.028770146891474724,
-0.03700939565896988,
-0.022355441004037857,
0.017794087529182434,
0.0388147309422493,
-0.019973933696746826,
-0.04375059902667999,
0.04793744161725044,
-0.0033489950001239777,
0.007946360856294632,
0.00930036325007677,
0.026964811608195305,
0.018860002979636192,
-0.009588448330760002,
-0.014663556590676308,
-0.055081963539123535,
0.0323232039809227,
-0.027752244845032692,
0.018696755170822144,
-0.06453116983175278,
-0.07186774909496307,
-0.04255984351038933,
-0.012253240682184696,
0.03558817505836487,
0.001590472529642284,
0.007730296812951565,
-0.01644008420407772,
-0.027982713654637337,
0.008512929081916809,
-0.012099594809114933,
-0.019858699291944504,
-0.02861650288105011,
0.0029168666806071997,
0.06015226989984512,
0.021395156159996986,
-0.010121406987309456,
0.038257766515016556,
0.012877426110208035,
-0.02631181664764881,
0.019157690927386284,
-0.0150092588737607,
-0.024103160947561264,
0.006721997167915106,
-0.014826805330812931,
0.06622127443552017,
0.05765552818775177,
-0.03904519975185394,
-0.017554014921188354,
0.021222304552793503,
-0.03700939565896988,
-0.06045956164598465,
0.013127099722623825,
0.03894917294383049,
0.01920570619404316,
0.049550723284482956,
-0.05623430758714676,
-0.030345015227794647,
-0.040024690330028534,
-0.022739555686712265,
0.009761299937963486,
-0.044365182518959045,
-0.01577748730778694,
-0.02527470886707306,
0.004306879360228777,
-0.03514644131064415,
0.02538994327187538,
-0.022720349952578545,
0.044826116412878036,
-0.03301461040973663,
-0.08511968702077866,
-0.022624321281909943,
-0.013165511190891266,
-0.011465806514024734,
-0.035396117717027664,
-0.04321283847093582,
-0.023795869201421738,
-0.01406817976385355,
0.01261814869940281,
0.04117703437805176,
-0.06353247910737991,
0.022624321281909943,
-0.039525341242551804,
0.012128403410315514,
-0.00443651806563139,
-0.019532203674316406,
-0.02713766321539879,
0.05911516398191452,
0.03904519975185394,
0.024007132276892662,
-0.01850469782948494,
-0.059768158942461014,
-0.017784483730793,
0.015162904746830463,
0.012522120028734207,
-0.05208587646484375,
-0.0109856640920043,
0.04209890589118004,
0.11001028120517731,
0.08319912105798721,
-0.03480073809623718,
-0.026964811608195305,
-0.014269839972257614,
0.005992180202156305,
0.039525341242551804,
0.012157212011516094,
0.04551752284169197,
0.05850058048963547,
-0.046247340738773346,
-0.09771863371133804,
-0.006174634676426649,
0.07163728028535843,
-0.027003223076462746,
0.012502914294600487,
0.005406406242400408,
-0.04209890589118004,
-0.011398586444556713,
-0.07428766787052155,
0.0008186431950889528,
-0.026984017342329025,
0.006409904453903437,
-0.04594004899263382,
-0.009170725010335445,
-0.05331503972411156,
-0.01741957478225231,
-0.029250290244817734,
0.09502983093261719,
0.01695863902568817,
0.09648946672677994,
0.042905546724796295,
-0.04490293934941292,
-0.019272925332188606,
-0.06522257626056671,
0.009598051197826862,
0.01866794563829899,
0.012368475086987019,
-0.01172508392482996,
-0.03385965898633003,
0.01974346488714218,
0.03998627886176109,
-0.0017009053844958544,
-0.0235269907861948,
-0.008316070772707462,
0.028405239805579185,
0.04325124993920326,
-0.019877905026078224,
0.033072225749492645,
0.0008780608768574893,
0.02817477099597454,
-0.011360174976289272,
0.06591398268938065,
-0.025639617815613747,
-0.031478151679039,
0.013482405804097652,
0.041945263743400574,
0.014385073445737362,
0.020991837605834007,
-0.0029048630967736244,
-0.03831538185477257,
0.0037667190190404654,
-0.029730433598160744,
-0.022873995825648308,
-0.03044104389846325,
0.10171341896057129,
-0.08012620359659195,
-0.0010040983324870467,
-0.0049886819906532764,
-0.002784827258437872,
0.06403182446956635,
0.006486727390438318,
0.04217572882771492,
-0.009799711406230927,
-0.06364770978689194,
-0.03654845803976059,
-0.01734275184571743,
0.04551752284169197,
-0.0571177713572979,
0.05577336996793747,
0.028866175562143326,
0.06602922081947327,
-0.022297823801636696,
0.001717710285447538,
0.04255984351038933,
-0.05170176178216934,
0.018255023285746574,
-0.009919746778905392,
-0.0011769497068598866,
0.005051100626587868,
0.006299471482634544,
0.06203443184494972,
0.048590436577796936,
-0.05104876682162285,
-0.03134371340274811,
-0.0076198638416826725,
0.037758417427539825,
-0.005579257383942604,
-0.02533232606947422,
-0.04186844080686569,
0.03526167571544647,
0.022681938484311104,
0.015623841434717178,
-0.004847039934247732,
-0.027425747364759445,
0.04401947930455208,
-0.051432881504297256,
-0.040024690330028534,
0.017506001517176628,
0.012723780237138271,
-0.05285410210490227,
-0.008258453570306301,
0.010073392651975155,
-0.00009535333083476871,
-0.009228341281414032,
0.034474242478609085,
0.007043692748993635,
-0.037816036492586136,
-0.0589999295771122,
-0.007110912818461657,
0.015547019429504871,
-0.05304615944623947,
-0.030133752152323723,
-0.027099251747131348,
-0.009487618692219257,
0.03844982385635376,
-0.009401192888617516,
-0.017208311706781387,
0.042367786169052124,
0.025639617815613747,
-0.02350778505206108,
-0.03553055599331856,
0.054697852581739426,
-0.02765621617436409,
-0.01930173486471176,
0.0072213453240692616,
0.02729130908846855,
0.07663076370954514,
0.08481239527463913,
0.0061938404105603695,
-0.016113586723804474,
0.03990945592522621,
0.0025207488797605038,
0.028885381296277046,
-0.022221002727746964,
-0.000998696661554277,
0.012464502826333046,
-0.03184305876493454,
0.010735989548265934,
-0.021279921755194664,
-0.010966458357870579,
-0.014490704983472824,
0.056541599333286285,
0.050895120948553085,
-0.10509362071752548,
0.03101721592247486,
-0.03330269455909729,
0.06049797311425209,
-0.0658755749464035,
-0.022393852472305298,
0.11093215644359589,
0.004179641604423523,
-0.04816791042685509,
0.02961519919335842,
-0.00012558730668388307,
-0.01123533770442009,
0.00587214482948184,
-0.0040764110162854195,
-0.01403937116265297,
-0.006093010306358337,
-0.03468550369143486,
0.03626037389039993,
-0.03706701099872589,
-0.03345634043216705,
-0.03520406037569046,
0.0715220496058464,
-0.017208311706781387,
-0.02577405795454979,
0.007029288448393345,
0.024064749479293823,
0.015095684677362442,
0.057386647909879684,
-0.015748679637908936,
-0.00020301032054703683,
-0.02529391460120678,
-0.033110637217760086,
0.013674463145434856,
-0.04071609675884247,
0.0015472597442567348,
0.0029984908178448677,
0.04279031231999397,
-0.005992180202156305,
-0.0096220588311553,
-0.02104945294559002,
-0.019359352067112923,
0.012531722895801067,
-0.06349406391382217,
0.02014678530395031,
0.006529939826577902,
0.01264695730060339,
0.01197475753724575,
0.05308457091450691,
-0.01922491192817688,
0.0020490088500082493,
-0.0011643458856269717,
0.01334796566516161,
0.032169558107852936,
-0.015153301879763603,
-0.027310514822602272,
-0.030345015227794647,
-0.021433567628264427,
-0.009986966848373413,
-0.05197064206004143,
-0.013636051677167416,
0.016065573319792747,
0.03651004657149315,
0.04793744161725044,
0.029365524649620056,
0.0023538994137197733,
-0.06134302541613579,
0.016007956117391586,
0.03743192180991173,
0.05765552818775177,
-0.01876397430896759,
-0.005420810543000698,
-0.041945263743400574,
0.05769393965601921,
-0.016228821128606796,
0.016651347279548645,
-0.006731600034981966,
0.013213525526225567,
-0.027521776035428047,
-0.014711570926010609,
0.033533163368701935,
0.017486795783042908,
-0.04647780954837799,
-0.01706426963210106,
0.036279577761888504,
0.046247340738773346,
0.02300843596458435,
-0.08865354210138321,
-0.022297823801636696,
0.009348377585411072,
0.018178200349211693,
-0.006621167063713074,
0.07958844304084778,
0.010716783814132214,
-0.022854790091514587,
0.0006499931332655251,
0.020857397466897964,
0.00036460833507589996,
0.006515535991638899,
-0.057463470846414566,
0.04302078112959862,
0.02669593133032322,
-0.021664036437869072,
0.046247340738773346,
0.0011637457646429539,
0.0008060394902713597,
-0.032534465193748474,
-0.002107826294377446,
0.003893957007676363,
-0.02433362975716591,
-0.060728441923856735,
-0.005963371600955725,
0.07447972893714905,
-0.02297002449631691,
0.006890046875923872,
0.03040263243019581,
0.04889772832393646,
0.011398586444556713,
-0.04067768529057503,
-0.02763701044023037,
-0.01597914658486843,
0.005276767536997795,
-0.06015226989984512,
0.038718704134225845,
0.0006613964796997607,
0.055542901158332825,
-0.020338842645287514,
-0.05926880985498428,
0.055081963539123535,
0.004551752470433712,
-0.01614239625632763,
-0.0723671019077301,
0.04190685227513313,
-0.01031346432864666,
-0.012887028977274895,
0.020799780264496803,
-0.03658686950802803,
0.032553672790527344,
0.023066053166985512,
-0.005252760369330645,
0.007936757989227772,
0.0786665752530098,
-0.09049728512763977,
0.035434529185295105,
0.021395156159996986,
0.020799780264496803,
0.018110981211066246,
0.03535770624876022,
0.03937169909477234,
-0.016689758747816086,
0.012570134364068508,
-0.02210576832294464,
-0.028808558359742165,
0.025908498093485832,
-0.004724603611975908,
-0.0673736184835434,
0.08404416590929031,
0.02212497405707836,
-0.042444609105587006,
0.0470539815723896,
-0.02254749834537506,
-0.009742094203829765,
-0.04981959983706474,
0.06153508275747299,
0.023373344913125038,
-0.05051100626587868,
0.0441347137093544,
0.04398106783628464,
0.03910281881690025,
-0.037259068340063095,
0.009228341281414032,
0.043904244899749756,
0.029672816395759583,
0.032553672790527344,
0.03714383393526077,
0.021894505247473717,
-0.042444609105587006,
-0.0058817476965487,
0.02339255064725876,
-0.04594004899263382,
0.0003724106354638934,
0.08335276693105698,
-0.012560531497001648,
0.008815418928861618,
-0.01612319052219391,
0.027752244845032692,
0.018648739904165268,
-0.0057905204594135284,
-0.03827697038650513,
0.0143274562433362,
-0.003317785682156682,
-0.0422525517642498,
0.020377254113554955,
0.013223128393292427,
-0.01706426963210106,
-0.01860072650015354,
-0.011312160640954971,
-0.043827421963214874,
-0.010428698733448982,
-0.012166814878582954,
0.025505177676677704,
-0.02625419944524765,
-0.008652170188724995,
0.0497811883687973,
0.014212222769856453,
-0.001028705621138215,
0.025908498093485832,
-0.013588037341833115,
-0.005636874586343765,
0.018437478691339493,
-0.04033198207616806,
0.01684340462088585,
-0.02490979991853237,
-0.027099251747131348,
0.03990945592522621,
-0.03297619894146919,
0.008997873403131962,
-0.0072693596594035625,
-0.005204746499657631,
-0.019455380737781525,
-0.03428218513727188,
0.037297479808330536,
-0.048129498958587646,
0.0192441176623106,
-0.006126620341092348,
-0.06441593915224075,
-0.023795869201421738,
-0.036817338317632675,
-0.018418272957205772,
0.018293434754014015,
-0.02535153180360794,
0.0063522872515022755,
0.021779270842671394,
-0.004244461189955473,
0.008897043764591217,
0.01050552073866129,
-0.011878728866577148,
0.008268056437373161,
-0.08012620359659195,
-0.06153508275747299,
-0.03186226636171341,
-0.02297002449631691,
-0.007024487014859915,
0.022413058206439018,
-0.009175525978207588,
0.07689964771270752,
-0.022797172889113426,
-0.034474242478609085,
0.006361890118569136,
0.025985321030020714,
0.04786061868071556,
-0.0018209409900009632,
-0.014663556590676308,
0.08196995407342911,
0.002878455212339759,
-0.10947252064943314,
0.014855613932013512,
0.02245146967470646,
0.00035350502002984285,
-0.09802592545747757,
0.019176896661520004,
0.006832430139183998,
0.0023154879454523325,
-0.06092049926519394,
-0.009401192888617516,
-0.02014678530395031,
-0.01796693727374077,
-0.004350092262029648,
0.03391727805137634,
0.017630837857723236,
-0.044826116412878036,
-0.009151519276201725,
0.010217435657978058,
-0.038737908005714417,
0.020473282784223557,
-0.008287262171506882,
0.00788874365389347,
0.026023732498288155,
0.016190409660339355,
-0.02212497405707836,
-0.040485627949237823,
0.004378900863230228,
-0.005416009109467268,
-0.04444200545549393,
-0.020492488518357277,
0.025966115295886993,
-0.029826462268829346,
0.06249536573886871,
-0.023277316242456436,
-0.022201796993613243,
0.08419781178236008,
0.045747991651296616,
0.021798476576805115,
0.06518416851758957,
-0.02907743863761425,
0.022240208461880684,
0.05585019290447235,
0.05673365667462349,
-0.020838191732764244,
-0.02116468735039234,
-0.08504286408424377,
0.0013239933177828789,
-0.01262775156646967,
0.0032529665622860193,
-0.04263666644692421,
0.02149118483066559,
-0.009761299937963486,
-0.000810240744613111,
-0.053199805319309235,
-0.005804924760013819,
-0.047130800783634186,
-0.01892722398042679,
0.03247684985399246,
-0.0046861921437084675,
0.014212222769856453,
0.036375608295202255,
-0.01656492054462433,
-0.01334796566516161,
-0.024218395352363586,
0.0333603098988533,
0.008628163486719131,
0.019196102395653725,
0.0638013556599617,
0.0019073666771873832,
-0.01053432933986187,
0.016171203926205635,
-0.03274573013186455,
-0.054659441113471985,
-0.012762191705405712,
-0.09095822274684906,
-0.04209890589118004,
-0.05150970444083214,
0.0026287809014320374,
-0.038641881197690964,
-0.054659441113471985,
0.048974551260471344,
0.078013576567173,
0.01878318004310131,
-0.018110981211066246,
-0.00960285309702158,
-0.0211262758821249,
0.017208311706781387,
0.01595994085073471,
-0.009391590021550655,
0.023200493305921555,
0.022605115547776222,
0.01848549209535122,
-0.030652306973934174,
0.09072775393724442,
0.04597846046090126,
0.0014416283229365945,
0.04832155629992485,
0.017189105972647667,
0.01550860796123743,
0.05077988654375076,
0.025985321030020714,
-0.022873995825648308,
-0.0318046510219574,
-0.001438027247786522,
-0.024756155908107758,
0.031113244593143463,
0.02525550313293934,
-0.024717744439840317,
-0.0581548772752285,
0.035434529185295105,
-0.012954249046742916,
-0.029231084510684013,
-0.053161393851041794,
0.008003978058695793,
-0.03579943627119064,
-0.022662732750177383,
0.0005485629662871361,
-0.024007132276892662,
0.07401879131793976,
0.03101721592247486,
-0.03328348696231842,
-0.03291857987642288,
0.000038242611481109634,
-0.05285410210490227,
0.04782220721244812,
0.051816996186971664,
0.05016530305147171,
-0.03268811106681824,
-0.003233760828152299,
0.024583304300904274,
0.051317647099494934,
0.0238534864038229,
0.032995402812957764,
0.003841141238808632,
0.03055627830326557,
0.012704574503004551,
0.048475202172994614,
-0.01802455447614193,
-0.03145894780755043,
-0.005809726193547249,
0.02164483070373535,
-0.049512311816215515,
-0.0016048768302425742,
-0.032841756939888,
0.027483364567160606,
-0.02955758199095726,
-0.020050756633281708,
0.03224638104438782,
0.017784483730793,
-0.03205432370305061,
0.0037403111346066,
0.04375059902667999,
0.028366828337311745,
0.05312298238277435,
0.04682351276278496,
-0.037239864468574524,
-0.003228959394618869,
-0.023181287571787834,
-0.010092598386108875,
-0.004412510897964239,
0.006986075546592474,
-0.011369777843356133,
-0.009948555380105972,
-0.023642223328351974,
-0.029327113181352615,
0.040101513266563416,
-0.05389121174812317,
-0.015278139151632786,
0.06560669094324112,
0.03391727805137634,
-0.07882022112607956,
0.027963507920503616,
-0.01706426963210106,
-0.02068454585969448,
0.09180327504873276,
-0.00822964496910572,
-0.017016256228089333,
0.05358392000198364,
-0.049934834241867065,
0.006717195734381676,
-0.026407845318317413,
-0.04090815410017967,
-0.03240002691745758,
0.0824308916926384,
-0.016286438331007957,
0.009357980452477932,
-0.03835379332304001,
0.018139788880944252,
-0.025908498093485832,
-0.04090815410017967,
0.002535153180360794,
-0.022873995825648308,
-0.027982713654637337,
0.035857051610946655,
0.013271142728626728,
0.015143699012696743,
0.012474105693399906,
0.12683448195457458,
-0.060229092836380005,
-0.03602990508079529,
0.05454420670866966,
0.005118320696055889,
0.012502914294600487,
0.06357088685035706,
0.053238216787576675,
0.04747650399804115,
-0.028846969828009605,
-0.00048554426757618785,
0.03101721592247486,
-0.0573098249733448,
0.03599149361252785,
0.0639934092760086,
0.002214658074080944,
0.03174703195691109,
-0.02256670407950878,
-0.01952259987592697,
-0.013472802937030792,
-0.014942039735615253,
-0.022336235269904137,
-0.03362919017672539,
0.026369433850049973,
-0.030210575088858604
]
|
36,605 | rfc3987 | _interpret_unicode_escapes | null | def _interpret_unicode_escapes(string):
return string.encode('ascii').decode('raw-unicode-escape')
| (string) | [
-0.05603900924324989,
-0.016663506627082825,
0.051110610365867615,
0.06610259413719177,
-0.018335025757551193,
-0.007539073470979929,
-0.017628507688641548,
0.011674793437123299,
0.054694902151823044,
0.009762022644281387,
0.021402351558208466,
0.04108148813247681,
-0.017447570338845253,
0.08292119204998016,
0.023901017382740974,
-0.005173958372324705,
-0.034395407885313034,
0.07954368740320206,
0.050490252673625946,
0.0031922589987516403,
-0.0829901173710823,
-0.011890196241438389,
0.05121400207281113,
-0.009451843798160553,
-0.002397425239905715,
0.032982368022203445,
-0.061312053352594376,
-0.00672054523602128,
-0.04549292474985123,
-0.05097275227308273,
0.03394737094640732,
-0.014604262076318264,
0.005126569885760546,
-0.002012932673096657,
0.04349398985505104,
-0.008241284638643265,
-0.030225222930312157,
-0.004691457841545343,
0.00624235300347209,
-0.019231099635362625,
-0.05493615195155144,
-0.015345245599746704,
-0.04125380888581276,
-0.01881752721965313,
-0.013484171591699123,
0.01235546451061964,
-0.07582154124975204,
-0.03760059177875519,
-0.02112663723528385,
0.02069583348929882,
0.031172990798950195,
0.0382898785173893,
0.014354395680129528,
-0.008025881834328175,
0.033740583807229996,
-0.006082955282181501,
-0.03494683653116226,
0.008094810880720615,
-0.0032525716815143824,
-0.05703847482800484,
-0.006436214782297611,
0.022281192243099213,
-0.01031345222145319,
0.01618100516498089,
0.012217607349157333,
-0.009529388509690762,
0.01503506675362587,
-0.038083091378211975,
0.0006677465280517936,
-0.025314055383205414,
-0.06848063319921494,
0.006039874628186226,
-0.046009887009859085,
-0.09394977986812592,
0.04638899490237236,
-0.02421119622886181,
-0.02185038849711418,
-0.001919232658110559,
-0.03144870698451996,
0.04711274802684784,
0.022849854081869125,
-0.04125380888581276,
0.0024598920717835426,
0.02533128671348095,
-0.024004409089684486,
-0.015422790311276913,
-0.019196635112166405,
0.03608416020870209,
-0.005565990228205919,
0.019558509811758995,
0.06737777590751648,
-0.08085332810878754,
-0.02312556840479374,
0.1366855502128601,
-0.0455273874104023,
-0.0035196703393012285,
0.040116485208272934,
0.007681238930672407,
-0.0398063063621521,
-0.07706225663423538,
-0.009460460394620895,
0.061380982398986816,
-0.0013419550377875566,
-0.06100187450647354,
-0.0377039834856987,
-0.06765349209308624,
0.010959658771753311,
0.010752872563898563,
-0.007969877682626247,
-0.0636211633682251,
0.02421119622886181,
0.01648256927728653,
-0.029915044084191322,
-0.002724836580455303,
-0.0005280043696984649,
0.011097515933215618,
0.018938152119517326,
-0.017102926969528198,
0.09188191592693329,
-0.013475554995238781,
0.012002204544842243,
0.061312053352594376,
-0.006582688074558973,
-0.018541812896728516,
0.0027549928054213524,
0.08305905014276505,
-0.01487136073410511,
0.09794764220714569,
0.00008764172525843605,
0.060415979474782944,
0.009675862267613411,
0.050421323627233505,
-0.00850407499819994,
0.0018018385162577033,
-0.011967740952968597,
0.015147075988352299,
-0.029105130583047867,
0.0377039834856987,
0.014681806787848473,
0.017852526158094406,
0.00746152875944972,
-0.013846047222614288,
0.04480363801121712,
0.017102926969528198,
-0.09705156832933426,
0.010184211656451225,
0.023969944566488266,
-0.021574674174189568,
0.014319931156933308,
-0.025158965960144997,
0.03282728046178818,
0.017594043165445328,
-0.04125380888581276,
0.06806706637144089,
0.010098050348460674,
0.0012417930411174893,
0.01588805951178074,
-0.031172990798950195,
0.055453117936849594,
0.048181142657995224,
-0.0037264563143253326,
-0.008779789321124554,
-0.022419050335884094,
0.012613946571946144,
-0.03212076053023338,
0.005505677778273821,
0.0784408301115036,
-0.05004221573472023,
0.004738846328109503,
-0.0017587580950930715,
0.011959124356508255,
-0.011433543637394905,
-0.012751804664731026,
0.04983542859554291,
0.04363184794783592,
0.010054970160126686,
-0.0051093376241624355,
0.03718701750040054,
-0.025848252698779106,
-0.03608416020870209,
0.06331098824739456,
-0.04345952719449997,
0.0011567092733457685,
-0.030121829360723495,
0.03777291253209114,
-0.07065188884735107,
0.04800881817936897,
0.03542933613061905,
0.02112663723528385,
-0.03165549412369728,
0.011295686475932598,
-0.019954850897192955,
-0.04793988913297653,
-0.010597783140838146,
-0.015233236365020275,
-0.009391531348228455,
0.04511381685733795,
-0.03763505443930626,
-0.05024900287389755,
-0.026796020567417145,
-0.04497595876455307,
0.0319829024374485,
0.04628560319542885,
-0.026985574513673782,
0.022057175636291504,
-0.06861849129199982,
-0.0031082523055374622,
-0.03701469674706459,
-0.025245126336812973,
-0.07147902995347977,
-0.012329615652561188,
0.021540209650993347,
0.0024232736323028803,
0.014026984572410583,
-0.014483637176454067,
0.05710740387439728,
-0.001669366261921823,
0.0062035806477069855,
0.07616618275642395,
-0.00794402975589037,
-0.04859471321105957,
0.002662369981408119,
-0.043976493179798126,
0.017344176769256592,
0.002892850199714303,
-0.022987712174654007,
-0.06696420162916183,
0.06479295343160629,
0.04911167919635773,
0.04790542647242546,
0.01641364023089409,
0.002053858945146203,
0.03043200820684433,
0.023470211774110794,
0.047388460487127304,
0.005927865859121084,
-0.03286174312233925,
-0.03904809057712555,
0.0014604262541979551,
0.011218140833079815,
-0.019076010212302208,
-0.04793988913297653,
0.01425961870700121,
-0.029828881844878197,
0.017886990681290627,
-0.007297823205590248,
-0.006031258963048458,
0.10663265734910965,
-0.010184211656451225,
-0.022849854081869125,
0.025589769706130028,
0.005018868949264288,
-0.002509434474632144,
-0.019816992804408073,
-0.013286001048982143,
0.029604865238070488,
0.025848252698779106,
0.031052365899086,
0.014690423384308815,
0.059209730476140976,
-0.0020150865893810987,
0.037359338253736496,
-0.021109405905008316,
-0.0096586300060153,
-0.03527424857020378,
-0.066068135201931,
-0.04294256120920181,
0.06468956172466278,
0.01363926101475954,
-0.012312384322285652,
0.02131619118154049,
-0.0057167718186974525,
-0.033447638154029846,
-0.01572435349225998,
-0.06369008868932724,
-0.01954127848148346,
0.002072168281301856,
-0.010210059583187103,
-0.0031771808862686157,
-0.09181299060583115,
0.0023457289207726717,
0.06796366721391678,
-0.03131084889173508,
-0.01691337302327156,
0.03494683653116226,
0.0013947285478934646,
0.0407368466258049,
-0.017266632989048958,
0.006220812443643808,
-0.02431458793580532,
-0.0001322703465120867,
-0.008034498430788517,
0.004025865346193314,
-0.03577398136258125,
-0.011485239490866661,
0.0002228065422968939,
-0.023901017382740974,
-0.08740155398845673,
0.014121761545538902,
-0.033240851014852524,
0.015440022572875023,
-0.0037867689970880747,
0.028639862313866615,
0.04325274005532265,
-0.03780737519264221,
0.014957522042095661,
-0.03007013350725174,
0.04900828376412392,
-0.02240181900560856,
-0.004277885891497135,
-0.0180937759578228,
0.0588306225836277,
-0.049732036888599396,
0.041770774871110916,
-0.06941117346286774,
0.052627041935920715,
-0.04370077699422836,
-0.03424031659960747,
0.022677533328533173,
-0.023418515920639038,
0.04325274005532265,
-0.04518274590373039,
0.05572883039712906,
-0.024107802659273148,
-0.023470211774110794,
-0.01233823224902153,
0.0356016606092453,
-0.029587632045149803,
0.03698023036122322,
0.022453514859080315,
-0.027347451075911522,
-0.011140596121549606,
0.007707086857408285,
-0.023056641221046448,
0.054867222905159,
-0.0005231578252278268,
-0.005897709634155035,
-0.020058242604136467,
-0.03339594230055809,
0.008124967105686665,
0.015508950687944889,
0.051110610365867615,
0.05583222210407257,
0.0023457289207726717,
-0.060519374907016754,
0.006905791349709034,
-0.03072495572268963,
0.053247399628162384,
0.0039806305430829525,
-0.05996794253587723,
-0.031431473791599274,
-0.054729364812374115,
0.015974219888448715,
-0.05228239670395851,
-0.06227705627679825,
0.0015002755681052804,
0.0058546289801597595,
0.004790542647242546,
0.002938084537163377,
-0.048181142657995224,
0.018179936334490776,
-0.004277885891497135,
-0.004467439372092485,
-0.020471815019845963,
-0.02612396702170372,
-0.022160567343235016,
0.018765831366181374,
0.018645206466317177,
-0.05345418304204941,
0.04266684874892235,
-0.0036122931633144617,
0.04418327659368515,
-0.02348744496703148,
-0.02283262275159359,
-0.00962416548281908,
-0.007883716374635696,
0.001088857650756836,
-0.020540744066238403,
-0.01238992903381586,
-0.05493615195155144,
-0.0016327479388564825,
-0.00007741012814221904,
-0.07685546576976776,
-0.04084023833274841,
0.04780203476548195,
-0.03492960333824158,
-0.006018334534019232,
0.03635987266898155,
0.03032861463725567,
0.006164807826280594,
-0.011959124356508255,
-0.008271440863609314,
0.07568368315696716,
0.008909030817449093,
-0.039565056562423706,
-0.014087297022342682,
0.05783115699887276,
0.009762022644281387,
0.04918060824275017,
0.006147576030343771,
-0.05376436188817024,
0.05379882827401161,
0.029329149052500725,
-0.00973617471754551,
0.05052471533417702,
0.024555839598178864,
-0.038014162331819534,
0.012019436806440353,
-0.03760059177875519,
-0.017120158299803734,
-0.005135186016559601,
-0.008068962953984737,
0.003097482258453965,
-0.03510192409157753,
-0.01487136073410511,
-0.029725490137934685,
-0.061243124306201935,
-0.015284933149814606,
-0.015586495399475098,
0.026658164337277412,
-0.011080283671617508,
-0.0018190706614404917,
-0.06861849129199982,
0.006888559088110924,
-0.003321500262245536,
-0.014897208660840988,
0.02431458793580532,
0.015534799546003342,
0.038703449070453644,
0.05438472330570221,
-0.017421722412109375,
-0.052627041935920715,
-0.001897692447528243,
-0.08443762362003326,
0.002851923694834113,
0.00018686131807044148,
0.0321035273373127,
0.04652685299515724,
0.010149747133255005,
0.05362650752067566,
0.05279936268925667,
0.03108683042228222,
-0.0005896632210351527,
-0.04366631433367729,
0.03911701962351799,
0.007431372534483671,
-0.011468008160591125,
0.08043976128101349,
0.024297356605529785,
-0.008977959863841534,
-0.027761021628975868,
-0.01225207094103098,
-0.01842118799686432,
-0.0023995793890208006,
0.020282261073589325,
-0.007767399773001671,
0.03499853238463402,
-0.028708791360259056,
-0.03935827314853668,
0.044631313532590866,
-0.04718167707324028,
-0.028450308367609978,
-0.001963390037417412,
0.007961261086165905,
-0.02174699492752552,
0.0059795621782541275,
0.01618100516498089,
0.035911839455366135,
-0.018076544627547264,
0.04694042354822159,
-0.03835880383849144,
0.03327531740069389,
-0.014302698895335197,
0.00713842548429966,
-0.0010667789028957486,
-0.0006655924953520298,
-0.05014560744166374,
-0.016370559111237526,
-0.01888645626604557,
0.007534765172749758,
-0.05507401004433632,
-0.08354154974222183,
0.036497730761766434,
-0.06682634353637695,
-0.0015993606066331267,
0.002686064224690199,
0.1131119504570961,
-0.0028540778439491987,
0.03492960333824158,
0.05710740387439728,
0.06868742406368256,
0.08140476047992706,
0.008590235374867916,
0.023780392482876778,
0.061312053352594376,
0.007793247699737549,
0.0074830688536167145,
0.013242920860648155,
0.07630404084920883,
-0.003719994332641363,
0.04359738528728485,
-0.0033128843642771244,
-0.012295152060687542,
-0.05383329093456268,
0.004150798544287682,
0.02908789925277233,
0.022126102820038795,
0.010864881798624992,
0.04414881393313408,
0.008086195215582848,
0.0356016606092453,
-0.010390996932983398,
0.03990970179438591,
-0.03687683865427971,
-0.012398544698953629,
0.01492305751889944,
0.048939358443021774,
0.024814322590827942,
0.017128774896264076,
0.0271406639367342,
0.006294049322605133,
-0.012743188068270683,
-0.02124726213514805,
-0.07368475198745728,
-0.024107802659273148,
-0.006345745641738176,
-0.021557442843914032,
0.031827814877033234,
-0.018179936334490776,
-0.007668314501643181,
-0.0392204150557518,
-0.016456719487905502,
-0.04263238236308098,
-0.03708362579345703,
-0.021143870428204536,
0.07485653460025787,
-0.03990970179438591,
0.0388757698237896,
-0.03694576770067215,
0.055453117936849594,
0.011468008160591125,
0.04511381685733795,
0.007668314501643181,
-0.004635453224182129,
0.05279936268925667,
-0.006108803674578667,
-0.036566659808158875,
-0.028277987614274025,
-0.040874700993299484,
0.007569229695945978,
-0.012777652591466904,
0.010287604294717312,
-0.020816458389163017,
0.04359738528728485,
0.012906894087791443,
-0.09326048940420151,
0.008099119178950787,
0.05221346765756607,
-0.07761368155479431,
0.06155330315232277,
0.024090571328997612,
-0.024917714297771454,
-0.009994657710194588,
-0.029880579560995102,
-0.05645258352160454,
-0.02974272146821022,
-0.05021453648805618,
0.017594043165445328,
-0.022711997851729393,
0.006617152597755194,
0.029932275414466858,
-0.002675293944776058,
0.09698264300823212,
-0.0032525716815143824,
-0.03356826305389404,
-0.0346711203455925,
0.06179455295205116,
-0.029294684529304504,
0.028243523091077805,
-0.0057167718186974525,
0.036566659808158875,
-0.022815389558672905,
-0.02450414188206196,
-0.033843979239463806,
0.006220812443643808,
-0.02529682219028473,
0.05424686521291733,
0.12393375486135483,
0.00242973561398685,
-0.024486910551786423,
-0.015465870499610901,
-0.047422926872968674,
0.046078816056251526,
0.03822094947099686,
0.03286174312233925,
-0.015474487096071243,
-0.019127706065773964,
0.0351363904774189,
0.016870291903614998,
-0.0257965549826622,
0.04690596088767052,
0.03032861463725567,
0.008465302176773548,
-0.0019116936018690467,
0.06334544718265533,
-0.02493494749069214,
-0.005010252818465233,
0.03749719634652138,
-0.036601126194000244,
-0.01852457970380783,
-0.005785700399428606,
0.01642225682735443,
-0.007711395155638456,
-0.011097515933215618,
0.051765430718660355,
0.017033997923135757,
-0.019885921850800514,
-0.03715255483984947,
-0.007724319119006395,
0.05173096805810928,
0.03075942024588585,
0.022746462374925613,
-0.052592575550079346,
-0.04228774085640907,
0.01885199174284935,
-0.019713599234819412,
0.023573605343699455,
0.00977063924074173,
-0.00982233602553606,
-0.04556185007095337,
0.006681772880256176,
0.026175662875175476,
0.005656458903104067,
0.004219727125018835,
0.016990916803479195,
-0.029828881844878197,
-0.0654822364449501,
-0.0055918386206030846,
0.026968343183398247,
-0.00004459496631170623,
0.0062035806477069855,
-0.016568729653954506,
-0.022384585812687874,
0.024331821128726006,
0.012028053402900696,
0.011916044168174267,
-0.04842239245772362,
-0.07047956436872482,
0.03492960333824158,
-0.025520840659737587,
-0.01176095474511385,
0.06365562975406647,
0.032293081283569336,
-0.0007662929710932076,
0.015284933149814606,
0.06251830607652664,
-0.05865829810500145,
-0.012208990752696991,
0.04125380888581276,
-0.003579982789233327,
0.007978493347764015,
0.028243523091077805,
-0.027088968083262444,
0.002634367672726512,
0.010485773906111717,
-0.01304475124925375,
-0.03456772863864899,
0.012131446041166782,
-0.0037910768296569586,
-0.052454717457294464,
0.07313331961631775,
-0.005027485080063343,
-0.04049559310078621,
-0.005186882335692644,
-0.01885199174284935,
-0.04804328456521034,
0.01885199174284935,
-0.04370077699422836,
0.07520118355751038,
0.0049628643319010735,
-0.06503420323133469,
-0.004471747670322657,
-0.04115041717886925,
-0.026313520967960358,
-0.024986643344163895,
-0.004327428061515093,
0.030742187052965164,
0.009339834563434124,
0.0838172659277916,
-0.0018933844985440373,
0.007030724547803402,
0.012096981517970562,
-0.06100187450647354,
0.023676998913288116,
-0.05876169353723526,
-0.043976493179798126,
0.06682634353637695,
-0.05138632282614708,
0.039668451994657516,
0.04666471108794212,
0.010994123294949532,
-0.03325808420777321,
0.00616049999371171,
0.0018287638667970896,
0.00962416548281908,
0.03684237599372864,
-0.011450775898993015,
-0.021402351558208466,
0.031000670045614243,
-0.004064637701958418,
-0.008021574467420578,
0.016620425507426262,
-0.009675862267613411,
-0.04059898853302002,
0.033775050193071365,
-0.005699539557099342,
0.004168030805885792,
0.01697368547320366,
-0.023539140820503235,
0.005927865859121084,
-0.015707120299339294,
-0.02793334424495697,
0.010839033871889114,
0.061312053352594376,
0.015965603291988373,
0.04418327659368515,
-0.08622977137565613,
0.024193963035941124,
0.02503833919763565,
-0.00977063924074173,
-0.02550360932946205,
0.02493494749069214,
-0.03608416020870209,
-0.010175595059990883,
-0.051834359765052795,
-0.030621562153100967,
-0.006681772880256176,
-0.04573417454957962,
0.005734004080295563,
0.013682341203093529,
0.0044502075761556625,
0.007909565232694149,
-0.03901362791657448,
-0.001525046885944903,
0.046078816056251526,
0.031931206583976746,
-0.013363545760512352,
0.0048250071704387665,
0.00021311345335561782,
0.0032611878123134375,
0.020902618765830994,
0.07368475198745728,
-0.07251296192407608,
0.005212730728089809,
0.042322203516960144,
0.014621494337916374,
0.021919317543506622,
0.0382898785173893,
0.010253139771521091,
0.03158656507730484,
-0.08361047506332397,
0.03463665768504143,
-0.06568902730941772,
0.020471815019845963,
-0.02912236377596855,
-0.01020144298672676,
0.03684237599372864,
-0.019627438858151436
]
|
36,607 | rfc3987 | _remove_dot_segments | null | def _remove_dot_segments(path):
path = _dot_segments.sub('', path)
c = 1
while c:
path, c = _2dots_segments.subn('/', path, 1)
return path
| (path) | [
-0.004168718121945858,
0.07943051308393478,
0.027762625366449356,
0.0332113653421402,
-0.04756836220622063,
-0.055386871099472046,
0.022296588867902756,
0.017444616183638573,
0.04618455469608307,
0.004713592119514942,
0.06448540091514587,
0.006080101244151592,
-0.03471625596284866,
-0.027970196679234505,
-0.01551593467593193,
0.033730290830135345,
0.059192340821027756,
0.011130996979773045,
0.008428248576819897,
-0.00356114050373435,
0.00957421399652958,
0.014581864699721336,
-0.012523451820015907,
0.013146165758371353,
-0.012756969779729843,
-0.013362385332584381,
0.0274339709430933,
0.01631162315607071,
0.008376356214284897,
-0.06123345345258713,
0.03310757875442505,
-0.0003037888673134148,
-0.029907526448369026,
-0.040268778800964355,
-0.02430310845375061,
0.018283547833561897,
0.046426720917224884,
0.029803739860653877,
-0.019667355343699455,
0.0014562405413016677,
-0.03219080716371536,
0.004064932931214571,
-0.06690706312656403,
-0.0332113653421402,
0.0341627337038517,
-0.008186082355678082,
0.023542014881968498,
0.03165458142757416,
-0.008415275253355503,
0.00008047431765589863,
0.036463312804698944,
-0.019650056958198547,
-0.022313885390758514,
-0.02558312937617302,
0.004030337557196617,
0.004229259677231312,
0.03338434174656868,
0.0763169527053833,
0.04888297617435455,
-0.00021838201791979373,
-0.02079169824719429,
-0.060091812163591385,
-0.009842326864600182,
0.028281552717089653,
0.04971326142549515,
0.026223139837384224,
0.025254474952816963,
0.01707271672785282,
-0.02812587469816208,
-0.034820038825273514,
-0.028385339304804802,
0.0033319476060569286,
-0.020065199583768845,
0.0035114099737256765,
-0.02253875508904457,
-0.019252212718129158,
0.01980573683977127,
0.08372031897306442,
0.008674738928675652,
-0.00356114050373435,
-0.02461446449160576,
-0.0380546897649765,
0.005699554458260536,
-0.02272902801632881,
0.06919034570455551,
0.016242433339357376,
0.009357994422316551,
-0.03546005114912987,
-0.09195397049188614,
0.06413944810628891,
-0.010170980356633663,
-0.0193387009203434,
-0.04511210322380066,
-0.017730025574564934,
-0.03926552087068558,
0.01921761780977249,
0.026897747069597244,
-0.016155945137143135,
-0.026811258867383003,
-0.0521349236369133,
0.047395385801792145,
0.030184287577867508,
-0.07866942137479782,
0.026620984077453613,
0.0339551605284214,
-0.035771407186985016,
-0.03808928281068802,
0.016173243522644043,
0.0023546339944005013,
-0.037847116589546204,
-0.017410019412636757,
-0.01875058375298977,
0.019546272233128548,
-0.049055952578783035,
0.0355292409658432,
-0.02790100686252117,
-0.024233918637037277,
-0.061544809490442276,
0.03533896803855896,
0.05272304266691208,
-0.015489988029003143,
-0.0079093212261796,
-0.10440822690725327,
0.02497771382331848,
-0.013889961875975132,
-0.008800147101283073,
-0.004467101767659187,
0.06590380519628525,
-0.03649790585041046,
-0.011148294433951378,
0.01181425154209137,
-0.0035633028019219637,
-0.009591511450707912,
-0.019096534699201584,
-0.005898477043956518,
0.02118954248726368,
-0.02373228780925274,
0.006439026445150375,
0.01786840707063675,
-0.002702747704461217,
-0.014772138558328152,
0.025202583521604538,
-0.02783181518316269,
0.021743064746260643,
0.050612736493349075,
0.030236180871725082,
0.06026478856801987,
0.01494511403143406,
-0.016925686970353127,
-0.003937363158911467,
-0.061925359070301056,
-0.013293194584548473,
0.0550755150616169,
-0.042309895157814026,
0.015637017786502838,
-0.05708203464746475,
-0.01547269057482481,
-0.028956158086657524,
0.026707472279667854,
-0.06445080786943436,
0.0027524784673005342,
-0.03291730582714081,
-0.02547934465110302,
-0.03974985331296921,
-0.020808996632695198,
-0.018041381612420082,
0.0258598905056715,
0.02400904893875122,
-0.022296588867902756,
0.05289601907134056,
0.03243297338485718,
0.04137582704424858,
-0.06541947275400162,
0.01322400476783514,
-0.0025362586602568626,
-0.0066033536568284035,
-0.0057211765088140965,
0.03549464792013168,
0.015265119262039661,
0.015317012555897236,
0.03902335464954376,
0.013967800885438919,
0.03691304847598076,
0.03601357340812683,
-0.0041297986172139645,
0.034024350345134735,
-0.005677932407706976,
-0.029250217601656914,
0.002384904772043228,
-0.007809860166162252,
-0.012670481577515602,
0.015325660817325115,
0.01883707195520401,
0.0059936135075986385,
0.053345754742622375,
0.013630498200654984,
0.032865412533283234,
0.008060675114393234,
-0.04940190538764,
-0.05839664861559868,
-0.02226199395954609,
0.0042119622230529785,
0.0021632793359458447,
-0.02157009020447731,
-0.004774133674800396,
0.021258732303977013,
0.0035762758925557137,
0.04753376543521881,
-0.008951500989496708,
-0.004276827909052372,
0.013976449146866798,
-0.01843922585248947,
0.05946910008788109,
-0.07306500524282455,
-0.014737543649971485,
-0.0489867627620697,
-0.012609940022230148,
0.07327257096767426,
0.004990353714674711,
0.0573933906853199,
-0.01244561281055212,
0.015438095666468143,
0.06372430920600891,
-0.030703214928507805,
-0.004761160351336002,
-0.012774267233908176,
-0.06583461165428162,
0.03546005114912987,
0.04424722492694855,
-0.04051094502210617,
0.06469297409057617,
-0.029544277116656303,
-0.013889961875975132,
-0.03398975729942322,
0.027693435549736023,
0.004480074625462294,
0.006391458213329315,
-0.0668378695845604,
0.07797751575708389,
-0.05182356759905815,
0.0020357095636427402,
0.0031503229402005672,
-0.032571353018283844,
-0.04843324050307274,
-0.00843689776957035,
0.028627505525946617,
-0.006439026445150375,
-0.04521588981151581,
0.022988492622971535,
0.021794958040118217,
0.017634889110922813,
0.028662100434303284,
0.00663794856518507,
0.03760495036840439,
0.0386774018406868,
-0.026482604444026947,
-0.03405894711613655,
0.040372565388679504,
-0.001294075627811253,
0.0935453474521637,
-0.0361519530415535,
-0.058327458798885345,
-0.037535760551691055,
-0.014322401024401188,
0.0034487061202526093,
0.004307098686695099,
-0.002309227827936411,
-0.022296588867902756,
-0.0028108577243983746,
0.03404165059328079,
0.03981904312968254,
-0.033730290830135345,
0.011200186796486378,
0.002404364524409175,
0.015758100897073746,
0.06071452796459198,
-0.05317277833819389,
-0.00795688945800066,
0.07327257096767426,
0.0027222076896578074,
-0.01757434755563736,
-0.024060942232608795,
-0.004977380391210318,
0.010828289203345776,
0.024925820529460907,
0.03566762059926987,
0.024770142510533333,
-0.0487791933119297,
-0.031204845756292343,
0.04151420667767525,
0.08005322515964508,
-0.02781451866030693,
0.029734550043940544,
-0.001591377891600132,
-0.016735414043068886,
0.0017189476639032364,
-0.004259530454874039,
-0.0409952774643898,
0.013786176219582558,
-0.025133391842246056,
0.025306368246674538,
0.0289042666554451,
0.009539619088172913,
0.02831614762544632,
0.03348812460899353,
-0.03992282971739769,
-0.024251215159893036,
0.02390526421368122,
0.03618654981255531,
0.05223871022462845,
-0.10240171104669571,
-0.04189475253224373,
-0.031689178198575974,
0.041825562715530396,
0.04227529838681221,
0.07368771731853485,
0.040372565388679504,
0.044869937002658844,
-0.028541017323732376,
0.00746823288500309,
-0.003920065239071846,
0.09105449169874191,
-0.04147960990667343,
0.036255739629268646,
-0.031274035573005676,
0.012315881438553333,
0.016666224226355553,
0.047084029763936996,
-0.049540285021066666,
0.000036656016163760796,
0.044351011514663696,
-0.024960417300462723,
-0.048675406724214554,
-0.016043510288000107,
0.07119686156511307,
-0.0010729908244684339,
0.023109575733542442,
-0.03601357340812683,
-0.007801211439073086,
0.008856363594532013,
0.04424722492694855,
-0.00439358688890934,
-0.005716852378100157,
-0.01942518912255764,
0.023403633385896683,
0.008605549111962318,
-0.007022819947451353,
0.04002661257982254,
-0.054625775665044785,
-0.004095203708857298,
0.055905796587467194,
0.027157209813594818,
0.03065132163465023,
-0.008060675114393234,
-0.010395849123597145,
-0.00971259456127882,
0.0005146031617186964,
0.019892223179340363,
0.031118357554078102,
0.0033016768284142017,
0.06372430920600891,
0.03084159642457962,
0.0355292409658432,
-0.018179763108491898,
0.10772936791181564,
0.020912781357765198,
-0.04511210322380066,
-0.019650056958198547,
-0.0301669891923666,
-0.006737409625202417,
-0.017444616183638573,
-0.01102721132338047,
0.04742998257279396,
-0.07053955644369125,
0.023005789145827293,
0.00529738562181592,
0.022884706035256386,
-0.018698690459132195,
0.006469297222793102,
0.07860022783279419,
-0.0318448543548584,
0.014806733466684818,
0.028921563178300858,
0.005206573288887739,
-0.016259731724858284,
0.03622114658355713,
0.02861020714044571,
-0.041825562715530396,
0.043382346630096436,
-0.007407691329717636,
-0.027278292924165726,
0.0013978611677885056,
-0.016225134953856468,
-0.016666224226355553,
-0.044385604560375214,
-0.035373564809560776,
0.007675803732126951,
-0.0316372849047184,
0.058223675936460495,
-0.00932339858263731,
0.031101059168577194,
0.04237908497452736,
0.020082497969269753,
0.0576009601354599,
0.01843922585248947,
0.013448873534798622,
0.03224270045757294,
0.03521788492798805,
-0.006957953795790672,
0.00351573433727026,
-0.02188144624233246,
-0.005171978380531073,
-0.002248686272650957,
-0.017643537372350693,
0.08579602837562561,
-0.02722639963030815,
0.009920165874063969,
-0.0064909192733466625,
0.015438095666468143,
0.023282550275325775,
0.0037427651695907116,
-0.041548799723386765,
-0.05888098105788231,
0.009245559573173523,
0.048364050686359406,
0.012013173662126064,
-0.010490985587239265,
-0.021846851333975792,
0.04746457561850548,
0.03414543345570564,
-0.05396846681833267,
-0.05659770220518112,
-0.0935453474521637,
-0.04500832036137581,
-0.01951167732477188,
-0.033055685460567474,
0.0525500662624836,
-0.021621981635689735,
0.025358261540532112,
0.04068392142653465,
-0.036463312804698944,
0.08212893456220627,
-0.010439093224704266,
-0.05888098105788231,
0.07361852377653122,
-0.00858392659574747,
-0.04061473160982132,
0.015265119262039661,
0.006577407009899616,
-0.06078371778130531,
-0.027174508199095726,
-0.027555054053664207,
0.035079505294561386,
-0.027278292924165726,
-0.003853037254884839,
-0.009418535977602005,
0.012419667094945908,
0.01648459956049919,
-0.02752045914530754,
0.05455658584833145,
-0.04715321958065033,
0.06884439289569855,
0.058708008378744125,
0.006944980937987566,
-0.0008113649091683328,
-0.04978245124220848,
0.0630669966340065,
-0.01619919016957283,
-0.03843523561954498,
-0.012756969779729843,
0.00835473369807005,
-0.061925359070301056,
0.022037124261260033,
0.038988757878541946,
-0.00397628266364336,
0.04999002441763878,
-0.01835273951292038,
-0.005453064106404781,
0.03604817017912865,
0.0026140976697206497,
0.0031200521625578403,
-0.03974985331296921,
-0.03798549994826317,
0.020047903060913086,
0.010335307568311691,
0.0029838336631655693,
-0.05303439870476723,
0.02987293154001236,
0.013163463212549686,
-0.06500432640314102,
0.005128734279423952,
0.02655179426074028,
-0.07334176450967789,
-0.030997274443507195,
-0.017245693132281303,
-0.002665990497916937,
-0.019580867141485214,
0.033730290830135345,
0.05642472580075264,
-0.020151687785983086,
-0.054037660360336304,
-0.007269310299307108,
0.01758299581706524,
-0.059676673263311386,
-0.012609940022230148,
0.07313419133424759,
0.01659703440964222,
0.054418206214904785,
-0.02841993421316147,
-0.03760495036840439,
-0.0337475910782814,
-0.04061473160982132,
-0.013163463212549686,
0.04044175520539284,
-0.028160469606518745,
-0.0036800613161176443,
-0.004309261217713356,
-0.020618721842765808,
0.08503492921590805,
0.0131375165656209,
-0.033055685460567474,
-0.027693435549736023,
-0.009401237592101097,
0.03808928281068802,
-0.0028303174767643213,
-0.051892757415771484,
-0.03329785168170929,
-0.019961414858698845,
-0.0035935735795646906,
0.03464706614613533,
0.017885703593492508,
0.044869937002658844,
0.05175437778234482,
0.020428448915481567,
0.0355292409658432,
-0.004726565442979336,
-0.016372164711356163,
-0.07811589539051056,
-0.018888963386416435,
-0.003016266506165266,
-0.012843457981944084,
-0.017141908407211304,
-0.006992549169808626,
0.06254807114601135,
0.017332181334495544,
0.018785178661346436,
0.031689178198575974,
0.055871203541755676,
0.042136918753385544,
0.049055952578783035,
-0.045942388474941254,
0.02869669534265995,
-0.002053007250651717,
-0.016674872487783432,
0.049851641058921814,
-0.08026079833507538,
-0.06759896874427795,
-0.0030249152332544327,
-0.019459784030914307,
-0.003496274584904313,
-0.06714922934770584,
-0.022988492622971535,
0.048467837274074554,
-0.04694565013051033,
-0.0009800163097679615,
0.06234050169587135,
-0.029232921078801155,
-0.00928015448153019,
0.018923558294773102,
0.003130862955003977,
0.021552791818976402,
0.01132991909980774,
0.020445747300982475,
-0.011485597118735313,
-0.03601357340812683,
0.07984565943479538,
0.034110840409994125,
0.023490121588110924,
0.019667355343699455,
0.02605016529560089,
0.032087020576000214,
0.0231268722563982,
-0.013898610137403011,
0.020463043823838234,
-0.043866679072380066,
-0.00858392659574747,
0.017228394746780396,
-0.045042913407087326,
-0.017150556668639183,
0.0030119421426206827,
-0.017392722889780998,
-0.0008794741588644683,
0.05708203464746475,
0.040268778800964355,
0.013327790424227715,
0.005574147216975689,
0.016614330932497978,
0.030530238524079323,
0.011390460655093193,
-0.010534229688346386,
0.011018562130630016,
-0.036082763224840164,
0.07562504708766937,
0.0653848722577095,
0.002072467003017664,
-0.02157009020447731,
0.010992615483701229,
-0.010395849123597145,
-0.01726299151778221,
-0.010266116820275784,
0.00700552249327302,
0.10779855400323868,
-0.0021049000788480043,
0.034110840409994125,
-0.031775664538145065,
0.039092544466257095,
-0.00858392659574747,
-0.046426720917224884,
-0.051408424973487854,
-0.0003440598084125668,
-0.07617856562137604,
-0.06673408299684525,
-0.04044175520539284,
-0.03350542485713959,
-0.05199654400348663,
0.002343822969123721,
-0.004769809544086456,
-0.022763622924685478,
-0.009522320702672005,
-0.004333045333623886,
0.031689178198575974,
-0.0666303038597107,
-0.0414104200899601,
0.012263988144695759,
0.008294192142784595,
-0.05642472580075264,
-0.011113698594272137,
-0.025911783799529076,
-0.01612135022878647,
0.07479476183652878,
0.023576609790325165,
-0.10094871371984482,
-0.08717983216047287,
-0.04763755202293396,
-0.048952169716358185,
0.010568824596703053,
-0.0706433430314064,
0.0010843423660844564,
0.017444616183638573,
0.01640675961971283,
0.033436235040426254,
-0.008039053529500961,
-0.007528774440288544,
-0.041617993265390396,
-0.04839864373207092,
0.017107311636209488,
0.07583262026309967,
-0.03443949297070503,
0.007546071894466877,
-0.023369038477540016,
0.015844589099287987,
-0.021033864468336105,
-0.021898744627833366,
0.02089548297226429,
-0.021431708708405495,
-0.021033864468336105,
0.003377353772521019,
-0.021933339536190033,
0.016354868188500404,
-0.036567095667123795,
0.05372630059719086,
-0.04258665814995766,
-0.04725700616836548,
-0.026119355112314224,
-0.028143173083662987,
-0.05417603999376297,
0.003141673980280757,
0.049540285021066666,
-0.0061492919921875,
0.05279223248362541,
-0.000979475793428719,
0.03663628548383713,
0.042102325707674026,
-0.06123345345258713,
0.010932073928415775,
-0.015204577706754208,
0.03777792677283287,
0.028281552717089653,
0.031585391610860825,
0.04061473160982132,
-0.0716811940073967,
-0.016536492854356766,
-0.03601357340812683,
0.052377089858055115,
-0.01058612298220396,
-0.002724369755014777,
0.04044175520539284,
-0.049055952578783035,
-0.03757035732269287,
-0.0096174580976367,
0.015239173546433449,
0.007714723236858845,
-0.06922493875026703,
-0.026707472279667854,
-0.011459650471806526,
-0.001312454347498715,
0.045734819024801254,
-0.06071452796459198,
-0.0824057012796402,
0.03580600395798683,
-0.02352471649646759,
0.024752845987677574,
0.023645799607038498,
-0.0334189347922802,
0.05787772312760353,
0.01904464140534401,
-0.05421063303947449,
-0.06386268883943558,
0.04794890806078911,
0.035287074744701385,
-0.01669217087328434,
-0.040164995938539505,
0.010456390678882599,
-0.004240070935338736,
-0.060091812163591385,
0.0005494686192832887,
0.028869671747088432,
0.022434968501329422,
-0.004019526764750481,
0.04424722492694855,
-0.08365112543106079,
-0.011269377544522285,
-0.0058033401146531105,
0.004929812159389257,
0.004726565442979336,
-0.006992549169808626,
0.003811955451965332,
0.005565498489886522,
0.011451002210378647,
-0.051512211561203,
-0.05815448239445686,
-0.037812523543834686,
0.012938594445586205,
0.012506154365837574,
-0.015559178777039051,
-0.02461446449160576,
0.059019364416599274,
0.03398975729942322,
-0.009435833431780338,
-0.012592642568051815,
0.006330916658043861,
0.008064999245107174,
-0.010465039871633053,
-0.06676868349313736,
-0.007450934965163469,
-0.05895017459988594,
0.013699688017368317,
-0.03232918679714203,
-0.047983504831790924,
-0.01982303336262703,
0.03385137394070625,
0.02499501220881939,
0.03220810368657112,
-0.006270375102758408,
0.09043177962303162,
0.022867409512400627,
-0.04151420667767525,
-0.01542079821228981
]
|
36,610 | rfc3987 | compose | Returns an URI composed_ from named parts.
.. _composed: http://tools.ietf.org/html/rfc3986#section-5.3
| def compose(scheme=None, authority=None, path=None, query=None, fragment=None,
iauthority=None, ipath=None, iquery=None, ifragment=None, **kw):
"""Returns an URI composed_ from named parts.
.. _composed: http://tools.ietf.org/html/rfc3986#section-5.3
"""
_i2u(locals())
res = ''
if scheme is not None:
res += scheme + ':'
if authority is not None:
res += '//' + authority
res += path or ''
if query is not None:
res += '?' + query
if fragment is not None:
res += '#' + fragment
return res
| (scheme=None, authority=None, path=None, query=None, fragment=None, iauthority=None, ipath=None, iquery=None, ifragment=None, **kw) | [
-0.027060315012931824,
-0.0026863855309784412,
-0.031023696064949036,
-0.0377546064555645,
0.008276971988379955,
-0.02676989510655403,
0.03713959828019142,
-0.022567346692085266,
-0.024378200992941856,
-0.03307371959090233,
0.07482587546110153,
0.10291120409965515,
-0.04021463543176651,
0.03331288695335388,
0.013376406393945217,
0.004762034863233566,
0.006461846176534891,
-0.0020446854177862406,
-0.03444040194153786,
-0.02637697383761406,
0.016972489655017853,
-0.036763761192560196,
0.004044526256620884,
-0.03307371959090233,
0.025881551206111908,
0.007995093241333961,
0.013265362940728664,
-0.011873055249452591,
-0.005765692330896854,
-0.0006208796403370798,
0.05268561467528343,
-0.001130716293118894,
0.010813876055181026,
-0.04540802910923958,
0.04544219747185707,
0.025727801024913788,
0.00200411188416183,
0.06553243100643158,
0.09484777599573135,
-0.0168614462018013,
0.011292215436697006,
-0.004510052502155304,
-0.049405574798583984,
-0.004522865172475576,
0.01439287606626749,
0.03553374856710434,
0.00699570681899786,
0.024429451674222946,
0.0022721097338944674,
0.009720530360937119,
0.033586226403713226,
-0.04093214496970177,
0.0065173679031431675,
-0.023865696042776108,
-0.022926101461052895,
0.006551534868776798,
-0.003991140518337488,
0.07366419583559036,
-0.0011510030599310994,
0.01542642991989851,
-0.012462437152862549,
-0.037071265280246735,
0.02637697383761406,
0.03447457030415535,
-0.0304428543895483,
0.013897453434765339,
-0.0029511803295463324,
-0.03512374311685562,
-0.031843703240156174,
0.010608873330056667,
0.027367819100618362,
0.029759513214230537,
-0.022516096010804176,
-0.047492220997810364,
0.019646063446998596,
-0.018296463415026665,
0.017083533108234406,
0.037720441818237305,
0.025727801024913788,
0.020397737622261047,
-0.0211323294788599,
-0.06471242010593414,
-0.06888080388307571,
-0.040385469794273376,
0.028016993775963783,
-0.046125538647174835,
-0.018808970227837563,
-0.0725025162100792,
-0.00820009596645832,
0.019697312265634537,
-0.0038672846276313066,
0.0021151548717170954,
-0.014777256175875664,
0.03744710236787796,
0.03655875846743584,
-0.013282446190714836,
-0.03543124720454216,
0.030972445383667946,
0.05210477486252785,
-0.03997546806931496,
-0.012214725837111473,
0.012863900512456894,
-0.0900643840432167,
-0.003984733950346708,
0.012983485125005245,
0.019150640815496445,
0.05350562557578087,
-0.051353100687265396,
-0.011608260683715343,
-0.05828901380300522,
0.01621227338910103,
-0.013068902306258678,
-0.003997546620666981,
0.0100707421079278,
-0.051968105137348175,
0.003254412906244397,
0.035157911479473114,
-0.01786937564611435,
0.04110297933220863,
-0.008140303194522858,
-0.07004248350858688,
0.04311883822083473,
-0.004294373095035553,
0.02309693582355976,
-0.012488062493503094,
0.052412278950214386,
-0.05104559659957886,
-0.010651582852005959,
-0.021371498703956604,
-0.08159095048904419,
-0.00489443214610219,
0.018603967502713203,
-0.024224448949098587,
-0.022174425423145294,
-0.024634454399347305,
0.02099566161632538,
-0.05975819751620293,
0.01569976657629013,
-0.029007839038968086,
0.12716981768608093,
-0.0538472943007946,
-0.021046912297606468,
-0.054940640926361084,
0.0503280870616436,
-0.03679792955517769,
0.014802881516516209,
0.0785159170627594,
-0.053778961300849915,
-0.02969118021428585,
0.011334924027323723,
0.036012087017297745,
0.016716236248612404,
0.018535632640123367,
0.007653422653675079,
0.073459193110466,
-0.027009064331650734,
0.016143938526511192,
-0.026957813650369644,
-0.028375748544931412,
-0.036968763917684555,
0.02395111322402954,
0.015537473373115063,
-0.0009086303762160242,
-0.019406892359256744,
0.01605852134525776,
-0.0026116450317204,
0.09928949177265167,
-0.019714396446943283,
0.024839457124471664,
-0.014760171994566917,
-0.02133733220398426,
0.019851064309477806,
-0.0699741467833519,
0.01600727066397667,
-0.014333084225654602,
-0.029930349439382553,
-0.010233036242425442,
-0.023626524955034256,
-0.032475795596838,
-0.014435584656894207,
0.0008552443468943238,
-0.02389986254274845,
-0.00035982191911898553,
-0.020671075209975243,
0.007525295950472355,
-0.014666212722659111,
-0.013376406393945217,
0.007175083737820387,
0.09628278762102127,
-0.05596565455198288,
-0.03454290330410004,
0.031929124146699905,
-0.033295806497335434,
0.02384861186146736,
-0.008063427172601223,
-0.06358490884304047,
-0.007422795053571463,
-0.022686932235956192,
0.029383676126599312,
0.009541152976453304,
-0.01740811951458454,
-0.00582548463717103,
-0.021371498703956604,
0.03690043091773987,
0.03806211054325104,
-0.04082964360713959,
-0.03242454677820206,
-0.016237897798419,
-0.018347714096307755,
0.020397737622261047,
0.019355641677975655,
0.018057294189929962,
-0.0011189713841304183,
0.03970212861895561,
-0.023267772048711777,
0.013607033528387547,
-0.019013971090316772,
0.005539335310459137,
0.06724078208208084,
0.02682114578783512,
-0.01610977202653885,
-0.004164110869169235,
0.13680492341518402,
-0.007503941655158997,
-0.02948617748916149,
-0.04988391697406769,
0.045066360384225845,
-0.00913968961685896,
-0.010438038036227226,
-0.006039028987288475,
0.02149108424782753,
-0.08972271531820297,
-0.04574970155954361,
0.015742475166916847,
0.004582657478749752,
0.02430986613035202,
-0.0063038235530257225,
0.03628542274236679,
0.010677208192646503,
0.00858447514474392,
-0.011070129461586475,
0.028512416407465935,
-0.01807437837123871,
0.0014745224034413695,
-0.005325791426002979,
-0.033791229128837585,
0.011847429908812046,
-0.05432563275098801,
-0.023575274273753166,
-0.012368477880954742,
-0.05958736315369606,
0.057058997452259064,
-0.029076172038912773,
-0.008191553875803947,
-0.013521616347134113,
0.048688068985939026,
-0.08726268261671066,
-0.027367819100618362,
-0.020158568397164345,
-0.03085285983979702,
0.006056112237274647,
-0.030613690614700317,
0.02360944263637066,
0.04065880924463272,
0.02893950417637825,
-0.06679661571979523,
0.006564347539097071,
-0.027709489688277245,
-0.010950544849038124,
-0.01154846791177988,
-0.006624139845371246,
-0.0037626479752361774,
0.013803494162857533,
0.04667221009731293,
-0.014025580137968063,
0.0005979236448183656,
-0.005987778306007385,
0.028529498726129532,
0.0030045663006603718,
0.02948617748916149,
-0.017527705058455467,
0.01558018196374178,
-0.06826579570770264,
-0.08897104114294052,
0.04407551512122154,
0.04971307888627052,
0.002291328739374876,
0.02477112226188183,
-0.04838056489825249,
0.001782026025466621,
0.04872223362326622,
0.0003010972577612847,
-0.05425729975104332,
-0.023062769323587418,
-0.008063427172601223,
0.05668316036462784,
-0.02565946616232395,
-0.02099566161632538,
0.06423408538103104,
-0.01998773403465748,
-0.016331857070326805,
0.017749790102243423,
0.023489857092499733,
-0.012898067012429237,
0.005663190968334675,
-0.03918962553143501,
-0.04106881096959114,
0.006039028987288475,
-0.036114588379859924,
0.06888080388307571,
0.022977352142333984,
-0.06689911335706711,
-0.03642209246754646,
-0.028802836313843727,
0.04978141561150551,
0.02627447247505188,
0.03915545716881752,
-0.06361907720565796,
0.004198278300464153,
-0.011053045280277729,
0.014401418156921864,
-0.011505759321153164,
-0.056956496089696884,
0.010677208192646503,
-0.018142711371183395,
0.027094483375549316,
-0.04318717122077942,
0.04564720019698143,
0.008721143007278442,
0.015691224485635757,
-0.016178105026483536,
0.07708089798688889,
-0.0013645471772179008,
0.04448552057147026,
-0.03871128335595131,
-0.023267772048711777,
0.0498155802488327,
-0.02330193854868412,
-0.022686932235956192,
-0.021149413660168648,
0.003837388474494219,
0.0053727710619568825,
0.001029282808303833,
0.011873055249452591,
0.004638179205358028,
-0.019116472452878952,
-0.01722020097076893,
0.029605763033032417,
-0.00448015658184886,
-0.10441455245018005,
-0.06279906630516052,
-0.08487098664045334,
-0.029024921357631683,
0.004369113594293594,
0.023131102323532104,
0.1057128980755806,
-0.032441627234220505,
-0.05152393504977226,
0.040795475244522095,
0.015921851620078087,
0.11111129820346832,
-0.026684477925300598,
0.024531953036785126,
-0.024788206443190575,
0.032475795596838,
-0.021764419972896576,
0.040248803794384,
0.007542379666119814,
0.0003112406120635569,
-0.03010118380188942,
0.045476362109184265,
-0.019646063446998596,
0.03356914222240448,
-0.02244776114821434,
-0.024190282449126244,
-0.044212181121110916,
0.050054751336574554,
0.010207410901784897,
-0.010438038036227226,
-0.02878575213253498,
0.0053898547776043415,
0.04110297933220863,
0.045920535922050476,
-0.015306845307350159,
-0.012795565649867058,
0.0071622710675001144,
0.026564892381429672,
0.009720530360937119,
-0.030015766620635986,
0.0181256290525198,
-0.010378246195614338,
-0.02084190957248211,
0.04298216849565506,
-0.05200227349996567,
0.02048315480351448,
0.0007281855796463788,
0.06013403460383415,
-0.05248061195015907,
-0.053334787487983704,
0.015460597351193428,
0.0291957575827837,
-0.05576065182685852,
0.07373252511024475,
0.021559419110417366,
0.008089052513241768,
-0.027538655325770378,
0.04393884539604187,
0.045578863471746445,
0.00670528644695878,
-0.02285776659846306,
-0.02053440548479557,
-0.04636470600962639,
-0.040590472519397736,
-0.010335537604987621,
0.04684304818511009,
-0.02179858833551407,
0.044827189296483994,
-0.041137147694826126,
-0.015187260694801807,
0.056751497089862823,
-0.009746155701577663,
-0.01872355118393898,
-0.022789431735873222,
0.06597660481929779,
-0.03690043091773987,
0.01675894483923912,
-0.03075035847723484,
-0.023233603686094284,
0.05432563275098801,
-0.012248893268406391,
-0.015255594626069069,
-0.022123174741864204,
-0.03594375401735306,
0.009925532154738903,
0.010805333964526653,
0.005885276943445206,
0.015537473373115063,
0.05948486179113388,
0.04684304818511009,
-0.04848306626081467,
0.022311093285679817,
-0.009122606366872787,
0.013068902306258678,
-0.038369614630937576,
0.02552279829978943,
0.0057400669902563095,
-0.008460619486868382,
0.020568573847413063,
-0.02169608697295189,
0.052617281675338745,
0.07332251965999603,
-0.02702614851295948,
-0.012009723111987114,
0.022259842604398727,
0.007610713597387075,
-0.017083533108234406,
0.08487098664045334,
0.026650311425328255,
-0.002126899780705571,
0.02818782813847065,
0.03584125265479088,
0.010643040761351585,
0.042298827320337296,
-0.02934950962662697,
-0.019167723134160042,
0.013273905031383038,
0.0427771657705307,
-0.026735728606581688,
-0.03956546261906624,
0.006192780565470457,
-0.033449556678533554,
0.014982257969677448,
-0.010096367448568344,
0.0007954519824124873,
0.06771912425756454,
0.08616933971643448,
0.022259842604398727,
0.014401418156921864,
0.02244776114821434,
-0.0352262444794178,
-0.034747906029224396,
-0.011266590096056461,
-0.02782907523214817,
0.059109024703502655,
0.011300756596028805,
0.04721888527274132,
-0.03069910779595375,
0.05777650699019432,
0.007901133969426155,
-0.003301392775028944,
0.04052213951945305,
0.05148976668715477,
-0.02395111322402954,
0.01464912947267294,
0.03367164358496666,
0.03010118380188942,
-0.003087848424911499,
-0.017134783789515495,
-0.05582898482680321,
0.0021728118881583214,
0.0027034690137952566,
-0.023968195542693138,
0.075509212911129,
0.011334924027323723,
-0.0033227470703423023,
-0.024173198267817497,
-0.010984711349010468,
-0.011873055249452591,
0.013342238962650299,
-0.008447807282209396,
-0.04202549159526825,
-0.0845293179154396,
0.05087475851178169,
-0.04978141561150551,
-0.05975819751620293,
0.012829733081161976,
-0.013683909550309181,
-0.008866353891789913,
-0.009225107729434967,
-0.03362039104104042,
0.05012308433651924,
0.04065880924463272,
-0.010694291442632675,
0.06484909355640411,
-0.016921238973736763,
-0.01841604895889759,
0.018740635365247726,
0.008597288280725479,
0.01580226793885231,
-0.012650355696678162,
0.025881551206111908,
0.035602081567049026,
0.05439396947622299,
0.025334879755973816,
0.03375706076622009,
0.016562484204769135,
-0.03034035488963127,
-0.0689491406083107,
-0.028051160275936127,
-0.004025307483971119,
0.009865740314126015,
0.08541766554117203,
-0.012240351177752018,
-0.04414384812116623,
-0.016331857070326805,
0.00936177559196949,
0.012214725837111473,
0.006000590976327658,
0.0805659368634224,
-0.01766437292098999,
-0.028051160275936127,
0.01642581634223461,
-0.03683209791779518,
0.04158131778240204,
-0.007525295950472355,
0.00015521991008426994,
-0.008891978301107883,
-0.02883700281381607,
-0.0880826935172081,
-0.0032245167531073093,
0.006235489621758461,
-0.005714441649615765,
-0.052514780312776566,
0.049508076161146164,
-0.0151018425822258,
0.022174425423145294,
0.05391562730073929,
-0.0840509831905365,
0.006841954775154591,
-0.01815979555249214,
-0.012923692353069782,
0.0007046957034617662,
0.06679661571979523,
0.0000023231268642120995,
0.017450828105211258,
-0.0032202459406107664,
-0.008089052513241768,
-0.040043801069259644,
0.07967759668827057,
0.00251768552698195,
0.033842477947473526,
-0.004471614491194487,
-0.038130443543195724,
-0.046023037284612656,
0.030835775658488274,
-0.011591176502406597,
0.0006246166885830462,
0.020295236259698868,
-0.01532392855733633,
-0.07557754963636398,
0.014529544860124588,
-0.05439396947622299,
0.03165578469634056,
-0.016673527657985687,
0.004117131233215332,
-0.04072714224457741,
-0.05804984271526337,
-0.019919399172067642,
-0.010352620854973793,
-0.023114020004868507,
0.0015108248917385936,
-0.02193525619804859,
0.00298107648268342,
0.05152393504977226,
-0.049098074436187744,
-0.02547154761850834,
-0.0019443195778876543,
0.03010118380188942,
-0.01149721723049879,
-0.0004946216358803213,
0.06396074593067169,
0.004518594592809677,
-0.03075035847723484,
0.05668316036462784,
-0.0181256290525198,
-0.019201891496777534,
-0.014375792816281319,
0.028324497863650322,
-0.04561303183436394,
0.021764419972896576,
-0.03553374856710434,
-0.026496559381484985,
-0.05678566172719002,
0.0284269992262125,
-0.0000030947219329391373,
-0.009925532154738903,
0.01882605254650116,
-0.0021717441268265247,
-0.021303165704011917,
-0.029657011851668358,
0.03655875846743584,
0.004322133958339691,
-0.02511279284954071,
-0.01399141363799572,
-0.009823031723499298,
-0.05610232055187225,
0.06160321831703186,
0.06334573775529861,
-0.04499802365899086,
-0.0016805925406515598,
-0.052617281675338745,
0.0017905677668750286,
-0.04216215759515762,
-0.08022426813840866,
0.008866353891789913,
-0.027196984738111496,
0.030374521389603615,
-0.08862936496734619,
0.014025580137968063,
-0.024241533130407333,
0.00984011497348547,
0.021832754835486412,
0.04598886892199516,
-0.0007671574130654335,
0.008097594603896141,
0.06949581205844879,
0.05220727622509003,
-0.00908843893557787,
-0.0012844681041315198,
0.02299443446099758,
-0.0018332765903323889,
-0.031877871602773666,
0.10010950267314911,
0.030015766620635986,
-0.021115247160196304,
0.015605807304382324,
0.03543124720454216,
-0.028871169313788414,
-0.00563756562769413,
-0.02149108424782753,
-0.05476980656385422,
0.02834158018231392,
0.007969467900693417,
-0.025198210030794144,
-0.04786805808544159,
0.023370273411273956,
-0.019816897809505463,
-0.006841954775154591,
0.028700334951281548,
0.012197642587125301,
0.07434753328561783,
-0.040248803794384,
-0.018757719546556473,
-0.0035469685681164265,
0.05179727077484131,
-0.027863241732120514,
0.02314818650484085,
-0.01641727425158024,
0.017237285152077675,
-0.054735638201236725,
0.03413289785385132,
0.00978886429220438,
0.001890933490358293,
0.0014841319061815739,
0.01998773403465748,
0.0604073703289032,
-0.006017674226313829,
0.0032928509172052145,
0.04797055944800377,
0.00205215928144753,
0.0427771657705307,
0.018381880596280098,
0.03280038386583328,
-0.016442900523543358,
0.014948091469705105,
0.011189714074134827,
0.042401328682899475,
-0.02234526164829731,
0.001839682925492525,
0.027214067056775093,
-0.04626220464706421,
0.026564892381429672,
-0.00989136565476656,
0.015938935801386833,
0.07106749713420868,
-0.04322133585810661,
0.0038224405143409967,
0.06068070977926254,
-0.01628914847970009,
-0.007995093241333961,
0.08999604731798172,
-0.0147174634039402,
0.06888080388307571,
-0.06413158029317856,
0.02762407250702381,
-0.05391562730073929,
0.006397782824933529,
-0.016519775614142418,
0.05159226804971695,
-0.012573479674756527,
-0.022208591923117638,
0.03614875674247742,
0.03563624992966652,
0.06484909355640411,
0.04223049432039261,
-0.04359717667102814,
0.03850628435611725,
-0.05036225542426109,
-0.059211526066064835,
-0.0129578597843647,
-0.0016891342820599675,
-0.009489902295172215,
0.010104909539222717,
0.0176131222397089,
-0.013905995525419712,
-0.036012087017297745,
0.038984622806310654,
-0.06232072785496712,
-0.00913968961685896,
0.0387454517185688,
0.005556419026106596,
0.04342633858323097,
-0.012838275171816349,
-0.0027333651669323444,
0.01273577380925417,
-0.08418764919042587,
0.03211704269051552,
0.018535632640123367,
-0.051455602049827576,
-0.04465635493397713,
-0.023284854367375374,
0.023336105048656464,
0.06850496679544449,
-0.034611236304044724,
0.027060315012931824,
-0.021029828116297722,
0.0010645176516845822,
-0.022516096010804176
]
|
36,611 | rfc3987 | format_patterns | Returns a dict of patterns (regular expressions) keyed by
`rule names for URIs`_ and `rule names for IRIs`_.
See also the module level dicts of patterns, and `get_compiled_pattern`.
To wrap a rule in a named capture group, pass it as keyword argument:
rule_name='group_name'. By default, the formatted patterns contain no
named groups.
Patterns are `str` instances (be it in python 2.x or 3.x) containing ASCII
characters only.
Caveats:
- with re_, named capture groups cannot occur on multiple branches of an
alternation
- with re_ before python 3.3, ``\u`` and ``\U`` escapes must be
preprocessed (see `issue3665 <http://bugs.python.org/issue3665>`_)
- on narrow builds, character ranges beyond BMP are not supported
.. _rule names for URIs: http://tools.ietf.org/html/rfc3986#appendix-A
.. _rule names for IRIs: http://tools.ietf.org/html/rfc3987#section-2.2
| def format_patterns(**names):
r"""Returns a dict of patterns (regular expressions) keyed by
`rule names for URIs`_ and `rule names for IRIs`_.
See also the module level dicts of patterns, and `get_compiled_pattern`.
To wrap a rule in a named capture group, pass it as keyword argument:
rule_name='group_name'. By default, the formatted patterns contain no
named groups.
Patterns are `str` instances (be it in python 2.x or 3.x) containing ASCII
characters only.
Caveats:
- with re_, named capture groups cannot occur on multiple branches of an
alternation
- with re_ before python 3.3, ``\u`` and ``\U`` escapes must be
preprocessed (see `issue3665 <http://bugs.python.org/issue3665>`_)
- on narrow builds, character ranges beyond BMP are not supported
.. _rule names for URIs: http://tools.ietf.org/html/rfc3986#appendix-A
.. _rule names for IRIs: http://tools.ietf.org/html/rfc3987#section-2.2
"""
formatted = {}
for name, pat in _common_rules[::-1] + _uri_rules[::-1] + _iri_rules[::-1]:
if name in names:
n = names[name]
if callable(n):
pat = n(pat)
else:
pat = '(?P<%s>%s)' % (n, pat)
formatted[name] = pat.format(**formatted)
return formatted
| (**names) | [
-0.05012749508023262,
0.01620132476091385,
0.009726368822157383,
-0.08182412385940552,
-0.052877262234687805,
-0.02983867935836315,
-0.01316357683390379,
-0.016526466235518456,
0.019880065694451332,
-0.012216022238135338,
-0.014008943922817707,
0.07632458955049515,
0.040614791214466095,
0.04689466208219528,
0.026624426245689392,
-0.013367950916290283,
0.008170335553586483,
0.03022884950041771,
-0.06134951487183571,
-0.06369052827358246,
-0.03481798619031906,
-0.005174390971660614,
0.025026587769389153,
-0.04165524244308472,
0.028519535437226295,
0.07639890909194946,
0.003818087512627244,
-0.03466935083270073,
-0.05993746966123581,
0.03411196544766426,
0.011816563084721565,
0.013981075026094913,
0.037604909390211105,
0.014306215569376945,
0.02420908957719803,
-0.07182835042476654,
-0.02790641039609909,
0.025361020117998123,
-0.012132414616644382,
-0.016563626006245613,
0.030117372050881386,
0.031919583678245544,
-0.04407057538628578,
-0.021050574257969856,
-0.020474610850214958,
0.050907835364341736,
-0.031362198293209076,
0.032439809292554855,
-0.029745781794190407,
-0.05317453294992447,
0.009549863636493683,
-0.05284010246396065,
-0.012541163712739944,
0.0136838024482131,
-0.014603488147258759,
0.006247357465326786,
-0.03784644603729248,
0.0646195039153099,
0.023224376142024994,
-0.10315339267253876,
-0.003762349020689726,
0.017743423581123352,
0.04314160346984863,
-0.013934626244008541,
-0.05692759156227112,
-0.011463552713394165,
-0.02082762122154236,
-0.05354612320661545,
0.002322437707334757,
-0.02915123850107193,
0.023020002990961075,
-0.003834344679489732,
-0.006948733702301979,
-0.016461437568068504,
0.023558808490633965,
0.040466152131557465,
-0.012884884141385555,
0.02523096278309822,
0.0004848088719882071,
0.01314499694854021,
0.0038877606857568026,
-0.01386959757655859,
0.005782869644463062,
-0.03002447448670864,
0.04659738764166832,
-0.01190946064889431,
-0.018124302849173546,
0.03271850198507309,
0.0469689778983593,
-0.0408749021589756,
-0.030098792165517807,
-0.01921120472252369,
0.03819945454597473,
-0.00442888867110014,
-0.028835386037826538,
0.005620299372822046,
-0.0035881660878658295,
-0.021459324285387993,
0.07546993345022202,
-0.014269056729972363,
0.0088066840544343,
-0.04708045721054077,
-0.06744358688592911,
-0.042398422956466675,
-0.007227425929158926,
-0.052357032895088196,
0.0136838024482131,
-0.002150577260181308,
-0.042918648570775986,
-0.0026986724697053432,
0.006200908683240414,
-0.011528580449521542,
0.050573401153087616,
-0.02558397315442562,
0.05373191833496094,
0.016498597338795662,
-0.02149648219347,
-0.050759196281433105,
0.04031751677393913,
0.007571146823465824,
-0.0864318385720253,
0.04529682546854019,
-0.028482375666499138,
0.019489897415041924,
-0.031547993421554565,
0.014510590583086014,
-0.03803223744034767,
-0.013795279897749424,
0.09795112907886505,
0.025806928053498268,
0.006609657779335976,
0.057856567203998566,
-0.04407057538628578,
0.011965198442339897,
0.02201670967042446,
-0.019731430336833,
-0.02398613654077053,
-0.014919339679181576,
0.06186974048614502,
0.07446663826704025,
-0.010720372200012207,
-0.02915123850107193,
-0.028853965923190117,
-0.012336788699030876,
-0.014956498518586159,
-0.03197532147169113,
0.06829825043678284,
0.02859385311603546,
0.023001423105597496,
0.025286700576543808,
0.06699768453836441,
0.018783876672387123,
-0.004565912298858166,
0.043996259570121765,
0.06982176750898361,
0.0012343756388872862,
0.030860552564263344,
-0.01655433513224125,
-0.07550709694623947,
0.01749259978532791,
0.02539817802608013,
0.018310097977519035,
-0.04091206192970276,
-0.010497418232262135,
0.02734902687370777,
0.011314916424453259,
0.04942147433757782,
-0.028723908588290215,
0.040614791214466095,
-0.016173455864191055,
-0.015969080850481987,
-0.032960034906864166,
-0.04477659985423088,
-0.011333495378494263,
0.046337276697158813,
-0.03128787875175476,
-0.015114424750208855,
0.015105134807527065,
-0.06993324309587479,
0.0519111268222332,
0.059305768460035324,
-0.005244064144790173,
-0.02792499028146267,
-0.007886998355388641,
-0.00573642086237669,
-0.0180314052850008,
-0.01512371376156807,
0.0029820099007338285,
0.018245071172714233,
0.010534577071666718,
0.008328261785209179,
-0.015058686025440693,
-0.04604000598192215,
0.02257409319281578,
-0.011760824359953403,
-0.06829825043678284,
-0.020400293171405792,
-0.026215676218271255,
0.03518957644701004,
-0.013358661904931068,
-0.048975564539432526,
0.025342440232634544,
-0.04856681823730469,
0.020140180364251137,
0.05629589036107063,
-0.0436989888548851,
-0.0038715035188943148,
-0.008718430995941162,
0.017808452248573303,
0.04124649241566658,
-0.023930396884679794,
0.024933690205216408,
-0.049532949924468994,
-0.014436272904276848,
-0.02188665233552456,
0.056816115975379944,
0.023354433476924896,
0.1019643023610115,
-0.05885985866189003,
0.015486014075577259,
-0.061981216073036194,
0.015950500965118408,
0.026587266474962234,
-0.021217791363596916,
0.013953205198049545,
-0.03143651783466339,
0.02967146411538124,
0.03468792885541916,
-0.02168227732181549,
0.013925336301326752,
0.0629473477602005,
-0.04570557177066803,
0.010803979821503162,
0.07067642360925674,
0.032960034906864166,
-0.046151481568813324,
0.013126417994499207,
-0.01804998517036438,
0.018579501658678055,
0.07595299929380417,
0.007464314810931683,
0.046337276697158813,
-0.020010123029351234,
-0.022462617605924606,
0.04518534615635872,
-0.03793933987617493,
0.024469202384352684,
-0.021087734028697014,
-0.0029541407711803913,
-0.061052240431308746,
-0.020939098671078682,
0.03680599108338356,
0.005262643564492464,
0.015904054045677185,
-0.07914867252111435,
-0.006474956404417753,
-0.006818676833063364,
0.0049142781645059586,
0.01855163276195526,
-0.049347154796123505,
0.04462796077132225,
0.0601232647895813,
-0.01618274487555027,
-0.051093630492687225,
0.052542828023433685,
-0.02242545783519745,
0.02597414329648018,
0.0038482791278511286,
-0.07108516991138458,
-0.024301987141370773,
-0.0465230718255043,
0.0064192176796495914,
0.004335991106927395,
0.014083261601626873,
-0.02628999389708042,
0.010664633475244045,
0.051651012152433395,
0.037419114261865616,
0.0035301053430885077,
-0.039462860673666,
0.021756596863269806,
0.021199211478233337,
-0.052542828023433685,
-0.0002390659210504964,
0.08814115077257156,
0.04641159251332283,
-0.0027009949553757906,
0.03909127041697502,
-0.05878554284572601,
-0.008165691047906876,
0.05246851220726967,
-0.0465230718255043,
-0.035988494753837585,
-0.015355957671999931,
-0.04232410341501236,
0.0444050095975399,
0.04938431456685066,
-0.09274887293577194,
0.014612778089940548,
0.007803390733897686,
-0.04325307905673981,
0.05648168548941612,
0.11058519035577774,
0.024673577398061752,
-0.0565931610763073,
-0.025491075590252876,
-0.04213830828666687,
-0.02740476466715336,
-0.009294395335018635,
0.02420908957719803,
0.0034673993941396475,
-0.03446497395634651,
0.03964865580201149,
-0.01164934691041708,
0.018440155312418938,
0.021217791363596916,
-0.0054391492158174515,
0.011983778327703476,
0.049087043851614,
0.014575619250535965,
0.018709557130932808,
0.004946792032569647,
-0.03041464276611805,
-0.04303012415766716,
0.023373013362288475,
-0.01919262483716011,
0.0009069119114428759,
0.02562113292515278,
0.04176671802997589,
0.011537870392203331,
0.0051929703913629055,
-0.029559986665844917,
0.02326153591275215,
0.030619017779827118,
-0.04734056815505028,
0.03505951911211014,
0.02632715366780758,
-0.01680515892803669,
-0.046151481568813324,
-0.016842318698763847,
-0.011333495378494263,
0.040094565600156784,
-0.016480017453432083,
-0.034929461777210236,
-0.06343042105436325,
-0.008272523060441017,
-0.04358750954270363,
0.010794689878821373,
-0.03481798619031906,
-0.01836583763360977,
-0.030470382422208786,
-0.05648168548941612,
-0.025491075590252876,
0.02896544337272644,
-0.019248362630605698,
0.02082762122154236,
-0.033870432525873184,
-0.049161359667778015,
0.03799508139491081,
0.0024246249813586473,
0.055738504976034164,
0.04741488769650459,
0.017966378480196,
-0.016749421134591103,
0.012141704559326172,
0.0048446049913764,
0.052542828023433685,
0.052171241492033005,
0.04574273154139519,
-0.08539138734340668,
-0.017464730888605118,
0.054846689105033875,
0.05744781717658043,
0.0062241330742836,
-0.05116794630885124,
-0.00831897184252739,
0.08160117268562317,
0.0035672641824930906,
-0.019824327901005745,
-0.004524108488112688,
-0.01519803237169981,
0.06097792461514473,
0.03450213372707367,
0.014826442115008831,
0.013265764340758324,
-0.05354612320661545,
0.004923567641526461,
0.030860552564263344,
-0.024673577398061752,
0.04321591928601265,
-0.02506374754011631,
-0.016767999157309532,
0.002185413846746087,
-0.019118307158350945,
-0.025361020117998123,
-0.041841037571430206,
0.008704496547579765,
0.0135072972625494,
-0.07573004812002182,
-0.017186038196086884,
-0.012959201820194721,
-0.060717809945344925,
-0.041320811957120895,
-0.03039606474339962,
-0.006056917365640402,
0.020047282800078392,
0.08903297036886215,
0.033535998314619064,
0.016526466235518456,
-0.007162397727370262,
-0.010302333161234856,
-0.05231987684965134,
0.008430448360741138,
-0.078925721347332,
0.028556693345308304,
0.01334008201956749,
0.017000243067741394,
-0.04481375589966774,
-0.010553156957030296,
0.030544700101017952,
0.005313737317919731,
-0.04351319372653961,
0.010776110924780369,
0.03487372398376465,
0.04355034977197647,
-0.014213318936526775,
-0.01614558696746826,
0.013823148794472218,
-0.004997885785996914,
0.05670463666319847,
-0.04288148880004883,
0.012949912808835506,
0.016210615634918213,
-0.032978616654872894,
0.03691747039556503,
-0.024543521925807,
0.05648168548941612,
0.010237305425107479,
0.03728906065225601,
-0.05194828659296036,
0.030470382422208786,
-0.03931422531604767,
0.009433741681277752,
-0.0011281240731477737,
-0.051502376794815063,
-0.03890547528862953,
0.011036223731935024,
-0.038125135004520416,
-0.028835386037826538,
0.017901349812746048,
0.015105134807527065,
-0.007557212375104427,
0.007510763593018055,
-0.06268724054098129,
0.058042362332344055,
0.04195251315832138,
0.1005522608757019,
0.029114078730344772,
-0.014733544550836086,
-0.011240598745644093,
0.09453250467777252,
0.01935984008014202,
0.017325384542346,
0.06487961858510971,
-0.08323616534471512,
-0.009670630097389221,
0.020418871194124222,
0.00586183276027441,
-0.012067385949194431,
-0.006679330952465534,
-0.0105717359110713,
0.03964865580201149,
-0.01582973450422287,
0.02915123850107193,
-0.05317453294992447,
0.02755340002477169,
0.008890291675925255,
0.05243135243654251,
-0.033721793442964554,
-0.0021900588180869818,
-0.03834808990359306,
-0.06985892355442047,
-0.020418871194124222,
0.016154875978827477,
0.019508477300405502,
-0.03894263505935669,
0.021106313914060593,
0.0002889983297791332,
-0.018709557130932808,
0.020530348643660545,
0.027869252488017082,
-0.03678741306066513,
0.013154286891222,
0.06209269165992737,
0.025453917682170868,
0.006697910372167826,
-0.012949912808835506,
-0.03950002044439316,
-0.037066105753183365,
-0.012922042980790138,
0.01119414996355772,
-0.07387209683656693,
0.007687268778681755,
0.041135016828775406,
0.038496725261211395,
0.001704669208265841,
0.030619017779827118,
0.008936740458011627,
-0.01668439246714115,
-0.01555104274302721,
-0.02877964824438095,
-0.004524108488112688,
0.007259940262883902,
0.00032107700826600194,
0.004784221760928631,
-0.035616904497146606,
-0.0073342579416930676,
-0.027683457359671593,
-0.015467435121536255,
0.04250989854335785,
-0.008913516066968441,
0.016043398529291153,
0.003116711275652051,
0.01554175280034542,
-0.023707443848252296,
0.0018335644854232669,
0.047935113310813904,
0.022611252963542938,
0.00007090692815836519,
-0.041692402213811874,
0.06287303566932678,
0.06042053923010826,
0.029039761051535606,
-0.03578411787748337,
0.01993580535054207,
0.03505951911211014,
0.013470138423144817,
-0.021979549899697304,
-0.03660161793231964,
0.05674179643392563,
0.061052240431308746,
0.07599016278982162,
-0.014324795454740524,
-0.06807529181241989,
0.05098215118050575,
-0.015170162543654442,
0.025453917682170868,
-0.07810822129249573,
0.0338146910071373,
-0.05919429287314415,
-0.00867198221385479,
0.0053090923465788364,
-0.0059733097441494465,
0.03754917159676552,
-0.025138065218925476,
-0.015328088775277138,
0.02097625657916069,
-0.035096678882837296,
-0.0053973449394106865,
-0.013432979583740234,
-0.020864779129624367,
0.0008000797824934125,
-0.06398779898881912,
-0.03823661431670189,
-0.06369052827358246,
-0.001459652092307806,
0.03762349113821983,
0.030619017779827118,
-0.030990608036518097,
0.04938431456685066,
-0.04663454741239548,
-0.01075753103941679,
0.08650615811347961,
-0.014073972590267658,
-0.013154286891222,
-0.02363312616944313,
-0.011036223731935024,
-0.02313147857785225,
0.013674513436853886,
0.025472495704889297,
0.06008610874414444,
0.02420908957719803,
-0.031362198293209076,
-0.05596145614981651,
0.039202746003866196,
0.04139512777328491,
0.008913516066968441,
0.06205553561449051,
-0.004726160783320665,
-0.028853965923190117,
-0.003365212120115757,
-0.017706265673041344,
0.052728623151779175,
-0.03604423254728317,
-0.01458490826189518,
0.00048422825057059526,
0.005081493407487869,
0.013070679269731045,
-0.0056899720802903175,
0.0037553817965090275,
-0.039388541132211685,
-0.012216022238135338,
-0.015058686025440693,
-0.008030989207327366,
0.05027613043785095,
0.004858539439737797,
0.07134528458118439,
-0.01717674918472767,
-0.03691747039556503,
-0.0004174581845290959,
0.006670041009783745,
0.03537537157535553,
0.052617147564888,
-0.0065074702724814415,
0.017548339441418648,
0.002410690300166607,
-0.04247273877263069,
0.022982843220233917,
-0.04997885972261429,
-0.0014015911146998405,
-0.012689799070358276,
-0.009549863636493683,
-0.06146099045872688,
-0.028872545808553696,
0.037790704518556595,
0.015987660735845566,
-0.03216111660003662,
0.008509411476552486,
-0.05570134520530701,
-0.05759645253419876,
-0.020511768758296967,
0.04644875228404999,
-0.02277846820652485,
-0.02952282689511776,
-0.015885474160313606,
0.009531283751130104,
0.02367028407752514,
0.03043322265148163,
-0.03435349836945534,
0.001395785016939044,
0.0037646715063601732,
-0.0704534724354744,
0.010841138660907745,
-0.009494124911725521,
-0.01645214855670929,
0.04715477302670479,
0.03998308628797531,
-0.07981754094362259,
-0.004491594620049,
-0.016136296093463898,
0.012569032609462738,
0.04752636328339577,
-0.05228271707892418,
0.01690734550356865,
0.008490832522511482,
0.10359930247068405,
-0.037753548473119736,
-0.04002024605870247,
0.006247357465326786,
-0.03178952634334564,
0.0009347811574116349,
0.002610419876873493,
0.01022801548242569,
0.0122717609629035,
-0.047043297439813614,
0.045408301055431366,
0.017390413209795952,
0.05035044997930527,
-0.0030122017487883568,
0.018310097977519035,
-0.018077854067087173,
0.01858879067003727,
0.06684904545545578,
0.017455441877245903,
0.017808452248573303,
0.07833117991685867,
0.00603833794593811,
0.030674757435917854,
-0.0025291345082223415,
-0.0032096088398247957,
-0.002791570033878088,
-0.052728623151779175,
0.003537072567269206,
0.018189331516623497,
0.02628999389708042,
0.04340171441435814,
-0.007900932803750038,
-0.005480953026562929,
0.006205553654581308,
0.035096678882837296,
0.05313737317919731,
0.013525877147912979,
0.021626539528369904,
-0.012429686263203621,
0.011240598745644093,
0.05276578292250633,
0.000056065095122903585,
-0.000032985873986035585,
0.026048460975289345,
-0.01991722546517849,
-0.021050574257969856,
-0.011993068270385265,
0.006094076205044985,
-0.05469805374741554,
-0.014176159165799618,
0.010701792314648628,
-0.006247357465326786,
0.003564941929653287,
0.013609484769403934,
0.010450969450175762,
-0.08011481165885925,
0.027590559795498848,
0.009229367598891258,
0.0025802282616496086,
-0.04340171441435814,
-0.08583729714155197,
0.04867829382419586,
0.002345662098377943,
0.061238035559654236,
-0.010274464264512062,
0.07877708226442337,
0.038831159472465515,
0.005727131385356188,
-0.04674602672457695,
-0.054475098848342896,
-0.037790704518556595,
-0.03039606474339962,
-0.03450213372707367,
-0.031046345829963684,
-0.03268134221434593,
0.02792499028146267,
0.09646476805210114,
-0.04678318277001381,
0.033313047140836716,
-0.0011298658791929483,
-0.004988596308976412,
0.02027023583650589,
-0.0864318385720253,
-0.019229784607887268,
0.03702894598245621,
0.010711082257330418,
0.0136838024482131,
-0.039722975343465805,
0.016340671107172966,
0.005792159587144852,
-0.0018533052643761039,
0.024320567026734352,
0.0033373429905623198,
-0.04659738764166832,
0.030284587293863297,
-0.014872890897095203,
0.01003293041139841,
-0.04217546805739403,
-0.02097625657916069,
0.004519463516771793,
-0.03842240944504738,
0.0324026495218277,
0.031027767807245255,
-0.02504516765475273,
0.03392617031931877,
-0.00932690966874361,
0.05328600853681564,
0.04797227308154106,
0.013033520430326462,
-0.03271850198507309,
-0.041543763130903244,
0.015560332685709,
-0.012476135045289993
]
|
36,612 | rfc3987 | get_compiled_pattern | Returns a compiled pattern object for a rule name or template string.
Usage for validation::
>>> uri = get_compiled_pattern('^%(URI)s$')
>>> assert uri.match('http://tools.ietf.org/html/rfc3986#appendix-A')
>>> assert not get_compiled_pattern('^%(relative_ref)s$').match('#f#g')
>>> from unicodedata import lookup
>>> smp = 'urn:' + lookup('OLD ITALIC LETTER A') # U+00010300
>>> assert not uri.match(smp)
>>> m = get_compiled_pattern('^%(IRI)s$').match(smp)
On narrow builds, non-BMP characters are (incorrectly) excluded::
>>> assert NARROW_BUILD == (not m)
For parsing, some subcomponents are captured in named groups (*only if*
regex_ is available, otherwise see `parse`)::
>>> match = uri.match('http://tools.ietf.org/html/rfc3986#appendix-A')
>>> d = match.groupdict()
>>> if REGEX:
... assert all([ d['scheme'] == 'http',
... d['authority'] == 'tools.ietf.org',
... d['path'] == '/html/rfc3986',
... d['query'] == None,
... d['fragment'] == 'appendix-A' ])
>>> for r in patterns.keys():
... assert get_compiled_pattern(r)
| def get_compiled_pattern(rule, flags=0):
"""Returns a compiled pattern object for a rule name or template string.
Usage for validation::
>>> uri = get_compiled_pattern('^%(URI)s$')
>>> assert uri.match('http://tools.ietf.org/html/rfc3986#appendix-A')
>>> assert not get_compiled_pattern('^%(relative_ref)s$').match('#f#g')
>>> from unicodedata import lookup
>>> smp = 'urn:' + lookup('OLD ITALIC LETTER A') # U+00010300
>>> assert not uri.match(smp)
>>> m = get_compiled_pattern('^%(IRI)s$').match(smp)
On narrow builds, non-BMP characters are (incorrectly) excluded::
>>> assert NARROW_BUILD == (not m)
For parsing, some subcomponents are captured in named groups (*only if*
regex_ is available, otherwise see `parse`)::
>>> match = uri.match('http://tools.ietf.org/html/rfc3986#appendix-A')
>>> d = match.groupdict()
>>> if REGEX:
... assert all([ d['scheme'] == 'http',
... d['authority'] == 'tools.ietf.org',
... d['path'] == '/html/rfc3986',
... d['query'] == None,
... d['fragment'] == 'appendix-A' ])
>>> for r in patterns.keys():
... assert get_compiled_pattern(r)
"""
cache, key = get_compiled_pattern.cache, (rule, flags)
if key not in cache:
if NARROW_BUILD:
pats = bmp_patterns if REGEX else bmp_upatterns_no_names
else:
pats = patterns if REGEX else upatterns_no_names
p = pats.get(rule) or rule % pats
cache[key] = _re.compile(p, flags)
return cache[key]
| (rule, flags=0) | [
0.041202884167432785,
0.023267975077033043,
-0.02017677202820778,
-0.0365808941423893,
0.008424271829426289,
-0.050841908901929855,
0.05451580137014389,
-0.010774771682918072,
0.02472963184118271,
-0.05763663351535797,
0.025243185460567474,
0.10958465933799744,
-0.03444766625761986,
0.021213756874203682,
0.028245504945516586,
-0.024946903809905052,
0.023564256727695465,
0.04886670038104057,
-0.046772975474596024,
0.017707759514451027,
-0.029845425859093666,
0.0632462278008461,
0.03974122926592827,
0.057281095534563065,
0.019702721387147903,
0.04179544746875763,
0.024591367691755295,
-0.051750507205724716,
0.0188632570207119,
-0.00750579871237278,
0.02461111918091774,
0.004239294677972794,
-0.01841883547604084,
-0.004283736925572157,
-0.020127391442656517,
-0.03665990009903908,
-0.006537945941090584,
0.04689148813486099,
-0.04207197576761246,
-0.05099992826581001,
0.04199296981096268,
0.004066464025527239,
0.01571279764175415,
-0.028206001967191696,
-0.0045232311822474,
-0.012759857811033726,
-0.0013591914903372526,
-0.02346549741923809,
-0.042309001088142395,
-0.060480937361717224,
0.04298057407140732,
-0.02293219044804573,
0.032669976353645325,
-0.028067735955119133,
0.008088485337793827,
0.031899645924568176,
-0.07126558572053909,
0.08777833729982376,
0.05131595954298973,
-0.0018418835243210196,
-0.0325712151825428,
-0.007525550667196512,
-0.03946470096707344,
0.017292965203523636,
-0.045469339936971664,
-0.035415519028902054,
-0.037924036383628845,
-0.07628262042999268,
0.01517949067056179,
-0.014794324524700642,
-0.04084734618663788,
0.007905778475105762,
0.018112678080797195,
-0.03318352997303009,
0.01923854649066925,
-0.03662039712071419,
-0.007466294337064028,
-0.05645150691270828,
0.03970172628760338,
0.00869586318731308,
-0.005693543236702681,
0.001840648939833045,
0.002039404585957527,
-0.06233763322234154,
0.06466837972402573,
-0.0046861860901117325,
-0.0024492605589330196,
-0.02145078219473362,
-0.006918173748999834,
-0.017204081639647484,
-0.026645585894584656,
-0.024097563698887825,
0.01187101285904646,
0.023485248908400536,
-0.003577599534764886,
0.010369853116571903,
0.041084371507167816,
0.033736590296030045,
0.025499964132905006,
-0.02312971092760563,
0.07245071232318878,
0.016868295148015022,
-0.09496810287237167,
-0.023366736248135567,
0.023722274228930473,
0.05672803521156311,
0.012740105390548706,
-0.008735367096960545,
-0.02579624578356743,
-0.032097164541482925,
0.021687807515263557,
-0.004520762246102095,
0.00597007293254137,
-0.014814076013863087,
0.03622535616159439,
0.014833828434348106,
-0.10429109632968903,
-0.032097164541482925,
-0.007698381785303354,
0.004876300226897001,
-0.020601442083716393,
0.045350827276706696,
-0.05901927873492241,
0.001304873265326023,
0.030536750331521034,
-0.02137177437543869,
-0.011653739959001541,
-0.02358401007950306,
0.06755218654870987,
-0.00029890486621297896,
0.0001446687092538923,
0.06482639908790588,
-0.032966259866952896,
0.013777091167867184,
-0.05467381700873375,
0.0053034392185509205,
0.020561937242746353,
-0.003950420301407576,
-0.03523774817585945,
0.053093649446964264,
0.004619522951543331,
0.04195346310734749,
0.013026511296629906,
-0.030497245490550995,
0.011594483628869057,
-0.04400768131017685,
0.06636705994606018,
0.0590587854385376,
0.028699804097414017,
0.021114997565746307,
0.045390330255031586,
-0.0712260827422142,
0.027257900685071945,
0.03989924490451813,
0.06423383206129074,
-0.0030862658750265837,
0.03442791476845741,
0.023208720609545708,
-0.07636162638664246,
-0.05984886735677719,
0.024255581200122833,
0.035297006368637085,
-0.10760945081710815,
-0.06103399395942688,
0.08272179961204529,
0.031247824430465698,
0.047563061118125916,
-0.013836347497999668,
-0.0071107568219304085,
-0.02342599257826805,
-0.08422296494245529,
-0.011150061152875423,
-0.05542439967393875,
0.055266380310058594,
0.026546824723482132,
0.03725246340036392,
-0.024808639660477638,
0.04732603579759598,
0.0004320772422943264,
0.0415189191699028,
0.022537147626280785,
0.03776601701974869,
-0.0392276756465435,
0.003012195462360978,
0.0028961519710719585,
0.04400768131017685,
0.010340224951505661,
0.0012814175570383668,
0.04515330493450165,
-0.013421553187072277,
-0.025124672800302505,
0.006750280968844891,
-0.012414195574820042,
0.004898521117866039,
-0.07517649978399277,
-0.04704950749874115,
-0.02202359400689602,
0.010369853116571903,
-0.004515824373811483,
0.03428965061903,
-0.05044686794281006,
0.04143990948796272,
-0.01187101285904646,
0.045508842915296555,
-0.017490485683083534,
-0.035790808498859406,
-0.012256179004907608,
-0.005244182888418436,
-0.0038788190577179193,
0.07410988956689835,
0.036699406802654266,
-0.0137178348377347,
0.027178892865777016,
0.04606190323829651,
-0.011969774030148983,
-0.008073671720921993,
-0.042150985449552536,
0.0834328755736351,
-0.05459481105208397,
0.016413995996117592,
-0.027909720316529274,
-0.006463875528424978,
0.00853290781378746,
0.030833030119538307,
-0.014389405958354473,
-0.04278305172920227,
0.04791859909892082,
0.027178892865777016,
-0.05842671915888786,
-0.04072883352637291,
0.03989924490451813,
-0.06885582953691483,
0.09765439480543137,
0.023722274228930473,
0.08062808215618134,
-0.024058060720562935,
0.04068933054804802,
0.03401311859488487,
0.013826471753418446,
-0.029312118887901306,
-0.025697484612464905,
0.012779610231518745,
0.014142504893243313,
0.029470136389136314,
0.035909321159124374,
0.061626557260751724,
0.015584408305585384,
-0.0027331970632076263,
-0.014014116488397121,
-0.027751702815294266,
-0.028719555586576462,
0.03261072188615799,
0.006305858492851257,
0.00505653815343976,
-0.04732603579759598,
-0.05017033964395523,
-0.017460858449339867,
-0.02982567436993122,
0.03585006669163704,
0.03170212358236313,
0.014537546783685684,
0.0037973416037857533,
0.045390330255031586,
-0.02202359400689602,
0.03442791476845741,
-0.04483726993203163,
-0.011633987538516521,
0.02846277877688408,
-0.04080784320831299,
0.005866374354809523,
-0.043533630669116974,
-0.013233908452093601,
0.028364017605781555,
0.03831907734274864,
-0.07387286424636841,
-0.032511960715055466,
-0.008547722361981869,
0.07375434786081314,
0.05115794390439987,
-0.024887647479772568,
-0.003145522205159068,
0.00916991289705038,
-0.02170756086707115,
-0.056214481592178345,
-0.021747063845396042,
-0.003022071672603488,
-0.011150061152875423,
0.01369808241724968,
-0.01062663085758686,
0.04890620335936546,
0.02374202571809292,
-0.05131595954298973,
-0.015811556950211525,
-0.022379131987690926,
0.004017083905637264,
0.043375615030527115,
0.026566576212644577,
-0.10192084312438965,
0.04258553311228752,
-0.005555278621613979,
-0.03162311390042305,
0.011219194158911705,
0.07126558572053909,
0.03901040181517601,
-0.047681573778390884,
0.057281095534563065,
-0.07280624657869339,
-0.02719864435493946,
-0.00711569469422102,
0.03346006199717522,
0.03442791476845741,
-0.06075746566057205,
-0.0035479713696986437,
0.021845825016498566,
0.007051500491797924,
-0.001957927132025361,
0.003535626223310828,
-0.028699804097414017,
0.033697087317705154,
0.015930069610476494,
0.005757737904787064,
0.03211691603064537,
0.014191885478794575,
-0.009861236438155174,
0.004863955080509186,
-0.027257900685071945,
-0.0011042659170925617,
-0.010063695721328259,
0.03519824519753456,
0.0017505299765616655,
0.01591031812131405,
-0.03132683411240578,
0.022043345496058464,
0.09006958454847336,
-0.021213756874203682,
0.027672694995999336,
0.03482295572757721,
-0.0567675419151783,
-0.01989036612212658,
-0.028897324576973915,
0.11448318511247635,
0.023781530559062958,
-0.07711220532655716,
-0.009234108030796051,
0.01097229216247797,
-0.04369165003299713,
-0.030833030119538307,
0.022537147626280785,
-0.0022023592609912157,
-0.0780998095870018,
0.015001721680164337,
-0.0956001728773117,
-0.04274354875087738,
0.03642287477850914,
0.041321396827697754,
0.01550539955496788,
-0.005362695548683405,
-0.0209569800645113,
0.059335313737392426,
-0.009140284731984138,
0.013757338747382164,
0.025203682482242584,
-0.04373115301132202,
-0.061310525983572006,
0.023070454597473145,
-0.03134658560156822,
0.023801282048225403,
0.01788552850484848,
0.035790808498859406,
-0.07715170830488205,
0.00984148494899273,
0.0655374750494957,
0.043454624712467194,
-0.0609549880027771,
-0.029707161709666252,
-0.08185271173715591,
0.013816595077514648,
0.0036640148609876633,
-0.0525800958275795,
0.014409158378839493,
-0.011031548492610455,
0.05597745627164841,
0.011387086473405361,
-0.029470136389136314,
0.00393807515501976,
-0.028028232976794243,
-0.03253171220421791,
0.05704407021403313,
0.014014116488397121,
0.026862857863307,
-0.03614634647965431,
0.00996987335383892,
0.03766725957393646,
-0.07584807276725769,
-0.013362296856939793,
0.012759857811033726,
0.04270404577255249,
0.05242208018898964,
-0.07802080363035202,
-0.0025998703204095364,
0.016660897061228752,
-0.027376413345336914,
-0.001902374322526157,
0.024907400831580162,
-0.0003064662159886211,
0.009836547076702118,
0.0861191675066948,
0.04011651873588562,
-0.02842327393591404,
-0.041084371507167816,
-0.033045265823602676,
-0.06012539938092232,
0.0036985811311751604,
-0.09164975583553314,
-0.010834028013050556,
-0.049696289002895355,
0.04043255373835564,
-0.03051699697971344,
-0.0008086016750894487,
-0.00026233261451125145,
-0.004384966567158699,
-0.050723396241664886,
0.01969284564256668,
0.02301119826734066,
-0.02796897664666176,
-0.0026838169433176517,
0.01775714010000229,
-0.006572511978447437,
-0.004412125796079636,
0.05657001957297325,
-0.07395187020301819,
-0.03381559997797012,
-0.015465895645320415,
-0.011229069903492928,
0.00658238772302866,
-0.03569204732775688,
0.017628751695156097,
0.01783614791929722,
0.013293164782226086,
0.01230555959045887,
-0.007397162262350321,
0.024828391149640083,
0.01076489593833685,
0.042388010770082474,
-0.046575456857681274,
0.005999701097607613,
-0.012147543020546436,
0.012433947995305061,
-0.006681148428469896,
-0.018478091806173325,
0.039800483733415604,
0.034763697534799576,
0.009550141170620918,
-0.018754620105028152,
0.010162455961108208,
-0.021845825016498566,
-0.009550141170620918,
0.018438586965203285,
-0.04906422272324562,
0.016641145572066307,
0.03336130082607269,
0.029094846919178963,
0.055108364671468735,
-0.005807118024677038,
-0.09125471115112305,
-0.012088286690413952,
0.04886670038104057,
0.03885238617658615,
-0.025124672800302505,
-0.02137177437543869,
-0.012424072250723839,
-0.016226351261138916,
-0.03642287477850914,
-0.021510038524866104,
0.005619472824037075,
0.04278305172920227,
-0.02312971092760563,
0.004938025493174791,
-0.021114997565746307,
0.015228870324790478,
-0.02103598788380623,
-0.02366301789879799,
-0.0031060180626809597,
0.06202159821987152,
0.000896868878044188,
-0.03280824050307274,
0.014883209019899368,
0.0137178348377347,
-0.05123695358633995,
-0.007081128656864166,
-0.04274354875087738,
0.019712597131729126,
-0.008967454545199871,
0.015801681205630302,
0.0030591068789362907,
0.0419139601290226,
-0.023524753749370575,
0.011831508949398994,
0.016957178711891174,
-0.01935705915093422,
0.03211691603064537,
-0.0884104073047638,
0.009303240105509758,
0.005397262051701546,
0.015436267480254173,
-0.015357259660959244,
0.018448462709784508,
-0.002570242155343294,
0.009500760585069656,
-0.017776891589164734,
0.0037948726676404476,
0.012522832490503788,
-0.004056587815284729,
0.024314837530255318,
0.017707759514451027,
0.048629675060510635,
0.0090464623644948,
-0.06415482610464096,
-0.08501304686069489,
0.014675811864435673,
0.03342055529356003,
0.019663216546177864,
0.04475826397538185,
-0.028166497126221657,
0.028601042926311493,
0.050881415605545044,
0.020285408943891525,
0.0037257401272654533,
0.028897324576973915,
-0.02658632956445217,
0.050683893263339996,
-0.01542639173567295,
0.001294997171498835,
0.046456944197416306,
0.048590172082185745,
-0.01961383782327175,
0.021608799695968628,
-0.052027035504579544,
-0.044402725994586945,
0.03336130082607269,
0.03047749400138855,
0.03458593040704727,
0.05242208018898964,
-0.04254602640867233,
0.008592164143919945,
0.018399082124233246,
-0.021095244213938713,
-0.02091747522354126,
-0.026388807222247124,
-0.05250108614563942,
-0.04578537121415138,
0.004318303428590298,
-0.029233111068606377,
-0.003192433388903737,
-0.00955507904291153,
0.026685088872909546,
0.019702721387147903,
0.035632792860269547,
-0.004036835860460997,
-0.008034167811274529,
-0.0034664939157664776,
-0.019268175587058067,
-0.050802405923604965,
0.01801391690969467,
-0.06107350066304207,
-0.02005825936794281,
0.020897723734378815,
0.01598932594060898,
-0.023722274228930473,
-0.00009173925354843959,
-0.026941867545247078,
0.025085169821977615,
0.05953283607959747,
-0.07193715870380402,
-0.0012925281189382076,
0.0038738809525966644,
-0.052975136786699295,
-0.004182507749646902,
0.03879312798380852,
0.0057132956571877,
0.043296609073877335,
-0.03885238617658615,
0.008108237758278847,
-0.012888246215879917,
0.0007758872234262526,
-0.0039602965116500854,
0.009120533242821693,
0.070870541036129,
-0.00943656638264656,
-0.045390330255031586,
0.03150460124015808,
0.016957178711891174,
0.03786477819085121,
-0.018033668398857117,
0.012117914855480194,
0.03284774720668793,
-0.018112678080797195,
0.033894605934619904,
-0.011584607884287834,
0.01316477544605732,
-0.024966657161712646,
0.008681048639118671,
0.019455820322036743,
0.0015122703043743968,
0.03138608857989311,
-0.03367733210325241,
0.02239888347685337,
-0.02034466527402401,
0.01845833845436573,
0.006473751273006201,
0.005629349034279585,
-0.001351784449070692,
0.01697693206369877,
-0.0319984033703804,
0.02087797224521637,
0.01331291627138853,
-0.028047984465956688,
0.006903359666466713,
-0.064786896109581,
-0.05996738001704216,
0.010695762932300568,
0.06565598398447037,
0.011703120544552803,
-0.021806320175528526,
0.06000688672065735,
0.04029428958892822,
0.00021156352886464447,
-0.014932588674128056,
-0.053093649446964264,
-0.022240865975618362,
0.015307879075407982,
0.03711419925093651,
-0.0030196025036275387,
-0.023979051038622856,
-0.009214355610311031,
0.010982168838381767,
0.022122353315353394,
0.013520313426852226,
-0.033578574657440186,
0.04467925429344177,
-0.028640547767281532,
-0.07877138257026672,
-0.0061182137578725815,
-0.006236725952476263,
-0.04424470663070679,
-0.013786966912448406,
0.03126757591962814,
-0.08023303747177124,
0.04669396951794624,
-0.020068135112524033,
-0.0003228234127163887,
0.0521850548684597,
0.0073823481798172,
0.017658378928899765,
0.04167693480849266,
0.07592707872390747,
0.007377409841865301,
-0.022142106667160988,
0.026013517752289772,
-0.01754974201321602,
-0.030181212350726128,
-0.034348905086517334,
0.026013517752289772,
-0.035948824137449265,
-0.060559943318367004,
0.02453211136162281,
0.06411532312631607,
0.015485648065805435,
0.0015048632631078362,
0.03671915829181671,
-0.060559943318367004,
0.00348624587059021,
0.006656458135694265,
-0.02658632956445217,
0.02551971562206745,
0.020127391442656517,
-0.016315236687660217,
-0.00014081088011153042,
-0.020068135112524033,
0.01801391690969467,
0.027178892865777016,
-0.022122353315353394,
0.034190889447927475,
0.00011781819921452552,
-0.00011966995953116566,
0.05850572511553764,
0.04424470663070679,
-0.005619472824037075,
0.05574043095111847,
-0.006567573640495539,
-0.009880988858640194,
0.03178113326430321,
0.07205566763877869,
-0.020976731553673744,
-0.015772053971886635,
0.048629675060510635,
-0.004614584613591433,
0.06079696863889694,
0.06265366822481155,
-0.047405045479536057,
-0.017688008025288582,
-0.0002850166638381779,
0.02739616483449936,
-0.04140040650963783,
-0.02354450523853302,
0.0360080823302269,
-0.00750579871237278,
-0.031939148902893066,
-0.06727565824985504,
0.008276131004095078,
-0.036363620311021805,
0.03306501731276512,
0.029154103249311447,
-0.01472519151866436,
-0.035297006368637085,
-0.11519426107406616,
-0.04155842214822769,
0.05645150691270828,
0.006745342630892992,
0.023208720609545708,
0.032511960715055466,
-0.01718432828783989,
0.047563061118125916,
-0.027672694995999336,
0.0068687936291098595,
0.006241664290428162,
-0.0735568255186081,
-0.04819512739777565,
-0.005049130879342556,
-0.012582088820636272,
0.011041425168514252,
0.08216874301433563,
0.003592413617298007,
0.028443027287721634,
0.01023158896714449,
-0.018843505531549454,
-0.006177470088005066,
-0.0830378383398056,
0.0053281295113265514,
0.02129276655614376,
-0.016502881422638893,
0.04313858970999718,
-0.038694366812705994,
0.032176174223423004,
0.008113175630569458,
0.04361264035105705,
-0.015060978010296822,
0.009322992525994778,
-0.03458593040704727,
0.0005620090523734689,
-0.016967056319117546,
-0.01735222153365612,
-0.026013517752289772,
0.0070465621538460255,
-0.009930369444191456,
-0.034348905086517334,
0.02522343397140503,
-0.006345362868160009,
-0.017490485683083534,
0.009357558563351631,
-0.04179544746875763,
-0.022142106667160988,
-0.017915155738592148,
0.018724992871284485,
0.010834028013050556,
-0.027830710634589195,
0.0013542535016313195,
-0.02826525829732418
]
|
36,613 | rfc3987 | match | Convenience function for checking if `string` matches a specific rule.
Returns a match object or None::
>>> assert match('%C7X', 'pct_encoded') is None
>>> assert match('%C7', 'pct_encoded')
>>> assert match('%c7', 'pct_encoded')
| def match(string, rule='IRI_reference'):
"""Convenience function for checking if `string` matches a specific rule.
Returns a match object or None::
>>> assert match('%C7X', 'pct_encoded') is None
>>> assert match('%C7', 'pct_encoded')
>>> assert match('%c7', 'pct_encoded')
"""
return get_compiled_pattern('^%%(%s)s$' % rule).match(string)
| (string, rule='IRI_reference') | [
0.01716269552707672,
0.013569655828177929,
-0.002523791743442416,
0.028178922832012177,
-0.0031644292175769806,
-0.044940363615751266,
0.02952859178185463,
-0.010067809373140335,
0.028671368956565857,
-0.08141793310642242,
0.007901953533291817,
0.10571199655532837,
-0.002551150042563677,
-0.007920192554593086,
0.046472422778606415,
-0.0064428504556417465,
-0.013168402016162872,
0.04960949346423149,
-0.050302568823099136,
0.020372722297906876,
-0.02708459459245205,
0.06970863789319992,
0.023272689431905746,
0.021339377388358116,
0.014317445456981659,
0.02755880355834961,
0.00675291009247303,
-0.05544590577483177,
-0.02992984466254711,
0.017153576016426086,
0.03673291206359863,
-0.04800448194146156,
-0.05208997055888176,
0.05066734179854393,
-0.011900806799530983,
-0.03822849318385124,
-0.009315459057688713,
0.0019766283221542835,
-0.0825122594833374,
-0.000962665828410536,
-0.049354150891304016,
0.08273112773895264,
-0.0030002801213413477,
-0.008827571757137775,
-0.0342889167368412,
0.022962629795074463,
-0.05106859654188156,
-0.010286674834787846,
-0.01913248561322689,
-0.015357056632637978,
0.02799653448164463,
-0.013688207603991032,
-0.05292895436286926,
-0.07499787956476212,
0.061720047146081924,
0.03928634151816368,
-0.03841087967157364,
0.06285085529088974,
-0.001029351376928389,
0.005872888490557671,
0.009429452009499073,
-0.026245610788464546,
-0.032702140510082245,
-0.007427745033055544,
-0.05063086748123169,
0.007094887085258961,
0.08783798664808273,
-0.06693633645772934,
0.0056312247179448605,
-0.04235045611858368,
-0.020318005234003067,
0.01568535529077053,
0.035583868622779846,
-0.05654023215174675,
-0.01742715947329998,
-0.0038962604012340307,
0.008750056847929955,
-0.019059529528021812,
0.011946404352784157,
0.04585230350494385,
0.002982041332870722,
0.006666275672614574,
0.03337697684764862,
-0.0753626599907875,
-0.06558667123317719,
-0.009114832617342472,
-0.007505259942263365,
-0.05566477030515671,
-0.038009628653526306,
-0.003558842930942774,
-0.007468782365322113,
-0.03525556996464729,
0.029200294986367226,
0.021941257640719414,
-0.01958845555782318,
0.005357643123716116,
0.07331991195678711,
0.04070896655321121,
0.011125658638775349,
0.0289449505507946,
-0.022907912731170654,
0.006114552728831768,
0.005799933336675167,
0.01232941821217537,
-0.04111022129654884,
-0.043517738580703735,
0.015831265598535538,
0.019260156899690628,
-0.036696434020996094,
-0.027266982942819595,
-0.0035132458433508873,
-0.06620679050683975,
0.027941817417740822,
0.004947270266711712,
0.0550081729888916,
0.070985347032547,
-0.01871299371123314,
-0.04278818890452385,
0.005786254536360502,
-0.02314501814544201,
-0.001525218365713954,
0.0060689556412398815,
-0.027358176186680794,
-0.038082581013441086,
0.04811391234397888,
0.01670672744512558,
-0.04373660683631897,
-0.02989336848258972,
0.005558269564062357,
0.053913846611976624,
0.05260065570473671,
0.049791883677244186,
-0.05245474353432655,
-0.01957021653652191,
-0.05099564045667648,
0.07893745601177216,
-0.0196066927164793,
0.0326109454035759,
-0.018986575305461884,
0.02363746426999569,
0.039103955030441284,
0.0568685308098793,
-0.0026742618065327406,
-0.054278623312711716,
-0.0033194588031619787,
0.04585230350494385,
-0.01475517638027668,
0.017837531864643097,
0.058254677802324295,
0.009310899302363396,
0.008964362554252148,
-0.06445586681365967,
0.023272689431905746,
0.10264787822961807,
-0.00042319679050706327,
0.013378148898482323,
0.02055511064827442,
-0.02256137691438198,
0.006556842941790819,
0.009247063659131527,
0.036605238914489746,
0.007482461165636778,
-0.05059438943862915,
-0.002644623862579465,
0.03873917832970619,
0.007026491686701775,
-0.026792773976922035,
-0.0034334512893110514,
-0.0047694421373307705,
-0.0551905632019043,
-0.0718243345618248,
-0.04282466694712639,
-0.06161061301827431,
0.03738950937986374,
0.03990646079182625,
0.04658185690641403,
-0.016487861052155495,
0.028653129935264587,
-0.05405975878238678,
0.00046252418542280793,
0.02909086085855961,
-0.010833838023245335,
-0.006488447543233633,
-0.0008344243979081511,
-0.026701580733060837,
0.016150442883372307,
0.009347377344965935,
0.03881213441491127,
0.010149884037673473,
-0.026227371767163277,
-0.01525674294680357,
-0.010943271219730377,
-0.05818172171711922,
0.01228382159024477,
-0.01594981737434864,
-0.06058924272656441,
0.05964082479476929,
0.002868048846721649,
0.031261276453733444,
-0.009484168142080307,
0.001822738558985293,
0.03895804286003113,
-0.009274422191083431,
0.019953230395913124,
-0.026282088831067085,
-0.029364442452788353,
0.01501051988452673,
0.04519570991396904,
-0.06288732588291168,
-0.02754056453704834,
-0.03848383575677872,
-0.0007306913030333817,
0.016241637989878654,
0.03211849927902222,
-0.0251330453902483,
0.05066734179854393,
-0.025661969557404518,
0.04683719947934151,
-0.007806199602782726,
0.009347377344965935,
0.0002532056241761893,
0.0002673121925909072,
0.016396667808294296,
0.04771266132593155,
0.02744937129318714,
-0.0529654286801815,
0.004732964560389519,
0.016807040199637413,
-0.00318722752854228,
-0.03534676507115364,
0.005585627630352974,
-0.009675675071775913,
0.09805170446634293,
0.019770842045545578,
0.04231398180127144,
0.01913248561322689,
-0.004354509990662336,
0.07930223643779755,
-0.022306034341454506,
0.02409343421459198,
-0.02549782022833824,
0.022780241444706917,
-0.02655567042529583,
0.05460692197084427,
0.005840970668941736,
0.017874008044600487,
-0.038009628653526306,
0.012849223800003529,
-0.002327724825590849,
-0.024221105501055717,
-0.020956363528966904,
0.029747458174824715,
0.018402934074401855,
-0.04581582546234131,
-0.02312677912414074,
0.0011855210177600384,
-0.023984001949429512,
-0.0022775682155042887,
0.05555533617734909,
0.03768132999539375,
0.012712433002889156,
0.031589575111866,
0.07167842239141464,
-0.03485431894659996,
-0.036623477935791016,
-0.005134217906743288,
-0.03233736380934715,
0.055737726390361786,
0.016113966703414917,
-0.014417759142816067,
-0.05548238381743431,
0.013159283436834812,
0.0295468308031559,
-0.005731537938117981,
-0.03189963474869728,
-0.0369335375726223,
0.07430481165647507,
0.02400224097073078,
0.03841087967157364,
-0.01129892747849226,
-0.019424306228756905,
0.02212364599108696,
-0.011253329925239086,
-0.04588878154754639,
0.051323939114809036,
0.0002673121925909072,
0.06722816079854965,
0.0441378578543663,
-0.0008783114608377218,
0.0010857776505872607,
-0.020318005234003067,
-0.08265817165374756,
-0.02898142859339714,
-0.0038620627019554377,
-0.03239208087325096,
0.09206938743591309,
0.08076133579015732,
-0.06565962731838226,
0.0021840943954885006,
-0.013277835212647915,
-0.009912779554724693,
-0.00960271991789341,
0.05464340001344681,
0.027321700006723404,
-0.049791883677244186,
0.04216806963086128,
-0.008576788008213043,
-0.019059529528021812,
-0.028215399011969566,
0.0033650556579232216,
0.01594981737434864,
0.050813253968954086,
-0.028926711529493332,
-0.022834958508610725,
-0.02414815127849579,
0.10585790872573853,
-0.0015753749758005142,
-0.026774534955620766,
0.004774001892656088,
-0.03259270638227463,
0.05635784566402435,
-0.010131645016372204,
0.003558842930942774,
-0.0007096027256920934,
-0.00859958678483963,
-0.03100593388080597,
-0.015630638226866722,
0.003162149339914322,
-0.007204319816082716,
-0.001754343044012785,
0.03797315061092377,
-0.04242341220378876,
0.05103211849927902,
-0.02943739853799343,
0.019059529528021812,
0.008672541938722134,
-0.010149884037673473,
-0.03979702666401863,
-0.00701737217605114,
0.03279333561658859,
0.04570639505982399,
0.04475797712802887,
0.028178922832012177,
-0.03552915155887604,
-0.020536871626973152,
0.00529380701482296,
-0.090318463742733,
0.03403357043862343,
-0.051871102303266525,
-0.016980309039354324,
0.004644050728529692,
-0.0005232251132838428,
0.0001452690630685538,
-0.014426878653466702,
0.02064630389213562,
0.06730111688375473,
0.041037265211343765,
-0.010177241638302803,
0.0020997400861233473,
-0.004764882382005453,
-0.008927885442972183,
-0.04957301542162895,
-0.01676144264638424,
-0.06668099761009216,
-0.026956923305988312,
0.001844397047534585,
0.016551697626709938,
0.050849732011556625,
0.01274891011416912,
-0.004279274959117174,
-0.008672541938722134,
0.01695295050740242,
-0.04162090644240379,
-0.03445306420326233,
0.009511525742709637,
-0.00979422777891159,
-0.003736671060323715,
-0.027722952887415886,
0.005097740329802036,
0.0030641157645732164,
0.03768132999539375,
0.010906793177127838,
-0.03527380898594856,
0.003962376154959202,
0.007591893896460533,
-0.025297194719314575,
0.00600967975333333,
0.05274656414985657,
-0.010852077044546604,
0.04081840068101883,
0.04424729198217392,
-0.021321138367056847,
0.06226721033453941,
-0.06109992787241936,
-0.046873677521944046,
-0.0029364442452788353,
0.008731817826628685,
0.015977175906300545,
-0.02847074344754219,
-0.041547950357198715,
-0.026209132745862007,
-0.04563343897461891,
-0.02710283361375332,
0.029127338901162148,
0.011481314897537231,
0.08477386832237244,
0.02661038748919964,
0.020992841571569443,
-0.05613897740840912,
-0.0743412896990776,
-0.04654537886381149,
-0.027868863195180893,
-0.014891967177391052,
-0.0706205740571022,
-0.021740632131695747,
-0.03100593388080597,
0.04774913936853409,
-0.030349338427186012,
-0.022871436551213264,
-0.011992000974714756,
0.015001400373876095,
-0.11176726967096329,
0.06558667123317719,
0.048478689044713974,
0.03160781413316727,
-0.052272357046604156,
0.0825122594833374,
-0.01527498196810484,
0.01427184883505106,
0.011836971156299114,
-0.06478416174650192,
0.002057562815025449,
-0.026318566873669624,
-0.027868863195180893,
0.011508673429489136,
-0.022834958508610725,
-0.01054201740771532,
0.00713592441752553,
0.019460782408714294,
-0.04238693416118622,
0.023710420355200768,
0.00649300729855895,
-0.01058761402964592,
0.014618385583162308,
-0.036550525575876236,
0.02951035276055336,
-0.018056396394968033,
-0.008909646421670914,
-0.0373530313372612,
-0.0069854543544352055,
-0.007683088071644306,
-0.029875129461288452,
-0.03408828750252724,
0.025205999612808228,
0.027303460985422134,
-0.011390120722353458,
-0.015621518716216087,
-0.0186765156686306,
-0.043080009520053864,
0.011818732134997845,
-0.04132908582687378,
0.0550081729888916,
0.023217972368001938,
-0.009994854219257832,
-0.09382031112909317,
0.03580273315310478,
0.031790200620889664,
0.012840104289352894,
0.0019412906840443611,
-0.036021601408720016,
-0.06051628664135933,
0.008859490044414997,
0.008038744330406189,
-0.01841205358505249,
0.06358040124177933,
0.03350464627146721,
-0.03133423253893852,
0.044028427451848984,
-0.038119059056043625,
0.04085487872362137,
-0.05223587900400162,
-0.042569324374198914,
-0.0030549964867532253,
0.0023573630023747683,
0.010997987352311611,
-0.001662009279243648,
0.012913059443235397,
0.018968336284160614,
-0.02799653448164463,
-0.0324285589158535,
-0.009976615197956562,
0.06190243363380432,
0.037152405828237534,
0.02108403481543064,
0.029163816943764687,
0.04475797712802887,
0.01152691151946783,
0.041511472314596176,
-0.05249122157692909,
-0.017418039962649345,
0.04523218423128128,
-0.010669688694179058,
-0.03779076039791107,
0.030805306509137154,
-0.00240523973479867,
0.00021972035756334662,
-0.020846931263804436,
-0.04366365075111389,
0.05635784566402435,
-0.0003852943191304803,
0.0031917872838675976,
0.015885980799794197,
0.018439412117004395,
0.024494687095284462,
-0.004837837535887957,
0.05351259559392929,
0.043955471366643906,
-0.031589575111866,
-0.02845250442624092,
-0.0137520432472229,
-0.0005973202059976757,
-0.022743765264749527,
0.009456809610128403,
-0.07857268303632736,
0.03226441144943237,
-0.01924191787838936,
0.010095166973769665,
-0.021722393110394478,
0.0010441704653203487,
-0.06741055101156235,
0.0009062396129593253,
0.04333535209298134,
-0.033759988844394684,
-0.01689823344349861,
0.025789640843868256,
0.06230368837714195,
-0.0027038997504860163,
0.002496433677151799,
-0.05570124834775925,
0.05639432370662689,
-0.03436186909675598,
0.004598453640937805,
0.05894775316119194,
0.007883714511990547,
0.06099049746990204,
0.019989708438515663,
-0.044466156512498856,
-0.0354926735162735,
-0.030622920021414757,
-0.007021931931376457,
-0.0014237650902941823,
-0.012958656065165997,
-0.04315296560525894,
0.0030116792768239975,
0.043080009520053864,
0.058692410588264465,
-0.025424866005778313,
0.020755736157298088,
-0.023801613599061966,
0.014846370555460453,
0.020901646465063095,
0.0005762316286563873,
-0.017609545961022377,
-0.009411212988197803,
0.000282558670733124,
-0.05526351556181908,
0.02361922524869442,
-0.007044730708003044,
-0.009684794582426548,
0.005882008001208305,
-0.006379014812409878,
0.07448719441890717,
0.07580038905143738,
-0.0024006799794733524,
-0.03841087967157364,
0.031662531197071075,
-0.010496420785784721,
-0.020865170285105705,
0.02562549151480198,
0.033687036484479904,
0.024531165137887,
-0.007528058253228664,
0.03580273315310478,
0.008891407400369644,
0.017436278983950615,
0.02456764318048954,
0.01823878474533558,
0.08302294462919235,
-0.10644154995679855,
-0.02456764318048954,
0.012511806562542915,
-0.04920824244618416,
0.004256476182490587,
0.0020370441488921642,
-0.015101714059710503,
0.011663702316582203,
-0.03627694398164749,
0.006315179169178009,
0.05205349251627922,
-0.0010179522214457393,
0.001314332359470427,
0.05945843830704689,
-0.01746363565325737,
-0.004687367472797632,
0.07291866093873978,
0.05369498208165169,
0.02992984466254711,
-0.008905086666345596,
-0.005143337417393923,
-0.03775428235530853,
0.005508112721145153,
-0.007176961749792099,
-0.009748630225658417,
-0.06835896521806717,
0.030185189098119736,
-0.009278981946408749,
-0.031097127124667168,
0.015530325472354889,
-0.07448719441890717,
-0.007938430644571781,
0.0441378578543663,
0.03979702666401863,
-0.01328695472329855,
0.01102534495294094,
0.09163165092468262,
0.037079449743032455,
-0.021923018619418144,
-0.05103211849927902,
-0.01869475468993187,
-0.07466958463191986,
-0.039979416877031326,
0.07813495397567749,
-0.0369335375726223,
-0.0172356516122818,
0.034635450690984726,
-0.018785947933793068,
0.043043531477451324,
0.009142191149294376,
0.014262729324400425,
0.015840385109186172,
-0.04096430912613869,
0.025862596929073334,
-0.013341670855879784,
0.053330205380916595,
0.03972407430410385,
0.0009056696435436606,
-0.005371321924030781,
-0.028343072161078453,
0.022871436551213264,
-0.01628723554313183,
0.03096945583820343,
0.05369498208165169,
0.006798507180064917,
0.02403871901333332,
0.03841087967157364,
0.0650395080447197,
0.00529380701482296,
-0.021959496662020683,
-0.000831004639621824,
-0.0027084595058113337,
-0.06879669427871704,
-0.010067809373140335,
-0.010651450604200363,
0.039614640176296234,
-0.024695314466953278,
0.007072088774293661,
0.07204320281744003,
-0.08885935693979263,
-0.045414574444293976,
0.004598453640937805,
-0.04340830817818642,
0.05311134085059166,
0.014426878653466702,
-0.022780241444706917,
0.018630918115377426,
0.015129071660339832,
0.006337977480143309,
-0.03383294492959976,
0.00982158537954092,
0.05763455852866173,
0.022451944649219513,
-0.016661129891872406,
-0.023783374577760696,
-0.017117099836468697,
0.04669128730893135,
0.08812980353832245,
0.02465883642435074,
-0.043481264263391495,
0.020318005234003067,
-0.039578162133693695,
0.013432865031063557,
-0.005343963857740164,
0.04614412412047386,
-0.028397787362337112,
0.00446622259914875,
0.04585230350494385,
-0.0056038666516542435,
0.06332506239414215,
0.04034418985247612,
-0.02458588220179081,
-0.03598512336611748,
-0.00553091149777174,
0.004436584189534187,
0.005357643123716116,
0.0038985402788966894,
-0.020500393584370613,
-0.04778561741113663,
-0.03494551032781601,
0.003481328021734953,
0.004846957046538591,
-0.06595144420862198,
-0.039979416877031326,
-0.005298366770148277,
-0.018877141177654266,
-0.008576788008213043,
-0.07204320281744003,
-0.01549384742975235,
0.00797490868717432,
-0.023272689431905746,
-0.008909646421670914,
0.037207119166851044,
-0.06139174848794937,
0.029109099879860878,
-0.015138191170990467,
-0.005763455759733915,
-0.02261609211564064,
-0.02166767604649067,
0.05996912345290184,
-0.013560536317527294,
0.019369589164853096,
0.008326005190610886,
0.06471120566129684,
0.01180049404501915,
0.00239384057931602,
-0.011599866673350334,
-0.027759430930018425,
-0.005535471253097057,
-0.07930223643779755,
0.07908336818218231,
-0.04669128730893135,
-0.001946990261785686,
0.004997427109628916,
-0.005731537938117981,
-0.09783284366130829,
0.012894820421934128,
0.05369498208165169,
-0.04183977097272873,
0.023272689431905746,
-0.009019078686833382,
0.028124205768108368,
0.026738058775663376,
-0.026847491040825844,
-0.015621518716216087,
0.039030998945236206,
0.05996912345290184,
-0.0026560230180621147,
0.003679674817249179,
-0.0050612627528607845,
-0.01034139096736908,
0.04377308487892151,
-0.06700929254293442,
0.02754056453704834,
0.017773695290088654,
-0.0026400641072541475,
-0.04566991701722145,
-0.04388251528143883,
-0.011052703484892845,
0.007163282483816147
]
|
36,614 | rfc3987 | normalize | Syntax-Based Normalization | def normalize(uri):
"Syntax-Based Normalization"
# TODO:
raise NotImplementedError
| (uri) | [
-0.04848829656839371,
0.02883828617632389,
0.044200435280799866,
-0.023148003965616226,
0.005077730864286423,
-0.00970410741865635,
-0.017248164862394333,
0.016369637101888657,
0.045490019023418427,
-0.022825608029961586,
-0.026968391612172127,
0.010743833146989346,
-0.04071856290102005,
0.07357067614793777,
-0.01798967458307743,
0.03614054620265961,
-0.012484769336879253,
0.060545895248651505,
-0.013677633367478848,
-0.021648865193128586,
-0.024647144600749016,
0.03193328529596329,
0.002309158444404602,
-0.036172784864902496,
0.017860716208815575,
0.0009394809021614492,
0.035237837582826614,
-0.050229232758283615,
-0.021793942898511887,
-0.054194699972867966,
0.04974564164876938,
0.005089820362627506,
0.05558100342750549,
-0.00712091289460659,
0.06460807472467422,
-0.08588618785142899,
-0.0257271695882082,
0.06712276488542557,
-0.020439881831407547,
-0.06048141419887543,
-0.08169504255056381,
0.0034294831566512585,
-0.055226366966962814,
0.0376235656440258,
0.035818152129650116,
0.021793942898511887,
0.0008044777787290514,
-0.028419172391295433,
-0.05316303297877312,
0.006516421213746071,
0.0018547822255641222,
0.007648835424333811,
0.03130461275577545,
0.02387339435517788,
-0.03862299397587776,
0.00558550376445055,
-0.01734488271176815,
0.08588618785142899,
0.015757085755467415,
0.03636622428894043,
0.016015000641345978,
0.03594711050391197,
-0.015217072330415249,
-0.06480151414871216,
0.031062815338373184,
-0.0007153152255341411,
0.007419128902256489,
0.03165924921631813,
-0.018118632957339287,
0.020278682932257652,
-0.08046994358301163,
-0.0232286024838686,
0.01172714028507471,
-0.012928063981235027,
0.0982016995549202,
0.03730117157101631,
-0.02590448595583439,
0.08214639872312546,
0.025420892983675003,
0.03610830754041672,
-0.0009757504449225962,
0.016353517770767212,
0.051905691623687744,
-0.031111175194382668,
0.001666382304392755,
-0.054549336433410645,
-0.01581350341439247,
-0.02240649424493313,
-0.03430289030075073,
-0.010252180509269238,
-0.008591842837631702,
-0.03301331028342247,
-0.04242726042866707,
0.007225691340863705,
-0.00835004635155201,
0.03662414103746414,
0.004199202638119459,
-0.02848365157842636,
0.05928855016827583,
-0.10961450636386871,
-0.01240417081862688,
0.07292588800191879,
-0.0443938747048378,
-0.013588974252343178,
-0.024711621925234795,
0.024389227852225304,
0.05445261672139168,
-0.06447912007570267,
-0.024614904075860977,
0.0018567971419543028,
-0.05384006351232529,
-0.039235543459653854,
0.007741524372249842,
-0.010437557473778725,
-0.01002650335431099,
-0.03904210776090622,
0.013210159726440907,
0.010155461728572845,
0.056225791573524475,
0.003576576244086027,
-0.024566544219851494,
0.028935005888342857,
-0.06012677773833275,
0.027645422145724297,
0.0031030576210469007,
0.014902736991643906,
0.008108248934149742,
0.0373334102332592,
-0.017909076064825058,
-0.03104669600725174,
-0.061513081192970276,
0.00803168024867773,
-0.03768804669380188,
0.017763998359441757,
0.003751878859475255,
-0.010542335920035839,
-0.04758559167385101,
0.03090161830186844,
0.035560235381126404,
0.03959017992019653,
-0.01540245022624731,
0.0011495418148115277,
0.0076730153523385525,
-0.05161553621292114,
-0.07299036532640457,
0.02298680692911148,
-0.024856701493263245,
0.00429189158603549,
-0.032191202044487,
0.0002979640557896346,
-0.004027930088341236,
0.03304554894566536,
0.1067129448056221,
0.04139559343457222,
0.019795089960098267,
0.005847450345754623,
0.004384580068290234,
-0.08208192139863968,
0.021084671840071678,
0.03672086074948311,
0.015063934028148651,
-0.01217043399810791,
0.014580341055989265,
-0.03090161830186844,
-0.01945657469332218,
-0.03394825756549835,
0.0323362797498703,
-0.06489823758602142,
-0.01574096456170082,
-0.010969510301947594,
-0.01412898674607277,
0.011179067194461823,
-0.05516188591718674,
0.0678965151309967,
0.06783203780651093,
0.025743288919329643,
0.023099644109606743,
0.07311931997537613,
-0.041911426931619644,
0.039557941257953644,
0.04561897739768028,
-0.036495182663202286,
0.005516994744539261,
-0.03691429644823074,
0.025791648775339127,
-0.010389198549091816,
-0.022890087217092514,
0.0007062478689476848,
0.02287396788597107,
-0.027919458225369453,
0.04165351018309593,
-0.036462944000959396,
-0.028822166845202446,
0.04400699958205223,
0.034528568387031555,
-0.041169919073581696,
-0.004187112674117088,
-0.010477856732904911,
0.02986995317041874,
-0.03504440188407898,
0.007741524372249842,
0.0329165905714035,
-0.020649438723921776,
0.04307205229997635,
-0.004501448478549719,
-0.0021076612174510956,
0.001717764069326222,
0.008011531084775925,
-0.054162461310625076,
-0.012992543168365955,
0.02201961912214756,
-0.0033287345431745052,
0.02766154333949089,
0.013879130594432354,
-0.01745772175490856,
-0.011872217990458012,
0.013854950666427612,
0.06509166955947876,
0.05538756400346756,
0.062222350388765335,
-0.010856672190129757,
-0.035914868116378784,
0.09078659862279892,
-0.0526149608194828,
-0.018215350806713104,
-0.004215322434902191,
-0.010888911783695221,
0.016893530264496803,
0.008253327570855618,
-0.002625509165227413,
0.020101366564631462,
-0.08975493162870407,
-0.011251606047153473,
0.035173360258340836,
0.05464605614542961,
-0.030434144660830498,
0.018682824447751045,
0.04278189688920975,
0.02372831664979458,
0.014604520983994007,
-0.05377558618783951,
0.004243532195687294,
-0.00970410741865635,
0.0058958097361028194,
-0.016571134328842163,
0.01329075824469328,
0.035818152129650116,
-0.02087511494755745,
-0.024292508140206337,
-0.06341521441936493,
-0.038203880190849304,
0.016909649595618248,
0.021294228732585907,
0.045844655483961105,
0.028677089139819145,
0.04826262220740318,
-0.06312505900859833,
0.020826755091547966,
-0.030031150206923485,
-0.022084098309278488,
-0.014048388227820396,
-0.05006803572177887,
0.05777329206466675,
0.043491166085004807,
0.017264284193515778,
-0.028741568326950073,
-0.019746730104088783,
0.02073003724217415,
0.04426491633057594,
-0.005621773190796375,
-0.09600941091775894,
0.013411656953394413,
-0.02869320847094059,
0.022148577496409416,
-0.01562812738120556,
0.030853258445858955,
-0.023083524778485298,
0.018827904015779495,
0.033142268657684326,
0.011227427050471306,
-0.008249297738075256,
-0.01606336049735546,
-0.0022910237312316895,
-0.0023716227151453495,
0.07563401013612747,
-0.00004190513209323399,
0.02904784306883812,
-0.012637907639145851,
-0.024099070578813553,
-0.021116912364959717,
0.04365236312150955,
0.01773175783455372,
-0.054903969168663025,
-0.00818884838372469,
0.014628699980676174,
0.04507090523838997,
-0.04800470545887947,
-0.04329773038625717,
0.07215213775634766,
-0.0071410625241696835,
-0.07608535885810852,
-0.012791045010089874,
0.012791045010089874,
0.013484195806086063,
-0.024776101112365723,
-0.01952105388045311,
0.00009275170305045322,
-0.002871335716918111,
0.004094424191862345,
0.004626377020031214,
-0.03804267942905426,
-0.004876233637332916,
-0.08311358839273453,
-0.031707607209682465,
0.01948881335556507,
0.07279692590236664,
0.022067978978157043,
-0.026355840265750885,
-0.0004382565093692392,
0.03730117157101631,
-0.05396902188658714,
0.005750731565058231,
0.021681103855371475,
-0.0014195481780916452,
-0.019279256463050842,
-0.004227412398904562,
-0.03365810215473175,
0.00412061857059598,
-0.0014739524340257049,
0.008301686495542526,
0.044587310403585434,
0.016861289739608765,
0.035850390791893005,
-0.03407721593976021,
-0.049197569489479065,
-0.08691785484552383,
0.03768804669380188,
0.012895824387669563,
0.005561324302107096,
-0.027145709842443466,
0.014862436801195145,
0.0802765041589737,
0.04133111611008644,
0.009357532486319542,
0.006516421213746071,
0.024260269477963448,
-0.059224072843790054,
-0.032561954110860825,
0.01277492567896843,
-0.059933342039585114,
-0.0446840301156044,
-0.015861863270401955,
-0.03212672099471092,
-0.004727125633507967,
0.02155214548110962,
0.005662072915583849,
-0.009131855331361294,
-0.07576296478509903,
-0.021584386005997658,
-0.049229808151721954,
0.0567416250705719,
-0.041492313146591187,
0.020439881831407547,
-0.04278189688920975,
0.05832136422395706,
-0.023276962339878082,
0.01475765835493803,
0.009639628231525421,
0.0052066887728869915,
0.019327616319060326,
-0.02116527035832405,
-0.012379990890622139,
-0.0019837403669953346,
-0.06609109789133072,
-0.05206688866019249,
-0.02912844344973564,
0.02740362659096718,
-0.046844080090522766,
-0.021600505337119102,
0.0036894145887345076,
0.03183656558394432,
0.08885222673416138,
0.01752220094203949,
-0.0077536143362522125,
0.006451942026615143,
-0.028999485075473785,
0.026420319452881813,
0.04294309392571449,
-0.05567771941423416,
0.04568345844745636,
-0.03546351566910744,
-0.03330346569418907,
0.013959729112684727,
-0.01570066623389721,
-0.02451818622648716,
0.003092982806265354,
-0.0019726580940186977,
-0.02298680692911148,
-0.001023102318868041,
-0.006899266038089991,
-0.017215924337506294,
-0.007733464706689119,
0.024002352729439735,
0.047553349286317825,
0.004243532195687294,
-0.023002926260232925,
0.026323601603507996,
0.09536461532115936,
-0.008664381690323353,
0.011856098659336567,
-0.004662646446377039,
-0.012347751297056675,
-0.01802191324532032,
0.0006604072405025363,
0.03436737135052681,
-0.010695474222302437,
0.09394607692956924,
-0.08208192139863968,
-0.05970766395330429,
0.026065684854984283,
0.0030708180274814367,
-0.006153726018965244,
0.021004073321819305,
0.06680037081241608,
0.04758559167385101,
-0.027387505397200584,
0.041814710944890976,
-0.0752471312880516,
0.0007797943544574082,
0.05129313841462135,
-0.023970112204551697,
-0.03177208825945854,
0.02251933328807354,
-0.030998336151242256,
0.011694900691509247,
0.014862436801195145,
0.01002650335431099,
0.06667140871286392,
0.03681757673621178,
-0.02201961912214756,
0.03994481638073921,
0.022084098309278488,
-0.008744980208575726,
-0.0388164296746254,
0.025066258385777473,
-0.056870583444833755,
-0.031675368547439575,
-0.0032541805412620306,
-0.027065111324191093,
-0.014709299430251122,
-0.0590951144695282,
-0.020907355472445488,
0.042588457465171814,
-0.010671294294297695,
-0.00965574849396944,
-0.016434116289019585,
0.005279228091239929,
0.03601158782839775,
0.022793369367718697,
0.044490594416856766,
0.009083496406674385,
0.028467532247304916,
0.005246988497674465,
0.023760555312037468,
-0.001970643177628517,
0.034496329724788666,
0.038590751588344574,
-0.013314938172698021,
-0.02487282082438469,
-0.022616051137447357,
0.017361003905534744,
-0.017215924337506294,
0.054581575095653534,
0.04739215224981308,
-0.013161800801753998,
0.0423305407166481,
-0.056838344782590866,
-0.012283272109925747,
0.025388654321432114,
0.00019696356321219355,
-0.041556794196367264,
-0.040525127202272415,
-0.026774954050779343,
0.06393104791641235,
0.03304554894566536,
0.022938447073101997,
-0.00003312111221021041,
-0.02790333889424801,
0.03090161830186844,
-0.02023032307624817,
0.016280977055430412,
0.013032842427492142,
0.02758094295859337,
0.01483019720762968,
0.02390563301742077,
-0.006911355536431074,
-0.014854377135634422,
-0.043201010674238205,
-0.022438732907176018,
-0.003314629662781954,
0.01755443960428238,
-0.038236118853092194,
-0.012218792922794819,
-0.008712741546332836,
0.061932194977998734,
0.057257458567619324,
-0.03691429644823074,
0.021471546962857246,
-0.03765580803155899,
-0.019359854981303215,
-0.06212563067674637,
-0.03510887920856476,
0.09478430449962616,
-0.011316085234284401,
0.00028108866536058486,
0.04342668876051903,
-0.009180215187370777,
0.016796810552477837,
0.029773233458399773,
0.012122074142098427,
-0.006512390915304422,
-0.03694653511047363,
-0.05670938640832901,
-0.002460281364619732,
0.007153152488172054,
-0.036172784864902496,
-0.021358707919716835,
0.02040764130651951,
0.0417502298951149,
-0.033238984644412994,
0.048875171691179276,
0.006979864556342363,
0.04942324385046959,
-0.0502614751458168,
0.032852113246917725,
0.0752471312880516,
0.030289066955447197,
-0.06660693138837814,
0.02198738045990467,
0.04371684417128563,
-0.012694327160716057,
0.01118712779134512,
-0.0423305407166481,
0.036237265914678574,
0.0035342618357390165,
0.0013409642269834876,
-0.015039755031466484,
-0.017215924337506294,
0.021245870739221573,
0.008954538032412529,
-0.01634545624256134,
0.005017281509935856,
-0.05677386373281479,
0.057902250438928604,
0.01591828279197216,
-0.06128740310668945,
-0.016152018681168556,
0.02890276536345482,
-0.014781838282942772,
0.017957434058189392,
-0.015209012664854527,
-0.03401273488998413,
0.018972981721162796,
0.05609683319926262,
-0.0352700799703598,
0.09104451537132263,
-0.005924019031226635,
-0.05335647240281105,
0.010123222135007381,
0.01561200711876154,
-0.005388036370277405,
-0.009599328972399235,
0.0825977548956871,
0.017796237021684647,
-0.02801617793738842,
0.03122401423752308,
0.0257271695882082,
-0.06989536434412003,
0.03083713911473751,
-0.0035060520749539137,
0.04529658332467079,
-0.009413952007889748,
-0.0585147999227047,
-0.0402672104537487,
0.0003213881282135844,
-0.004154873080551624,
0.026936152949929237,
0.09562253206968307,
0.0214554276317358,
-0.015136473812162876,
-0.03157864883542061,
-0.05825688689947128,
0.020601078867912292,
-0.030740421265363693,
-0.01640993542969227,
-0.05345319211483002,
0.0002115721144946292,
-0.08453212678432465,
-0.02469550259411335,
0.027967818081378937,
-0.019924048334360123,
0.004888323135674,
0.03148192912340164,
0.07621432095766068,
0.021471546962857246,
-0.030385784804821014,
0.029144562780857086,
-0.04745663329958916,
-0.04690856114029884,
-0.041492313146591187,
0.0402672104537487,
0.047230955213308334,
-0.01627291738986969,
0.0163857564330101,
0.017038607969880104,
0.011549822054803371,
0.0012805149890482426,
-0.005791030824184418,
-0.04839158058166504,
0.0056258030235767365,
-0.012436410412192345,
-0.04639272764325142,
-0.06160980090498924,
-0.04200814664363861,
0.001705674221739173,
0.008970657363533974,
0.011856098659336567,
0.02198738045990467,
-0.06776755303144455,
-0.08156608790159225,
0.011541762389242649,
-0.05274391919374466,
-0.03259419649839401,
-0.052195847034454346,
0.01393555011600256,
-0.013177920132875443,
0.007443308364599943,
0.02366383746266365,
-0.051486577838659286,
0.05161553621292114,
0.017780117690563202,
-0.05109970271587372,
0.0107277138158679,
-0.029934432357549667,
0.01984344981610775,
0.012226853519678116,
-0.018328189849853516,
-0.021906781941652298,
-0.029209041967988014,
0.019795089960098267,
0.022599931806325912,
0.051260899752378464,
0.04532882198691368,
0.02712959051132202,
0.009212453849613667,
0.0940750390291214,
-0.03926778584718704,
-0.026065684854984283,
0.02284172922372818,
-0.01695800945162773,
0.004767424892634153,
0.0018930666847154498,
0.03222344070672989,
0.05271168053150177,
-0.027967818081378937,
0.027323028072714806,
0.01845714822411537,
0.015088113956153393,
-0.029144562780857086,
-0.01308120135217905,
-0.024292508140206337,
0.0526149608194828,
-0.005170419346541166,
-0.021761702373623848,
-0.03230403736233711,
-0.022325895726680756,
0.023067405447363853,
-0.015225131995975971,
0.02037540264427662,
0.02637195959687233,
-0.06763859838247299,
-0.005541174206882715,
-0.027709901332855225,
-0.03365810215473175,
0.014854377135634422,
-0.0014225705526769161,
-0.02405071258544922,
0.016506655141711235,
0.04481298848986626,
-0.005799090955406427,
-0.021068552508950233,
-0.007427188567817211,
-0.054871730506420135,
0.02013360522687435,
-0.0034576929174363613,
0.030498623847961426,
-0.010252180509269238,
-0.04964892193675041,
0.018972981721162796,
0.02087511494755745,
0.10323107242584229,
-0.003268285421654582,
-0.01215431373566389,
-0.030272947624325752,
0.07756838202476501,
-0.01452392153441906,
0.014677059836685658,
0.0017469811718910933,
-0.030675942078232765,
0.05280840024352074,
-0.011968936771154404,
-0.01805415377020836,
0.023422040045261383,
0.04861725494265556,
0.11058168858289719,
0.0031292522326111794,
-0.04075080528855324,
0.024953419342637062,
0.019762849435210228,
-0.01475765835493803,
0.042169343680143356,
-0.0673162043094635,
0.018892381340265274,
-0.005093850661069155,
-0.005545204505324364,
-0.03304554894566536,
-0.014024208299815655,
0.05074506625533104,
-0.007169272284954786,
-0.03559247404336929,
-0.06841234862804413,
0.04133111611008644,
0.0067058284766972065,
0.020649438723921776,
-0.01002650335431099,
0.004952802322804928,
0.010348898358643055,
0.007519877515733242,
-0.017328763380646706,
-0.024921180680394173,
0.025082377716898918,
-0.014257945120334625,
-0.040557365864515305,
-0.0054122162982821465,
0.012202673591673374,
-0.014443323016166687,
0.03607606887817383,
-0.025114616379141808,
0.00012486532796174288,
0.024711621925234795,
0.032384637743234634,
0.04207262769341469,
-0.009276933036744595,
0.004356370773166418,
0.00819287821650505,
-0.09639628231525421,
0.08911014348268509,
0.0373334102332592,
-0.025936726480722427,
-0.03398049622774124,
0.02230977639555931,
-0.0035544114653021097,
0.029918311163783073,
0.02345428057014942,
-0.01581350341439247,
-0.0010770028457045555,
0.029209041967988014,
-0.016087541356682777
]
|
36,615 | rfc3987 | parse | Parses `string` according to `rule` into a dict of subcomponents.
If `rule` is None, parse an IRI_reference `without validation
<http://tools.ietf.org/html/rfc3986#appendix-B>`_.
If regex_ is available, any rule is supported; with re_, `rule` must be
'IRI_reference' or some special case thereof ('IRI', 'absolute_IRI',
'irelative_ref', 'irelative_part', 'URI_reference', 'URI', 'absolute_URI',
'relative_ref', 'relative_part'). ::
>>> d = parse('http://tools.ietf.org/html/rfc3986#appendix-A',
... rule='URI')
>>> assert all([ d['scheme'] == 'http',
... d['authority'] == 'tools.ietf.org',
... d['path'] == '/html/rfc3986',
... d['query'] == None,
... d['fragment'] == 'appendix-A' ])
| def parse(string, rule='IRI_reference'):
"""Parses `string` according to `rule` into a dict of subcomponents.
If `rule` is None, parse an IRI_reference `without validation
<http://tools.ietf.org/html/rfc3986#appendix-B>`_.
If regex_ is available, any rule is supported; with re_, `rule` must be
'IRI_reference' or some special case thereof ('IRI', 'absolute_IRI',
'irelative_ref', 'irelative_part', 'URI_reference', 'URI', 'absolute_URI',
'relative_ref', 'relative_part'). ::
>>> d = parse('http://tools.ietf.org/html/rfc3986#appendix-A',
... rule='URI')
>>> assert all([ d['scheme'] == 'http',
... d['authority'] == 'tools.ietf.org',
... d['path'] == '/html/rfc3986',
... d['query'] == None,
... d['fragment'] == 'appendix-A' ])
"""
if not REGEX and rule and rule not in REFERENCE_RULES:
raise ValueError(rule)
if rule:
m = match(string, rule)
if not m:
raise ValueError('%r is not a valid %r.' % (string, rule))
if REGEX:
return _i2u(m.groupdict())
return _i2u(_iri_non_validating_re.match(string).groupdict())
| (string, rule='IRI_reference') | [
-0.03290749341249466,
0.0923948585987091,
-0.053890589624643326,
-0.04465879872441292,
-0.02723378874361515,
-0.025656690821051598,
0.004594259429723024,
0.020271478220820427,
0.01880016177892685,
-0.08100898563861847,
-0.006221843883395195,
0.10562709718942642,
-0.033022891730070114,
0.07170026004314423,
0.0085634496062994,
0.017684653401374817,
-0.05662166327238083,
0.058352623134851456,
-0.035561636090278625,
0.0002691103727556765,
-0.048043787479400635,
-0.0024738318752497435,
0.018925175070762634,
0.06085290014743805,
0.028695490211248398,
0.009582793340086937,
-0.018136626109480858,
-0.0653534010052681,
0.008885600604116917,
0.005986240692436695,
0.058237224817276,
-0.01928098313510418,
-0.01569404825568199,
-0.01468432042747736,
0.002299533924087882,
-0.03890816122293472,
-0.011010835878551006,
0.023637237027287483,
-0.006673817057162523,
0.06358397006988525,
-0.027579981833696365,
0.042620111256837845,
-0.007534489035606384,
-0.001768224872648716,
-0.011866699904203415,
0.04173539578914642,
-0.053198207169771194,
0.017982762306928635,
-0.04061988741159439,
-0.03725413233041763,
0.008539408445358276,
-0.030407218262553215,
-0.018011612817645073,
-0.02746458351612091,
-0.00366867589764297,
0.005976624321192503,
-0.06273772567510605,
0.04765912890434265,
0.02840699627995491,
-0.0026349076069891453,
-0.008082627318799496,
-0.006813255604356527,
-0.03050338290631771,
-0.009702999144792557,
-0.005221732892096043,
-0.02511817030608654,
0.0756237730383873,
-0.04931316152215004,
-0.03881199657917023,
-0.044466469436883926,
-0.01881939359009266,
0.024541182443499565,
0.041658464819192886,
-0.07558530569076538,
0.03550393506884575,
-0.008505750447511673,
0.03692717105150223,
0.016444131731987,
-0.019906053319573402,
0.048389982432127,
0.007822982966899872,
0.055083028972148895,
-0.029522504657506943,
-0.065776526927948,
0.009688573889434338,
-0.0027647295501083136,
0.03008025884628296,
-0.05304434150457382,
-0.034388426691293716,
0.037446457892656326,
-0.022214001044631004,
-0.0750083178281784,
0.03244590386748314,
0.02983023039996624,
-0.038869693875312805,
-0.0052938563749194145,
-0.010472315363585949,
0.009885711595416069,
0.035100046545267105,
-0.060006652027368546,
0.0021781260147690773,
0.0071498313918709755,
-0.10624255239963531,
-0.01138587761670351,
-0.04927469417452812,
-0.02161778137087822,
0.010472315363585949,
-0.027599213644862175,
0.033253688365221024,
-0.03660021349787712,
0.0014725190121680498,
-0.05585234612226486,
-0.044735729694366455,
0.044004879891872406,
-0.0068228719756007195,
0.047274474054574966,
-0.02821466699242592,
-0.04200465604662895,
0.039812106639146805,
-0.021175425499677658,
-0.05935273319482803,
0.010866589844226837,
-0.07239264249801636,
0.016838405281305313,
-0.004125457257032394,
-0.0460820309817791,
-0.05312127619981766,
0.03119576722383499,
0.06627658009529114,
-0.005370787810534239,
0.042735505849123,
-0.0014977622777223587,
-0.027810776606202126,
-0.01688648760318756,
-0.010760808363556862,
0.010029958561062813,
-0.020713835954666138,
0.03554240241646767,
-0.007390242535620928,
0.03388837352395058,
0.0149247320368886,
0.0060150898061692715,
-0.01735769398510456,
-0.052005767822265625,
-0.02134852111339569,
-0.01138587761670351,
0.04973628371953964,
0.0008937289239838719,
-0.025252800434827805,
-0.008832709863781929,
-0.01878092810511589,
-0.009433737955987453,
0.03733106330037117,
0.028022337704896927,
0.035600099712610245,
-0.03625401854515076,
-0.000994701636955142,
-0.059775859117507935,
0.013347634114325047,
-0.044620331376791,
0.007563338615000248,
0.05304434150457382,
-0.01421311404556036,
0.011943631805479527,
0.024252688512206078,
0.018742462620139122,
0.06758441776037216,
-0.059314269572496414,
-0.0014749231049790978,
-0.044004879891872406,
-0.07685467600822449,
0.0052938563749194145,
-0.07285422831773758,
0.02657986991107464,
0.0025748047046363354,
0.01810777746140957,
0.016751857474446297,
0.039581310003995895,
-0.03596552461385727,
0.04808225482702255,
0.03548470512032509,
0.02044457383453846,
-0.0182808730751276,
-0.0042288340628147125,
-0.05219809710979462,
0.006346857640892267,
0.006279542576521635,
0.024118058383464813,
0.048005323857069016,
-0.05958352982997894,
0.0034883676562458277,
-0.05666012689471245,
-0.03073417767882347,
0.017713502049446106,
0.008241298608481884,
-0.0065872687846422195,
0.009741464629769325,
0.013164921663701534,
-0.013261085376143456,
-0.017751967534422874,
-0.018607832491397858,
0.04077375307679176,
-0.056237004697322845,
0.04135073721408844,
-0.06943077594041824,
-0.03879276290535927,
-0.05381365865468979,
-0.01046269852668047,
-0.0258682519197464,
-0.0053996373899281025,
-0.02302178367972374,
0.015838295221328735,
0.005938158370554447,
-0.005591966211795807,
-0.0060150898061692715,
-0.004156711045652628,
-0.005370787810534239,
0.06708436459302902,
0.022656358778476715,
-0.0002928509784396738,
-0.01877131126821041,
-0.004548581317067146,
0.05639086663722992,
-0.011549357324838638,
-0.03179198503494263,
-0.019213669002056122,
0.010356917977333069,
0.023137180134654045,
0.011058918200433254,
0.0033176755532622337,
0.045658908784389496,
-0.0840093120932579,
0.10154972225427628,
0.008664422668516636,
0.0848555639386177,
0.005346746649593115,
-0.01642489805817604,
0.02656063809990883,
0.07031548768281937,
0.021675480529665947,
-0.001971372403204441,
-0.02584902010858059,
-0.056006208062171936,
0.013145687989890575,
-0.036330949515104294,
0.05196730047464371,
0.040966082364320755,
-0.0013463031500577927,
-0.022156301885843277,
-0.07508524507284164,
0.004680807236582041,
0.02721455506980419,
0.0279646385461092,
0.03333061933517456,
-0.05500609800219536,
0.016636459156870842,
-0.011443576775491238,
-0.00032635830575600266,
0.010866589844226837,
-0.02607981488108635,
0.046812884509563446,
-0.02394496276974678,
0.0431586317718029,
0.0005544485175050795,
-0.013213003054261208,
-0.039542846381664276,
0.014761252328753471,
0.017992379143834114,
-0.02511817030608654,
0.023541072383522987,
0.044043343514204025,
-0.018838627263903618,
0.021060027182102203,
-0.0023079481907188892,
-0.018694380298256874,
0.025233566761016846,
0.04973628371953964,
0.027522282674908638,
0.06654583662748337,
0.01666530966758728,
-0.05465990677475929,
0.024541182443499565,
-0.022214001044631004,
-0.01019343826919794,
0.05327513813972473,
-0.04435107111930847,
0.04558197781443596,
0.08454783260822296,
-0.010212671011686325,
0.020117614418268204,
0.04104301333427429,
-0.09508746862411499,
-0.09878018498420715,
0.029118612408638,
-0.01692495308816433,
0.0840093120932579,
-0.0014544881414622068,
-0.06181454658508301,
0.05254428833723068,
-0.03496541455388069,
-0.009972259402275085,
0.021444685757160187,
0.008856751024723053,
0.029022449627518654,
-0.04912083223462105,
0.037427227944135666,
0.021983206272125244,
-0.05454450845718384,
-0.0027334762271493673,
-0.008472093380987644,
0.005890076048672199,
-0.008318229578435421,
-0.055313825607299805,
0.020136848092079163,
-0.03736952692270279,
0.04365868866443634,
0.003877833718433976,
-0.02956097014248371,
0.02065613679587841,
-0.03521544486284256,
-0.008198024705052376,
-0.020098382607102394,
-0.004488478414714336,
-0.007212338037788868,
-0.007077707909047604,
-0.004784184508025646,
-0.011193549260497093,
0.03619632124900818,
0.03942744806408882,
-0.013472647406160831,
0.007587379775941372,
-0.024041127413511276,
0.007447941228747368,
-0.005207308102399111,
-0.04573583975434303,
-0.04292783513665199,
0.015665197744965553,
-0.041235342621803284,
-0.003707141848281026,
0.017040351405739784,
-0.004409142769873142,
0.06154528632760048,
0.021213890984654427,
-0.009698190726339817,
0.017328845337033272,
-0.01622295193374157,
-0.07062321156263351,
0.03521544486284256,
-0.024483483284711838,
-0.011837851256132126,
-0.024368086829781532,
-0.023848798125982285,
-0.014742019586265087,
0.027426118031144142,
-0.00439952639862895,
0.006640159524977207,
-0.008414394222199917,
-0.07650848478078842,
0.053929056972265244,
-0.01952139474451542,
0.005082294344902039,
-0.052275028079748154,
-0.025233566761016846,
-0.05165957286953926,
0.05892961099743843,
-0.041927725076675415,
0.012030179612338543,
0.022829454392194748,
0.053429000079631805,
-0.036042459309101105,
0.020617671310901642,
0.021060027182102203,
0.009332765825092793,
-0.032022781670093536,
0.01515552680939436,
-0.023541072383522987,
0.05896807834506035,
0.010616561397910118,
-0.021463917568325996,
-0.017444241791963577,
0.025252800434827805,
0.045697376132011414,
-0.05804489925503731,
0.010712726041674614,
-0.0010265561286360025,
-0.04038909450173378,
0.00384658039547503,
0.08377852290868759,
0.021733179688453674,
0.05285201221704483,
0.024329621344804764,
0.010905055329203606,
0.04346635937690735,
-0.060699038207530975,
-0.028368530794978142,
-0.026137514039874077,
0.005063061602413654,
-0.060737501829862595,
0.0023079481907188892,
-0.040004435926675797,
-0.049197763204574585,
-0.0144535256549716,
-0.01138587761670351,
0.04396641254425049,
0.01902133971452713,
0.05481376871466637,
0.027406884357333183,
0.060468241572380066,
-0.04785145819187164,
-0.09170247614383698,
0.007621037308126688,
-0.04038909450173378,
-0.011193549260497093,
-0.09962642937898636,
0.0012633611913770437,
-0.016540296375751495,
0.05619853734970093,
-0.014559306204319,
-0.02821466699242592,
-0.02348337322473526,
-0.002310352399945259,
-0.0441972091794014,
0.008371120318770409,
0.03756185621023178,
-0.026945294812321663,
-0.027387652546167374,
0.013655359856784344,
-0.02652217075228691,
0.004450012464076281,
0.032272808253765106,
-0.0009844842134043574,
0.005265006795525551,
0.012722564861178398,
-0.03992750495672226,
-0.017078816890716553,
-0.036042459309101105,
-0.022387098520994186,
0.03727336227893829,
0.040004435926675797,
-0.028022337704896927,
0.016136404126882553,
0.0258682519197464,
0.022867919877171516,
0.021502384915947914,
0.01116469968110323,
0.007039241958409548,
-0.02581055462360382,
0.017771201208233833,
-0.05796796455979347,
-0.005548692308366299,
0.03781188651919365,
-0.07539297640323639,
0.027368418872356415,
0.017078816890716553,
-0.007351776584982872,
0.0012008543126285076,
-0.00716906413435936,
0.008058586157858372,
-0.007130598183721304,
0.045428112149238586,
-0.0007518862257711589,
0.03119576722383499,
0.04962088540196419,
0.023098714649677277,
-0.09670303016901016,
0.08770202845335007,
0.0498516820371151,
0.006024706643074751,
-0.023367974907159805,
-0.0007374615524895489,
-0.04673594981431961,
0.011308946646749973,
0.03165735676884651,
0.015117060393095016,
0.005111143458634615,
0.029157079756259918,
0.004933239426463842,
0.000934598792809993,
-0.0032118945382535458,
0.004928431008011103,
0.007486407179385424,
-0.01569404825568199,
-0.0258682519197464,
0.03625401854515076,
0.016338350251317024,
0.01433812826871872,
0.02702222764492035,
0.0161844864487648,
-0.04088914766907692,
-0.021983206272125244,
-0.0737389475107193,
0.03219587728381157,
0.041696932166814804,
0.031599655747413635,
0.0351962111890316,
0.007890298031270504,
0.03223434463143349,
-0.004541368689388037,
-0.027887707576155663,
-0.02186780981719494,
0.03973517566919327,
-0.036504048854112625,
0.003572511486709118,
0.011693604290485382,
0.003416244173422456,
0.04150460287928581,
-0.056467797607183456,
0.03402300179004669,
0.017078816890716553,
-0.05185190215706825,
-0.04915929585695267,
0.023060249164700508,
0.10785811394453049,
0.01290527731180191,
-0.043081700801849365,
0.013068757019937038,
0.013068757019937038,
-0.001810296904295683,
-0.0530058778822422,
-0.03315752372145653,
0.01174168661236763,
-0.018963640555739403,
0.03271516412496567,
0.01782890036702156,
0.05115951970219612,
-0.011251247487962246,
0.011895549483597279,
0.026676034554839134,
0.0005490392213687301,
-0.10016494989395142,
-0.03985057398676872,
0.017992379143834114,
0.008933682925999165,
-0.007822982966899872,
0.020771533250808716,
0.025252800434827805,
0.06462255120277405,
-0.040542956441640854,
-0.0289070513099432,
0.06427635997533798,
0.029022449627518654,
0.06343010812997818,
0.035369306802749634,
-0.013645743951201439,
0.06273772567510605,
0.008842326700687408,
-0.029022449627518654,
-0.008198024705052376,
-0.022464029490947723,
-0.021271590143442154,
0.001858379109762609,
0.03531160578131676,
-0.0027623255737125874,
0.03833117336034775,
0.01952139474451542,
-0.032022781670093536,
-0.03311905637383461,
0.036330949515104294,
0.001942523056641221,
-0.012299440801143646,
-0.0289070513099432,
-0.01809816062450409,
-0.0863172635436058,
0.02702222764492035,
0.032772865146398544,
0.024945072829723358,
0.02861855737864971,
-0.01948292925953865,
-0.0024353661574423313,
-0.003764840541407466,
-0.01647298038005829,
-0.017771201208233833,
0.04065835475921631,
-0.016723008826375008,
-0.04038909450173378,
0.026406774297356606,
-0.02725302241742611,
-0.04538964852690697,
0.06831526756286621,
0.021194657310843468,
0.059045009315013885,
0.018636681139469147,
0.013809223659336567,
0.002339201746508479,
0.07266189903020859,
0.02936864085495472,
0.028849352151155472,
0.07954727858304977,
-0.05946813151240349,
-0.054621439427137375,
0.007697968743741512,
-0.07108480483293533,
0.023117948323488235,
0.00013703442527912557,
-0.048966966569423676,
-0.03585013002157211,
0.015895992517471313,
-0.03531160578131676,
0.01468432042747736,
-0.031176533550024033,
0.00468801986426115,
0.023637237027287483,
0.02019454725086689,
-0.003507600398734212,
0.027079924941062927,
0.027426118031144142,
0.02748381718993187,
-0.006846913136541843,
0.02065613679587841,
-0.021483151242136955,
0.027079924941062927,
-0.06943077594041824,
-0.04154306650161743,
-0.02467581257224083,
-0.0002815817133523524,
-0.023425674065947533,
-0.005611198954284191,
-0.020598437637090683,
-0.05527535825967789,
-0.03950437903404236,
0.01575174741446972,
0.004519731737673283,
-0.013039907440543175,
0.03754262253642082,
0.03029181994497776,
-0.005327513907104731,
-0.013472647406160831,
-0.04131227359175682,
-0.031003437936306,
-0.0404275581240654,
0.023406442254781723,
0.05681399255990982,
-0.03377297520637512,
-0.013434181921184063,
0.033715277910232544,
0.023367974907159805,
0.10693493485450745,
0.03631171956658363,
0.024598881602287292,
0.032561302185058594,
0.0027983873151242733,
-0.013876538723707199,
0.018896326422691345,
0.021656246855854988,
0.04408181086182594,
0.0053996373899281025,
0.05492916703224182,
-0.038850460201501846,
0.004055737983435392,
0.030195655301213264,
0.027849242091178894,
0.03377297520637512,
-0.0034114359878003597,
-0.00029104790883138776,
-0.03610015660524368,
0.09662609547376633,
0.0567755252122879,
-0.00722195440903306,
-0.04554351046681404,
0.03996596857905388,
-0.04808225482702255,
-0.0011389483697712421,
0.0078566400334239,
0.04950549080967903,
-0.0028825311455875635,
0.038158077746629715,
0.04388948157429695,
0.016953803598880768,
-0.03644634783267975,
-0.0021781260147690773,
-0.007919147610664368,
0.011712837032973766,
0.03631171956658363,
0.008226873353123665,
0.031618889421224594,
0.0011888337321579456,
0.0042528752237558365,
0.000522594025824219,
-0.03119576722383499,
0.04631282761693001,
0.0166556928306818,
0.03283056244254112,
-0.04058142378926277,
-0.0756237730383873,
0.056044675409793854,
-0.000073438131948933,
0.0848555639386177,
-0.036042459309101105,
0.013972703367471695,
-0.01479971781373024,
0.052467357367277145,
0.045428112149238586,
-0.014030401594936848,
0.005832377355545759,
0.02281022071838379,
-0.010712726041674614,
-0.02188704162836075,
0.04646668955683708,
0.06300698965787888,
-0.004120649304240942,
0.04904389753937721,
-0.03196508437395096,
0.023137180134654045,
0.009856862016022205,
0.011414727196097374,
0.0031998739577829838,
-0.06946924328804016,
-0.024368086829781532,
0.0241949912160635,
0.030195655301213264,
-0.0530058778822422,
-0.001651625381782651,
-0.00378888170234859,
-0.012712948024272919,
0.0559292770922184,
-0.07570070028305054,
-0.02019454725086689,
0.03233050927519798,
-0.05585234612226486,
0.03825424239039421,
0.03961977735161781,
-0.05377519503235817,
0.048274584114551544,
-0.010943520814180374,
-0.02181011065840721,
-0.024598881602287292,
0.007250803988426924,
0.03273439779877663,
-0.021463917568325996,
0.005332321859896183,
-0.0030027367174625397,
0.05942966789007187,
-0.0279646385461092,
0.005221732892096043,
0.016511445865035057,
-0.03692717105150223,
-0.0026108664460480213,
-0.07546990364789963,
0.04962088540196419,
-0.05396752059459686,
0.013174537569284439,
-0.04077375307679176,
-0.0161844864487648,
-0.014761252328753471,
-0.04858230799436569,
0.03319598734378815,
-0.008356695994734764,
-0.005952583160251379,
-0.011299329809844494,
0.03079187497496605,
-0.035792429000139236,
-0.02069460228085518,
-0.014415060169994831,
0.036042459309101105,
0.018963640555739403,
-0.02936864085495472,
0.006058364175260067,
0.01504012942314148,
-0.05431371554732323,
0.013222619891166687,
-0.020059917122125626,
0.029214777052402496,
0.04723600670695305,
-0.010885822586715221,
-0.03056108020246029,
-0.05492916703224182,
-0.0027262638323009014,
-0.01760772243142128
]
|
36,616 | rfc3987 | resolve | Resolves_ an `URI reference` relative to a `base` URI.
`Test cases <http://tools.ietf.org/html/rfc3986#section-5.4>`_::
>>> base = resolve.test_cases_base
>>> for relative, resolved in resolve.test_cases.items():
... assert resolve(base, relative) == resolved
If `return_parts` is True, returns a dict of named parts instead of
a string.
Examples::
>>> assert resolve('urn:rootless', '../../name') == 'urn:name'
>>> assert resolve('urn:root/less', '../../name') == 'urn:/name'
>>> assert resolve('http://a/b', 'http:g') == 'http:g'
>>> assert resolve('http://a/b', 'http:g', strict=False) == 'http://a/g'
.. _Resolves: http://tools.ietf.org/html/rfc3986#section-5.2
| def resolve(base, uriref, strict=True, return_parts=False):
"""Resolves_ an `URI reference` relative to a `base` URI.
`Test cases <http://tools.ietf.org/html/rfc3986#section-5.4>`_::
>>> base = resolve.test_cases_base
>>> for relative, resolved in resolve.test_cases.items():
... assert resolve(base, relative) == resolved
If `return_parts` is True, returns a dict of named parts instead of
a string.
Examples::
>>> assert resolve('urn:rootless', '../../name') == 'urn:name'
>>> assert resolve('urn:root/less', '../../name') == 'urn:/name'
>>> assert resolve('http://a/b', 'http:g') == 'http:g'
>>> assert resolve('http://a/b', 'http:g', strict=False) == 'http://a/g'
.. _Resolves: http://tools.ietf.org/html/rfc3986#section-5.2
"""
#base = normalize(base)
if isinstance(base, basestring):
B = parse(base, 'IRI')
else:
B = _i2u(dict(base))
if not B.get('scheme'):
raise ValueError('Expected an IRI (with scheme), not %r.' % base)
if isinstance(uriref, basestring):
R = parse(uriref, 'IRI_reference')
else:
R = _i2u(dict(uriref))
# _last_segment = get_compiled_pattern(r'(?<=^|/)%(segment)s$')
if R['scheme'] and (strict or R['scheme'] != B['scheme']):
T = R
else:
T = {}
T['scheme'] = B['scheme']
if R['authority'] is not None:
T['authority'] = R['authority']
T['path'] = R['path']
T['query'] = R['query']
else:
T['authority'] = B['authority']
if R['path']:
if R['path'][:1] == "/":
T['path'] = R['path']
elif B['authority'] is not None and not B['path']:
T['path'] = '/%s' % R['path']
else:
T['path'] = ''.join(B['path'].rpartition('/')[:2]) + R['path']
# _last_segment.sub(R['path'], B['path'])
T['query'] = R['query']
else:
T['path'] = B['path']
if R['query'] is not None:
T['query'] = R['query']
else:
T['query'] = B['query']
T['fragment'] = R['fragment']
T['path'] = _remove_dot_segments(T['path'])
if return_parts:
return T
else:
return compose(**T)
| (base, uriref, strict=True, return_parts=False) | [
-0.026175450533628464,
0.014075113460421562,
-0.028576157987117767,
-0.00032640661811456084,
-0.015004419721662998,
0.00022476377489510924,
0.031944893300533295,
0.03868236020207405,
0.00006061512976884842,
-0.05908837169408798,
0.04088946431875229,
0.08673522621393204,
-0.006403498817235231,
0.03664950281381607,
0.004322240594774485,
0.020096242427825928,
0.009951317682862282,
0.05254450812935829,
-0.030183084309101105,
-0.014491365291178226,
-0.03610740974545479,
0.00040899141458794475,
0.011219433508813381,
0.0007574811461381614,
-0.008649321272969246,
-0.007782937493175268,
0.02938930131494999,
-0.06586456298828125,
0.009830314666032791,
-0.013939589262008667,
0.015033460222184658,
0.021161071956157684,
-0.004496485460549593,
0.016049887984991074,
0.04073457792401314,
-0.04321272671222687,
-0.03362926095724106,
0.06090826168656349,
-0.04979531094431877,
0.006655185949057341,
-0.062263499945402145,
0.01485921535640955,
-0.045419830828905106,
0.004694931209087372,
0.028769763186573982,
0.04530366510152817,
-0.014017031528055668,
0.016679106280207634,
-0.011945453472435474,
0.009433423168957233,
0.03637845814228058,
-0.04611681029200554,
-0.04313528537750244,
-0.014539766125380993,
-0.009980359114706516,
0.03163512423634529,
-0.06578712165355682,
0.08619312942028046,
0.018528038635849953,
0.0186635609716177,
0.046581462025642395,
-0.02691115252673626,
-0.019312139600515366,
0.02756940945982933,
-0.037733692675828934,
0.01813114620745182,
-0.005411271005868912,
-0.05711359530687332,
-0.047239720821380615,
0.014762412756681442,
-0.007686134893447161,
0.012952201999723911,
-0.023794105276465416,
-0.04863367974758148,
0.09525386244058609,
0.04131539538502693,
0.01714375987648964,
0.00048068593605421484,
0.03070581890642643,
0.015343228355050087,
-0.022380786016583443,
-0.037946660071611404,
-0.02482021413743496,
-0.08696755021810532,
-0.010386929847300053,
0.018363473936915398,
-0.004944198299199343,
-0.06276687234640121,
0.028711682185530663,
0.0025047699455171824,
-0.0448002927005291,
0.01639837771654129,
0.017995622009038925,
0.04154771938920021,
0.015943406149744987,
-0.018169866874814034,
-0.029350580647587776,
0.015198024921119213,
0.012400426901876926,
-0.0737636610865593,
-0.006950434297323227,
0.03908893093466759,
-0.1215841993689537,
0.013697582297027111,
0.014404242858290672,
0.01070637907832861,
0.024007070809602737,
-0.04665890336036682,
0.016533901914954185,
-0.02179996855556965,
-0.04576832056045532,
-0.08379241824150085,
-0.032835476100444794,
0.0343456007540226,
-0.03124791383743286,
-0.002570111770182848,
0.009796434082090855,
-0.01768585480749607,
0.03209977596998215,
-0.005600036587566137,
-0.0003140037879347801,
0.03010564111173153,
-0.04731716215610504,
0.010938705876469612,
0.027220919728279114,
-0.022748636081814766,
-0.038817886263132095,
0.041237954050302505,
0.06710363179445267,
-0.03632037341594696,
0.041625164449214935,
0.024413641542196274,
-0.06981410831212997,
0.019370220601558685,
-0.008818726055324078,
0.06342513114213943,
-0.05250578746199608,
0.05475160852074623,
-0.02118043228983879,
0.026949873194098473,
-0.014346160925924778,
-0.02966034971177578,
0.004039092920720577,
-0.026233533397316933,
-0.01624349318444729,
-0.008591240271925926,
0.05994023382663727,
-0.021102989092469215,
-0.05099566653370857,
0.041508998721838,
0.05409334972500801,
-0.014588167890906334,
0.017037276178598404,
0.001136826816946268,
-0.01725992187857628,
-0.06261198967695236,
0.017366405576467514,
0.0038503275718539953,
-0.013997671194374561,
-0.019631588831543922,
0.008223390206694603,
-0.008450875990092754,
0.02602056786417961,
-0.011626005172729492,
0.03424879536032677,
0.042515747249126434,
0.040192484855651855,
-0.060946982353925705,
0.018363473936915398,
-0.011984175071120262,
-0.06129547208547592,
0.03451984375715256,
-0.08843895047903061,
0.0061034103855490685,
0.03608804941177368,
-0.029640987515449524,
-0.002555591519922018,
-0.006582583766430616,
-0.05970790982246399,
0.029369940981268883,
0.04925321787595749,
-0.052312180399894714,
0.01215841993689537,
-0.050105080008506775,
0.006514822132885456,
0.06195373088121414,
-0.013252289965748787,
0.01639837771654129,
0.04259318858385086,
-0.010551494546234608,
-0.04692995175719261,
0.0010811651591211557,
0.0069117131642997265,
0.051421597599983215,
0.037559449672698975,
-0.042786795645952225,
0.0010079581988975406,
0.017017915844917297,
0.0003820681886281818,
0.010144923813641071,
-0.08139171451330185,
-0.031189830973744392,
-0.03177064657211304,
0.020289847627282143,
-0.002422487596049905,
-0.017879460006952286,
-0.037830498069524765,
-0.0005154744139872491,
0.03996015712618828,
0.03144151717424393,
-0.059669189155101776,
0.0016178152291104198,
-0.014355841092765331,
-0.003821286838501692,
-0.004394842777401209,
-0.012293943203985691,
-0.01681463047862053,
0.02954418584704399,
0.049988918006420135,
0.029021451249718666,
0.02933122031390667,
-0.015043140389025211,
0.10795437544584274,
-0.02768557332456112,
-0.022709915414452553,
-0.02245822735130787,
0.013494296930730343,
-0.003913249354809523,
-0.00589044438675046,
-0.035642754286527634,
0.03548787161707878,
-0.08518637716770172,
0.03384222462773323,
0.010464372113347054,
0.07523506134748459,
-0.02646585926413536,
0.02288416028022766,
0.048943448811769485,
0.12189396470785141,
0.015507793053984642,
-0.0009541116887703538,
0.03814026713371277,
-0.04844007268548012,
0.011635685339570045,
-0.030066920444369316,
-0.01728896237909794,
0.013271651230752468,
-0.033048443496227264,
0.028363192453980446,
-0.04046352952718735,
-0.0020873083267360926,
0.028459995985031128,
-0.013707263395190239,
0.0037220639642328024,
-0.008528318256139755,
-0.00013726321049034595,
-0.0531640462577343,
-0.026756267994642258,
0.018983010202646255,
-0.02497509866952896,
0.0346553698182106,
-0.020657697692513466,
0.03521682322025299,
0.031499601900577545,
-0.0337454229593277,
-0.0794556587934494,
0.0036978633143007755,
-0.028595518320798874,
-0.023039042949676514,
-0.01624349318444729,
-0.026291614398360252,
-0.026291614398360252,
-0.049059610813856125,
0.03527490422129631,
-0.04050225019454956,
0.048556238412857056,
-0.008508957922458649,
0.0003460696607362479,
0.06001767888665199,
0.013978310860693455,
-0.09037500619888306,
0.00468283100053668,
-0.008247590623795986,
-0.01884748600423336,
0.052738115191459656,
0.006248614750802517,
-0.01414287555962801,
0.03351309522986412,
-0.03422943502664566,
-0.021277233958244324,
0.053357649594545364,
-0.04797542095184326,
-0.06636793166399002,
0.0029282819014042616,
-0.0006140921614132822,
0.03862427920103073,
-0.045535992830991745,
-0.07298924028873444,
0.031557682901620865,
-0.0040560332126915455,
-0.0564553365111351,
0.009264019317924976,
0.0030638056341558695,
0.018479635939002037,
-0.00940922275185585,
-0.03138343617320061,
0.03637845814228058,
-0.06632921099662781,
-0.02129659429192543,
0.005474193021655083,
0.002906501293182373,
-0.03180936723947525,
-0.008634801022708416,
0.014075113460421562,
0.019515424966812134,
0.004428723827004433,
-0.01414287555962801,
-0.008954250253736973,
-0.0004770558443851769,
0.0067907096818089485,
-0.056261733174324036,
0.04940810054540634,
0.008170148357748985,
0.052738115191459656,
0.014026711694896221,
0.010774141177535057,
-0.03390030562877655,
0.060946982353925705,
0.024839574471116066,
0.010241726413369179,
-0.009612509049475193,
0.013368453830480576,
0.01998007856309414,
0.0007490109419450164,
-0.07074341922998428,
-0.02580760046839714,
0.04220597818493843,
-0.037443287670612335,
0.015401310287415981,
0.04166388511657715,
0.04340633377432823,
0.02559463493525982,
0.011335596442222595,
-0.0014084794092923403,
0.004421463701874018,
-0.021587003022432327,
-0.013697582297027111,
0.04274807497859001,
0.001816260744817555,
-0.054790329188108444,
-0.10369505733251572,
-0.0702013224363327,
-0.016001487150788307,
0.03209977596998215,
-0.008697723038494587,
0.04398714751005173,
-0.024529805406928062,
-0.05661022290587425,
0.034965138882398605,
0.0026451339945197105,
0.04452924430370331,
-0.04522622376680374,
-0.0355459526181221,
-0.04232214391231537,
0.04294167831540108,
-0.02542039006948471,
0.004174616653472185,
0.028266388922929764,
0.001740028616040945,
-0.039321258664131165,
0.009573787450790405,
-0.020541533827781677,
0.02938930131494999,
-0.02079322189092636,
0.015314187854528427,
-0.048285190016031265,
0.024007070809602737,
-0.002478149253875017,
-0.01251658983528614,
0.013639501295983791,
0.04325144737958908,
0.06896224617958069,
-0.02079322189092636,
0.014956017956137657,
0.0002214361884398386,
-0.019408943131566048,
0.08534126728773117,
0.021451478824019432,
0.0007229952025227249,
0.04549727216362953,
-0.020289847627282143,
0.00005724972652387805,
0.04007631912827492,
-0.019496064633131027,
-0.020948104560375214,
-0.06555479019880295,
0.03996015712618828,
-0.036513980478048325,
0.005633917637169361,
-0.010183644481003284,
0.02189677208662033,
-0.00279275793582201,
0.018498996272683144,
0.03688183054327965,
0.03637845814228058,
-0.007221481762826443,
0.10230109840631485,
0.008325032889842987,
-0.006427699699997902,
-0.0660194456577301,
-0.07670646160840988,
-0.05041484907269478,
-0.0291182529181242,
-0.051266711205244064,
-0.016495181247591972,
-0.010938705876469612,
0.01568203791975975,
-0.002398286946117878,
-0.008053985424339771,
-0.024239396676421165,
-0.00621957378461957,
-0.04925321787595749,
-0.017550330609083176,
0.037888579070568085,
-0.007274723146110773,
-0.02141275815665722,
-0.03115111030638218,
-0.03279675543308258,
0.023406894877552986,
0.03171256557106972,
0.020735139027237892,
-0.00900749210268259,
-0.044761572033166885,
-0.051692645996809006,
0.032119136303663254,
-0.049059610813856125,
-0.01576916128396988,
0.035410430282354355,
0.022167818620800972,
-0.05204113572835922,
-0.015662677586078644,
0.024065151810646057,
-0.026949873194098473,
-0.010580535978078842,
0.025246145203709602,
-0.045419830828905106,
-0.034926414489746094,
-0.000736910616979003,
-0.06501269340515137,
-0.017540650442242622,
-0.020154323428869247,
-0.09726735949516296,
0.0394180603325367,
-0.000274072663160041,
-0.06342513114213943,
-0.021819328889250755,
0.019999438896775246,
0.07906845211982727,
-0.006742308381944895,
0.026117369532585144,
0.04402587190270424,
0.010270766913890839,
0.0364365391433239,
0.012719875201582909,
-0.049446821212768555,
0.0456908755004406,
0.05498393625020981,
-0.016020847484469414,
-0.03148023784160614,
-0.023755384609103203,
-0.0005526829627342522,
-0.0026281934697180986,
-0.0028508396353572607,
0.023232650011777878,
0.03819834813475609,
0.047510769218206406,
-0.004995019640773535,
0.02811150625348091,
0.0043924227356910706,
-0.029195696115493774,
-0.027530688792467117,
-0.02350369654595852,
0.0117228077724576,
0.04452924430370331,
0.03659142181277275,
-0.046465300023555756,
0.00018407638708595186,
0.03599124401807785,
-0.013426534831523895,
-0.033977750688791275,
0.0038067663554102182,
0.040812019258737564,
-0.009099454618990421,
0.06756828725337982,
0.0032090097665786743,
0.0063889785669744015,
0.024994459003210068,
-0.03186745196580887,
0.0012124539352953434,
-0.0555647537112236,
0.060288723558187485,
-0.034926414489746094,
0.019960718229413033,
0.06907840818166733,
-0.00029131563496775925,
0.048788562417030334,
-0.024200676009058952,
0.018895888701081276,
0.004651369992643595,
-0.010164284147322178,
-0.05904965102672577,
0.0373271219432354,
0.09037500619888306,
0.012284263037145138,
-0.021528922021389008,
0.02350369654595852,
0.02025112509727478,
0.007260202895849943,
-0.0271821990609169,
-0.03874044120311737,
0.02855679765343666,
0.02536230906844139,
0.04274807497859001,
0.01708567701280117,
0.03091878443956375,
-0.007129519246518612,
0.009888396598398685,
0.03428751975297928,
0.008634801022708416,
0.006456740200519562,
0.013116766698658466,
0.007395726628601551,
0.05382230505347252,
-0.022032296285033226,
0.07690007239580154,
0.09254338592290878,
0.024665329605340958,
-0.09997783601284027,
-0.02685306966304779,
0.03390030562877655,
0.0498727522790432,
0.003281611716374755,
-0.045652154833078384,
-0.011596963740885258,
0.01628221571445465,
-0.01031916867941618,
0.012990922667086124,
-0.04387098550796509,
0.054829053580760956,
-0.0180730652064085,
0.022148458287119865,
-0.0033880947157740593,
0.030415410175919533,
0.05630045384168625,
-0.003092846367508173,
-0.016921112313866615,
0.004421463701874018,
-0.0011053659254685044,
-0.038004741072654724,
-0.006156652234494686,
-0.006824590731412172,
0.01636933721601963,
-0.0158272422850132,
0.04785925894975662,
-0.047897979617118835,
0.03599124401807785,
0.050608452409505844,
-0.003325172932818532,
0.017627771943807602,
-0.00766193401068449,
-0.02598184533417225,
0.028653601184487343,
0.006161492317914963,
0.010386929847300053,
-0.004014892037957907,
0.04321272671222687,
-0.0036373615730553865,
-0.08658033609390259,
0.10787693411111832,
-0.010357889346778393,
0.026446498930454254,
0.006684226915240288,
0.02207101695239544,
0.009888396598398685,
0.017017915844917297,
-0.008112066425383091,
0.010435331612825394,
0.06342513114213943,
0.011103270575404167,
-0.07693879306316376,
-0.048401352018117905,
-0.08727731555700302,
0.04948554188013077,
-0.009559267200529575,
-0.0037825657054781914,
-0.05657150223851204,
-0.07387982308864594,
-0.029428021982312202,
0.03163512423634529,
-0.042012374848127365,
0.003032344626262784,
-0.005474193021655083,
0.04143155738711357,
0.044103313237428665,
-0.029466742649674416,
0.002819378860294819,
0.04627169296145439,
-0.012584351934492588,
-0.016863031312823296,
0.029582906514406204,
0.05904965102672577,
-0.04286423698067665,
0.025555914267897606,
-0.014462323859333992,
-0.0322546623647213,
-0.02183869108557701,
-0.01827635057270527,
0.024684689939022064,
-0.0839473083615303,
-0.023077765479683876,
0.0062679750844836235,
-0.02729836292564869,
-0.024858934804797173,
0.020831942558288574,
-0.009109134785830975,
0.04274807497859001,
0.0030952664092183113,
-0.0018102106405422091,
-0.04677506536245346,
-0.03182872757315636,
0.02625289373099804,
-0.008755804970860481,
-0.020541533827781677,
-0.023426255211234093,
-0.005396750755608082,
-0.04782053455710411,
0.12034512311220169,
0.025129981338977814,
0.01039661094546318,
0.053628697991371155,
-0.034694090485572815,
-0.026562662795186043,
-0.020289847627282143,
0.023852186277508736,
-0.012923161499202251,
0.0003893283719662577,
0.019128214567899704,
-0.06296047568321228,
0.01574011892080307,
0.05266067013144493,
0.029079532250761986,
0.07221481949090958,
0.03064773604273796,
0.00005452714685816318,
0.026562662795186043,
0.08007519692182541,
0.05498393625020981,
0.0030468651093542576,
-0.02867296151816845,
0.0695817843079567,
-0.04824646934866905,
-0.003676082706078887,
0.010958066210150719,
0.01705663651227951,
-0.011354957707226276,
0.046426575630903244,
0.016582302749156952,
-0.00967543013393879,
-0.04046352952718735,
-0.01786009967327118,
0.0027733976021409035,
0.005953366402536631,
0.008712243288755417,
-0.0083637535572052,
-0.018808765336871147,
0.015120582655072212,
-0.024781491607427597,
0.01039661094546318,
-0.01557555515319109,
0.01356205902993679,
0.0725633054971695,
0.0008990550995804369,
-0.027491968125104904,
0.019070133566856384,
0.051924970000982285,
0.03721095994114876,
0.012613392435014248,
-0.021606363356113434,
0.0019142734818160534,
-0.02938930131494999,
0.08263079077005386,
-0.02840191312134266,
-0.01615637168288231,
0.029621627181768417,
-0.050608452409505844,
0.05161520093679428,
-0.026833709329366684,
-0.014413923025131226,
0.048014141619205475,
-0.02437492087483406,
0.07442191988229752,
-0.01725992187857628,
0.029524825513362885,
-0.046426575630903244,
0.042670633643865585,
0.01962190866470337,
-0.0103772496804595,
-0.0025241305120289326,
-0.05149903893470764,
0.01693079248070717,
-0.02102554775774479,
0.020870663225650787,
0.0008391584269702435,
-0.04340633377432823,
0.054403118789196014,
-0.0543643981218338,
-0.02156764268875122,
0.023736022412776947,
-0.01529482752084732,
0.01144208014011383,
0.05149903893470764,
-0.04414203390479088,
0.07267946749925613,
-0.03186745196580887,
0.0006098570302128792,
-0.003412295365706086,
0.037172239273786545,
0.042515747249126434,
0.012681154534220695,
-0.011838970705866814,
-0.0297184307128191,
0.07004643976688385,
-0.006437379866838455,
0.007352165412157774,
-0.006824590731412172,
-0.05289299786090851,
0.041199229657649994,
-0.04754948988556862,
-0.002829059027135372,
-0.010929025709629059,
0.03808218240737915,
-0.011374318040907383,
-0.04545855149626732,
-0.011229113675653934,
-0.06129547208547592,
0.009685110300779343,
0.02042536996304989,
-0.007845859043300152,
-0.0213546771556139,
0.028847206383943558,
0.0018440915737301111,
0.024413641542196274,
-0.013339412398636341,
-0.0005835387855768204,
0.003238050499930978,
-0.0448002927005291,
-0.0024188575334846973,
-0.008460556156933308,
-0.04007631912827492,
-0.014017031528055668,
-0.04023120552301407,
0.0060453289188444614,
0.0030976864509284496,
0.032274022698402405,
-0.04170260578393936,
0.03961166739463806,
-0.005856563802808523,
0.009220457635819912
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.