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
716,401
pytorch_optimizer.optimizer.fp16
DynamicLossScaler
Dynamically adjusts the loss scaling factor. Dynamic loss scalers are important in mixed-precision training. They help us avoid underflows and overflows in low-precision gradients. See here for information: <https://docs.nvidia.com/deeplearning/performance/mixed-precision-training/index.html#lossscaling> Shamelessly stolen and adapted from FairSeq. <https://github.com/pytorch/fairseq/blob/main/fairseq/optim/fp16_optimizer.py> Reference : 'https://github.com/facebookresearch/ParlAI/blob/main/parlai/utils/fp16.py' :param init_scale: Initial loss scale. :param scale_factor: Factor by which to increase or decrease loss scale. :param scale_window: If we do not experience overflow in scale_window iterations, loss scale will increase by scale_factor. :param tolerance: Pct of iterations that have overflowed after which we must decrease the loss scale. :param threshold: If not None, loss scale will decrease below this threshold.
class DynamicLossScaler: r"""Dynamically adjusts the loss scaling factor. Dynamic loss scalers are important in mixed-precision training. They help us avoid underflows and overflows in low-precision gradients. See here for information: <https://docs.nvidia.com/deeplearning/performance/mixed-precision-training/index.html#lossscaling> Shamelessly stolen and adapted from FairSeq. <https://github.com/pytorch/fairseq/blob/main/fairseq/optim/fp16_optimizer.py> Reference : 'https://github.com/facebookresearch/ParlAI/blob/main/parlai/utils/fp16.py' :param init_scale: Initial loss scale. :param scale_factor: Factor by which to increase or decrease loss scale. :param scale_window: If we do not experience overflow in scale_window iterations, loss scale will increase by scale_factor. :param tolerance: Pct of iterations that have overflowed after which we must decrease the loss scale. :param threshold: If not None, loss scale will decrease below this threshold. """ def __init__( self, init_scale: float = 2.0 ** 15, scale_factor: float = 2.0, scale_window: int = 2000, tolerance: float = 0.00, threshold: Optional[float] = None, ): # fmt: skip self.loss_scale = init_scale self.scale_factor = scale_factor self.scale_window = scale_window self.tolerance = tolerance self.threshold = threshold self.iter: int = 0 self.last_overflow_iter: int = -1 self.last_rescale_iter: int = -1 self.overflows_since_rescale: int = 0 self.has_overflow_serial: bool = False def update_scale(self, overflow: bool): r"""Update the loss scale. If overflow exceeds our tolerance, we decrease the loss scale. If the number of iterations since the last overflow exceeds the scale window, we increase the loss scale. :param overflow: bool. adjust scales to prevent overflow. """ iter_since_rescale: int = self.iter - self.last_rescale_iter if overflow: # calculate how often we overflowed already self.last_overflow_iter = self.iter self.overflows_since_rescale += 1 pct_overflow: float = self.overflows_since_rescale / float(iter_since_rescale) if pct_overflow >= self.tolerance: # decrease loss scale by the scale factor self.decrease_loss_scale() # reset iterations self.last_rescale_iter = self.iter self.overflows_since_rescale = 0 elif (self.iter - self.last_overflow_iter) % self.scale_window == 0: # increase the loss scale by scale factor self.loss_scale *= self.scale_factor self.last_rescale_iter = self.iter self.iter += 1 def decrease_loss_scale(self): r"""Decrease the loss scale by self.scale_factor. NOTE: the loss_scale will not go below `self.threshold`. """ self.loss_scale /= self.scale_factor if self.threshold is not None: self.loss_scale = max(self.loss_scale, self.threshold)
(init_scale: float = 32768.0, scale_factor: float = 2.0, scale_window: int = 2000, tolerance: float = 0.0, threshold: Optional[float] = None)
[ -0.00042458955431357026, -0.05847708880901337, -0.04632195830345154, 0.048230938613414764, 0.014356301166117191, -0.012077214196324348, -0.018067121505737305, -0.02043386735022068, 0.003491678275167942, 0.02058970183134079, -0.012651855126023293, 0.011931118555366993, 0.07129452377557755, 0.0017044454580172896, -0.045971330255270004, 0.04834781587123871, -0.008122900500893593, 0.006340537220239639, -0.011716845445334911, 0.028323015198111534, 0.05010095611214638, 0.03260847553610802, 0.012924566864967346, 0.03030990995466709, -0.02623872086405754, 0.0354524664580822, 0.01369400229305029, 0.013148579746484756, -0.051854100078344345, -0.009973441250622272, -0.04998408257961273, 0.022284407168626785, 0.04086773470044136, 0.015671158209443092, -0.031011167913675308, -0.029608653858304024, -0.024602454155683517, 0.005780505016446114, -0.09615020453929901, -0.04527007415890694, -0.00759695703163743, 0.028303535655140877, 0.025440067052841187, -0.028634684160351753, 0.019849484786391258, 0.023394731804728508, -0.023725882172584534, -0.00818133819848299, -0.04706217348575592, -0.0397963672876358, 0.026258200407028198, -0.025206314399838448, 0.01620684191584587, 0.020044278353452682, -0.024232344701886177, 0.06626883894205093, 0.020920850336551666, 0.03475121036171913, 0.003528202185407281, -0.08454049378633499, 0.015057558193802834, -0.03202409669756889, -0.02668674662709236, -0.013869316317141056, -0.0061067845672369, -0.045815493911504745, -0.01818399876356125, 0.008634233847260475, 0.009744558483362198, -0.0254790261387825, -0.01105454657226801, -0.03235524520277977, 0.016158143058419228, -0.008010894060134888, -0.028381451964378357, -0.018758639693260193, 0.021544191986322403, -0.02668674662709236, 0.009910132735967636, -0.04156899079680443, 0.0793200209736824, 0.006559680216014385, 0.04503631964325905, -0.02768019400537014, 0.03800426423549652, -0.0948256105184555, 0.0012758992379531264, 0.003701081732288003, -0.005590581335127354, -0.021972738206386566, 0.0012320706155151129, 0.011171422898769379, 0.044997360557317734, 0.04258191958069801, 0.003177573438733816, 0.009856564924120903, -0.033679842948913574, -0.023589525371789932, 0.08033294975757599, -0.03202409669756889, 0.022985665127635002, 0.02775811217725277, 0.0378289520740509, 0.06490528583526611, 0.027037374675273895, 0.012564198113977909, 0.007791751064360142, 0.018719680607318878, -0.012038255110383034, 0.0011340649798512459, -0.005444485694169998, 0.04721800982952118, -0.06529486924409866, -0.012573937885463238, -0.05368516221642494, 0.0001941850350704044, -0.05481496825814247, 0.017843108624219894, -0.0022888267412781715, 0.04125732183456421, -0.055009759962558746, -0.01833983324468136, -0.040010642260313034, -0.01892421394586563, 0.008945903740823269, -0.03543298691511154, 0.029530735686421394, 0.02670622617006302, 0.00437312014400959, 0.023550566285848618, -0.035783614963293076, 0.012116172350943089, -0.007996284402906895, 0.03757571801543236, 0.037906866520643234, -0.07986544817686081, -0.007528779096901417, 0.11033119261264801, 0.014229685068130493, -0.01104480680078268, 0.029063230380415916, 0.019508596509695053, -0.0029876495245844126, 0.02781655080616474, 0.020550742745399475, -0.019099529832601547, 0.07390476018190384, 0.005537013057619333, -0.014278382994234562, 0.020258551463484764, -0.053879957646131516, 0.012534978799521923, 0.062762551009655, 0.023102540522813797, 0.07086597383022308, 0.005434746388345957, -0.008906945586204529, -0.0407118983566761, -0.028985314071178436, 0.014093329198658466, -0.019586512818932533, -0.047179050743579865, -0.02284931018948555, -0.05789270997047424, -0.025673819705843925, 0.009627682156860828, 0.005790244787931442, 0.000463852658867836, -0.007105102762579918, 0.1118895411491394, 0.05076325684785843, -0.0638144388794899, 0.03537454828619957, 0.024310262873768806, -0.01900213211774826, 0.09887731820344925, 0.04398443177342415, -0.006881089881062508, -0.0016813137335702777, 0.04102356731891632, -0.0005420745583251119, -0.03718613088130951, 0.013547906652092934, -0.09022847563028336, -0.03627059981226921, 0.03806270286440849, -0.014502395875751972, 0.0023898761719465256, -0.06638571619987488, 0.005322739947587252, 0.02095980942249298, -0.05208785459399223, 0.007061274256557226, 0.0014877374051138759, -0.00923809502273798, -0.004743228200823069, 0.006140873767435551, -0.001306335674598813, 0.08383923768997192, 0.021544191986322403, -0.009642291814088821, 0.0666973888874054, 0.057581037282943726, 0.01622632145881653, -0.019859224557876587, -0.03757571801543236, -0.0043487707152962685, 0.026939978823065758, -0.04094564914703369, -0.03356296569108963, -0.09170890599489212, 0.01346024964004755, 0.03030990995466709, 0.041296280920505524, 0.050334710627794266, 0.022810351103544235, -0.010041618719696999, -0.007640785537660122, -0.015077037736773491, 0.011629188433289528, 0.01863202452659607, -0.01541792694479227, -0.0425429604947567, 0.024193385615944862, 0.031420234590768814, 0.014122548513114452, 0.01704445481300354, 0.006121394224464893, 0.09147515147924423, 0.005239952355623245, -0.000010072588338516653, -0.025459546595811844, -0.012992744334042072, 0.031108565628528595, 0.07137243449687958, 0.013138839974999428, -0.01066495943814516, 0.04078981652855873, 0.0499061644077301, 0.0034235005732625723, -0.03584205359220505, 0.0017847978742793202, -0.011356476694345474, 0.03989376500248909, 0.011405175551772118, 0.02715425193309784, 0.04172482714056969, 0.08937138319015503, 0.01104480680078268, 0.01945989765226841, -0.008230037055909634, -0.058944594115018845, -0.02563486061990261, 0.027173731476068497, -0.003024173201993108, 0.01402515172958374, -0.059606894850730896, -0.0026175412349402905, 0.0011766761308535933, -0.013986192643642426, -0.043633803725242615, 0.004307377152144909, -0.0756579041481018, 0.06319110095500946, -0.02436870150268078, -0.03136179596185684, -0.013333633542060852, 0.00976890791207552, -0.022829830646514893, 0.06397027522325516, 0.049049071967601776, 0.011814242228865623, -0.060230232775211334, -0.009218615479767323, -0.010850013233721256, 0.042348165065050125, -0.009379319846630096, 0.02602444775402546, 0.057658955454826355, 0.01160970889031887, 0.03983532637357712, -0.04998408257961273, -0.016382155939936638, -0.045893412083387375, 0.01938197948038578, 0.02261555753648281, -0.02731008641421795, -0.03445901721715927, 0.028556765988469124, 0.02563486061990261, -0.002917036646977067, 0.018222957849502563, 0.04745176434516907, 0.0284983292222023, 0.011580489575862885, -0.02208961360156536, -0.032316286116838455, -0.024680370464920998, 0.017745712772011757, -0.03724456951022148, 0.020375428721308708, -0.03001772053539753, -0.03319285809993744, 0.02715425193309784, -0.016411375254392624, -0.060230232775211334, -0.013625823892652988, -0.027017896994948387, 0.03740040585398674, 0.03290066868066788, -0.00039019627729430795, 0.016265280544757843, -0.006506111938506365, 0.028985314071178436, 0.0630352646112442, -0.04488048329949379, 0.04897115379571915, 0.0027782460674643517, -0.006174962501972914, 0.06841157376766205, -0.033913593739271164, 0.043633803725242615, -0.03732248768210411, 0.013616085052490234, -0.047256968915462494, -0.0425429604947567, 0.029978761449456215, 0.017745712772011757, 0.012038255110383034, -0.07702145725488663, -0.007368074264377356, -0.04117940366268158, 0.034809645265340805, -0.0012150261318311095, -0.0139180151745677, -0.052750151604413986, 0.028868436813354492, 0.0345369353890419, 0.03521871566772461, -0.06299630552530289, 0.002800160553306341, 0.023472649976611137, -0.05076325684785843, 0.03274483233690262, 0.03580309450626373, -0.010684438049793243, 0.08399507403373718, -0.024777768179774284, -0.0037424752954393625, -0.007139191497117281, -0.01126881968230009, -0.06891803443431854, -0.00958385318517685, 0.04110148549079895, 0.021213041618466377, -0.044296104460954666, -0.017073674127459526, -0.03893927484750748, 0.038510728627443314, -0.08438466489315033, 0.006160352844744921, -0.012301227077841759, -0.009837085381150246, 0.034887563437223434, 0.007655395194888115, 0.021661067381501198, -0.03734196722507477, -0.03350452706217766, -0.01093767024576664, 0.016713306307792664, -0.00916017685085535, -0.07047638297080994, -0.008643973618745804, -0.01519391406327486, -0.037595197558403015, 0.013382332399487495, -0.07600852847099304, 0.008468659594655037, 0.037984784692525864, 0.041062526404857635, 0.09809814393520355, -0.0014804326929152012, -0.05469809100031853, -0.009096869267523289, 0.06587925553321838, -0.0034965481609106064, 0.008044982329010963, -0.025907572358846664, 0.028556765988469124, -0.01876837946474552, -0.018729420378804207, 0.0208818931132555, 0.01862228475511074, -0.054191626608371735, -0.04215337336063385, 0.0005384221440181136, 0.03854968771338463, 0.07647603750228882, -0.015398447401821613, 0.0037936086300760508, -0.04336109384894371, 0.032238367944955826, 0.025517983362078667, 0.012544718571007252, -0.03153711184859276, -0.01357712596654892, 0.07141139358282089, 0.10627948492765427, -0.04632195830345154, 0.11929170787334442, -0.015719857066869736, 0.02027803100645542, -0.03794582560658455, -0.019849484786391258, -0.010226673446595669, -0.003837437368929386, -0.030972208827733994, -0.012642115354537964, -0.0284983292222023, 0.00493802223354578, -0.019703390076756477, 0.012807690538465977, 0.02366744354367256, 0.05497080087661743, -0.03490704298019409, -0.0556720606982708, -0.04133524000644684, -0.022070134058594704, -0.05317869782447815, -0.01047990471124649, -0.028186658397316933, -0.0020940329413861036, -0.024992041289806366, -0.018437230959534645, 0.02384275756776333, -0.03831593319773674, -0.024193385615944862, 0.04601028934121132, -0.045659661293029785, -0.03506287932395935, 0.027115292847156525, -0.05407474935054779, 0.05286702886223793, 0.03471225127577782, 0.054503295570611954, -0.055321432650089264, -0.0013842532644048333, -0.022225968539714813, -0.10113692283630371, -0.006632728036493063, 0.007041794713586569, -0.0167425237596035, 0.021602628752589226, 0.03356296569108963, -0.007942715659737587, -0.057347286492586136, -0.03627059981226921, -0.05847708880901337, 0.019567035138607025, -0.03319285809993744, -0.032569520175457, 0.06517799943685532, -0.039543136954307556, -0.006622988265007734, -0.04484152793884277, 0.015515323728322983, 0.04199753701686859, -0.012466801330447197, -0.0032140971161425114, 0.00946697685867548, -0.013090141117572784, 0.00905304029583931, 0.03527715057134628, -0.00695900758728385, -0.028829477727413177, -0.024232344701886177, -0.022790871560573578, 0.003968922886997461, 0.01605100743472576, 0.010177974589169025, 0.0706322193145752, -0.04036127030849457, 0.03987428545951843, -0.020726056769490242, -0.0176580548286438, -0.030426787212491035, -0.022790871560573578, 0.039718449115753174, -0.01735612563788891, 0.03210201486945152, -0.03305650129914284, 0.018437230959534645, 0.061360038816928864, 0.03469277173280716, -0.061282120645046234, -0.08594301342964172, -0.013207017444074154, 0.004404773935675621, 0.03516027703881264, -0.03800426423549652, 0.030446266755461693, -0.0026345858350396156, -0.035725176334381104, 0.0005000721430405974, 0.06751552224159241, -0.0018663678783923388, -0.04425714537501335, 0.05271119624376297, -0.03301754593849182, 0.013830358162522316, -0.013966713100671768, -0.013392072170972824, -0.022381804883480072, -0.02127148024737835, 0.024095989763736725, -0.017171071842312813, -0.05216577276587486, 0.039328861981630325, 0.02723217010498047, -0.01809634082019329, 0.014950421638786793, 0.004163716919720173, -0.03395255282521248, -0.025810174643993378, 0.006890829652547836, -0.022459721192717552, -0.07152827084064484, -0.04456881433725357, 0.08407299220561981, 0.03761467710137367, 0.01013901550322771, -0.027173731476068497, 0.027193211019039154, 0.043789640069007874, 0.012914827093482018, 0.02058970183134079, -0.040088556706905365, -0.01788206771016121, -0.043477971106767654, -0.004636091645807028, -0.04215337336063385, 0.038354892283678055, 0.030718978494405746, -0.002527449280023575, -0.03543298691511154, 0.019333282485604286, -0.0070174457505345345, 0.07308661937713623, 0.0034770688507705927, -0.028537288308143616, 0.0011791110737249255, 0.04258191958069801, 0.006398975383490324, 0.023862237110733986, 0.024095989763736725, -0.011259079910814762, 0.017073674127459526, 0.0023752665147185326, -0.005605190992355347, 0.004451037850230932, -0.058321256190538406, -0.0538409985601902, 0.05423058569431305, -0.03679654374718666, -0.019138488918542862, 0.010869492776691914, -0.013655043207108974, 0.02738800458610058, 0.019586512818932533, 0.014210205525159836, 0.00697848666459322, 0.03225784748792648, 0.036017369478940964, -0.014765367843210697, -0.05134763941168785, -0.022868787869811058, 0.045815493911504745, -0.06860636919736862, 0.011035067029297352, -0.02888791635632515, 0.013129100203514099, -0.010061098262667656, -0.02308306097984314, 0.0011304125655442476, -0.024855684489011765, -0.002977909753099084, -0.03778999298810959, 0.026784144341945648, -0.02247920073568821, 0.03928990289568901, -0.01856384612619877, 0.04406234994530678, -0.018953433260321617, -0.05711353197693825, 0.0005487705930136144, 0.01447317749261856, -0.03716665133833885, 0.02865416370332241, 0.05847708880901337, 0.03704977408051491, -0.042737752199172974, 0.022303886711597443, -0.019654691219329834, 0.028537288308143616, 0.02111564390361309, -0.055009759962558746, 0.028400931507349014, -0.038802918046712875, 0.036757584661245346, -0.019206665456295013, -0.057581037282943726, 0.009744558483362198, 0.0018383662682026625, -0.038569167256355286, 0.012116172350943089, 0.0033041893038898706, -0.0067349947057664394, -0.009871174581348896, 0.09724105149507523, -0.06447673588991165, -0.01244732178747654, 0.023706402629613876, -0.007855058647692204, 0.011190902441740036, -0.03514079749584198, -0.0003305406717117876, 0.044296104460954666, -0.0446467325091362, -0.06019127368927002, -0.07819022238254547, -0.015262091532349586, 0.018583325669169426, 0.06019127368927002, -0.02955021522939205, -0.015525063499808311, 0.042504001408815384, 0.020492304116487503, 0.008478398434817791, 0.04834781587123871, -0.030524183064699173, 0.07421642541885376, -0.0002990388893522322, -0.025907572358846664, -0.011229860596358776, -0.022868787869811058, -0.043789640069007874, 0.05481496825814247, 0.00795732531696558, 0.042270246893167496, 0.0378289520740509, -0.022362325340509415, 0.023940155282616615, -0.057736873626708984, -0.039328861981630325, 0.061866503208875656, 0.006900569424033165, 0.007845318876206875, 0.029803447425365448, 0.019362499937415123, -0.02316097915172577, -0.059606894850730896, 0.005551622249186039, 0.03313441947102547, 0.04382859915494919, -0.006632728036493063, 0.019859224557876587, -0.005994778126478195, -0.05941209942102432, 0.017005495727062225, 0.0023923111148178577, -0.01969365030527115, -0.018953433260321617, -0.03319285809993744, -0.0038155228830873966, 0.025907572358846664, 0.026004968211054802, 0.0009703164687380195, -0.02894635498523712, -0.007100232876837254, 0.006608378607779741, -0.005103596951812506, 0.004287898074835539, -0.07074909657239914, 0.018378792330622673, 0.06389235705137253, -0.0033991513773798943, -0.0077138333581388, 0.027095813304185867, -0.028381451964378357, -0.003236011601984501, -0.011190902441740036, 0.05407474935054779, -0.029686570167541504, -0.03401099145412445, -0.03330973535776138, -0.08212505280971527, -0.039640530943870544, 0.008911815471947193, 0.0725022405385971, -0.02744644321501255, -0.011483092792332172, -0.0036523831076920033, -0.0732814148068428, -0.04698425903916359, 0.02978396788239479, 0.05586685240268707, -0.048230938613414764, -0.0284983292222023, 0.049282822757959366, 0.014210205525159836, 0.009953961707651615, 0.07055430114269257, 0.06159378960728645, -0.05746416375041008, -0.011307778768241405, 0.01583673432469368, 0.008600144647061825, 0.013031703419983387, -0.04593237116932869, 0.03839385136961937, 0.02970604971051216, 0.02240128442645073, 0.03358244523406029, 0.008307954296469688, -0.07986544817686081, -0.005502923857420683, 0.04484152793884277, -0.039095111191272736, 0.041296280920505524, 0.02549850381910801, 0.039932724088430405, 0.021310439333319664, -0.006038607098162174, -0.01346024964004755, 0.030446266755461693, -0.01569063775241375, 0.0425429604947567, -0.03817958012223244, 0.0032092274632304907, 0.014736148528754711, 0.0010062315268442035, -0.009754298254847527, -0.008161858655512333, -0.015515323728322983, -0.02353108674287796, 0.015807515010237694, 0.018008684739470482, 0.02421286515891552, 0.038257498294115067, -0.03710821270942688, 0.02775811217725277, -0.036017369478940964, -0.02857624553143978, 0.012281747534871101, 0.01334337331354618, -0.0753851905465126, 0.022673994302749634, -0.01346024964004755, -0.03177086263895035, -0.05060742050409317, -0.004465647041797638, -0.020492304116487503, 0.04869844391942024, 0.04636091738939285, -0.01154153048992157, -0.02269347384572029, 0.05111388489603996, 0.024115469306707382 ]
716,402
pytorch_optimizer.optimizer.fp16
__init__
null
def __init__( self, init_scale: float = 2.0 ** 15, scale_factor: float = 2.0, scale_window: int = 2000, tolerance: float = 0.00, threshold: Optional[float] = None, ): # fmt: skip self.loss_scale = init_scale self.scale_factor = scale_factor self.scale_window = scale_window self.tolerance = tolerance self.threshold = threshold self.iter: int = 0 self.last_overflow_iter: int = -1 self.last_rescale_iter: int = -1 self.overflows_since_rescale: int = 0 self.has_overflow_serial: bool = False
(self, init_scale: float = 32768.0, scale_factor: float = 2.0, scale_window: int = 2000, tolerance: float = 0.0, threshold: Optional[float] = None)
[ -0.0019346349872648716, -0.06179996207356453, -0.03409653156995773, 0.02786596678197384, -0.011919338256120682, 0.008388685993850231, -0.04923047870397568, -0.03136952966451645, -0.03767233341932297, -0.006027392577379942, -0.0049212416633963585, 0.06028295308351517, 0.053564783185720444, 0.020840782672166824, -0.038105763494968414, 0.04392095282673836, 0.0036593270488083363, -0.009553530253469944, 0.027739550918340683, 0.061330411583185196, 0.02857029251754284, -0.006831044796854258, -0.00024733191821724176, 0.09463232010602951, -0.014194848015904427, 0.07328587025403976, -0.02102137729525566, 0.013797536492347717, -0.007386377546936274, -0.023856734856963158, -0.05450388044118881, 0.012750079855322838, 0.020389292389154434, 0.03523428365588188, 0.000012821612472180277, -0.007937195710837841, -0.0021355480421334505, -0.004672922194004059, -0.08813086152076721, 0.0038128336891531944, 0.023387186229228973, 0.004085985012352467, -0.006352465134114027, -0.011621354147791862, -0.00032733031548559666, 0.022989874705672264, 0.022393908351659775, -0.016091106459498405, 0.004718071315437555, -0.034656379371881485, -0.028949543833732605, -0.01534163299947977, 0.005160531494766474, 0.028136860579252243, -0.05591253191232681, 0.0759948119521141, 0.03492727130651474, 0.0573573000729084, 0.009869572706520557, -0.040164556354284286, -0.04959166795015335, 0.02131033129990101, -0.00011816341429948807, -0.0029053385369479656, -0.009499351494014263, -0.03357280045747757, -0.0649784505367279, -0.010284943506121635, -0.018330497667193413, -0.010474570095539093, 0.045365720987319946, 0.0009955356363207102, -0.0016231067711487412, 0.02707134559750557, -0.03756397217512131, 0.0022800248116254807, 0.006939402315765619, -0.007801748346537352, -0.028299396857619286, -0.04789406806230545, 0.036155324429273605, 0.08011239767074585, -0.001886099809780717, -0.015152006410062313, 0.06974618881940842, -0.08372431993484497, 0.027739550918340683, 0.038755908608436584, -0.0025057699531316757, 0.010971209034323692, -0.051325391978025436, 0.006713657174259424, 0.0384308360517025, 0.01786094717681408, 0.02371225878596306, 0.016100136563181877, -0.019052881747484207, -0.015197155997157097, 0.03017759695649147, -0.022989874705672264, -0.00013114375178702176, -0.0010198032250627875, -0.013923954218626022, 0.029744166880846024, -0.017599083483219147, 0.008867264725267887, 0.01441156305372715, -0.02546403929591179, -0.046160344034433365, 0.021328391507267952, 0.010655165649950504, 0.05645431950688362, -0.06617038697004318, 0.04048962891101837, -0.06602590531110764, 0.00993278156965971, -0.031604304909706116, 0.022177191451191902, 0.010673224925994873, -0.012018665671348572, -0.00872730277478695, -0.005810677073895931, -0.044354382902383804, 0.04059798642992973, -0.013327986933290958, -0.01921541802585125, 0.061041459441185, 0.0370221845805645, -0.010284943506121635, 0.015738943591713905, -0.016352970153093338, -0.031604304909706116, -0.01711147464811802, 0.044715575873851776, 0.013454403728246689, -0.07621152698993683, 0.01078158337622881, 0.07411660999059677, -0.039406053721904755, -0.024795833975076675, 0.024543000385165215, 0.021527046337723732, -0.03577607497572899, -0.008447378873825073, -0.02042541094124317, 0.03133340924978256, 0.026800449937582016, -0.0347466766834259, 0.021689582616090775, 0.022502265870571136, -0.03713054209947586, -0.025030609220266342, -0.00034905827487818897, -0.0005378375644795597, 0.06295577436685562, -0.022610623389482498, 0.014691486954689026, -0.033410266041755676, 0.02252032421529293, 0.04088694229722023, -0.025752993300557137, 0.016948936507105827, 0.0026276721619069576, -0.08350760489702225, -0.04272902011871338, 0.016786400228738785, -0.02873282879590988, -0.01243403647094965, -0.014799844473600388, 0.0686626136302948, 0.03922545909881592, -0.05724894255399704, 0.012163142673671246, 0.023044053465127945, -0.03229057043790817, 0.07296079397201538, 0.060680266469717026, 0.026836570352315903, -0.05230060964822769, 0.034259065985679626, 0.0014910459285601974, -0.018303407356142998, -0.013228659518063068, -0.025301503017544746, -0.02696298621594906, 0.033952053636312485, 0.0063298908062279224, 0.02131033129990101, -0.04063410684466362, -0.011142775416374207, 0.049013763666152954, -0.03653457760810852, -0.002458363538607955, -0.004438147414475679, -0.0029820918571203947, 0.0013522127410396934, 0.0005841152742505074, -0.013075152412056923, 0.03557741641998291, 0.03633592277765274, -0.042765140533447266, 0.06371428072452545, 0.060680266469717026, -0.04374035820364952, -0.0019436647417023778, -0.03207385540008545, -0.0008928216411732137, 0.0415370874106884, -0.020335113629698753, -0.002720227697864175, -0.09412664920091629, -0.023296887055039406, -0.0075760032050311565, 0.042765140533447266, 0.024597179144620895, -0.007643727120012045, -0.02257450297474861, -0.003280075266957283, 0.01042942050844431, 0.014122609049081802, 0.0508558414876461, -0.012903586030006409, -0.05298687517642975, -0.01093508955091238, 0.017102444544434547, 0.03496339172124863, 0.07057692855596542, -0.01890840381383896, 0.06887932866811752, -0.00010151472088182345, -0.031495947390794754, -0.057429537177085876, -0.01183807011693716, -0.016289761289954185, 0.03144177049398422, 0.023947034031152725, 0.00007463695510523394, 0.033897873014211655, 0.005101837683469057, -0.026258662343025208, 0.012831347994506359, -0.019558550789952278, -0.006862649228423834, 0.011964486911892891, -0.0039685978554189205, -0.010158526711165905, 0.03593860939145088, 0.048616450279951096, -0.031044457107782364, 0.01856527104973793, -0.028389696031808853, -0.06692888587713242, 0.0014267086517065763, -0.0008629104122519493, 0.022881517186760902, 0.008339021354913712, -0.060716383159160614, -0.037347257137298584, 0.01572088524699211, -0.04099529981613159, 0.001327380770817399, -0.0009955356363207102, -0.03846695274114609, 0.07198558002710342, -0.03442160412669182, -0.017833858728408813, -0.03864755108952522, 0.009151703678071499, 0.016804460436105728, 0.037058304995298386, 0.0700712576508522, 0.024831954389810562, -0.013192540034651756, 0.02481389418244362, -0.0032687881030142307, 0.0005496891681104898, -0.0040182615630328655, -0.0432346910238266, 0.04262066259980202, 0.039803363382816315, 0.04890540614724159, -0.02922043763101101, -0.002806010888889432, -0.011829040013253689, 0.04146484658122063, -0.03158624470233917, -0.016488417983055115, -0.014682456851005554, 0.011792920529842377, -0.03171266242861748, -0.056129246950149536, 0.041500966995954514, 0.040164556354284286, 0.013923954218626022, 0.020732423290610313, -0.010303003713488579, 0.00810424704104662, -0.0418260395526886, 0.00772048020735383, -0.024633297696709633, 0.02642119862139225, -0.08798638731241226, -0.007589547894895077, 0.028443874791264534, -0.01348149310797453, 0.0000840194770717062, -0.01496238075196743, 0.0017754847649484873, 0.05970504879951477, 0.018727807328104973, 0.01198254618793726, 0.06349756568670273, 0.010366211645305157, -0.006889738608151674, 0.023730318993330002, -0.008320962078869343, 0.05605700612068176, -0.04023679345846176, -0.026800449937582016, 0.07924553751945496, -0.020840782672166824, 0.019937802106142044, -0.036155324429273605, -0.027450596913695335, -0.0363178625702858, -0.042259469628334045, 0.049772266298532486, 0.005110867787152529, 0.04532960429787636, -0.03713054209947586, -0.061330411583185196, -0.035396821796894073, 0.037058304995298386, -0.02512090839445591, -0.04081470146775246, -0.051217034459114075, 0.0326337032020092, 0.041500966995954514, -0.004736131057143211, -0.07111871987581253, 0.018195049837231636, -0.022935695946216583, -0.023694198578596115, 0.025247324258089066, 0.0363178625702858, -0.032651763409376144, 0.02766731195151806, -0.07982344180345535, -0.0036164354532957077, -0.024687476456165314, 0.006176384165883064, -0.023351065814495087, -0.014519920572638512, 0.06393099576234818, 0.05089196190237999, 0.014005222357809544, -0.02822715975344181, -0.0712270736694336, 0.039514411240816116, -0.03268788009881973, 0.035396821796894073, 0.034800853580236435, -0.02506672963500023, 0.002796981018036604, 0.004487811122089624, -0.008515102788805962, -0.028714768588542938, -0.025157026946544647, -0.00335231376811862, 0.03387981653213501, 0.005124412477016449, -0.07245513051748276, -0.04970002546906471, -0.00572940893471241, -0.02631284110248089, -0.011242102831602097, -0.08625266700983047, -0.00880857091397047, 0.019684966653585434, 0.02297181449830532, 0.06277517974376678, 0.023784497752785683, -0.03922545909881592, 0.008664094842970371, -0.011169864796102047, -0.0054269107058644295, -0.0019402785692363977, 0.0042959279380738735, 0.08849205076694489, 0.010014049708843231, -0.0037405951879918575, 0.02391091361641884, 0.04919435828924179, -0.01826728880405426, -0.015043648891150951, 0.037600092589855194, 0.0508558414876461, 0.06747067719697952, -0.0025373741518706083, 0.0010689027840271592, -0.0469188466668129, 0.01890840381383896, -0.0286786500364542, 0.050169575959444046, 0.026385080069303513, -0.025752993300557137, 0.04467945918440819, 0.022195251658558846, 0.024597179144620895, 0.11702622473239899, -0.0018025741446763277, -0.010844791308045387, -0.003975369967520237, -0.04197051748633385, -0.0689515620470047, -0.007381862495094538, -0.04442662373185158, -0.019287655130028725, -0.0319293774664402, -0.0347466766834259, -0.01851109229028225, 0.048110783100128174, 0.050422411412000656, 0.043162450194358826, -0.000521753216162324, -0.061872199177742004, 0.0033974628895521164, -0.028787007555365562, 0.0031875199638307095, -0.009052376262843609, -0.07476675510406494, 0.013373135589063168, -0.014610218815505505, -0.03082774206995964, 0.05027793347835541, -0.03203773498535156, -0.062233392149209976, 0.03492727130651474, -0.02876894734799862, -0.004036321304738522, 0.041356489062309265, -0.03191131725907326, 0.09968900680541992, -0.013508583419024944, 0.03077356331050396, -0.0248680729418993, -0.040164556354284286, 0.00045882677659392357, -0.0986054316163063, -0.004957361146807671, 0.040959179401397705, -0.030737444758415222, 0.012217321433126926, 0.016181403771042824, 0.026041947305202484, -0.05721282213926315, -0.10727404057979584, 0.003027240978553891, 0.017942216247320175, -0.0429457351565361, -0.016479387879371643, 0.01896258257329464, -0.0573573000729084, -0.03599279001355171, -0.03713054209947586, 0.07512794435024261, 0.06230562925338745, 0.02111167646944523, 0.01141366921365261, 0.013571791350841522, -0.006618844345211983, 0.01490820199251175, 0.020985258743166924, -0.02432628534734249, -0.0069213430397212505, -0.015142977237701416, -0.04644929990172386, 0.00026383952354080975, 0.02416374906897545, 0.013138361275196075, 0.03454802185297012, -0.03508980944752693, 0.06487009674310684, 0.003146885894238949, -0.05974116548895836, -0.007332198787480593, -0.008420289494097233, 0.0037654272746294737, -0.00021558650769293308, 0.029906703159213066, -0.06851813197135925, 0.05165046453475952, 0.007436041720211506, 0.06692888587713242, -0.01926959678530693, -0.03994784131646156, 0.026637913659214973, 0.03257952257990837, 0.039658889174461365, -0.03839471563696861, 0.010438450612127781, -0.024001212790608406, -0.03792516514658928, -0.01781579852104187, 0.04717168211936951, -0.0016005323268473148, -0.09405440837144852, 0.0128584373742342, -0.022881517186760902, -0.012551424093544483, 0.005499149207025766, -0.005300493445247412, -0.03767233341932297, 0.014718576334416866, -0.0006433733506128192, 0.006271196994930506, -0.06887932866811752, 0.023242708295583725, -0.013770447112619877, -0.0026999106630682945, -0.004654862452298403, 0.06219727173447609, 0.037961285561323166, -0.011901278048753738, 0.016542596742510796, -0.030249834060668945, 0.01750878430902958, -0.022339729592204094, 0.08834757655858994, 0.04027291387319565, -0.02136451005935669, -0.06461726129055023, -0.0017438804497942328, 0.03346444293856621, -0.005368216894567013, 0.02531956322491169, -0.021852118894457817, -0.04128425195813179, -0.017599083483219147, -0.04334304854273796, -0.031206993386149406, 0.029708046466112137, 0.06692888587713242, -0.03196549788117409, -0.016623863950371742, 0.05378149822354317, -0.0004111381422262639, 0.0861804261803627, -0.022538384422659874, -0.03164042532444, 0.05872982740402222, 0.013002914376556873, 0.008578311651945114, -0.018890345469117165, -0.02037123218178749, -0.022556444630026817, 0.02828133851289749, -0.0025644635315984488, 0.02506672963500023, -0.0028534173034131527, -0.04962778836488724, -0.01916123926639557, 0.07426108419895172, 0.0020113883074373007, -0.06458114087581635, -0.00945420190691948, -0.016100136563181877, 0.017833858728408813, -0.0014278372982516885, 0.03422294929623604, 0.01781579852104187, 0.013779477216303349, 0.013698209077119827, 0.017301099374890327, -0.04659377411007881, -0.04189828038215637, 0.03752785548567772, -0.00077430548844859, -0.017680350691080093, -0.050314053893089294, 0.0048715779557824135, -0.01606401614844799, -0.02887730486690998, -0.05500955134630203, -0.0017991879722103477, 0.007901076227426529, -0.054467763751745224, -0.006627874448895454, -0.051469869911670685, 0.008578311651945114, 0.00910655502229929, 0.04359588027000427, -0.04374035820364952, -0.019739145413041115, -0.025301503017544746, -0.047713469713926315, -0.012722990475594997, -0.029635807499289513, 0.03409653156995773, 0.05334806814789772, -0.06310025602579117, 0.030899981036782265, -0.04565467685461044, 0.03377145901322365, -0.0029617748223245144, -0.07751181721687317, 0.023495543748140335, 0.00599127309396863, 0.017978334799408913, -0.010465539991855621, -0.016091106459498405, 0.025048669427633286, -0.008826631121337414, -0.016398118808865547, 0.008700213395059109, -0.05807968229055405, -0.007535369135439396, 0.006551120895892382, 0.09831647574901581, -0.02040735073387623, 0.00843383464962244, 0.022592563182115555, -0.0016851866384968162, 0.025409860536456108, -0.028443874791264534, -0.027595072984695435, 0.06779574602842331, -0.07202169299125671, -0.01926959678530693, -0.05233673006296158, 0.021942418068647385, 0.00349679053761065, 0.027793729677796364, -0.0892866775393486, -0.01248821523040533, 0.03642622008919716, 0.018276318907737732, 0.02147286757826805, 0.040056198835372925, 0.027902087196707726, 0.04348752275109291, 0.008569281548261642, 0.04847197234630585, -0.023947034031152725, 0.01735527813434601, -0.04839973524212837, 0.04038127139210701, -0.0009165248484350741, 0.03393399342894554, 0.04399319365620613, -0.013689178973436356, 0.05110867694020271, -0.011946427635848522, -0.020533768460154533, -0.0013014201540499926, 0.055623576045036316, -0.01135949045419693, 0.02647537738084793, 0.0480385422706604, -0.02282733842730522, -0.060174595564603806, 0.018691688776016235, 0.04789406806230545, 0.021888239309191704, 0.046666014939546585, 0.01346343383193016, 0.01685863919556141, -0.031604304909706116, -0.029852524399757385, 0.027902087196707726, -0.024001212790608406, 0.002442561322823167, -0.04839973524212837, 0.026511497795581818, 0.0143393250182271, 0.019197357818484306, -0.006013847887516022, -0.007386377546936274, -0.002532859332859516, -0.006659478414803743, -0.014005222357809544, 0.034602198749780655, -0.09477679431438446, -0.004099529702216387, 0.04742451757192612, -0.020876901224255562, -0.0542510487139225, -0.0033726308029145002, -0.002386125037446618, 0.025084787979722023, 0.024705536663532257, 0.04735228046774864, -0.004350106697529554, -0.007074849214404821, -0.07017961889505386, -0.02252032421529293, -0.08459118008613586, -0.06277517974376678, 0.06645933538675308, -0.05844087526202202, 0.04626870155334473, 0.014926262199878693, -0.07447779923677444, 0.028010444715619087, 0.033410266041755676, 0.0029233982786536217, -0.0661342665553093, -0.017978334799408913, 0.0799679234623909, 0.005241799633949995, 0.017481695860624313, 0.07758405059576035, 0.04702720418572426, -0.05995788052678108, -0.01846594363451004, 0.03922545909881592, 0.024344345554709435, 0.010853821411728859, -0.0759948119521141, 0.012795228511095047, 0.015738943591713905, 0.03568577393889427, 0.03153206780552864, 0.04569079354405403, -0.027685372158885002, -0.008018463850021362, 0.019233476370573044, -0.014881112612783909, 0.024380464106798172, -0.006844589486718178, 0.01330992765724659, 0.02526538446545601, -0.027595072984695435, -0.0011129230260849, -0.005300493445247412, -0.0469188466668129, 0.013219629414379597, -0.02461523935198784, 0.04500453174114227, 0.011567175388336182, 0.032308630645275116, -0.062125034630298615, -0.031857140362262726, 0.0019842989277094603, -0.03351862356066704, 0.022881517186760902, 0.04048962891101837, 0.01493529137223959, 0.04742451757192612, -0.016587745398283005, 0.006528546568006277, -0.040309034287929535, 0.00920588243752718, 0.035559359937906265, 0.019396012648940086, -0.08329088985919952, 0.02602388709783554, -0.005761013366281986, 0.0010722889564931393, -0.05638207867741585, 0.007765629328787327, -0.05345642566680908, 0.016804460436105728, 0.03962276875972748, 0.0018657827749848366, 0.03828635811805725, 0.05959669128060341, 0.00019089564739260823 ]
716,403
pytorch_optimizer.optimizer.fp16
decrease_loss_scale
Decrease the loss scale by self.scale_factor. NOTE: the loss_scale will not go below `self.threshold`.
def decrease_loss_scale(self): r"""Decrease the loss scale by self.scale_factor. NOTE: the loss_scale will not go below `self.threshold`. """ self.loss_scale /= self.scale_factor if self.threshold is not None: self.loss_scale = max(self.loss_scale, self.threshold)
(self)
[ -0.032900407910346985, -0.010394646786153316, 0.020858997479081154, 0.01600583828985691, -0.0270626749843359, -0.03520064800977707, -0.007684893906116486, 0.02800368331372738, 0.03704781085252762, -0.016363073140382767, -0.03868585824966431, 0.01452462375164032, 0.03903438150882721, -0.003483034437522292, -0.013601042330265045, 0.03248218074440956, -0.01845420151948929, -0.026905842125415802, 0.08015988767147064, 0.07702320069074631, 0.04879297688603401, -0.011692888103425503, 0.02514580823481083, -0.012163392268121243, -0.02010967582464218, 0.034608159214258194, 0.006587051786482334, 0.008268666453659534, -0.0019451843108981848, 0.0006905077607370913, -0.05356771871447563, -0.0029079741798341274, 0.018105680122971535, 0.00536287110298872, -0.049036942422389984, 0.03931319713592529, -0.016972985118627548, -0.002315488178282976, -0.03166315704584122, -0.041439179331064224, -0.050187062472105026, 0.05788937956094742, 0.016999123618006706, 0.017426062375307083, 0.05064013972878456, 0.011135254055261612, -0.02702782303094864, 0.017879141494631767, 0.027324067428708076, -0.022636456415057182, 0.000620803504716605, 0.01671159453690052, -0.011928140185773373, 0.043251488357782364, -0.00835579726845026, 0.005611192435026169, 0.012494486756622791, 0.028753003105521202, -0.0023873706813901663, -0.04558658227324486, 0.029798567295074463, -0.006826660130172968, -0.06649785488843918, -0.07120289653539658, 0.0655568465590477, -0.03270871937274933, 0.0023960836697369814, 0.05158114805817604, -0.005541488062590361, -0.022671308368444443, -0.04488953948020935, -0.05353286489844322, -0.009549482725560665, 0.0007879848126322031, -0.028857560828328133, -0.026104241609573364, 0.039382901042699814, 0.014176102355122566, -0.026243651285767555, -0.027899127453565598, 0.06078210845589638, 0.01459432765841484, 0.028090814128518105, 0.013714311644434929, 0.027794569730758667, -0.09124286472797394, 0.020283937454223633, -0.005833374802023172, -0.012416069395840168, 0.0004389189707580954, -0.011719027534127235, -0.01005483791232109, 0.07071496546268463, 0.03183741867542267, 0.02608681656420231, 0.02206139639019966, -0.07555940747261047, 0.03126235678792, 0.046248771250247955, -0.02840448170900345, 0.05551943555474281, 0.03649017587304115, 0.004112550988793373, 0.039661720395088196, 0.0329526849091053, 0.057575713843107224, 0.06886780261993408, -0.005707035772502422, -0.0013548764400184155, 0.037535738199949265, -0.03166315704584122, 0.052835822105407715, -0.04945516586303711, 0.04767770692706108, -0.06921631842851639, -0.04091639444231987, -0.03694325312972069, -0.04792167246341705, -0.0077545978128910065, 0.04973398521542549, -0.05443901941180229, -0.00257252249866724, 0.015683457255363464, -0.03359745070338249, 0.017504479736089706, 0.004962071310728788, 0.0359673947095871, 0.014350363053381443, 0.008939570747315884, 0.006395365111529827, -0.052870675921440125, -0.010141968727111816, -0.053811684250831604, -0.017391210421919823, 0.0487581230700016, -0.07604733854532242, -0.012520626187324524, 0.054752688854932785, 0.05837731063365936, -0.007458354812115431, 0.009436213411390781, 0.026017112657427788, 0.036803845316171646, -0.011492488905787468, 0.03277842327952385, -0.015692168846726418, 0.08566652238368988, -0.02716723270714283, 0.007401720155030489, 0.003724820911884308, -0.06099122017621994, 0.04314693063497543, 0.020057398825883865, -0.08183278888463974, 0.057575713843107224, 0.041508883237838745, -0.035653725266456604, -0.028787856921553612, -0.006216748151928186, 0.026644449681043625, 0.029937976971268654, 0.004678898025304079, 0.0027511396910995245, -0.0632217600941658, 0.009200961329042912, -0.05273126810789108, 0.06503406912088394, 0.025703443214297295, -0.034886978566646576, 0.04551687464118004, 0.005188610404729843, -0.026853563264012337, 0.0075585548765957355, 0.037640295922756195, 0.013905998319387436, 0.0487581230700016, 0.04558658227324486, 0.017643889412283897, -0.02397826313972473, 0.057610563933849335, 0.037466034293174744, -0.018576182425022125, 0.01812310516834259, 0.024030540138483047, 0.0226887334138155, -0.0205104760825634, -0.042310480028390884, 0.0477474108338356, -0.08629386126995087, -0.04760800302028656, 0.036699287593364716, -0.037675149738788605, 0.002600839827209711, -0.03805852308869362, 0.004410972353070974, 0.0014376501785591245, 0.03425963968038559, -0.034886978566646576, 0.060363881289958954, -0.002457074820995331, -0.023211516439914703, -0.018401922658085823, 0.041404325515031815, 0.01452462375164032, -0.00805519800633192, -0.03729177638888359, 0.023960836231708527, 0.028596168383955956, 0.004495924338698387, -0.044436462223529816, -0.05137203261256218, 0.042310480028390884, 0.04419249668717384, -0.03642047196626663, 0.05499665439128876, -0.04555172845721245, -0.015125822275876999, -0.005454357713460922, -0.019046686589717865, 0.023141810670495033, -0.07339857518672943, -0.004275920335203409, -0.02322894148528576, 0.0247101578861475, -0.0215211883187294, 0.03924349322915077, 0.035793133080005646, -0.015979699790477753, 0.1180092990398407, 0.0097498819231987, -0.024466192349791527, -0.032900407910346985, 0.030478183180093765, -0.008564909920096397, 0.03879041597247124, 0.035793133080005646, -0.01852390542626381, -0.018349643796682358, 0.001706665032543242, -0.012302800081670284, 0.0054674274288117886, -0.054926950484514236, -0.03704781085252762, 0.04868841916322708, -0.01400184165686369, 0.016920706257224083, 0.024082818999886513, -0.0031454043928533792, -0.011640610173344612, 0.02467530593276024, -0.0015247805276885629, -0.05618162825703621, 0.012843008153140545, 0.018976982682943344, 0.05259185656905174, -0.013226381503045559, -0.05241759866476059, -0.02568601630628109, -0.01533493585884571, -0.02648761495947838, -0.009366508573293686, 0.01563117839396, -0.009139969944953918, 0.052800972014665604, -0.001696862862445414, -0.0011272483970969915, 0.006247243378311396, 0.0085736233741045, 0.03927834704518318, 0.018367070704698563, 0.07904462516307831, -0.01845420151948929, -0.028195369988679886, 0.0060468437150120735, -0.03690840303897858, 0.004813950043171644, -0.009087692014873028, 0.02579057402908802, 0.08225101977586746, 0.03455588221549988, 0.018349643796682358, -0.07653526961803436, -0.012076261453330517, 0.0018950843950733542, 0.0628732368350029, 0.0066785383969545364, 0.0026661877054721117, -0.07451384514570236, -0.007658754475414753, 0.055728551000356674, -0.004805237054824829, 0.04032390937209129, 0.0031628303695470095, 0.04642303287982941, -0.03725692257285118, -0.07137715071439743, 0.013487773016095161, -0.03736148029565811, 0.05698322504758835, 0.0007536772172898054, -0.004652758594602346, -0.046248771250247955, -0.009662752039730549, 0.017931418493390083, 0.04021935164928436, 0.004761671647429466, 0.024135097861289978, -0.0033697648905217648, 0.01638050004839897, 0.05039617419242859, -0.02188713476061821, -0.003966607619076967, -0.045412320643663406, 0.033405762165784836, -0.012320226058363914, 0.035183221101760864, 0.07284094393253326, -0.01801854930818081, -0.051755405962467194, 0.04576084017753601, -0.06433702260255814, -0.011928140185773373, -0.05172055587172508, -0.004822663031518459, -0.02850903943181038, -0.07897491753101349, 0.019081538543105125, 0.03335348516702652, 0.030617592856287956, -0.06820560991764069, -0.038581304252147675, -0.03645532205700874, 0.055728551000356674, -0.038581304252147675, -0.03635076805949211, -0.05429961159825325, 0.04562143236398697, 0.0037858120631426573, 0.0050317756831645966, 0.009584334678947926, -0.031192652881145477, 0.00201379950158298, -0.022706160321831703, 0.01953461579978466, 0.020231658592820168, 0.03375428542494774, 0.02108553610742092, -0.050012800842523575, -0.014629179611802101, -0.06513862311840057, -0.0057288180105388165, -0.04255444556474686, -0.04562143236398697, 0.036559879779815674, -0.004962071310728788, -0.028962116688489914, -0.0036986819468438625, -0.003973142243921757, 0.03335348516702652, -0.08496948331594467, 0.02178257890045643, -0.029206082224845886, -0.055833104997873306, 0.03617650642991066, 0.006321304477751255, 0.006273382809013128, -0.03586283698678017, -0.06531288474798203, 0.029606880620121956, 0.027446048334240913, 0.019220948219299316, -0.03079185262322426, -0.009340370073914528, -0.011109115555882454, -0.035183221101760864, 0.030147088691592216, -0.05848186835646629, -0.02127722278237343, 0.05921376124024391, 0.07974166423082352, 0.038720712065696716, -0.02850903943181038, -0.05531032383441925, -0.011126541532576084, 0.06336116790771484, 0.01752190664410591, -0.00209766230545938, -0.0672297477722168, 0.020928701385855675, -0.04391367733478546, 0.01815795712172985, 0.02514580823481083, 0.03197682648897171, -0.03168058395385742, 0.0055458443239331245, 0.03931319713592529, -0.02720208466053009, 0.02282814309000969, 0.04171799495816231, 0.04562143236398697, -0.094797782599926, 0.04736403748393059, -0.024361636489629745, -0.018576182425022125, -0.03816307708621025, 0.02720208466053009, 0.004687611013650894, 0.11208443343639374, -0.0025659878738224506, 0.03816307708621025, 0.024396488443017006, 0.011928140185773373, -0.0564952977001667, -0.00946235191076994, 0.0021956840064376593, -0.006905077490955591, 0.023106958717107773, -0.0243790615350008, -0.0010629898170009255, -0.02938034199178219, -0.061444297432899475, 0.06733430922031403, 0.00008474784408463165, -0.028160518035292625, -0.003964429255574942, -0.07514118403196335, -0.006360513158142567, -0.008429857902228832, -0.02491926960647106, 0.02565116435289383, -0.04966427758336067, -0.03645532205700874, -0.008364509791135788, -0.030844131484627724, 0.03645532205700874, -0.01727794110774994, -0.002328557660803199, 0.0497688353061676, -0.025999685749411583, -0.03725692257285118, 0.04684125632047653, -0.037605442106723785, 0.044331904500722885, -0.001370124169625342, 0.07897491753101349, -0.013217668980360031, -0.04666699841618538, -0.02767258882522583, -0.06391879916191101, 0.012755878269672394, -0.04551687464118004, -0.029136376455426216, 0.002354696858674288, -0.0032172868959605694, 0.005615548696368933, -0.0290840994566679, -0.05977139621973038, -0.05046587809920311, 0.05788937956094742, 0.00044136951328255236, -0.02014452964067459, 0.029502324759960175, -0.04509865120053291, -0.015291370451450348, -0.01660703867673874, 0.0497688353061676, 0.052905526012182236, 0.02010967582464218, 0.03267386928200722, 0.00838629249483347, -0.009227100759744644, 0.005415149033069611, 0.04262414947152138, 0.0008457085932604969, -0.016972985118627548, -0.009052840061485767, -0.024570748209953308, -0.02824764885008335, 0.034451328217983246, 0.06709033995866776, 0.07109833508729935, -0.019621746614575386, 0.03256931155920029, -0.029641732573509216, 0.0007400630856864154, -0.010943567380309105, -0.045307762920856476, 0.01190200075507164, 0.02633078023791313, 0.04116035997867584, -0.044157642871141434, -0.014864431694149971, -0.00015424788580276072, 0.07029673457145691, -0.04736403748393059, -0.07186508178710938, -0.016633177176117897, -0.0339633971452713, 0.01457690168172121, 0.00023320973559748381, 0.006160113029181957, 0.02246219478547573, -0.04980368912220001, -0.03272614628076553, 0.011492488905787468, 0.03520064800977707, -0.039592016488313675, 0.06203678250312805, -0.013975702226161957, 0.0275680311024189, -0.03270871937274933, 0.02108553610742092, -0.039487458765506744, 0.015073544345796108, -0.004879297688603401, -0.021939413622021675, -0.049071792513132095, 0.031140374019742012, 0.0763261541724205, 0.0055981227196753025, -0.047259483486413956, -0.015117109753191471, -0.0033719432540237904, -0.025494329631328583, 0.01967402547597885, -0.05454357713460922, -0.033806562423706055, -0.024448765441775322, 0.07618674635887146, 0.030739575624465942, 0.005580696742981672, -0.009723743423819542, 0.022218231111764908, 0.036699287593364716, 0.006844086106866598, 0.028456760570406914, -0.07151656597852707, -0.04447131231427193, -0.02861359529197216, -0.023525185883045197, -0.03183741867542267, -0.03990568593144417, 0.04279841110110283, 0.01822766102850437, -0.062350451946258545, 0.01943005993962288, -0.04590024799108505, 0.04007994383573532, -0.02636563405394554, 0.000707389262970537, -0.021974265575408936, 0.0679267942905426, 0.014899283647537231, 0.012163392268121243, 0.026470189914107323, 0.05747115612030029, -0.002032314660027623, 0.04795652627944946, 0.015143248252570629, -0.027080101892352104, -0.019987694919109344, -0.046980664134025574, 0.10128027945756912, -0.002901439554989338, -0.001186061417683959, 0.0005451090401038527, -0.041474029421806335, 0.06580081582069397, 0.02680128440260887, 0.010229098610579967, -0.0010188801679760218, 0.020458197221159935, 0.036803845316171646, 0.02730664052069187, -0.05266156047582626, -0.03739633038640022, 0.05531032383441925, -0.02441391348838806, -0.018541330471634865, 0.036803845316171646, 0.009784734807908535, 0.01427194569259882, -0.0247101578861475, 0.03549689054489136, -0.005702679045498371, -0.014873145148158073, -0.003328378079459071, -0.023925984278321266, -0.013670746237039566, 0.018105680122971535, -0.0002138776908395812, 0.022340212017297745, -0.0011817049235105515, -0.05632103607058525, -0.024466192349791527, -0.02192198671400547, -0.015291370451450348, -0.009322944097220898, -0.01432422362267971, 0.058586422353982925, -0.003916507586836815, -0.037466034293174744, 0.02239249087870121, -0.0009464530157856643, 0.0019549864809960127, -0.02629592828452587, 0.03718721866607666, -0.046388179063797, -0.005393366329371929, 0.02127722278237343, -0.03739633038640022, 0.0205104760825634, -0.028996968641877174, -0.0009186802781186998, -0.0020965731237083673, -0.015962272882461548, 0.026435337960720062, -0.06384909152984619, 0.025442052632570267, -0.04450616613030434, 0.006081696134060621, 0.01398441568017006, 0.024152522906661034, 0.051023513078689575, -0.021800003945827484, 0.019360356032848358, 0.028491612523794174, -0.01986571215093136, -0.08622416108846664, -0.07639586180448532, -0.04028905928134918, -0.08929114788770676, 0.007227459456771612, -0.04032390937209129, -0.036734141409397125, 0.039626866579055786, 0.011492488905787468, -0.008316588588058949, 0.05112806707620621, -0.02192198671400547, 0.0564952977001667, -0.029345490038394928, 0.032970111817121506, -0.013078260235488415, -0.04691096022725105, -0.009183535352349281, -0.007257955148816109, 0.06653270870447159, -0.046179067343473434, 0.011178819462656975, 0.013975702226161957, 0.007445285562425852, 0.01104812417179346, -0.050953809171915054, 0.05147659033536911, 0.034608159214258194, 0.0507795475423336, 0.03791911154985428, 0.019813433289527893, -0.032063957303762436, -0.048409603536129, -0.020632458850741386, 0.04659729078412056, 0.048270195722579956, 0.04311208054423332, -0.0029057960491627455, -0.010063551366329193, -0.024135097861289978, -0.029328063130378723, -0.040393613278865814, -0.009166109375655651, -0.007201320491731167, -0.07339857518672943, -0.026470189914107323, 0.023716872557997704, -0.011658036150038242, 0.02770744077861309, 0.011213671416044235, -0.023211516439914703, -0.034207362681627274, -0.05809849500656128, 0.043251488357782364, -0.07078466564416885, 0.02430935762822628, 0.08524829894304276, -0.01745220273733139, -0.03750088810920715, 0.06670697033405304, -0.06123518571257591, 0.025546608492732048, 0.006892007775604725, -0.020196806639432907, -0.03840704262256622, -0.004657115321606398, -0.04314693063497543, 0.01351391151547432, -0.04366971552371979, 0.001532404450699687, 0.056634705513715744, 0.005153757985681295, 0.004635332617908716, -0.011684175580739975, -0.08622416108846664, -0.0052147493697702885, 0.04555172845721245, 0.026435337960720062, 0.004635332617908716, -0.05419505760073662, 0.001862410455942154, -0.006861512083560228, 0.00006357789970934391, 0.055728551000356674, 0.023385776206851006, -0.007336372509598732, -0.012572904117405415, 0.007314589805901051, -0.05489209666848183, -0.00027486891485750675, -0.02178257890045643, -0.004243246279656887, -0.016014551743865013, 0.01855875737965107, 0.068588986992836, 0.00582466134801507, -0.021730300039052963, -0.011152680031955242, 0.05628618225455284, -0.023542610928416252, -0.006521704141050577, 0.01211982686072588, -0.011335654184222221, -0.0016195346834138036, -0.007989849895238876, -0.033911120146512985, 0.02633078023791313, 0.015186813659965992, 0.02579057402908802, -0.04562143236398697, 0.07015732675790787, -0.005349801387637854, 0.0359673947095871, -0.04091639444231987, 0.01606683060526848, -0.0003297337971162051, 0.008795805275440216, 0.009383934549987316, 0.010821585543453693, 0.030181940644979477, 0.00308441324159503, -0.040428467094898224, 0.04973398521542549, -0.01707754097878933, 0.01410639751702547, -0.029537176713347435, 0.02010967582464218, -0.03694325312972069, 0.050953809171915054, 0.009427499957382679, 0.0019244907889515162, 0.012581617571413517, 0.031819991767406464, -0.010699602775275707, -0.006892007775604725, 0.02666187658905983, 0.03201167657971382, -0.005284453742206097, 0.024535896256566048, -0.02904924750328064 ]
716,404
pytorch_optimizer.optimizer.fp16
update_scale
Update the loss scale. If overflow exceeds our tolerance, we decrease the loss scale. If the number of iterations since the last overflow exceeds the scale window, we increase the loss scale. :param overflow: bool. adjust scales to prevent overflow.
def update_scale(self, overflow: bool): r"""Update the loss scale. If overflow exceeds our tolerance, we decrease the loss scale. If the number of iterations since the last overflow exceeds the scale window, we increase the loss scale. :param overflow: bool. adjust scales to prevent overflow. """ iter_since_rescale: int = self.iter - self.last_rescale_iter if overflow: # calculate how often we overflowed already self.last_overflow_iter = self.iter self.overflows_since_rescale += 1 pct_overflow: float = self.overflows_since_rescale / float(iter_since_rescale) if pct_overflow >= self.tolerance: # decrease loss scale by the scale factor self.decrease_loss_scale() # reset iterations self.last_rescale_iter = self.iter self.overflows_since_rescale = 0 elif (self.iter - self.last_overflow_iter) % self.scale_window == 0: # increase the loss scale by scale factor self.loss_scale *= self.scale_factor self.last_rescale_iter = self.iter self.iter += 1
(self, overflow: bool)
[ -0.010365487076342106, -0.023715658113360405, -0.01097680814564228, 0.03739846125245094, -0.01001487672328949, -0.014294123277068138, -0.0423969104886055, -0.019813992083072662, 0.02008369192481041, 0.03196849301457405, -0.024740520864725113, -0.028246626257896423, 0.08515341579914093, 0.006670590955764055, -0.03635561838746071, 0.0522499643266201, 0.0018485718173906207, 0.0018800367834046483, 0.031752731651067734, 0.06116805970668793, 0.052070166915655136, -0.013952502980828285, 0.03338891640305519, 0.026646403595805168, -0.0012158994795754552, 0.032507892698049545, 0.009187795221805573, 0.0018564380006864667, -0.029810888692736626, -0.02434496022760868, -0.010491346940398216, 0.02420111931860447, 0.0350610576570034, -0.002055342076346278, -0.009610326029360294, 0.02572942152619362, -0.01450988370925188, 0.011048727668821812, -0.05728437379002571, -0.038908783346414566, -0.008252833038568497, 0.0774579644203186, 0.042109228670597076, 0.009664265438914299, 0.06537538766860962, 0.013736742548644543, -0.030943630263209343, 0.017710328102111816, 0.02754540555179119, -0.03948414325714111, -0.015480805188417435, -0.02278069779276848, 0.010868927463889122, 0.0310515109449625, 0.004085961729288101, 0.012999561615288258, 0.022151395678520203, 0.043080151081085205, 0.03432387486100197, -0.054371610283851624, 0.0006697560893371701, -0.012073589488863945, -0.05005640164017677, -0.024794461205601692, 0.022025536745786667, -0.02957714907824993, -0.020928753539919853, 0.020605113357305527, -0.020371373742818832, -0.0405629463493824, -0.04764707759022713, 0.004796172957867384, -0.012604000978171825, -0.034485697746276855, -0.06282222270965576, 0.011228528805077076, -0.002908269641920924, -0.03549257665872574, -0.043691471219062805, -0.06411678344011307, 0.07702644914388657, 0.06494386494159698, 0.020820874720811844, 0.011021758429706097, 0.050955403596162796, -0.06623842567205429, 0.05307704582810402, 0.05458736792206764, 0.02022753283381462, 0.008428138680756092, 0.03772210329771042, -0.005128803197294474, 0.06904331594705582, 0.008342733606696129, 0.0036094908136874437, 0.03432387486100197, -0.042576707899570465, -0.02308635786175728, 0.006279525347054005, -0.03808170184493065, 0.004180356860160828, 0.0454535149037838, 0.041497908532619476, 0.0491214394569397, 0.011111658066511154, 0.019580252468585968, 0.052681487053632736, -0.051566723734140396, -0.023931419476866722, 0.024183139204978943, -0.00007774958066875115, 0.03725462034344673, -0.05972965806722641, -0.00035313901025801897, -0.06145574152469635, -0.011534188874065876, -0.01164206862449646, 0.004773697815835476, 0.032669711858034134, 0.01390755269676447, -0.027311664074659348, 0.004393869545310736, 0.036319658160209656, -0.04771899804472923, 0.003204940352588892, 0.018717210739850998, 0.02954118885099888, 0.07084131240844727, 0.0033510280773043633, 0.031033530831336975, -0.040634866803884506, -0.015588685870170593, -0.03382043540477753, 0.03930434584617615, 0.04020334407687187, -0.057931654155254364, -0.019885912537574768, 0.04067082703113556, 0.009120370261371136, -0.01507625449448824, -0.0005304108490236104, 0.07515652477741241, -0.010104776360094547, 0.005623253993690014, -0.018843071535229683, 0.002834102138876915, 0.054155848920345306, 0.01229833997786045, 0.02384151890873909, -0.01263097021728754, -0.03380245342850685, -0.019742071628570557, 0.022942516952753067, -0.005038903094828129, 0.05861489474773407, 0.046388477087020874, -0.05073964223265648, -0.024111218750476837, -0.018591349944472313, 0.04782687872648239, -0.021791795268654823, -0.008342733606696129, 0.005083853378891945, -0.03257981315255165, -0.03782998025417328, -0.02781510539352894, -0.0035847683902829885, 0.01905883103609085, -0.03844130411744118, 0.09536607563495636, 0.0688275545835495, -0.030170489102602005, 0.017161937430500984, 0.008419148623943329, 0.05063176155090332, 0.06562710553407669, 0.0571405328810215, 0.012280359864234924, -0.012702890671789646, 0.011300448328256607, -0.022043516859412193, -0.03142908960580826, 0.02632276341319084, -0.00634245527908206, -0.03186061233282089, 0.024003339931368828, -0.013053501024842262, 0.012568040750920773, -0.046748075634241104, -0.030619990080595016, -0.011731969192624092, -0.06098825857043266, -0.011327418498694897, -0.05383220687508583, -0.03696694225072861, -0.0007602181285619736, -0.020317433401942253, -0.016541626304388046, 0.05688881129026413, -0.0033982256427407265, -0.07429347932338715, 0.04991256073117256, 0.08019093424081802, 0.020443294197320938, 0.005506384186446667, -0.03349679335951805, 0.0017710329266265035, 0.03822554275393486, -0.0014698674203827977, -0.05394008755683899, -0.11478450894355774, -0.0018204780062660575, 0.006081745028495789, 0.002982437377795577, 0.03248991444706917, 0.006935796234756708, -0.04581311345100403, -0.04833031818270683, 0.004611877724528313, 0.03338891640305519, -0.06411678344011307, -0.018591349944472313, -0.069366954267025, -0.01334118191152811, 0.029307447373867035, 0.02394939959049225, 0.03869302198290825, 0.010770037770271301, 0.0810539722442627, -0.009385575540363789, -0.017782248556613922, -0.0608084611594677, 0.01591232605278492, -0.02369767799973488, 0.033838413655757904, 0.029954729601740837, -0.04034718498587608, 0.038297463208436966, 0.03137515112757683, 0.0047557177022099495, -0.0019216156797483563, -0.030170489102602005, -0.001454134820960462, 0.022906556725502014, -0.05149480327963829, 0.01154317893087864, 0.026520542800426483, 0.022582916542887688, -0.019688131287693977, 0.035258837044239044, -0.01406038273125887, -0.040383145213127136, -0.012936631217598915, 0.005029913038015366, 0.05692477151751518, -0.0027913996018469334, -0.08745486289262772, 0.012972591444849968, -0.0010922867804765701, -0.03277759253978729, -0.027419544756412506, 0.001473238691687584, -0.01349401194602251, 0.036013998091220856, -0.0705895945429802, -0.014752614311873913, 0.004126416519284248, 0.010761047713458538, -0.0047557177022099495, 0.0331551730632782, 0.06321778148412704, 0.00927769485861063, -0.041354067623615265, 0.010985798202455044, 0.005609769374132156, 0.046748075634241104, 0.050811562687158585, 0.03173475340008736, 0.03592409938573837, -0.006045784801244736, 0.02968502789735794, -0.022906556725502014, 0.00904844980686903, 0.0023801063653081656, 0.051422882825136185, -0.01860933005809784, 0.0010518317576497793, 0.012271369807422161, -0.03222021088004112, 0.050703682005405426, 0.0027666769456118345, 0.02526194043457508, 0.044410672038793564, 0.004360157065093517, -0.0270419642329216, -0.007151556666940451, 0.015094234608113766, -0.06372122466564178, 0.0172248687595129, 0.014348063617944717, 0.006998726632446051, -0.01620899699628353, -0.014554833993315697, 0.053292807191610336, 0.02145017497241497, 0.019382471218705177, -0.01570555567741394, -0.034180037677288055, 0.027671264484524727, 0.021971596404910088, -0.002746449550613761, 0.042576707899570465, -0.06300202012062073, 0.021683914586901665, 0.012280359864234924, -0.008028083480894566, 0.06925906985998154, 0.004868092946708202, -0.03808170184493065, 0.0454535149037838, -0.05397604778409004, 0.030332310125231743, -0.0067020561546087265, -0.03263375163078308, -0.060520779341459274, -0.04818647727370262, 0.025891242548823357, 0.04426683112978935, 0.04574119299650192, -0.07839293032884598, -0.023607779294252396, -0.06095229834318161, 0.03455761820077896, -0.03320911526679993, -0.0417855866253376, -0.07202799618244171, 0.04174962639808655, 0.013736742548644543, 0.010410437360405922, -0.054012008011341095, 0.010913877747952938, 0.019993793219327927, -0.024794461205601692, -0.019598232582211494, 0.028696127235889435, 0.010949837975203991, 0.019490351900458336, -0.0008383188978768885, -0.02252897620201111, -0.017926089465618134, -0.03079979121685028, -0.023931419476866722, 0.006850391160696745, 0.018573369830846786, 0.015723535791039467, -0.019382471218705177, -0.02520800195634365, -0.05861489474773407, 0.04365551099181175, -0.05552233010530472, 0.0007293149246834219, -0.024362940341234207, -0.015426864847540855, 0.03948414325714111, -0.004683797713369131, 0.00232616625726223, -0.07824908941984177, -0.07152456045150757, 0.011974699795246124, 0.02456071972846985, -0.024326980113983154, -0.05581001192331314, -0.034180037677288055, -0.04121022671461105, -0.0350610576570034, 0.011857829056680202, -0.11010970175266266, 0.00008133154187817127, 0.0454535149037838, 0.051063284277915955, 0.10227040946483612, -0.014123313128948212, -0.04876184090971947, 0.013988463208079338, 0.06976251304149628, -0.026142962276935577, 0.023571819067001343, -0.03966394439339638, 0.04408703371882439, -0.0027307169511914253, 0.0035106006544083357, 0.06343354284763336, 0.03930434584617615, -0.0208927933126688, -0.0553065687417984, 0.025441741570830345, -0.004787182901054621, 0.04901355877518654, -0.0051647634245455265, 0.02247503586113453, -0.02831854671239853, 0.04534563422203064, 0.0052411784417927265, 0.005677194334566593, -0.0167304165661335, -0.021162495017051697, 0.009493455290794373, 0.0650877058506012, -0.005510879214853048, 0.09486263245344162, -0.021378254517912865, -0.005434463731944561, -0.024380920454859734, -0.012028639204800129, -0.020820874720811844, 0.02281665802001953, -0.032507892698049545, -0.043943192809820175, -0.018006999045610428, 0.01403341256082058, -0.020461274310946465, 0.03908858448266983, 0.036625318229198456, 0.04944508150219917, -0.06293009966611862, -0.07961557060480118, 0.011947729624807835, -0.0393403060734272, -0.05825529620051384, 0.013089461252093315, -0.03808170184493065, -0.035456616431474686, 0.02373363822698593, -0.010536297224462032, 0.023266157135367393, -0.043943192809820175, -0.021036634221673012, 0.020623093470931053, -0.07601956278085709, -0.03070989064872265, 0.05613365024328232, -0.0227267574518919, 0.04351167008280754, 0.0017620428698137403, 0.06257050484418869, -0.0009681122028268874, -0.04559735581278801, 0.0009051820961758494, -0.10845553874969482, -0.017063047736883163, 0.0030296349432319403, 0.007681967690587044, 0.029954729601740837, 0.05232188478112221, 0.018789131194353104, -0.04092254862189293, -0.1131303459405899, -0.02297847718000412, 0.027419544756412506, -0.0028902897611260414, -0.01891499012708664, 0.026430644094944, -0.049481041729450226, 0.005295118782669306, 0.008014597930014133, -0.02109057456254959, 0.045417554676532745, 0.01869923062622547, 0.04534563422203064, 0.021683914586901665, 0.0015990989049896598, -0.06663399189710617, 0.042972270399332047, 0.013979473151266575, -0.007389792241156101, -0.03959202393889427, -0.04904951900243759, 0.01468968391418457, 0.021324314177036285, 0.030530089512467384, 0.033460833132267, -0.03265173360705376, 0.03808170184493065, 0.0022205335553735495, -0.028444405645132065, -0.024830421432852745, -0.016235966235399246, -0.0032004453241825104, 0.027203785255551338, 0.03482731804251671, -0.031698793172836304, 0.02261887677013874, 0.0018923981115221977, 0.042936310172080994, -0.058327216655015945, -0.0983147993683815, -0.028839966282248497, 0.0042320494540035725, 0.050955403596162796, -0.03049412928521633, 0.0005770465941168368, -0.013179361820220947, -0.010949837975203991, 0.0016811327077448368, 0.04753919690847397, 0.062138982117176056, -0.06666994839906693, 0.04171366989612579, -0.018843071535229683, -0.013781692832708359, -0.011174588464200497, -0.04067082703113556, 0.006643620785325766, 0.010491346940398216, 0.02826460637152195, -0.02628680318593979, -0.03351477533578873, 0.06005329638719559, 0.08170125633478165, -0.005272643640637398, -0.04574119299650192, -0.022636856883764267, -0.027059944346547127, 0.01941843144595623, 0.0012305082054808736, -0.031231310218572617, -0.010805997997522354, -0.029217548668384552, 0.053292807191610336, 0.0417855866253376, 0.006517760455608368, -0.0032611277420073748, 0.023463938385248184, 0.02882198803126812, 0.037038858979940414, 0.008720314130187035, -0.03772210329771042, -0.05361644923686981, -0.06713742762804031, 0.008518039248883724, -0.04610079526901245, 0.03608591854572296, 0.03240001201629639, -0.038153622299432755, -0.029091687873005867, 0.05336472764611244, 0.006126694846898317, 0.03121333010494709, 0.009637296199798584, -0.04739535599946976, -0.004670312628149986, 0.06731723248958588, 0.017926089465618134, 0.04991256073117256, 0.024075258523225784, -0.002521699061617255, 0.012873700819909573, 0.02211543545126915, -0.008931579999625683, -0.020317433401942253, -0.01769234798848629, -0.03675118088722229, 0.0896843895316124, -0.043080151081085205, -0.030170489102602005, 0.0050883484072983265, -0.06044885888695717, 0.047143638134002686, 0.04347570985555649, 0.049337200820446014, 0.01605616696178913, 0.022708777338266373, 0.04189346730709076, 0.002647559391334653, -0.019238632172346115, -0.03732654079794884, 0.05692477151751518, -0.03247193247079849, 0.01151620876044035, -0.005232188384979963, 0.00795616302639246, -0.06738915294408798, -0.05311300605535507, -0.0012035382678732276, 0.01692819781601429, 0.008306773379445076, -0.02225927636027336, 0.020479252561926842, -0.019400451332330704, 0.03959202393889427, -0.04081466794013977, 0.014051392674446106, -0.03797382116317749, -0.03572631999850273, 0.014428973197937012, -0.0297929085791111, -0.04477027431130409, -0.02317625842988491, 0.010455386713147163, 0.05901045724749565, -0.03090767003595829, 0.024740520864725113, -0.02862420678138733, -0.012756831012666225, -0.04034718498587608, -0.06044885888695717, 0.0393403060734272, -0.05563021078705788, 0.0056726993061602116, -0.001978927059099078, -0.03619379922747612, 0.03919646516442299, -0.030997570604085922, -0.0010574504267424345, 0.0068773613311350346, -0.016388796269893646, -0.010203666985034943, -0.04340378940105438, 0.07486884295940399, -0.04509391263127327, 0.003840983845293522, 0.034180037677288055, 0.004171366803348064, -0.0059828548692166805, -0.011552168987691402, -0.023212218657135963, 0.10306152701377869, 0.02389545924961567, -0.07947172969579697, -0.04876184090971947, 0.0032364053186029196, 0.01804295927286148, 0.018897010013461113, -0.05865085497498512, 0.011345398612320423, 0.03432387486100197, -0.011687018908560276, -0.011776919476687908, 0.0032341578043997288, -0.010752057656645775, 0.08206085115671158, -0.009853055700659752, 0.06656207144260406, -0.0031465052161365747, -0.02984684891998768, -0.005632244050502777, 0.03326305374503136, -0.00317122763954103, -0.038764942437410355, 0.027725204825401306, 0.002463263925164938, 0.03227415308356285, -0.018879031762480736, -0.030727870762348175, 0.05649325251579285, 0.05117116495966911, 0.013377142138779163, -0.01651465706527233, 0.012037629261612892, -0.036427538841962814, -0.0504160039126873, 0.0043691471219062805, -0.013287241570651531, 0.025297900661826134, 0.014330083504319191, 0.013449061661958694, -0.01727880910038948, -0.01576848514378071, 0.009088904596865177, -0.01406038273125887, -0.03333497419953346, 0.008019093424081802, -0.1019827276468277, 0.010832968167960644, 0.018879031762480736, -0.0164247564971447, -0.0021991822868585587, -0.03085372969508171, -0.015597675926983356, -0.008459603413939476, -0.08515341579914093, 0.024974260479211807, -0.05803953483700752, 0.06904331594705582, 0.03696694225072861, -0.0014957137173041701, 0.0034229480661451817, 0.028642186895012856, 0.0030071598012000322, 0.004607382696121931, -0.016083136200904846, 0.028048845008015633, -0.06742510944604874, -0.01936449110507965, -0.059657737612724304, -0.06674186885356903, -0.053868167102336884, -0.01961621269583702, 0.06354142725467682, -0.025136081501841545, 0.047143638134002686, 0.0249023400247097, -0.04383531212806702, -0.02450677938759327, 0.05005640164017677, 0.021216435357928276, -0.03793786093592644, -0.030889689922332764, 0.03635561838746071, 0.05847105383872986, 0.0030071598012000322, 0.05875873565673828, 0.0022227810695767403, -0.040634866803884506, 0.008396673947572708, -0.03272365406155586, 0.0038252512458711863, -0.00028964702505618334, 0.0010827349033206701, 0.0011164474999532104, 0.02292453683912754, 0.060772500932216644, 0.004706272855401039, -0.0182946790009737, -0.04020334407687187, -0.022025536745786667, 0.014950394630432129, -0.009538405574858189, 0.007470702286809683, 0.013062491081655025, -0.0013698535040020943, -0.006720035802572966, 0.015993235632777214, -0.016838297247886658, 0.030781811103224754, 0.0020508470479398966, 0.028246626257896423, 0.02668236382305622, 0.029667047783732414, -0.02013763226568699, 0.019903892651200294, -0.05976561829447746, -0.015975255519151688, -0.02297847718000412, 0.008697839453816414, 0.011938739567995071, 0.04833031818270683, -0.018771151080727577, 0.02083885483443737, -0.03491721674799919, 0.04146194830536842, -0.02083885483443737, 0.0071650417521595955, 0.0172248687595129, 0.06512366980314255, -0.04106638580560684, 0.03435983508825302, 0.01565161533653736, 0.02840844728052616, -0.023194238543510437, 0.04581311345100403, -0.0423969104886055, 0.042073268443346024, 0.0405629463493824, -0.009421535767614841, -0.011111658066511154, 0.020605113357305527, 0.01146226841956377 ]
716,405
pytorch_optimizer.loss.focal
FocalCosineLoss
Focal Cosine loss function w/ logit input. :param alpha: float. alpha. :param gamma: float. gamma. :param focal_weight: float. weight of focal loss. :param reduction: str. type of reduction.
class FocalCosineLoss(nn.Module): r"""Focal Cosine loss function w/ logit input. :param alpha: float. alpha. :param gamma: float. gamma. :param focal_weight: float. weight of focal loss. :param reduction: str. type of reduction. """ def __init__(self, alpha: float = 1.0, gamma: float = 2.0, focal_weight: float = 0.1, reduction: str = 'mean'): super().__init__() self.alpha = alpha self.gamma = gamma self.focal_weight = focal_weight self.reduction = reduction def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor: cosine_loss = cosine_embedding_loss( y_pred, one_hot(y_true, num_classes=y_pred.size(-1)), torch.tensor([1], device=y_true.device), reduction=self.reduction, ) ce_loss = cross_entropy(normalize(y_pred), y_true, reduction='none') pt = torch.exp(-ce_loss) focal_loss = (self.alpha * (1 - pt) ** self.gamma * ce_loss).mean() return cosine_loss + self.focal_weight * focal_loss
(alpha: float = 1.0, gamma: float = 2.0, focal_weight: float = 0.1, reduction: str = 'mean')
[ -0.08324657380580902, -0.042592138051986694, 0.02869286574423313, 0.06953361630439758, 0.05377117544412613, -0.014719067141413689, -0.07061426341533661, 0.0007685588789172471, 0.08130887150764465, -0.016898980364203453, 0.014365064911544323, -0.03826957568526268, 0.06584453582763672, 0.04326288029551506, 0.00004989082663087174, 0.05213158205151558, 0.011421251110732555, -0.0007085879915393889, 0.005789810325950384, -0.018063463270664215, 0.017839882522821426, -0.017159823328256607, -0.030816882848739624, 0.0028273651842027903, -0.05119999498128891, 0.015762444585561752, 0.006209024228155613, 0.014691120013594627, -0.02656884863972664, -0.0494113489985466, -0.009632605127990246, -0.00274818018078804, 0.032456476241350174, 0.00243609887547791, 0.03946200758218765, -0.007266375236213207, 0.018035516142845154, 0.010023871436715126, -0.08525879681110382, 0.0008360989158973098, -0.041884131729602814, -0.04460436478257179, 0.01270684041082859, 0.018063463270664215, -0.02833886258304119, 0.025898106396198273, -0.014644540846347809, 0.04806986451148987, -0.0022369720973074436, 0.0176442489027977, -0.039871904999017715, -0.050156619399785995, 0.014570013619959354, 0.010005239397287369, 0.012185151688754559, 0.055149924010038376, 0.04471615329384804, -0.02770538441836834, -0.02314060926437378, -0.0016803492326289415, 0.013517321087419987, -0.059733327478170395, 0.07370712608098984, -0.027370013296604156, 0.025432312861084938, 0.013247160241007805, -0.004974672105163336, 0.02571178786456585, -0.00046986897359602153, 0.00026754001737572253, -0.00019650653121061623, -0.05019388347864151, 0.04069169983267784, 0.026792429387569427, 0.012734788469970226, -0.009707131423056126, -0.014402328059077263, -0.01653566025197506, 0.04091528058052063, -0.04449257254600525, 0.01559475902467966, -0.03146899491548538, -0.028599707409739494, 0.03670451045036316, 0.03055603802204132, -0.10128208994865417, -0.006795923691242933, -0.050231147557497025, 0.0053193592466413975, 0.04646753519773483, -0.08406636863946915, 0.03172983601689339, -0.0022556039039045572, 0.008291120640933514, 0.05138631537556648, 0.040952544659376144, -0.02163144014775753, -0.03456186130642891, 0.02334555797278881, 0.008174671791493893, 0.04147423431277275, 0.13847102224826813, 0.021389227360486984, 0.07176942378282547, 0.06103755161166191, -0.0129211051389575, -0.037729255855083466, -0.011206986382603645, 0.02520873211324215, 0.00166986882686615, -0.07128500193357468, -0.01653566025197506, 0.009259969927370548, -0.03826957568526268, 0.02397903800010681, -0.06651528179645538, 0.002936826553195715, 0.0027132458053529263, -0.028152545914053917, 0.024649780243635178, 0.021743230521678925, -0.02371819317340851, -0.034319646656513214, -0.03968558833003044, 0.05403202027082443, 0.0004957786877639592, 0.03525123372673988, -0.022805238142609596, 0.04993303865194321, -0.0481443926692009, -0.017122561112046242, -0.007611061912029982, 0.021258804947137833, 0.024370303377509117, 0.04479068145155907, -0.011467830277979374, 0.04553595185279846, 0.038101889193058014, -0.0034235804341733456, 0.0385676845908165, -0.009651236236095428, 0.04456710070371628, 0.03433828055858612, 0.057795628905296326, -0.009488209150731564, 0.031673941761255264, 0.0002448325976729393, -0.005868995096534491, 0.05127452313899994, -0.04270392656326294, 0.01941426284611225, -0.034151963889598846, 0.0296244528144598, 0.011579620651900768, -0.015296651050448418, 0.0011580785503610969, -0.0008168849744834006, -0.03754293918609619, -0.006800581701099873, 0.07583114504814148, -0.01149577833712101, -0.009697816334664822, -0.04855429008603096, -0.021389227360486984, -0.01546433661133051, -0.04091528058052063, 0.05760931223630905, -0.03240057826042175, -0.010731876827776432, 0.04367277771234512, 0.027612224221229553, -0.0642794743180275, 0.0842154249548912, 0.059435222297906876, -0.008039591833949089, 0.06614264100790024, 0.006516447756439447, -0.016796505078673363, -0.02435167133808136, 0.01663813553750515, 0.03020203486084938, -0.021091118454933167, -0.06547190248966217, -0.0637950450181961, 0.03569839522242546, 0.04378456622362137, -0.006036680657416582, 0.032456476241350174, 0.03763609752058983, -0.0072011640295386314, 0.012483259662985802, -0.033164482563734055, -0.0019481803756207228, -0.009800290688872337, 0.021538279950618744, -0.016759240999817848, -0.000521397334523499, 0.008132750168442726, 0.01906026154756546, -0.03482270613312721, -0.062006399035453796, 0.0816815048456192, 0.038455892354249954, 0.011095196008682251, -0.05231789872050285, 0.01031266339123249, 0.009856185875833035, 0.13019853830337524, -0.07668820768594742, -0.06461483985185623, 0.010284715332090855, 0.02934497594833374, -0.009576709941029549, 0.06323609501123428, 0.017970304936170578, -0.04598311334848404, -0.04177233949303627, 0.03625734895467758, 0.008351673372089863, 0.003789228154346347, -0.010275399312376976, -0.014178747311234474, -0.05667772516608238, -0.0010986898560076952, 0.062453560531139374, -0.009311207570135593, 0.04676564410328865, -0.01445822324603796, 0.05004482716321945, -0.008728966116905212, -0.012026782147586346, 0.030686460435390472, -0.059733327478170395, 0.02412809059023857, 0.050529252737760544, 0.012008150108158588, 0.015184860676527023, 0.030760986730456352, -0.02949403040111065, -0.03998369351029396, -0.037375252693891525, -0.049075979739427567, -0.004515865817666054, 0.020383113995194435, 0.018613098189234734, -0.01978689804673195, 0.03512081131339073, 0.077657051384449, -0.0484052374958992, 0.0296244528144598, -0.030537405982613564, -0.015836970880627632, -0.0006451236549764872, 0.014178747311234474, -0.003917321562767029, -0.05909984931349754, -0.08563143759965897, -0.011579620651900768, 0.014020377770066261, -0.03172983601689339, -0.03733798861503601, -0.010759824886918068, -0.03161804750561714, 0.07478776574134827, 0.010126345790922642, -0.03728209435939789, -0.026401162147521973, 0.00801630225032568, 0.028245704248547554, 0.031673941761255264, 0.04978398606181145, 0.026680639013648033, -0.036518193781375885, -0.03942474350333214, 0.012986316345632076, -0.046653855592012405, -0.04233129322528839, 0.03540029004216194, -0.03249374032020569, 0.034375544637441635, 0.011607568711042404, -0.07989285886287689, -0.05969606712460518, -0.032456476241350174, 0.036313243210315704, 0.022805238142609596, 0.027724014595150948, -0.04684017226099968, 0.047734495252370834, -0.013200581073760986, 0.04795807600021362, 0.020327217876911163, 0.04732459783554077, 0.038381364196538925, 0.006921688094735146, 0.017355456948280334, -0.01414148323237896, 0.019395632669329643, 0.0007336243870668113, -0.03063056617975235, 0.0210538562387228, 0.011402619071304798, -0.0365554541349411, -0.07389344274997711, -0.037300724536180496, -0.05134905129671097, 0.000593304168432951, 0.042592138051986694, -0.005137699656188488, -0.008933914825320244, 0.018696941435337067, -0.01986142434179783, -0.03519533947110176, 0.02954992465674877, -0.014607276767492294, 0.007736826315522194, 0.03400290757417679, -0.018156621605157852, 0.04113886132836342, 0.05563434958457947, 0.022041337564587593, 0.03172983601689339, 0.0015068412758409977, 0.07877495884895325, -0.009874816983938217, -0.0784023255109787, 0.034729547798633575, 0.027444539591670036, -0.0063767097890377045, -0.02886055037379265, -0.02455662190914154, -0.0038707421626895666, -0.011626199819147587, -0.015566810965538025, -0.09420203417539597, 0.005049198865890503, 0.03942474350333214, 0.03849315643310547, 0.044082675129175186, -0.014532750472426414, 0.004338864237070084, 0.0054078600369393826, -0.059435222297906876, 0.04363551363348961, -0.03035108931362629, -0.05198252946138382, 0.010051818564534187, -0.009837553836405277, 0.05928616598248482, -0.015641337260603905, 0.011057931929826736, -0.00408500712364912, 0.014979911968111992, 0.011076563969254494, 0.07698631286621094, 0.01634002849459648, -0.07206753641366959, -0.03853042051196098, -0.012958369217813015, -0.06878834962844849, 0.004867539741098881, -0.038101889193058014, -0.035605236887931824, 0.024724306538701057, -0.032586898654699326, 0.04628121852874756, 0.014793594367802143, 0.0063580782152712345, 0.02112838253378868, -0.004201455507427454, -0.03463638573884964, -0.04300203546881676, 0.015836970880627632, 0.006120523437857628, -0.0215569119900465, 0.0018177581951022148, 0.025003783404827118, -0.0029717611614614725, -0.043300140649080276, 0.003253566101193428, 0.031804364174604416, -0.014048324897885323, -0.07981833815574646, -0.007098689209669828, 0.018063463270664215, 0.021743230521678925, -0.02127743698656559, -0.028171176090836525, 0.03219563141465187, -0.007736826315522194, -0.03625734895467758, -0.014989227056503296, 0.031319938600063324, -0.004394759424030781, -0.06990625709295273, 0.007811353076249361, 0.008253856562077999, 0.038791265338659286, -0.03186025843024254, -0.06651528179645538, -0.0002276564628118649, -0.03521396964788437, -0.003211644710972905, 0.046094901859760284, -0.015585443004965782, 0.037375252693891525, 0.03219563141465187, 0.03307132050395012, 0.012697524391114712, 0.09002852439880371, -0.03137583285570145, 0.032456476241350174, -0.03733798861503601, 0.018333623185753822, -0.02191091515123844, -0.02699737809598446, -0.04520057886838913, -0.07012983411550522, -0.021389227360486984, 0.029605820775032043, 0.01527801901102066, 0.04225676506757736, 0.052653271704912186, 0.015389809384942055, -0.02127743698656559, 0.015007859095931053, 0.015250071883201599, 0.0380646251142025, -0.011234933510422707, 0.008183987811207771, -0.08920872956514359, -0.018184568732976913, -0.012585734017193317, -0.07251469790935516, -0.010899562388658524, -0.03512081131339073, 0.005291411653161049, -0.012213099747896194, -0.041101597249507904, 0.031673941761255264, 0.013666374608874321, 0.008705676533281803, 0.02664337493479252, 0.06498748064041138, -0.015138281509280205, -0.0001698689884506166, -0.004096651915460825, -0.001349636004306376, -0.062453560531139374, 0.008160698227584362, 0.0010381367756053805, -0.009893449023365974, -0.015343230217695236, 0.011626199819147587, 0.0247056744992733, -0.004932750947773457, -0.07262648642063141, -0.026866955682635307, 0.016749925911426544, 0.005375254433602095, -0.04527510702610016, 0.0935312882065773, -0.03746841102838516, -0.03746841102838516, 0.0129211051389575, 0.013219213113188744, 0.07348354905843735, -0.00229752529412508, -0.043598249554634094, 0.017187772318720818, 0.041101597249507904, -0.025581367313861847, 0.0284879170358181, -0.028189808130264282, -0.02278660610318184, -0.0015895195538178086, -0.051088206470012665, 0.014206694439053535, 0.0494113489985466, -0.03228878974914551, 0.01963784359395504, -0.011458514258265495, 0.007387481164187193, -0.025655893608927727, 0.0267179012298584, 0.045945849269628525, 0.02669927105307579, -0.023289663717150688, 0.032456476241350174, 0.018398834392428398, -0.004357496276497841, 0.039089370518922806, -0.001137700048275292, -0.017308877781033516, -0.05563434958457947, -0.04829344525933266, -0.00025545849348418415, 0.016097815707325935, 0.004655603785067797, 0.03597787395119667, -0.01484948955476284, 0.01527801901102066, -0.07884948700666428, 0.013209897093474865, 0.054590970277786255, 0.027612224221229553, -0.03990916907787323, 0.0016978164203464985, -0.028171176090836525, -0.010117029771208763, -0.007163900416344404, 0.012026782147586346, 0.043747302144765854, -0.004709169734269381, -0.025749051943421364, -0.049299560487270355, 0.002764482982456684, 0.0983010083436966, 0.01588355004787445, -0.035456184297800064, -0.009539445862174034, 0.025749051943421364, -0.016871031373739243, 0.01646113395690918, -0.014979911968111992, 0.0395737960934639, -0.03463638573884964, -0.020755747333168983, 0.03292226791381836, -0.00044570592581294477, -0.03048151172697544, 0.012241046875715256, -0.024519357830286026, 0.043523721396923065, -0.001994759775698185, 0.007867248728871346, -0.033164482563734055, -0.037673357874155045, 0.015659969300031662, -0.011998835019767284, -0.023867247626185417, 0.04139970615506172, -0.0020890827290713787, 0.02563726156949997, 0.0019272196805104613, -0.029475398361682892, 0.009418339468538761, 0.0567149892449379, -0.03871673718094826, 0.00410829670727253, -0.08973041921854019, -0.01661018840968609, 0.004643958993256092, -0.011542357504367828, 0.035605236887931824, 0.056864041835069656, 0.020662588998675346, 0.01188704464584589, -0.02178049273788929, 0.05324948579072952, -0.020737117156386375, -0.04825618118047714, 0.07981833815574646, 0.004199126269668341, -0.02233944460749626, 0.018165936693549156, 0.02612168714404106, -0.00304395891726017, -0.025022413581609726, 0.011737990193068981, -0.003987190313637257, 0.01832430809736252, -0.029382240027189255, 0.03972284868359566, -0.06621716916561127, 0.0038334785494953394, 0.025003783404827118, -0.034375544637441635, 0.04400814697146416, -0.06372051686048508, -0.0029601161368191242, -0.07061426341533661, 0.002641047816723585, 0.01716914027929306, -0.005053856875747442, 0.01784919761121273, -0.027891701087355614, 0.05682677775621414, 0.0029251817613840103, 0.01578107662498951, -0.01573449745774269, -0.02984803356230259, -0.0028832603711634874, -0.013815428130328655, 0.02220902405679226, -0.03972284868359566, -0.09658689051866531, 0.04106433317065239, 0.07407975941896439, 0.04281571879982948, -0.07098689675331116, -0.016507713124155998, 0.02377408929169178, -0.05332401394844055, -0.016554292291402817, -0.013303055427968502, -0.04117612540721893, 0.031953416764736176, -0.003067248733714223, -0.03961106017231941, -0.06867656111717224, 0.016051236540079117, -0.029307711869478226, -0.005626782774925232, -0.018864627927541733, -0.004671906586736441, 0.0008034933707676828, -0.005188936833292246, 0.05146083980798721, 0.009441629983484745, 0.015408441424369812, -0.0054078600369393826, -0.04728733375668526, 0.006181076634675264, 0.003887044731527567, -0.0006427947082556784, 0.02677379734814167, -0.056305091828107834, -0.004208442289382219, -0.0008902474073693156, -0.03186025843024254, 0.006409315392374992, -0.02135196328163147, 0.022376708686351776, -0.008775545284152031, 0.017839882522821426, -0.015585443004965782, 0.0408407524228096, -0.0028832603711634874, -0.04475341737270355, -0.027519065886735916, 0.03228878974914551, -0.035884711891412735, -0.02826433628797531, -0.03243784233927727, 0.0027924305759370327, -0.012762735597789288, -0.01348937302827835, 0.0534358024597168, -0.034282386302948, 0.00526812206953764, 0.05503813177347183, 0.07974380999803543, 0.04531237110495567, 0.06748412549495697, -0.028432020917534828, 0.006032022647559643, 0.007373507600277662, 0.07475050538778305, -0.03577292338013649, 0.015007859095931053, -0.023177873343229294, 0.05261600762605667, 0.035735659301280975, -0.003963900730013847, -0.026233477517962456, 0.05503813177347183, -0.05649140849709511, -0.027519065886735916, -0.007769431918859482, -0.031170886009931564, 0.004783696960657835, -0.02114701457321644, -0.00005203784166951664, 0.03577292338013649, -0.00216128071770072, 0.05742299556732178, 0.020327217876911163, -0.0060227070935070515, -0.018864627927541733, 0.01762561686336994, 0.02327103167772293, 0.006698107346892357, -0.014290537685155869, 0.022302182391285896, -0.006474526599049568, -0.06826665997505188, 0.012380785308778286, -0.07039067894220352, -0.06032954528927803, -0.04091528058052063, 0.012995632365345955, 0.04471615329384804, -0.0036285296082496643, 0.027873069047927856, -0.03128267452120781, -0.077135369181633, 0.0011004365514963865, -0.006539737340062857, -0.01928384229540825, -0.027463171631097794, 0.03927568718791008, -0.006167103070765734, -0.039797376841306686, -0.017001453787088394, 0.014663171954452991, -0.016777873039245605, -0.06506200134754181, -0.03512081131339073, 0.021873651072382927, 0.03340669348835945, 0.017429985105991364, -0.006171760614961386, 0.008183987811207771, 0.006982241291552782, 0.038232311606407166, -0.0034212516620755196, 0.0025152836460620165, -0.01729024574160576, 0.023904509842395782, 0.02904686890542507, -0.004411062225699425, 0.07206753641366959, 0.08071266114711761, -0.033518481999635696, -0.09464919567108154, 0.009259969927370548, -0.03990916907787323, 0.003116156905889511, -0.012613682076334953, 0.022451234981417656, 0.036667246371507645, -0.023401454091072083, 0.020457640290260315, 0.008402911014854908, -0.012986316345632076, 0.034673649817705154, -0.01641455478966236, -0.0365554541349411, -0.007420086767524481, -0.0004957786877639592, 0.021538279950618744, 0.021314699202775955, 0.03146899491548538, 0.050156619399785995, 0.04035633057355881, -0.012539154849946499, -0.0074294027872383595, 0.04218223690986633, 0.002755167195573449, 0.021463753655552864, 0.019507423043251038, -0.003360698465257883, -0.012539154849946499, 0.09055021405220032, -0.03471091389656067, -0.03148762509226799, 0.001979621360078454, -0.04307655990123749, -0.10448674857616425, -0.04382183030247688, -0.02056943066418171, 0.00865909643471241, 0.007890538312494755, 0.00017088789900299162, 0.03471091389656067, 0.013824744150042534, 0.04467888921499252 ]
716,411
pytorch_optimizer.loss.focal
__init__
null
def __init__(self, alpha: float = 1.0, gamma: float = 2.0, focal_weight: float = 0.1, reduction: str = 'mean'): super().__init__() self.alpha = alpha self.gamma = gamma self.focal_weight = focal_weight self.reduction = reduction
(self, alpha: float = 1.0, gamma: float = 2.0, focal_weight: float = 0.1, reduction: str = 'mean')
[ 0.007006996776908636, -0.018888024613261223, 0.01191327627748251, 0.03523307666182518, 0.014447036199271679, -0.012346318922936916, -0.05229679495096207, -0.040245313197374344, 0.015091992914676666, 0.03180558979511261, -0.0035449599381536245, 0.027714721858501434, 0.024324091151356697, 0.05811983346939087, -0.02600097842514515, 0.027198756113648415, 0.018215427175164223, 0.033206067979335785, -0.010393020696938038, 0.023181594908237457, -0.002830900251865387, -0.006491031032055616, -0.028064841404557228, 0.07006075233221054, 0.0057401168160140514, 0.0607365183532238, 0.002876968588680029, -0.009508508257567883, -0.006044168025255203, -0.04334110766649246, -0.02725403755903244, -0.03243212029337883, 0.031971435993909836, 0.030220840126276016, 0.025835132226347923, -0.05137543007731438, 0.02953902818262577, 0.0077164494432508945, -0.10039215534925461, 0.02362385205924511, 0.02021479420363903, -0.002023552544414997, -0.014437821693718433, -0.012945207767188549, -0.0077625177800655365, 0.025411304086446762, 0.050011806190013885, 0.028654515743255615, 0.004616049118340015, 0.01739541068673134, -0.038807980716228485, -0.015045924112200737, 0.022131238132715225, 0.009444012306630611, -0.02714347466826439, 0.06132619455456734, 0.051559701561927795, -0.011323601007461548, 0.009218277409672737, -0.005601911805570126, -0.020491203293204308, -0.03687310963869095, 0.023550141602754593, -0.08749301731586456, -0.028267541900277138, -0.0024231954012066126, -0.0544712208211422, 0.02983386628329754, -0.0013866574736312032, 0.062136996537446976, 0.03668883815407753, -0.0076888082548975945, 0.01066943071782589, -0.012530592270195484, 0.0005151017685420811, 0.0412403903901577, -0.08004837483167648, -0.012079122476279736, 0.0064357491210103035, -0.05723532289266586, 0.04293570667505264, 0.02972330152988434, -0.049053583294153214, 0.01361780520528555, 0.0336114726960659, -0.049680113792419434, -0.055908553302288055, -0.048648182302713394, 0.055908553302288055, 0.0109274135902524, -0.09405314922332764, 0.028672942891716957, 0.01518412958830595, 0.021375715732574463, 0.0632057785987854, 0.025614004582166672, -0.014087703078985214, -0.04945898428559303, 0.040577005594968796, 0.017423052340745926, -0.004194523673504591, -0.003480464220046997, 0.022757766768336296, 0.03482767567038536, 0.00046183523954823613, -0.02985229343175888, -0.015552676282823086, -0.023034177720546722, 0.005431458819657564, 0.01898016221821308, -0.017284845933318138, 0.037149522453546524, -0.009757277555763721, 0.049901239573955536, -0.037886615842580795, 0.005459100008010864, 0.01061414834111929, -0.01880510151386261, 0.039545074105262756, 0.028378106653690338, -0.001283003599382937, 0.014004779979586601, -0.006827330216765404, 0.06353747099637985, 0.04330425336956978, 0.014189053326845169, 0.013129481114447117, 0.005210330709815025, 0.021596845239400864, -0.02010422945022583, 0.030276121571660042, -0.01905387081205845, -0.05638766661286354, -0.014686590991914272, 0.03692839294672012, -0.03729693964123726, 0.06541706621646881, 0.03433013707399368, -0.014327257871627808, 0.06475368142127991, 0.0011183093301951885, 0.007135988213121891, 0.027714721858501434, -0.000985862803645432, -0.03532521426677704, 0.03991362079977989, 0.01925657130777836, -0.03858685493469238, -0.0019544498063623905, -0.015138060785830021, -0.009365696460008621, 0.02030692994594574, -0.0017229564255103469, -0.0019256571540609002, 0.022739339619874954, -0.04153522849082947, 0.010918200016021729, -0.051780831068754196, 0.02777000330388546, 0.04562609642744064, -0.02205752767622471, 0.016529325395822525, -0.015838300809264183, -0.03066309727728367, -0.0023276035208255053, 0.018998589366674423, -0.015156488865613937, -0.04245659336447716, -0.004984595812857151, 0.01217125914990902, 0.04754254221916199, -0.1219152882695198, 0.010651003569364548, 0.0331692136824131, 0.0009046673076227307, 0.09272637963294983, 0.02402925305068493, 0.022960467264056206, -0.003694681916385889, 0.02550343982875347, 0.050822608172893524, -0.03550948575139046, -0.0634269118309021, -0.028654515743255615, 0.044815294444561005, -0.014695804566144943, 0.008287697099149227, 0.04558924213051796, 0.04205119237303734, -0.026977628469467163, 0.04566295072436333, -0.013322968035936356, -0.0043672798201441765, -0.027806857600808144, 0.01487086433917284, -0.016262128949165344, 0.04050329700112343, -0.05347614362835884, 0.025890415534377098, 0.035601623356342316, -0.05119115486741066, 0.00007601278048241511, 0.014170625247061253, -0.010586507618427277, 0.006587774492800236, 0.00508133927360177, 0.01460366789251566, 0.025448158383369446, -0.01736776903271675, -0.033021796494722366, -0.0022734731901437044, -0.016778094694018364, 0.025779850780963898, -0.0030612421687692404, 0.012760934419929981, -0.09449540823698044, 0.01969882845878601, 0.014990642666816711, 0.04942212998867035, 0.036615125834941864, 0.06291094422340393, -0.007241945248097181, -0.004754254128783941, -0.02714347466826439, 0.029815439134836197, 0.008868157863616943, 0.059741441160440445, -0.04879559949040413, -0.046879157423973083, -0.0038259767461568117, -0.011084046214818954, -0.05708790570497513, -0.05060147866606712, -0.00852725189179182, -0.012254182249307632, 0.03189772740006447, -0.0006282571703195572, 0.013009702786803246, -0.06578560918569565, -0.07982724159955978, 0.04805850610136986, -0.005343928933143616, -0.006067202426493168, 0.04179321229457855, -0.0383288711309433, -0.0410192608833313, 0.005887535400688648, 0.06158417463302612, -0.013590164482593536, 0.00004041778083774261, -0.029041489586234093, -0.018279923126101494, -0.0171466413885355, 0.053955256938934326, -0.03324292600154877, 0.022960467264056206, -0.04072442650794983, 0.005136621650308371, 0.028746653348207474, -0.03491981327533722, -0.011323601007461548, -0.014972214587032795, -0.012982062064111233, 0.11528144776821136, 0.02146785333752632, 0.0068181161768734455, 0.015607958659529686, -0.03433013707399368, -0.002489994512870908, -0.002388644265010953, 0.10112924873828888, 0.049053583294153214, 0.013580950908362865, -0.013977138325572014, -0.011166969314217567, -0.05255477875471115, 0.0015571103431284428, 0.01211597677320242, -0.02972330152988434, 0.022978894412517548, 0.050196077674627304, -0.06574875116348267, -0.010540439747273922, 0.04853761941194534, -0.020546486601233482, -0.0032777634914964437, 0.029188908636569977, 0.0069839623756706715, 0.020786041393876076, -0.05351300165057182, 0.013590164482593536, 0.03479082137346268, 0.029096772894263268, 0.02559557743370533, 0.09537991881370544, -0.02694077417254448, 0.012162045575678349, -0.0016193026676774025, -0.003922720439732075, 0.005928996950387955, 0.0775422528386116, -0.04562609642744064, 0.030902652069926262, -0.008734559640288353, -0.03140018880367279, -0.006117877550423145, 0.038181450217962265, 0.001562868943437934, 0.005551236681640148, 0.018418127670884132, 0.011231464333832264, 0.025650858879089355, -0.03910281881690025, 0.0416826456785202, -0.02684863656759262, -0.03906596451997757, 0.039950475096702576, -0.045552387833595276, 0.013949497602880001, 0.08432351797819138, 0.0171466413885355, 0.0018980161985382438, -0.042419739067554474, -0.016308197751641273, -0.05130171775817871, -0.05811983346939087, 0.023144740611314774, 0.029281046241521835, 0.014852437190711498, -0.014032420702278614, -0.11660821735858917, -0.0017010739538818598, 0.025411304086446762, 0.013645446859300137, -0.09029397368431091, -0.007370936684310436, 0.02205752767622471, 0.022241801023483276, 0.005689441692084074, -0.0437096543610096, 0.007163628935813904, -0.0006605050293728709, -0.03128962591290474, 0.05483976751565933, -0.016916299238801003, -0.05970458686351776, -0.0036347932182252407, -0.09029397368431091, 0.06375860422849655, -0.08506061136722565, -0.009029397740960121, -0.030828941613435745, -0.007896116003394127, 0.026258962228894234, 0.09272637963294983, 0.0264432355761528, -0.046473756432533264, -0.007509141694754362, -0.013046558015048504, -0.023365868255496025, 0.014364113099873066, 0.020454348996281624, -0.06331634521484375, 0.039618782699108124, 0.012825429439544678, -0.006205407436937094, 0.02434251829981804, -0.007112953811883926, 0.0385499969124794, -0.006620022468268871, 0.04536811634898186, -0.07879531383514404, -0.053218163549900055, 0.0030151738319545984, -0.015884367749094963, 0.025245457887649536, 0.002602861961349845, -0.022647202014923096, 0.011360456235706806, -0.00851803831756115, 0.02279462106525898, 0.033519335091114044, -0.016713598743081093, 0.02671964466571808, -0.03751806914806366, 0.002245832234621048, -0.030312977731227875, -0.015571103431284428, 0.06397973001003265, 0.027272464707493782, -0.045036423951387405, -0.00831533782184124, 0.03925023600459099, -0.007960611954331398, 0.002222798066213727, 0.01689787209033966, -0.005164262373000383, -0.01898016221821308, -0.06467996537685394, 0.02249978482723236, -0.008789842016994953, -0.06530649960041046, -0.030128704383969307, 0.03637557104229927, 0.018639255315065384, -0.05038035288453102, 0.018169358372688293, 0.034661829471588135, 0.03110535256564617, 0.05060147866606712, 0.005293253809213638, -0.01415219809859991, -0.05495033413171768, 0.03442227467894554, -0.008232414722442627, -0.02559557743370533, -0.02537444978952408, -0.11041662842035294, -0.0005401514354161918, -0.027217183262109756, 0.002867755014449358, 0.0609576441347599, 0.027419883757829666, 0.06302151083946228, 0.05461864173412323, 0.015700094401836395, 0.008605568669736385, -0.0006466844934038818, 0.05572428181767464, -0.007919150404632092, -0.08122771978378296, 0.03851314261555672, -0.02382655255496502, -0.038807980716228485, 0.012014626525342464, -0.007108347024768591, -0.03972934931516647, -0.01269643846899271, -0.0049523478373885155, -0.02893092669546604, 0.01730327308177948, -0.04746883362531662, 0.03687310963869095, -0.00869770534336567, -0.05480291321873665, -0.004850997589528561, -0.018888024613261223, 0.0470634289085865, -0.04293570667505264, -0.026056261733174324, 0.06958164274692535, 0.011084046214818954, -0.016123924404382706, -0.014880077913403511, 0.07057671993970871, -0.019219717010855675, -0.09493766725063324, -0.02539287693798542, 0.02351328730583191, -0.04352537915110588, -0.012051481753587723, 0.029299473389983177, -0.04920100048184395, -0.04691601172089577, -0.027106620371341705, 0.06648585200309753, 0.08992542326450348, 0.02353171445429325, -0.026682790368795395, -0.023863406851887703, 0.038623709231615067, 0.026774927973747253, -0.0038421007338911295, -0.0551346056163311, -0.015783017501235008, 0.028636088594794273, -0.03298494219779968, -0.018307562917470932, 0.028672942891716957, -0.03655984625220299, 0.011028763838112354, -0.007974431850016117, 0.008808269165456295, 0.02364227920770645, 0.017782384529709816, 0.046473756432533264, -0.01786530762910843, -0.029041489586234093, 0.03215571120381355, 0.029870720580220222, -0.04894302040338516, 0.07230889052152634, 0.0015202556969597936, 0.06280037760734558, -0.01882352866232395, 0.025116465985774994, 0.03913967311382294, 0.030810514464974403, 0.019809391349554062, 0.06534335017204285, -0.008177133277058601, -0.016759667545557022, -0.06913938373327255, -0.008541072718799114, 0.017423052340745926, -0.060367971658706665, -0.08078546822071075, -0.015902794897556305, -0.015073565766215324, -0.0015640206402167678, 0.033648326992988586, -0.03198986500501633, 0.01745990663766861, -0.015414470806717873, -0.004901672713458538, -0.03215571120381355, -0.06423771381378174, 0.046473756432533264, -0.02579827792942524, -0.005039877723902464, -0.008688491769134998, 0.03969249501824379, -0.0014661253662779927, -0.022297082468867302, -0.0015156487934291363, 0.006795082241296768, 0.002994443057104945, -0.02559557743370533, 0.049385275691747665, 0.038807980716228485, -0.018731392920017242, -0.030239267274737358, -0.026387952268123627, 0.05907805636525154, -0.005049091763794422, 0.04791108891367912, -0.007135988213121891, -0.024895338341593742, 0.018924878910183907, -0.055797990411520004, 0.00824623554944992, 0.024397799745202065, 0.043156832456588745, -0.022978894412517548, 0.009084679186344147, -0.008881978690624237, -0.006596988067030907, 0.01471423264592886, 0.00995076447725296, -0.018593188375234604, -0.01999366469681263, -0.05119115486741066, -0.06062595546245575, 0.0025291526690125465, 0.02154156193137169, 0.03587803244590759, 0.03224784880876541, -0.03370360657572746, -0.010356166400015354, 0.010245601646602154, -0.001964815193787217, -0.02964959293603897, 0.03668883815407753, 0.04945898428559303, -0.057161614298820496, -0.024121390655636787, -0.0056479801423847675, 0.032487403601408005, -0.02506118454039097, -0.008799055591225624, 0.004194523673504591, 0.0023771270643919706, 0.00021004289737902582, 0.04105611518025398, -0.08395496755838394, -0.0018093346152454615, 0.02115458808839321, 0.042235467582941055, -0.016556967049837112, -0.05587169900536537, 0.02393711730837822, -0.020804468542337418, -0.05609282851219177, -0.04271457716822624, -0.026885490864515305, 0.028451815247535706, -0.01956983655691147, 0.006873398553580046, -0.04072442650794983, -0.04216175898909569, 0.006666090805083513, -0.01518412958830595, -0.00048141428851522505, -0.0419037751853466, -0.07842676341533661, -0.04569980874657631, -0.04632633551955223, -0.042346030473709106, 0.023660706356167793, -0.005454493220895529, -0.05358671024441719, -0.004878638777881861, -0.027733149006962776, -0.0002437303919577971, -0.0036347932182252407, -0.0019314157543703914, 0.0043189083226025105, 0.08778785169124603, -0.036007024347782135, -0.02467421069741249, -0.02176268957555294, -0.006357432808727026, -0.03998732939362526, -0.016059428453445435, 0.01440096739679575, -0.007039244286715984, -0.008743773214519024, -0.006836543790996075, 0.034293282777071, 0.02167055383324623, -0.038697417825460434, 0.011240677908062935, -0.02404768019914627, 0.06438513100147247, -0.00002771299477899447, -0.03224784880876541, 0.035601623356342316, -0.0984020009636879, -0.01766260713338852, -0.04300941526889801, 0.01882352866232395, -0.0007630070904269814, -0.0248769111931324, -0.04385707154870033, -0.02786214090883732, 0.014944573864340782, -0.029078345745801926, 0.046363189816474915, 0.014382540248334408, -0.019754109904170036, -0.011268319562077522, 0.05730903148651123, 0.025724569335579872, 0.004208344034850597, -0.0016550056170672178, 0.0049523478373885155, -0.06777576357126236, 0.004496271256357431, 0.03484610468149185, -0.025853559374809265, -0.018454981967806816, 0.016603033989667892, 0.009402550756931305, 0.03355618938803673, -0.011940917000174522, -0.014078488573431969, -0.007647346705198288, 0.007785551715642214, 0.060773372650146484, -0.004438685718923807, -0.050417207181453705, 0.007665774319320917, 0.04934842139482498, 0.06103135645389557, 0.041498374193906784, -0.021080879494547844, -0.008223201148211956, -0.0925789624452591, -0.03514093905687332, 0.014189053326845169, -0.05100687965750694, -0.010862917639315128, 0.025208603590726852, -0.009775704704225063, -0.015580317005515099, 0.041387807577848434, 0.05071204528212547, 0.03936080262064934, 0.07205090671777725, 0.01269643846899271, 0.03128962591290474, 0.025429731234908104, 0.03348248079419136, -0.051043737679719925, 0.052591633051633835, 0.011747430078685284, -0.11579741537570953, 0.0551346056163311, -0.004229074809700251, 0.014271976426243782, -0.029612738639116287, -0.045552387833595276, 0.02642480842769146, -0.011793498881161213, 0.004837177228182554, -0.019219717010855675, -0.07791080325841904, -0.04883245378732681, 0.06622786819934845, -0.02952060103416443, 0.02972330152988434, 0.05060147866606712, -0.056019119918346405, 0.012972848489880562, -0.011360456235706806, -0.0044041345827281475, -0.018528692424297333, -0.00869770534336567, 0.024379372596740723, -0.040061041712760925, 0.036522991955280304, 0.05428694933652878, -0.01705450378358364, -0.008471970446407795, 0.02270248532295227, 0.06198957562446594, 0.025356022641062737, 0.01716506853699684, -0.03619129955768585, 0.005878321826457977, 0.007209697272628546, 0.005150442011654377, 0.04267772287130356, 0.037462785840034485, 0.020454348996281624, -0.03119749017059803, -0.011572370305657387, -0.017644179984927177, -0.007702628616243601, -0.0407981351017952, 0.03151075541973114, 0.04404134675860405, -0.04628948122262955, 0.0022112810984253883, -0.01586594060063362, -0.02819383330643177, 0.015110420063138008, 0.0007399729220196605, 0.014622095972299576, 0.034145865589380264, 0.004371886607259512, 0.012309464626014233, -0.019827820360660553, 0.0012565143406391144, 0.0020051251631230116, 0.03283752128481865, 0.0187129657715559, -0.03149232640862465, 0.015985717996954918, 0.019846247509121895, 0.002830900251865387, 0.03077366016805172, 0.04175635427236557, 0.03534363955259323, 0.049680113792419434, -0.04805850610136986, 0.016013359650969505, -0.013875788077712059, 0.008637816645205021, -0.09700152277946472, -0.07164550572633743, -0.06847599893808365, -0.0002671964466571808, 0.002791742328554392, 0.009342662058770657, 0.0679231807589531, 0.055503152310848236, 0.008858944289386272 ]
716,441
pytorch_optimizer.loss.focal
forward
null
def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor: cosine_loss = cosine_embedding_loss( y_pred, one_hot(y_true, num_classes=y_pred.size(-1)), torch.tensor([1], device=y_true.device), reduction=self.reduction, ) ce_loss = cross_entropy(normalize(y_pred), y_true, reduction='none') pt = torch.exp(-ce_loss) focal_loss = (self.alpha * (1 - pt) ** self.gamma * ce_loss).mean() return cosine_loss + self.focal_weight * focal_loss
(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor
[ -0.04260512813925743, -0.03051641397178173, 0.004955122712999582, 0.002336943056434393, 0.0655326172709465, 0.0024016720708459616, -0.05828295648097992, 0.03764107823371887, 0.05581878870725632, 0.05389031022787094, 0.038141053169965744, -0.058890070766210556, 0.05367603152990341, 0.004941730760037899, 0.051890403032302856, 0.05385459586977959, 0.020731162279844284, -0.024052433669567108, 0.017017051577568054, -0.01703490875661373, 0.0396052710711956, -0.03756965324282646, -0.03699824959039688, 0.002303462475538254, -0.008280858397483826, -0.03394482284784317, -0.03508762642741203, 0.003106995951384306, -0.026695165783166885, -0.0035154586657881737, -0.023570314049720764, 0.005946147255599499, 0.036748260259628296, 0.0026427321135997772, 0.04910482093691826, 0.02935575507581234, -0.0034150171559304, -0.03480192646384239, 0.020713306963443756, -0.008620128035545349, -0.03774821385741234, -0.06560403853654861, 0.014401104301214218, 0.036891113966703415, -0.03365912288427353, 0.0431051030755043, -0.06735395640134811, 0.013365439139306545, 0.03664112463593483, 0.001945220516063273, -0.02607019618153572, -0.05056903883814812, -0.016811704263091087, 0.0038346401415765285, 0.025695214048027992, 0.036533985286951065, 0.021623976528644562, -0.025623789057135582, -0.07399649918079376, -0.032962728291749954, 0.03469478711485863, -0.0444621816277504, 0.04653351381421089, -0.011954791843891144, 0.043747931718826294, 0.023731021210551262, 0.016740279272198677, 0.04856913164258003, 0.0021650760900229216, -0.0029686095658689737, -0.04799773171544075, -0.020302610471844673, 0.017570598050951958, 0.016990268602967262, -0.015008218586444855, -0.007097878493368626, -0.013936840929090977, -0.035444751381874084, 0.027284424751996994, -0.05210467800498009, -0.03287344425916672, -0.009829891845583916, -0.02644517831504345, -0.00878976285457611, -0.00542385084554553, -0.03203419968485832, 0.002254357561469078, -0.019034814089536667, -0.03392696753144264, 0.06524691730737686, -0.041783738881349564, 0.03953384608030319, -0.008039798587560654, 0.0224275104701519, 0.06646114587783813, 0.03290915861725807, -0.021302564069628716, -0.011079832911491394, 0.0578186959028244, 0.0469263531267643, 0.0357125960290432, 0.13849344849586487, 0.0015568459639325738, 0.032302044332027435, 0.06538976728916168, 0.017445603385567665, -0.04771202802658081, -0.0164635069668293, -0.006084533873945475, -0.014776087366044521, -0.005272072274237871, -0.05696159228682518, 0.032159194350242615, -0.021659689024090767, 0.004234174732118845, -0.08171042054891586, -0.01885625161230564, 0.007097878493368626, -0.034855496138334274, 0.04814058169722557, 0.030052149668335915, -0.0728536993265152, 0.006155958864837885, -0.03233775496482849, -0.014811799861490726, 0.011499456129968166, 0.05071188881993294, -0.02214181050658226, 0.024516697973012924, -0.027766544371843338, -0.033319853246212006, 0.025177380070090294, 0.007669280283153057, 0.03721252456307411, 0.028641503304243088, -0.015106428414583206, 0.036748260259628296, 0.024891680106520653, 0.03276630863547325, -0.0056961593218147755, 0.04035523533821106, 0.02424885332584381, 0.029105765745043755, 0.056854452937841415, -0.026391608640551567, -0.008254073560237885, 0.014168973080813885, 0.04314081743359566, 0.044676460325717926, -0.00462478119879961, 0.05260465666651726, 0.009445982053875923, 0.045926399528980255, -0.04778345301747322, -0.04164088889956474, 0.002490953542292118, -0.013749349862337112, -0.04574783518910408, 0.012204780243337154, 0.031641360372304916, -0.013285085558891296, -0.04799773171544075, -0.06778250634670258, -0.02549879439175129, 0.014936793595552444, -0.022820349782705307, 0.04721205309033394, 0.053604606539011, 0.021909678354859352, 0.04306939244270325, 0.0847817063331604, -0.07260370999574661, 0.06406839936971664, 0.0665682777762413, -0.031641360372304916, 0.007151447702199221, 0.025945201516151428, -0.05817582085728645, -0.015392129309475422, 0.05235466733574867, 0.04006953537464142, -0.03269488364458084, -0.0798533633351326, -0.08185327053070068, 0.05574736371636391, -0.01059771329164505, 0.010651282034814358, 0.07028239220380783, 0.0473191924393177, 0.025980914011597633, -0.01778487302362919, -0.07263942062854767, 0.025088099762797356, -0.005923827178776264, 0.02105257660150528, -0.03953384608030319, 0.017499173060059547, 0.005258679855614901, 0.0364268496632576, -0.047676317393779755, -0.08735301345586777, 0.004812272265553474, 0.010285227559506893, -0.005999716464430094, -0.05281893163919449, 0.006789857521653175, -0.03721252456307411, 0.08063904196023941, -0.05056903883814812, -0.10049524903297424, -0.011928007006645203, 0.00518725486472249, -0.023427464067935944, 0.026855872943997383, 0.034284092485904694, -0.001791209913790226, -0.018981244415044785, 0.0027230854611843824, -0.047033488750457764, -0.01908838376402855, -0.038498178124427795, -0.016079597175121307, -0.0609256885945797, 0.019641928374767303, 0.016258159652352333, -0.03356984257698059, 0.031230665743350983, -0.0037074140273034573, -0.007798738311976194, -0.008745121769607067, -0.009642400778830051, 0.051247578114271164, -0.0271594300866127, 0.0032364539802074432, 0.08713873475790024, 0.013061881996691227, 0.021088289096951485, 0.00863352045416832, -0.030712833628058434, 0.020356180146336555, -0.00471406290307641, -0.038783881813287735, 0.040105246007442474, -0.0027320135850459337, 0.005749728064984083, 0.01449931412935257, 0.0311770960688591, 0.08021049201488495, -0.021748971194028854, 0.0473191924393177, -0.022159665822982788, -0.017775945365428925, -0.022641785442829132, -0.004812272265553474, 0.0055577727034688, -0.055604513734579086, -0.023784589022397995, -0.04649779945611954, 0.029409322887659073, 0.019999053329229355, -0.02833794616162777, 0.05617591366171837, -0.00831657089293003, 0.036962538957595825, -0.027587981894612312, -0.018766969442367554, 0.017820585519075394, 0.009990599006414413, 0.030052149668335915, 0.06074712797999382, 0.05914006009697914, 0.0010194830829277635, -0.023838158696889877, -0.023552456870675087, -0.01951693370938301, -0.0156867578625679, 0.032516319304704666, -0.011829798109829426, -0.010303083807229996, 0.02221323549747467, 0.012954744510352612, -0.11378033459186554, -0.027052292600274086, -0.023784589022397995, 0.01873125694692135, 0.04303367808461189, 0.015008218586444855, -0.025230949744582176, 0.10049524903297424, -0.006106853950768709, 0.042355138808488846, 0.053426045924425125, 0.052854642271995544, 0.006276488769799471, -0.002455241046845913, -0.015311775729060173, -0.040605220943689346, -0.016767064109444618, 0.029087910428643227, 0.021141856908798218, 0.019177664071321487, 0.03503405675292015, -0.008026406168937683, -0.04371221736073494, -0.06878246366977692, -0.04078378528356552, 0.052854642271995544, 0.05142613872885704, -0.032302044332027435, -0.02607019618153572, 0.025373799726366997, -0.013177948072552681, -0.07121092081069946, 0.01253512129187584, -0.036676835268735886, -0.022052528336644173, 0.029302185401320457, -0.00793712493032217, 0.03664112463593483, 0.054604560136795044, 0.031587790697813034, -0.0017488012090325356, 0.010062023997306824, 0.04349794238805771, 0.015392129309475422, -0.04321224242448807, 0.015115357004106045, -0.008990646339952946, -0.0034150171559304, -0.01395469717681408, 0.026909440755844116, -0.020856156945228577, -0.04371221736073494, 0.0008448261069133878, -0.05799725651741028, -0.03706967458128929, 0.010829844512045383, 0.04339080676436424, 0.020963294431567192, 0.01594567485153675, -0.060568563640117645, -0.019784778356552124, -0.03337342292070389, 0.021981103345751762, -0.011383390054106712, -0.006678255740553141, -0.03392696753144264, -0.0144546739757061, 0.06499692797660828, -0.02630232833325863, -0.005392602179199457, 0.005861329846084118, 0.051247578114271164, 0.047604892402887344, 0.018677687272429466, -0.02462383545935154, -0.05985431373119354, -0.0033480559941381216, -0.033105578273534775, -0.023623881861567497, -0.009767395444214344, -0.02133827656507492, -0.053640320897102356, 0.034641217440366745, -0.07892484217882156, 0.0371410995721817, -0.0031471725087612867, -0.04399791732430458, -0.028141526505351067, 0.021820396184921265, -0.01650814712047577, -0.0009368976461701095, 0.00384133611805737, 0.025945201516151428, -0.013606498949229717, 0.018766969442367554, 0.0033368957228958607, 0.0022342693991959095, 0.04067664593458176, -0.0051693981513381, -0.013169020414352417, 0.011633378453552723, -0.08021049201488495, -0.014910008758306503, 0.00909331999719143, 0.03621257469058037, -0.026713022962212563, -0.05871151015162468, 0.016409937292337418, -0.021106144413352013, -0.02053474262356758, -0.046069249510765076, 0.0021371757611632347, -0.05449742078781128, -0.01873125694692135, 0.002950753318145871, -0.007035381626337767, 0.058604370802640915, -0.035516176372766495, -0.0034462655894458294, 0.0017008123686537147, 0.006321129854768515, -0.01434753555804491, 0.01974906586110592, -0.03999810665845871, 0.016990268602967262, 0.03389125317335129, 0.05810439586639404, -0.033105578273534775, 0.10678066313266754, -0.030980678275227547, 0.03431980684399605, -0.06249704584479332, 0.01982049085199833, -0.04328366741538048, 0.008026406168937683, -0.058532945811748505, -0.02608805149793625, 0.007312154397368431, 0.04224800318479538, 0.013490433804690838, 0.03931956738233566, 0.027516555041074753, -0.010044167749583721, -0.07071094214916229, 0.029677167534828186, -0.019534790888428688, 0.04353365674614906, 0.01766880787909031, -0.006209527608007193, -0.03760536387562752, -0.05849723517894745, 0.01729382574558258, -0.05156898871064186, -0.013160091824829578, -0.003745358670130372, 0.022963199764490128, -0.015418913215398788, -0.040105246007442474, 0.03067712113261223, -0.014356464147567749, -0.0313735157251358, 0.03015928715467453, 0.0932098776102066, -0.018516981974244118, -0.003131548408418894, -0.02869507111608982, -0.029909299686551094, -0.019534790888428688, 0.008053191006183624, -0.019695496186614037, 0.004968515131622553, 0.004664957989007235, 0.033105578273534775, 0.046640653163194656, 0.014320751652121544, -0.07463932782411575, -0.05628305301070213, 0.01766880787909031, 0.0003244824183639139, -0.024677405133843422, 0.05210467800498009, -0.03183778002858162, 0.03321271389722824, 0.007365723140537739, 0.001446360140107572, -0.0053434972651302814, -0.008084438741207123, -0.024141715839505196, -0.007379115093499422, 0.0178562980145216, -0.031587790697813034, 0.05396173521876335, 0.005236359313130379, -0.04642637446522713, 0.03928385674953461, -0.03046284429728985, 0.01387434359639883, 0.06074712797999382, -0.016740279272198677, -0.02455241046845913, 0.018624119460582733, -0.04464074596762657, -0.05192611739039421, 0.02403457835316658, 0.01892767660319805, 0.0007332242676056921, -0.02010619267821312, 0.0458906851708889, 0.053068917244672775, 0.022606072947382927, 0.0052854642271995544, 0.04464074596762657, -0.033409133553504944, -0.07349652051925659, -0.03094496577978134, 0.00557116512209177, 0.02753441222012043, -0.0022320372518152, 0.08556738495826721, -0.013927912339568138, -0.014776087366044521, -0.10706636309623718, 0.0032677026465535164, 0.0034418015275150537, 0.015793895348906517, -0.007812130730599165, -0.0013894431758672, -0.04946194589138031, 0.030070006847381592, 0.01878482662141323, -0.003428409341722727, 0.0035065305419266224, -0.01878482662141323, -0.012347630225121975, -0.022409655153751373, 0.023909583687782288, 0.06288988143205643, -0.0021271314471960068, -0.008700481615960598, -0.043319378048181534, 0.03387339785695076, -0.03015928715467453, 0.018838394433259964, -0.0316949300467968, 0.054818835109472275, -0.019266946241259575, -0.014874296262860298, 0.030569983646273613, -0.030284281820058823, -0.0322127640247345, -0.03153422474861145, -0.004892625845968723, 0.01899910159409046, -0.060140013694763184, 0.004602461121976376, -0.005218503065407276, -0.033766258507966995, 0.020481174811720848, -0.02703443542122841, 0.0009687041747383773, -0.0021170873660594225, -0.018838394433259964, 0.0005959539557807148, -0.015793895348906517, -0.030266426503658295, -0.021659689024090767, -0.001121040782891214, -0.03985525667667389, 0.020963294431567192, -0.12063714861869812, -0.007084486540406942, 0.02621304616332054, 0.023195331916213036, 0.060425713658332825, 0.08135329186916351, 0.07785346359014511, 0.04903339594602585, -0.010133448988199234, 0.06024714931845665, -0.0039507062174379826, -0.05960432440042496, 0.05514024943113327, -0.016427794471383095, 0.019927628338336945, 0.02439170330762863, -0.005539916455745697, 0.016454579308629036, 0.01864197477698326, 0.011079832911491394, -0.012544049881398678, 0.051533278077840805, 0.007798738311976194, 0.045212145894765854, -0.014329679310321808, 0.010865557938814163, 0.04006953537464142, -0.06574688851833344, 0.03664112463593483, -0.022766780108213425, -0.0238203015178442, -0.0742821991443634, 0.005231895484030247, 0.04121233522891998, -0.028641503304243088, -0.0020824908278882504, -0.014374320395290852, 0.07246086001396179, -0.003892672946676612, -0.017088478431105614, -0.036176860332489014, -0.022159665822982788, 0.0005116945249028504, 0.002694068942219019, 0.02273106761276722, -0.05974717438220978, -0.0374625138938427, 0.01693669892847538, 0.07113949209451675, 0.051890403032302856, 0.019427653402090073, -0.008459421806037426, 0.016454579308629036, -0.014356464147567749, 0.004042219370603561, -0.010660209693014622, -0.04035523533821106, 0.030623551458120346, -0.04649779945611954, -0.06106853857636452, -0.044176481664180756, 0.0038279439322650433, -0.00040957884630188346, -0.023998865857720375, -0.01201728917658329, 0.01778487302362919, 0.029766449704766273, 0.04721205309033394, -0.01643672212958336, 0.04464074596762657, 0.035516176372766495, -0.03190920501947403, -0.013124379329383373, 0.04656922444701195, 0.015258206985890865, -0.032087769359350204, 0.03946242108941078, -0.030641408637166023, 0.0039551700465381145, 0.00403329124674201, -0.02294534258544445, 0.033766258507966995, -0.014874296262860298, 0.00909331999719143, -0.022052528336644173, 0.029159335419535637, -0.009517407044768333, 0.04553356021642685, -0.0003066261124331504, -0.08992432057857513, -0.049783360213041306, 0.04489073529839516, 0.00016196220531128347, 0.007990693673491478, -0.036676835268735886, 0.005843473598361015, -0.02957003004848957, -0.01982049085199833, 0.024713117629289627, -0.028302233666181564, -0.014651092700660229, 0.012249420396983624, 0.05731871724128723, 0.054961685091257095, 0.03199848532676697, -0.014954649843275547, -0.0271594300866127, 0.038569603115320206, 0.018981244415044785, -0.030337851494550705, -0.004727454856038094, -0.028534363955259323, 0.0392124317586422, 0.00031164821120910347, 0.004633709322661161, 0.0017744696233421564, 0.03483763709664345, -0.07542500644922256, -0.04549784958362579, -0.04442647099494934, -0.028284376487135887, 0.030712833628058434, -0.021106144413352013, -0.011106617748737335, 0.029605742543935776, -0.05178326368331909, 0.034480512142181396, 0.05067617446184158, 0.043962206691503525, -0.02790939435362816, 0.0033168073277920485, 0.030766401439905167, 0.0416765995323658, 0.008825475350022316, 0.02251679264008999, -0.052640367299318314, -0.0486762709915638, 0.0029217367991805077, -0.07371079921722412, -0.05428314581513405, -0.0483548566699028, 0.011204827576875687, 0.022891774773597717, -0.030284281820058823, -0.002228689147159457, 0.0039060653652995825, -0.008111223578453064, 0.02324889972805977, 0.005093509331345558, 0.004839056637138128, -0.059318624436855316, 0.03935528174042702, -0.008687089197337627, -0.061675652861595154, -0.005039940122514963, 0.039890971034765244, -0.004493091255426407, -0.03581973537802696, -0.04817629233002663, -0.017320608720183372, 0.04931909590959549, -0.0007817710866220295, -0.03964098170399666, 0.024802397936582565, -0.02992715686559677, 0.02687372826039791, -0.026034483686089516, 0.011338749900460243, 0.02710586041212082, 0.030319994315505028, 0.025909489020705223, 0.0069416360929608345, 0.0024507769849151373, 0.04649779945611954, -0.07060380280017853, -0.0792105421423912, 0.03483763709664345, -0.04339080676436424, -0.01878482662141323, 0.0016639837995171547, 0.023195331916213036, 0.010454862378537655, -0.0021896285470575094, 0.03699824959039688, -0.017543813213706017, -0.01161552220582962, 0.010660209693014622, -0.060568563640117645, 0.05346175655722618, 0.008504061959683895, 0.03967669606208801, 0.044247906655073166, 0.05596163868904114, 0.02483811043202877, 0.016043884679675102, 0.022052528336644173, -0.031944919377565384, -0.027337992563843727, 0.00486137717962265, 0.0015322936233133078, 0.016356369480490685, 0.03439123183488846, -0.034784067422151566, 0.0016818400472402573, 0.09470980614423752, 0.023034624755382538, 0.013883272185921669, -0.02148112654685974, -0.03917671740055084, -0.06196135655045509, -0.039890971034765244, -0.035801880061626434, -0.024748830124735832, 0.023284612223505974, 0.0066470070742070675, 0.037105388939380646, 0.029445035383105278, 0.036533985286951065 ]
716,475
pytorch_optimizer.loss.focal
FocalLoss
Focal loss function w/ logit input. :param alpha: float. alpha. :param gamma: float. gamma.
class FocalLoss(nn.Module): r"""Focal loss function w/ logit input. :param alpha: float. alpha. :param gamma: float. gamma. """ def __init__(self, alpha: float = 1.0, gamma: float = 2.0): super().__init__() self.alpha = alpha self.gamma = gamma def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor: bce_loss = binary_cross_entropy_with_logits(y_pred, y_true, reduction='none') pt = torch.exp(-bce_loss) focal_loss = self.alpha * (1 - pt) ** self.gamma * bce_loss return focal_loss.mean()
(alpha: float = 1.0, gamma: float = 2.0)
[ -0.069245845079422, -0.04379555583000183, 0.007278896402567625, 0.09097445756196976, 0.03744237869977951, -0.029999015852808952, -0.06714065372943878, 0.009553258307278156, 0.05063743516802788, -0.00048224450438283384, 0.005916159134358168, -0.03650256246328354, 0.03007420152425766, 0.061313778162002563, -0.011954494751989841, 0.04063776507973671, -0.004057667683809996, 0.0021627580281347036, -0.03223578259348869, -0.02428491786122322, 0.010234626941382885, -0.015845345333218575, -0.01761220395565033, 0.04247980937361717, -0.03716043382883072, 0.039810724556446075, 0.02110832929611206, 0.022217316552996635, -0.03622061386704445, -0.04221665859222412, -0.007457462139427662, -0.02176620252430439, 0.03849497810006142, 0.02593899890780449, 0.012377412989735603, -0.010150042362511158, 0.0019595222547650337, 0.0326681025326252, -0.12368015199899673, -0.005930256564170122, -0.017677990719676018, -0.055862829089164734, 0.00502803036943078, 0.031201982870697975, -0.019905362278223038, 0.00008428999717580155, 0.01887156069278717, 0.012969499453902245, 0.013157462701201439, -0.0023636443074792624, -0.05962210148572922, -0.013693159446120262, 0.033795882016420364, -0.0015248559648171067, 0.01828887313604355, 0.07138863205909729, 0.042066287249326706, -0.0085006607696414, -0.032799676060676575, -0.027593079954385757, -0.024322509765625, -0.07247882336378098, 0.060937847942113876, -0.047817979007959366, 0.02845771238207817, 0.02276241034269333, -0.05206596106290817, 0.02753669023513794, 0.006644518580287695, 0.017706185579299927, 0.0033997944556176662, -0.020356474444270134, 0.04007387161254883, 0.047479644417762756, 0.0036394482012838125, 0.002180379582569003, -0.01309167593717575, -0.010920694097876549, 0.014661173336207867, -0.039246831089258194, 0.019050126895308495, -0.029867440462112427, -0.01668178290128708, 0.06135137006640434, 0.029002808034420013, -0.15104767680168152, -0.006616324186325073, -0.05883265659213066, 0.006348475813865662, 0.050111137330532074, -0.08157627284526825, 0.020600827410817146, -0.010037264786660671, -0.006564634386450052, 0.04702853038907051, 0.02400297112762928, -0.034735701978206635, 0.010525970719754696, 0.031145595014095306, -0.008524156175553799, 0.00895647332072258, 0.11871790885925293, 0.00025066727539524436, 0.08172664046287537, 0.04180314019322395, -0.008486563339829445, -0.021503053605556488, -0.011738336645066738, 0.002127514686435461, -0.017452435567975044, -0.0639076754450798, -0.005850371904671192, -0.004546373151242733, -0.020375270396471024, 0.014933720231056213, -0.036953672766685486, 0.008538253605365753, -0.002810058183968067, -0.025506680831313133, 0.043081291019916534, 0.014529597945511341, -0.021860184147953987, -0.05116373300552368, -0.020676013082265854, 0.04413389042019844, 0.012706349603831768, 0.032198190689086914, -0.050035953521728516, 0.034773293882608414, -0.06962177157402039, -0.013542789034545422, 0.02657807432115078, -0.010986481793224812, 0.029472716152668, 0.05048706382513046, -0.048457056283950806, 0.04608871415257454, 0.05571245774626732, 0.02013091742992401, 0.025356311351060867, -0.0008475990616716444, 0.03966035321354866, 0.03221698850393295, 0.044998522847890854, -0.0009174980805255473, 0.0004981039674021304, 0.025713441893458366, -0.0036746913101524115, 0.05507338047027588, -0.02013091742992401, 0.016230670735239983, -0.032160598784685135, 0.01631525345146656, 0.019012533128261566, -0.00288289412856102, 0.013326629996299744, -0.0011929824249818921, -0.03234856203198433, 0.0163340512663126, 0.026822427287697792, -0.019397860392928123, -0.0019536481704562902, -0.055562086403369904, -0.027687061578035355, -0.010723331943154335, -0.04127684235572815, 0.030807260423898697, -0.04439703747630119, 0.009003464132547379, 0.04902094602584839, 0.04003627970814705, -0.05958450958132744, 0.07620050758123398, 0.05142688378691673, 0.004069415386766195, 0.07289234548807144, 0.016174281015992165, -0.009200826287269592, -0.0059255575761199, 0.05890784040093422, 0.04247980937361717, -0.017706185579299927, -0.07774180918931961, -0.04766760766506195, 0.034077830612659454, 0.00487296050414443, -0.009849300608038902, 0.0395851656794548, -0.005375763401389122, -0.006954658776521683, 0.0025845016352832317, -0.01661599613726139, 0.017414841800928116, -0.03454773873090744, 0.012208245694637299, -0.007786398753523827, 0.0020593779627233744, 0.010986481793224812, 0.05496060103178024, -0.02050684578716755, -0.054547082632780075, 0.06732861697673798, 0.010836110450327396, 0.026051776483654976, -0.051351696252822876, 0.012245838530361652, 0.011005277745425701, 0.09744041413068771, -0.07379457354545593, -0.06360693275928497, 0.010441387072205544, 0.03227337822318077, -0.013354824855923653, 0.05150206759572029, 0.009689531289041042, -0.06082507222890854, -0.029923830181360245, 0.03868294134736061, 0.02172861061990261, 0.029585495591163635, -0.013627372682094574, -0.02561946026980877, -0.05304337292909622, 0.0025163646787405014, 0.05108854919672012, 0.014172467403113842, 0.04285573586821556, 0.0013227949384599924, 0.025375107303261757, 0.015403630211949348, 0.004593364428728819, 0.03943479433655739, -0.06229119002819061, 0.006292086560279131, 0.06296785920858383, 0.04157758131623268, -0.007880380377173424, 0.0033058125991374254, -0.04860742762684822, -0.03717923164367676, -0.016399838030338287, -0.02842012047767639, 0.016399838030338287, 0.037912290543317795, 0.01564798317849636, -0.04060016945004463, 0.024247324094176292, 0.07480957359075546, -0.038288217037916183, 0.033138010650873184, -0.03684089705348015, -0.024886401370167732, -0.008904783055186272, 0.03456653282046318, -0.013129268772900105, -0.038833312690258026, -0.0704864114522934, -0.03140874207019806, 0.018345262855291367, -0.015478814952075481, -0.00863693468272686, -0.009393488988280296, -0.04582556337118149, 0.0683436244726181, 0.009393488988280296, -0.02592020109295845, -0.0246796403080225, -0.019454248249530792, 0.06244156137108803, 0.02270602248609066, 0.07529827952384949, 0.015074693597853184, -0.02394658327102661, -0.04732927307486534, 0.005399258807301521, -0.038607753813266754, -0.0008775558089837432, 0.03300643712282181, -0.03749876841902733, 0.009393488988280296, 0.01754641719162464, -0.09841782599687576, -0.0631934180855751, -0.012208245694637299, 0.0051173134706914425, 0.029265956953167915, 0.012236440554261208, -0.021672220900654793, 0.03966035321354866, -0.030619295313954353, 0.06962177157402039, 0.02204814925789833, 0.044660188257694244, 0.06522342562675476, 0.019999343901872635, -0.0015389532782137394, -0.004527576733380556, 0.01663479208946228, 0.02080758847296238, -0.028626879677176476, 0.033438753336668015, -0.026672057807445526, -0.010648147203028202, -0.07266678661108017, -0.053644854575395584, -0.0631934180855751, 0.008904783055186272, 0.049396876245737076, -0.006945260800421238, 0.00004904679371975362, 0.04033702239394188, -0.016719376668334007, -0.04285573586821556, 0.029322346672415733, 0.004734336864203215, -0.044697780162096024, 0.03486727550625801, -0.0169073399156332, 0.016503218561410904, 0.05759209394454956, 0.02020610310137272, 0.0332883819937706, 0.01137180719524622, 0.08225294202566147, -0.026051776483654976, -0.06270471215248108, 0.053231336176395416, 0.03420940414071083, 0.009990273974835873, -0.021634628996253014, -0.05785524472594261, 0.002645589876919985, 0.017349055036902428, -0.008120033890008926, -0.10774082690477371, 0.0032259279396384954, 0.03522440791130066, 0.03007420152425766, 0.03140874207019806, -0.03528079763054848, -0.0069123669527471066, -0.0016470324480906129, -0.05917099118232727, 0.06992251425981522, 0.007170817349106073, -0.03193504363298416, -0.01637164317071438, -0.015911132097244263, 0.04860742762684822, 0.0015495262341573834, -0.0009539160528220236, -0.015460018999874592, -0.0029298849403858185, 0.013401815667748451, 0.06439638137817383, 0.0076360274106264114, -0.0518404021859169, 0.003021517302840948, -0.007903875783085823, -0.05078780651092529, -0.005718797445297241, -0.027010392397642136, -0.05725375935435295, 0.019040727987885475, -0.012010883539915085, 0.043006107211112976, 0.03201022744178772, 0.007278896402567625, 0.02853289805352688, -0.0019125312101095915, -0.013824733905494213, -0.04026183485984802, -0.013279639184474945, -0.0024200333282351494, -0.03787469491362572, 0.003082605544477701, 0.020882774144411087, -0.008857792243361473, -0.000998557428829372, 0.023269912227988243, 0.04093850776553154, -0.013072879053652287, -0.0791703313589096, -0.01732086017727852, 0.012424403801560402, 0.017734380438923836, -0.03272448852658272, -0.03187865391373634, 0.033795882016420364, -0.00944517832249403, -0.020036935806274414, -0.03573191165924072, 0.012274033389985561, -0.0007160244276747108, -0.06105062738060951, 0.0017175187822431326, 0.015093489550054073, 0.02593899890780449, -0.021935369819402695, -0.05127651244401932, 0.017818963155150414, -0.01328903716057539, 0.008566448464989662, 0.02873965911567211, -0.015300249680876732, 0.029265956953167915, 0.03129596635699272, 0.050750214606523514, -0.003982482012361288, 0.0724412277340889, -0.012255236506462097, 0.07443364709615707, -0.07127585262060165, 0.009120941162109375, -0.00018649529374670237, -0.006489448715001345, -0.019379062578082085, -0.09999671578407288, -0.024848807603120804, -0.004882358480244875, 0.031822264194488525, 0.04695334658026695, 0.042066287249326706, 0.014473209157586098, -0.05563727021217346, 0.02434130571782589, 0.012208245694637299, 0.044585004448890686, -0.02332630194723606, 0.031258370727300644, -0.06808046996593475, -0.0345289409160614, -0.006169910077005625, -0.0736817941069603, 0.004915252327919006, -0.03992350026965141, -0.005878566298633814, -0.03430338576436043, -0.02270602248609066, 0.02853289805352688, 0.010516571812331676, 0.026408907026052475, 0.05977247282862663, 0.05563727021217346, 0.006137016694992781, -0.022856391966342926, 0.0008393756579607725, -0.014961915090680122, -0.055825237184762955, 0.005295878741890192, -0.009022260084748268, -0.009459275752305984, 0.022969171404838562, 0.0197925828397274, 0.02272481843829155, -0.012010883539915085, -0.10480859130620956, -0.022837596014142036, 0.031126797199249268, 0.0013580381637439132, -0.05864469334483147, 0.08120033890008926, -0.03992350026965141, -0.03240495175123215, -0.003162490203976631, -0.0015142830088734627, 0.06687750667333603, -0.024078156799077988, -0.048832982778549194, 0.011907503940165043, 0.02913438156247139, -0.041727952659130096, 0.02753669023513794, -0.02597659081220627, -0.044021110981702805, 0.0068512787111103535, -0.018786977976560593, 0.023251116275787354, 0.07229086011648178, -0.049058541655540466, 0.0003544878854881972, 0.00944517832249403, -0.0028805446345359087, -0.020901570096611977, 0.016879145056009293, 0.05270503833889961, 0.0005171940429136157, 0.0033692503347992897, 0.027254745364189148, 0.006508245132863522, -0.030280960723757744, 0.026540482416749, -0.002105194143950939, 0.008900083601474762, -0.07781699299812317, -0.06665194779634476, 0.015779556706547737, 0.028081785887479782, 0.02270602248609066, 0.013439408503472805, -0.013909317553043365, 0.021371478214859962, -0.08210256695747375, -0.010027866810560226, 0.03898368403315544, 0.010168839246034622, -0.0395851656794548, -0.001123670837841928, -0.011296621523797512, 0.0085006607696414, 0.0030097695998847485, 0.0008223414188250899, 0.026954002678394318, -0.004099959507584572, -0.028683269396424294, -0.02274361439049244, 0.0066680144518613815, 0.07804255187511444, 0.005709399003535509, -0.02078879065811634, -0.0008176423143595457, 0.018100909888744354, 0.012725146487355232, 0.016531411558389664, -0.006752598099410534, 0.028382526710629463, -0.015882937237620354, -0.006766695063561201, 0.029585495591163635, 0.017471231520175934, -0.013232648372650146, 0.009506266564130783, 0.006043034605681896, 0.0262773334980011, -0.03075087070465088, 0.0118511151522398, -0.04157758131623268, -0.047517236322164536, -0.05142688378691673, -0.015394231304526329, -0.01627766154706478, 0.03464172035455704, 0.018702393397688866, -0.0039354912005364895, -0.017443036660552025, -0.03202902525663376, -0.02298796735703945, 0.06973455101251602, -0.024378899484872818, 0.0032682197634130716, -0.07240363955497742, -0.032461341470479965, -0.02524353191256523, -0.013561584986746311, 0.02302555926144123, 0.05090058594942093, 0.016719376668334007, 0.031126797199249268, -0.022593243047595024, 0.02043166011571884, -0.040524985641241074, -0.05684024095535278, 0.06954658776521683, 0.054246339946985245, -0.04672779142856598, 0.020036935806274414, 0.01860841177403927, 0.02657807432115078, -0.028269749134778976, 0.018683597445487976, -0.004283224232494831, 0.01827947609126568, -0.02529992163181305, 0.011268427595496178, -0.0447353720664978, 0.0023319253232330084, 0.025751033797860146, -0.03434097766876221, 0.054283931851387024, -0.01328903716057539, -0.012490191496908665, -0.0736817941069603, 0.0023906640708446503, 0.0036840895190835, -0.029021603986620903, 0.015901733189821243, -0.02528112567961216, 0.043006107211112976, -0.0022508660331368446, 0.019360266625881195, -0.010497775860130787, -0.019473044201731682, 0.0014590686187148094, -0.03067568503320217, 0.004494683351367712, -0.03714163973927498, -0.08909481763839722, 0.015206268057227135, 0.06860677152872086, 0.04390833154320717, -0.042404621839523315, -0.016503218561410904, -0.01329843606799841, -0.05544930696487427, -0.011540974490344524, -0.029341142624616623, -0.03332597389817238, 0.05093817785382271, -0.009877495467662811, -0.02526232786476612, -0.06777972728013992, -0.01696372963488102, -0.01860841177403927, 0.002626793459057808, -0.009849300608038902, -0.0006238046917133033, 0.023514265194535255, 0.012029680423438549, 0.047479644417762756, 0.038344606757164, -0.017386646941304207, 0.020262492820620537, -0.03005540370941162, 0.04165276885032654, 0.03516801819205284, -0.017443036660552025, 0.032762084156274796, -0.046539824455976486, 0.0022837596479803324, 0.015300249680876732, -0.03778071328997612, 0.04169036075472832, -0.0459759347140789, 0.03035614639520645, -0.009059852920472622, 0.006202803924679756, 0.0029933229088783264, 0.03546876087784767, 0.014163069427013397, -0.058043207973241806, -0.04582556337118149, 0.02721715159714222, -0.022612038999795914, -0.03815664350986481, 0.00247642258182168, 0.029679477214813232, -0.02560066431760788, 0.0059349555522203445, 0.04582556337118149, -0.05548689886927605, -0.00976471696048975, 0.011165047064423561, 0.05785524472594261, 0.05544930696487427, 0.024322509765625, -0.0076172309927642345, 0.03272448852658272, 0.03272448852658272, 0.06928344070911407, -0.031220780685544014, -0.024548066779971123, -0.04093850776553154, 0.0466901957988739, 0.045600008219480515, -0.01754641719162464, -0.007354082074016333, 0.0261833518743515, -0.08142589777708054, -0.04533685743808746, -0.001970095094293356, -0.041464805603027344, 0.001433223602361977, -0.02045045606791973, -0.02107073739171028, 0.029002808034420013, -0.010948888957500458, 0.036333393305540085, 0.04755483195185661, -0.00027196004521101713, 0.0020640769507735968, 0.04958483949303627, 0.034359775483608246, -0.02146546170115471, -0.030807260423898697, 0.05684024095535278, 0.020356474444270134, -0.07511031627655029, 0.05056225135922432, -0.049133725464344025, -0.03255532309412956, -0.0562763474881649, -0.005328772589564323, 0.05195318162441254, -0.001030276296660304, 0.026709649711847305, -0.0192192941904068, -0.07529827952384949, 0.00417044572532177, -0.008608739823102951, -0.023175930604338646, -0.04556241258978844, 0.03813784569501877, -0.029867440462112427, -0.01732086017727852, 0.0030285660177469254, -0.002337799174711108, -0.023138338699936867, -0.0415399894118309, -0.03355152904987335, 0.008674527518451214, 0.016484420746564865, 0.03159670904278755, -0.0007218982791528106, -0.005192498676478863, 0.013157462701201439, 0.05161484703421593, -0.0016258865362033248, -0.015262656845152378, -0.03804386407136917, 0.049133725464344025, 0.014031494036316872, -0.0049293492920696735, 0.06413323432207108, 0.06804288178682327, -0.02308194898068905, -0.08676406741142273, -0.010507173836231232, -0.03232976421713829, -0.014858534559607506, 0.008199919015169144, 0.028984010219573975, 0.02881484292447567, -0.03396505117416382, 0.0004461202188394964, 0.005333471577614546, -0.03326958417892456, 0.028326138854026794, 0.00327761797234416, 0.005408657249063253, 0.011221435852348804, 0.023871397599577904, -0.013326629996299744, 0.02140907198190689, 0.03482968360185623, 0.07462161034345627, 0.02590140514075756, -0.021503053605556488, 0.0013862326741218567, 0.014134874567389488, 0.008232812397181988, 0.023175930604338646, 0.026484092697501183, 0.018100909888744354, 0.0028711464256048203, 0.11067306250333786, -0.031859856098890305, -0.014191263355314732, -0.011973291635513306, -0.04770519956946373, -0.08180182427167892, -0.035694316029548645, -0.029923830181360245, 0.028382526710629463, -0.007255400996655226, -0.02821335941553116, 0.02462325245141983, 0.02526232786476612, 0.029660681262612343 ]
716,481
pytorch_optimizer.loss.focal
__init__
null
def __init__(self, alpha: float = 1.0, gamma: float = 2.0): super().__init__() self.alpha = alpha self.gamma = gamma
(self, alpha: float = 1.0, gamma: float = 2.0)
[ -0.002953522838652134, -0.018357280641794205, -0.03526051715016365, 0.029244419187307358, -0.009487624280154705, -0.002926259534433484, -0.03864116594195366, -0.0024287046398967505, -0.011068894527852535, 0.031607236713171005, 0.004632486961781979, 0.023010214790701866, -0.009351307526230812, 0.0688125416636467, -0.03200709819793701, -0.008846936747431755, 0.06274191290140152, 0.029371649026870728, 0.02410074695944786, -0.003278410295024514, 0.0010399807943031192, 0.02466418780386448, -0.026827074587345123, 0.058488838374614716, -0.007506492082029581, 0.05445387214422226, 0.022446773946285248, 0.018648087978363037, -0.007688247133046389, -0.03195257484912872, -0.013149992562830448, -0.016012636944651604, 0.03691449016332626, 0.07611910253763199, 0.022501301020383835, -0.06557729840278625, -0.0013915636809542775, 0.018057383596897125, -0.12133980542421341, 0.0645594671368599, 0.04696555808186531, 0.0007855235016904771, -0.008524321019649506, -0.0410403348505497, -0.01179591566324234, -0.012577463872730732, 0.04980093985795975, 0.02795395813882351, -0.030334951356053352, -0.009869310073554516, 0.012586550787091255, -0.027299638837575912, 0.04983729124069214, -0.013331747613847256, -0.03820495307445526, 0.06979401409626007, 0.05539900064468384, 0.00013553546159528196, -0.023064741864800453, 0.047510821372270584, -0.01701229065656662, -0.016485201194882393, 0.007411070168018341, -0.08295309543609619, -0.030498530715703964, -0.02491864562034607, -0.06819456815719604, 0.020447466522455215, 0.011496019549667835, 0.09523975104093552, 0.04260342940688133, 0.022846635431051254, -0.008796954527497292, -0.014313225634396076, -0.009119569323956966, 0.035115115344524384, -0.08004501461982727, 0.035242341458797455, -0.016003549098968506, -0.042203567922115326, 0.02675437368452549, 0.012059461325407028, -0.02868097834289074, 0.014494981616735458, 0.020483816042542458, -0.031261902302503586, -0.029244419187307358, -0.040531422942876816, 0.040022507309913635, 0.05205470323562622, -0.10221915692090988, 0.015167475678026676, 0.008079021237790585, -0.004323503002524376, 0.07023023068904877, 0.0031375500839203596, 0.015321968123316765, -0.028481047600507736, 0.024627836421132088, -0.008069933392107487, -0.0017471223836764693, -0.0015403757570311427, -0.005216375924646854, 0.009760256856679916, -0.013967891223728657, -0.06405054777860641, -0.03911373019218445, -0.02055651880800724, 0.03197075054049492, 0.018793493509292603, -0.034333568066358566, 0.028026659041643143, -0.015476459637284279, 0.04703826084733009, -0.04107668623328209, -0.024427905678749084, -0.02624545805156231, -0.0027535920962691307, 0.055580757558345795, 0.014494981616735458, -0.002101544989272952, 0.037332527339458466, -0.010350961238145828, 0.09320409595966339, 0.0358966626226902, 0.04114938899874687, 0.0005986563628539443, 0.016948677599430084, -0.007383807096630335, -0.023882640525698662, 0.06557729840278625, 0.0027944869361817837, -0.047801632434129715, -0.012522936798632145, 0.043621260672807693, -0.053617797791957855, 0.04453003779053688, 0.06615891307592392, -0.0011768653057515621, 0.04671109840273857, 0.005284533835947514, -0.012977325357496738, 0.010796261951327324, -0.04503894969820976, -0.034188162535429, 0.05063701421022415, 0.0346061997115612, -0.024518784135580063, -0.032425135374069214, -0.0027717675548046827, 0.03602389246225357, 0.04089493304491043, 0.021101783961057663, -0.007701878901571035, 0.003698719432577491, -0.06390514969825745, 0.009314957074820995, -0.0619785413146019, 0.03606024011969566, 0.027027005329728127, -0.019157003611326218, 0.03538774698972702, -0.007938160561025143, -0.05350874736905098, -0.0031511816196143627, 0.051909301429986954, -0.06299637258052826, -0.0483105443418026, 0.02321014553308487, -0.014204173348844051, 0.0097239064052701, -0.08026311546564102, 0.026190930977463722, 0.02884455770254135, -0.004698373377323151, 0.04474814236164093, -0.00005268062523100525, 0.015449196100234985, 0.03175264224410057, 0.027644973248243332, 0.04373031482100487, -0.05034620314836502, -0.05696209520101547, -0.012132163159549236, 0.06655877083539963, -0.027117883786559105, 0.007751861587166786, 0.05449022352695465, -0.004884672351181507, -0.041258443146944046, 0.02928077057003975, 0.006488662678748369, 0.004300783853977919, -0.007570106070488691, 0.013468064367771149, 0.00974208116531372, 0.019429637119174004, -0.0611061155796051, 0.014694912359118462, 0.06950321048498154, -0.026190930977463722, -0.000044409338443074375, -0.004180370829999447, -0.040531422942876816, 0.02277393266558647, -0.031043797731399536, 0.00430532731115818, -0.013686170801520348, -0.012777394615113735, -0.023482779040932655, -0.03566037863492966, -0.0179483313113451, 0.03287952393293381, -0.0008633374236524105, -0.012441147118806839, -0.10040160268545151, 0.025845596566796303, -0.013386274687945843, 0.04045872017741203, 0.058488838374614716, 0.10723559558391571, -0.042458027601242065, 0.016530640423297882, -0.011677774600684643, 0.02059287019073963, 0.02277393266558647, 0.05590791627764702, -0.04638393968343735, -0.07539207488298416, -0.0043871174566447735, -0.016103515401482582, -0.0500190444290638, -0.05525359511375427, -0.006156959105283022, -0.018230052664875984, 0.056780342012643814, 0.002143576042726636, 0.017530294135212898, -0.10345508903265, -0.07172062247991562, 0.0478743314743042, 0.04427557811141014, 0.020374763756990433, 0.054381173104047775, -0.010360049083828926, -0.025118576362729073, -0.011468756012618542, 0.0645594671368599, -0.03636922687292099, -0.0032761383336037397, -0.0440211221575737, -0.046783801168203354, -0.0006372793577611446, 0.05747101083397865, -0.0337701253592968, 0.019684093073010445, -0.03407910838723183, 0.004568872507661581, 0.02944434992969036, -0.013867925852537155, -0.02599100023508072, -0.030843866989016533, -0.01739397831261158, 0.09603947401046753, 0.04761987552046776, 0.022446773946285248, 0.013777048327028751, -0.02580924518406391, 0.00492556719109416, 0.024009868502616882, 0.12940974533557892, 0.024627836421132088, 0.0005444137495942414, 0.0021549356169998646, 0.022810284048318863, -0.04282153770327568, 0.0011234746780246496, 0.0020833695307374, -0.03140730783343315, 0.01683962345123291, 0.0559806190431118, -0.04725636541843414, -0.01577635668218136, 0.03520599380135536, -0.012841008603572845, -0.017203135415911674, 0.019811322912573814, 0.0282084159553051, 0.009105938486754894, -0.029480701312422752, -0.002235589548945427, 0.023028390482068062, 0.037114422768354416, 0.03278864920139313, 0.09291328489780426, -0.02004760503768921, -0.0013529406860470772, 0.04405747354030609, -0.0013313571689650416, 0.016176218166947365, 0.09480354189872742, -0.049146618694067, 0.02782672829926014, 0.0254275593906641, -0.029171718284487724, -0.000142635268275626, 0.04136749356985092, 0.023228321224451065, 0.02517310157418251, 0.01416782196611166, 0.027063356712460518, 0.04671109840273857, -0.0072293151170015335, 0.0461658351123333, -0.015494635328650475, -0.06855808198451996, 0.029735159128904343, -0.06506837904453278, -0.0055389911867678165, 0.06815821677446365, -0.009732993319630623, -0.004975549876689911, -0.025373032316565514, 0.0029739702586084604, -0.03691449016332626, -0.037078071385622025, 0.01948416233062744, 0.046311236917972565, -0.00798814371228218, -0.0065113818272948265, -0.11159772425889969, 0.017593909054994583, 0.020974555984139442, 0.027917606756091118, -0.06514108180999756, -0.0190115999430418, -0.003932729363441467, 0.03337026387453079, 0.01032369863241911, -0.04936472699046135, 0.010132855735719204, -0.021301714703440666, -0.03747793287038803, 0.008924182504415512, 0.0030080494470894337, -0.0495828315615654, -0.006016098894178867, -0.07150251418352127, 0.019465986639261246, -0.025718368589878082, -0.004930111113935709, -0.03642375394701958, 0.0010916674509644508, 0.020065778866410255, 0.05543535202741623, -0.008419811725616455, -0.02257400192320347, -0.03947724029421806, 0.0023719060700386763, -0.014113294892013073, 0.03313398361206055, 0.05110957846045494, -0.06350528448820114, 0.03969534859061241, 0.012777394615113735, -0.019120652228593826, 0.014295050874352455, -0.01568547822535038, 0.0440211221575737, 0.010578155517578125, 0.04336680471897125, -0.035969365388154984, -0.03064393624663353, -0.00535269221290946, -0.003473797347396612, 0.024391554296016693, -0.04151289910078049, 0.007161156740039587, 0.02504587359726429, -0.018311841413378716, 0.029171718284487724, -0.0006974857533350587, 0.0030171372927725315, 0.034860655665397644, -0.03744158148765564, -0.028281116858124733, 0.00011792792065534741, -0.013940627686679363, 0.07873637229204178, 0.03384282812476158, -0.04209451749920845, 0.000052432129450608045, 0.057979926466941833, -0.01540375780314207, -0.002508222358301282, -0.00201407540589571, 0.023755410686135292, -0.02077462524175644, -0.03551497682929039, -0.0052118320018053055, 0.014813053421676159, -0.02675437368452549, 0.011595984920859337, 0.015785444527864456, 0.008674269542098045, -0.04565691947937012, 0.03860481455922127, 0.019029775634407997, 0.016339797526597977, 0.025354858487844467, -0.048274196684360504, -0.024264326319098473, -0.04525705799460411, 0.0006105840438976884, 0.036096591502428055, -0.05441752076148987, 0.027754027396440506, -0.07793664932250977, 0.01038731262087822, -0.03273412212729454, -0.014367752708494663, 0.026390861719846725, 0.004205361939966679, 0.06106976419687271, 0.04114938899874687, 0.04289424046874046, -0.00044047250412404537, 0.01790289208292961, 0.03751428425312042, -0.004432556219398975, -0.052927128970623016, -0.0023628182243555784, -0.01658516749739647, -0.042966943234205246, 0.016766922548413277, -0.00197204458527267, -0.021610699594020844, -0.025409383699297905, -0.011668686755001545, 0.011059806682169437, 0.02128354087471962, -0.031189201399683952, 0.059979233890771866, 0.017675697803497314, -0.0084425313398242, -0.011777739971876144, 0.005016444716602564, 0.03526051715016365, 0.010360049083828926, -0.03835035860538483, 0.021865157410502434, 0.013395361602306366, 0.010287347249686718, -0.05732560530304909, 0.05496278777718544, -0.055326297879219055, -0.12541112303733826, -0.022174140438437462, 0.026390861719846725, -0.026190930977463722, 0.015912672504782677, 0.03687813878059387, -0.06575904786586761, -0.035496801137924194, -0.04969188570976257, 0.040749527513980865, 0.10403670370578766, -0.004487082827836275, -0.05619872361421585, -0.037168949842453, 0.04162195324897766, 0.0380231998860836, -0.0056753079406917095, -0.05394496023654938, -0.05201835185289383, 0.013331747613847256, -0.012023109942674637, -0.016848711296916008, -0.0087606031447649, -0.04725636541843414, -0.021556172519922256, -0.025463910773396492, 0.016430674120783806, 0.04576597362756729, 0.012559288181364536, 0.049001216888427734, -0.015949023887515068, -0.002313971519470215, 0.045366112142801285, 0.03871386870741844, -0.0653591901063919, 0.016866886988282204, -0.03337026387453079, 0.05667128786444664, -0.032425135374069214, 0.0032738663721829653, 0.035842135548591614, 0.038822922855615616, -0.0013995154295116663, 0.03555132821202278, -0.016566991806030273, -0.007102086674422026, -0.01961139217019081, -0.015658214688301086, 0.022555826231837273, -0.055580757558345795, -0.05150943994522095, -0.005470833275467157, -0.026954304426908493, -0.007724598050117493, 0.038568463176488876, -0.02355547994375229, 0.007938160561025143, -0.03273412212729454, 0.010996192693710327, -0.0090786749497056, -0.07764584571123123, 0.016894150525331497, -0.016467025503516197, -0.0014892570907250047, 0.006025186739861965, 0.037805091589689255, 0.0363146997988224, -0.04114938899874687, -0.01034187339246273, 0.01598537527024746, 0.008924182504415512, -0.018529947847127914, 0.026354512199759483, 0.04594772681593895, -0.018611738458275795, -0.04580232501029968, -0.04114938899874687, 0.05885235220193863, -0.022174140438437462, 0.03893197327852249, -0.007660984061658382, -0.0012995500583201647, 0.033697422593832016, -0.049728237092494965, 0.035151466727256775, 0.007901809178292751, 0.05976112559437752, -0.017112256959080696, -0.010196469724178314, -0.028626451268792152, -0.04576597362756729, 0.04543881118297577, -0.015040246769785881, -0.008397093042731285, 0.00032630746136419475, -0.04249437898397446, -0.042712483555078506, -0.03453349694609642, -0.012695604003965855, 0.023828113451600075, 0.0040963091887533665, -0.03424268960952759, 0.017075905576348305, 0.007233859039843082, 0.026427213102579117, -0.004625671077519655, 0.025572963058948517, 0.011405142024159431, -0.0713934600353241, -0.03911373019218445, -0.00822896882891655, 0.033788301050662994, -0.019884023815393448, 0.004916479345411062, 0.013413537293672562, -0.037623338401317596, -0.009996538981795311, 0.02824476547539234, -0.04794703423976898, 0.018366368487477303, -0.0017096353694796562, 0.0337701253592968, -0.024137098342180252, -0.035242341458797455, 0.030662110075354576, 0.002054970245808363, -0.08215337246656418, -0.05419941619038582, -0.00903777964413166, 0.011232474818825722, -0.021574348211288452, 0.019520513713359833, 0.0030080494470894337, -0.030153196305036545, -0.005116410553455353, 0.027045181021094322, -0.006988489534705877, -0.06088801100850105, -0.06146962568163872, -0.05310888588428497, -0.017430327832698822, -0.0564168319106102, -0.0013109097490087152, -0.014267787337303162, -0.015594600699841976, 0.01572182960808277, -0.019138827919960022, 0.025500262156128883, 0.016394324600696564, -0.00925134215503931, 0.032207030802965164, 0.04503894969820976, -0.04569327086210251, -0.034297216683626175, -0.003898650174960494, -0.02064739726483822, -0.04809243977069855, -0.025100400671362877, -0.01491301879286766, 0.0029739702586084604, -0.01747576706111431, -0.009387658908963203, 0.015249265357851982, 0.043875716626644135, -0.07895448058843613, 0.01961139217019081, -0.013522590510547161, 0.06808551400899887, -0.00015491795784328133, -0.03795049712061882, 0.03484247997403145, -0.10185564309358597, -0.014004241675138474, -0.03740523010492325, 0.0483105443418026, 0.026136405766010284, -0.011077982373535633, -0.051909301429986954, -0.04532976076006889, -0.022210491821169853, -0.02922624535858631, 0.02580924518406391, 0.03364289551973343, 0.008219880983233452, -0.0006639746716246009, 0.04202181473374367, -0.0017630259972065687, 0.02760862186551094, -0.0036919035483151674, -0.016439761966466904, -0.0696849599480629, 0.010369136929512024, 0.04431192949414253, -0.045366112142801285, -0.012468410655856133, 0.027717676013708115, 0.0023071556352078915, 0.022683056071400642, -0.06492297351360321, -0.013331747613847256, 0.015094773843884468, 0.05227281153202057, 0.06088801100850105, -0.004634758923202753, -0.039259135723114014, 0.01961139217019081, 0.00080540293129161, 0.06532283872365952, 0.031516361981630325, -0.0012018566485494375, -0.0017789294943213463, -0.08535226434469223, -0.03098927065730095, 0.007779124658554792, -0.03936818614602089, -0.0011013231705874205, -0.01540375780314207, -0.03458802402019501, -0.00637960946187377, 0.0179483313113451, 0.0040917652659118176, 0.03440627083182335, 0.04525705799460411, 0.021610699594020844, 0.029498877003788948, 0.030444005504250526, 0.0006656785844825208, -0.03298857808113098, 0.019266055896878242, 0.03662368282675743, -0.07270210236310959, 0.0760463997721672, -0.007760949432849884, -0.016739659011363983, -0.041476547718048096, -0.06128787249326706, -0.0012836464447900653, 0.007306561339646578, -0.006679505575448275, -0.009369483217597008, -0.07502856850624084, -0.03867751732468605, 0.04064047336578369, -0.03307945653796196, 0.008474338799715042, 0.010360049083828926, -0.06655877083539963, 0.06644971668720245, -0.005239095073193312, -0.00925588607788086, 0.011032544076442719, -0.015294704586267471, 0.019229706376791, -0.039513591676950455, 0.027554096654057503, 0.039731696248054504, -0.01113250944763422, -0.0461658351123333, -0.0014938010135665536, 0.07321101427078247, 0.021519821137189865, 0.006820365786552429, -0.05667128786444664, 0.03616929426789284, -0.006956682074815035, -0.0008798090275377035, 0.057725466787815094, 0.02593647502362728, 0.01190496888011694, -0.004802882671356201, -0.012259392067790031, -0.0016982756787911057, -0.01597628742456436, -0.04671109840273857, 0.02517310157418251, 0.038277655839920044, -0.049146618694067, 0.000011191082194272894, -0.013068202883005142, -0.0388956256210804, 0.0038168602623045444, -0.014204173348844051, 0.04518435522913933, 0.00858793593943119, 0.01557642500847578, -0.0026218194980174303, -0.023010214790701866, -0.0016494288574904203, 0.020065778866410255, 0.036223821341991425, 0.02282845973968506, -0.002170839346945286, 0.03282499685883522, -0.0026649862993508577, -0.010650857351720333, 0.019811322912573814, 0.026009175926446915, 0.04376666620373726, 0.0645594671368599, -0.014922105707228184, 0.002801302820444107, -0.00659317197278142, 0.0014233707915991545, -0.06728579103946686, -0.057071149349212646, -0.04114938899874687, 0.017921067774295807, 0.02482776716351509, 0.01790289208292961, 0.05467198044061661, 0.05765276402235031, 0.0026922496035695076 ]
716,511
pytorch_optimizer.loss.focal
forward
null
def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor: bce_loss = binary_cross_entropy_with_logits(y_pred, y_true, reduction='none') pt = torch.exp(-bce_loss) focal_loss = self.alpha * (1 - pt) ** self.gamma * bce_loss return focal_loss.mean()
(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor
[ -0.047320809215307236, -0.031054280698299408, 0.0032428079284727573, 0.062108561396598816, 0.058712854981422424, -0.012533076107501984, -0.054148733615875244, 0.0022227270528674126, 0.051957953721284866, 0.03654948249459267, 0.02674574963748455, -0.06882694363594055, 0.023715173825621605, 0.01658601686358452, 0.01682334952056408, 0.050132304430007935, -0.0015472370432689786, -0.01246917899698019, 0.014121390879154205, -0.014075749553740025, 0.023970764130353928, -0.04962112382054329, -0.03320854529738426, 0.023550864309072495, -0.016102219000458717, -0.018986742943525314, -0.02004561945796013, 0.011282507330179214, -0.045422133058309555, 0.009009575471282005, -0.01626652665436268, -0.020319467410445213, 0.050680000334978104, 0.00012102052278351039, 0.04702870547771454, 0.018055662512779236, 0.015353702940046787, -0.020502032712101936, -0.041259653866291046, -0.03844815492630005, -0.05436781048774719, -0.06714735180139542, 0.018530331552028656, 0.054696425795555115, -0.0183386392891407, 0.012368768453598022, -0.026636211201548576, 0.011884971521794796, 0.05228657275438309, 0.0028411652892827988, -0.05590135604143143, -0.040784984827041626, 0.002505702432245016, 0.010177990421652794, 0.020264698192477226, 0.04673660174012184, 0.025686873123049736, -0.029064323753118515, -0.06762202084064484, -0.04790501669049263, 0.009151062928140163, -0.06521216034889221, 0.0512642078101635, -0.033062491565942764, 0.06159737706184387, 0.0382290780544281, -0.022838862612843513, 0.04523956775665283, -0.006161563564091921, 0.010022809728980064, -0.04359648376703262, -0.02335004322230816, 0.025303486734628677, 0.027256930246949196, -0.0344499871134758, -0.013427644036710262, -0.011711535044014454, -0.015837499871850014, 0.013601080514490604, -0.045495159924030304, -0.007685979828238487, -0.0015734807820990682, -0.003288449253886938, 0.022272910922765732, 0.022309424355626106, -0.06908253580331802, 0.003231397829949856, -0.018347766250371933, -0.02170695923268795, 0.06510262191295624, -0.035107217729091644, 0.020264698192477226, 0.012286613695323467, 0.030725663527846336, 0.06269276887178421, 0.035600144416093826, -0.050387896597385406, 0.03090822882950306, 0.06539472937583923, 0.02924688719213009, 0.030871715396642685, 0.12071187794208527, 0.0073527991771698, 0.03470557555556297, 0.05075302720069885, 0.02486533112823963, -0.01738017238676548, -0.020940188318490982, -0.0031926026567816734, -0.02415332943201065, -0.028753962367773056, -0.03514373302459717, 0.020976699888706207, -0.0166681706905365, -0.01635780930519104, -0.06334999948740005, -0.0192605908960104, 0.00814239215105772, -0.04027380421757698, 0.06703781336545944, 0.020337723195552826, -0.0660884752869606, -0.010789582505822182, -0.03435870260000229, -0.005020533222705126, 0.0294842217117548, 0.050533950328826904, -0.032514799386262894, 0.011976254172623158, -0.04498397558927536, -0.022218141704797745, 0.027348212897777557, -0.011665893718600273, 0.0026449081487953663, 0.039908673614263535, -0.04823363199830055, 0.04381556063890457, 0.012387024238705635, 0.05535366013646126, -0.002069828798994422, 0.05086256563663483, 0.020355980843305588, 0.03490639850497246, 0.030652636662125587, 0.001697853091172874, -0.008977626450359821, 0.03958005830645561, 0.04056590795516968, 0.04984020069241524, 0.00829300843179226, 0.039434004575014114, 0.0022033294662833214, 0.014723855070769787, -0.0434139184653759, -0.025266975164413452, 0.004260607063770294, -0.016631657257676125, -0.032204438000917435, 0.00483796838670969, -0.0004592646728269756, -0.024573227390646935, -0.03262433782219887, -0.06806017458438873, -0.03642168641090393, 0.014659957028925419, -0.018612485378980637, 0.020246440544724464, 0.06418979912996292, 0.02092193067073822, 0.04575074836611748, 0.06900951266288757, -0.06992233544588089, 0.047539886087179184, 0.06700129806995392, -0.010844351723790169, 0.03545409440994263, 0.020228184759616852, -0.04323135316371918, -0.016695555299520493, 0.07762657105922699, 0.04239155724644661, -0.02501138299703598, -0.0665266290307045, -0.05418524518609047, 0.04516654089093208, -0.025613848119974136, 0.019406642764806747, 0.06601544469594955, 0.010588760487735271, 0.00530807301402092, -0.032989468425512314, -0.06272927671670914, 0.032916441559791565, -0.035034194588661194, 0.014678213745355606, -0.014888162724673748, 0.02101321332156658, 0.035837478935718536, 0.038740258663892746, -0.03863072022795677, -0.08127786964178085, -0.0037859384901821613, -0.011090814135968685, -0.01557278074324131, -0.03987216204404831, 0.0005300085758790374, -0.040383342653512955, 0.07229568064212799, -0.03547234833240509, -0.08113181591033936, -0.009940655902028084, 0.009041523560881615, -0.04279319941997528, 0.015682319179177284, 0.025066152215003967, -0.029538990929722786, 0.004662249702960253, 0.02004561945796013, -0.034796860069036484, 0.026690980419516563, -0.05736187472939491, -0.039689596742391586, -0.043998125940561295, 0.013162924908101559, 0.015709705650806427, -0.0008979908307082951, 0.038813285529613495, 0.02013690210878849, 0.0011381777003407478, -0.009557269513607025, -0.011099942028522491, 0.04407115280628204, -0.049986254423856735, -0.004233222454786301, 0.09522582590579987, 0.05057046189904213, 0.014714726246893406, 0.005262431688606739, -0.03373798355460167, 0.029922377318143845, -0.0022923299111425877, -0.030378790572285652, 0.040858011692762375, 0.02815149910748005, -0.007202182896435261, -0.0204472616314888, 0.04600634053349495, 0.07229568064212799, -0.023258760571479797, 0.060282912105321884, -0.03903236240148544, -0.016485605388879776, -0.02077587880194187, 0.00897306203842163, -0.010123220272362232, -0.06670919060707092, -0.014203544706106186, -0.05016881972551346, 0.04472838714718819, 0.0102236308157444, -0.004096298478543758, 0.04115011543035507, -0.01949792541563511, 0.04348694533109665, -0.04136919230222702, -0.0012596973683685064, 0.012277485802769661, -0.017827456817030907, 0.05648556351661682, 0.07182101160287857, 0.08230023086071014, -0.004431761801242828, -0.031784538179636, -0.035819221287965775, -0.02572338655591011, -0.012514820322394371, 0.04169781133532524, 0.004942943342030048, -0.026544928550720215, 0.016239142045378685, 0.011109070852398872, -0.11209481209516525, -0.03470557555556297, -0.002852575620636344, -0.017599251121282578, 0.03549060598015785, 0.00532632926478982, -0.046444498002529144, 0.07981734722852707, -0.012670000083744526, 0.036841586232185364, 0.042355041950941086, 0.04012775421142578, 0.03326331451535225, 0.021652190014719963, -0.03435870260000229, 0.0014297108864411712, -0.033464137464761734, 0.025522565469145775, 0.031492434442043304, 0.024208098649978638, 0.022765835747122765, -0.003916015848517418, -0.04049288108944893, -0.054221756756305695, -0.03539932146668434, 0.055098067969083786, 0.03375624120235443, -0.016020065173506737, -0.028443602845072746, 0.021999062970280647, -0.01825648359954357, -0.04483792558312416, 0.016020065173506737, -0.028881758451461792, -0.04670008644461632, 0.03623912110924721, -0.017005914822220802, 0.01958920806646347, 0.05411221832036972, 0.024518458172678947, 0.010351426899433136, 0.024956613779067993, 0.044545821845531464, -0.009329063817858696, -0.04206293821334839, 0.026928314939141273, 0.035034194588661194, 0.007202182896435261, -0.031017767265439034, -0.021049726754426956, -0.0203742366284132, -0.022984914481639862, 0.007895929738879204, -0.0718575194478035, -0.040456369519233704, -0.0017343660583719611, 0.027092622593045235, 0.01927884668111801, -0.007288901600986719, -0.05542668700218201, -0.0069922334514558315, -0.04461884871125221, 0.04973066225647926, -0.000993266818113625, -0.0016932889120653272, -0.028060216456651688, -0.012387024238705635, 0.04279319941997528, -0.005413047503679991, -0.015636678785085678, 0.0008055673679336905, 0.029447710141539574, 0.05057046189904213, 0.01980828493833542, -0.011976254172623158, -0.06094014644622803, 0.01747145503759384, -0.008087622933089733, -0.011556354351341724, -0.01167502161115408, -0.025066152215003967, -0.060903631150722504, 0.03256956860423088, -0.04827014356851578, 0.05900495871901512, 0.0001635952212382108, -0.04001821205019951, -0.005636689718812704, 0.011894099414348602, -0.01168415043503046, -0.018986742943525314, -0.005559099372476339, 0.018986742943525314, -0.034176137298345566, 0.027165649458765984, 0.005896844435483217, -0.017015043646097183, 0.03979913517832756, 0.037389278411865234, 0.0052213543094694614, 0.012304870411753654, -0.102528415620327, -0.019881311804056168, 0.0047101727686822414, 0.02973981387913227, -0.035910505801439285, -0.058785878121852875, 0.028114985674619675, -0.022601528093218803, 0.003277038922533393, -0.047466859221458435, 0.0032861672807484865, -0.056120432913303375, -0.02691005729138851, 0.003548604203388095, 0.010670915246009827, 0.05717930942773819, -0.0341578833758831, -0.011702406220138073, -0.004287991672754288, 0.03733450919389725, -0.0021702395752072334, -0.006056588608771563, -0.04870830103754997, 0.003614783985540271, 0.022272910922765732, 0.0657963678240776, -0.03273387625813484, 0.0966133177280426, -0.018466433510184288, 0.048087578266859055, -0.06718385964632034, 0.005015969276428223, -0.04611587896943092, -0.004897302016615868, -0.060428962111473083, -0.07178449630737305, -0.012770410627126694, 0.02313096635043621, 0.013382002711296082, 0.03342762216925621, 0.021926037967205048, -0.004833404440432787, -0.07594697177410126, 0.030707405880093575, -0.03019622527062893, 0.039434004575014114, 0.0029370118863880634, 0.002587856724858284, -0.029192117974162102, -0.06543123722076416, 0.015581909567117691, -0.04571423679590225, -0.0031127305701375008, -0.005636689718812704, 0.019224077463150024, -0.018347766250371933, -0.017005914822220802, 0.02413507178425789, -0.02743949554860592, -0.00043701459071598947, 0.05542668700218201, 0.08850743621587753, 0.008525778539478779, -0.01246005017310381, -0.03623912110924721, -0.042975764721632004, -0.030013659968972206, 0.020100388675928116, -0.02760380506515503, -0.006973977200686932, 0.020319467410445213, 0.028644423931837082, 0.05590135604143143, 0.024737536907196045, -0.10939285159111023, -0.04177083447575569, 0.023222249001264572, 0.004778634756803513, -0.027549033984541893, 0.052250057458877563, -0.02681877464056015, 0.03859420865774155, 0.012414409779012203, -0.004653121344745159, 0.012752153910696507, -0.0037562716752290726, -0.026599697768688202, -0.0023870354052633047, 0.015618422068655491, -0.03392054885625839, 0.04728429391980171, 0.010251016356050968, -0.06353256851434708, 0.026453645899891853, -0.0049155582673847675, 0.03256956860423088, 0.08003642410039902, -0.03209489956498146, -0.03231397643685341, 0.025029640644788742, -0.04334089532494545, -0.04523956775665283, 0.021049726754426956, 0.024993127211928368, -0.01675032451748848, -0.0024258303456008434, 0.04381556063890457, 0.026690980419516563, -0.012076664716005325, 0.0023060222156345844, 0.01738017238676548, -0.007069823332130909, -0.08989492803812027, -0.07094469666481018, 0.020483775064349174, 0.022948401048779488, 0.02579641155898571, 0.05177538841962814, -0.00990414246916771, -0.0023140094708651304, -0.10734812915325165, -0.017727047204971313, -0.008160648867487907, -0.0005425598938018084, -0.011501585133373737, -0.0067868479527533054, -0.040456369519233704, 0.03954354673624039, 0.024591485038399696, -0.002114329021424055, 0.005750792566686869, -0.013874928466975689, -0.017553608864545822, -0.02784113772213459, 0.037863947451114655, 0.04779547452926636, 0.010981275700032711, -0.008439060300588608, -0.0385211817920208, 0.02106798253953457, -0.004984020255506039, 0.033153776079416275, -0.01419441681355238, 0.03987216204404831, -0.009840245358645916, -0.006289358716458082, 0.0014742111088708043, -0.016403451561927795, -0.015581909567117691, -0.02848011627793312, 0.026544928550720215, 0.015244164504110813, -0.08069366216659546, 0.003071653423830867, -0.01975351572036743, -0.05301683023571968, -0.04461884871125221, -0.033318083733320236, 0.002056136494502425, -0.014294827356934547, 0.010369682684540749, -0.004491094965487719, -0.020629826933145523, -0.013893184252083302, -0.03954354673624039, 0.018895462155342102, -0.02263803966343403, 0.015308062545955181, -0.06769504398107529, -0.00436786375939846, 0.011218609288334846, 0.025522565469145775, 0.06272927671670914, 0.07116377353668213, 0.06426282227039337, 0.06816971302032471, -0.02084890566766262, 0.026946570724248886, -0.023970764130353928, -0.07149239629507065, 0.05940660089254379, 0.010917377658188343, -0.021579165011644363, 0.02358737774193287, -0.026599697768688202, 0.06167040392756462, 0.019461411982774734, 0.024317637085914612, -0.019461411982774734, 0.05159282311797142, -0.009256037883460522, 0.02187126874923706, -0.00432678684592247, 0.009210396558046341, 0.04418069124221802, -0.07233218848705292, 0.049438558518886566, 0.0008312405552715063, -0.006408025976270437, -0.08952979743480682, 0.02210860326886177, 0.03490639850497246, -0.024317637085914612, 0.023733429610729218, -0.029666787013411522, 0.05031486973166466, 0.005919665098190308, -0.0064491028897464275, -0.03910538926720619, 0.012450922280550003, -0.014596058987081051, -0.013144669122993946, 0.011775432154536247, -0.04523956775665283, -0.03713368996977806, 0.021889524534344673, 0.045495159924030304, 0.04892737790942192, 0.030579611659049988, -0.019698746502399445, -0.0010851197876036167, -0.024664510041475296, -0.010725684463977814, -0.0330442376434803, -0.027859395369887352, 0.030816946178674698, -0.025449538603425026, -0.03067089430987835, -0.051081642508506775, -0.024901844561100006, 0.0015346857253462076, -0.009539012797176838, -0.004372428171336651, 0.010963018983602524, 0.045896802097558975, 0.040931038558483124, 0.007854852825403214, 0.0819351002573967, 0.02320399135351181, -0.009137370623648167, -0.012560461647808552, 0.0711272656917572, 0.03554537519812584, -0.06039245054125786, 0.04545864462852478, -0.021341830492019653, -0.004511633887887001, 0.016795964911580086, -0.024244612082839012, 0.05130071938037872, -0.05308985710144043, 0.013591952621936798, -0.0078092110343277454, 0.031510692089796066, 0.014422622509300709, 0.03678681701421738, -0.004379274323582649, -0.08076668530702591, -0.06159737706184387, 0.04315833002328873, 0.002169098472222686, -0.008092186413705349, -0.0254130270332098, 0.03910538926720619, -0.04827014356851578, 0.010707427747547626, 0.018594229593873024, -0.028644423931837082, -0.0008169776992872357, -0.01809217594563961, 0.06601544469594955, 0.05137374624609947, -0.0016510707791894674, 0.011492457240819931, -0.0006338423117995262, 0.07240521907806396, 0.026471901684999466, -0.031492434442043304, -0.038740258663892746, -0.03390229120850563, 0.015189395286142826, 0.01557278074324131, -0.013190309517085552, -0.00737561983987689, 0.015444985590875149, -0.0810587927699089, -0.062181584537029266, -0.029922377318143845, -0.042355041950941086, -0.004319940693676472, -0.033391110599040985, -0.01957095041871071, 0.027622060850262642, -0.049365535378456116, 0.028589654713869095, 0.0558648407459259, 0.04202642664313316, -0.021816499531269073, 0.0383751317858696, 0.03368321433663368, 0.012688256800174713, 0.002852575620636344, 0.06002731993794441, -0.01816520281136036, -0.05301683023571968, 0.033391110599040985, -0.04655403643846512, -0.03107253648340702, -0.06678222119808197, -0.0035120912361890078, 0.02006387710571289, -0.010387939400970936, 0.002136008581146598, 0.009411217644810677, -0.03099950961768627, 0.0358557365834713, 0.005002276506274939, -0.0011684149503707886, -0.05316288396716118, 0.04217248037457466, -0.024007277563214302, -0.05071651190519333, -0.0024121380411088467, 0.034340448677539825, -0.003318116068840027, -0.030232738703489304, -0.05104513093829155, -0.017170224338769913, 0.033336341381073, 0.02123229205608368, -0.04472838714718819, 0.00042018439853563905, -0.023167477920651436, 0.04348694533109665, -0.03640342876315117, 0.0003585687663871795, 0.0018245073733851314, 0.03592875972390175, -0.0033820136450231075, 0.01769053377211094, 0.012560461647808552, 0.04772245138883591, -0.04717475548386574, -0.06835227459669113, 0.030962998047471046, -0.05597437918186188, -0.02123229205608368, 0.01344590075314045, 0.02234593592584133, 0.01372887659817934, -0.013409387320280075, 0.030926484614610672, -0.026636211201548576, -0.0177818164229393, -0.0007256952812895179, -0.041478730738162994, 0.06057501584291458, 0.00712002906948328, 0.06053850054740906, 0.009703321382403374, 0.063861183822155, 0.033062491565942764, 0.043925102800130844, 0.020027363672852516, -0.035673171281814575, -0.029758069664239883, -0.006800540257245302, -0.00586033146828413, 0.025504307821393013, 0.04954809695482254, -0.008868087083101273, 0.006732078734785318, 0.09836594015359879, 0.005527150817215443, 0.007891365326941013, -0.011738919652998447, -0.04257412254810333, -0.04626193270087242, -0.034888140857219696, -0.04096755012869835, -0.021433113142848015, 0.010871736332774162, -0.017736174166202545, 0.02871745079755783, 0.018767666071653366, 0.02572338655591011 ]
716,545
pytorch_optimizer.loss.focal
FocalTverskyLoss
Focal Tversky Loss w/ logits input. :param alpha: float. alpha. :param beta: float. beta. :param gamma: float. gamma. :param smooth: float. smooth factor.
class FocalTverskyLoss(nn.Module): r"""Focal Tversky Loss w/ logits input. :param alpha: float. alpha. :param beta: float. beta. :param gamma: float. gamma. :param smooth: float. smooth factor. """ def __init__(self, alpha: float = 0.5, beta: float = 0.5, gamma: float = 1.0, smooth: float = 1e-6): super().__init__() self.gamma = gamma self.tversky = TverskyLoss(alpha, beta, smooth) def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor: return self.tversky(y_pred, y_true) ** self.gamma
(alpha: float = 0.5, beta: float = 0.5, gamma: float = 1.0, smooth: float = 1e-06)
[ -0.05221664905548096, -0.05827980488538742, -0.011510812677443027, 0.04703540354967117, 0.02575923316180706, -0.026549281552433968, -0.08054812997579575, 0.04218487814068794, 0.06562908738851547, 0.00976535864174366, -0.00037980859633535147, -0.02326047793030739, 0.007822391577064991, 0.03529492765665054, -0.02162526175379753, 0.03784880042076111, 0.015791770070791245, 0.016600189730525017, -0.02291138656437397, -0.029599232599139214, 0.023370716720819473, -0.013311387039721012, -0.027559807524085045, 0.030058562755584717, -0.03154679387807846, 0.00010708133777370676, 0.023683061823248863, 0.01334813330322504, -0.03621358796954155, -0.04310353845357895, -0.020228898152709007, -0.0031280380208045244, 0.029286889359354973, 0.06691521406173706, -0.007036937400698662, -0.02375655435025692, -0.022654160857200623, 0.03766506910324097, -0.11479578167200089, -0.029948323965072632, -0.011648612096905708, -0.05342927947640419, 0.01516708079725504, 0.027743538841605186, -0.0038836360909044743, -0.031473301351070404, -0.0007245932938531041, 0.02544688805937767, -0.017546409741044044, -0.02575923316180706, -0.050342582166194916, -0.006779712624847889, 0.018786601722240448, -0.025685740634799004, 0.018850907683372498, 0.06945071369409561, 0.05243712663650513, 0.01140976045280695, -0.017785262316465378, -0.004191387444734573, 0.016692057251930237, -0.07033263146877289, 0.026751386001706123, 0.022948132827878, -0.0030132054816931486, -0.008065836504101753, -0.050599806010723114, 0.03246545419096947, 0.00856191385537386, 0.020357510074973106, 0.0030407654121518135, -0.015975501388311386, 0.03542353957891464, 0.0388777032494545, -0.004763253498822451, -0.008961530402302742, -0.02829473465681076, -0.042368609458208084, -0.0005758851184509695, -0.030995596200227737, -0.004099521320313215, -0.02482219971716404, -0.022580668330192566, 0.04376497492194176, -0.0021002870053052902, -0.12354142963886261, -0.016388898715376854, -0.07176573574542999, 0.008084210567176342, 0.030462773516774178, -0.08414927870035172, 0.047402869910001755, -0.02491406537592411, -0.029525740072131157, 0.034137412905693054, 0.02936038188636303, -0.006329569034278393, -0.022047845646739006, -0.01094124373048544, -0.03051789291203022, 0.02682487852871418, 0.09252745658159256, -0.02682487852871418, 0.09032267332077026, 0.04924019053578377, -0.024858945980668068, -0.0507100448012352, 0.013219520449638367, 0.008097990415990353, -0.01372478436678648, -0.042111385613679886, 0.028404975309967995, -0.004042105283588171, -0.030628131702542305, 0.013504305854439735, -0.07915176451206207, 0.025814352557063103, 0.00055177032481879, -0.02669626660645008, 0.006177990231662989, 0.005240956787019968, 0.012760191224515438, -0.04516133666038513, -0.005911578889936209, 0.011832344345748425, 0.01639808528125286, 0.04060478135943413, -0.04692516475915909, 0.03399042785167694, -0.062285166233778, -0.03674640879034996, 0.03529492765665054, 0.0007791387033648789, 0.029066409915685654, 0.04391195997595787, -0.04817454144358635, 0.02473033405840397, 0.039612628519535065, 0.04115597903728485, 0.0032681338489055634, -0.008888037875294685, 0.056883443146944046, -0.0013653588248416781, 0.021478276699781418, -0.010555406101047993, -0.03226334601640701, 0.0030522486194968224, -0.025722486898303032, 0.09142506867647171, 0.011391387321054935, 0.02526315674185753, -0.030279042199254036, 0.023866793140769005, 0.05317205563187599, -0.039171673357486725, 0.024491481482982635, 0.007137990090996027, -0.04159693419933319, 0.026586027815937996, 0.04578602686524391, -0.02263578772544861, -0.02357282117009163, -0.04053128883242607, -0.029929950833320618, -0.012484592385590076, -0.055670809000730515, 0.03891444951295853, -0.019291864708065987, -0.0008468899177387357, 0.04159693419933319, 0.025208037346601486, -0.04093550145626068, 0.06324057281017303, 0.044683635234832764, 0.02811100333929062, 0.06224841624498367, 0.005906985141336918, -0.018455883488059044, 0.011666985228657722, 0.06412248313426971, 0.01865798979997635, -0.04773358628153801, -0.07143501937389374, -0.06581281870603561, 0.03806928172707558, 0.01539674587547779, -0.009737798944115639, 0.0321163609623909, -0.037040382623672485, 0.03465186432003975, 0.014165741391479969, -0.017298372462391853, 0.0373159795999527, -0.00021057415870018303, 0.026549281552433968, 0.017252439633011818, 0.011354641057550907, 0.0017649759538471699, 0.04946066811680794, 0.010932057164609432, -0.030223922803997993, 0.055817797780036926, 0.0017959807300940156, 0.03558889776468277, -0.025152917951345444, 0.0051536839455366135, 0.028625452890992165, 0.055009376257658005, -0.06265262514352798, -0.0538334921002388, -0.01308172196149826, 0.012934735976159573, 0.014340286143124104, 0.058831002563238144, 0.02237856388092041, -0.05827980488538742, -0.03411903977394104, 0.032006122171878815, 0.025777606293559074, -0.005626793950796127, 0.0016524400562047958, -0.04244210198521614, -0.07382353395223618, 0.03702200949192047, 0.0557810515165329, 0.004914832301437855, 0.03332899510860443, 0.0250977985560894, 0.01096880342811346, -0.007183922920376062, 0.014762870036065578, 0.07036937773227692, -0.019585836678743362, 0.02869894541800022, 0.06173396855592728, 0.013008229434490204, -0.0026824879460036755, -0.006678659934550524, -0.05515636131167412, -0.05328229442238808, -0.022488802671432495, -0.03674640879034996, 0.010187942534685135, 0.026255309581756592, 0.016884975135326385, -0.008180669508874416, 0.014285166747868061, 0.06162372976541519, -0.042552340775728226, 0.05287808179855347, -0.03274105116724968, -0.0077672721818089485, 0.00250794249586761, 0.059896647930145264, -0.01777607575058937, -0.07679999619722366, -0.008153109811246395, -0.017923060804605484, 0.004818372894078493, -0.006214736495167017, -0.058794256299734116, -0.006067750975489616, -0.07290487736463547, 0.08084210008382797, 0.011226028203964233, -0.03906143456697464, -0.029470620676875114, -0.0036241146735846996, 0.013008229434490204, 0.007666219957172871, 0.08745645731687546, 0.021717127412557602, -0.04093550145626068, -0.027908898890018463, 0.010353300720453262, -0.03884095326066017, -0.009356554597616196, 0.020651482045650482, -0.002914449665695429, 0.00189588509965688, 0.006724592763930559, -0.08481071144342422, -0.05390698462724686, -0.013504305854439735, 0.0017764592776075006, 0.01334813330322504, 0.0044164592400193214, -0.03577262908220291, 0.04986487701535225, -0.019861433655023575, 0.0403108112514019, 0.013357319869101048, 0.0715085119009018, 0.04053128883242607, 0.04391195997595787, 0.002592918463051319, -0.03373320400714874, 0.04898296296596527, 0.026347175240516663, -0.03270430490374565, 0.0620279386639595, -0.016168421134352684, -0.03270430490374565, -0.04766009375452995, -0.016636937856674194, -0.039980094879865646, 0.00294200936332345, 0.04769684001803398, 0.025428514927625656, -0.005553300958126783, 0.032373588532209396, -0.01721569336950779, -0.03608497604727745, 0.04078851640224457, -0.008630813099443913, -0.038767460733652115, 0.00533741619437933, -0.044058945029973984, 0.013752344064414501, 0.07973971217870712, 0.00474947365000844, 0.002611291827633977, 0.038326505571603775, 0.06926698237657547, -0.0025446887593716383, -0.07885779440402985, 0.05210641026496887, 0.020449377596378326, -0.035166315734386444, -0.01003176998347044, -0.019696075469255447, 0.005273109767585993, 0.03608497604727745, 0.01605818048119545, -0.0862070769071579, 0.025685740634799004, 0.037481337785720825, 0.05739789083600044, 0.032722678035497665, -0.027743538841605186, 0.026567654684185982, -0.016802296042442322, -0.05853703245520592, 0.05364975705742836, 0.0235360749065876, -0.02366468869149685, -0.017858754843473434, -0.026439040899276733, 0.07077358663082123, 0.03038928098976612, 0.00428095692768693, -0.009535693563520908, 0.02309511788189411, 0.04501435160636902, 0.057103920727968216, 0.042368609458208084, -0.025336649268865585, 0.010996363125741482, -0.019328610971570015, -0.062285166233778, -0.04821128770709038, -0.0034633490722626448, -0.04641071707010269, 0.019990047439932823, -0.008534353226423264, 0.025520382449030876, 0.03305339440703392, 0.016829855740070343, 0.00992153026163578, 0.0063525354489684105, -0.040862008929252625, -0.03340248763561249, 0.0063387556001544, -0.005792152602225542, -0.02847846783697605, -0.010463540442287922, -0.014974161982536316, -0.014533204957842827, 0.06169722229242325, 0.0020325358491390944, 0.05074679106473923, -0.013835023157298565, -0.02847846783697605, -0.014735310338437557, 0.04391195997595787, 0.023499328643083572, -0.025189664214849472, -0.046961911022663116, 0.06401224434375763, -0.046153489500284195, -0.010748324915766716, -0.0338066965341568, 0.04960765317082405, -0.010334927588701248, -0.028625452890992165, 0.005562487989664078, 0.0075651672668755054, 0.03444975987076759, -0.007712152786552906, -0.02272765524685383, 0.016719616949558258, -0.032538946717977524, 0.02882755920290947, 0.043213777244091034, -0.028570333495736122, 0.006876172032207251, 0.03602985292673111, 0.0721699520945549, -0.00909473653882742, 0.060300856828689575, -0.011621052399277687, 0.0501955971121788, -0.07996018975973129, 0.0071931094862520695, 0.03509281948208809, 0.0014135884121060371, -0.013945262879133224, -0.0552666001021862, -0.0013573204632848501, 0.026714639738202095, 0.040457796305418015, 0.014404593035578728, 0.03127119317650795, 0.006132056936621666, -0.03457837179303169, 0.029562486335635185, -0.014551578089594841, 0.04438966140151024, -0.018832534551620483, 0.026310428977012634, -0.056075021624565125, -0.0557810515165329, 0.009007463231682777, -0.07051636278629303, 0.0019659330137073994, -0.011124975979328156, -0.006357128731906414, -0.034853968769311905, -0.019273491576313972, 0.030683252960443497, 0.015663156285881996, 0.02131291851401329, 0.03898794203996658, 0.03766506910324097, 0.017445357516407967, -0.01962258294224739, 0.0235360749065876, -0.021074065938591957, -0.04156018793582916, 0.006297416053712368, -0.048652246594429016, 0.029342008754611015, 0.006595980376005173, 0.009691865183413029, -0.0072757890447974205, -0.018391577526926994, -0.07510966062545776, -0.027559807524085045, -0.0036447844468057156, 0.0028248801827430725, -0.06518813222646713, 0.06055808439850807, -0.00010033492435468361, -0.005709473509341478, 0.013954449445009232, -0.08642755448818207, 0.04666794091463089, -0.0509672686457634, -0.03740784525871277, -0.03942889720201492, -0.010886124335229397, -0.044904112815856934, 0.024895692244172096, -0.004822966177016497, -0.029342008754611015, 0.0034174160100519657, -0.025116171687841415, 0.017454544082283974, 0.05508286878466606, -0.051187749952077866, -0.011933396570384502, 0.006706219632178545, 0.02015540562570095, -0.0007096650660969317, 0.010775884613394737, 0.050783537328243256, -0.0027376075740903616, -0.004997511859983206, 0.04821128770709038, 0.003527655266225338, -0.020210525020956993, -0.012016075663268566, 0.009995023719966412, 0.022213203832507133, -0.09039616584777832, -0.04185416176915169, -0.01321033388376236, 0.0470721498131752, -0.006311195902526379, 0.023609567433595657, -0.008865071460604668, 0.028037510812282562, -0.04284631460905075, -0.014643444679677486, 0.03345760703086853, 0.03002181649208069, -0.040641527622938156, -0.010546219535171986, -0.021606888622045517, 0.02247042953968048, 0.023866793140769005, -0.024675214663147926, -0.0016754065873101354, 0.004133970942348242, 0.008364401757717133, -0.04247884824872017, -0.019291864708065987, 0.07198621332645416, 0.02388516627252102, -0.02597971260547638, -0.008176076225936413, 0.03698526322841644, 0.023774927482008934, -0.01733511872589588, 0.011666985228657722, 0.04122947156429291, -0.01036248728632927, 0.018547751009464264, 0.06607004255056381, 0.02664114721119404, 0.01824459247291088, 0.008892631158232689, -0.02754143439233303, 0.02789052575826645, 0.008897224441170692, -0.04648420959711075, -0.05486239120364189, -0.04633722081780434, -0.03266755864024162, -0.02985645830631256, -0.016829855740070343, 0.00033933011582121253, 0.005277703050523996, 0.0017959807300940156, -0.021864114329218864, -0.03983310982584953, -0.03310851380228996, 0.06158698350191116, -0.077240951359272, -0.0016099520726129413, -0.08664803206920624, -0.012631578370928764, -0.00812095683068037, -0.026053205132484436, 0.00021373204072006047, 0.07176573574542999, -0.042736075818538666, 0.007036937400698662, -0.01934698410332203, 0.03417416289448738, -0.03038928098976612, -0.06077856197953224, 0.052731096744537354, 0.05537683889269829, -0.07246392220258713, 0.01536918617784977, 0.023701434955000877, 0.02754143439233303, -0.037352725863456726, 0.014275980181992054, 0.031216075643897057, 0.012025262229144573, -0.0009163636132143438, 0.044683635234832764, -0.02985645830631256, 0.006132056936621666, 0.04438966140151024, -0.025336649268865585, 0.05420095473527908, -0.005709473509341478, 0.007353875320404768, -0.05802258104085922, 0.006770526058971882, 0.019549090415239334, -0.04817454144358635, 0.011180095374584198, -0.01633377932012081, 0.048248037695884705, -0.007845358923077583, 0.027284208685159683, 0.000013169856174499728, 0.0017477511428296566, -0.005456842016428709, -0.03033416159451008, 0.015093587338924408, -0.060521338135004044, -0.08047463744878769, 0.025024304166436195, 0.0811360701918602, 0.03505607321858406, -0.057728610932826996, 0.006573013961315155, -0.013109281659126282, -0.04387521371245384, -0.004795406479388475, -0.05284133553504944, -0.0271739698946476, 0.04600650444626808, 0.008047463372349739, -0.04435291513800621, -0.03529492765665054, -0.01241109985858202, 0.0014847846468910575, -0.02873569168150425, -0.004735693335533142, 0.0352398082613945, 0.018483443185687065, 0.016260286793112755, 0.04093550145626068, -0.002845550188794732, -0.0027973204851150513, 0.019328610971570015, -0.013173587620258331, 0.03555215150117874, 0.004554258193820715, -0.02046775072813034, 0.03279617056250572, -0.07092057168483734, -0.011124975979328156, -0.04854200780391693, -0.051628705114126205, 0.0036792343016713858, -0.03696688637137413, 0.016352152451872826, 0.0049377987161278725, 0.01062889862805605, -0.007303348742425442, 0.030352534726262093, 0.010261435061693192, -0.05600152909755707, -0.057544875890016556, 0.03884095326066017, -0.032814543694257736, 0.015736650675535202, -0.023866793140769005, 0.013247081078588963, -0.008267941884696484, 0.031087461858987808, 0.04832153022289276, -0.03584612160921097, 0.004439425654709339, 0.010757511481642723, 0.0442059300839901, 0.07114104926586151, 0.000868133909534663, -0.010151195339858532, 0.027817031368613243, -0.011602679267525673, 0.08223846554756165, -0.04442640766501427, 0.016719616949558258, -0.021386411041021347, 0.04288306087255478, 0.05368650332093239, 0.014266793616116047, -0.010959616862237453, 0.00575081305578351, -0.05614851415157318, -0.025722486898303032, 0.0012114831479266286, -0.03891444951295853, -0.005567081272602081, -0.053539518266916275, -0.02303999848663807, 0.04479387402534485, -0.03101396933197975, 0.02410564385354519, 0.026898371055722237, -0.012365167029201984, 0.014836362563073635, 0.04325052350759506, 0.024969184771180153, -0.014579137787222862, -0.02967272512614727, 0.028680572286248207, 0.04053128883242607, -0.07812286913394928, 0.0569569356739521, -0.0634610503911972, -0.049717891961336136, -0.08363483101129532, -0.00949894730001688, 0.026751386001706123, 0.01596631482243538, 0.03803253546357155, -0.038546983152627945, -0.06401224434375763, -0.006370908580720425, -0.005461435299366713, -0.054568417370319366, -0.05805932730436325, 0.0026044019032269716, -0.033384114503860474, 0.0014744496438652277, 0.005263923201709986, 0.008543540723621845, 0.005466028582304716, -0.05442143231630325, -0.037168994545936584, -0.005038851406425238, -0.0029052630998194218, -0.02024727128446102, 0.0442059300839901, 0.01637052558362484, 0.01899789460003376, 0.03437626734375954, -0.005305262748152018, -0.0373159795999527, -0.008580286987125874, 0.03983310982584953, 0.03964937478303909, -0.03669128939509392, 0.030628131702542305, 0.0748891830444336, -0.030279042199254036, -0.06019061803817749, -0.01434947270900011, 0.006256076041609049, -0.001821243902668357, -0.010426794178783894, 0.045528803020715714, -0.005544114392250776, -0.022837894037365913, -0.024491481482982635, 0.01408306136727333, -0.009241721592843533, 0.029066409915685654, 0.024528227746486664, 0.021680381149053574, 0.03964937478303909, -0.003488612361252308, -0.0020290908869355917, -0.010197129100561142, 0.00003129186370642856, 0.0784168392419815, 0.021074065938591957, -0.015598851256072521, 0.0033691865392029285, 0.030536266043782234, -0.00023325358051806688, 0.06812784075737, 0.013338946737349033, 0.01109741535037756, -0.02923176810145378, 0.1255992352962494, -0.020651482045650482, -0.01696765422821045, -0.042111385613679886, -0.07397052645683289, -0.0834878459572792, -0.003725167363882065, -0.018226219341158867, 0.0630568414926529, -0.0009353109635412693, -0.011336266994476318, 0.02131291851401329, 0.027431195601820946, 0.041266217827796936 ]
716,551
pytorch_optimizer.loss.focal
__init__
null
def __init__(self, alpha: float = 0.5, beta: float = 0.5, gamma: float = 1.0, smooth: float = 1e-6): super().__init__() self.gamma = gamma self.tversky = TverskyLoss(alpha, beta, smooth)
(self, alpha: float = 0.5, beta: float = 0.5, gamma: float = 1.0, smooth: float = 1e-06)
[ -0.02900044247508049, -0.04938796907663345, -0.038848962634801865, 0.0094396797940135, -0.015872109681367874, -0.03247104585170746, -0.08649254590272903, 0.015236134640872478, 0.019588017836213112, 0.04855211824178696, -0.011193152517080307, 0.023658255115151405, -0.0014513848582282662, 0.03943042457103729, -0.04331895709037781, 0.016262779012322426, 0.027746662497520447, 0.018061678856611252, -0.016326377168297768, -0.02787385880947113, 0.01816161721944809, 0.014754611067473888, -0.033706653863191605, 0.04804333671927452, -0.02433057129383087, 0.028091905638575554, -0.00019448330567684025, 0.029436537995934486, -0.029036782681941986, -0.03385201841592789, -0.015072598122060299, -0.007740719243884087, 0.027510443702340126, 0.09267058223485947, 0.00002285533628310077, -0.043827734887599945, -0.010130167007446289, 0.006927580572664738, -0.11367591470479965, 0.0016864683711901307, 0.01056626345962286, -0.007082031574100256, 0.023022281005978584, 0.02256801351904869, 0.010548093356192112, -0.0482250452041626, 0.021586794406175613, 0.018752165138721466, -0.031617023050785065, -0.05171382054686546, -0.049206264317035675, -0.006309776566922665, 0.03717725723981857, -0.016008390113711357, -0.0061189839616417885, 0.06850355118513107, 0.05433040112257004, 0.0337248258292675, -0.018933871760964394, 0.011738274246454239, 0.003840832272544503, -0.05229528248310089, -0.002078274032101035, 0.011111385188996792, -0.023749109357595444, -0.015127110294997692, -0.08547498285770416, 0.03192592412233353, 0.020423870533704758, 0.06297965347766876, 0.07035695761442184, 0.013037479482591152, 0.0049742297269403934, 0.011365775018930435, -0.024730326607823372, 0.0065005687065422535, -0.06450599431991577, -0.037722378969192505, -0.030108854174613953, -0.025493495166301727, -0.004197432193905115, 0.00375679275020957, -0.026783615350723267, 0.02563886158168316, -0.0026279378216713667, -0.07344598323106766, -0.01790722832083702, -0.07304622232913971, -0.0261112991720438, 0.02660190872848034, -0.08649254590272903, 0.059890635311603546, -0.020278504118323326, -0.03501494601368904, 0.04851577803492546, 0.009212546050548553, 0.0013344109756872058, -0.025257276371121407, 0.025675203651189804, -0.03356128931045532, 0.025693373754620552, 0.008258584886789322, -0.04666236415505409, 0.05047821253538132, 0.0136643685400486, -0.025729715824127197, -0.037395305931568146, 0.017689179629087448, 0.01800716668367386, -0.012683150358498096, -0.011483884416520596, 0.06305234134197235, 0.004106578882783651, 0.0073909335769712925, -0.039575789123773575, -0.06883062422275543, 0.0013162402901798487, 0.008467547595500946, 0.004290557000786066, 0.00016538178897462785, -0.00852205976843834, 0.03021787852048874, -0.021823013201355934, 0.05578405782580376, 0.01744387485086918, 0.013882417231798172, 0.020551064983010292, -0.01857045851647854, 0.01310107670724392, -0.037467990070581436, -0.0038658170960843563, 0.023512888699769974, -0.008662882260978222, 0.01792539842426777, 0.03332506865262985, -0.07747987657785416, 0.02120521105825901, 0.038122136145830154, 0.031707875430583954, -0.004152005538344383, 0.016889669001102448, 0.024639472365379333, -0.008176816627383232, -0.04411846771836281, -0.024766668677330017, 0.0016694333171471953, -0.004222417250275612, -0.07944231480360031, 0.056692592799663544, 0.04241042211651802, 0.05600210651755333, 0.007145628798753023, -0.008453919552266598, 0.05236796662211418, -0.03688652813434601, -0.03019970841705799, 0.016508083790540695, -0.051786504685878754, 0.0546211339533329, 0.049460653215646744, -0.021405087783932686, 0.013546259142458439, 0.00443592295050621, -0.05204089358448982, -0.004422294907271862, 0.0038476462941616774, -0.0104481540620327, 0.0032162144780158997, 0.011792786419391632, -0.008294926024973392, -0.002777846297249198, -0.06323404610157013, 0.018770335242152214, 0.03367031365633011, 0.04673504829406738, 0.05207723379135132, 0.015935705974698067, -0.003918057773262262, 0.016035644337534904, 0.05433040112257004, 0.01550869457423687, -0.050187479704618454, -0.049606017768383026, -0.032180313020944595, 0.036123357713222504, -0.001714860089123249, 0.006709531880915165, 0.04081139713525772, -0.05236796662211418, 0.009812179952859879, 0.025293618440628052, -0.003459247527644038, 0.03148982673883438, 0.009094436652958393, 0.05440308526158333, 0.011929066851735115, 0.04288285970687866, -0.025293618440628052, 0.026656420901417732, 0.06614135950803757, -0.027837516739964485, 0.023094963282346725, -0.00912169273942709, -0.011075043119490147, 0.029145807027816772, -0.021477770060300827, 0.007681664545089006, -0.0136643685400486, -0.02040569856762886, -0.021823013201355934, -0.022222770377993584, -0.00149681163020432, 0.026165811344981194, 0.03528750315308571, 0.023167645558714867, -0.07835207134485245, -0.003195772413164377, 0.025493495166301727, 0.019715212285518646, 0.019097408279776573, 0.04855211824178696, -0.05618381127715111, -0.0586550273001194, 0.026238495483994484, 0.014009611681103706, 0.02860068716108799, 0.041029445827007294, 0.00562383234500885, -0.033216044306755066, -0.004081594292074442, -0.0245122779160738, 0.03735896572470665, -0.03317970409989357, 0.023912644013762474, 0.013064735569059849, 0.033143360167741776, 0.013155588880181313, 0.0008330131531693041, -0.08293108642101288, -0.08489352464675903, 0.022131916135549545, -0.01744387485086918, 0.004622172564268112, 0.020769113674759865, 0.009594131261110306, 0.01734393648803234, 0.002111208625137806, 0.05396698787808418, -0.04804333671927452, 0.04506334289908409, -0.013273698277771473, -0.012029005214571953, 0.006600508000701666, 0.058291614055633545, -0.030653975903987885, -0.05920014902949333, 0.025348130613565445, -0.030163366347551346, 0.028400808572769165, -0.006459685042500496, -0.0626525804400444, 0.008235870860517025, -0.062216486781835556, 0.12079883366823196, 0.020750941708683968, -0.0006649341667070985, -0.01670796051621437, -0.0353238470852375, -0.008821875788271427, 0.0017864071996882558, 0.11905444413423538, 0.025039227679371834, -0.015635889023542404, -0.002641565864905715, 0.012483272701501846, -0.03270726650953293, -0.005378528032451868, -0.0010027956450358033, 0.013891502283513546, 0.00907172355800867, 0.037395305931568146, -0.05175016075372696, -0.012565040960907936, -0.00960321631282568, -0.0176800936460495, -0.028618857264518738, -0.004431379958987236, -0.029291173443198204, 0.05658356845378876, -0.049460653215646744, -0.0068685258738696575, 0.05393064767122269, 0.06192575395107269, 0.041247494518756866, 0.12036273628473282, -0.009221632033586502, -0.006818556226789951, 0.06010868400335312, 0.01519070751965046, 0.006582336965948343, 0.10190130025148392, -0.04815236106514931, -0.00556477764621377, -0.02000594325363636, -0.01661710813641548, 0.00576465530321002, 0.04971504211425781, 0.018461434170603752, 0.048806507140398026, 0.00717288488522172, 0.03928506001830101, 0.015944791957736015, -0.02064191922545433, 0.06715891510248184, -0.02578422799706459, -0.06170770525932312, -0.004040710162371397, -0.06566891819238663, -0.000053802315960638225, 0.08133206516504288, -0.0017057746881619096, -0.037322621792554855, 0.03350677713751793, 0.005946362391114235, -0.019224602729082108, -0.07660768181085587, 0.05858234688639641, 0.011429372243583202, -0.020223991945385933, -0.027619468048214912, -0.05956356227397919, -0.015118024311959743, 0.05011479929089546, 0.023076793178915977, -0.05680161714553833, 0.012701321393251419, -0.008962699212133884, 0.05930917337536812, 0.025584349408745766, -0.05135040730237961, 0.04666236415505409, -0.011338518932461739, -0.031362634152173996, 0.04666236415505409, 0.03005434200167656, -0.04353700578212738, -0.020605577155947685, -0.08685596287250519, 0.0353238470852375, 0.01790722832083702, -0.021659478545188904, -0.0025279989931732416, 0.03199860826134682, 0.07479061186313629, 0.04717114567756653, 0.0401572547852993, 0.009903033263981342, 0.010502666234970093, -0.008154102601110935, -0.05207723379135132, -0.05720137432217598, 0.047207485884428024, -0.05818258970975876, 0.03343409299850464, -0.0016501270001754165, 0.008812790736556053, 0.04226505383849144, -0.014527477324008942, -0.0063461181707680225, 0.029945317655801773, -0.0015104396734386683, -0.0425557866692543, -0.017407532781362534, 0.005542064551264048, -0.005246790591627359, -0.017889056354761124, -0.04426383227109909, -0.027673980221152306, 0.10022959858179092, 0.004274657927453518, 0.046480659395456314, 0.0003316153306514025, 0.006882153917104006, 0.004806150682270527, 0.03628689423203468, 0.01638088934123516, -0.009993886575102806, -0.036922868341207504, 0.09943008422851562, -0.011910895816981792, -0.004728925414383411, -0.028073735535144806, 0.09368814527988434, -0.032961655408144, 0.0200967974960804, 0.01880667731165886, 0.008353980258107185, 0.01132943294942379, -0.010093825869262218, 0.03479689732193947, -0.011038701981306076, 0.0018136632861569524, 0.035360187292099, 0.014400281943380833, -0.03285263106226921, -0.053785279393196106, 0.03712274506688118, 0.059490881860256195, 0.009253430180251598, 0.03227116912603378, -0.02836446650326252, 0.008771906606853008, -0.06890330463647842, 0.003647768637165427, 0.02916397713124752, -0.0490245558321476, 0.0273287370800972, -0.061816729605197906, 0.006205295212566853, 0.003166245063766837, -0.004581288434565067, 0.03953944891691208, 0.03069031797349453, 0.019824236631393433, 0.01678064465522766, 0.032016780227422714, -0.018843019381165504, 0.01621735282242298, 0.026456544175744057, -0.006709531880915165, -0.04433651641011238, -0.048879191279411316, -0.00423604529350996, -0.0642152652144432, 0.019824236631393433, 0.010139252059161663, -0.025529837235808372, -0.042301397770643234, 0.003111732890829444, 0.02634751982986927, -0.0058282529935240746, -0.010711628943681717, 0.05534796044230461, 0.03199860826134682, -0.004610816016793251, -0.024167034775018692, 0.012474187649786472, -0.005105967633426189, -0.003949856385588646, -0.004115664400160313, -0.021804843097925186, 0.044554565101861954, -0.008449376560747623, -0.020205821841955185, 0.026383860036730766, -0.023403864353895187, -0.09267058223485947, -0.007272823713719845, -0.004476807080209255, -0.023004109039902687, -0.039975546300411224, 0.0309447068721056, -0.005433040205389261, -0.0002626234490890056, -0.011965407989919186, -0.07024794071912766, 0.03953944891691208, -0.024530448019504547, -0.00717288488522172, -0.049533337354660034, -0.022767890244722366, -0.004006640054285526, 0.021659478545188904, -0.01245601661503315, -0.021495942026376724, -0.005433040205389261, -0.01678064465522766, -0.019715212285518646, 0.020696431398391724, -0.04368237033486366, -0.01381881907582283, -0.006218923255801201, 0.025420812889933586, 0.017080459743738174, 0.010175593197345734, 0.06178038939833641, -0.025366300716996193, -0.00875373650342226, 0.0787154883146286, 0.038194816559553146, -0.06294331699609756, -0.008117761462926865, -0.016744302585721016, 0.03561457619071007, -0.0980491116642952, 0.00508325407281518, 0.0037318081595003605, 0.05600210651755333, -0.02843715064227581, 0.02193203754723072, 0.0029209405183792114, 0.0016364989569410682, -0.03276177868247032, -0.028818733990192413, -0.0016478556208312511, -0.005660173948854208, -0.06792208552360535, -0.02056923508644104, -0.01862497068941593, 0.0261112991720438, 0.05011479929089546, -0.04539041593670845, 0.0014502492267638445, -0.0019238231470808387, 0.03628689423203468, -0.029908977448940277, -0.0779886543750763, 0.043827734887599945, 0.006309776566922665, -0.006845812313258648, 0.0041088503785431385, 0.052985768765211105, 0.06138063594698906, -0.04837040975689888, 0.010738885030150414, 0.013064735569059849, 0.0022361320443451405, 0.016371803358197212, 0.06319770216941833, 0.04924260452389717, 0.013128332793712616, -0.02449410781264305, -0.05567503347992897, 0.03654128313064575, 0.012801259756088257, -0.024039840325713158, -0.02160496637225151, -0.04313724860548973, 0.00963955745100975, -0.07515402883291245, 0.005669259466230869, -0.026220323517918587, 0.033633969724178314, -0.02362191304564476, -0.03568726032972336, -0.02676544524729252, -0.05738307908177376, 0.06116258725523949, -0.0819135308265686, -0.00912169273942709, -0.023276669904589653, -0.01960618793964386, -0.02707434631884098, -0.021386917680501938, 0.006332490127533674, 0.03881262242794037, -0.02425788901746273, -0.018843019381165504, -0.0013548530405387282, 0.03285263106226921, -0.01824338547885418, -0.037758719176054, 0.012928455136716366, 0.04393675923347473, -0.07813402265310287, -0.0008006466086953878, -0.0049242605455219746, 0.05204089358448982, -0.03416091948747635, 0.0005167293711565435, 0.037795063108205795, -0.009180747903883457, 0.018661310896277428, 0.03029056079685688, -0.02000594325363636, 0.019569847732782364, 0.0126558942720294, 0.006228008307516575, 0.019006555899977684, -0.004472264088690281, 0.031780559569597244, -0.003086748067289591, -0.04201066493988037, -0.010920592583715916, -0.02554800733923912, 0.021732160821557045, -0.032979827374219894, 0.026256665587425232, -0.002941382583230734, -0.00009064057667274028, 0.018915701657533646, 0.02274972014129162, -0.03979383781552315, -0.038776278495788574, -0.03581445664167404, -0.06763135641813278, -0.008181358687579632, 0.002389447530731559, 0.030326902866363525, 0.010030227713286877, -0.031453486531972885, 0.018170703202486038, -0.018107105046510696, 0.009103521704673767, 0.005573863163590431, -0.044627245515584946, 0.018679482862353325, 0.06410624086856842, 0.0018647683318704367, -0.03448799252510071, -0.004220145754516125, -0.023440206423401833, -0.006854897830635309, -0.05818258970975876, 0.005941819865256548, 0.031689707189798355, 0.006977549754083157, 0.01358260028064251, 0.015454182401299477, 0.011393031105399132, -0.0049651446752250195, 0.0013934657908976078, -0.010030227713286877, 0.06810379773378372, -0.010021142661571503, -0.03597799316048622, 0.0361778698861599, -0.09070815145969391, -0.018606800585985184, -0.07660768181085587, -0.015063513070344925, -0.0027460474520921707, -0.04669870808720589, -0.037467990070581436, -0.004996943287551403, 0.022277282550930977, -0.010720714926719666, 0.03674115985631943, 0.03118092566728592, -0.01112955529242754, -0.037722378969192505, 0.05607479065656662, -0.005819167476147413, 0.0417562760412693, -0.03316153213381767, -0.006273434963077307, -0.04651699960231781, 0.06323404610157013, 0.03397921472787857, -0.018461434170603752, 0.02144142985343933, 0.0009937103604897857, 0.012419675476849079, 0.05135040730237961, -0.05403967201709747, 0.006373373791575432, 0.029018612578511238, -0.02040569856762886, 0.08314913511276245, -0.014927232638001442, -0.010302788577973843, 0.012583211995661259, 0.021350575610995293, 0.08104133605957031, 0.04371871054172516, -0.013491746969521046, -0.019860578700900078, -0.07242842018604279, -0.03196226805448532, 0.011320347897708416, -0.06152600049972534, -0.015517780557274818, -0.04320993274450302, -0.026074958965182304, 0.007649865932762623, -0.004245130345225334, 0.009794008918106556, 0.026892639696598053, 0.028382638469338417, 0.020114967599511147, 0.040520668029785156, 0.033942874521017075, 0.009348826482892036, -0.056837957352399826, 0.023894473910331726, 0.060871854424476624, -0.0843847468495369, 0.08104133605957031, -0.027201542630791664, -0.03181689977645874, -0.06810379773378372, -0.029363855719566345, -0.009812179952859879, 0.019860578700900078, 0.006100813392549753, -0.037758719176054, -0.07275549322366714, -0.05287674441933632, 0.01630820520222187, -0.04288285970687866, -0.04477261006832123, -0.0009255702025257051, -0.06014502793550491, 0.025202764198184013, -0.0022508958354592323, 0.0067277029156684875, 0.016971437260508537, -0.046626023948192596, -0.022913256660103798, -0.05414869263768196, 0.005664716474711895, -0.01758923940360546, 0.04233773797750473, -0.01008473988622427, 0.008740108460187912, 0.033070679754018784, -0.004819778725504875, -0.03950310871005058, -0.04088408127427101, 0.02907312475144863, -0.004847034811973572, -0.04477261006832123, 0.014881805516779423, 0.043500661849975586, -0.001352581661194563, -0.01522704865783453, -0.012128944508731365, 0.01953350566327572, 0.022386305034160614, -0.04411846771836281, 0.03928506001830101, 0.0017318951431661844, -0.026729103177785873, -0.047280170023441315, -0.0031367174815386534, -0.029127636924386024, 0.012047176249325275, 0.015417841263115406, 0.08176816254854202, 0.03116275556385517, -0.006677733268588781, -0.010293703526258469, -0.03541469946503639, -0.019569847732782364, 0.008562943898141384, 0.022876914590597153, -0.0032094004563987255, -0.007854286581277847, 0.024839350953698158, 0.013773392885923386, 0.04331895709037781, 0.022386305034160614, 0.03012702614068985, 0.011111385188996792, 0.11505688726902008, -0.0130556495860219, 0.004617630038410425, -0.03254372999072075, -0.03365214169025421, -0.07304622232913971, -0.010920592583715916, -0.04702577739953995, 0.05087796971201897, -0.0010862672934308648, 0.006927580572664738, 0.05927283316850662, 0.04684407263994217, 0.02056923508644104 ]
716,581
pytorch_optimizer.loss.focal
forward
null
def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor: return self.tversky(y_pred, y_true) ** self.gamma
(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor
[ -0.04674258455634117, -0.04340631142258644, 0.0017691373359411955, 0.0043115257285535336, 0.026273155584931374, 0.01716790907084942, -0.0717993900179863, 0.021755285561084747, 0.04319779574871063, 0.06189483031630516, 0.03266768157482147, -0.04590851813554764, 0.033501747995615005, 0.03320635110139847, -0.00703310826793313, 0.03808912634849548, 0.03742882236838341, -0.0053823478519916534, 0.021233992651104927, -0.012484962120652199, 0.012615284882485867, -0.02017403021454811, -0.029487794265151024, 0.030495626851916313, -0.016568422317504883, -0.035030875355005264, -0.008605674840509892, -0.012606596574187279, -0.0449354387819767, 0.017550190910696983, -0.03171197697520256, 0.014361616224050522, 0.04430988430976868, 0.0397920161485672, 0.04344106465578079, -0.01507404912263155, -0.0025260979309678078, -0.014917661435902119, -0.03718554973602295, -0.035152509808540344, -0.03934022784233093, -0.06641270220279694, 0.008405845612287521, 0.03473547473549843, -0.040452320128679276, -0.01885342225432396, -0.049661826342344284, 0.01916619762778282, 0.007649971637874842, -0.022328706458210945, -0.029696311801671982, -0.038645170629024506, 0.0006244652904570103, 0.0037772005889564753, 0.002237214706838131, 0.025352206081151962, 0.03421418368816376, -0.03294570371508598, -0.048619240522384644, -0.021268745884299278, 0.03923596814274788, -0.04430988430976868, 0.013405912555754185, 0.005712499842047691, 0.04646456241607666, 0.016299087554216385, -0.012571844272315502, 0.05282433331012726, 0.00928769912570715, 0.025630228221416473, -0.061721064150333405, 0.006303298287093639, 0.02938353642821312, 0.0003760367108043283, -0.019756997004151344, -0.0013368987711146474, -0.034353192895650864, -0.06217285245656967, -0.014500627294182777, -0.0539364255964756, -0.0315382145345211, -0.0008210361120291054, -0.03537840396165848, -0.014570132829248905, -0.034179430454969406, -0.03569117933511734, 0.013857699930667877, -0.03847140818834305, -0.004259396344423294, 0.03202475234866142, -0.05174699425697327, 0.012954125180840492, 0.006459686439484358, 0.008692556992173195, 0.06297216564416885, 0.032858822494745255, -0.016881197690963745, -0.0027215827722102404, 0.02488304115831852, 0.006689923815429211, 0.04517870768904686, 0.10863741487264633, -0.024813536554574966, 0.04389285296201706, 0.04590851813554764, -0.002784572308883071, -0.06203383952379227, -0.0022013760171830654, 0.018471140414476395, -0.023301787674427032, -0.038645170629024506, 0.0024522480089217424, 0.030773650854825974, -0.01095583662390709, -0.017124468460679054, -0.08132167160511017, -0.025908250361680984, -0.003255907678976655, -0.024205360561609268, 0.047090113162994385, 0.018279999494552612, -0.03930547460913658, 0.021355627104640007, -0.01089501939713955, -0.03694228082895279, 0.043753840029239655, 0.06592615693807602, -0.006359771825373173, -0.005842823069542646, -0.023579809814691544, -0.023093270137906075, 0.04139064624905586, 0.01354492362588644, 0.02877536043524742, 0.019079316407442093, -0.026672814041376114, 0.030599886551499367, 0.008722965605556965, 0.08806372433900833, -0.010026197880506516, 0.04361482709646225, 0.025786615908145905, -0.0010148918954655528, 0.011034030467271805, -0.012154810130596161, -0.018836045637726784, 0.015630094334483147, 0.0237883273512125, 0.050426386296749115, 0.029522547498345375, 0.05668190121650696, 0.0314687080681324, 0.05362365022301674, -0.02424011379480362, -0.04034806042909622, 0.01973962038755417, -0.005590864922851324, -0.05828053131699562, 0.03202475234866142, 0.005334562622010708, -0.025230569764971733, -0.03266768157482147, -0.04768091067671776, -0.004904496017843485, 0.02809767983853817, -0.014118346385657787, 0.03652524575591087, 0.0589408352971077, 0.013666559010744095, 0.036316730082035065, 0.0539364255964756, -0.05049589276313782, 0.032615549862384796, 0.046047527343034744, -0.006911473348736763, 0.002172053325921297, 0.027802281081676483, -0.039166465401649475, 0.014882909134030342, 0.07541368901729584, 0.016168763861060143, -0.05682091414928436, -0.07888897508382797, -0.08556152135133743, 0.04771566390991211, -0.02656855434179306, 0.012206939049065113, 0.05821102485060692, -0.009391957893967628, 0.02608201466500759, -0.042502738535404205, -0.07666479051113129, 0.05240730196237564, -0.012406768277287483, 0.024865664541721344, -0.0021622790955007076, 0.012050551362335682, 0.028705855831503868, 0.044865932315588, -0.0163772813975811, -0.035152509808540344, -0.03833239525556564, -0.025491217151284218, -0.00883156806230545, -0.027993422001600266, -0.012780360877513885, -0.03624722361564636, 0.03676851838827133, 0.001825610757805407, -0.05550030246376991, -0.03226802125573158, -0.003666425822302699, -0.004926216788589954, 0.010773384012281895, 0.011164353229105473, -0.0180019773542881, 0.013892452232539654, 0.0018147504888474941, -0.041425399482250214, -0.0008259232272394001, -0.0062381369061768055, -0.056855663657188416, -0.055048517882823944, 0.031086426228284836, 0.03331060707569122, -0.015178307890892029, 0.02090384066104889, 0.03452695906162262, -0.0589408352971077, -0.04590851813554764, 0.005373659543693066, 0.06015718728303909, -0.00884460099041462, 0.0030213261488825083, 0.06231186166405678, -0.0010007735108956695, 0.010703878477215767, 0.001335812732577324, -0.03265030309557915, 0.03805437311530113, -0.004168170038610697, -0.01692463830113411, 0.05004410445690155, 0.029974333941936493, -0.012406768277287483, 0.024865664541721344, 0.024952547624707222, 0.06217285245656967, -0.013171331025660038, 0.05063490569591522, -0.0397225096821785, -0.02403159625828266, -0.019548479467630386, 0.037845853716135025, -0.007993156090378761, -0.033901408314704895, 0.07534418255090714, -0.026551177725195885, 0.05240730196237564, 0.017037585377693176, -0.026620684191584587, 0.03975726291537285, -0.05334562808275223, 0.05932311713695526, -0.044518403708934784, -0.02351030334830284, 0.0039857178926467896, -0.00003325956640765071, 0.02069532312452793, 0.045839011669158936, 0.07930600643157959, 0.029696311801671982, -0.058419544249773026, -0.025421710684895515, 0.008805504068732262, -0.0023827424738556147, 0.0474376417696476, 0.01897505670785904, -0.023492926731705666, 0.0004287089977879077, -0.0008992300136014819, -0.11781216412782669, -0.01897505670785904, 0.008427566848695278, -0.0410083644092083, 0.021929049864411354, 0.0016409861855208874, -0.02604726143181324, 0.11850722134113312, -0.02455288916826248, 0.021633649244904518, 0.03589969500899315, 0.04827171191573143, 0.016968078911304474, 0.05139946565032005, -0.03596920147538185, -0.0628679096698761, 0.009826368652284145, 0.028080303221940994, 0.033102091401815414, 0.045839011669158936, 0.022398212924599648, -0.01559534203261137, -0.018905552104115486, -0.027593763545155525, 0.0026194960810244083, 0.06919293105602264, 0.022849999368190765, -0.0012782532721757889, -0.040904104709625244, 0.012832490727305412, -0.01567353680729866, -0.05880182608962059, 0.024448631331324577, -0.04139064624905586, -0.06783756613731384, 0.00012360340042505413, -0.028358327224850655, 0.041981443762779236, 0.04882775619626045, 0.016299087554216385, -0.012163498438894749, 0.03909695893526077, 0.042224716395139694, -0.005243336316198111, -0.06648220866918564, -0.0029778850730508566, -0.006707300432026386, -0.04792418330907822, -0.015630094334483147, 0.006746397353708744, 0.018436387181282043, 0.004635161720216274, 0.04424038156867027, -0.06926243007183075, -0.018922926858067513, -0.006642138585448265, 0.06752479076385498, 0.006416245363652706, 0.004609096795320511, -0.03895794600248337, -0.025595474988222122, -0.035830188542604446, 0.016325151547789574, 0.007576121482998133, 0.018314752727746964, -0.04524821415543556, -0.017367737367749214, 0.07902798801660538, 0.029731065034866333, -0.015708288177847862, 0.016724810004234314, 0.07833293080329895, 0.061721064150333405, -0.0004216498346067965, 0.007493583485484123, -0.03930547460913658, 0.01897505670785904, -0.041494905948638916, -0.014483250677585602, -0.021355627104640007, 0.022728364914655685, -0.07930600643157959, 0.04340631142258644, -0.013136577792465687, 0.008497072383761406, 0.0031798859126865864, -0.021042851731181145, -0.0333627387881279, 0.04903627187013626, -0.0063728042878210545, -0.007111302111297846, 0.0013629633467644453, 0.033866655081510544, -0.01784558966755867, 0.030043840408325195, -0.022328706458210945, -0.0034144676756113768, 0.06995748728513718, 0.007971435785293579, 0.015404201112687588, -0.004695978946983814, -0.05397117882966995, -0.023093270137906075, 0.007206872571259737, 0.024448631331324577, -0.02910551242530346, -0.0551527738571167, 0.04934905096888542, -0.04020904749631882, 0.00674205319955945, -0.06001817435026169, 0.042502738535404205, -0.04007003828883171, 0.008149543777108192, -0.01965273730456829, -0.019200950860977173, 0.03930547460913658, -0.037637338042259216, -0.000997515395283699, -0.015525836497545242, 0.029192395508289337, -0.013414600864052773, -0.007089581806212664, -0.04642980918288231, -0.020313041284680367, 0.03614296391606331, 0.10321597009897232, -0.04191193729639053, 0.08278129249811172, -0.03315421938896179, 0.03150346130132675, -0.0717993900179863, 0.009965379722416401, -0.01597762294113636, 0.01192022766917944, -0.018471140414476395, -0.0328240692615509, 0.02338866889476776, 0.05727269873023033, 0.033866655081510544, 0.022050684317946434, 0.017558878287672997, -0.009530969895422459, -0.02708984725177288, 0.051712244749069214, -0.03164247050881386, 0.03508300334215164, 0.014283422380685806, 0.013405912555754185, -0.00013473517901729792, -0.07610874623060226, 0.023336539044976234, -0.01808885857462883, -0.002921411534771323, 0.01909669116139412, 0.0037858886644244194, -0.023162774741649628, -0.022293955087661743, 0.028549468144774437, -0.013214771635830402, -0.022276578471064568, 0.030043840408325195, 0.0462212935090065, -0.02974844165146351, 0.012832490727305412, 0.00002346835572097916, -0.04834121838212013, -0.028236692771315575, 0.018262622877955437, -0.03278931602835655, 0.03341486677527428, 0.004648193717002869, 0.0007287238840945065, 0.05855855345726013, 0.013275588862597942, -0.10307695716619492, -0.05821102485060692, 0.004129073116928339, -0.0030300142243504524, 0.014978478662669659, 0.05188600718975067, -0.015777794644236565, 0.049661826342344284, 0.014987166970968246, -0.03278931602835655, -0.012024486437439919, -0.015803858637809753, -0.026342662051320076, -0.05185125395655632, -0.007302443031221628, -0.006763773504644632, 0.028201939538121223, 0.026342662051320076, -0.06258988380432129, 0.01175515167415142, -0.02390996180474758, 0.015360760502517223, 0.03777635097503662, -0.050704412162303925, -0.06394524872303009, 0.014040151610970497, -0.012189562432467937, -0.006338051520287991, 0.0134841063991189, 0.03018285147845745, 0.00263252854347229, -0.006702956277877092, 0.0668644830584526, 0.01619482971727848, -0.00022630079183727503, -0.02580399252474308, 0.04945330694317818, -0.001684427261352539, -0.11169566214084625, -0.05723794549703598, 0.020000265911221504, 0.04702060669660568, -0.005925361067056656, 0.08563102781772614, -0.0031690257601439953, 0.01925307884812355, -0.07916699349880219, 0.011546635068953037, 0.009435399435460567, 0.02439650148153305, 0.0218247901648283, -0.02062581665813923, -0.068080835044384, 0.05157323181629181, 0.0512952096760273, -0.0263252854347229, -0.007111302111297846, -0.03569117933511734, 0.024326996877789497, -0.017915094271302223, -0.0002834529441315681, 0.028688479214906693, 0.012710855342447758, -0.010634372942149639, -0.03544791042804718, 0.019583232700824738, -0.005447509698569775, -0.008271178230643272, 0.007658659480512142, 0.04097361117601395, -0.009183441288769245, 0.015265190042555332, 0.030443498864769936, -0.011981045827269554, -0.008301587775349617, -0.044865932315588, -0.0314687080681324, 0.02298901043832302, -0.08153019100427628, -0.03638623654842377, -0.04132113978266716, -0.04976608231663704, 0.001999374944716692, -0.025595474988222122, 0.0009795960504561663, -0.031816236674785614, -0.01738511398434639, 0.008596986532211304, -0.016994144767522812, -0.023614563047885895, -0.0371507965028286, 0.0134841063991189, -0.05084342136979103, 0.01845376379787922, -0.09953216463327408, -0.012650038115680218, 0.028931748121976852, 0.027107223868370056, 0.042502738535404205, 0.08750768005847931, 0.030652014538645744, 0.065370112657547, -0.0031994343735277653, 0.023093270137906075, -0.0022567634005099535, -0.06960996240377426, 0.04215520992875099, -0.005599553231149912, -0.00045911775669083, 0.008136511780321598, -0.03449220582842827, 0.0500788576900959, 0.007137367036193609, 0.004433160647749901, 0.009921939112246037, 0.014457186684012413, 0.022641483694314957, 0.05087817460298538, -0.003987889736890793, -0.002521753776818514, 0.05126045644283295, -0.06349346041679382, 0.02142513357102871, 0.005625617690384388, 0.003336273832246661, -0.05087817460298538, 0.01833212934434414, 0.040417566895484924, -0.04948806017637253, -0.0009106333018280566, 0.00384887820109725, 0.0668644830584526, 0.007315475028008223, 0.00018476028344593942, -0.039374981075525284, 0.03051300346851349, -0.042780760675668716, -0.02403159625828266, -0.001408576499670744, -0.09098296612501144, -0.016542356461286545, 0.008497072383761406, 0.05960113927721977, 0.015508459880948067, 0.01559534203261137, 0.005834134761244059, 0.006776805967092514, -0.02078220434486866, -0.022276578471064568, -0.02736787125468254, -0.036281976848840714, 0.0353262722492218, -0.025856122374534607, -0.053762663155794144, -0.011416311375796795, -0.03690752759575844, 0.013796881772577763, -0.01238070335239172, -0.00037875177804380655, 0.03874943032860756, 0.04191193729639053, 0.036559998989105225, -0.01033028494566679, 0.04910577833652496, -0.0014140066923573613, -0.0067246765829622746, -0.006863688118755817, 0.05438821390271187, 0.017159219831228256, -0.05897558853030205, 0.05132996290922165, -0.06356296688318253, -0.007736853789538145, -0.02576923929154873, -0.01722872629761696, 0.02889699675142765, -0.03829764202237129, 0.015612718649208546, -0.008258146233856678, 0.011807281523942947, -0.012154810130596161, 0.037359315901994705, -0.010052261874079704, -0.09786403179168701, -0.07360654324293137, 0.06644745171070099, -0.0013455869629979134, 0.04212045669555664, -0.005269401241093874, 0.01131205353885889, -0.04542197659611702, 0.03468334674835205, 0.024865664541721344, -0.015160931274294853, -0.007437110412865877, -0.0006863688468001783, 0.04538722336292267, 0.07138235867023468, -0.014935038052499294, -0.009652604348957539, -0.008067005313932896, 0.0462212935090065, 0.0436495803296566, -0.023579809814691544, -0.013301653787493706, -0.003249391680583358, -0.01897505670785904, 0.01095583662390709, -0.005599553231149912, 0.010017509572207928, 0.005312842316925526, -0.06769855320453644, -0.08632608503103256, -0.02669019065797329, -0.03011334501206875, 0.010026197880506516, -0.03183361142873764, -0.0449354387819767, 0.036108214408159256, -0.06203383952379227, 0.035030875355005264, 0.04959231987595558, 0.030460873618721962, -0.0176631361246109, 0.01640334539115429, 0.018419010564684868, 0.025213193148374557, 0.007702100556343794, 0.015004543587565422, -0.015282566659152508, -0.05935787037014961, 0.05139946565032005, -0.06015718728303909, -0.03240703418850899, -0.08590904623270035, -0.027159353718161583, -0.0004824673233088106, -0.019948136061429977, 0.014344239607453346, -0.006086092907935381, -0.013553611934185028, 0.00555611215531826, 0.014352927915751934, -0.014352927915751934, -0.05334562808275223, 0.008549201302230358, -0.02267623506486416, -0.04208570346236229, -0.0075544011779129505, 0.029887452721595764, 0.016950704157352448, -0.03652524575591087, -0.0301480982452631, -0.04444889724254608, 0.03854091092944145, -0.03254604712128639, -0.017619695514440536, 0.016551045700907707, 0.004739420022815466, 0.0352567695081234, -0.04528296738862991, -0.004198578651994467, 0.04132113978266716, 0.034422699362039566, 0.01449193898588419, -0.020486805588006973, -0.015708288177847862, 0.04079984873533249, -0.044796425849199295, -0.04139064624905586, 0.012693478725850582, -0.021112358197569847, -0.010903706774115562, -0.00821904931217432, 0.031016919761896133, 0.019513726234436035, 0.01591680571436882, -0.02185954339802265, -0.03958349674940109, -0.019200950860977173, -0.022641483694314957, -0.046568822115659714, 0.09668243676424026, 0.020191406831145287, 0.028757983818650246, 0.054318707436323166, 0.0437190867960453, -0.01569960080087185, 0.07464912533760071, 0.0013238664250820875, -0.03576068580150604, -0.014978478662669659, 0.027993422001600266, -0.030877908691763878, 0.0424332320690155, 0.0359344482421875, -0.032337527722120285, -0.023162774741649628, 0.11836821585893631, 0.039374981075525284, 0.03063463792204857, -0.029036007821559906, -0.05421444773674011, -0.043997108936309814, -0.044518403708934784, -0.024187983945012093, -0.0017202661838382483, 0.04076509550213814, -0.007580465637147427, 0.028914373368024826, 0.048097945749759674, 0.034474827349185944 ]
716,615
pytorch_optimizer.optimizer.fromage
Fromage
On the distance between two neural networks and the stability of learning. :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param lr: float. learning rate. :param p_bound: Optional[float]. Restricts the optimisation to a bounded set. A value of 2.0 restricts parameter norms to lie within 2x their initial norms. This regularises the model class.
class Fromage(Optimizer, BaseOptimizer): r"""On the distance between two neural networks and the stability of learning. :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param lr: float. learning rate. :param p_bound: Optional[float]. Restricts the optimisation to a bounded set. A value of 2.0 restricts parameter norms to lie within 2x their initial norms. This regularises the model class. """ def __init__(self, params: PARAMETERS, lr: float = 1e-2, p_bound: Optional[float] = None): self.validate_learning_rate(lr) self.p_bound = p_bound defaults: DEFAULTS = {'lr': lr} super().__init__(params, defaults) def __str__(self) -> str: return 'Fromage' @torch.no_grad() def reset(self): for group in self.param_groups: for p in group['params']: state = self.state[p] if self.p_bound is not None: state['max'] = p.norm().mul_(self.p_bound) @torch.no_grad() def step(self, closure: CLOSURE = None) -> LOSS: loss: LOSS = None if closure is not None: with torch.enable_grad(): loss = closure() for group in self.param_groups: pre_factor: float = math.sqrt(1 + group['lr'] ** 2) for p in group['params']: if p.grad is None: continue grad = p.grad if grad.is_sparse: raise NoSparseGradientError(str(self)) state = self.state[p] if len(state) == 0 and self.p_bound is not None: state['max'] = p.norm().mul_(self.p_bound) p_norm, g_norm = p.norm(), grad.norm() if p_norm > 0.0 and g_norm > 0.0: p.add_(grad * (p_norm / g_norm), alpha=-group['lr']) else: p.add_(grad, alpha=-group['lr']) p.div_(pre_factor) if self.p_bound is not None: p_norm = p.norm() if p_norm > state['max']: p.mul_(state['max']).div_(p_norm) return loss
(params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], lr: float = 0.01, p_bound: Optional[float] = None)
[ -0.024096375331282616, -0.02066216617822647, -0.022616440430283546, 0.005967173259705305, -0.01676310785114765, 0.026031674817204475, -0.01860353909432888, -0.08226919919252396, -0.04861016571521759, 0.003744899295270443, -0.0529361292719841, 0.0175789687782526, 0.015453934669494629, 0.07456594705581665, -0.03834548965096474, 0.03669479489326477, 0.00017654270050115883, 0.007219425868242979, 0.005644623190164566, -0.01582391932606697, -0.019865280017256737, -0.034892309457063675, 0.001559386495500803, 0.025424521416425705, -0.032198067754507065, -0.010340570472180843, 0.025576310232281685, -0.03079402819275856, -0.04925526678562164, -0.007276346441358328, -0.02274925448000431, -0.029257172718644142, 0.021876472979784012, 0.011137458495795727, 0.021762631833553314, -0.06223315745592117, 0.010416463948786259, 0.021345213055610657, -0.06743190437555313, -0.009439327754080296, 0.009500991553068161, -0.053467389196157455, -0.019409915432333946, 0.0015178818721324205, 0.010112888179719448, -0.011412573978304863, -0.027853133156895638, 0.030300717800855637, -0.019561702385544777, -0.02126931957900524, 0.017702298238873482, -0.03115452639758587, 0.05369507148861885, -0.0027559043373912573, 0.0038634836673736572, 0.05297407880425453, 0.04534672200679779, 0.0104354377835989, 0.05965275689959526, -0.05009010061621666, 0.026392171159386635, -0.07126455754041672, -0.003154348349198699, -0.03680863603949547, 0.0002708173997234553, -0.06287825852632523, -0.07612177729606628, -0.015027030371129513, 0.016990790143609047, 0.04758559539914131, 0.014552692882716656, -0.03844035789370537, 0.0385921485722065, 0.02422918938100338, -0.010568252764642239, 0.0052604093216359615, -0.061815738677978516, -0.017531536519527435, 0.020529352128505707, -0.05248076468706131, 0.007072380743920803, -0.0032919063232839108, 0.02092779614031315, -0.033469296991825104, -0.028877703472971916, -0.05821077153086662, -0.0010435438016429543, -0.037074264138936996, 0.061056800186634064, -0.07703250646591187, -0.015710078179836273, 0.026050647720694542, 0.031420156359672546, 0.021098557859659195, 0.07126455754041672, 0.05506116524338722, -0.0561995767056942, -0.015643669292330742, -0.02071908675134182, -0.018679434433579445, 0.03271035477519035, 0.06838057935237885, 0.028593100607395172, 0.053922753781080246, 0.05623752251267433, -0.03464565426111221, -0.029446909204125404, -0.04861016571521759, 0.01984630525112152, -0.01857507973909378, -0.07008819282054901, -0.0016186786815524101, -0.06348540633916855, 0.010520818643271923, -0.052404873073101044, 0.0120387002825737, 0.0008899768581613898, 0.009904179722070694, -0.04155201464891434, -0.007485054899007082, 0.03576509281992912, 0.04993831366300583, -0.026809588074684143, -0.02737879380583763, -0.020396538078784943, 0.014808835461735725, 0.04591592773795128, 0.0009629063424654305, -0.00708661088719964, -0.07824680954217911, -0.020225776359438896, 0.006783034652471542, -0.026050647720694542, -0.002123848767951131, 0.01893557608127594, -0.045840032398700714, -0.023584090173244476, 0.03965466469526291, -0.007470824755728245, 0.04621950164437294, 0.025879886001348495, 0.060487594455480576, 0.023792797699570656, -0.03694145008921623, 0.03301393240690231, 0.005303099751472473, 0.006811494939029217, 0.050773147493600845, 0.022009287029504776, 0.003249215893447399, -0.014846782200038433, 0.019068391993641853, 0.06469971686601639, 0.014524232596158981, 0.03151502087712288, 0.010150834918022156, -0.01881224848330021, -0.04713023081421852, -0.04470162093639374, -0.028175681829452515, -0.042121220380067825, -0.018072281032800674, -0.03252061828970909, -0.055402688682079315, -0.01633620448410511, -0.024399951100349426, 0.01152641512453556, 0.0037259256932884455, -0.046143610030412674, 0.061056800186634064, -0.03350724279880524, -0.08879608660936356, 0.04219711571931839, 0.01660183258354664, -0.007935675792396069, 0.09426046162843704, 0.03639121726155281, 0.01939094066619873, 0.005056444089859724, -0.0008176402770914137, 0.0529361292719841, -0.019770411774516106, -0.029408961534500122, -0.07646329700946808, 0.0005712809506803751, 0.029200252145528793, -0.028061840683221817, -0.005454888101667166, -0.04231095686554909, 0.03770039230585098, 0.003581252647563815, -0.030528400093317032, 0.00573949096724391, -0.016962330788373947, -0.010027507320046425, 0.04515698552131653, -0.0021582383196800947, 0.03185654431581497, 0.08530496060848236, 0.06568633764982224, 0.006147421430796385, 0.04731996729969978, -0.0002711138513404876, 0.016554398462176323, -0.021212399005889893, 0.034285157918930054, -0.04291810840368271, 0.05528884753584862, 0.01147898193448782, 0.00031009851954877377, -0.010378517210483551, -0.013034810312092304, 0.009216388687491417, 0.059994280338287354, 0.031230419874191284, -0.018499186262488365, -0.0046081943437457085, 0.006507918704301119, 0.06860826164484024, 0.002800966380164027, 0.03343134745955467, -0.07225117832422256, 0.00804477371275425, -0.013328900560736656, 0.052101295441389084, 0.008960246108472347, 0.04280426725745201, -0.009448815137147903, -0.001936485292389989, 0.01636466383934021, 0.04857221990823746, -0.08985860645771027, 0.0088321752846241, 0.000022808992071077228, 0.07168196886777878, 0.02846028469502926, -0.02846028469502926, 0.031021710485219955, -0.06492739915847778, -0.006228059064596891, -0.05737593397498131, -0.02728392742574215, -0.06397872418165207, 0.02005501464009285, -0.02168673649430275, -0.013509148731827736, 0.03935108706355095, -0.005488091614097357, -0.0064747147262096405, 0.04060333967208862, -0.040641285479068756, -0.03094581700861454, -0.038041915744543076, 0.03881983086466789, -0.04462572559714317, -0.03003508783876896, 0.014619099907577038, -0.020092960447072983, -0.0046081943437457085, -0.05786924809217453, -0.036561980843544006, -0.05058341473340988, -0.10966696590185165, 0.05506116524338722, -0.017920492216944695, 0.04610566049814224, 0.04637129232287407, -0.04052744433283806, 0.020225776359438896, -0.002478416543453932, 0.09858642518520355, 0.0480409599840641, -0.06910157203674316, 0.0071008410304784775, 0.0021558667067438364, 0.021060610190033913, -0.011061564087867737, -0.005644623190164566, 0.005820128135383129, -0.017616916447877884, 0.0654207095503807, -0.024513792246580124, -0.06549660116434097, -0.04504314437508583, -0.04352526366710663, 0.02381177246570587, -0.01724693365395069, -0.021591870114207268, 0.021136505529284477, 0.023944586515426636, 0.03269138187170029, -0.019884252920746803, 0.06458587199449539, -0.011298732832074165, 0.09532298147678375, 0.00006907548231538385, -0.01802484691143036, 0.034380026161670685, -0.025064025074243546, -0.03893367201089859, 0.05164593085646629, -0.029541775584220886, 0.0004286830371711403, 0.006280236411839724, 0.004698318894952536, -0.012835588306188583, 0.0023788055405020714, -0.0016115636099129915, 0.030319690704345703, -0.007290576584637165, 0.009951612912118435, 0.007432878017425537, -0.01603262685239315, -0.009202159009873867, 0.0035741375759243965, -0.03405747562646866, -0.017683323472738266, -0.03927519544959068, 0.01603262685239315, 0.05024189129471779, -0.02271130681037903, 0.06621759384870529, -0.011346166953444481, -0.002727444050833583, -0.05263255536556244, -0.033355455845594406, 0.01211459469050169, 0.028536180034279823, -0.015359067358076572, -0.020738061517477036, -0.04045155271887779, 0.015871351584792137, 0.045384667813777924, 0.013433254323899746, -0.020529352128505707, 0.0305473729968071, 0.07862628251314163, 0.02534862793982029, 0.004745752550661564, -0.028004920110106468, 0.046029768884181976, 0.05115262046456337, -0.051797717809677124, 0.026581905782222748, 0.0017692811088636518, -0.03593585267663002, -0.006228059064596891, 0.015159845352172852, 0.04565029591321945, -0.029029490426182747, -0.043335527181625366, 0.0011052077170461416, 0.0055639855563640594, 0.03806088864803314, 0.04754764959216118, 0.004432689398527145, 0.00759889604523778, -0.00807797722518444, 0.016734648495912552, -0.04424625635147095, -0.006759317591786385, -0.028593100607395172, -0.05627547204494476, 0.032406777143478394, 0.05342944338917732, -0.0159757062792778, 0.023546142503619194, -0.06948104500770569, -0.005274639464914799, -0.002985958242788911, -0.03329853340983391, -0.09593013674020767, -0.016070574522018433, -0.0024546997155994177, -0.05103877931833267, -0.014789861626923084, -0.016118008643388748, -0.017920492216944695, 0.021497001871466637, 0.0528222881257534, 0.05726209282875061, 0.014600126072764397, 0.03823164850473404, 0.03976850584149361, 0.049293212592601776, -0.04530877247452736, 0.02030166983604431, -0.005312586668878794, 0.050355732440948486, -0.04724407196044922, 0.056579045951366425, -0.003168578492477536, -0.004008156713098288, 0.0008034101338125765, -0.0624987855553627, 0.03236883133649826, 0.015112411230802536, 0.0319514125585556, -0.059880439192056656, -0.04842043295502663, -0.034133367240428925, -0.020548325031995773, 0.005696800537407398, 0.030661214143037796, -0.010141348466277122, -0.07449005544185638, 0.040337711572647095, 0.08606389909982681, -0.015605723485350609, 0.08917555958032608, -0.03576509281992912, -0.006783034652471542, 0.022559519857168198, 0.049293212592601776, 0.0176643505692482, -0.035195887088775635, 0.050621360540390015, 0.008523855358362198, 0.012854562141001225, 0.04936910793185234, 0.07285833358764648, -0.008267712779343128, 0.03823164850473404, -0.00654112221673131, 0.026278330013155937, -0.031420156359672546, -0.05415043607354164, -0.050773147493600845, -0.010198269039392471, 0.0008810830186121166, -0.011981779709458351, -0.027815185487270355, -0.04470162093639374, -0.02107958495616913, -0.022331837564706802, 0.001274783629924059, -0.01488472893834114, 0.06352335959672928, 0.044663675129413605, -0.019220178946852684, 0.025993727147579193, -0.015406501479446888, 0.01845175214111805, 0.02235081046819687, -0.02096574380993843, -0.05145619437098503, 0.05756567046046257, -0.005293612834066153, -0.06591401994228363, -0.028384391218423843, 0.01975143887102604, -0.016715673729777336, 0.013755804859101772, 0.028782835230231285, 0.018195608630776405, 0.03680863603949547, -0.014353470876812935, -0.045991819351911545, -0.03752962872385979, 0.01663978025317192, 0.027208032086491585, 0.04398062825202942, -0.007565692532807589, 0.041058704257011414, -0.054226331412792206, 0.015615209937095642, 0.06215726211667061, 0.0002909767790697515, -0.017797164618968964, -0.006839955225586891, 0.006009863689541817, -0.01857507973909378, 0.020396538078784943, -0.038762908428907394, -0.038307543843984604, 0.036979395896196365, -0.015605723485350609, -0.0021357072982937098, 0.02637319825589657, -0.019504781812429428, 0.026809588074684143, -0.0543401725590229, 0.06321977823972702, 0.05908355116844177, -0.01308224443346262, 0.026392171159386635, -0.023394353687763214, 0.03546151518821716, -0.0013649078318849206, 0.050924938172101974, -0.03771936520934105, -0.050052154809236526, 0.06936720013618469, 0.01908736489713192, -0.05312586575746536, -0.012465604580938816, 0.0369035042822361, 0.018641486763954163, 0.07395879179239273, -0.010444924235343933, -0.007020203862339258, 0.001641209819354117, -0.032501645386219025, 0.00583910197019577, 0.06883594393730164, 0.027473662048578262, -0.05859024077653885, 0.03151502087712288, -0.0384213849902153, 0.07278243452310562, 0.018916603177785873, -0.015027030371129513, 0.007764914538711309, 0.027511609718203545, -0.000891162664629519, -0.04056539386510849, -0.010293136350810528, 0.06777342408895493, 0.030357638373970985, -0.04443599283695221, 0.029238199815154076, 0.02804286777973175, -0.026050647720694542, -0.05843845382332802, 0.007300063036382198, 0.01911582425236702, -0.014182709157466888, -0.027568530291318893, 0.04587797820568085, -0.03012995608150959, 0.059425074607133865, -0.005246179178357124, 0.024305082857608795, 0.03792807459831238, 0.00936343427747488, 0.0033938889391720295, -0.0069964868016541, -0.057034410536289215, -0.08158615231513977, -0.02066216617822647, 0.03542356938123703, 0.021212399005889893, 0.025367600843310356, 0.03715015947818756, 0.02014988102018833, 0.0401100292801857, -0.027416741475462914, 0.029864326119422913, -0.033412374556064606, 0.012930456548929214, -0.042880162596702576, 0.033715952187776566, -0.03536664694547653, 0.002483160002157092, 0.04265248030424118, 0.023394353687763214, -0.0481548011302948, 0.021724684163928032, 0.019466836005449295, 0.026809588074684143, -0.020548325031995773, -0.046295396983623505, 0.040034133940935135, 0.002483160002157092, -0.04177969694137573, 0.024570712819695473, -0.00777440145611763, 0.004081679042428732, -0.030110981315374374, 0.023584090173244476, 0.005805897992104292, -0.014609613455832005, -0.03735886886715889, -0.003718810621649027, -0.017835112288594246, 0.003972581587731838, 0.017265906557440758, 0.005559242330491543, 0.0008959060651250184, -0.031325288116931915, 0.06318183243274689, -0.035499460995197296, -0.0003993333666585386, -0.033222638070583344, -0.0014123416040092707, 0.061815738677978516, -0.0850013867020607, 0.0559718944132328, 0.03923724591732025, 0.022673361003398895, -0.012503552250564098, 0.02020680159330368, -0.022217996418476105, -0.06291620433330536, -0.012883022427558899, 0.0043046181090176105, -0.05938712880015373, -0.01885019615292549, 0.04925526678562164, 0.06280235946178436, -0.056009840220212936, -0.00003240692603867501, 0.014704480767250061, -0.012977889738976955, -0.009809311479330063, -0.011801531538367271, -0.027416741475462914, 0.004186033736914396, 0.011848965659737587, -0.042424798011779785, -0.0018700779182836413, -0.014239629730582237, -0.00609524454921484, -0.03593585267663002, -0.03604969382286072, -0.007513515185564756, -0.02510197088122368, -0.018983010202646255, 0.08864430338144302, -0.033621083945035934, -0.016146467998623848, -0.029389988631010056, 0.019523756578564644, -0.006389333866536617, -0.007935675792396069, -0.03134426102042198, 0.03826959803700447, -0.09023807942867279, -0.01754102297127247, -0.011697176843881607, -0.029333068057894707, -0.027473662048578262, 0.01341428142040968, -0.05411249026656151, 0.02422918938100338, -0.012095620855689049, 0.04515698552131653, 0.004280901048332453, -0.05187361314892769, -0.05582010746002197, -0.024646606296300888, 0.02092779614031315, -0.03642916679382324, -0.013641963712871075, -0.0369035042822361, -0.04591592773795128, -0.008040030486881733, 0.04322168603539467, 0.06621759384870529, -0.006953796371817589, 0.019618622958660126, 0.04936910793185234, -0.0010850484250113368, 0.013604016043245792, 0.017171038314700127, -0.03584098443388939, 0.01651645265519619, 0.04762354493141174, 0.0692533627152443, -0.03938903659582138, -0.007338010240346193, -0.0026847536209970713, 0.05175977200269699, 0.04253863915801048, -0.051380302757024765, -0.009932640008628368, -0.010644146241247654, -0.00601935014128685, -0.006232802290469408, 0.014495772309601307, -0.07134044915437698, -0.0018451751675456762, -0.051683876663446426, 0.027416741475462914, 0.008798971772193909, -0.005568729247897863, 0.013177111744880676, -0.06822878867387772, -0.031590916216373444, -0.003472154727205634, 0.021724684163928032, 0.05160798504948616, -0.009885205887258053, 0.008357836864888668, 0.0386490672826767, 0.02525375969707966, -0.024817368015646935, 0.03642916679382324, 0.036561980843544006, 0.024969156831502914, -0.05232897773385048, -0.026335250586271286, 0.03557535633444786, 0.004143343307077885, 0.04223506152629852, -0.06162600591778755, -0.05665494129061699, -0.0559718944132328, -0.012911482714116573, -0.057034410536289215, -0.0020159368868917227, -0.006204342003911734, -0.05342944338917732, 0.0029266660567373037, 0.003026277059689164, 0.03597380220890045, 0.01754102297127247, 0.0020479545928537846, 0.032236017286777496, -0.00822976604104042, 0.0009261451195925474, -0.0026823817752301693, 0.017294365912675858, -0.004176546819508076, 0.07855039089918137, 0.01282610185444355, 0.050773147493600845, 0.0056730834767222404, -0.017379747703671455, 0.005877048708498478, 0.012418171390891075, -0.0016257937531918287, 0.024210216477513313, -0.025082997977733612, -0.023394353687763214, 0.008324633352458477, 0.023735877126455307, -0.04656102508306503, -0.017408207058906555, -0.009116778150200844, 0.017645377665758133, 0.04246274381875992, -0.014590639621019363, -0.04879990220069885, -0.0080305440351367, 0.0015795457875356078, 0.03100273758172989, 0.032406777143478394, 0.005938712973147631, 0.02274925448000431, 0.00890806969255209, 0.06826673448085785, 0.007670046761631966, -0.028991544619202614, 0.01948580890893936, 0.03447489067912102, -0.026543959975242615, -0.027625450864434242, 0.0247794222086668, -0.03470257297158241, 0.06295415014028549, 0.003991554956883192, 0.05589599907398224, -0.003529075300320983, 0.04682665690779686, -0.0654207095503807, 0.025671176612377167, -0.05365712568163872, -0.06204342097043991, -0.0884925127029419, -0.005620906129479408, -0.025538362562656403, 0.07331369817256927, 0.04067923501133919, 0.03711221367120743, 0.00777440145611763, 0.012958916835486889, 0.01944786123931408 ]
716,617
pytorch_optimizer.optimizer.fromage
__init__
null
def __init__(self, params: PARAMETERS, lr: float = 1e-2, p_bound: Optional[float] = None): self.validate_learning_rate(lr) self.p_bound = p_bound defaults: DEFAULTS = {'lr': lr} super().__init__(params, defaults)
(self, params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], lr: float = 0.01, p_bound: Optional[float] = None)
[ -0.018903600051999092, -0.011470719240605831, -0.020352153107523918, 0.010130808688700199, -0.04352898150682449, 0.007663744036108255, -0.03635865077376366, -0.03979896008968353, -0.03148789331316948, -0.002797515597194433, -0.01765422523021698, 0.055733028799295425, 0.023086294531822205, 0.04660715162754059, -0.021547207608819008, 0.04472403600811958, 0.053560201078653336, 0.0020483427215367556, -0.05424826219677925, -0.02493319660425186, -0.009551388211548328, 0.004429399501532316, -0.002007602248340845, 0.09104147553443909, 0.0018876440590247512, 0.031958673149347305, -0.009388426318764687, -0.018704425543546677, -0.04711414501070976, -0.0003109293757006526, -0.00452446099370718, 0.004906969144940376, -0.012846843339502811, 0.0750349834561348, 0.030980899930000305, -0.0020573961082845926, -0.018459981307387352, -0.0043977126479148865, -0.0868406817317009, 0.06018732488155365, 0.015617198310792446, -0.023122508078813553, -0.031035222113132477, -0.012249316088855267, -0.0062649864703416824, -0.002214699750766158, 0.03393232449889183, 0.02049700729548931, 0.024136492982506752, -0.0315060019493103, 0.012611453421413898, 0.011660841293632984, 0.01574394665658474, -0.018016362562775612, -0.028192438185214996, 0.061454810202121735, 0.04008866846561432, 0.03748127818107605, 0.028771858662366867, 0.00043682887917384505, -0.00795798096805811, -0.03911089897155762, -0.018613889813423157, -0.04019731283187866, 0.046281229704618454, -0.015463289804756641, -0.08046705275774002, -0.015680572018027306, 0.03277348354458809, 0.04298577457666397, 0.08582669496536255, -0.027558697387576103, -0.023357897996902466, 0.028898607939481735, 0.0201891902834177, 0.004680633079260588, -0.0532342754304409, -0.016432009637355804, -0.0069213612005114555, -0.017219658941030502, 0.02891671471297741, 0.04675200954079628, 0.004452033434063196, -0.009551388211548328, -0.017590850591659546, -0.05033717304468155, -0.04103022813796997, -0.06170830503106117, 0.04399976134300232, -0.003447100520133972, -0.05627623572945595, 0.010176076553761959, -0.014874815940856934, 0.015608144924044609, 0.06040460988879204, -0.008673204109072685, -0.01645011641085148, -0.02710602432489395, -0.026381749659776688, -0.011461665853857994, -0.03456606715917587, 0.0038228186313062906, -0.034837670624256134, 0.014585105702280998, 0.07206545025110245, -0.02000812068581581, -0.018523355945944786, -0.035815443843603134, 0.014204860664904118, -0.017156284302473068, -0.03498252481222153, 0.04772977903485298, -0.07872878760099411, 0.05461040139198303, -0.06442433595657349, 0.07246380299329758, -0.0010603851405903697, -0.010139862075448036, -0.008786371909081936, 0.01271104160696268, 0.014901976101100445, 0.048236772418022156, -0.047838423401117325, 0.002768091857433319, 0.020334044471383095, 0.01610608398914337, 0.004187219776213169, 0.017364514991641045, -0.0108460308983922, -0.06054946407675743, 0.05982518941164017, -0.018867386505007744, -0.036032725125551224, -0.0335339717566967, -0.017636118456721306, -0.040921587496995926, 0.01574394665658474, 0.05345156043767929, -0.03619568794965744, 0.015644358471035957, 0.04733143001794815, 0.03885740041732788, 0.04675200954079628, -0.021311817690730095, 0.04888862371444702, 0.03704671189188957, -0.02839161455631256, 0.02151099406182766, 0.013036966323852539, 0.03726399317383766, 0.00522384000942111, -0.006228772457689047, 0.024408096447587013, 0.010357145220041275, 0.03463849425315857, -0.02759491093456745, 0.04363762214779854, -0.06862513720989227, 0.0021207702811807394, -0.006292146630585194, -0.005803260486572981, -0.019374379888176918, 0.014422143809497356, -0.08734767138957977, -0.03242945298552513, 0.03025662526488304, -0.01301885861903429, -0.02279658429324627, -0.0034584172535687685, 0.028138117864727974, -0.006233299151062965, -0.14891111850738525, -0.007265392225235701, 0.014874815940856934, 0.00007320562144741416, 0.04179072007536888, 0.022289590910077095, 0.019664090126752853, -0.022416338324546814, 0.022343911230564117, 0.1242857426404953, 0.003804711624979973, -0.029079677537083626, -0.06286714971065521, 0.030763618648052216, 0.018441874533891678, -0.048055704683065414, 0.03740885108709335, -0.06073053181171417, 0.0375174917280674, 0.03463849425315857, 0.006513956002891064, -0.004130635876208544, -0.0024172707926481962, -0.007523415610194206, 0.019899480044841766, 0.061672091484069824, 0.008034935221076012, 0.027486270293593407, 0.061454810202121735, 0.07250001281499863, 0.042696062475442886, -0.0008747894898988307, -0.019935693591833115, -0.022289590910077095, 0.02484266273677349, -0.03016608953475952, 0.036702681332826614, 0.024498632177710533, -0.024064065888524055, 0.0006739160744473338, -0.04581044986844063, 0.009506121277809143, 0.0174822099506855, -0.00021869737247470766, 0.011597467586398125, -0.0650399774312973, -0.002525912132114172, 0.024643486365675926, 0.014376875944435596, 0.09654597193002701, -0.03148789331316948, 0.007161277811974287, -0.05779721587896347, 0.0192476324737072, 0.043673835694789886, 0.026906849816441536, -0.06837164610624313, -0.05211164802312851, 0.06337413936853409, -0.009750563651323318, -0.056348662823438644, -0.009062501601874828, 0.003935986664146185, 0.022597407922148705, 0.024317562580108643, -0.014757120981812477, 0.03472902998328209, -0.1045130118727684, -0.01760895736515522, 0.016015550121665, 0.03950924798846245, -0.04088537395000458, -0.02147478051483631, -0.011036153882741928, 0.016839414834976196, 0.0011339443735778332, 0.03378747031092644, 0.003157390281558037, -0.0070345294661819935, -0.03476524353027344, -0.02484266273677349, -0.03192245960235596, 0.0365397185087204, -0.007292552851140499, 0.038531478494405746, 0.029152104631066322, -0.021855024620890617, 0.02652660384774208, 0.010583481751382351, -0.025711793452501297, 0.009804884903132915, -0.016332421451807022, 0.0681905746459961, 0.01689373515546322, 0.024824555963277817, -0.011371131055057049, -0.013272355310618877, 0.026273107156157494, -0.011724215932190418, 0.11994008719921112, 0.026943063363432884, 0.00422569690272212, -0.005902848206460476, 0.013136553578078747, -0.035145487636327744, -0.024824555963277817, -0.039364393800497055, -0.0015379545511677861, 0.014766174368560314, 0.08387114852666855, -0.003073645755648613, 0.035109274089336395, 0.0011633681133389473, -0.021040214225649834, 0.012013926170766354, 0.0025123320519924164, -0.0018061629962176085, -0.028554577380418777, -0.006056757178157568, -0.026725780218839645, 0.016576863825321198, 0.05899227038025856, 0.04602773115038872, 0.07431070506572723, -0.006391734816133976, 0.036612145602703094, 0.0005463190609589219, 0.012855896726250648, -0.019627876579761505, 0.025784220546483994, -0.05529846251010895, 0.059463050216436386, 0.0025575992185622454, -0.028952928259968758, -0.0572177954018116, 0.03311751410365105, 0.01075549703091383, 0.02270604856312275, 0.000514914863742888, 0.026001503691077232, 0.04570180922746658, 0.01505588460713625, 0.02080482430756092, 0.03264673426747322, -0.021366138011217117, 0.00674029253423214, -0.07119631767272949, 0.04026973992586136, 0.022597407922148705, -0.01505588460713625, -0.0008023618720471859, 0.018613889813423157, -0.04715035855770111, -0.06572803854942322, -0.0749625563621521, 0.024009745568037033, 0.0310895424336195, -0.027884621173143387, -0.012385117821395397, -0.008700364269316196, -0.009560441598296165, 0.036485396325588226, -0.050409600138664246, -0.04005245491862297, 0.0036892802454531193, 0.028989141806960106, 0.03675699979066849, 0.013163713738322258, -0.019990013912320137, 0.04787463694810867, -0.020026227459311485, -0.03393232449889183, 0.05815935507416725, 0.0007650164188817143, -0.014865762554109097, 0.0023742669727653265, -0.04494131729006767, 0.05247378721833229, -0.09350401908159256, -0.03864011913537979, -0.012285529635846615, -0.0037752881180495024, 0.05609516799449921, 0.019627876579761505, -0.024951303377747536, 0.005920955445617437, -0.008650570176541805, 0.004191746469587088, -0.03867633268237114, -0.003021588549017906, -0.01026661042124033, -0.05468282848596573, 0.04457918182015419, 0.03644918277859688, 0.01893981359899044, 0.012204048223793507, -0.01765422523021698, -0.002190934494137764, 0.037227779626846313, -0.018505249172449112, -0.11030721664428711, -0.028627004474401474, -0.0005774402525275946, 0.011425452306866646, 0.00448145717382431, -0.025693686679005623, -0.012647667899727821, 0.038748759776353836, -0.012973591685295105, -0.001574168330989778, 0.002600603038445115, 0.05294456705451012, 0.016667399555444717, -0.030673082917928696, -0.0192114170640707, 0.016069870442152023, 0.029152104631066322, 0.0512787327170372, -0.017020482569932938, -0.0034584172535687685, 0.024625379592180252, -0.005486389622092247, -0.009524228051304817, -0.06554696708917618, 0.028373507782816887, 0.026798207312822342, 0.03152410686016083, -0.02337600477039814, -0.028319187462329865, -0.011362077668309212, -0.04700550436973572, -0.017020482569932938, 0.04418082907795906, 0.02187313139438629, -0.009813938289880753, 0.023919211700558662, 0.030437692999839783, 0.017092911526560783, 0.030709296464920044, -0.028011370450258255, -0.02404595911502838, 0.0038024482782930136, 0.016794146969914436, -0.017527475953102112, -0.022995758801698685, 0.036032725125551224, -0.017998255789279938, 0.009478960186243057, -0.015309381298720837, 0.051387373358011246, -0.007048109546303749, 0.07036340236663818, 0.030836045742034912, 0.053161848336458206, 0.043710049241781235, -0.0001996002538362518, -0.014539838768541813, 0.017952987924218178, -0.03748127818107605, -0.07297079265117645, 0.03295455127954483, -0.06373627483844757, -0.028898607939481735, 0.020062441006302834, 0.016776040196418762, -0.015608144924044609, 0.04168207570910454, 0.008818059228360653, -0.011271543800830841, 0.05366884171962738, -0.04262363538146019, 0.023430325090885162, 0.0031868137884885073, -0.0024738546926528215, 0.005409435369074345, -0.0177809726446867, 0.00322076422162354, -0.04320305585861206, -0.0355619452893734, 0.0031732337083667517, -0.016042711213231087, 0.05895605683326721, -0.0010485025122761726, -0.021619634702801704, -0.019790837541222572, -0.05884741619229317, -0.015282221138477325, 0.04497753083705902, -0.03371504321694374, 0.017799079418182373, 0.04026973992586136, 0.0022995758336037397, -0.028156224638223648, -0.04950425773859024, 0.06011489778757095, 0.054537974298000336, -0.011968659237027168, -0.02270604856312275, 0.01474806759506464, 0.019102776423096657, 0.038748759776353836, 0.035598158836364746, -0.04972153902053833, -0.013290462084114552, 0.036032725125551224, 0.006011489778757095, 0.013245195150375366, 0.03429446369409561, -0.0018129530362784863, 0.022416338324546814, -0.030365265905857086, 0.013906097039580345, 0.07445555925369263, -0.017364514991641045, -0.006473215762525797, -0.08568183332681656, 0.03251998871564865, -0.02093157358467579, 0.04081294685602188, -0.05587788298726082, 0.002962741069495678, 0.02594718337059021, 0.03277348354458809, -0.03192245960235596, 0.0013399104354903102, 0.05290835350751877, 0.010909405536949635, 0.07275351136922836, 0.027775980532169342, -0.014213914051651955, -0.0075822630897164345, -0.02692495658993721, -0.01809784397482872, 0.05866634473204613, -0.0261282529681921, -0.11501500755548477, 0.03835040703415871, -0.05073552578687668, 0.05508118122816086, 0.002978584496304393, 0.030709296464920044, -0.008818059228360653, 0.011027100495994091, -0.04005245491862297, -0.0034584172535687685, -0.06257743388414383, 0.060440823435783386, -0.03194056451320648, -0.03561626747250557, 0.019754623994231224, 0.06934941560029984, 0.022144734859466553, -0.05424826219677925, 0.03337101265788078, 0.022017987444996834, -0.012448491528630257, -0.05957169085741043, 0.0542844757437706, 0.015119259245693684, 0.03460228070616722, -0.030365265905857086, -0.023394111543893814, 0.041935574263334274, -0.012919271364808083, 0.08111889660358429, -0.00530984764918685, -0.033914219588041306, -0.001971388468518853, -0.03454795852303505, 0.0009924842743203044, 0.041754502803087234, 0.06826300173997879, 0.009080609306693077, -0.0034584172535687685, 0.005327954422682524, -0.051423586905002594, 0.06471405178308487, -0.040957801043987274, -0.0005511287017725408, 0.02567557990550995, -0.03632243722677231, -0.023249255493283272, -0.004766640719026327, 0.010692122392356396, 0.0030510120559483767, 0.03438499569892883, -0.016395796090364456, 0.06040460988879204, 0.025096159428358078, -0.002387847052887082, -0.009596655145287514, 0.005509023554623127, -0.0020834249444305897, -0.042877133935689926, -0.007645637262612581, -0.046860650181770325, -0.009551388211548328, -0.06482268869876862, -0.006246879696846008, 0.03087225928902626, -0.015173579566180706, -0.021130748093128204, 0.01712912507355213, -0.018206484615802765, 0.0261282529681921, 0.0301117692142725, 0.035054951906204224, -0.04200800135731697, -0.027160344645380974, 0.010474840179085732, -0.002095873234793544, -0.05131494626402855, -0.09321430325508118, -0.00577610032632947, 0.012638614512979984, -0.05823178216814995, 0.008129997178912163, -0.019845159724354744, 0.009949740022420883, 0.014485517516732216, 0.05761614814400673, -0.012584293261170387, -0.05069931223988533, -0.03166896477341652, 0.0025440191384404898, -0.053596414625644684, -0.051387373358011246, 0.05877498909831047, 0.04396354779601097, -0.07445555925369263, 0.02647228352725506, -0.01326330192387104, 0.01569868065416813, -0.007423827890306711, -0.03925575315952301, -0.0375174917280674, 0.046100158244371414, -0.013652600347995758, -0.01020323671400547, 0.007677324116230011, 0.01708385720849037, 0.0018661420326679945, -0.04048702120780945, 0.0027997789438813925, -0.03708292543888092, -0.051387373358011246, 0.038205552846193314, 0.09169332683086395, -0.028645111247897148, -0.03304508700966835, -0.03099900856614113, 0.01554477121680975, 0.061672091484069824, -0.08111889660358429, -0.009949740022420883, 0.005830420646816492, -0.13333919644355774, -0.011036153882741928, -0.02710602432489395, -0.006523009855300188, -0.034348782151937485, -0.037553705275058746, -0.06522104144096375, 0.0006614676094613969, 0.0009732457110658288, 0.016332421451807022, -0.006138238124549389, 0.03409528732299805, 0.003965410403907299, -0.03246566653251648, 0.0029287906363606453, 0.00882711261510849, -0.03154221549630165, 0.0017337354365736246, -0.001547008054330945, -0.05834042280912399, 0.02683442085981369, 0.06293957680463791, -0.0024127440992742777, -0.01177853625267744, 0.037589918822050095, -0.019138989970088005, 0.030147982761263847, -0.01086413860321045, -0.005744413007050753, 0.013806508854031563, 0.03188624605536461, 0.04519481584429741, -0.026146359741687775, -0.06138237938284874, -0.01782624050974846, 0.04591909050941467, 0.025711793452501297, -0.01271104160696268, 0.011769482865929604, -0.03730020672082901, -0.012222155928611755, -0.05113387852907181, -0.004698739852756262, -0.03762613236904144, -0.002510068705305457, -0.0221809484064579, 0.03534466400742531, 0.010013113729655743, 0.019501127302646637, -0.06398977339267731, -0.07239137589931488, 0.009841098450124264, 0.004820961505174637, 0.031035222113132477, 0.020370259881019592, -0.016703613102436066, -0.031125755980610847, 0.02071429044008255, 0.04577423632144928, -0.06808193027973175, 0.04990260675549507, 0.007840286009013653, -0.0007367243524640799, -0.04928697273135185, -0.0192476324737072, 0.017862454056739807, 0.015218846499919891, 0.019627876579761505, -0.044325683265924454, -0.07728023827075958, -0.10712040215730667, 0.007862919941544533, -0.003336195833981037, -0.021655848249793053, -0.01199581939727068, -0.0769905298948288, 0.036883749067783356, -0.023357897996902466, 0.022289590910077095, -0.0015334278577938676, -0.008999127894639969, 0.009306944906711578, -0.05051824450492859, 0.031904350966215134, 0.01095467247068882, 0.013380996882915497, -0.0867682471871376, 0.017147231847047806, 0.052184078842401505, 0.05667458847165108, 0.0017869244329631329, -0.047041717916727066, -0.014739014208316803, -0.0020540012046694756, -0.01348058506846428, 0.02089536003768444, -0.019591663032770157, 0.03429446369409561, -0.01760895736515522, -0.01606081798672676, -0.02071429044008255, 0.006812720093876123, -0.008818059228360653, -0.0023923737462610006, 0.026943063363432884, -0.043492767959833145, -0.03329858183860779, -0.010492946952581406, -0.02808379754424095, 0.021438566967844963, 0.018478088080883026, 0.04226149618625641, 0.009795831516385078, 0.01681225374341011, 0.027069810777902603, -0.012086354196071625, 0.0007044714875519276, 0.014032845385372639, 0.04896105080842972, -0.020352153107523918, -0.06572803854942322, 0.06685066223144531, 0.012620506808161736, 0.007709011435508728, -0.0033769363071769476, 0.02328546904027462, 0.03299076482653618, -0.006663338281214237, -0.05265485495328903, 0.017527475953102112, -0.0005013347254134715, -0.061273738741874695, -0.03903846815228462, -0.024915089830756187, -0.03317183628678322, 0.062070444226264954, 0.027486270293593407, 0.03340722620487213, 0.04396354779601097, 0.03215784952044487, -0.004825488198548555 ]
716,620
pytorch_optimizer.optimizer.fromage
__str__
null
def __str__(self) -> str: return 'Fromage'
(self) -> str
[ 0.01290901843458414, -0.029166096821427345, 0.015532241202890873, -0.040349312126636505, 0.0011314806761220098, -0.050462525337934494, 0.06188735365867615, -0.019812235608696938, 0.06057574227452278, -0.07469282299280167, -0.04438769444823265, -0.026594648137688637, -0.015955062583088875, 0.02785448543727398, 0.00045922581921331584, 0.0006002563750371337, 0.01891481876373291, -0.07842055708169937, 0.01042385958135128, 0.004875397775322199, -0.0013202405534684658, 0.015532241202890873, 0.025783520191907883, -0.028303194791078568, -0.022866910323500633, 0.07310508191585541, -0.028907226398587227, -0.026249486953020096, -0.005237816832959652, 0.011165956035256386, -0.016524579375982285, -0.060092516243457794, 0.018742237240076065, -0.0018002298893406987, -0.0695154070854187, 0.020399009808897972, -0.051152847707271576, 0.009250312112271786, -0.017637722194194794, 0.02497239224612713, 0.01584288664162159, 0.023470941931009293, -0.022901427000761032, -0.024385618045926094, -0.02826867811381817, -0.04866768792271614, -0.022539008408784866, 0.03158222511410713, 0.01749102957546711, 0.0029058235231786966, 0.005669267848134041, 0.021244654431939125, -0.03358415886759758, -0.040004149079322815, -0.030391419306397438, 0.003395520383492112, 0.03460238128900528, 0.008227773010730743, -0.005557090509682894, 0.05936767905950546, -0.04279995337128639, -0.021123848855495453, 0.019415302202105522, -0.07030928134918213, -0.021952234208583832, 0.006148178596049547, 0.007960273884236813, 0.0339120589196682, 0.03197915852069855, 0.03134061023592949, 0.0338430292904377, -0.03541351109743118, 0.015670305117964745, 0.063751220703125, 0.012934905476868153, -0.019225463271141052, -0.1117631047964096, 0.03945189341902733, -0.0004794500709977001, -0.04235124588012695, 0.0598854199051857, -0.0002069617185043171, -0.027543840929865837, -0.022314652800559998, -0.010484262369573116, -0.06416541337966919, -0.0328248031437397, -0.0560886487364769, -0.009802569635212421, 0.012374019250273705, -0.04569930583238602, 0.014453613199293613, -0.017283933237195015, 0.015307886525988579, -0.00856861937791109, -0.0039671934209764, 0.007757491432130337, -0.017189012840390205, 0.02902803383767605, 0.04200608283281326, 0.0032056819181889296, 0.05898800119757652, -0.023626264184713364, 0.012960792519152164, -0.057434774935245514, -0.02759561501443386, -0.04866768792271614, 0.010941601358354092, 0.031185287982225418, 0.01713723875582218, -0.06419993191957474, -0.014539903961122036, 0.013996275141835213, 0.023401910439133644, 0.0063595897518098354, -0.03703576698899269, -0.008055192418396473, 0.013530307449400425, 0.022608039900660515, -0.05415574833750725, 0.03273851424455643, 0.005820275750011206, -0.040728986263275146, -0.02706061489880085, 0.039969634264707565, 0.073243148624897, -0.05218832939863205, -0.0385199598968029, 0.04362833872437477, -0.03541351109743118, 0.022763362154364586, -0.011830390430986881, -0.047770269215106964, -0.04535414278507233, 0.08925861120223999, -0.01913917250931263, 0.019052881747484207, 0.025679972022771835, 0.05940219387412071, 0.13668371737003326, -0.011709583923220634, 0.03696673363447189, 0.060817353427410126, -0.009267570450901985, -0.012235954403877258, -0.002366509521380067, -0.019760461524128914, 0.08325280994176865, -0.03446431830525398, 0.005009147804230452, 0.014721113257110119, 0.07393346726894379, 0.044974468648433685, -0.0018476895056664944, 0.02921787090599537, 0.006501968950033188, -0.017689496278762817, -0.06461412459611893, 0.023747071623802185, -0.04003866761922836, 0.0006407049368135631, -0.01000966690480709, -0.000456259585916996, -0.019121915102005005, -0.0025304609443992376, 0.030374160036444664, -0.005129954311996698, 0.008374466560781002, 0.030305128544569016, 0.03700124844908714, -0.06451057642698288, -0.07010218501091003, -0.05670993775129318, 0.018397076055407524, 0.007231120951473713, 0.04376640543341637, 0.017154498025774956, 0.09112247824668884, 0.03786415234208107, 0.019156429916620255, 0.00704128248617053, -0.010561924427747726, -0.06357864290475845, 0.03161673992872238, 0.07089605182409286, -0.06413089483976364, 0.014444984495639801, 0.020295461639761925, 0.014712483622133732, -0.015575386583805084, 0.007567652966827154, 0.015230225399136543, -0.029959967359900475, 0.006130920723080635, -0.00812853965908289, -0.0319446437060833, -0.003514169482514262, -0.048805754631757736, -0.008016361854970455, 0.04493995010852814, -0.001315925968810916, 0.04939252510666847, -0.055432841181755066, 0.018138205632567406, 0.038036733865737915, 0.029252387583255768, -0.012339502573013306, -0.009768053889274597, -0.0041462453082203865, -0.058953482657670975, 0.046562206000089645, 0.0017344335792586207, -0.025369327515363693, 0.01290901843458414, 0.03603480011224747, -0.058470260351896286, 0.005186042748391628, -0.0279752928763628, -0.01504901610314846, 0.043835435062646866, 0.09222699701786041, -0.02221110463142395, -0.025679972022771835, -0.06312993168830872, -0.00296191219240427, 0.024282069876790047, 0.009768053889274597, -0.013582081533968449, -0.006036001723259687, -0.0020450784359127283, 0.014427726157009602, -0.06623637676239014, -0.027336744591593742, 0.01227909978479147, 0.02845851704478264, 0.053845103830099106, -0.05205026641488075, 0.0059842271730303764, -0.1007179543375969, -0.03266948089003563, -0.007088742218911648, 0.021814169362187386, 0.007261322811245918, 0.018086431547999382, 0.045008983463048935, -0.07959410548210144, 0.0018347459845244884, 0.0036953790113329887, -0.056226711720228195, -0.01552361249923706, 0.04031479358673096, -0.056986067444086075, -0.0035724155604839325, 0.022677071392536163, -0.009155393578112125, -0.052706070244312286, -0.018276270478963852, 0.005289590917527676, 0.007269951980561018, 0.0007232200005091727, -0.057710904628038406, -0.013098856434226036, -0.06633992493152618, 0.018362561240792274, -0.017508286982774734, 0.03700124844908714, -0.037657056003808975, 0.00907773245126009, 0.0339120589196682, -0.024126747623085976, 0.10658568888902664, -0.012356760911643505, -0.05871187150478363, 0.0385199598968029, -0.030063515529036522, -0.043904468417167664, -0.0193290114402771, 0.02763013169169426, -0.09781860560178757, -0.06071380525827408, -0.031133513897657394, -0.022349169477820396, 0.003906790167093277, -0.009233054704964161, -0.015118048526346684, -0.06540799140930176, 0.02331561967730522, 0.003945620730519295, 0.0024118118453770876, 0.004590640310198069, 0.0522918775677681, -0.026128681376576424, -0.021693363785743713, 0.006739266682416201, 0.034895770251750946, 0.021348202601075172, 0.048840269446372986, 0.053845103830099106, -0.028665613383054733, -0.029286904260516167, 0.0027677591424435377, -0.0004255186941009015, -0.016645384952425957, -0.018673205748200417, -0.03456786647439003, -0.011528374627232552, -0.003540056524798274, -0.010777649469673634, 0.0006973329000174999, 0.00847801472991705, -0.02259078249335289, 0.010113215073943138, 0.012494824826717377, 0.05180865153670311, 0.004320983309298754, 0.06430348008871078, -0.01963965594768524, 0.011942567303776741, 0.012555228546261787, 0.05070414021611214, -0.01796562597155571, 0.005643380805850029, -0.04552672430872917, -0.0037083225324749947, -0.011131439357995987, -0.013219662941992283, -0.0655115395784378, 0.06654702126979828, 0.038865119218826294, 0.04528511315584183, -0.034930285066366196, -0.025231262668967247, 0.04894381761550903, -0.008106967434287071, -0.03814028203487396, 0.006350961048156023, 0.032496899366378784, -0.001379564986564219, -0.04476737231016159, 0.006061888765543699, 0.08843022584915161, -0.027647389099001884, -0.045043498277664185, 0.009397005662322044, 0.05443187803030014, 0.027336744591593742, -0.050876718014478683, -0.010303053073585033, 0.04932349547743797, 0.01470385491847992, -0.04739059507846832, 0.013254178687930107, 0.024385618045926094, -0.018552398309111595, 0.001761399325914681, -0.011735470965504646, -0.006989508401602507, 0.059678323566913605, -0.0066918074153363705, 0.03565512225031853, -0.0026340093463659286, -0.07441668957471848, 0.003041730495169759, 0.003667334793135524, -0.027319487184286118, 0.0011422669049352407, 0.034239962697029114, -0.01656772382557392, 0.048115432262420654, -0.02854480780661106, -0.017913851886987686, 0.01516119297593832, -0.038865119218826294, 0.0009820907143875957, -0.030270611867308617, 0.04956510663032532, 0.03273851424455643, 0.03789866715669632, -0.04556123912334442, 0.016110384836792946, 0.04286898672580719, 0.00858587771654129, 0.015946434810757637, 0.055467359721660614, 0.007464104797691107, -0.015489095821976662, 0.01917368918657303, 0.0022715902887284756, -0.01455716136842966, -0.011631922796368599, 0.02005384862422943, -0.023332877084612846, -0.022539008408784866, -0.0032315689604729414, -0.03127158060669899, -0.07469282299280167, -0.033221736550331116, -0.04666575416922569, -0.04052188992500305, 0.017413368448615074, 0.027008840814232826, -0.01565304771065712, -0.019052881747484207, -0.009802569635212421, -0.04514704644680023, 0.06847992539405823, -0.008771401830017567, -0.001375250518321991, -0.049668654799461365, 0.012650147080421448, 0.01409982331097126, -0.02645658329129219, -0.04911639913916588, -0.03161673992872238, 0.08325280994176865, -0.00006660527287749574, 0.0045216078869998455, -0.03696673363447189, -0.006105033680796623, -0.010320311412215233, -0.014246516861021519, 0.052360910922288895, 0.00858587771654129, 0.07103411853313446, 0.01974320411682129, 0.04949607700109482, 0.0037579394411295652, 0.032082706689834595, 0.10292698442935944, 0.00811128132045269, -0.00042875457438640296, -0.0026620535645633936, -0.0328248031437397, -0.013901355676352978, 0.041902534663677216, -0.022797878831624985, 0.011165956035256386, -0.04701091721653938, -0.017413368448615074, 0.03197915852069855, 0.039589956402778625, -0.048909302800893784, 0.05494961887598038, 0.040763504803180695, 0.0028411056846380234, -0.06440702825784683, -0.03199641779065132, 0.012158293277025223, 0.024316586554050446, -0.013875468634068966, 0.001568324863910675, 0.03009803220629692, -0.029079807922244072, -0.03789866715669632, 0.04984123632311821, -0.013047082349658012, 0.011821761727333069, -0.0580560676753521, -0.013538937084376812, 0.008029305376112461, -0.045043498277664185, 0.06561508774757385, -0.04787381738424301, 0.04438769444823265, 0.002018112689256668, 0.01644691824913025, -0.0046467287465929985, 0.004051326308399439, -0.05135994404554367, 0.00551394559442997, 0.03032238595187664, -0.02148626744747162, -0.003535742172971368, -0.03548254072666168, -0.030874643474817276, 0.05916057899594307, -0.025783520191907883, -0.0071275727823376656, 0.014954096637666225, -0.02949400059878826, -0.018207238987088203, -0.03349786624312401, 0.01422925852239132, 0.0735883042216301, -0.02554190717637539, 0.038727056235075, -0.014867806807160378, 0.030650289729237556, -0.04707995057106018, 0.0020612578373402357, 0.007912813685834408, 0.006320759188383818, -0.05439735949039459, -0.03876157104969025, -0.02933867834508419, 0.039624471217393875, -0.012607002630829811, 0.011985712684690952, -0.08166506886482239, 0.03562060743570328, -0.013297324068844318, -0.02274610474705696, 0.017465142533183098, 0.0016600082162767649, 0.03358415886759758, 0.0033610044047236443, 0.02990819327533245, 0.0035012259613722563, -0.0014130024937912822, -0.01913917250931263, 0.030460450798273087, -0.03793318569660187, 0.025144971907138824, 0.023332877084612846, -0.0030503596644848585, -0.026128681376576424, -0.016101757064461708, 0.027302227914333344, -0.005483744200319052, 0.01428966224193573, 0.01571345143020153, -0.035378992557525635, -0.029735613614320755, -0.06423444300889969, 0.0006924790795892477, 0.015005870722234249, -0.03494754433631897, 0.011631922796368599, -0.022642556577920914, 0.07469282299280167, 0.02341916784644127, 0.03168577328324318, 0.022262878715991974, 0.04355930909514427, -0.02448916621506214, 0.058194130659103394, -0.08739474415779114, -0.0006261434755288064, 0.015031757764518261, 0.03707028180360794, 0.01275369618088007, -0.050428010523319244, -0.020071107894182205, -0.002096852520480752, 0.03555157408118248, -0.03253141790628433, -0.025455618277192116, 0.014954096637666225, 0.004892656113952398, 0.016938772052526474, -0.024834327399730682, -0.03558608889579773, -0.0250931978225708, -0.04276543855667114, 0.013504420407116413, 0.03153045102953911, -0.02145175077021122, 0.025334810838103294, 0.06029961258172989, -0.009241683408617973, -0.004879712592810392, -0.014505387283861637, 0.07206960022449493, 0.05522574484348297, -0.0011994341621175408, 0.042454794049263, -0.04487092047929764, 0.04673478752374649, -0.004187233280390501, -0.04663123935461044, 0.01089845597743988, -0.06627089530229568, 0.008102652616798878, 0.048874784260988235, -0.04680382087826729, 0.056951552629470825, 0.02297045849263668, 0.05163607373833656, -0.005630437284708023, 0.0522918775677681, -0.02664642222225666, 0.04949607700109482, -0.0017258045263588428, -0.04942704364657402, -0.02971835434436798, 0.015454580076038837, -0.020226430147886276, 0.012926275841891766, 0.04704543203115463, -0.038416408002376556, -0.030011741444468498, 0.010208133608102798, -0.04431866109371185, -0.0232293289154768, 0.03548254072666168, -0.08201023191213608, 0.00729583902284503, -0.05329284444451332, 0.009284828789532185, -0.0034149358980357647, 0.05526026338338852, 0.04514704644680023, 0.011752729304134846, 0.040798019617795944, 0.05218832939863205, 0.06468315422534943, 0.01666264235973358, 0.021141106262803078, -0.021589815616607666, 0.02978738769888878, -0.01364248525351286, -0.01590328849852085, 0.0028864082414656878, -0.01619667559862137, -0.026698196306824684, 0.01150248758494854, 0.05173962190747261, -0.04169543832540512, -0.037311896681785583, 0.021538041532039642, -0.012296357192099094, 0.04531962797045708, -0.02008836530148983, 0.04556123912334442, -0.02718142233788967, 0.004914228338748217, 0.000684389378875494, -0.001290038926526904, 0.03047770820558071, -0.09919925034046173, 0.020071107894182205, 0.006355275399982929, 0.01364248525351286, -0.06547702848911285, -0.04856413975358009, 0.001634121173992753, 0.022193847224116325, 0.0299772247672081, -0.036897700279951096, 0.01669715903699398, -0.032997384667396545, 0.0042282212525606155, -0.07124121487140656, 0.03710479661822319, -0.04866768792271614, 0.006501968950033188, -0.07621152698993683, -0.035154640674591064, -0.02278061956167221, -0.06150767579674721, -0.00037671078462153673, 0.007291524205356836, 0.008357208222150803, 0.03893415257334709, -0.018276270478963852, -0.01546320877969265, 0.0038204998709261417, 0.031064482405781746, -0.016533207148313522, -0.014548532664775848, -0.006545113865286112, -0.02940770983695984, 0.025006908923387527, -0.022711588069796562, 0.07890378683805466, 0.0319446437060833, -0.025956101715564728, -0.048184461891651154, 0.006010114215314388, -0.007166403345763683, -0.005293905735015869, 0.05954025685787201, 0.012805470265448093, -0.05294768512248993, -0.024799812585115433, 0.005915195215493441, 0.03130609542131424, 0.008163055405020714, 0.06385476887226105, -0.045768335461616516, 0.041522856801748276, -0.014548532664775848, -0.0013083756202831864, -0.07193153351545334, 0.014539903961122036, 0.07565927505493164, -0.0635441243648529, 0.03772608935832977, 0.039175763726234436, -0.03327351063489914, -0.06364767253398895, -0.05836671218276024, -0.030236097052693367, 0.02892448380589485, 0.09795666486024857, 0.03786415234208107, -0.04897833243012428, -0.017793044447898865, -0.02528303675353527, -0.014091194607317448, 0.014453613199293613, 0.062405094504356384, -0.014522645622491837, -0.0019199575763195753, -0.006506283301860094, -0.05142897740006447, -0.012235954403877258, 0.011666438542306423, 0.0212273970246315, -0.03562060743570328, 0.05022091418504715, 0.037242863327264786, -0.03368770703673363, -0.024351103231310844, 0.055778004229068756, -0.058090582489967346, 0.04362833872437477, 0.051601555198431015, 0.002329836133867502, 0.021727880463004112, 0.022521749138832092, 0.025973359122872353, 0.01705094985663891, -0.03434351086616516, 0.030995450913906097, 0.06699573248624802, -0.01682659424841404, -0.03548254072666168, -0.0771779790520668, -0.007571967784315348, 0.03976253792643547, 0.038416408002376556, -0.009241683408617973, 0.006199953146278858, 0.018621431663632393, 0.00468124495819211, -0.014634822495281696, 0.015540869906544685, 0.09374570101499557, 0.02861383929848671, 0.019242720678448677, 0.059678323566913605, -0.003384734271094203, -0.008827490732073784, 0.029286904260516167, 0.005902251694351435, 0.04870220646262169, 0.011666438542306423, -0.04221317917108536, 0.04376640543341637, 0.03907221555709839, 0.030374160036444664, 0.022090299054980278, -0.012097890488803387, -0.010234021581709385, -0.015394176356494427, -0.0021701992955058813, 0.015394176356494427, 0.00836583785712719, 0.02065788023173809, -0.007623741868883371, -0.006980879697948694, 0.02876916155219078, 0.0057210419327020645, 0.027319487184286118, 0.03620738163590431, -0.01860417239367962, 0.03755350783467293 ]
716,656
pytorch_optimizer.optimizer.gsam
GSAM
Surrogate Gap Guided Sharpness-Aware Minimization. Example: ------- Here's an example:: model = YourModel() base_optimizer = AdamP(model.parameters()) lr_scheduler = LinearScheduler(base_optimizer, t_max=num_total_steps) rho_scheduler = ProportionScheduler(lr_scheduler, max_lr=max_lr) optimizer = GSAM(model.parameters(), base_optimizer, model, rho_scheduler) def loss_fn(predictions, targets): return F.cross_entropy(predictions, targets) for inputs, targets in data: optimizer.set_closure(loss_fn, inputs, targets) predictions, loss = optimizer.step() lr_scheduler.step() optimizer.update_rho_t() :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param base_optimizer: Optimizer. base optimizer. :param model: nn.Module. model. :param alpha: float. rho alpha. :param rho_scheduler: rho scheduler. :param adaptive: bool. element-wise Adaptive SAM. :param perturb_eps: float. epsilon for perturbation. :param kwargs: Dict. parameters for optimizer.
class GSAM(Optimizer, BaseOptimizer): r"""Surrogate Gap Guided Sharpness-Aware Minimization. Example: ------- Here's an example:: model = YourModel() base_optimizer = AdamP(model.parameters()) lr_scheduler = LinearScheduler(base_optimizer, t_max=num_total_steps) rho_scheduler = ProportionScheduler(lr_scheduler, max_lr=max_lr) optimizer = GSAM(model.parameters(), base_optimizer, model, rho_scheduler) def loss_fn(predictions, targets): return F.cross_entropy(predictions, targets) for inputs, targets in data: optimizer.set_closure(loss_fn, inputs, targets) predictions, loss = optimizer.step() lr_scheduler.step() optimizer.update_rho_t() :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param base_optimizer: Optimizer. base optimizer. :param model: nn.Module. model. :param alpha: float. rho alpha. :param rho_scheduler: rho scheduler. :param adaptive: bool. element-wise Adaptive SAM. :param perturb_eps: float. epsilon for perturbation. :param kwargs: Dict. parameters for optimizer. """ def __init__( self, params: PARAMETERS, base_optimizer: OPTIMIZER, model: nn.Module, rho_scheduler, alpha: float = 0.4, adaptive: bool = False, perturb_eps: float = 1e-12, **kwargs, ): self.validate_range(alpha, 'alpha', 0.0, 1.0) self.model = model self.rho_scheduler = rho_scheduler self.alpha = alpha self.adaptive = adaptive self.perturb_eps = perturb_eps self.rho_t: float = 0.0 self.forward_backward_func: Optional[Callable] = None if hasattr(ReduceOp, 'AVG'): self.grad_reduce = ReduceOp.AVG self.manual_average: bool = False else: # PyTorch <= 1.11.0 does not have AVG, need to manually average across processes self.grad_reduce = ReduceOp.SUM self.manual_average: bool = True self.base_optimizer = base_optimizer self.param_groups = self.base_optimizer.param_groups defaults: DEFAULTS = {'adaptive': adaptive} defaults.update(kwargs) super().__init__(params, defaults) self.update_rho_t() def __str__(self) -> str: return 'GSAM' @torch.no_grad() def reset(self): pass @torch.no_grad() def update_rho_t(self) -> float: self.rho_t = self.rho_scheduler.step() return self.rho_t @torch.no_grad() def perturb_weights(self, rho: float): grad_norm = self.grad_norm(weight_adaptive=self.adaptive) for group in self.param_groups: scale = rho / (grad_norm + self.perturb_eps) for p in group['params']: if p.grad is None: continue self.state[p]['old_g'] = p.grad.clone() e_w = (torch.pow(p, 2) if self.adaptive else 1.0) * p.grad * scale.to(p) p.add_(e_w) # climb to the local maximum "w + e(w)" self.state[p]['e_w'] = e_w @torch.no_grad() def un_perturb(self): for group in self.param_groups: for p in group['params']: if 'e_w' in self.state[p]: p.sub_(self.state[p]['e_w']) @torch.no_grad() def gradient_decompose(self, alpha: float = 0.0): inner_prod = 0.0 for group in self.param_groups: for p in group['params']: if p.grad is None: continue inner_prod += torch.sum(self.state[p]['old_g'] * p.grad) new_grad_norm = self.grad_norm(by=None) old_grad_norm = self.grad_norm(by='old_g') cosine = inner_prod / (new_grad_norm * old_grad_norm + self.perturb_eps) # gradient decomposition for group in self.param_groups: for p in group['params']: if p.grad is None: continue vertical = self.state[p]['old_g'] - cosine * old_grad_norm * p.grad / ( new_grad_norm + self.perturb_eps ) p.grad.add_(vertical, alpha=-alpha) @torch.no_grad() def sync_grad(self): if is_initialized(): for group in self.param_groups: for p in group['params']: if p.grad is None: continue all_reduce(p.grad, op=self.grad_reduce) if self.manual_average: p.grad.div_(float(get_world_size())) @torch.no_grad() def grad_norm(self, by: Optional[str] = None, weight_adaptive: bool = False) -> torch.Tensor: return torch.norm( torch.stack( [ ((torch.abs(p) if weight_adaptive else 1.0) * (p.grad if not by else self.state[p][by])).norm(p=2) for group in self.param_groups for p in group['params'] if p.grad is not None ] ), p=2, ) def maybe_no_sync(self): return self.model.no_sync() if is_initialized() else ExitStack() @torch.no_grad() def set_closure(self, loss_fn: nn.Module, inputs: torch.Tensor, targets: torch.Tensor, **kwargs): r"""Set closure. Create `self.forward_backward_func`, which is a function such that `self.forward_backward_func()` automatically performs forward and backward passes. This function does not take any arguments, and the inputs and targets data should be pre-set in the definition of partial-function. :param loss_fn: nn.Module. loss function. :param inputs: torch.Tensor. inputs. :param targets: torch.Tensor. targets. """ def get_grad(): self.base_optimizer.zero_grad() with torch.enable_grad(): outputs = self.model(inputs) loss = loss_fn(outputs, targets, **kwargs) loss.backward() return outputs, loss.detach() self.forward_backward_func = get_grad @torch.no_grad() def step(self, closure: CLOSURE = None) -> Tuple[torch.Tensor, float]: get_grad = closure if closure else self.forward_backward_func with self.maybe_no_sync(): outputs, loss = get_grad() self.perturb_weights(rho=self.rho_t) disable_running_stats(self.model) get_grad() self.gradient_decompose(self.alpha) self.un_perturb() self.sync_grad() self.base_optimizer.step() enable_running_stats(self.model) return outputs, loss def load_state_dict(self, state_dict: Dict): super().load_state_dict(state_dict) self.base_optimizer.param_groups = self.param_groups
(params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], base_optimizer: Type[torch.optim.optimizer.Optimizer], model: torch.nn.modules.module.Module, rho_scheduler, alpha: float = 0.4, adaptive: bool = False, perturb_eps: float = 1e-12, **kwargs)
[ -0.010680017992854118, -0.03977009281516075, -0.03035200946033001, 0.022856878116726875, -0.007921241223812103, -0.0012202808866277337, -0.06551139801740646, -0.03175051882863045, -0.023162800818681717, -0.0419989675283432, -0.03564012050628662, -0.011931028217077255, 0.025216860696673393, 0.05594034865498543, -0.043856360018253326, 0.050652239471673965, -0.018300797790288925, 0.04719967022538185, 0.01220417395234108, -0.052575189620256424, -0.03928935527801514, -0.08544014394283295, -0.014487676322460175, 0.05484776571393013, -0.0594366230070591, -0.04081897437572479, 0.028778687119483948, -0.02853832021355629, -0.03275569900870323, 0.008057814091444016, 0.0008460704702883959, -0.05314333364367485, 0.00588903296738863, 0.005465656518936157, 0.05899958685040474, -0.03684196621179581, 0.017634321004152298, 0.0430915504693985, -0.1003430038690567, -0.024998344480991364, -0.011854547075927258, -0.06756545603275299, 0.027511289343237877, -0.008582254871726036, 0.029106464236974716, 0.02281317487359047, -0.005910884588956833, 0.06096624210476875, -0.018847091123461723, 0.0014381149085238576, 0.033170878887176514, -0.055415909737348557, 0.002698684809729457, 0.023949462920427322, -0.006735786329954863, 0.06935729086399078, 0.07634983956813812, -0.005547600332647562, 0.06420028954744339, -0.0843912661075592, 0.0710180252790451, -0.05816922336816788, 0.022638360038399696, -0.027751658111810684, -0.0017986679449677467, -0.025391675531864166, -0.043135255575180054, -0.01592988893389702, 0.02079189196228981, 0.030264602974057198, -0.006375233177095652, -0.032187554985284805, 0.034766051918268204, 0.0063479188829660416, -0.0044932556338608265, -0.032733846455812454, -0.020704485476017, -0.055765535682439804, 0.007806519512087107, -0.057863298803567886, 0.029630905017256737, 0.01167973317205906, -0.03574937954545021, -0.019775787368416786, -0.05323074012994766, -0.04479598253965378, 0.017459508031606674, -0.0430915504693985, 0.0031165985856205225, -0.07416466623544693, -0.0005268307868391275, 0.00842929258942604, 0.038153067231178284, 0.055634427815675735, 0.0538862906396389, 0.024561310186982155, -0.05489146709442139, -0.04772411286830902, -0.004394922871142626, -0.06564250588417053, 0.006998006720095873, 0.027511289343237877, 0.023315763100981712, 0.06035439297556877, 0.03904898837208748, -0.04995298385620117, -0.010303076356649399, -0.019808566197752953, 0.021381888538599014, -0.035377901047468185, -0.04532042518258095, 0.002473339205607772, -0.04553894326090813, -0.028800539672374725, -0.017142659053206444, -0.009134010411798954, -0.02270391583442688, 0.010374094359576702, -0.022660212591290474, 0.019557271152734756, 0.026790183037519455, 0.03467864543199539, -0.07516984641551971, -0.021360035985708237, 0.014083419926464558, 0.033061619848012924, 0.0384371392428875, 0.011264551430940628, 0.011592326685786247, -0.032187554985284805, -0.028800539672374725, 0.02558833919465542, -0.01952449418604374, 0.01686951145529747, 0.03609900549054146, -0.033782728016376495, -0.006375233177095652, 0.015132301487028599, 0.003097478300333023, 0.02512945421040058, 0.012968983501195908, 0.036557894200086594, 0.004343025386333466, 0.0072875418700277805, 0.07333430647850037, 0.0022739425767213106, 0.053624071180820465, 0.005036816466599703, 0.004924826789647341, -0.012280655093491077, 0.021360035985708237, 0.012783244252204895, 0.023053543642163277, 0.02512945421040058, -0.02355613186955452, 0.011723436415195465, -0.027554992586374283, 0.024146128445863724, -0.028691280633211136, -0.01804950274527073, -0.055852942168712616, -0.044730428606271744, -0.03247162699699402, -0.03428531810641289, 0.004039832856506109, -0.006096624303609133, 0.028997205197811127, 0.028713133186101913, -0.021370962262153625, 0.021032260730862617, -0.017907466739416122, -0.08277423679828644, -0.022201325744390488, 0.05196334049105644, 0.00543834175914526, 0.11782436072826385, 0.03699492663145065, 0.006566435564309359, -0.021185223013162613, -0.02163318172097206, 0.05856255441904068, -0.024255385622382164, -0.030898302793502808, -0.05283740907907486, 0.0011922833509743214, 0.052138153463602066, 0.006621065083891153, -0.022966135293245316, 0.0181259848177433, 0.02120707370340824, 0.007036247290670872, -0.015984518453478813, 0.00274375407025218, 0.0008569963392801583, 0.025085750967264175, 0.014280085451900959, 0.01696784421801567, 0.014673416502773762, 0.06677879393100739, 0.025741301476955414, -0.00636430736631155, -0.011013256385922432, 0.01410527154803276, 0.0020895686466246843, -0.04138711839914322, -0.03343309834599495, -0.00723837548866868, 0.04851077124476433, 0.016585439443588257, 0.023162800818681717, -0.032733846455812454, 0.0054328786209225655, 0.03795640170574188, 0.07263504713773727, 0.05143890157341957, -0.060747724026441574, 0.031772371381521225, 0.055634427815675735, 0.06354474276304245, -0.002439195988699794, -0.014553232118487358, -0.02864757739007473, -0.012346209958195686, -0.019469864666461945, 0.03725714609026909, -0.033891987055540085, 0.0008979682461358607, -0.04042564332485199, 0.006113012786954641, -0.028734983876347542, 0.03332384303212166, -0.04824855178594589, -0.012826947495341301, 0.0073093934915959835, 0.05760107934474945, 0.01940430887043476, -0.021775217726826668, 0.00522528775036335, -0.035705678164958954, -0.04409673064947128, -0.035902343690395355, -0.00011523356806719676, -0.035705678164958954, 0.02694314531981945, -0.0001331587991444394, -0.012105841189622879, 0.058387741446495056, 0.06734693795442581, -0.011581400409340858, 0.031051265075802803, -0.02810128591954708, -0.019491715356707573, -0.061578087508678436, 0.027030551806092262, -0.09544822573661804, -0.04191156104207039, 0.035705678164958954, 0.04816114529967308, 0.019163940101861954, -0.038655657321214676, -0.017131732776761055, -0.06590472161769867, -0.06542398780584335, 0.06258326768875122, 0.03511568158864975, 0.009161325171589851, 0.03553086146712303, -0.021993735805153847, 0.010865757241845131, 0.022987987846136093, 0.12420506030321121, 0.064986951649189, -0.08714457601308823, -0.0022916970774531364, -0.016738401725888252, 0.020944854244589806, -0.002339497674256563, 0.010751035995781422, 0.03690752014517784, -0.00020946902805007994, 0.06966321915388107, -0.0356619730591774, -0.05358036607503891, -0.02325020730495453, -0.012750466354191303, 0.05143890157341957, -0.013067316263914108, -0.041212305426597595, 0.05528479814529419, 0.019174866378307343, 0.028144989162683487, -0.0033924763556569815, 0.048204850405454636, -0.02652796357870102, 0.11100663244724274, -0.0000560376574867405, -0.010374094359576702, 0.025916116312146187, -0.023796500638127327, -0.021360035985708237, 0.09352527558803558, -0.005659590009599924, 0.015744149684906006, -0.0039141857996582985, -0.022660212591290474, -0.03618641570210457, 0.014618786983191967, -0.0013479767367243767, 0.011887324042618275, -0.017437655478715897, -0.0026413241866976023, -0.009614747948944569, 0.015995444729924202, 0.034634944051504135, 0.013220278546214104, -0.055109985172748566, 0.00965298805385828, -0.03778158873319626, 0.02440834790468216, 0.06529287993907928, -0.04951595142483711, 0.03435087203979492, 0.02375279739499092, 0.01549285463988781, -0.02059522643685341, -0.02567574754357338, 0.018847091123461723, 0.03841528668999672, -0.05611516535282135, -0.018967274576425552, -0.06433140486478806, -0.008505773730576038, 0.022113919258117676, 0.021469295024871826, -0.046194493770599365, 0.010636314749717712, 0.05432332307100296, 0.0068013411946594715, 0.02716166153550148, -0.06621064990758896, 0.061796605587005615, 0.053929995745420456, -0.03107311576604843, 0.04324451461434364, -0.02311909757554531, -0.060747724026441574, 0.013023613020777702, 0.008522163145244122, 0.023425022140145302, -0.028276098892092705, 0.0012755929492413998, 0.01568952016532421, -0.0371478870511055, 0.0996437519788742, 0.06730323284864426, 0.024233534932136536, -0.00009679619688540697, -0.012936205603182316, 0.029150167480111122, -0.06546769291162491, 0.009308824315667152, 0.004659874830394983, -0.06227734312415123, 0.05419221520423889, 0.07259134203195572, -0.007888463325798512, -0.024976491928100586, -0.027292773127555847, 0.03242792189121246, -0.057469967752695084, 0.0015077672433108091, -0.06354474276304245, 0.006730323191732168, 0.017055250704288483, -0.03806566074490547, -0.009090307168662548, -0.019382458180189133, -0.012182322330772877, 0.027074255049228668, 0.011832695454359055, 0.05165741592645645, -0.012739541009068489, 0.009336138144135475, 0.026921292766928673, 0.03319273144006729, -0.030177196487784386, 0.043113403022289276, -0.025937967002391815, 0.028887946158647537, -0.07787945866584778, 0.04188970848917961, -0.0016129285795614123, 0.02683388628065586, 0.023927610367536545, -0.031772371381521225, 0.03682011365890503, 0.031772371381521225, 0.06699731200933456, -0.05462924763560295, -0.027533141896128654, -0.013143797405064106, -0.0754757672548294, -0.0025812319945544004, 0.025216860696673393, 0.0013288564514368773, -0.09536081552505493, 0.07901574671268463, 0.054585546255111694, 0.023403169587254524, 0.06446251273155212, -0.03319273144006729, -0.005034085363149643, -0.06660398095846176, 0.027183514088392258, 0.008074202574789524, -0.0127286147326231, -0.0020322080235928297, 0.004200989380478859, 0.010068170726299286, 0.044621169567108154, 0.04615078866481781, 0.018595796078443527, 0.031466446816921234, 0.02056244947016239, 0.015460077673196793, -0.017546914517879486, -0.04698115214705467, 0.0026631758082658052, -0.06323881447315216, 0.00718920910730958, -0.02142559178173542, -0.008407440967857838, -0.016159331426024437, -0.04575745761394501, -0.03472235053777695, 0.004457746632397175, 0.007981332950294018, 0.048641882836818695, 0.05528479814529419, 0.003365161595866084, 0.036120858043432236, -0.012280655093491077, -0.018814312294125557, -0.016257664188742638, 0.0008658735896460712, -0.019284125417470932, 0.00922688003629446, -0.0014108003815636039, -0.03684196621179581, 0.008931881748139858, 0.016093777492642403, 0.0131000941619277, 0.017109880223870277, -0.008778920397162437, -0.007730038836598396, 0.0024583162739872932, 0.0076699466444551945, -0.0421956330537796, -0.03435087203979492, -0.0026058151852339506, -0.010559833608567715, 0.031969036906957626, -0.027642399072647095, 0.02056244947016239, -0.013657311908900738, 0.03985749930143356, 0.08146313577890396, -0.014596935361623764, -0.040141571313142776, -0.0015869797207415104, -0.005356397945433855, -0.01740487851202488, 0.017240989953279495, -0.040906380861997604, -0.03668900206685066, -0.016793031245470047, -0.0392238013446331, 0.034438278526067734, 0.008571329526603222, -0.027620548382401466, 0.04829225689172745, -0.04955965280532837, 0.030701637268066406, 0.06926988810300827, 0.01762339472770691, 0.023949462920427322, 0.041955262422561646, 0.006211345549672842, -0.0009990324033424258, 0.033367544412612915, -0.05899958685040474, -0.0646810308098793, 0.05602775886654854, 0.03786899521946907, -0.06293289363384247, 0.011756214313209057, 0.02386205643415451, -0.008642347529530525, 0.0680461898446083, -0.01633414439857006, 0.03498456999659538, -0.0004541056405287236, -0.06730323284864426, -0.01697877049446106, 0.038240473717451096, -0.021720590069890022, -0.05515369027853012, 0.019065607339143753, -0.06026698648929596, 0.03893972933292389, -0.019240422174334526, -0.027620548382401466, 0.01962282508611679, 0.008188924752175808, -0.0020636199042201042, -0.028560170903801918, 0.017765430733561516, 0.025850560516119003, 0.015984518453478813, -0.05244407802820206, 0.0181259848177433, 0.03024275228381157, -0.01677117869257927, 0.009669376537203789, 0.017645247280597687, 0.04846706986427307, 0.003266829065978527, -0.02239799126982689, 0.04746188968420029, -0.011603252030909061, 0.007757353130728006, 0.017361175268888474, 0.033476803451776505, 0.058300334960222244, 0.02556648850440979, -0.024146128445863724, 0.0029718310106545687, -0.0725039392709732, -0.08338608592748642, -0.04298229143023491, -0.014793600887060165, -0.007855686359107494, 0.02630944550037384, 0.01124269887804985, 0.005146075040102005, 0.018475612625479698, 0.01410527154803276, 0.005435610190033913, -0.048641882836818695, -0.026353148743510246, -0.06214623153209686, 0.011144367046654224, -0.016585439443588257, -0.007156431674957275, 0.03170681744813919, 0.013449721038341522, -0.02716166153550148, 0.023097246885299683, -0.005236213561147451, 0.03022089973092079, -0.03775973618030548, -0.04075342044234276, -0.0032395145390182734, -0.03985749930143356, -0.026790183037519455, 0.04055675491690636, 0.04855447635054588, 0.006877822335809469, -0.025632042437791824, 0.0105489082634449, -0.005998291540890932, -0.009379842318594456, -0.0181259848177433, -0.00997530110180378, -0.04324451461434364, 0.018945423886179924, 0.04405302554368973, -0.03168496489524841, -0.024583160877227783, -0.05908699333667755, 0.07407726347446442, -0.04580116271972656, -0.020868372172117233, 0.00456427363678813, -0.014760822989046574, 0.056071460247039795, -0.063588447868824, 0.06476843357086182, 0.0076972609385848045, 0.00442496920004487, -0.00013179305824451149, 0.020201895385980606, -0.01602822169661522, -0.07066839933395386, -0.007828371599316597, 0.04145267233252525, -0.0672595277428627, 0.012411764822900295, 0.044511910527944565, 0.041518229991197586, -0.06315141171216965, 0.0104505755007267, 0.05545961111783981, -0.00480191083624959, -0.0009662548545747995, -0.017535988241434097, 0.005987365730106831, 0.011843620799481869, 0.01740487851202488, -0.03380458056926727, -0.03682011365890503, -0.01931690238416195, 0.00437580281868577, -0.029150167480111122, -0.03955157473683357, -0.024058720096945763, -0.05126408487558365, 0.01177806593477726, 0.08596458286046982, 0.011887324042618275, -0.014618786983191967, 0.011625103652477264, -0.021906329318881035, 0.006167642306536436, 0.009669376537203789, -0.026287594810128212, 0.038349732756614685, -0.082817941904068, -0.015940815210342407, -0.04210822284221649, -0.052007045596838, -0.04022897779941559, 0.009904283098876476, 0.008686050772666931, 0.039726387709379196, -0.029871273785829544, 0.0330834724009037, 0.05187593400478363, -0.05344925820827484, -0.04306969791650772, -0.01887986809015274, 0.023075394332408905, 0.0101282624527812, 0.007271152921020985, -0.026003522798419, -0.009407156147062778, 0.011920101940631866, 0.012510097585618496, 0.04296044260263443, 0.013733793050050735, -0.011668807826936245, 0.04973446950316429, -0.04899150878190994, -0.014094346202909946, 0.0021305407863110304, 0.03679826110601425, -0.000030472878279397264, 0.005187047179788351, 0.023315763100981712, -0.012914353981614113, 0.0009676205809228122, -0.00041620657430030406, 0.01983041688799858, 0.017240989953279495, -0.03535604849457741, -0.004028907045722008, -0.01900005340576172, 0.007833833806216717, 0.019480789080262184, 0.007822908461093903, -0.08203127980232239, -0.024757975712418556, -0.04149637743830681, -0.019131163135170937, 0.00411358242854476, -0.01688043773174286, 0.04129971191287041, -0.03577123209834099, -0.050652239471673965, 0.00283798947930336, 0.03701677918434143, 0.04628190025687218, -0.012247877195477486, 0.0202565249055624, 0.04855447635054588, -0.002476070774719119, -0.020201895385980606, -0.027926471084356308, 0.0324934758245945, -0.0076754093170166016, -0.032952360808849335, -0.013985087163746357, 0.03419790789484978, 0.0026194725651293993, 0.03832788020372391, -0.07018765807151794, -0.032952360808849335, -0.05165741592645645, 0.016694698482751846, -0.052793703973293304, -0.020944854244589806, -0.02864757739007473, -0.041321564465761185, 0.012881577014923096, 0.02748943865299225, 0.04829225689172745, 0.014345640316605568, -0.02162225730717182, 0.02556648850440979, -0.022944284602999687, 0.015973592177033424, -0.006599212996661663, 0.002493825275450945, 0.04223933443427086, 0.025741301476955414, -0.01730654574930668, 0.00971308071166277, -0.011756214313209057, -0.014280085451900959, 0.02735832706093788, -0.004760939162224531, 0.008713365532457829, 0.05218185856938362, 0.00011139245179947466, -0.037803441286087036, -0.021283555775880814, 0.03054867498576641, -0.026243891566991806, 0.009931596927344799, -0.005763385910540819, 0.039726387709379196, 0.01993967592716217, -0.014826377853751183, 0.028909798711538315, 0.019120236858725548, -0.01194195356220007, 0.06638546288013458, 0.03673270717263222, -0.0668661966919899, 0.040054164826869965, -0.0013090533902868629, 0.03841528668999672, -0.03319273144006729, -0.040119718760252, 0.000747737823985517, 0.04580116271972656, -0.02694314531981945, -0.02683388628065586, 0.038655657321214676, -0.060004767030477524, 0.09833264350891113, 0.01362453494220972, 0.03216570243239403, 0.021807996556162834, 0.05008409544825554, -0.042173780500888824, 0.012400839477777481, -0.026178335770964622, -0.07442688941955566, -0.09876967966556549, -0.011570475064218044, -0.012586578726768494, 0.04741818830370903, 0.01257565338164568, 0.015787852928042412, 0.011286403052508831, 0.01749228499829769, 0.010871220380067825 ]
716,658
pytorch_optimizer.optimizer.gsam
__init__
null
def __init__( self, params: PARAMETERS, base_optimizer: OPTIMIZER, model: nn.Module, rho_scheduler, alpha: float = 0.4, adaptive: bool = False, perturb_eps: float = 1e-12, **kwargs, ): self.validate_range(alpha, 'alpha', 0.0, 1.0) self.model = model self.rho_scheduler = rho_scheduler self.alpha = alpha self.adaptive = adaptive self.perturb_eps = perturb_eps self.rho_t: float = 0.0 self.forward_backward_func: Optional[Callable] = None if hasattr(ReduceOp, 'AVG'): self.grad_reduce = ReduceOp.AVG self.manual_average: bool = False else: # PyTorch <= 1.11.0 does not have AVG, need to manually average across processes self.grad_reduce = ReduceOp.SUM self.manual_average: bool = True self.base_optimizer = base_optimizer self.param_groups = self.base_optimizer.param_groups defaults: DEFAULTS = {'adaptive': adaptive} defaults.update(kwargs) super().__init__(params, defaults) self.update_rho_t()
(self, params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], base_optimizer: Type[torch.optim.optimizer.Optimizer], model: torch.nn.modules.module.Module, rho_scheduler, alpha: float = 0.4, adaptive: bool = False, perturb_eps: float = 1e-12, **kwargs)
[ -0.019418053328990936, -0.009257105179131031, -0.031799737364053726, 0.018125461414456367, -0.003423428162932396, 0.006856575142592192, -0.0670982226729393, -0.027542924508452415, -0.07806096225976944, -0.009893682785332203, 0.0015136946458369493, 0.0269792377948761, 0.018057430163025856, 0.05858459696173668, -0.05496922507882118, 0.042762480676174164, 0.015783242881298065, 0.04182948172092438, -0.00013196234067436308, -0.02476336434483528, -0.028048299252986908, -0.06904196739196777, -0.028903549537062645, 0.06721484661102295, -0.021186865866184235, 0.013178618624806404, -0.017814461141824722, -0.020409366115927696, -0.03422942012548447, 0.0032096158247441053, 0.02678486332297325, -0.012702400796115398, -0.006453247275203466, 0.049410101026296616, 0.06130584701895714, -0.004754896275699139, -0.007454277947545052, 0.061577972024679184, -0.12486644089221954, 0.056174349039793015, 0.016337212175130844, -0.09827595204114914, 0.05252010002732277, -0.018718304112553596, 0.007915918715298176, -0.017036961391568184, 0.05112060159444809, 0.04692210257053375, 0.029408924281597137, -0.04412310570478439, -0.026473863050341606, -0.03685348480939865, 0.028437050059437752, -0.023247240111231804, -0.054891474545001984, 0.06826446950435638, 0.05131497606635094, 0.02274186536669731, 0.0269792377948761, -0.014014431275427341, 0.01146811991930008, -0.05115947499871254, 0.014957149513065815, -0.022664114832878113, 0.018164334818720818, -0.045989103615283966, -0.08148196339607239, -0.01939861662685871, -0.013256369158625603, 0.0286314245313406, 0.0470387302339077, 0.00007216927770059556, 0.0016801281599327922, 0.00862052757292986, 0.018310116603970528, -0.019213959574699402, -0.041401855647563934, -0.04839935153722763, -0.04315122961997986, -0.02149786613881588, 0.05131497606635094, 0.029739361256361008, -0.04552260413765907, -0.005641731899231672, -0.053530849516391754, -0.08684670925140381, -0.016813429072499275, -0.05823472514748573, 0.011351495049893856, -0.0018234796589240432, -0.03508467227220535, -0.011788838542997837, 0.015384774655103683, -0.00572434114292264, 0.05730172246694565, 0.04769960418343544, -0.01969989761710167, -0.036620233207941055, 0.005296716466546059, -0.06923634558916092, -0.044006481766700745, 0.06398822367191315, -0.00905787106603384, 0.02711530029773712, 0.0109724635258317, -0.04664997756481171, -0.051431600004434586, -0.025968488305807114, 0.01071005780249834, -0.028573112562298775, -0.058118097484111786, 0.06663171947002411, -0.0671759694814682, 0.007274481002241373, -0.025054926052689552, -0.011166838929057121, -0.023402739316225052, -0.00006419687269954011, 0.015044618397951126, -0.0008698277524672449, 0.012673243880271912, 0.06775909662246704, -0.05458047613501549, 0.015229274518787861, -0.004375865217298269, 0.015452805906534195, 0.012945368885993958, -0.017726991325616837, -0.018358711153268814, -0.04820497706532478, -0.02021499164402485, -0.0015246282564476132, -0.012867619283497334, 0.007731262128800154, 0.032907672226428986, -0.03840848430991173, -0.004135326016694307, 0.0337434858083725, -0.03906935825943947, 0.022042114287614822, 0.02425798960030079, 0.04431748017668724, 0.01514180563390255, -0.01551111787557602, 0.010525401681661606, 0.005369606893509626, 0.025268739089369774, -0.003885068465024233, 0.003287365660071373, -0.007259903009980917, 0.0018684288952499628, 0.026298925280570984, 0.01958327181637287, 0.028339862823486328, 0.008416433818638325, 0.009951995685696602, 0.002006920985877514, -0.015958180651068687, 0.005719481967389584, -0.009811073541641235, -0.07125784456729889, 0.03675629571080208, 0.0035036078188568354, -0.052675601094961166, -0.03730054572224617, -0.03053629770874977, -0.040041230618953705, -0.01583183743059635, -0.016968930140137672, 0.01466558687388897, -0.018834928050637245, -0.06760359555482864, 0.00004494919994613156, 0.035920482128858566, -0.0438121035695076, 0.08272596448659897, 0.0355122946202755, 0.011973494663834572, -0.008921808563172817, 0.006997496820986271, 0.06651509553194046, -0.025268739089369774, -0.015637461096048355, -0.06099484860897064, 0.005806950386613607, 0.02781504951417446, -0.011030776426196098, 0.012342806905508041, -0.00691002793610096, 0.026143426075577736, 0.02983654849231243, -0.009767339564859867, -0.014840524643659592, -0.017445148900151253, -0.016920335590839386, 0.012838463298976421, 0.04649448022246361, -0.038194671273231506, 0.023499926552176476, 0.04528935253620148, 0.022664114832878113, -0.0040551465936005116, 0.002004491165280342, 0.02900073677301407, 0.007021793629974127, -0.03976910561323166, -0.011264026165008545, 0.05310322716832161, 0.0017433000029996037, 0.008042261935770512, -0.023830363526940346, 0.0007604918209835887, 0.02058430388569832, 0.05714622512459755, 0.0052335443906486034, -0.05329760164022446, 0.006249153520911932, 0.0502653531730175, 0.08000471442937851, -0.01479193102568388, 0.020234428346157074, 0.0007756773848086596, 0.007420262321829796, -0.011225150898098946, 0.020895302295684814, -0.0016461125342175364, 0.029059048742055893, -0.03185804933309555, -0.015443086624145508, 0.005884700454771519, 0.021731115877628326, -0.061577972024679184, -0.04921572655439377, 0.00005455405334942043, 0.050615228712558746, 0.052014727145433426, -0.04260697960853577, 0.03796141967177391, -0.10993845015764236, -0.04497835412621498, 0.016706524416804314, 0.026726549491286278, 0.006064497400075197, -0.023538801819086075, 0.008421293459832668, -0.04089648276567459, 0.03619260713458061, 0.04513385519385338, -0.06476572155952454, -0.015919305384159088, -0.016551023349165916, -0.023422176018357277, -0.04284023120999336, 0.039263732731342316, -0.06445471942424774, -0.029681049287319183, 0.02311117760837078, 0.0054959505796432495, 0.018980709835886955, -0.007527168374508619, -0.014966867864131927, -0.05621322616934776, -0.019466647878289223, 0.0641048476099968, 0.022411426529288292, -0.0008831910090520978, -0.033821236342191696, 0.004473052453249693, 0.03279104828834534, 0.02178942784667015, 0.1486579328775406, 0.01658017933368683, -0.0126246502622962, -0.00256817857734859, 0.007692387327551842, -0.006326903589069843, -0.060178473591804504, -0.003938521724194288, -0.005262700840830803, 0.008027683943510056, 0.02557973749935627, -0.05096510052680969, -0.03316035866737366, -0.02620173804461956, -0.006006184965372086, 0.010156089439988136, -0.014228243380784988, 0.006511559709906578, -0.0016874171560630202, 0.011166838929057121, 0.006147106643766165, 0.011127963662147522, 0.03300486132502556, -0.00017782267241273075, 0.08614695817232132, -0.03310204669833183, -0.005452216137200594, 0.05220910161733627, 0.022702990099787712, -0.0009056656272150576, 0.0803157165646553, -0.02260580286383629, 0.002730967476963997, -0.012634369544684887, -0.03846679627895355, -0.012206744402647018, 0.007600059267133474, 0.06569872051477432, 0.03739773482084274, -0.007906199432909489, 0.07922721654176712, 0.014694742858409882, 0.02958386205136776, 0.042568106204271317, 0.01804771088063717, -0.048749227076768875, 0.0011097592068836093, -0.04762185364961624, 0.010914151556789875, 0.05458047613501549, -0.04260697960853577, 0.056757472455501556, 0.011856869794428349, 0.006399794016033411, -0.0470387302339077, -0.03308260813355446, 0.018533647060394287, 0.05982859805226326, -0.07712796330451965, 0.01671624183654785, -0.035220734775066376, 0.0372033566236496, 0.011613900773227215, 0.019631866365671158, -0.07961596548557281, -0.0018052569357678294, 0.044045355170965195, 0.048632603138685226, 0.013800619170069695, -0.012634369544684887, 0.06196672096848488, 0.026396112516522408, 0.005296716466546059, 0.03545398265123367, -0.009329996071755886, -0.08241496235132217, 0.00619084108620882, -0.03279104828834534, 0.03368517383933067, -0.060100723057985306, -0.033607423305511475, 0.048632603138685226, -0.04987660050392151, 0.04964335262775421, 0.05158710107207298, 0.016667649149894714, -0.04824385419487953, -0.031138861551880836, 0.030594611540436745, -0.051431600004434586, -0.011681932024657726, 0.007021793629974127, -0.06935296952724457, 0.03564835712313652, 0.021225741133093834, -0.021186865866184235, -0.009524370543658733, -0.015005743131041527, 0.07044146955013275, -0.04023560509085655, 0.004801060538738966, -0.03477367013692856, 0.014908555895090103, 0.011681932024657726, -0.0003088738885708153, 0.01240111980587244, -0.04455072805285454, -0.019787365570664406, 0.04781622812151909, -0.02062317728996277, 0.0435788556933403, -0.01501546148210764, 0.05158710107207298, -0.019719334319233894, -0.010204683057963848, -0.039633043110370636, 0.031216610223054886, 0.013567368499934673, 0.03403504565358162, -0.031624797731637955, 0.032577235251665115, -0.02149786613881588, 0.02274186536669731, -0.002828154945746064, -0.011438963934779167, 0.036989547312259674, 0.05730172246694565, 0.023383302614092827, -0.06534884870052338, -0.043345604091882706, 0.01308143138885498, -0.047466352581977844, 0.027173612266778946, 0.041324105113744736, 0.01675511710345745, -0.055513475090265274, 0.05846797302365303, 0.02880636230111122, 0.03685348480939865, 0.061616845428943634, 0.028398174792528152, 0.012595494277775288, -0.0569518506526947, 0.031138861551880836, -0.024705050513148308, -0.01786305382847786, 0.046066854149103165, -0.044783979654312134, 0.03582329675555229, 0.00452893553301692, 0.03407392278313637, 0.035959359258413315, 0.021847739815711975, 0.01277043204754591, 0.04956560209393501, 0.007143278140574694, -0.006132528651505709, 0.028087174519896507, -0.012323369272053242, -0.045328229665756226, -0.04451185464859009, 0.019602710381150246, 0.00011001923849107698, -0.014762774109840393, -0.00457509933039546, 0.012838463298976421, 0.02760123834013939, -0.0018319835653528571, 0.019048741087317467, 0.0038947872817516327, 0.028242673724889755, -0.0401967316865921, 0.00988396443426609, -0.027737298980355263, -0.03578441962599754, 0.011516713537275791, 0.02664880082011223, -0.001999631989747286, -0.06896422058343887, 0.01943749189376831, 0.03378235921263695, 0.009373730048537254, 0.045328229665756226, -0.004322411958128214, -0.03189692273736, -0.026065675541758537, 0.0065067000687122345, -0.006773965898901224, 0.006871153134852648, -0.015044618397951126, -0.0036275216843932867, 0.039963480085134506, -0.024083051830530167, -0.04641672968864441, -0.05189810320734978, 0.054774850606918335, 0.09819820523262024, -0.028320424258708954, -0.02591017633676529, -0.006059637758880854, 0.012478869408369064, -0.012167869135737419, 0.014199087396264076, -0.048788104206323624, -0.06247209757566452, 0.022625239565968513, -0.0016473273281008005, -0.002288764575496316, 0.03943866863846779, -0.052714474499225616, 0.04416197910904884, -0.035220734775066376, 0.05185922607779503, 0.07246296852827072, -0.003525475040078163, 0.03380179777741432, 0.004745177458971739, 0.00808599591255188, 0.03685348480939865, 0.04486173018813133, -0.05644647404551506, -0.021653365343809128, 0.03887498378753662, 0.06663171947002411, 0.004013841971755028, 0.00784302782267332, 0.0387389212846756, 0.05508584901690483, 0.06445471942424774, 0.005068325903266668, 0.046844352036714554, -0.018650272861123085, -0.03325754776597023, -0.028048299252986908, -0.010321307927370071, 0.0039360919035971165, -0.06880871951580048, 0.010525401681661606, -0.07219084352254868, 0.022061552852392197, 0.01807686686515808, -0.01701752282679081, -0.045989103615283966, -0.01823236607015133, -0.034346047788858414, -0.03391842171549797, -0.01951524056494236, 0.01804771088063717, 0.0036007952876389027, -0.030186424031853676, 0.03267442435026169, 0.04501723125576973, 0.006239434704184532, 0.0009305698913522065, -0.011050214059650898, 0.0502653531730175, 0.019602710381150246, 0.0053841848857700825, 0.0670982226729393, 0.01225533802062273, 0.006837137509137392, -0.02186717838048935, -0.015025180764496326, 0.033024296164512634, 0.023169489577412605, 0.0009967788355425, -0.00714813731610775, -0.028495362028479576, -0.0353567972779274, -0.04237373173236847, -0.008678839541971684, 0.014500368386507034, 0.03090561181306839, -0.030400237068533897, 0.02227536402642727, -0.026959801092743874, -0.00905787106603384, 0.060800474137067795, -0.03805860877037048, 0.017260491847991943, -0.028825799003243446, -0.022800177335739136, -0.050731852650642395, 0.02653217501938343, -0.01398527529090643, 0.033199235796928406, -0.017357679083943367, -0.024530114606022835, 0.01973877288401127, 0.03730054572224617, -0.019748490303754807, -0.03498748317360878, 0.005811810027807951, 0.04054660722613335, -0.029486674815416336, 0.014986305497586727, 0.02752348780632019, -0.012809306383132935, -0.021070240065455437, 0.01807686686515808, -0.008814902044832706, -0.052053600549697876, -0.0435011051595211, -0.01697864942252636, -0.030380798503756523, 0.0006262516835704446, -0.003829185850918293, 0.0007702105795033276, -0.04210160672664642, -0.008989839814603329, 0.023752614855766296, -0.05940097197890282, -0.02384980209171772, -0.027504049241542816, -0.021303489804267883, 0.00595273170620203, -0.047349728643894196, 0.03961360827088356, -0.002526873955503106, -0.02616286277770996, -0.011186276562511921, 0.04237373173236847, -0.015958180651068687, -0.03485142067074776, -0.02005949057638645, -0.0004546550626400858, -0.08840171247720718, -0.038233544677495956, 0.04890472814440727, 0.04089648276567459, -0.06200559809803963, -0.001976549858227372, 0.038933295756578445, -0.013023119419813156, 0.004929833579808474, -0.06480459868907928, -0.015132087282836437, 0.05384185165166855, -0.009271683171391487, -0.03531792014837265, 0.01720217987895012, -0.02462730184197426, 0.009845089167356491, 0.010068620555102825, -0.01343130599707365, -0.05897334963083267, -0.04552260413765907, -0.0009020210709422827, 0.10884995013475418, 0.020700927823781967, -0.00594301288947463, 0.024374613538384438, 0.009825651533901691, 0.016959210857748985, -0.024782801046967506, -0.005389044526964426, 0.05314210057258606, -0.1341964453458786, 0.011108526028692722, -0.016657929867506027, -0.007177293766289949, -0.011380651034414768, -0.023091739043593407, 0.0018295538611710072, 0.003676115535199642, -0.049332354217767715, 0.014966867864131927, 0.06600972265005112, 0.01547224260866642, -0.06950847059488297, 0.023985864594578743, 0.013168900273740292, 0.004375865217298269, -0.013314681127667427, 0.01672596111893654, 0.002444264478981495, -0.019204242154955864, 0.030069798231124878, 0.04039110615849495, 0.03840848430991173, -0.004028419964015484, 0.008547636680305004, -0.08008246123790741, 0.027776174247264862, -0.008202621713280678, 0.056796349585056305, 0.019505523145198822, 0.00931541807949543, 0.05325872451066971, 0.0024673466105014086, -0.008576792664825916, -0.00483264634385705, -0.0013083860976621509, 0.022722426801919937, 0.011623620055615902, -0.024530114606022835, -0.06185009703040123, -0.012187306769192219, -0.028534237295389175, -0.0011194780236110091, -0.03755323216319084, -0.008479605428874493, -0.04952672868967056, 0.005568841006606817, 0.02256692759692669, 0.03417110815644264, -0.030108673498034477, -0.031099986284971237, -0.0504986010491848, -0.014597555622458458, 0.07036371529102325, 0.009432042948901653, -0.021361803635954857, -0.03947754576802254, 0.03411279618740082, -0.012099837884306908, -0.047427479177713394, 0.042723607271909714, -0.01072949543595314, -0.06196672096848488, -0.06663171947002411, 0.01992342807352543, 0.01687174290418625, -0.006142247002571821, 0.03685348480939865, -0.06593196839094162, -0.08638021349906921, -0.044084228575229645, 0.0005199529114179313, -0.014850242994725704, -0.005865262821316719, -0.0020470106974244118, -0.06554321944713593, 0.03069179877638817, -0.0008643609471619129, 0.04322898015379906, -0.0030686939135193825, 0.022955676540732384, 0.0030492565128952265, -0.057457223534584045, 0.04182948172092438, 0.049993228167295456, 0.01939861662685871, -0.009859667159616947, 0.013810337521135807, 0.06130584701895714, 0.03490973263978958, -0.0011152260703966022, -0.024821676313877106, 0.016920335590839386, 0.005267560016363859, -0.026551613584160805, 0.0570295974612236, 0.005675747524946928, 0.013013400137424469, -0.05908997356891632, -0.007789574563503265, 0.025307614356279373, 0.026959801092743874, -0.015938742086291313, 0.04591135308146477, 0.028359299525618553, -0.012712119147181511, -0.0002182162133976817, 0.042023856192827225, -0.018766896799206734, 0.03805860877037048, 0.005675747524946928, -0.021225741133093834, 0.07292946428060532, 0.017911648377776146, 0.005617435090243816, -0.045328229665756226, -0.04163510724902153, 0.032538361847400665, 0.04291798174381256, -0.02491886354982853, -0.028786923736333847, 0.09065645933151245, -0.01811574213206768, 0.023383302614092827, 0.004220365080982447, 0.06954734027385712, 0.038194671273231506, 0.05290885269641876, -0.05197585001587868, 0.03498748317360878, -0.0033311001025140285, -0.05912884697318077, -0.08521395921707153, -0.020409366115927696, -0.06628184765577316, 0.04455072805285454, 0.018144898116588593, -0.008873214945197105, 0.014840524643659592, 0.04913797602057457, 0.0026313504204154015 ]
716,661
pytorch_optimizer.optimizer.gsam
__str__
null
def __str__(self) -> str: return 'GSAM'
(self) -> str
[ 0.05245975777506828, -0.02448582462966442, 0.022828109562397003, 0.001823917613364756, 0.00039041548734530807, -0.06509982794523239, -0.011906188912689686, 0.008711635135114193, 0.09117429703474045, -0.043238718062639236, -0.03419036045670509, -0.01614544913172722, -0.013391224667429924, 0.01961628720164299, 0.017716823145747185, 0.015446100383996964, -0.019737163558602333, -0.053910255432128906, 0.022793574258685112, -0.01968535967171192, 0.01565331406891346, 0.019426342099905014, 0.0036758955102413893, -0.010645635426044464, -0.011845751665532589, 0.04575982689857483, 0.021550288423895836, -0.01687069796025753, -0.050732970237731934, -0.020427877083420753, 0.02208559215068817, -0.08033008128404617, 0.0018724835244938731, -0.0005687600933015347, -0.032532647252082825, -0.007865509949624538, -0.020047985017299652, -0.017682287842035294, -0.074459008872509, -0.0075417375192046165, -0.012605536729097366, 0.00257506943307817, -0.006367523223161697, -0.007446764037013054, 0.0035809222608804703, -0.007265451829880476, 0.014910796657204628, 0.06354571878910065, -0.01066290307790041, 0.01639583148062229, 0.01444456446915865, 0.008163380436599255, -0.07224871963262558, -0.00644954526796937, -0.0337759330868721, 0.02686878852546215, 0.05207986384630203, 0.0061603086069226265, 0.008655514568090439, 0.022189198061823845, -0.00024863018188625574, -0.019702626392245293, 0.04945514723658562, -0.02959711104631424, -0.00148503587115556, 0.045967042446136475, -0.02755950391292572, 0.040095970034599304, 0.036020755767822266, 0.026661574840545654, 0.04265161231160164, -0.035606324672698975, -0.032532647252082825, 0.020876841619610786, 0.017259225249290466, 0.020427877083420753, -0.09372993558645248, -0.013175376690924168, 0.0026074466295540333, -0.04227171838283539, 0.02887186035513878, 0.0111809391528368, 0.006829438265413046, -0.003619774943217635, -0.022241001948714256, -0.061853472143411636, -0.003764393273741007, -0.05024946853518486, -0.03688414767384529, -0.013080403208732605, -0.015109376981854439, -0.014513636007905006, -0.005547299515455961, 0.08785887062549591, -0.030097877606749535, -0.021792037412524223, -0.028992734849452972, -0.04330779239535332, -0.024192269891500473, -0.008867045864462852, 0.012139304541051388, 0.025660037994384766, -0.03234269842505455, 0.038403719663619995, -0.023622430860996246, -0.023985056206583977, -0.01825212687253952, 0.006320036482065916, 0.012467394582927227, 0.015169814229011536, -0.055257149040699005, 0.03543364629149437, 0.046070646494627, -0.011811215430498123, 0.038749076426029205, -0.06437458097934723, 0.042237184941768646, 0.026350753381848335, 0.02757677063345909, -0.008875679224729538, -0.008353326469659805, 0.01890830509364605, -0.029424432665109634, 0.03520916402339935, 0.040061432868242264, 0.08088265359401703, -0.021774770691990852, -0.01861475221812725, 0.017224689945578575, -0.059332363307476044, 0.06962400674819946, 0.03163471817970276, -0.03995782509446144, -0.03681507706642151, 0.06727557629346848, -0.027006931602954865, 0.06023029237985611, 0.003160018241032958, 0.04638146981596947, 0.14311601221561432, -0.023311609402298927, 0.00499904528260231, 0.0163612961769104, 0.0014688472729176283, 0.012769581750035286, 0.029372628778219223, -0.011578099802136421, 0.02344975247979164, -0.006868291180580854, -0.02339794859290123, 0.03691868111491203, 0.0346565917134285, 0.04821186140179634, -0.0037967704702168703, -0.05515354126691818, -0.0012756631476804614, -0.0023980739060789347, 0.004925656598061323, 0.028422895818948746, -0.006173259578645229, -0.009100161492824554, -0.033171556890010834, -0.027749449014663696, -0.015333859249949455, 0.0026527747977524996, -0.00834469310939312, 0.007256818003952503, 0.04120111092925072, -0.009186500683426857, -0.021774770691990852, -0.025988128036260605, -0.053254079073667526, -0.09462786465883255, 0.0091174291446805, 0.04410211369395256, 0.01478992123156786, 0.0063502551056444645, 0.09656187146902084, 0.02652343176305294, -0.017604582011699677, 0.013080403208732605, -0.009324643760919571, -0.058054544031620026, 0.03892175480723381, 0.049075257033109665, -0.027628574520349503, 0.031876467168331146, 0.03681507706642151, 0.01668938621878624, -0.023829646408557892, 0.03270532563328743, 0.01858021691441536, -0.0592978298664093, -0.009065626189112663, 0.02030700258910656, -0.027317753061652184, 0.0072309160605072975, -0.049765970557928085, -0.06233697012066841, 0.028768252581357956, -0.01927093043923378, 0.01999618113040924, -0.055602505803108215, 0.0055386656895279884, 0.03605528920888901, -0.018856501206755638, 0.04500003904104233, -0.030460502952337265, 0.004124859813600779, -0.02234460972249508, 0.005292598623782396, -0.000046306191507028416, 0.003915486857295036, 0.03760939836502075, 0.040475860238075256, -0.08088265359401703, 0.021895645186305046, 0.03381046652793884, 0.002480096183717251, 0.02237914502620697, 0.019754430279135704, -0.04227171838283539, -0.006695612333714962, -0.03198007494211197, -0.03850732743740082, 0.017388734966516495, 0.007856875658035278, -0.006764683872461319, -0.05553343519568443, -0.03306794911623001, 0.032498110085725784, -0.051078327000141144, 0.0038787927478551865, 0.027386823669075966, -0.03268805891275406, 0.01992710866034031, -0.0024002324789762497, -0.009514590725302696, -0.05346129089593887, -0.04175368323922157, -0.00369532173499465, 0.014038769528269768, -0.016948403790593147, 0.06910597532987595, 0.022517288103699684, -0.03344784304499626, -0.0210149846971035, 0.003511850954964757, -0.004610518459230661, -0.007597858086228371, 0.013589804992079735, -0.031496573239564896, -0.01479855552315712, -0.0008919928222894669, -0.014772653579711914, -0.059746790677309036, -0.061231829226017, 0.05677672103047371, 0.032221823930740356, -0.00032674026442691684, -0.06610136479139328, 0.00148503587115556, -0.06250964850187302, 0.043860360980033875, 0.04120111092925072, 0.06962400674819946, -0.011250009760260582, 0.030149681493639946, 0.03381046652793884, -0.030028806999325752, 0.10830400884151459, 0.041857291013002396, -0.06969308108091354, -0.0010463243816047907, -0.010619733482599258, -0.013788385316729546, -0.009367813356220722, 0.023570626974105835, -0.061749864369630814, -0.05090564861893654, 0.03267078846693039, -0.03964700549840927, 0.0054221078753471375, 0.03467386215925217, -0.0053573534823954105, 0.012225644662976265, 0.024900251999497414, -0.027473164722323418, 0.03451845049858093, 0.018096717074513435, 0.02859557420015335, 0.0059228758327662945, -0.018079448491334915, -0.00009321945981355384, 0.07874143868684769, 0.0020926487632095814, 0.05460096895694733, 0.02719687856733799, -0.013089037500321865, 0.009695902466773987, 0.03950886055827141, -0.006708563305437565, 0.010887385345995426, 0.0013220704859122634, -0.053150471299886703, 0.017699556425213814, -0.015877796337008476, 0.005055165849626064, 0.019150055944919586, 0.019357269629836082, -0.049351539462804794, 0.022586360573768616, 0.027455896139144897, 0.026264414191246033, 0.03363778814673424, 0.09918658435344696, 0.002834087470546365, 0.018062179908156395, 0.021602092310786247, 0.042789753526449203, -0.02519380673766136, 0.00558183528482914, 0.004180980380624533, -0.009583662264049053, 0.007805072236806154, -0.025953592732548714, -0.059435971081256866, 0.03657332435250282, 0.005327134393155575, 0.0041205426678061485, -0.0790867954492569, -0.012527831830084324, 0.03246357664465904, -0.0012583952629938722, -0.028647378087043762, 0.013149474747478962, 0.04859175533056259, -0.04855721816420555, -0.04928246885538101, -0.061784401535987854, 0.07328479737043381, -0.014297787100076675, -0.021757502108812332, 0.05069843307137489, 0.012217010371387005, 0.03543364629149437, -0.08537229895591736, -0.04634693264961243, -0.024675769731402397, 0.0013004856882616878, -0.013045867905020714, -0.0077489516697824, 0.03861093148589134, 0.03261898458003998, 0.05957411229610443, 0.01670665293931961, 0.009859947487711906, 0.04779743403196335, -0.027714913710951805, 0.043549541383981705, 0.02755950391292572, -0.035226430743932724, 0.006777634844183922, -0.0012141463812440634, -0.03439757600426674, -0.03234269842505455, 0.01203569769859314, 0.00051129050552845, 0.07438993453979492, -0.015031671151518822, -0.015480635687708855, 0.0039996677078306675, -0.032239094376564026, 0.002821136498823762, -0.04610518366098404, 0.08129707723855972, 0.04240986332297325, -0.004269478376954794, -0.08226408064365387, -0.040752146393060684, 0.037298575043678284, 0.015938233584165573, 0.015273421071469784, 0.040130503475666046, 0.04306603968143463, -0.02239641360938549, 0.01580009050667286, 0.01169034093618393, 0.021912913769483566, -0.02823294885456562, -0.00011918869859073311, -0.03719496726989746, 0.045310862362384796, 0.0011234900448471308, -0.05270150676369667, -0.032912541180849075, -0.04617425426840782, -0.01856294833123684, -0.03937071934342384, 0.042478933930397034, 0.02030700258910656, -0.07093636691570282, -0.030477771535515785, -0.00783529132604599, -0.03477746993303299, -0.03581354022026062, 0.019167324528098106, -0.022241001948714256, -0.026264414191246033, -0.009160599671304226, -0.011094599030911922, -0.012709144502878189, -0.07432086765766144, -0.06254418194293976, 0.04845361411571503, -0.022275539115071297, -0.042133577167987823, 0.011103233322501183, -0.015756921842694283, 0.04365314915776253, -0.042202647775411606, 0.03726404160261154, 0.01820032298564911, 0.043860360980033875, 0.03344784304499626, 0.0213085375726223, 0.0069891661405563354, 0.036469716578722, 0.029683450236916542, 0.006872607860714197, -0.0393361821770668, 0.043515004217624664, -0.022292805835604668, -0.014660412445664406, 0.021619359031319618, -0.007645344827324152, -0.007692831102758646, -0.02472757361829281, -0.03902536258101463, -0.01152629591524601, 0.04779743403196335, -0.048039183020591736, -0.015592876821756363, 0.01168170664459467, 0.06772454082965851, -0.06903690099716187, -0.07653114944696426, -0.007174795493483543, 0.08737536519765854, -0.0002905856817960739, -0.025919057428836823, 0.04296243190765381, -0.012009795755147934, -0.035260967910289764, 0.08005379140377045, -0.020393341779708862, 0.043894898146390915, -0.04361861199140549, -0.032843466848134995, -0.02034153789281845, -0.08537229895591736, 0.08247129619121552, -0.03510555624961853, 0.050802040845155716, 0.03023602068424225, 0.03396587818861008, 0.021412145346403122, 0.04610518366098404, -0.03657332435250282, -0.008785023353993893, 0.008785023353993893, 0.004437839612364769, -0.010231206193566322, -0.027127806097269058, -0.008379228413105011, 0.04955875501036644, -0.049040719866752625, 0.021481215953826904, -0.029838860034942627, -0.024554895237088203, -0.009471421130001545, -0.026368020102381706, -0.006250964943319559, 0.0721796527504921, 0.007183429319411516, 0.043860360980033875, 0.003988875541836023, -0.009911751374602318, -0.04883350431919098, -0.026385288685560226, 0.02306986041367054, 0.007079822011291981, -0.07549507915973663, -0.0011850068112835288, 0.019460877403616905, 0.08557950705289841, -0.000026913578039966524, -0.02001344785094261, -0.07846514880657196, 0.025245610624551773, -0.009618197567760944, 0.017077913507819176, -0.024019591510295868, -0.043894898146390915, 0.02994246780872345, -0.03937071934342384, 0.0073906434699893, 0.0015195716405287385, 0.004839317407459021, 0.014686314389109612, -0.008620978333055973, -0.06396014988422394, 0.024986591190099716, 0.004571665544062853, 0.007338840048760176, -0.004649370908737183, -0.007140259724110365, -0.02586725354194641, -0.044274792075157166, 0.05294325575232506, -0.022223735228180885, -0.013287617824971676, -0.027973931282758713, -0.04676136374473572, -0.030391432344913483, 0.002225395292043686, -0.013468930497765541, 0.016413100063800812, -0.03539911285042763, 0.06092100590467453, 0.05194171890616417, 0.062475115060806274, 0.013814287260174751, 0.0683116540312767, 0.022914448752999306, 0.06769000738859177, -0.08115893602371216, -0.0015303640393540263, -0.011060063727200031, 0.003846415551379323, -0.0070366524159908295, -0.05622414872050285, 0.006907143630087376, -0.023674234747886658, 0.011949358507990837, -0.0044723753817379475, 0.005823585670441389, -0.012225644662976265, 0.034259431064128876, -0.010835581459105015, -0.012890457175672054, -0.015057573094964027, -0.026730645447969437, -0.08475065231323242, 0.030495038256049156, 0.0619916133582592, -0.025280145928263664, 0.037367645651102066, 0.028163878247141838, 0.005176040809601545, -0.03419036045670509, -0.012096134945750237, 0.03455298766493797, 0.054221078753471375, -0.039819683879613876, 0.007373375818133354, -0.024330412968993187, 0.046277862042188644, -0.003604665631428361, 0.004822049755603075, 0.017535511404275894, -0.054911792278289795, 0.04990411177277565, 0.054566435515880585, -0.07273222506046295, 0.04886804148554802, 0.021584823727607727, 0.04551807790994644, -0.020548751577734947, 0.0025038395542651415, 0.00893611740320921, 0.04303150624036789, -0.0019437134033069015, 0.011707608588039875, -0.02441675215959549, 0.020928645506501198, -0.00104308663867414, -0.02168843150138855, -0.01670665293931961, -0.008059773594141006, -0.04130471870303154, -0.0015951184323057532, 0.025919057428836823, 0.009031089954078197, 0.00412701815366745, -0.05532621964812279, 0.025055663660168648, -0.020376073196530342, -0.010023992508649826, 0.02272450178861618, 0.035260967910289764, 0.06492715328931808, 0.02584998495876789, 0.029441699385643005, 0.10485044121742249, 0.04617425426840782, 0.011422689072787762, 0.022810840979218483, -0.03619343414902687, -0.015679216012358665, -0.045276325196027756, 0.00790004525333643, -0.03101307526230812, -0.004502594470977783, -0.005007679108530283, 0.015428831800818443, 0.04776289686560631, -0.021498484537005424, -0.00834469310939312, -0.0012918517459183931, 0.001955585088580847, 0.06171532720327377, -0.07383736222982407, 0.04403303936123848, 0.019788967445492744, 0.0018789588939398527, -0.016041841357946396, 0.01674119010567665, 0.015955502167344093, -0.09780515730381012, -0.0008159063290804625, -0.02134307473897934, -0.021412145346403122, -0.0828857272863388, -0.03510555624961853, -0.006061018444597721, -0.04341139644384384, 0.04921339824795723, -0.053530361503362656, 0.04613972082734108, -0.04272068291902542, 0.036642398685216904, -0.017665019258856773, 0.03709135949611664, -0.05774372071027756, 0.013874724507331848, -0.10063708573579788, -0.010205305181443691, -0.022534556686878204, -0.04551807790994644, -0.02203378826379776, 0.00680785346776247, 0.009661367163062096, -0.004493960179388523, -0.021826574578881264, -0.02510746754705906, -0.02068689465522766, -0.021792037412524223, -0.02030700258910656, -0.04669228941202164, -0.023208003491163254, -0.016628948971629143, 0.013175376690924168, -0.023190734907984734, 0.024589430540800095, -0.012795483693480492, 0.007524469401687384, -0.03520916402339935, -0.0008029554737731814, -0.026765180751681328, -0.05819268524646759, 0.006484081037342548, 0.004757295362651348, -0.035260967910289764, -0.055637042969465256, 0.011828483082354069, 0.0393361821770668, -0.0006324353162199259, 0.07155800610780716, -0.006501349154859781, 0.02237914502620697, -0.007874143309891224, 0.006622224114835262, -0.06375293433666229, 0.017803162336349487, 0.06703382730484009, -0.06682661175727844, 0.014245984144508839, 0.0153511269018054, -0.049075257033109665, -0.06734465062618256, -0.04845361411571503, -0.03444937989115715, 0.026903323829174042, 0.09594022482633591, 0.030771324411034584, 0.0008563778828829527, -0.011319081299006939, -0.0034233529586344957, -0.0044723753817379475, -0.009652732871472836, 0.02344975247979164, -0.0067344652488827705, 0.036469716578722, 0.017276493832468987, -0.03234269842505455, -0.005098335444927216, 0.003962973598390818, -0.011957992799580097, -0.006566103547811508, 0.05674218386411667, 0.016603047028183937, -0.041166577488183975, 0.05480818450450897, 0.04189182445406914, -0.08744443953037262, -0.037643931806087494, 0.04986957833170891, 0.013089037500321865, 0.01310630515217781, -0.020548751577734947, -0.024658503010869026, 0.02857830747961998, 0.007338840048760176, 0.03125482425093651, 0.043135110288858414, -0.0038054045289754868, 0.006121456157416105, -0.016300858929753304, -0.012674608267843723, -0.02821568213403225, 0.04272068291902542, -0.060368433594703674, 0.04085575416684151, 0.0025448508094996214, 0.03415582701563835, -0.022448217496275902, 0.017276493832468987, 0.03626250475645065, 0.06420189887285233, 0.041166577488183975, 0.04310057684779167, 0.014591340906918049, -0.0654451847076416, -0.0075374203734099865, 0.053564898669719696, 0.008668465539813042, 0.0091174291446805, -0.043204184621572495, 0.03543364629149437, 0.07839608192443848, 0.028630109503865242, 0.0357099324464798, 0.020807771012187004, 0.0031362748704850674, -0.01086148340255022, -0.022603627294301987, 0.01580009050667286, 0.016499439254403114, -0.010982358828186989, -0.027041466906666756, -0.02483118139207363, 0.039094433188438416, -0.023501556366682053, -0.019702626392245293, 0.03144477307796478, -0.026091735810041428, -0.014297787100076675 ]
716,674
pytorch_optimizer.optimizer.gsam
grad_norm
null
@torch.no_grad() def perturb_weights(self, rho: float): grad_norm = self.grad_norm(weight_adaptive=self.adaptive) for group in self.param_groups: scale = rho / (grad_norm + self.perturb_eps) for p in group['params']: if p.grad is None: continue self.state[p]['old_g'] = p.grad.clone() e_w = (torch.pow(p, 2) if self.adaptive else 1.0) * p.grad * scale.to(p) p.add_(e_w) # climb to the local maximum "w + e(w)" self.state[p]['e_w'] = e_w
(self, by: Optional[str] = None, weight_adaptive: bool = False) -> torch.Tensor
[ -0.02999388985335827, -0.00732553331181407, -0.026073932647705078, 0.008664704859256744, -0.030650172382593155, 0.006274593994021416, -0.001816971693187952, -0.033612314611673355, -0.04487554356455803, 0.022632881999015808, -0.033399466425180435, -0.015431510284543037, 0.027688032016158104, 0.0467202290892601, -0.057398125529289246, 0.00338340294547379, -0.02199433743953705, 0.05587271228432655, 0.007130422163754702, -0.03664540499448776, -0.00937419943511486, -0.07492264360189438, -0.01860649883747101, 0.07336175441741943, -0.06953048706054688, -0.07336175441741943, -0.010385229252278805, -0.016034580767154694, -0.03458786755800247, 0.030650172382593155, -0.0037558877374976873, -0.03529736399650574, 0.044627219438552856, 0.04434342309832573, 0.02861037477850914, -0.02029155008494854, 0.020149650052189827, 0.07818631827831268, -0.07584498822689056, -0.008961805142462254, -0.019156357273459435, -0.020646296441555023, 0.00466492772102356, -0.028095992282032967, 0.03263675794005394, 0.0351732037961483, 0.04430794715881348, 0.05033865198493004, 0.017737368121743202, 0.012354076839983463, 0.02506290189921856, 0.0026428678538650274, 0.024672679603099823, 0.01632724702358246, -0.004015296697616577, 0.024654941633343697, 0.03125324472784996, -0.0461881086230278, 0.011227753944694996, -0.07470979541540146, 0.057823821902275085, -0.06250648945569992, 0.02124936692416668, -0.06151319295167923, -0.021799225360155106, -0.053105682134628296, -0.00805719941854477, 0.0023191608488559723, 0.015342824161052704, -0.008939634077250957, 0.010136906057596207, -0.020894620567560196, -0.00998613890260458, 0.012300864793360233, -0.045265763998031616, -0.004217059351503849, 0.01901445910334587, -0.011307572945952415, -0.025506336241960526, 0.0030929537024348974, -0.015715308487415314, 0.02399865910410881, -0.03368326276540756, 0.01144060306251049, -0.08301088213920593, -0.05033865198493004, -0.011130198836326599, -0.03746132180094719, 0.02437114529311657, -0.07094947248697281, -0.0107311075553298, 0.00017099932301789522, 0.04381129890680313, 0.02373259887099266, 0.06686987727880478, 0.048387542366981506, -0.05296378210186958, 0.001441161148250103, -0.06424474716186523, -0.07485169917345047, -0.04146996885538101, 0.008793300949037075, 0.02781219407916069, 0.024832315742969513, 0.011360784992575645, -0.041186168789863586, 0.0008369821007363498, -0.04409509897232056, 0.02023833803832531, 0.012726562097668648, -0.05377970263361931, 0.0006501853931695223, -0.054595619440078735, -0.00791973527520895, 0.004695968236774206, -0.046223580837249756, -0.004248099867254496, 0.01057147141546011, 0.02930213324725628, 0.025524074211716652, 0.044591743499040604, 0.016087792813777924, -0.04508839175105095, -0.047713521867990494, -0.048032794147729874, 0.05693695321679115, 0.052254289388656616, -0.011467209085822105, -0.010340886190533638, 0.010083694010972977, -0.04076047241687775, 0.02791861817240715, -0.04434342309832573, 0.004483120050281286, 0.04668475314974785, -0.04551408812403679, -0.040299300104379654, 0.008363169617950916, 0.11110688000917435, 0.01003935094922781, 0.025311224162578583, 0.020646296441555023, 0.008230138570070267, 0.019457893446087837, 0.051686692982912064, 0.0019045500084757805, 0.01991906575858593, 0.014739753678441048, -0.02903607301414013, 0.00816362351179123, -0.015413773246109486, 0.05590818449854851, 0.06360620260238647, 0.034038010984659195, -0.01512110698968172, 0.025470862165093422, -0.0006767914746887982, -0.005285735707730055, -0.03373647481203079, -0.039447907358407974, -0.021905649453401566, -0.0018291660817340016, -0.00791973527520895, 0.022242659702897072, -0.04349202662706375, -0.02823789045214653, 0.018571024760603905, -0.024353407323360443, -0.001792582799680531, 0.015316218137741089, -0.006287897005677223, -0.07747682929039001, -0.01430518738925457, 0.044911015778779984, 0.036272916942834854, 0.08549411594867706, 0.01885482296347618, -0.034676555544137955, -0.03212237358093262, 0.022349083796143532, 0.04164734110236168, -0.045265763998031616, 0.0439886748790741, -0.03407348692417145, 0.013977046124637127, 0.017666419968008995, 0.005303473211824894, -0.001716090366244316, -0.015005813911557198, -0.02272156998515129, 0.0418601892888546, -0.031714413315057755, -0.004021948203444481, 0.005862200167030096, 0.06669250875711441, 0.0595620833337307, 0.04015740379691124, -0.0467202290892601, 0.02277478203177452, 0.02559502236545086, -0.00660716975107789, -0.048813238739967346, -0.030118051916360855, 0.02680116333067417, -0.007245715241879225, -0.025896558538079262, 0.002050883136689663, 0.0488487146794796, 0.019191833212971687, 0.003915524110198021, 0.012974885292351246, 0.011130198836326599, 0.024867791682481766, 0.023377852514386177, -0.007223543245345354, -0.0493808351457119, -0.01802116632461548, -0.00010372203541919589, 0.058781638741493225, -0.02717364951968193, -0.06860814243555069, -0.0025785700418055058, 0.05388612672686577, 0.012575794011354446, 0.030756596475839615, -0.010846400633454323, -0.02972782962024212, -0.01864197477698326, -0.007715755142271519, -0.009037189185619354, 0.04636548087000847, 0.0015320652164518833, -0.013356238603591919, -0.0031661202665418386, 0.05392159894108772, 0.03254806995391846, -0.08308183401823044, -0.02474362961947918, -0.02935534529387951, 0.02781219407916069, -0.02373259887099266, 0.0017648681532591581, -0.016806157305836678, 0.00712598767131567, -0.017897004261612892, -0.03990907967090607, 0.06445759534835815, 0.015369430184364319, 0.01425197534263134, 0.00495315995067358, -0.03386063501238823, -0.04079594835639, -0.049238935112953186, 0.01901445910334587, -0.04104427248239517, -0.037745121866464615, 0.05101267248392105, 0.05934923514723778, -0.01186629943549633, -0.0558372363448143, 0.021373528987169266, -0.04973558336496353, 0.0020752721466124058, 0.051473844796419144, 0.00047087171697057784, 0.03675182908773422, -0.0029843123629689217, -0.0010686764726415277, -0.013977046124637127, 0.01414555124938488, 0.06254196166992188, 0.03969623148441315, -0.035847220569849014, -0.0182340145111084, 0.0013269769260659814, 0.04076047241687775, 0.028468476608395576, 0.0671536773443222, 0.002696080133318901, 0.011032643727958202, 0.001918961526826024, -0.0714106485247612, -0.006314503028988838, 0.010642421431839466, -0.02272156998515129, 0.06474139541387558, -0.02653510309755802, 0.022473245859146118, 0.026996275410056114, 0.003924392629414797, 0.008970674127340317, 0.011165673844516277, -0.0017094388604164124, -0.029497243463993073, 0.01790587417781353, -0.022278135642409325, -0.01497033890336752, -0.00696635153144598, 0.0027138174045830965, 0.010535997338593006, 0.03898673504590988, 0.01673520728945732, 0.018109852448105812, 0.013799672946333885, -0.024974215775728226, 0.005161574110388756, 0.0827270895242691, -0.012442763894796371, 0.013303026556968689, -0.041718289256095886, -0.025683710351586342, 0.014331793412566185, 0.0190676711499691, 0.0595620833337307, 0.019617529585957527, -0.09798122197389603, 0.03277865797281265, -0.034995827823877335, -0.010855269618332386, 0.052999258041381836, -0.04874229058623314, 0.03162572905421257, -0.009347593411803246, 0.025258012115955353, -0.07094947248697281, -0.0037514534778892994, 0.02013191394507885, 0.056866005063056946, -0.018872560933232307, -0.017781712114810944, -0.07584498822689056, 0.00917021930217743, 0.04629453271627426, 0.03247712180018425, -0.045904308557510376, 0.007640371564775705, 0.06059085205197334, 0.03792249411344528, -0.003527519293129444, -0.06612490862607956, 0.010278805159032345, 0.02866358682513237, -0.005285735707730055, 0.03781607002019882, -0.0017571080243214965, 0.003633943386375904, -0.005844463128596544, 0.01387949101626873, 0.03739037364721298, -0.024779103696346283, -0.004864473361521959, 0.02077045850455761, -0.04970010742545128, 0.057930245995521545, 0.05119004473090172, 0.01834043860435486, -0.02399865910410881, -0.003053044667467475, -0.005498584359884262, 0.0018003429286181927, -0.014260844327509403, 0.005498584359884262, -0.03916411101818085, 0.06623133271932602, 0.08343657851219177, -0.013498137705028057, -0.01191951148211956, 0.026446416974067688, 0.02479684166610241, -0.02988746576011181, 0.019032197073101997, -0.03639708086848259, -0.033293042331933975, 0.01197272352874279, -0.02346653863787651, 0.00921456329524517, -0.07123327255249023, -0.009897451847791672, 0.06509613990783691, 0.010509391315281391, -0.0003838477423414588, -0.018925772979855537, 0.01486391481012106, 0.021018782630562782, -0.023058578372001648, -0.07020450383424759, 0.06740199774503708, -0.029071547091007233, -0.005161574110388756, -0.028273366391658783, 0.05629840865731239, -0.023750336840748787, 0.006438664626330137, 0.048600390553474426, -0.029710091650485992, 0.03453465551137924, 0.0071392906829714775, 0.007068341597914696, -0.09869071841239929, -0.009006149135529995, -0.0010492762085050344, -0.0827270895242691, -0.07272320985794067, 0.014881651848554611, -0.030171263962984085, -0.043740350753068924, 0.004004211165010929, 0.0783282220363617, 0.06066180020570755, 0.02722686156630516, 0.005866634659469128, 0.06509613990783691, -0.034942615777254105, 0.0005013578338548541, 0.005871069151908159, -0.005817857105284929, 0.04533671587705612, -0.03222879767417908, 0.014393874444067478, 0.029656879603862762, 0.06804054230451584, -0.033931586891412735, -0.001763759646564722, 0.026730215176939964, 0.048919662833213806, -0.046436432749032974, 0.005955321714282036, -0.013187733478844166, -0.023289164528250694, 0.03602459654211998, -0.025470862165093422, -0.020788196474313736, 0.03183857724070549, -0.028379790484905243, 0.026996275410056114, 0.01285072322934866, 0.0370001494884491, 0.061584144830703735, 0.01459785457700491, 0.008762259967625141, 0.008017290383577347, -0.010606946423649788, -0.018730660900473595, -0.071871817111969, 0.015511329285800457, -0.008921896107494831, 0.011405128054320812, -0.05296378210186958, -0.06885646283626556, 0.029958415776491165, 0.022863468155264854, -0.03636160492897034, 0.06310955435037613, -0.04054762423038483, -0.0053345137275755405, 0.019528843462467194, -0.02298763021826744, -0.044059623032808304, 0.017187509685754776, -0.0009711209568195045, 0.05736264958977699, -0.007037301082164049, 0.014881651848554611, -0.003888918086886406, -0.033239830285310745, -0.0018136459402740002, 0.051154572516679764, -0.043421078473329544, 0.0054409378208220005, -0.027244597673416138, 0.06342882663011551, 0.015236400067806244, 0.026286780834197998, -0.039022210985422134, -0.045904308557510376, -0.019156357273459435, -0.02855716273188591, 0.045017439872026443, 0.019936801865696907, -0.07279416173696518, -0.014447086490690708, -0.01599910669028759, 0.0638190507888794, 0.04217946156859398, 0.004312397912144661, -0.0073166643269360065, 0.01326755154877901, 0.015032419934868813, 0.02522253803908825, 0.03412669897079468, -0.02770576998591423, -0.056759580969810486, 0.04530123993754387, 0.06264838576316833, -0.0488487146794796, -0.024193771183490753, 0.03373647481203079, 0.004161630291491747, 0.05275093391537666, -0.012629006057977676, 0.0370711013674736, 0.008921896107494831, 0.021799225360155106, -0.02653510309755802, -0.025027427822351456, 0.002957706106826663, 0.0005667643272317946, 0.028273366391658783, -0.034995827823877335, 0.054382771253585815, 0.01626516692340374, -0.03268996998667717, -0.05587271228432655, 0.014278581365942955, 0.005946452729403973, -0.006682553794234991, -0.024193771183490753, 0.044911015778779984, 0.03293829411268234, -0.05129646882414818, 0.03178536519408226, 0.0364680290222168, -0.004474251065403223, 0.018411388620734215, 0.030916232615709305, 0.039873603731393814, -0.005582836922258139, -0.011059249751269817, 0.022544195875525475, 0.014952601864933968, 0.01247823890298605, 0.022579669952392578, 0.04785542190074921, -0.002095226664096117, 0.004860038869082928, -0.028113728389143944, -0.023768074810504913, -0.08364942669868469, -0.07470979541540146, -0.03010031394660473, -0.011316440999507904, -0.02282799407839775, 0.044911015778779984, -0.05346043035387993, 0.0014001434901729226, 0.01858876273036003, -0.006527351681143045, -0.03625518083572388, -0.03586496040225029, -0.03471203148365021, -0.04037025198340416, -0.020734984427690506, -0.07698018103837967, 0.03013578988611698, -0.007706886623054743, -0.027688032016158104, -0.020220600068569183, -0.020681772381067276, -0.005946452729403973, 0.009879713878035545, 0.014447086490690708, -0.1074175015091896, 0.057930245995521545, 0.049664631485939026, -0.006593866739422083, 0.022366821765899658, -0.0027138174045830965, 0.04877776280045509, -0.03511998802423477, -0.02357296273112297, -0.01837591454386711, 0.020273812115192413, 0.006691422313451767, -0.0010149100562557578, -0.0015775172505527735, -0.021479953080415726, 0.058249518275260925, -0.045691460371017456, -0.004545200616121292, -0.03185631334781647, 0.020486660301685333, -0.02554181031882763, -0.021018782630562782, -0.012061410583555698, -0.003230418311432004, 0.045797884464263916, -0.02759934589266777, 0.06747294962406158, 0.0182340145111084, 0.01449143048375845, -0.06161961704492569, -0.020060963928699493, 0.0012349642347544432, -0.06172604113817215, -0.016779551282525063, -0.009737815707921982, -0.06963691115379333, -0.019351469352841377, 0.05392159894108772, 0.024601729586720467, -0.024388881400227547, -0.029639143496751785, 0.04973558336496353, 0.019298257306218147, -0.02389223501086235, -0.0579657219350338, 0.020734984427690506, 0.019511105492711067, 0.026570579037070274, -0.025506336241960526, 0.007800007704645395, -0.029479507356882095, 0.028699062764644623, -0.0012926107738167048, -0.03240617364645004, -0.025098375976085663, -0.03391384705901146, -0.046010732650756836, 0.0869840532541275, 0.025683710351586342, -0.0944337472319603, 0.010952824726700783, 0.005471978336572647, 0.0016850499669089913, -0.013844016008079052, -0.015413773246109486, 0.04370487481355667, -0.07953435927629471, -0.039447907358407974, -0.009666865691542625, -0.057398125529289246, -0.0357053242623806, 0.003656115150079131, 0.01970621570944786, -0.0029177970718592405, 0.006026270799338818, 0.023502012714743614, -0.0005997447879053652, -0.03263675794005394, -0.08208854496479034, 0.0024366709403693676, 0.033807422965765, 0.016832763329148293, -0.033807422965765, 0.0014245323836803436, 0.022313609719276428, 0.002600741572678089, -0.024761365726590157, -0.044414371252059937, -0.017249591648578644, -0.019138621166348457, -0.015812864527106285, -0.05133194476366043, 0.006549523212015629, 0.00504628149792552, 0.05346043035387993, 0.012726562097668648, 0.043101806193590164, 0.02162185311317444, -0.006580563727766275, 0.011502683162689209, -0.022189447656273842, 0.015112238004803658, -0.01885482296347618, 0.03265449404716492, 0.020681772381067276, -0.06562826037406921, -0.021763751283288002, -0.048245642334222794, -0.06584110856056213, -0.018978985026478767, 0.0010221158154308796, -0.023608436807990074, -0.012495975941419601, -0.004722574260085821, 0.042782533913850784, -0.01818080246448517, 0.005844463128596544, -0.03157251700758934, 0.006274593994021416, 0.06726010143756866, 0.02447756938636303, -0.0370001494884491, 0.034144435077905655, 0.06999165564775467, 0.0013713203370571136, -0.03444597125053406, 0.027936356142163277, 0.028149204328656197, 0.01716090366244316, -0.01944015547633171, -0.07641258090734482, 0.018978985026478767, 0.04572693631052971, 0.034995827823877335, -0.02605619467794895, 0.005942018702626228, -0.02453078143298626, 0.03824176639318466, -0.004864473361521959, 0.007800007704645395, -0.017205247655510902, -0.0230940543115139, 0.003871180582791567, 0.024335669353604317, 0.003922175616025925, 0.06240006163716316, 0.01600797474384308, 0.019475631415843964, 0.010748845525085926, -0.039235059171915054, 0.03668087720870972, -0.01589268259704113, 0.007157028187066317, 0.00821683555841446, 0.06686987727880478, 0.0021983252372592688, -0.01486391481012106, -0.02564823441207409, 0.017152035608887672, -0.024938739836215973, -0.0019732823129743338, 0.042995382100343704, 0.03389611095190048, -0.03231748566031456, -0.006247987970709801, 0.054382771253585815, 0.04210851341485977, -0.04920345917344093, -0.016779551282525063, 0.030632436275482178, -0.03877388685941696, -0.02527575008571148, -0.005267998669296503, 0.02087688259780407, 0.05026770383119583, 0.09202146530151367, 0.03018900193274021, -0.057930245995521545, 0.0644930750131607, 0.0000074959434641641565, 0.03990907967090607, -0.021391266956925392, -0.03575853630900383, 0.06623133271932602, 0.009436280466616154, -0.005161574110388756, -0.008695744909346104, 0.0730779618024826, -0.06804054230451584, 0.10578566789627075, 0.05186406522989273, 0.04636548087000847, -0.01802116632461548, 0.06321597844362259, -0.028433002531528473, 0.04842301458120346, -0.06676345318555832, -0.09351141005754471, -0.04324370622634888, 0.0067579373717308044, -0.030330900102853775, 0.01154702715575695, 0.06999165564775467, -0.010473916307091713, 0.004540766589343548, 0.06261291354894638, -0.024867791682481766 ]
716,676
pytorch_optimizer.optimizer.gsam
load_state_dict
null
def load_state_dict(self, state_dict: Dict): super().load_state_dict(state_dict) self.base_optimizer.param_groups = self.param_groups
(self, state_dict: Dict)
[ -0.009217611514031887, -0.0060093458741903305, -0.033237095922231674, 0.020421931520104408, -0.0313577800989151, 0.006761073600500822, -0.03368455544114113, -0.0016220312099903822, -0.018506817519664764, -0.025898804888129234, -0.031125100329518318, 0.04030691459774971, -0.007503851782530546, 0.06940951198339462, -0.03730000555515289, -0.0046490770764648914, 0.004622229840606451, 0.03549227863550186, -0.06991066038608551, -0.05108167976140976, -0.044960469007492065, -0.04363599419593811, 0.01609949953854084, 0.03687044605612755, -0.00023085979046300054, -0.027813920751214027, -0.005754295736551285, -0.05126066133379936, 0.031071405857801437, -0.031805235892534256, -0.04524683952331543, -0.015437262132763863, -0.03291492909193039, 0.07739214599132538, 0.0031321982387453318, -0.04177457466721535, 0.025057585909962654, 0.000686287006828934, -0.06475596129894257, -0.0026623685844242573, 0.01030045747756958, -0.03627980500459671, 0.003349214792251587, 0.012922555208206177, 0.048325344920158386, 0.02387630008161068, -0.00472067017108202, 0.01906166411936283, 0.05344425141811371, -0.02874463051557541, -0.017406072467565536, -0.0511532723903656, 0.016493260860443115, 0.05219137296080589, -0.015965262427926064, -0.0213705413043499, 0.028655139729380608, -0.01234086137264967, 0.04785998910665512, -0.025111280381679535, -0.01730763167142868, -0.06110471114516258, -0.0641116201877594, -0.04914866387844086, -0.00048157546552829444, -0.08698561787605286, -0.06862198561429977, 0.02305297926068306, -0.01981339044868946, -0.006989276502281427, -0.006671582348644733, -0.011231168173253536, 0.03919722139835358, -0.0015224720118567348, -0.054732926189899445, 0.03431099280714989, -0.10051671415567398, -0.005101008340716362, 0.0030315204057842493, 0.0009642695658840239, -0.03622610867023468, -0.02980062924325466, -0.0255766361951828, -0.006555243395268917, -0.08447986096143723, -0.051511235535144806, 0.011768115684390068, -0.029102595522999763, -0.005284465849399567, -0.07087717205286026, 0.002554978709667921, 0.0753159448504448, -0.015455161221325397, 0.029317375272512436, 0.07667621225118637, 0.030820829793810844, 0.0027071142103523016, 0.039233021438121796, -0.029836425557732582, -0.03676305711269379, -0.030731339007616043, -0.11462055891752243, 0.008841748349368572, -0.024055281654000282, -0.022856097668409348, -0.08226047456264496, 0.021137863397598267, -0.06983906775712967, -0.024431146681308746, 0.008971510455012321, -0.04614175483584404, -0.007110089994966984, -0.013548994436860085, 0.04123762622475624, -0.005011517088860273, 0.0040561966598033905, 0.018265189602971077, -0.03474055230617523, 0.003986841067671776, 0.057167090475559235, -0.02217596396803856, 0.07753533124923706, -0.006855039391666651, 0.046428125351667404, -0.006295718252658844, 0.029138391837477684, 0.016511159017682076, 0.024502739310264587, 0.03790854662656784, -0.08555375784635544, 0.013548994436860085, -0.04857591912150383, -0.05011517181992531, -0.013012045994400978, 0.0086717139929533, -0.03565336391329765, 0.021871693432331085, 0.009647170081734657, 0.01066737249493599, 0.022677114233374596, 0.07517275959253311, 0.028243478387594223, 0.010917947627604008, -0.02208647131919861, 0.06772707402706146, -0.0009508458897471428, 0.02958584949374199, 0.006013820413500071, -0.049077071249485016, -0.03937620669603348, 0.029066799208521843, 0.014703433029353619, -0.02396579086780548, -0.0029017578344792128, -0.025039687752723694, 0.004658026155084372, -0.0046043312177062035, -0.05756085366010666, 0.010381000116467476, -0.012296115048229694, -0.0018412850331515074, -0.0022115556057542562, -0.02459223009645939, -0.035975534468889236, -0.03162625432014465, -0.012054488062858582, -0.00822425726801157, -0.04628494009375572, -0.0529073029756546, -0.022856097668409348, -0.041595593094825745, -0.11096930503845215, -0.015687838196754456, 0.04127342253923416, 0.021048372611403465, 0.07227323949337006, -0.026775820180773735, 0.004854907281696796, -0.026740023866295815, 0.030051205307245255, 0.08175931870937347, 0.012233471497893333, -0.048933885991573334, 0.028332969173789024, -0.012976249679923058, 0.009790356270968914, -0.008783578872680664, 0.03060605190694332, 0.0247891116887331, 0.031751539558172226, 0.04385077580809593, -0.0029196562245488167, 0.015365669503808022, -0.03289702907204628, -0.008586697280406952, 0.005526092369109392, -0.012081336230039597, -0.03270014747977257, 0.0380159355700016, 0.0877731442451477, 0.0034208078868687153, -0.043349623680114746, 0.003765349742025137, 0.005942227318882942, -0.02051142416894436, 0.015535702928900719, -0.03780115768313408, -0.008797002024948597, 0.024395348504185677, 0.01972389966249466, -0.02135264314711094, -0.046499717980623245, 0.04181037098169327, 0.024502739310264587, 0.029925916343927383, -0.05437495931982994, -0.0005347109981812537, 0.04932764545083046, 0.03812332823872566, -0.017978817224502563, 0.09994397312402725, 0.03123249113559723, 0.03212740272283554, -0.07696258276700974, -0.0028346392791718245, -0.03447207808494568, 0.008707511238753796, -0.03808753192424774, -0.060567762702703476, 0.041667185723781586, 0.0240015871822834, -0.07946833968162537, -0.006984801962971687, -0.03431099280714989, 0.07803647965192795, 0.03212740272283554, 0.020242949947714806, -0.01800566539168358, 0.012752520851790905, 0.02158532105386257, 0.004145687911659479, 0.008157138712704182, -0.03049866110086441, -0.06171325221657753, -0.07789329439401627, -0.017916174605488777, 0.030158594250679016, 0.03479424864053726, -0.0011292693670839071, 0.03282543644309044, 0.05333686247467995, -0.008246630430221558, -0.05054473131895065, 0.03606502339243889, -0.031644150614738464, -0.0068863616324961185, 0.028458258137106895, 0.01968810334801674, 0.007955783046782017, -0.04356440156698227, -0.017826681956648827, -0.020099762827157974, -0.09307102859020233, 0.02888781577348709, 0.041452404111623764, 0.05788302421569824, 0.05673753470182419, -0.0190079677850008, -0.006206227000802755, -0.030677644535899162, 0.08977775275707245, 0.06962428987026215, -0.008116868324577808, 0.034239400178194046, 0.016967564821243286, 0.006242023780941963, 0.01986708492040634, -0.05598580464720726, 0.0018491155933588743, 0.05423177406191826, 0.09822573512792587, -0.017540309578180313, -0.024108976125717163, 0.02231914922595024, -0.009360797703266144, -0.00003163659857818857, -0.023536231368780136, 0.014184383675456047, 0.002550504170358181, -0.004939923994243145, 0.011445946991443634, 0.02461012825369835, 0.027813920751214027, 0.02543344907462597, 0.0022909792605787516, -0.0511532723903656, -0.027599141001701355, 0.05845576897263527, -0.03130408376455307, 0.049828797578811646, 0.030999813228845596, -0.030731339007616043, 0.027366463094949722, 0.03715682029724121, 0.03130408376455307, -0.018775291740894318, 0.06239338964223862, 0.008801477029919624, -0.02459223009645939, 0.022605521604418755, 0.0231245718896389, 0.05663014203310013, -0.023500435054302216, -0.014193332754075527, 0.01884688436985016, -0.05691651627421379, 0.013405808247625828, -0.03379194438457489, 0.01765664853155613, 0.04317064210772514, -0.07624665647745132, -0.007584394421428442, -0.048933885991573334, -0.04288426786661148, -0.003015859518200159, -0.015499906614422798, 0.0811149850487709, -0.025773515924811363, 0.0013099299976602197, -0.010524186305701733, -0.061462678015232086, -0.044960469007492065, 0.028565647080540657, 0.02043982967734337, 0.00008571596117690206, 0.00042732132715173066, -0.004127789754420519, 0.03209160640835762, -0.007794699165970087, 0.0028301647398620844, 0.02960374765098095, -0.015866821631789207, -0.04113023728132248, -0.003167994786053896, -0.012591436505317688, -0.045032061636447906, -0.03144726902246475, 0.008993883617222309, 0.017925122752785683, -0.03402462229132652, -0.08175931870937347, -0.010559982620179653, 0.0353848896920681, 0.0655076876282692, 0.05000778287649155, 0.04012793302536011, 0.0221580658107996, -0.0029196562245488167, -0.0064165317453444, -0.03808753192424774, 0.04420873895287514, -0.02731276862323284, -0.059708647429943085, 0.009190764278173447, 0.0625365749001503, 0.015267228707671165, -0.004405213054269552, -0.05050893500447273, 0.04048589989542961, -0.026901107281446457, 0.007051920518279076, -0.08498100936412811, -0.01959861069917679, 0.03536699339747429, 0.017826681956648827, 0.01683332771062851, -0.029979610815644264, -0.019294340163469315, -0.00011612904199864715, 0.022516030818223953, 0.0394120030105114, 0.0027966054622083902, 0.07195106893777847, 0.0429200641810894, -0.016126345843076706, 0.004573009442538023, 0.04675029590725899, 0.006734225898981094, 0.03463316336274147, -0.06668897718191147, 0.013020995073020458, 0.04374338686466217, -0.01158018410205841, 0.02795710600912571, 0.008237681351602077, 0.019186951220035553, 0.03048076294362545, 0.006313616875559092, -0.020028170198202133, -0.030248085036873817, -0.01660959981381893, -0.027742326259613037, -0.03289702907204628, 0.02801080048084259, 0.037371598184108734, -0.07180788367986679, -0.015723634511232376, 0.10409636795520782, 0.0008087783353403211, -0.038409698754549026, 0.04123762622475624, 0.011481743305921555, -0.008877544663846493, 0.025773515924811363, -0.027491750195622444, -0.03116089664399624, 0.02473541721701622, -0.018417324870824814, 0.0221580658107996, 0.009101273491978645, 0.08369233459234238, 0.029961712658405304, -0.00030762661481276155, 0.002546029631048441, 0.03610081970691681, -0.00947713665664196, -0.030248085036873817, -0.035044822841882706, 0.03035547584295273, -0.0072040557861328125, -0.047358836978673935, 0.046499717980623245, -0.004617754835635424, 0.02228335291147232, 0.058813732117414474, -0.00987089890986681, 0.017665598541498184, 0.026203075423836708, -0.007562021259218454, 0.034114111214876175, 0.021996980533003807, -0.022551827132701874, 0.03533119708299637, 0.007951308973133564, -0.01150859147310257, -0.0003660756628960371, -0.001785352942533791, 0.0690157487988472, -0.008134766481816769, -0.020762000232934952, 0.027617039158940315, -0.03536699339747429, -0.004065145738422871, -0.023589927703142166, -0.008385341614484787, 0.0443161316215992, 0.040664881467819214, -0.00319707952439785, 0.0021287761628627777, -0.0011370998108759522, -0.02056511864066124, -0.01323577482253313, -0.06350307911634445, 0.0595654621720314, -0.0058974819257855415, 0.05333686247467995, -0.0016186753055080771, 0.005615584086626768, 0.027867615222930908, 0.02147793024778366, -0.03683464974164963, 0.024395348504185677, 0.008130291476845741, -0.04617755115032196, -0.039233021438121796, 0.005365008022636175, 0.02305297926068306, 0.021996980533003807, -0.03314760699868202, 0.009736661799252033, 0.0702328309416771, 0.007669411133974791, 0.02627466805279255, 0.008416663855314255, 0.012976249679923058, -0.002210437087342143, 0.0015179974725469947, 0.024896500632166862, 0.015267228707671165, 0.02648944780230522, -0.03227059170603752, -0.01639482006430626, 0.04463829845190048, 0.040772270411252975, 0.016001058742403984, 0.0025124703533947468, -0.010891100391745567, 0.02290979214012623, 0.07388407737016678, -0.025272365659475327, -0.01890057884156704, 0.015455161221325397, -0.04513945057988167, 0.018435223028063774, -0.0028704358264803886, 0.043993961066007614, -0.04302745312452316, 0.05129645764827728, -0.00006149036198621616, 0.0492202565073967, -0.011911301873624325, -0.0033939604181796312, 0.003557282267138362, 0.02641785517334938, 0.026203075423836708, -0.032539065927267075, -0.04585538059473038, 0.05942227318882942, -0.009342899546027184, 0.02897730842232704, 0.07116354256868362, 0.035778652876615524, 0.02808239497244358, -0.06017400324344635, 0.02063671126961708, -0.01730763167142868, -0.008349545300006866, -0.04102284833788872, 0.03848129138350487, 0.0036669091787189245, -0.013808519579470158, -0.04360019788146019, 0.004631178919225931, 0.09665068984031677, 0.009638221003115177, 0.020368237048387527, 0.06117630377411842, -0.04270528629422188, -0.09636431187391281, -0.02457433193922043, -0.0074591063894331455, -0.021298948675394058, 0.055592045187950134, 0.01111482921987772, 0.04596276953816414, 0.05680912733078003, -0.027760224416851997, 0.024914398789405823, -0.03389933332800865, -0.015177737921476364, -0.03561756759881973, 0.007383038755506277, -0.06199962645769119, -0.03690624237060547, 0.056415364146232605, -0.07291757315397263, 0.0110790329053998, -0.016770683228969574, -0.025111280381679535, 0.031841032207012177, 0.028494054451584816, 0.0127883180975914, 0.022444438189268112, 0.015866821631789207, -0.006550768855959177, 0.006443378981202841, -0.08963456004858017, 0.030659746378660202, -0.05598580464720726, 0.04048589989542961, 0.03613661974668503, -0.04352860525250435, -0.04184616729617119, 0.026578938588500023, -0.02054722048342228, 0.007190632168203592, 0.014980856329202652, 0.057167090475559235, 0.016967564821243286, 0.002207081066444516, 0.03434678912162781, 0.04306324943900108, 0.01967020519077778, 0.03221689537167549, -0.024520637467503548, 0.035009026527404785, -0.03533119708299637, 0.06504233181476593, 0.05791882053017616, -0.014417060650885105, -0.03944779932498932, 0.003740739542990923, 0.01281516533344984, -0.004438772331923246, -0.04628494009375572, -0.031053507700562477, -0.01639482006430626, -0.017951970919966698, -0.013772723264992237, 0.006206227000802755, -0.0346868559718132, -0.0007869647815823555, 0.049721408635377884, 0.028529850766062737, -0.013808519579470158, -0.006501548457890749, 0.003754163160920143, 0.10123264789581299, -0.03372035175561905, 0.01193815004080534, -0.027438055723905563, -0.035563874989748, 0.010031983256340027, -0.03613661974668503, -0.00947713665664196, -0.0744568258523941, 0.000019453887944109738, -0.007503851782530546, 0.0381949208676815, -0.07338292896747589, -0.029478460550308228, -0.017567157745361328, -0.015231432393193245, 0.03037337400019169, -0.039268817752599716, -0.027617039158940315, 0.03848129138350487, -0.049077071249485016, -0.013083639554679394, -0.055627841502428055, -0.03123249113559723, -0.013835366815328598, -0.01827413961291313, -0.055735230445861816, 0.0213705413043499, -0.020063966512680054, 0.049936190247535706, 0.01566099189221859, -0.006984801962971687, -0.01965230703353882, 0.02788551338016987, -0.0025348432827740908, 0.00949503481388092, -0.016770683228969574, -0.008166087791323662, 0.02464592456817627, -0.06489914655685425, 0.037335801869630814, 0.04886229336261749, -0.0011119303526356816, 0.015822075307369232, -0.02622097358107567, -0.044137146323919296, -0.009700865484774113, 0.026686329394578934, -0.019312238320708275, -0.006537345238029957, 0.021674811840057373, 0.03955518826842308, -0.02729487046599388, -0.041452404111623764, 0.0345078743994236, -0.002984537510201335, 0.014739230275154114, 0.023214062675833702, 0.03212740272283554, -0.06149847432971001, 0.001798776676878333, 0.014604993164539337, -0.018318884074687958, -0.025379754602909088, -0.05659434571862221, -0.024287959560751915, 0.021084168925881386, -0.018157800659537315, 0.014229129068553448, 0.006859513930976391, -0.039984747767448425, 0.03271804749965668, 0.019580712541937828, 0.020189255475997925, 0.028655139729380608, 0.0281181912869215, 0.009208662435412407, 0.00902073085308075, 0.018453121185302734, -0.06461277604103088, 0.01152648963034153, 0.034991130232810974, 0.017468716949224472, 0.01031835563480854, -0.005369482561945915, 0.018542613834142685, -0.018435223028063774, -0.020762000232934952, -0.04635653272271156, -0.0409870520234108, -0.07810807228088379, 0.013808519579470158, 0.010014085099101067, -0.02709798887372017, -0.02153162471950054, -0.04675029590725899, -0.0231245718896389, -0.002760808914899826, 0.023697316646575928, -0.045676399022340775, 0.01158913318067789, -0.008676188997924328, -0.03815912455320358, 0.03116089664399624, -0.0480031743645668, -0.013531096279621124, 0.01718234457075596, 0.053873807191848755, 0.06296613067388535, 0.025057585909962654, -0.02715168334543705, -0.031608354300260544, -0.025343958288431168, -0.023625724017620087, 0.0119560481980443, -0.03851708769798279, 0.018435223028063774, 0.025182873010635376, -0.03062395006418228, -0.008819375187158585, -0.013978553004562855, 0.042597897350788116, 0.020672507584095, 0.0095039838925004, -0.0001462624641135335, -0.046678703278303146, -0.05501930043101311, -0.03934041038155556, 0.012573538348078728, 0.021817997097969055, 0.024377450346946716, 0.009289205074310303, 0.05355164036154747, 0.007378564216196537, 0.032413776963949203, 0.004508127924054861, 0.0070921918377280235, -0.012913606129586697, 0.03150096535682678, 0.0024364027194678783, -0.03207371011376381, 0.02314247004687786, 0.016475362703204155, 0.03866027668118477, 0.08276162296533585, 0.05673753470182419, 0.032646454870700836, 0.009087849408388138, -0.06672476977109909, 0.013548994436860085, 0.009271306917071342, 0.008269003592431545, -0.053838010877370834, -0.03448997810482979, -0.10559982806444168, 0.03227059170603752, -0.02468172274529934, 0.07474319636821747, 0.004277687985450029, 0.041702982038259506, -0.015294075943529606 ]
716,677
pytorch_optimizer.optimizer.gsam
maybe_no_sync
null
def maybe_no_sync(self): return self.model.no_sync() if is_initialized() else ExitStack()
(self)
[ 0.042022477835416794, 0.0015653372975066304, -0.021935734897851944, 0.0734216719865799, 0.021465081721544266, -0.04672899469733238, -0.014909575693309307, 0.006963124964386225, 0.03647551313042641, -0.06232773885130882, -0.0038282477762550116, -0.0276003647595644, -0.037853848189115524, -0.03640827536582947, -0.033248186111450195, 0.0027818880043923855, -0.03859344497323036, -0.014228811487555504, 0.04699794203042984, -0.03862706199288368, 0.02008674480021, 0.05096486210823059, 0.01401869859546423, 0.020826339721679688, 0.0061436863616108894, -0.0315672867000103, -0.00022390102094504982, -0.012514294125139713, 0.06511802971363068, 0.06747129559516907, 0.0004441250639501959, -0.012262159027159214, 0.020506970584392548, 0.002594887977465987, 0.056848008185625076, 0.022238295525312424, 0.03459290415048599, 0.03926580399274826, -0.04057690501213074, -0.12142815440893173, 0.0068790796212852, -0.04992270469665527, -0.005925169680267572, 0.00997613649815321, -0.006475664209574461, -0.0326598696410656, 0.0005867388681508601, 0.05610841512680054, 0.007660697679966688, 0.003645450109615922, 0.05002355948090553, 0.05446113273501396, 0.003279854543507099, 0.06958922743797302, -0.02696162275969982, 0.011404900811612606, 0.03151685744524002, 0.0049082254990935326, 0.00823220331221819, -0.03560144454240799, 0.009942518547177315, 0.07019434869289398, 0.0033638994209468365, -0.00248142727650702, 0.030138522386550903, 0.006374809890985489, 0.0035782139748334885, -0.0022587082348763943, 0.007164832670241594, 0.0658240094780922, -0.08108657598495483, -0.010917440056800842, -0.028692947700619698, 0.07557322829961777, 0.02395281381905079, -0.052712999284267426, -0.011530968360602856, 0.018607553094625473, 0.018557127565145493, -0.010867012664675713, -0.0071017988957464695, 0.009808046743273735, -0.02371748723089695, 0.007383349351584911, -0.017716677859425545, 0.0029688880313187838, 0.06542059779167175, 0.024894116446375847, -0.012068855576217175, -0.033517129719257355, -0.037080634385347366, 0.07590940594673157, 0.003634944325312972, 0.03590400516986847, 0.07496809959411621, 0.0015968541847541928, 0.018809260800480843, -0.03170175850391388, -0.045048099011182785, -0.08471731841564178, 0.004366135690361261, 0.028608903288841248, -0.012816855683922768, -0.037047017365694046, -0.0015369721222668886, -0.01645600236952305, 0.04003901779651642, -0.015363418497145176, -0.05557052791118622, -0.026423735544085503, -0.025263914838433266, 0.02417133003473282, -0.025600094348192215, -0.015329800546169281, -0.011001485399901867, -0.04619110748171806, -0.04639281705021858, 0.053452592343091965, 0.04457744583487511, -0.04003901779651642, -0.03650913015007973, 0.049149490892887115, -0.08189340680837631, -0.07893502712249756, 0.07362338155508041, 0.0703960582613945, 0.05799102038145065, 0.013161440379917622, 0.01399348583072424, 0.006589124910533428, 0.01575002446770668, -0.02420494705438614, -0.028776993975043297, -0.008824720978736877, -0.061117492616176605, -0.007938046008348465, 0.033416274935007095, -0.03113025240600109, -0.009219732135534286, 0.03210517391562462, 0.01589290238916874, -0.02828953228890896, 0.013766564428806305, 0.028810610994696617, 0.07221142947673798, 0.09681978821754456, -0.03281114995479584, 0.0027692813891917467, 0.01182512566447258, -0.02358301542699337, 0.07409403473138809, -0.017229216173291206, -0.025650521740317345, 0.04235865920782089, -0.07685071229934692, 0.07093394547700882, -0.025700947269797325, -0.04350167140364647, 0.006563911214470863, -0.053654301911592484, -0.040980320423841476, 0.002815506188198924, 0.045384276658296585, -0.0278524998575449, -0.012531103566288948, 0.009228136390447617, -0.05832720175385475, -0.0021704609971493483, -0.04054328799247742, 0.02808782458305359, -0.06336989998817444, 0.034239914268255234, -0.041619062423706055, -0.011127552017569542, 0.029735106974840164, 0.08733952045440674, -0.006992540322244167, 0.02425537444651127, -0.041484590619802475, -0.014380092732608318, -0.022860229015350342, -0.05953744798898697, 0.002920562168583274, 0.003866068087518215, 0.03220602869987488, 0.02339811623096466, -0.01554831676185131, -0.06350436806678772, 0.0636388435959816, 0.00973240565508604, 0.010245080105960369, -0.0003464228066150099, 0.02417133003473282, 0.03506355732679367, 0.03489546477794647, 0.025263914838433266, 0.025566475465893745, 0.04696432128548622, 0.03506355732679367, -0.02028845250606537, 0.029600633308291435, -0.053990479558706284, 0.022776182740926743, -0.04336719959974289, -0.06572315841913223, 0.02797016128897667, -0.026776723563671112, 0.0015170114347711205, 0.029062746092677116, 0.048746075481176376, -0.030054476112127304, -0.052612144500017166, -0.013909440487623215, 0.05409133434295654, 0.04242589324712753, -0.02770121768116951, 0.08969277888536453, -0.0013510227436199784, 0.01995227299630642, 0.037820231169462204, 0.026776723563671112, -0.045417893677949905, -0.014632226899266243, -0.005303236655890942, -0.05610841512680054, -0.00776155199855566, -0.04595578461885452, 0.011262024752795696, -0.004357730969786644, -0.0543602779507637, 0.013060586526989937, -0.0070975967682898045, -0.021767644211649895, -0.060579605400562286, 0.008698653429746628, 0.004614068195223808, 0.025499239563941956, 0.010261889547109604, -0.02317960001528263, -0.005727664101868868, -0.018826071172952652, -0.018220946192741394, -0.004593057092279196, 0.00010131356975762174, 0.03637465834617615, -0.045283421874046326, 0.056679919362068176, -0.014312855899333954, 0.004475393798202276, -0.028608903288841248, 0.017514968290925026, -0.0012375620426610112, -0.033786073327064514, -0.06010895222425461, 0.0058579337783157825, -0.10925844311714172, 0.02696162275969982, 0.01991865411400795, 0.04736773669719696, 0.03252539783716202, -0.041282884776592255, -0.004132910631597042, -0.033786073327064514, 0.06400863826274872, -0.046762615442276, -0.013909440487623215, -0.04602301865816116, 0.04030796140432358, 0.006639551836997271, 0.06925304234027863, 0.029953623190522194, -0.04219057038426399, -0.02383515052497387, -0.009875282645225525, -0.034223105758428574, -0.025700947269797325, 0.00813555158674717, -0.022271914407610893, -0.04834266006946564, 0.022557666525244713, 0.05009079352021217, 0.02025483548641205, 0.022154251113533974, -0.014674250036478043, -0.06259668618440628, 0.0004089312569703907, 0.010572855360805988, -0.09144091606140137, -0.030827689915895462, -0.018153710290789604, 0.022608093917369843, 0.08296918123960495, 0.02412090264260769, -0.012690789066255093, 0.028339959681034088, -0.03472737595438957, -0.008429708890616894, 0.0006319130188785493, 0.038122791796922684, 0.02835676819086075, 0.014867553487420082, -0.006433641538023949, -0.06794194132089615, 0.021095285192131996, 0.056646302342414856, -0.003218921832740307, 0.018304992467164993, 0.013010159134864807, -0.015615553595125675, 0.007366540376096964, -0.041350118815898895, 0.060949403792619705, 0.0842466652393341, 0.03415587171912193, 0.03973645716905594, 0.03876153379678726, 0.015077665448188782, -0.00004576510764309205, -0.010404765605926514, 0.05856252834200859, -0.05923488736152649, 0.005471326876431704, 0.005811708979308605, 0.04235865920782089, -0.030020859092473984, -0.03613933175802231, 0.018557127565145493, 0.002618000376969576, -0.05799102038145065, 0.028592094779014587, 0.014548182487487793, -0.06579039245843887, 0.025112632662057877, -0.0240536667406559, -0.026390116661787033, 0.01944800280034542, 0.024894116446375847, -0.04249313101172447, 0.017834339290857315, -0.010413169860839844, 0.0320715568959713, 0.004076180513948202, -0.009051642380654812, -0.033920545130968094, 0.014775103889405727, 0.014245619997382164, 0.06841259449720383, 0.016935059800744057, 0.016708137467503548, -0.04299740120768547, -0.0644792914390564, 0.10004711896181107, -0.06790832430124283, 0.06269753724336624, 0.0004819453170057386, -0.002931067952886224, 0.006916900165379047, 0.03506355732679367, 0.04252674803137779, -0.03425672650337219, -0.022658521309494972, 0.026121173053979874, -0.02818867936730385, 0.020490160211920738, -0.010505619458854198, -0.06525250524282455, -0.03455928713083267, 0.0546964593231678, -0.02746589295566082, -0.05254490673542023, -0.08182617276906967, -0.024507509544491768, 0.010640091262757778, -0.01568278856575489, 0.020792722702026367, 0.022305531427264214, -0.020859958603978157, -0.016615688800811768, 0.020775914192199707, -0.033954162150621414, -0.022288722917437553, 0.0009996097069233656, -0.008623012341558933, -0.025902656838297844, -0.04225780442357063, 0.03272710740566254, 0.026070745661854744, -0.014791912399232388, 0.008400293067097664, -0.04998994246125221, 0.03533250093460083, -0.049620144069194794, -0.05930212140083313, 0.01924629509449005, 0.018624363467097282, 0.034223105758428574, 0.05241043493151665, 0.014447328634560108, 0.005559573881328106, -0.013035372830927372, -0.006916900165379047, 0.02415452152490616, 0.014657440595328808, -0.007980069145560265, -0.0012732810573652387, -0.041417356580495834, -0.007547236979007721, -0.010522428900003433, 0.0011734777363017201, -0.03158409520983696, -0.04400594159960747, -0.053318120539188385, -0.012346204370260239, -0.028743375092744827, 0.0045132143422961235, -0.0009276462369598448, 0.05846167355775833, -0.003111764555796981, 0.021028049290180206, 0.025095824152231216, 0.011102339252829552, 0.0317353755235672, 0.041417356580495834, 0.02006993629038334, -0.0024457082618027925, 0.007370742969214916, 0.0017418317729607224, 0.014094339683651924, -0.030138522386550903, 0.022944273427128792, -0.007685911376029253, -0.026205217465758324, 0.09433206170797348, 0.03146643191576004, -0.02346535213291645, -0.02025483548641205, 0.02028845250606537, -0.05634373798966408, -0.01646440662443638, 0.08431389927864075, 0.01980099268257618, 0.047771155834198, -0.030373847112059593, -0.014758294448256493, 0.0035298881120979786, 0.011186383664608002, 0.01188395731151104, 0.04047605022788048, 0.010984675958752632, 0.041450973600149155, -0.037517670542001724, -0.005353663582354784, -0.02746589295566082, 0.00012166820670245215, -0.037013400346040726, -0.04286292940378189, -0.03960198536515236, -0.010782968252897263, -0.030441083014011383, -0.018590744584798813, -0.05183893069624901, 0.053250886499881744, -0.03205474838614464, 0.005698248278349638, 0.07792648673057556, -0.0029331690166145563, -0.0039648208767175674, 0.02043973281979561, -0.048746075481176376, -0.024944543838500977, -0.022961081936955452, 0.004920832347124815, 0.0024688206613063812, -0.03872791677713394, -0.022103823721408844, -0.04326634481549263, -0.018994159996509552, 0.0071017988957464695, 0.01959928497672081, -0.03254220634698868, -0.053856007754802704, 0.011673844419419765, 0.005962989758700132, 0.0557049997150898, -0.03242454305291176, -0.04753582924604416, 0.01959928497672081, -0.06004171818494797, 0.04333357885479927, -0.05425942316651344, -0.025347959250211716, -0.049283962696790695, -0.003542494960129261, 0.01946481131017208, 0.007597664371132851, -0.013127822428941727, -0.06868153810501099, -0.02390238642692566, 0.029869578778743744, -0.03435757756233215, 0.04249313101172447, 0.025633711367845535, 0.012052047066390514, 0.008908765390515327, -0.01991865411400795, -0.0398373082280159, -0.017716677859425545, -0.005584787577390671, -0.00246251723729074, -0.004166528582572937, 0.026272453367710114, 0.005046899896115065, 0.008076720871031284, 0.02413771115243435, 0.052612144500017166, 0.021734025329351425, 0.028877846896648407, -0.07853160798549652, 0.06394140422344208, 0.02413771115243435, 0.005303236655890942, -0.012766429223120213, 0.04286292940378189, -0.017985621467232704, 0.0022776182740926743, -0.02800378017127514, -0.014531373046338558, -0.012472271919250488, 0.009009619243443012, 0.03936665877699852, 0.03896324336528778, -0.015430654399096966, 0.0041224053129553795, 0.029079554602503777, 0.00963995698839426, -0.012825260870158672, -0.0015516800340265036, -0.03671083599328995, -0.057083334773778915, -0.07234589755535126, -0.0240536667406559, -0.029314881190657616, 0.06343713402748108, 0.0052906302735209465, 0.024641981348395348, 0.005025888327509165, 0.013077395036816597, 0.04451020807027817, -0.05079677328467369, -0.0009208175470121205, -0.053822390735149384, 0.04797286167740822, 0.045754075050354004, -0.03869429975748062, 0.02753312885761261, -0.025885846465826035, -0.010488810949027538, 0.06407587230205536, 0.04262760281562805, 0.02297789230942726, 0.033349040895700455, 0.018977351486682892, 0.03116386942565441, -0.038122791796922684, 0.008484338410198689, 0.018052857369184494, -0.006984136067330837, -0.01407753024250269, 0.07402680069208145, 0.0135480472818017, -0.01980099268257618, -0.025314340367913246, 0.008614608086645603, 0.01170746237039566, 0.045619603246450424, 0.008475934155285358, -0.009681979194283485, 0.056612685322761536, -0.06878239661455154, -0.06753852963447571, 0.03462652117013931, -0.06891686469316483, -0.006769821513444185, -0.03113025240600109, 0.0028512252029031515, -0.026238836348056793, -0.049082256853580475, 0.05933573842048645, -0.02815506048500538, 0.012430249713361263, -0.022137442603707314, 0.06874877214431763, 0.018372228369116783, -0.04373699426651001, 0.0631345734000206, 0.04619110748171806, 0.002815506188198924, -0.013119418174028397, 0.01917905919253826, -0.00499227037653327, -0.018910115584731102, 0.020944003015756607, 0.021818071603775024, -0.030020859092473984, 0.03929942101240158, -0.017851149663329124, -0.061285581439733505, -0.0032315286807715893, -0.0028596296906471252, 0.011514158919453621, 0.012489080429077148, 0.00011129390622954816, -0.021851688623428345, -0.05123380571603775, 0.01912863180041313, -0.04619110748171806, -0.042022477835416794, -0.0014424215769395232, 0.024591553956270218, 0.057385895401239395, 0.04474553465843201, 0.04235865920782089, -0.03119748830795288, -0.029499780386686325, -0.02348216064274311, 0.06478185206651688, 0.01579204760491848, 0.02815506048500538, -0.01209406927227974, -0.033567555248737335, -0.012052047066390514, -0.029331689700484276, -0.005647821351885796, 0.013438789173960686, 0.07086671143770218, -0.049485672265291214, -0.01552310399711132, 0.03141600638628006, 0.010219866409897804, 0.05170445889234543, -0.01909501478075981, -0.04656090587377548, 0.01625429466366768, -0.014329665340483189, -0.03435757756233215, -0.053587064146995544, -0.00800107978284359, -0.03197070211172104, 0.026911195367574692, -0.01978418231010437, -0.028676139190793037, -0.0031874049454927444, 0.015296182595193386, -0.05113295093178749, -0.012800047174096107, -0.01579204760491848, -0.022843418642878532, -0.041417356580495834, -0.005521753802895546, -0.06283201277256012, -0.022221487015485764, 0.00046933855628594756, -0.026675868779420853, 0.025448814034461975, 0.07624558359384537, 0.045754075050354004, -0.011203193105757236, 0.0038639670237898827, -0.00399633776396513, -0.018405845388770103, -0.02005312778055668, 0.01188395731151104, -0.004158124327659607, 0.04393870383501053, -0.04649367183446884, -0.02694481424987316, -0.00591256283223629, 0.034374386072158813, -0.014371687546372414, 0.018069665879011154, 0.006664765067398548, -0.03546697273850441, -0.005496540106832981, 0.01356485579162836, 0.017279643565416336, 0.03176899254322052, -0.00296048354357481, -0.03940027579665184, 0.11423390358686447, -0.0469307042658329, -0.025297531858086586, -0.013413575477898121, 0.026053937152028084, 0.04282930865883827, -0.04407317563891411, -0.03960198536515236, -0.053116414695978165, -0.013850608840584755, -0.003328180406242609, -0.021296992897987366, 0.08498626202344894, 0.009043237194418907, -0.01589290238916874, -0.001055814791470766, -0.01190917007625103, 0.04380423203110695, -0.037080634385347366, 0.012858878821134567, -0.030020859092473984, -0.03452567011117935, -0.018943732604384422, 0.011673844419419765, -0.013959867879748344, -0.004349326714873314, 0.002384775783866644, -0.025936273857951164, -0.018573936074972153, 0.009488675743341446, 0.018304992467164993, -0.012136091478168964, -0.04666176065802574, -0.010707327164709568, -0.02815506048500538, -0.022893846035003662, 0.049586523324251175, 0.018036048859357834, -0.03092854470014572, -0.028793802484869957, 0.01209406927227974, 0.06444567441940308, -0.0016178654041141272, -0.05449474975466728, -0.014934789389371872, 0.09298734366893768, 0.09365969896316528, 0.0013510227436199784, 0.037013400346040726, 0.06925304234027863, -0.024288993328809738, -0.016422385349869728, 0.024457082152366638, -0.079338438808918, 0.026003509759902954, 0.003107562428340316, 0.045014478266239166, 0.025667330250144005, 0.016355149447917938, 0.012589934282004833, -0.03825726360082626, -0.0017407812410965562, 0.06142005696892738, -0.02438984625041485, 0.04377061501145363, -0.015380227006971836, -0.0015222643269225955, 0.026827150955796242, -0.04363614320755005, 0.06891686469316483, -0.0014224608894437551, 0.008606203831732273, 0.016615688800811768, -0.03430715203285217, -0.015422250144183636, 0.03973645716905594, -0.02023802511394024, 0.0031390790827572346, 0.026675868779420853, 0.03990454599261284 ]
716,687
pytorch_optimizer.optimizer.gsam
set_closure
Set closure. Create `self.forward_backward_func`, which is a function such that `self.forward_backward_func()` automatically performs forward and backward passes. This function does not take any arguments, and the inputs and targets data should be pre-set in the definition of partial-function. :param loss_fn: nn.Module. loss function. :param inputs: torch.Tensor. inputs. :param targets: torch.Tensor. targets.
@torch.no_grad() def perturb_weights(self, rho: float): grad_norm = self.grad_norm(weight_adaptive=self.adaptive) for group in self.param_groups: scale = rho / (grad_norm + self.perturb_eps) for p in group['params']: if p.grad is None: continue self.state[p]['old_g'] = p.grad.clone() e_w = (torch.pow(p, 2) if self.adaptive else 1.0) * p.grad * scale.to(p) p.add_(e_w) # climb to the local maximum "w + e(w)" self.state[p]['e_w'] = e_w
(self, loss_fn: torch.nn.modules.module.Module, inputs: torch.Tensor, targets: torch.Tensor, **kwargs)
[ -0.02999388985335827, -0.00732553331181407, -0.026073932647705078, 0.008664704859256744, -0.030650172382593155, 0.006274593994021416, -0.001816971693187952, -0.033612314611673355, -0.04487554356455803, 0.022632881999015808, -0.033399466425180435, -0.015431510284543037, 0.027688032016158104, 0.0467202290892601, -0.057398125529289246, 0.00338340294547379, -0.02199433743953705, 0.05587271228432655, 0.007130422163754702, -0.03664540499448776, -0.00937419943511486, -0.07492264360189438, -0.01860649883747101, 0.07336175441741943, -0.06953048706054688, -0.07336175441741943, -0.010385229252278805, -0.016034580767154694, -0.03458786755800247, 0.030650172382593155, -0.0037558877374976873, -0.03529736399650574, 0.044627219438552856, 0.04434342309832573, 0.02861037477850914, -0.02029155008494854, 0.020149650052189827, 0.07818631827831268, -0.07584498822689056, -0.008961805142462254, -0.019156357273459435, -0.020646296441555023, 0.00466492772102356, -0.028095992282032967, 0.03263675794005394, 0.0351732037961483, 0.04430794715881348, 0.05033865198493004, 0.017737368121743202, 0.012354076839983463, 0.02506290189921856, 0.0026428678538650274, 0.024672679603099823, 0.01632724702358246, -0.004015296697616577, 0.024654941633343697, 0.03125324472784996, -0.0461881086230278, 0.011227753944694996, -0.07470979541540146, 0.057823821902275085, -0.06250648945569992, 0.02124936692416668, -0.06151319295167923, -0.021799225360155106, -0.053105682134628296, -0.00805719941854477, 0.0023191608488559723, 0.015342824161052704, -0.008939634077250957, 0.010136906057596207, -0.020894620567560196, -0.00998613890260458, 0.012300864793360233, -0.045265763998031616, -0.004217059351503849, 0.01901445910334587, -0.011307572945952415, -0.025506336241960526, 0.0030929537024348974, -0.015715308487415314, 0.02399865910410881, -0.03368326276540756, 0.01144060306251049, -0.08301088213920593, -0.05033865198493004, -0.011130198836326599, -0.03746132180094719, 0.02437114529311657, -0.07094947248697281, -0.0107311075553298, 0.00017099932301789522, 0.04381129890680313, 0.02373259887099266, 0.06686987727880478, 0.048387542366981506, -0.05296378210186958, 0.001441161148250103, -0.06424474716186523, -0.07485169917345047, -0.04146996885538101, 0.008793300949037075, 0.02781219407916069, 0.024832315742969513, 0.011360784992575645, -0.041186168789863586, 0.0008369821007363498, -0.04409509897232056, 0.02023833803832531, 0.012726562097668648, -0.05377970263361931, 0.0006501853931695223, -0.054595619440078735, -0.00791973527520895, 0.004695968236774206, -0.046223580837249756, -0.004248099867254496, 0.01057147141546011, 0.02930213324725628, 0.025524074211716652, 0.044591743499040604, 0.016087792813777924, -0.04508839175105095, -0.047713521867990494, -0.048032794147729874, 0.05693695321679115, 0.052254289388656616, -0.011467209085822105, -0.010340886190533638, 0.010083694010972977, -0.04076047241687775, 0.02791861817240715, -0.04434342309832573, 0.004483120050281286, 0.04668475314974785, -0.04551408812403679, -0.040299300104379654, 0.008363169617950916, 0.11110688000917435, 0.01003935094922781, 0.025311224162578583, 0.020646296441555023, 0.008230138570070267, 0.019457893446087837, 0.051686692982912064, 0.0019045500084757805, 0.01991906575858593, 0.014739753678441048, -0.02903607301414013, 0.00816362351179123, -0.015413773246109486, 0.05590818449854851, 0.06360620260238647, 0.034038010984659195, -0.01512110698968172, 0.025470862165093422, -0.0006767914746887982, -0.005285735707730055, -0.03373647481203079, -0.039447907358407974, -0.021905649453401566, -0.0018291660817340016, -0.00791973527520895, 0.022242659702897072, -0.04349202662706375, -0.02823789045214653, 0.018571024760603905, -0.024353407323360443, -0.001792582799680531, 0.015316218137741089, -0.006287897005677223, -0.07747682929039001, -0.01430518738925457, 0.044911015778779984, 0.036272916942834854, 0.08549411594867706, 0.01885482296347618, -0.034676555544137955, -0.03212237358093262, 0.022349083796143532, 0.04164734110236168, -0.045265763998031616, 0.0439886748790741, -0.03407348692417145, 0.013977046124637127, 0.017666419968008995, 0.005303473211824894, -0.001716090366244316, -0.015005813911557198, -0.02272156998515129, 0.0418601892888546, -0.031714413315057755, -0.004021948203444481, 0.005862200167030096, 0.06669250875711441, 0.0595620833337307, 0.04015740379691124, -0.0467202290892601, 0.02277478203177452, 0.02559502236545086, -0.00660716975107789, -0.048813238739967346, -0.030118051916360855, 0.02680116333067417, -0.007245715241879225, -0.025896558538079262, 0.002050883136689663, 0.0488487146794796, 0.019191833212971687, 0.003915524110198021, 0.012974885292351246, 0.011130198836326599, 0.024867791682481766, 0.023377852514386177, -0.007223543245345354, -0.0493808351457119, -0.01802116632461548, -0.00010372203541919589, 0.058781638741493225, -0.02717364951968193, -0.06860814243555069, -0.0025785700418055058, 0.05388612672686577, 0.012575794011354446, 0.030756596475839615, -0.010846400633454323, -0.02972782962024212, -0.01864197477698326, -0.007715755142271519, -0.009037189185619354, 0.04636548087000847, 0.0015320652164518833, -0.013356238603591919, -0.0031661202665418386, 0.05392159894108772, 0.03254806995391846, -0.08308183401823044, -0.02474362961947918, -0.02935534529387951, 0.02781219407916069, -0.02373259887099266, 0.0017648681532591581, -0.016806157305836678, 0.00712598767131567, -0.017897004261612892, -0.03990907967090607, 0.06445759534835815, 0.015369430184364319, 0.01425197534263134, 0.00495315995067358, -0.03386063501238823, -0.04079594835639, -0.049238935112953186, 0.01901445910334587, -0.04104427248239517, -0.037745121866464615, 0.05101267248392105, 0.05934923514723778, -0.01186629943549633, -0.0558372363448143, 0.021373528987169266, -0.04973558336496353, 0.0020752721466124058, 0.051473844796419144, 0.00047087171697057784, 0.03675182908773422, -0.0029843123629689217, -0.0010686764726415277, -0.013977046124637127, 0.01414555124938488, 0.06254196166992188, 0.03969623148441315, -0.035847220569849014, -0.0182340145111084, 0.0013269769260659814, 0.04076047241687775, 0.028468476608395576, 0.0671536773443222, 0.002696080133318901, 0.011032643727958202, 0.001918961526826024, -0.0714106485247612, -0.006314503028988838, 0.010642421431839466, -0.02272156998515129, 0.06474139541387558, -0.02653510309755802, 0.022473245859146118, 0.026996275410056114, 0.003924392629414797, 0.008970674127340317, 0.011165673844516277, -0.0017094388604164124, -0.029497243463993073, 0.01790587417781353, -0.022278135642409325, -0.01497033890336752, -0.00696635153144598, 0.0027138174045830965, 0.010535997338593006, 0.03898673504590988, 0.01673520728945732, 0.018109852448105812, 0.013799672946333885, -0.024974215775728226, 0.005161574110388756, 0.0827270895242691, -0.012442763894796371, 0.013303026556968689, -0.041718289256095886, -0.025683710351586342, 0.014331793412566185, 0.0190676711499691, 0.0595620833337307, 0.019617529585957527, -0.09798122197389603, 0.03277865797281265, -0.034995827823877335, -0.010855269618332386, 0.052999258041381836, -0.04874229058623314, 0.03162572905421257, -0.009347593411803246, 0.025258012115955353, -0.07094947248697281, -0.0037514534778892994, 0.02013191394507885, 0.056866005063056946, -0.018872560933232307, -0.017781712114810944, -0.07584498822689056, 0.00917021930217743, 0.04629453271627426, 0.03247712180018425, -0.045904308557510376, 0.007640371564775705, 0.06059085205197334, 0.03792249411344528, -0.003527519293129444, -0.06612490862607956, 0.010278805159032345, 0.02866358682513237, -0.005285735707730055, 0.03781607002019882, -0.0017571080243214965, 0.003633943386375904, -0.005844463128596544, 0.01387949101626873, 0.03739037364721298, -0.024779103696346283, -0.004864473361521959, 0.02077045850455761, -0.04970010742545128, 0.057930245995521545, 0.05119004473090172, 0.01834043860435486, -0.02399865910410881, -0.003053044667467475, -0.005498584359884262, 0.0018003429286181927, -0.014260844327509403, 0.005498584359884262, -0.03916411101818085, 0.06623133271932602, 0.08343657851219177, -0.013498137705028057, -0.01191951148211956, 0.026446416974067688, 0.02479684166610241, -0.02988746576011181, 0.019032197073101997, -0.03639708086848259, -0.033293042331933975, 0.01197272352874279, -0.02346653863787651, 0.00921456329524517, -0.07123327255249023, -0.009897451847791672, 0.06509613990783691, 0.010509391315281391, -0.0003838477423414588, -0.018925772979855537, 0.01486391481012106, 0.021018782630562782, -0.023058578372001648, -0.07020450383424759, 0.06740199774503708, -0.029071547091007233, -0.005161574110388756, -0.028273366391658783, 0.05629840865731239, -0.023750336840748787, 0.006438664626330137, 0.048600390553474426, -0.029710091650485992, 0.03453465551137924, 0.0071392906829714775, 0.007068341597914696, -0.09869071841239929, -0.009006149135529995, -0.0010492762085050344, -0.0827270895242691, -0.07272320985794067, 0.014881651848554611, -0.030171263962984085, -0.043740350753068924, 0.004004211165010929, 0.0783282220363617, 0.06066180020570755, 0.02722686156630516, 0.005866634659469128, 0.06509613990783691, -0.034942615777254105, 0.0005013578338548541, 0.005871069151908159, -0.005817857105284929, 0.04533671587705612, -0.03222879767417908, 0.014393874444067478, 0.029656879603862762, 0.06804054230451584, -0.033931586891412735, -0.001763759646564722, 0.026730215176939964, 0.048919662833213806, -0.046436432749032974, 0.005955321714282036, -0.013187733478844166, -0.023289164528250694, 0.03602459654211998, -0.025470862165093422, -0.020788196474313736, 0.03183857724070549, -0.028379790484905243, 0.026996275410056114, 0.01285072322934866, 0.0370001494884491, 0.061584144830703735, 0.01459785457700491, 0.008762259967625141, 0.008017290383577347, -0.010606946423649788, -0.018730660900473595, -0.071871817111969, 0.015511329285800457, -0.008921896107494831, 0.011405128054320812, -0.05296378210186958, -0.06885646283626556, 0.029958415776491165, 0.022863468155264854, -0.03636160492897034, 0.06310955435037613, -0.04054762423038483, -0.0053345137275755405, 0.019528843462467194, -0.02298763021826744, -0.044059623032808304, 0.017187509685754776, -0.0009711209568195045, 0.05736264958977699, -0.007037301082164049, 0.014881651848554611, -0.003888918086886406, -0.033239830285310745, -0.0018136459402740002, 0.051154572516679764, -0.043421078473329544, 0.0054409378208220005, -0.027244597673416138, 0.06342882663011551, 0.015236400067806244, 0.026286780834197998, -0.039022210985422134, -0.045904308557510376, -0.019156357273459435, -0.02855716273188591, 0.045017439872026443, 0.019936801865696907, -0.07279416173696518, -0.014447086490690708, -0.01599910669028759, 0.0638190507888794, 0.04217946156859398, 0.004312397912144661, -0.0073166643269360065, 0.01326755154877901, 0.015032419934868813, 0.02522253803908825, 0.03412669897079468, -0.02770576998591423, -0.056759580969810486, 0.04530123993754387, 0.06264838576316833, -0.0488487146794796, -0.024193771183490753, 0.03373647481203079, 0.004161630291491747, 0.05275093391537666, -0.012629006057977676, 0.0370711013674736, 0.008921896107494831, 0.021799225360155106, -0.02653510309755802, -0.025027427822351456, 0.002957706106826663, 0.0005667643272317946, 0.028273366391658783, -0.034995827823877335, 0.054382771253585815, 0.01626516692340374, -0.03268996998667717, -0.05587271228432655, 0.014278581365942955, 0.005946452729403973, -0.006682553794234991, -0.024193771183490753, 0.044911015778779984, 0.03293829411268234, -0.05129646882414818, 0.03178536519408226, 0.0364680290222168, -0.004474251065403223, 0.018411388620734215, 0.030916232615709305, 0.039873603731393814, -0.005582836922258139, -0.011059249751269817, 0.022544195875525475, 0.014952601864933968, 0.01247823890298605, 0.022579669952392578, 0.04785542190074921, -0.002095226664096117, 0.004860038869082928, -0.028113728389143944, -0.023768074810504913, -0.08364942669868469, -0.07470979541540146, -0.03010031394660473, -0.011316440999507904, -0.02282799407839775, 0.044911015778779984, -0.05346043035387993, 0.0014001434901729226, 0.01858876273036003, -0.006527351681143045, -0.03625518083572388, -0.03586496040225029, -0.03471203148365021, -0.04037025198340416, -0.020734984427690506, -0.07698018103837967, 0.03013578988611698, -0.007706886623054743, -0.027688032016158104, -0.020220600068569183, -0.020681772381067276, -0.005946452729403973, 0.009879713878035545, 0.014447086490690708, -0.1074175015091896, 0.057930245995521545, 0.049664631485939026, -0.006593866739422083, 0.022366821765899658, -0.0027138174045830965, 0.04877776280045509, -0.03511998802423477, -0.02357296273112297, -0.01837591454386711, 0.020273812115192413, 0.006691422313451767, -0.0010149100562557578, -0.0015775172505527735, -0.021479953080415726, 0.058249518275260925, -0.045691460371017456, -0.004545200616121292, -0.03185631334781647, 0.020486660301685333, -0.02554181031882763, -0.021018782630562782, -0.012061410583555698, -0.003230418311432004, 0.045797884464263916, -0.02759934589266777, 0.06747294962406158, 0.0182340145111084, 0.01449143048375845, -0.06161961704492569, -0.020060963928699493, 0.0012349642347544432, -0.06172604113817215, -0.016779551282525063, -0.009737815707921982, -0.06963691115379333, -0.019351469352841377, 0.05392159894108772, 0.024601729586720467, -0.024388881400227547, -0.029639143496751785, 0.04973558336496353, 0.019298257306218147, -0.02389223501086235, -0.0579657219350338, 0.020734984427690506, 0.019511105492711067, 0.026570579037070274, -0.025506336241960526, 0.007800007704645395, -0.029479507356882095, 0.028699062764644623, -0.0012926107738167048, -0.03240617364645004, -0.025098375976085663, -0.03391384705901146, -0.046010732650756836, 0.0869840532541275, 0.025683710351586342, -0.0944337472319603, 0.010952824726700783, 0.005471978336572647, 0.0016850499669089913, -0.013844016008079052, -0.015413773246109486, 0.04370487481355667, -0.07953435927629471, -0.039447907358407974, -0.009666865691542625, -0.057398125529289246, -0.0357053242623806, 0.003656115150079131, 0.01970621570944786, -0.0029177970718592405, 0.006026270799338818, 0.023502012714743614, -0.0005997447879053652, -0.03263675794005394, -0.08208854496479034, 0.0024366709403693676, 0.033807422965765, 0.016832763329148293, -0.033807422965765, 0.0014245323836803436, 0.022313609719276428, 0.002600741572678089, -0.024761365726590157, -0.044414371252059937, -0.017249591648578644, -0.019138621166348457, -0.015812864527106285, -0.05133194476366043, 0.006549523212015629, 0.00504628149792552, 0.05346043035387993, 0.012726562097668648, 0.043101806193590164, 0.02162185311317444, -0.006580563727766275, 0.011502683162689209, -0.022189447656273842, 0.015112238004803658, -0.01885482296347618, 0.03265449404716492, 0.020681772381067276, -0.06562826037406921, -0.021763751283288002, -0.048245642334222794, -0.06584110856056213, -0.018978985026478767, 0.0010221158154308796, -0.023608436807990074, -0.012495975941419601, -0.004722574260085821, 0.042782533913850784, -0.01818080246448517, 0.005844463128596544, -0.03157251700758934, 0.006274593994021416, 0.06726010143756866, 0.02447756938636303, -0.0370001494884491, 0.034144435077905655, 0.06999165564775467, 0.0013713203370571136, -0.03444597125053406, 0.027936356142163277, 0.028149204328656197, 0.01716090366244316, -0.01944015547633171, -0.07641258090734482, 0.018978985026478767, 0.04572693631052971, 0.034995827823877335, -0.02605619467794895, 0.005942018702626228, -0.02453078143298626, 0.03824176639318466, -0.004864473361521959, 0.007800007704645395, -0.017205247655510902, -0.0230940543115139, 0.003871180582791567, 0.024335669353604317, 0.003922175616025925, 0.06240006163716316, 0.01600797474384308, 0.019475631415843964, 0.010748845525085926, -0.039235059171915054, 0.03668087720870972, -0.01589268259704113, 0.007157028187066317, 0.00821683555841446, 0.06686987727880478, 0.0021983252372592688, -0.01486391481012106, -0.02564823441207409, 0.017152035608887672, -0.024938739836215973, -0.0019732823129743338, 0.042995382100343704, 0.03389611095190048, -0.03231748566031456, -0.006247987970709801, 0.054382771253585815, 0.04210851341485977, -0.04920345917344093, -0.016779551282525063, 0.030632436275482178, -0.03877388685941696, -0.02527575008571148, -0.005267998669296503, 0.02087688259780407, 0.05026770383119583, 0.09202146530151367, 0.03018900193274021, -0.057930245995521545, 0.0644930750131607, 0.0000074959434641641565, 0.03990907967090607, -0.021391266956925392, -0.03575853630900383, 0.06623133271932602, 0.009436280466616154, -0.005161574110388756, -0.008695744909346104, 0.0730779618024826, -0.06804054230451584, 0.10578566789627075, 0.05186406522989273, 0.04636548087000847, -0.01802116632461548, 0.06321597844362259, -0.028433002531528473, 0.04842301458120346, -0.06676345318555832, -0.09351141005754471, -0.04324370622634888, 0.0067579373717308044, -0.030330900102853775, 0.01154702715575695, 0.06999165564775467, -0.010473916307091713, 0.004540766589343548, 0.06261291354894638, -0.024867791682481766 ]
716,705
pytorch_optimizer.optimizer.shampoo_utils
Graft
Base class to perform grafting onto Shampoo. This class does no grafting.
class Graft: r"""Base class to perform grafting onto Shampoo. This class does no grafting.""" def __init__(self, *args): pass def add_statistics(self, grad: torch.Tensor, unused_beta2: float): r"""Add the statistics.""" pass def precondition_gradient(self, grad: torch.Tensor) -> torch.Tensor: r"""Get preconditioned gradient.""" return grad def update_momentum(self, update: torch.Tensor, unused_beta1: float) -> torch.Tensor: # noqa: ARG002 r"""Update momentum.""" return update
(*args)
[ -0.020434850826859474, -0.07969781011343002, -0.04597368836402893, 0.006748604588210583, 0.013327076099812984, -0.030586112290620804, -0.04756159335374832, 0.03207950294017792, 0.01761820539832115, 0.00912101287394762, -0.014206096529960632, 0.01419664453715086, -0.044158935546875, 0.06211740896105766, -0.06344066560268402, 0.014054867438971996, 0.016786444932222366, 0.006805315613746643, 0.023440532386302948, -0.03905494883656502, 0.020359236747026443, -0.021512359380722046, -0.012230664491653442, 0.10404571145772934, -0.04056724160909653, 0.057920798659324646, 0.03264661133289337, -0.021512359380722046, -0.022325215861201286, -0.017306296154856682, 0.01148397009819746, -0.03610597923398018, 0.041777078062295914, 0.017986826598644257, -0.0236295685172081, -0.02300574816763401, -0.019319534301757812, 0.03858235850930214, -0.0747828558087349, 0.015633322298526764, 0.016559600830078125, -0.0020723131019622087, 0.033761925995349884, -0.03013242594897747, 0.0395086370408535, 0.015822358429431915, 0.03780730813741684, 0.05478278920054436, -0.04381867125630379, 0.008435755968093872, -0.008766570128500462, -0.012211760506033897, -0.0037381977308541536, 0.0013197113294154406, -0.04313813894987106, 0.054518140852451324, 0.07470723986625671, 0.050056878477334976, 0.01805298961699009, 0.001005438156425953, 0.04404551535844803, 0.019395150244235992, 0.040264785289764404, -0.033024683594703674, 0.014612524770200253, -0.0027126744389533997, -0.05629508197307587, -0.025898005813360214, 0.0007053426234051585, 0.07500970363616943, -0.003433376317843795, 0.03196607902646065, -0.002509460086002946, 0.03559558093547821, 0.009154094383120537, 0.003116740146651864, 0.013034069910645485, -0.010567142628133297, 0.003610597923398018, -0.024007640779018402, 0.06177714467048645, -0.02455584704875946, -0.03351617977023125, -0.003293961752206087, 0.00551041541621089, -0.07485847175121307, 0.027183454483747482, -0.047977473586797714, 0.005439526401460171, -0.05224969983100891, -0.05202285572886467, 0.01107754185795784, 0.006299642845988274, -0.02466926909983158, 0.06827999651432037, -0.014971693977713585, -0.07682444900274277, -0.05569016560912132, -0.03750485181808472, 0.011332741007208824, -0.04461262375116348, 0.1328548789024353, -0.017249584197998047, 0.03803415223956108, 0.035463254898786545, -0.007925356738269329, -0.026408405974507332, -0.0453309640288353, -0.014385680668056011, -0.01214559841901064, -0.022457541897892952, 0.01739136129617691, -0.0422307625412941, 0.012977358885109425, 0.01018906943500042, -0.07024598121643066, -0.016531245782971382, 0.035028472542762756, 0.009603056125342846, 0.01109644491225481, 0.03587913513183594, -0.0034664575941860676, -0.007963164709508419, 0.03315700963139534, 0.018024634569883347, 0.03803415223956108, 0.044915083795785904, 0.005557674448937178, 0.028639037162065506, -0.06000019982457161, -0.0565597340464592, 0.02141784131526947, -0.03850674256682396, 0.022098371759057045, 0.01148397009819746, 0.009697575122117996, 0.07013256102800369, 0.008057682774960995, 0.01975431852042675, 0.0313800647854805, -0.011172059923410416, -0.014555813744664192, 0.03196607902646065, -0.00456050643697381, -0.050019070506095886, 0.015983039513230324, 0.01839325577020645, -0.007117225788533688, 0.006403612904250622, -0.0034239243250340223, 0.030888572335243225, 0.008057682774960995, 0.0383366122841835, -0.0034286503214389086, -0.003610597923398018, 0.008388496935367584, 0.0024291195441037416, -0.03323262557387352, 0.0046408469788730145, 0.0333082377910614, -0.03529312461614609, -0.006091702729463577, 0.0203403327614069, 0.0038090862799435854, 0.018109701573848724, -0.01832709275186062, 0.052665580064058304, -0.07134239375591278, -0.049716610461473465, 0.04234418645501137, 0.010708920657634735, -0.012580381706357002, -0.020586078986525536, 0.03094528242945671, 0.049943454563617706, 0.06903614848852158, -0.011143703944981098, 0.03973548114299774, 0.014518006704747677, -0.0141399335116148, 0.0014059592504054308, -0.041777078062295914, -0.05856352299451828, -0.033875349909067154, 0.01890365406870842, 0.004340751562267542, -0.009466004557907581, 0.012117242440581322, 0.013440498150885105, 0.025727873668074608, 0.014612524770200253, -0.018998172134160995, 0.01881858892738819, -0.0021538350265473127, 0.01024578046053648, 0.010604950599372387, -0.04204172641038895, -0.034763820469379425, 0.03587913513183594, 0.03931960090994835, -0.021758105605840683, -0.012126694433391094, 0.03722129389643669, -0.00491967611014843, -0.00007827294757589698, -0.017145615071058273, -0.008360140956938267, 0.014811012893915176, -0.0329301655292511, -0.025538837537169456, -0.04722132906317711, 0.008114393800497055, 0.0028001037426292896, 0.04234418645501137, 0.020113488659262657, -0.13255243003368378, 0.049867842346429825, -0.004123359452933073, 0.031115414574742317, 0.02669196017086506, 0.05432910472154617, -0.028563421219587326, -0.07587926834821701, 0.02517966739833355, -0.01465978380292654, 0.0519094355404377, 0.0111342528834939, -0.05984897166490555, -0.03347837179899216, -0.09013262391090393, 0.020434850826859474, -0.02037813887000084, -0.06155030056834221, 0.012504767626523972, 0.010406461544334888, -0.0029938663356006145, -0.014829916879534721, -0.00863897055387497, 0.010708920657634735, -0.024177774786949158, 0.014347873628139496, -0.014886627905070782, 0.031361162662506104, 0.09535003453493118, -0.0018301100935786963, -0.0321362130343914, 0.011294933967292309, 0.012863936834037304, -0.017949020490050316, 0.05508524924516678, -0.05807202681899071, -0.04699448496103287, -0.036540765315294266, 0.028449999168515205, -0.01634220965206623, -0.015529352240264416, -0.049943454563617706, 0.012211760506033897, -0.00030112930107861757, -0.026124849915504456, -0.018610646948218346, -0.070510633289814, -0.03187156096100807, 0.07742936909198761, 0.020831827074289322, -0.01696603000164032, 0.018138056620955467, -0.004768447019159794, 0.019121047109365463, 0.002870992524549365, 0.12567149102687836, 0.07587926834821701, -0.0313800647854805, -0.01619097962975502, -0.02425338886678219, -0.03661637753248215, -0.01925337128341198, 0.04132338985800743, 0.021701395511627197, -0.034536976367235184, 0.033062491565942764, -0.04937634617090225, 0.005614385474473238, -0.0035184426233172417, 0.0001767787034623325, 0.017750531435012817, -0.027221262454986572, -0.010255232453346252, 0.024461328983306885, -0.024574751034379005, 0.014707042835652828, 0.0503593347966671, 0.01673918589949608, -0.013591727241873741, 0.12446165829896927, 0.0023121533449739218, -0.0569378063082695, 0.05671096220612526, 0.008464111015200615, -0.0053544603288173676, 0.10351641476154327, -0.048355549573898315, -0.018988721072673798, 0.014414036646485329, -0.018175864592194557, -0.011408355087041855, 0.024688173085451126, 0.012240116484463215, 0.006134235765784979, -0.01109644491225481, 0.025595547631382942, -0.04408332332968712, -0.031852658838033676, 0.04264664277434349, 0.04926292225718498, -0.07538777589797974, 0.02625717595219612, -0.04204172641038895, -0.01334598008543253, 0.06945202499628067, -0.027126744389533997, -0.030850764364004135, 0.06272232532501221, 0.07727813720703125, -0.05168259143829346, -0.09958445280790329, -0.026049235835671425, 0.004990564659237862, -0.03837442025542259, 0.0036602201871573925, -0.08400783687829971, 0.004158804193139076, 0.07100212574005127, 0.023610664531588554, -0.09497196227312088, -0.000976491894107312, 0.04638956859707832, -0.00491967611014843, 0.015822358429431915, -0.033875349909067154, 0.08703242242336273, 0.02037813887000084, 0.02138003334403038, 0.06945202499628067, 0.04756159335374832, -0.005415896885097027, 0.013166395016014576, -0.05062398687005043, 0.03977328911423683, -0.0020037873182445765, -0.03610597923398018, -0.017268488183617592, -0.048015281558036804, 0.049905646592378616, 0.06945202499628067, 0.0032750582322478294, 0.023175880312919617, -0.051153287291526794, -0.02200385369360447, -0.05051056295633316, 0.03924398496747017, 0.019584186375141144, -0.03674870356917381, 0.05240093171596527, -0.03742923587560654, -0.01487717591226101, -0.008119119331240654, -0.03621940314769745, 0.038865912705659866, 0.007547284010797739, 0.05085083097219467, -0.03260880336165428, -0.08650312572717667, 0.02742920257151127, -0.05376199260354042, -0.034726012498140335, -0.03924398496747017, 0.01905488409101963, 0.010368654504418373, -0.008790199644863605, 0.08476398885250092, 0.005061453673988581, -0.031701426953077316, -0.00645087193697691, 0.029527507722377777, 0.035255316644907, 0.008213638328015804, -0.003279783995822072, 0.024536943063139915, -0.02323259226977825, -0.002344053238630295, -0.04597368836402893, 0.041852690279483795, -0.010037840344011784, -0.08075641095638275, 0.014187192544341087, 0.027013322338461876, 0.0031829029321670532, -0.029924485832452774, -0.010056744329631329, 0.06597375124692917, -0.02436681091785431, -0.015179635025560856, 0.003523168619722128, -0.010434817522764206, -0.07092650979757309, 0.025557741522789, 0.04253322258591652, 0.012485863640904427, 0.043402791023254395, 0.0003145686350762844, -0.0017190510407090187, -0.04370524734258652, 0.03219292312860489, 0.03143677860498428, -0.07969781011343002, -0.004324210807681084, -0.026484020054340363, -0.014357325620949268, 0.045104119926691055, 0.0010107547277584672, 0.07160704582929611, 0.05017029866576195, 0.03440465033054352, -0.020907441154122353, 0.015293056145310402, -0.07485847175121307, -0.004484891891479492, -0.03644624724984169, 0.013487757183611393, 0.006805315613746643, 0.019035980105400085, -0.02680538222193718, -0.022533155977725983, 0.01673918589949608, -0.02521747536957264, -0.023270398378372192, -0.02266548201441765, 0.012986810877919197, 0.03682431951165199, 0.03459368646144867, -0.014168289490044117, 0.033875349909067154, -0.041588038206100464, 0.030964186415076256, -0.04449920356273651, -0.014952790923416615, -0.0017072362825274467, 0.03427232429385185, 0.023383820429444313, 0.011304385028779507, 0.06665428727865219, 0.04710790514945984, 0.05625727400183678, -0.00883273221552372, -0.03973548114299774, -0.04124777391552925, -0.01843106374144554, -0.029149435460567474, 0.0024314825423061848, -0.02296794019639492, 0.017410265281796455, -0.07330837100744247, 0.013440498150885105, 0.014073770493268967, 0.005146519746631384, 0.05017029866576195, -0.067372627556324, -0.04865800589323044, -0.030661728233098984, 0.03928179293870926, -0.03249538317322731, 0.012769418768584728, -0.06332724541425705, -0.006658812519162893, -0.008516096509993076, -0.017797790467739105, -0.009981129318475723, -0.002392493886873126, -0.0375615619122982, -0.0033128655049949884, -0.021701395511627197, -0.018884750083088875, 0.06964106112718582, -0.0333082377910614, 0.036276113241910934, 0.0045297881588339806, -0.004551054909825325, 0.08302485197782516, -0.024196676909923553, -0.04128558188676834, -0.006880930159240961, 0.03905494883656502, -0.011143703944981098, -0.051304519176483154, 0.022533155977725983, -0.029527507722377777, 0.017731627449393272, 0.011862043291330338, -0.018610646948218346, 0.03105870448052883, 0.026465116068720818, -0.07274126261472702, 0.011049185879528522, 0.022570963948965073, -0.06211740896105766, -0.003513716859742999, 0.012533122673630714, -0.02599252574145794, 0.0038019975181668997, -0.011086992919445038, -0.027410298585891724, 0.015226894058287144, 0.0016635216306895018, -0.012069983407855034, -0.02773166075348854, -0.037826213985681534, 0.0658225268125534, 0.00712667778134346, -0.04540657624602318, 0.01692822203040123, 0.04136119782924652, -0.001436677761375904, -0.01074672769755125, -0.013034069910645485, -0.007013255730271339, 0.007145581301301718, -0.011673006229102612, 0.0329112634062767, 0.005940473638474941, 0.03536873683333397, -0.0014414036413654685, 0.015623870305716991, 0.023421628400683403, 0.02506624534726143, 0.03837442025542259, -0.032400865107774734, -0.041966114193201065, -0.024763787165284157, -0.043478406965732574, -0.0039815823547542095, -0.031777042895555496, -0.0023204234894365072, 0.008969783782958984, -0.03536873683333397, 0.01809079758822918, 0.0103592025116086, -0.011918754316866398, -0.03105870448052883, -0.01657850481569767, -0.03374302387237549, -0.037088971585035324, -0.026502924039959908, 0.025973621755838394, 0.028752459213137627, 0.043364983052015305, -0.04003794118762016, 0.0074811214581131935, 0.062382061034440994, -0.007117225788533688, -0.030699534341692924, -0.037939634174108505, 0.040151361376047134, 0.04778843745589256, -0.05103986710309982, 0.018223123624920845, 0.030378172174096107, 0.05247654393315315, -0.03759936988353729, -0.014291162602603436, 0.013431046158075333, 0.01720232516527176, 0.0422307625412941, 0.04396989941596985, 0.006658812519162893, 0.006427242420613766, -0.012485863640904427, -0.03105870448052883, -0.004428180865943432, -0.0453309640288353, 0.01504730898886919, -0.040302589535713196, 0.005874310620129108, -0.03597365319728851, -0.036313921213150024, 0.017381910234689713, -0.06907395273447037, 0.010425365529954433, 0.038242094218730927, 0.028071926906704903, 0.04321375489234924, 0.022173985838890076, 0.029735447838902473, -0.04465043172240257, 0.014215548522770405, -0.04922511801123619, -0.014395132660865784, -0.04151242598891258, 0.01824202574789524, 0.0054537043906748295, -0.03374302387237549, 0.0453309640288353, 0.010434817522764206, -0.008577533066272736, 0.003629501676186919, -0.016370564699172974, -0.013308173045516014, 0.02026471681892872, 0.016909318044781685, -0.05822325497865677, -0.020359236747026443, -0.02773166075348854, -0.024177774786949158, 0.013412143103778362, -0.034726012498140335, -0.017788339406251907, -0.013175847008824348, 0.029962291941046715, 0.028676843270659447, 0.02688099630177021, -0.01642727665603161, 0.018270382657647133, -0.04752378910779953, 0.007608721032738686, 0.0360114611685276, -0.049527574330568314, 0.022287407889962196, -0.09194737672805786, -0.017901761457324028, -0.06404557824134827, -0.008010423742234707, -0.013223106041550636, 0.02266548201441765, -0.05258996784687042, -0.0013468853430822492, -0.0049574836157262325, -0.038752492517232895, 0.03385644406080246, -0.02393202669918537, -0.007051063235849142, -0.010586046613752842, 0.029565315693616867, 0.004260411020368338, -0.0195652823895216, -0.04892265796661377, -0.03837442025542259, -0.026673056185245514, -0.012967906892299652, 0.014149385504424572, -0.00807658676058054, -0.03831770643591881, 0.0770891010761261, 0.011654103174805641, 0.02215508371591568, -0.03729690983891487, 0.037013355642557144, 0.009560523554682732, 0.004900772590190172, 0.059395283460617065, -0.009659767150878906, 0.0075378320179879665, -0.005576577968895435, 0.027088936418294907, 0.07081308960914612, -0.008086037822067738, 0.0203403327614069, -0.0027244891971349716, -0.0062712873332202435, 0.02347833849489689, 0.006351627875119448, -0.05410226061940193, 0.02812863700091839, -0.034688204526901245, -0.04544438421726227, -0.027712756767868996, -0.011550133116543293, 0.046843256801366806, 0.04468823969364166, -0.010217425413429737, 0.0029560590628534555, 0.030888572335243225, 0.03283564746379852, -0.0253687035292387, 0.015831811353564262, 0.016843156889081, 0.05633288994431496, -0.05962212756276131, 0.012930099852383137, -0.05799641087651253, -0.034461360424757004, -0.0029277035500854254, -0.03776950016617775, 0.02525528147816658, 0.019073788076639175, 0.05425348877906799, 0.017599301412701607, -0.041625846177339554, -0.031852658838033676, -0.0002847363066393882, -0.05984897166490555, 0.027296876534819603, -0.002462201053276658, -0.045066311955451965, 0.059244051575660706, -0.002804829739034176, -0.00041972019243985415, -0.015122924000024796, 0.00727318087592721, 0.007225921843200922, -0.011294933967292309, 0.038279902189970016, 0.03512299060821533, 0.038639068603515625, 0.03009461797773838, 0.062306445091962814, -0.0464651845395565, 0.038450032472610474, 0.028185348957777023, -0.021020863205194473, -0.013875282369554043, -0.03427232429385185, -0.0035184426233172417, 0.05852571502327919, 0.006403612904250622, 0.02525528147816658, -0.030397076159715652, -0.00003470592855592258, -0.03916837275028229, 0.013714601285755634, -0.044990696012973785, 0.03820428624749184, 0.020397042855620384, -0.008856361731886864, -0.02665415219962597, 0.048355549573898315, -0.041890498250722885, 0.03419671207666397, 0.02223069779574871, 0.019451860338449478, 0.03965986892580986, 0.005647466983646154, -0.007589817512780428, -0.018799684941768646, -0.04865800589323044, 0.029848869889974594, -0.005340282339602709, 0.011578488163650036, 0.008279800415039062, -0.025501029565930367, 0.03147458657622337, 0.09981129318475723, -0.018913106992840767, 0.02138003334403038, 0.024612559005618095, 0.09860146045684814, -0.016635216772556305, 0.008062408305704594, -0.038979336619377136, -0.027240166440606117, -0.09466949850320816, -0.023402724415063858, -0.07663541287183762, 0.04113435372710228, -0.012533122673630714, 0.010765631683170795, 0.024121062830090523, 0.0053591858595609665, 0.03105870448052883 ]
716,706
pytorch_optimizer.optimizer.shampoo_utils
__init__
null
def __init__(self, *args): pass
(self, *args)
[ -0.04483609274029732, -0.02452736534178257, 0.0009244611137546599, -0.006083901971578598, -0.05058877915143967, -0.021441832184791565, -0.022679531946778297, 0.07189115136861801, 0.04375528544187546, -0.006293090526014566, -0.026811007410287857, 0.04372042044997215, -0.03075072541832924, 0.03577125072479248, -0.033905986696481705, 0.005988024175167084, 0.05853794515132904, 0.04438285157084465, -0.027804652228951454, -0.00284583680331707, -0.021424399688839912, 0.03130856156349182, 0.018129680305719376, 0.06139685586094856, 0.017048871144652367, 0.06802116334438324, 0.011705845594406128, 0.00574397062882781, 0.028746001422405243, -0.029094649478793144, -0.0325288288295269, 0.027403708547353745, 0.016212116926908493, 0.075865738093853, 0.016377724707126617, -0.05257606878876686, -0.03028005175292492, 0.057701192796230316, -0.09190353006124496, 0.037096112966537476, 0.032633423805236816, -0.040756914764642715, -0.0004475219757296145, -0.015802456066012383, 0.013998204842209816, 0.005059749353677034, 0.040826644748449326, -0.010869091376662254, -0.0453939288854599, -0.011060847900807858, -0.01514002587646246, 0.021180346608161926, 0.0420120470225811, -0.02696789801120758, -0.053412824869155884, 0.15005795657634735, 0.047590408474206924, 0.0752381682395935, -0.0267587099224329, 0.04797391965985298, -0.041907452046871185, 0.05881686508655548, 0.04804364964365959, -0.005042317323386669, -0.024231014773249626, -0.04019907861948013, -0.06010686233639717, 0.013152733445167542, 0.020500482991337776, 0.0664173811674118, 0.02466682344675064, 0.009090987965464592, -0.021494129672646523, 0.038176920264959335, 0.03678233176469803, -0.011958615854382515, -0.07433168590068817, 0.05250634253025055, 0.009291460737586021, 0.019733458757400513, -0.013544962741434574, -0.010938821360468864, -0.055853359401226044, 0.054040390998125076, 0.01742366887629032, -0.05062364414334297, -0.04121015593409538, -0.023341963067650795, -0.021581292152404785, 0.05798010900616646, -0.09441379457712173, 0.03362707048654556, -0.016517184674739838, 0.027246816083788872, -0.0138936098664999, -0.031203968450427055, -0.00768768135458231, -0.051251210272312164, 0.003242423525080085, 0.03584098070859909, -0.020308727398514748, 0.013257328420877457, -0.030123159289360046, -0.0352482795715332, 0.006672244984656572, -0.0413496159017086, -0.05295958369970322, -0.039606377482414246, -0.02980937622487545, 0.04121015593409538, 0.019349945709109306, 0.024509932845830917, -0.02513749711215496, 0.0406523197889328, -0.031814102083444595, -0.018792109563946724, -0.02656695432960987, -0.005168701987713575, 0.02837992087006569, 0.013449084013700485, -0.0009124763309955597, 0.036956652998924255, -0.0569341666996479, 0.041977182030677795, 0.048740945756435394, 0.006280016154050827, -0.021040888503193855, -0.026863303035497665, 0.006088260095566511, -0.04093123972415924, 0.045149873942136765, -0.022383181378245354, -0.058503080159425735, -0.0035714597906917334, 0.0024906517937779427, -0.027020195499062538, 0.054981738328933716, -0.026026548817753792, -0.015767591074109077, 0.01747596450150013, 0.02764776162803173, 0.011888885870575905, 0.06512738764286041, -0.001608137390576303, -0.047590408474206924, 0.026706412434577942, -0.0026170366909354925, -0.0012605793308466673, 0.04033853858709335, 0.04595176503062248, 0.021372102200984955, -0.003978941589593887, 0.03734016790986061, 0.025852225720882416, -0.03531800955533981, -0.02351628616452217, 0.031064508482813835, -0.05480741709470749, 0.024823715910315514, -0.031203968450427055, -0.01368442177772522, -0.014861107803881168, 0.006929372902959585, -0.06003713235259056, -0.0006422743899747729, 0.015061579644680023, -0.009849296882748604, -0.045359063893556595, -0.011235171929001808, 0.030646130442619324, -0.02926897257566452, -0.05665524676442146, -0.03789800405502319, -0.008350111544132233, -0.021093184128403664, 0.009073556400835514, -0.01802508533000946, 0.05194850638508797, 0.0026954824570566416, 0.020273862406611443, 0.0406523197889328, -0.040547724813222885, -0.052192557603120804, -0.006306164897978306, 0.06826521456241608, 0.005761403124779463, 0.01500928308814764, 0.04344150051474571, -0.006184138357639313, 0.0026627967599779367, 0.009544230066239834, -0.002250956604257226, -0.007879437878727913, 0.0071777841076254845, 0.022470343858003616, 0.01493955310434103, -0.02466682344675064, 0.013980772346258163, 0.005377890542149544, 0.05058877915143967, 0.007665890734642744, 0.03789800405502319, -0.006489205174148083, -0.06289604306221008, 0.04532419890165329, -0.004619581624865532, 0.035265713930130005, 0.01537536270916462, -0.009134569205343723, -0.056480925530195236, 0.01368442177772522, -0.018251705914735794, 0.019559135660529137, -0.003336122492328286, 0.02093629352748394, -0.04497555270791054, 0.04005961865186691, -0.05459822714328766, 0.02006467431783676, 0.052680663764476776, 0.1273261308670044, 0.02018669992685318, -0.02349885366857052, -0.018931569531559944, -0.034655578434467316, 0.015148742124438286, 0.003874347312375903, -0.016229549422860146, -0.01476522907614708, -0.0474160835146904, -0.0413496159017086, -0.026863303035497665, -0.0041358331218361855, 0.02025642991065979, -0.003135650185868144, -0.020483050495386124, 0.016229549422860146, -0.012751788832247257, -0.10375755280256271, -0.04790419340133667, 0.04051285982131958, 0.021372102200984955, 0.0034603283274918795, -0.004933364689350128, 0.021424399688839912, 0.006367178168147802, -0.009875445626676083, 0.0379677340388298, 0.01023280993103981, 0.012934829108417034, -0.018408598378300667, -0.02187764272093773, -0.0352308489382267, -0.014050501398742199, -0.021110616624355316, -0.02222628891468048, 0.009186866693198681, -0.0230281800031662, 0.010755781084299088, -0.013710570521652699, 0.011592535302042961, 0.008459064178168774, 0.02966991811990738, 0.08527922630310059, -0.0021866746246814728, 0.04354609549045563, -0.002131108893081546, -0.0267587099224329, -0.02499803900718689, 0.019698593765497208, 0.13429908454418182, -0.0057962676510214806, 0.010956253856420517, 0.0813046395778656, -0.03950178250670433, -0.07230953127145767, -0.008315247483551502, 0.012734356336295605, -0.06495306640863419, 0.03988529369235039, 0.09587810933589935, 0.0138936098664999, -0.010938821360468864, 0.009274028241634369, 0.008245517499744892, -0.01604650914669037, 0.005883429665118456, 0.0379677340388298, -0.040687184780836105, -0.03510882332921028, 0.02480628341436386, 0.049821753054857254, 0.03901367634534836, 0.04999607801437378, 0.07893383502960205, 0.016839683055877686, -0.008411125279963017, 0.03883935138583183, -0.0008405677508562803, -0.03667773678898811, 0.01741495169699192, -0.06687062233686447, -0.003554027294740081, -0.0020733640994876623, -0.006532785948365927, -0.04553338885307312, -0.00944835226982832, 0.06286117434501648, 0.008119133301079273, 0.02222628891468048, 0.06742846220731735, 0.04365069046616554, -0.007596161216497421, 0.05731767788529396, -0.008463422767817974, 0.02222628891468048, 0.03041950985789299, -0.03531800955533981, -0.004885425791144371, 0.050379589200019836, -0.035056523978710175, -0.0220171008259058, 0.015201038680970669, -0.02229601889848709, -0.01665664277970791, 0.02330709807574749, -0.026985330507159233, 0.010415849275887012, -0.018077382817864418, 0.02797897718846798, -0.01734522171318531, -0.006210286635905504, 0.020238997414708138, -0.019698593765497208, -0.0338711217045784, -0.01026767399162054, -0.03706124797463417, 0.009152001701295376, 0.011017266660928726, -0.0426744781434536, 0.05937470123171806, 0.002298895735293627, -0.05072823911905289, 0.03331328555941582, 0.013283477164804935, -0.012037061154842377, -0.021110616624355316, -0.02764776162803173, 0.06533657759428024, -0.031814102083444595, 0.0366080068051815, -0.0366080068051815, -0.026305466890335083, 0.019820621237158775, 0.07028736919164658, 0.011557670310139656, -0.008153997361660004, 0.002503726165741682, -0.005268937908113003, -0.061222534626722336, 0.06767251342535019, -0.007151635363698006, -0.039397187530994415, -0.012193952687084675, 0.016560764983296394, -0.009099704213440418, 0.017937922850251198, 0.007395688910037279, -0.028240462765097618, -0.009029975160956383, -0.0030027281027287245, -0.05609741061925888, -0.04086150974035263, 0.024091554805636406, -0.030663562938570976, -0.010825510136783123, -0.01571529358625412, 0.028833163902163506, -0.025660470128059387, -0.018739812076091766, -0.02330709807574749, -0.0008067925227805972, 0.03298206999897957, -0.014974418096244335, -0.03901367634534836, -0.018931569531559944, -0.006724542006850243, 0.03618963062763214, 0.059932537376880646, 0.06449981778860092, -0.008463422767817974, -0.05637633055448532, -0.033783961087465286, -0.08109544962644577, 0.009849296882748604, -0.007443627808243036, 0.073216013610363, 0.02168588526546955, -0.04211663827300072, -0.043999336659908295, 0.04891527071595192, -0.036747466772794724, 0.002121303230524063, 0.010686051100492477, -0.0014185602776706219, 0.02628803439438343, 0.04835743457078934, 0.004053029231727123, 0.03280774876475334, 0.01138334721326828, 0.029861673712730408, -0.004558568354696035, -0.05560930445790291, -0.05515606328845024, 0.029443297535181046, -0.036956652998924255, 0.033836256712675095, -0.0028698062524199486, 0.03901367634534836, -0.03734016790986061, 0.009404771029949188, 0.033295854926109314, 0.03401058167219162, 0.045219603925943375, 0.03197099268436432, 0.0050989724695682526, -0.03449868783354759, -0.007295452989637852, 0.05801497399806976, -0.033034369349479675, -0.10738348960876465, 0.008315247483551502, -0.03442895784974098, -0.011392063461244106, 0.005399681162089109, -0.01361469179391861, -0.022784126922488213, -0.03489963337779045, 0.023882366716861725, 0.06763765215873718, -0.04295339435338974, -0.02621830627322197, 0.04661419615149498, -0.0000641457227175124, -0.0022008384112268686, -0.0704268291592598, -0.02011697180569172, 0.003521341597661376, 0.03366193547844887, -0.0345509871840477, -0.020029809325933456, 0.043859876692295074, 0.028240462765097618, -0.05243661254644394, -0.007164709735661745, -0.08646462857723236, -0.08576732873916626, 0.00350608816370368, 0.009901594370603561, -0.0301405917853117, -0.020430754870176315, -0.010686051100492477, 0.011566386558115482, -0.0650576576590538, -0.033016934990882874, 0.04978688806295395, 0.050170402973890305, -0.018949002027511597, -0.057701192796230316, -0.032563693821430206, 0.0203261598944664, 0.023185070604085922, -0.015697861090302467, -0.07649330049753189, -0.018809542059898376, 0.0033339434303343296, -0.015253336168825626, -0.03856043517589569, -0.008894873782992363, -0.012734356336295605, -0.030715860426425934, -0.04870608076453209, 0.051669586449861526, 0.06317496299743652, -0.04800878465175629, -0.028902892023324966, 0.00014735812146682292, -0.053761471062898636, 0.032894909381866455, -0.011148009449243546, -0.049821753054857254, 0.026305466890335083, -0.0047503248788416386, -0.012586181052029133, 0.02743857353925705, 0.024283310398459435, -0.044069066643714905, 0.00942220352590084, -0.03950178250670433, -0.02316763810813427, -0.02358601614832878, 0.013771583326160908, -0.01706630364060402, -0.04194231703877449, 0.003057204419746995, -0.04783446341753006, -0.004312335979193449, -0.018129680305719376, -0.03542260453104973, -0.003915749490261078, -0.016002928838133812, 0.01033740397542715, -0.057282812893390656, 0.015262052416801453, 0.04483609274029732, -0.0015808993484824896, -0.06397684663534164, -0.006458698306232691, -0.040756914764642715, 0.03775854408740997, 0.060873884707689285, 0.03605017066001892, 0.0331912599503994, -0.013658273033797741, -0.013762867078185081, -0.010119498707354069, -0.013283477164804935, -0.01504414714872837, 0.07468033581972122, 0.023969527333974838, 0.022609801962971687, -0.027316546067595482, -0.050030943006277084, 0.026200873777270317, -0.049019865691661835, 0.059862807393074036, -0.02161615714430809, -0.01131361722946167, 0.04999607801437378, 0.074540875852108, 0.033783961087465286, 0.00768768135458231, 0.04511500895023346, -0.01409408263862133, -0.03331328555941582, -0.03897881135344505, -0.04692797735333443, 0.004741608630865812, -0.012115507386624813, 0.007879437878727913, 0.02018669992685318, -0.07189115136861801, -0.009465784765779972, 0.046718791127204895, 0.009326325729489326, -0.019001299515366554, 0.014956985600292683, -0.02255750447511673, -0.007230081129819155, 0.040617454797029495, 0.003462507389485836, 0.02107575163245201, -0.009709837846457958, -0.001597242197021842, -0.06178037077188492, -0.00026312004774808884, 0.030942481011152267, 0.03988529369235039, -0.008873083628714085, 0.004514987580478191, -0.013300908729434013, -0.024614525958895683, -0.018391165882349014, 0.05888659507036209, -0.038455840200185776, 0.03247653320431709, 0.0024383547715842724, 0.0433717705309391, -0.03544003516435623, -0.08228085190057755, 0.01884440705180168, 0.006323597393929958, -0.05682957172393799, -0.057073626667261124, -0.05316876992583275, -0.007918660528957844, 0.00332740624435246, -0.03514368459582329, -0.007203932851552963, -0.010407133027911186, 0.030855320394039154, 0.028641406446695328, -0.0007005639490671456, -0.005460694432258606, -0.017972787842154503, -0.009308893233537674, 0.0022084652446210384, -0.057073626667261124, 0.026410061866044998, -0.007443627808243036, -0.03347017616033554, 0.04720689728856087, -0.027490869164466858, 0.0077879177406430244, 0.016578197479248047, -0.014172527939081192, -0.004262217786163092, 0.03470787778496742, -0.004693669266998768, 0.039397187530994415, 0.024631958454847336, -0.017650289461016655, 0.026741277426481247, 0.0032554976642131805, -0.0020668271463364363, 0.007269304245710373, -0.022941017523407936, 0.060002267360687256, 0.05180904641747475, 0.06596413999795914, -0.023411691188812256, -0.001099329674616456, 0.009474501013755798, 0.02661924995481968, -0.026514656841754913, -0.007151635363698006, -0.022139128297567368, -0.10557051748037338, 0.02478885091841221, -0.027961544692516327, 0.04121015593409538, -0.0213372390717268, 0.009875445626676083, -0.06669630110263824, 0.03021032176911831, -0.028414785861968994, -0.010607605800032616, -0.024841146543622017, 0.005373532418161631, 0.04654446616768837, -0.016447454690933228, -0.015750158578157425, 0.0029242823366075754, -0.00992774311453104, -0.054179850965738297, -0.017842045053839684, -0.03646854683756828, -0.004066103603690863, 0.03570152446627617, -0.019402243196964264, 0.012254966422915459, 0.05320363491773605, -0.011958615854382515, 0.059723347425460815, -0.044069066643714905, 0.003785006469115615, -0.01877467706799507, 0.02750830166041851, 0.042046912014484406, -0.01990778185427189, -0.016212116926908493, 0.0203261598944664, 0.03605017066001892, 0.021773047745227814, 0.02642749436199665, 0.0007664801669307053, -0.008328321389853954, -0.034115176647901535, -0.0014980954583734274, 0.056341465562582016, -0.010154363699257374, 0.050972290337085724, 0.02283642254769802, 0.015671713277697563, -0.007609235588461161, -0.0199775118380785, -0.012368276715278625, -0.03908340632915497, 0.036886923015117645, 0.01222881767898798, -0.027630329132080078, -0.009657540358603, -0.009029975160956383, -0.09852783381938934, -0.0047503248788416386, 0.0684395432472229, -0.06558062881231308, 0.053412824869155884, 0.035945575684309006, -0.0962267592549324, -0.0000419126263295766, -0.04218636825680733, 0.0406523197889328, 0.014608337543904781, -0.008280382491648197, 0.03611990064382553, -0.06819548457860947, -0.08283869177103043, 0.04330204054713249, -0.023132773116230965, 0.012603613547980785, 0.02297588251531124, -0.05173931643366814, 0.021860210224986076, -0.009936459362506866, 0.03761908411979675, 0.011296184733510017, 0.011941183358430862, 0.03467301279306412, -0.021720750257372856, 0.008646462112665176, 0.08625543862581253, 0.02140696719288826, -0.03542260453104973, 0.04344150051474571, 0.002682408085092902, 0.06770738214254379, 0.023725474253296852, -0.04309285432100296, -0.018129680305719376, -0.024701688438653946, -0.023185070604085922, 0.019611431285738945, -0.015880901366472244, 0.04225609824061394, -0.013335773721337318, -0.0582590289413929, -0.04243042320013046, 0.0011396420886740088, -0.018861839547753334, 0.042918529361486435, -0.026322899386286736, -0.017310356721282005, 0.02424844726920128, 0.00556964660063386, -0.04114042595028877, 0.06484846770763397, 0.026671547442674637, 0.032005857676267624, 0.06212901696562767, -0.05536525323987007, -0.04389474168419838, 0.0010508459527045488, 0.04019907861948013, 0.027612896636128426, -0.012141655199229717, 0.026811007410287857, 0.0345509871840477, 0.0206748079508543, 0.018007652834057808, 0.018321435898542404, 0.00302451872266829, 0.011235171929001808, 0.030593834817409515, -0.02074453793466091, -0.026601817458868027, -0.006110050715506077, -0.01125260442495346, -0.03176180273294449, -0.04030367359519005, -0.05407525599002838, -0.03265085443854332, 0.06129226088523865, -0.019193055108189583, 0.050832830369472504, 0.052262287586927414, 0.06132712587714195, 0.02128494158387184 ]
716,707
pytorch_optimizer.optimizer.shampoo_utils
add_statistics
Add the statistics.
def add_statistics(self, grad: torch.Tensor, unused_beta2: float): r"""Add the statistics.""" pass
(self, grad: torch.Tensor, unused_beta2: float)
[ -0.031290069222450256, -0.009889866225421429, -0.026612428948283195, 0.020097143948078156, 0.04079569876194, 0.021233143284916878, -0.021934788674116135, 0.007396517787128687, 0.0129888029769063, -0.01715691387653351, 0.007104165386408567, -0.00016679753025528044, 0.0032325831707566977, -0.02532607689499855, -0.039893582463264465, 0.028967954218387604, 0.01986326277256012, 0.011727510951459408, 0.0013563067186623812, -0.034447476267814636, -0.0743076503276825, -0.049048393964767456, -0.024490784853696823, 0.07397352904081345, -0.04961639270186424, 0.013682096265256405, 0.027598073706030846, -0.06929589062929153, 0.0388244092464447, -0.001176718738861382, -0.039626289159059525, -0.08580127358436584, -0.023388197645545006, -0.0016350856749340892, 0.0020161878783255816, 0.029569365084171295, 0.00930516142398119, 0.014667741023004055, -0.05018439143896103, 0.07143423706293106, 0.03202512487769127, -0.0018814969807863235, 0.019378792494535446, 0.011568805202841759, 0.034196887165308, 0.008010458201169968, -0.040628641843795776, 0.033395007252693176, -0.029903482645750046, -0.013590213842689991, 0.008661986328661442, -0.005842872895300388, 0.017407501116394997, 0.016856208443641663, -0.024039726704359055, 0.0177583247423172, 0.07938622683286667, -0.010257395915687084, 0.020949143916368484, 0.025209136307239532, 0.06528648734092712, -0.01867714710533619, -0.019311970099806786, -0.0447382815182209, -0.022151965647935867, 0.007108341436833143, -0.0532916784286499, -0.03471476957201958, 0.004539816174656153, 0.07257023453712463, -0.008135751821100712, 0.05011756718158722, 0.028199484571814537, 0.027297368273139, -0.02512560784816742, -0.01384080108255148, 0.006619695574045181, -0.03872417286038399, -0.009188220836222172, -0.04617498442530632, 0.04216558113694191, -0.037654999643564224, 0.009848101995885372, -0.004903168883174658, 0.014199977740645409, -0.04888133332133293, -0.0052164033986628056, -0.04924886301159859, -0.004543992690742016, -0.009823042899370193, -0.04453781247138977, -0.054227206856012344, 0.03872417286038399, -0.04229922592639923, 0.05867096409201622, -0.012871861457824707, -0.0637829601764679, -0.035750530660152435, -0.04052840545773506, -0.005137050524353981, 0.04243287444114685, -0.016747619956731796, 0.04136369749903679, 0.027865367010235786, 0.03247618302702904, -0.07925257831811905, -0.00849075149744749, -0.05512932315468788, -0.024023020640015602, 0.040361348539590836, -0.0213834960013628, 0.00511199189350009, 0.01651373878121376, -0.04079569876194, 0.00334534770809114, -0.019295264035463333, 0.0010796159040182829, 0.004452110733836889, -0.03448088467121124, 0.0690285935997963, 0.02900136634707451, 0.037855468690395355, 0.004619169048964977, 0.025559959933161736, -0.042733579874038696, -0.006548695266246796, 0.03038795106112957, 0.005567226558923721, 0.026077840477228165, -0.058370258659124374, 0.010115395300090313, -0.03172441944479942, 0.01638844422996044, 0.046809807419776917, 0.08145775645971298, -0.046676162630319595, 0.07624552398920059, -0.0049992273561656475, 0.05215568095445633, 0.03407994657754898, 0.015745269134640694, -0.017123501747846603, -0.04724416136741638, -0.026194781064987183, 0.011284805834293365, 0.026261605322360992, -0.04019428789615631, 0.019562557339668274, -0.008139927871525288, -0.07069918513298035, 0.023321375250816345, -0.0065904599614441395, -0.006611342541873455, -0.027648191899061203, -0.017065031453967094, -0.00033150683157145977, 0.03875758498907089, -0.015745269134640694, 0.003178289160132408, -0.03728746995329857, -0.0002678157470654696, -0.007120870985090733, -0.020414555445313454, 0.013573507778346539, -0.010240689851343632, -0.025676900520920753, 0.033578768372535706, 0.026595722883939743, -0.0677923634648323, -0.01154374610632658, 0.010424453765153885, -0.0690954178571701, 0.06692365556955338, 0.07644599676132202, 0.012103392742574215, 0.01941220462322235, 0.019445616751909256, 0.020731966942548752, 0.017791736871004105, 0.013606919907033443, 0.046876631677150726, -0.011401746422052383, -0.04584086686372757, -0.04487193003296852, 0.011385040357708931, -0.011986451223492622, 0.01887761615216732, -0.02703007496893406, -0.001109895296394825, -0.006807636469602585, 0.03762158751487732, -0.016956442967057228, 0.007567752618342638, -0.01717361994087696, 0.0302543044090271, 0.017942089587450027, 0.003961375914514065, 0.01384080108255148, 0.004982521291822195, -0.009430455975234509, -0.002230231650173664, -0.027798544615507126, -0.007500929292291403, -0.02263643406331539, 0.04123005270957947, -0.005404344294220209, -0.02637854591012001, 0.02599431201815605, -0.010892217978835106, -0.00987316109240055, -0.017841853201389313, 0.037187233567237854, 0.0012299686204642057, 0.03413006290793419, -0.013272802345454693, -0.048246510326862335, 0.019061380997300148, -0.0017927471781149507, 0.006594636477530003, -0.030605128034949303, 0.03379594534635544, -0.07383988052606583, -0.015010211616754532, -0.008198399096727371, 0.03932558372616768, 0.005299932789057493, 0.10016831010580063, -0.03578394278883934, -0.012479274533689022, 0.010232336819171906, 0.0558977946639061, 0.014759623445570469, -0.02519243024289608, -0.018042324110865593, 0.0015285857953131199, 0.06689024716615677, -0.04420369490981102, -0.014667741023004055, 0.014759623445570469, -0.013849154114723206, -0.06675659865140915, -0.027080193161964417, -0.005078580230474472, 0.07076600193977356, -0.06542012840509415, -0.06348225474357605, -0.009288456290960312, 0.046007927507162094, -0.037788644433021545, 0.04286722466349602, -0.03511570766568184, -0.022653140127658844, -0.00032498111249879, 0.011134453117847443, -0.07925257831811905, -0.018961146473884583, 0.002167584840208292, -0.012086686678230762, 0.01541950460523367, -0.08894197642803192, 0.007045694626867771, -0.035550061613321304, -0.06755848228931427, 0.05011756718158722, 0.004907344933599234, 0.039626289159059525, 0.06291425228118896, 0.013890919275581837, 0.029636187478899956, 0.002869230695068836, -0.006076755002140999, 0.04500557482242584, 0.0025580842047929764, -0.028984660282731056, 0.040160875767469406, 0.021751023828983307, 0.04099617153406143, 0.005170462187379599, 0.028182778507471085, 0.013297861441969872, 0.07190200686454773, -0.045606985688209534, -0.04096275940537453, -0.0027272310107946396, -0.00669069541618228, 0.0018668794073164463, -0.00969774927943945, 0.03474818170070648, -0.02295384556055069, -0.009739513508975506, 0.007505105808377266, -0.0041472287848591805, 0.043969813734292984, 0.020615026354789734, 0.04711051285266876, 0.05806955322623253, 0.013005509041249752, 0.07397352904081345, 0.008937632665038109, 0.0697636529803276, 0.019178321585059166, -0.00927175022661686, -0.020314320921897888, -0.017457619309425354, -0.01854350045323372, -0.05335850268602371, 0.07751516997814178, 0.00018141514738090336, 0.023388197645545006, -0.030287716537714005, -0.005892990622669458, -0.003700347151607275, 0.02684631012380123, 0.07798293232917786, -0.014492330141365528, -0.05556367710232735, -0.02129996567964554, -0.01815926469862461, -0.013690449297428131, 0.06124366819858551, -0.028583718463778496, -0.06164460629224777, 0.04253310710191727, -0.030805598944425583, -0.02019738033413887, -0.010474571958184242, 0.01470115315169096, 0.0016162915853783488, 0.02933548204600811, -0.011710804887115955, -0.06862765550613403, -0.07818340510129929, 0.05058533325791359, 0.00467346329241991, -0.0512869767844677, -0.005454462021589279, 0.027314074337482452, 0.026746075600385666, 0.02689642831683159, 0.013799036853015423, -0.031991712749004364, -0.02992018684744835, -0.028851013630628586, 0.059305787086486816, 0.09234996885061264, -0.05282391607761383, 0.009096338413655758, -0.06942953914403915, -0.0018345117568969727, 0.0207152608782053, -0.010249042883515358, 0.010599865578114986, -0.06936271488666534, 0.058704376220703125, 0.09435467422008514, 0.0493490993976593, 0.005867931991815567, 0.01677267998456955, 0.026361839845776558, -0.014500683173537254, -0.03072206862270832, 0.07283753156661987, -0.004681816324591637, 0.042198993265628815, 0.05085262656211853, -0.016680797562003136, 0.0043059345334768295, 0.021333377808332443, 0.007713928818702698, -0.04293404892086983, 0.0434018149971962, -0.02046467363834381, 0.009179867804050446, 0.0638497844338417, -0.009004455991089344, -0.03474818170070648, 0.006185343023389578, 0.004857227671891451, -0.008114869706332684, -0.0355166494846344, -0.03839005529880524, 0.007033165078610182, -0.03434723988175392, 0.035951003432273865, 0.008829045109450817, 0.0618450790643692, -0.028132660314440727, -0.05743473395705223, -0.009990101680159569, -0.015244093723595142, 0.01834302954375744, -0.012637980282306671, 0.02420678548514843, 0.033912885934114456, -0.04460463672876358, 0.032392654567956924, 0.014458918012678623, -0.0296027772128582, -0.04086252301931381, 0.019295264035463333, -0.01450903620570898, -0.07190200686454773, -0.036151472479104996, 0.04520604759454727, -0.02834983728826046, -0.04677639529109001, -0.03762158751487732, 0.04731098189949989, 0.008135751821100712, 0.11172876507043839, -0.04988368600606918, -0.06291425228118896, -0.02906818874180317, 0.03986017033457756, 0.00429340498521924, 0.025760428979992867, -0.007237812038511038, -0.03085571527481079, 0.020949143916368484, 0.037521351128816605, 0.03478159010410309, -0.03698676452040672, 0.007095812354236841, 0.029385600239038467, -0.016555503010749817, -0.018710559234023094, -0.06562060117721558, -0.014676094055175781, -0.04440416395664215, -0.017791736871004105, 0.00558810867369175, 0.01625479757785797, 0.007588635198771954, -0.02953595295548439, -0.010215630754828453, -0.03195830062031746, -0.04533969238400459, -0.03125665709376335, 0.019428910687565804, 0.0328938290476799, 0.023822549730539322, 0.04006064310669899, 0.03889123350381851, -0.008131575770676136, -0.031991712749004364, -0.0035896708723157644, -0.008478221483528614, -0.042332638055086136, 0.02525925450026989, -0.037855468690395355, -0.006264695897698402, 0.03145712614059448, 0.06505260616540909, 0.02328796312212944, -0.016012562438845634, -0.0585373193025589, -0.04721074923872948, -0.07611187547445297, 0.023505138233304024, 0.027063487097620964, -0.035683706402778625, 0.007421576417982578, -0.10865488648414612, 0.030404657125473022, 0.015678444877266884, 0.012178569100797176, 0.06916224211454391, -0.054227206856012344, -0.023371491581201553, 0.00862022116780281, 0.00596816698089242, -0.03162418678402901, 0.02407313883304596, -0.07978716492652893, -0.03117312677204609, -0.0047695217654109, -0.03538300096988678, 0.001718614948913455, 0.040361348539590836, -0.002658319193869829, 0.054828617721796036, 0.03281030058860779, 0.011978098191320896, 0.052456386387348175, 0.03309430181980133, 0.07110012322664261, -0.003286877181380987, -0.009480573236942291, 0.0579024963080883, 0.018927734345197678, 0.006147754844278097, -0.04624180868268013, 0.024056432768702507, -0.030688656494021416, -0.07557728886604309, 0.006156107876449823, 0.03745453059673309, -0.004619169048964977, 0.050819214433431625, 0.04954956844449043, -0.007112517952919006, -0.03578394278883934, 0.0013907625107094646, -0.04366910830140114, 0.003936317283660173, -0.02118302509188652, -0.025426313281059265, 0.036485590040683746, -0.05780225992202759, 0.00841557513922453, -0.015544799156486988, 0.027263956144452095, 0.0054795206524431705, 0.05202203616499901, 0.06037496402859688, -0.0170900896191597, -0.031741127371788025, 0.05091944709420204, 0.030555009841918945, -0.009731161408126354, -0.0387909971177578, 0.06555377691984177, 0.026094546541571617, -0.021015966311097145, 0.032242301851511, -0.01632162183523178, -0.0394592322409153, -0.0029966128058731556, 0.030020423233509064, 0.017023267224431038, -0.009914925321936607, 0.010892217978835106, -0.013197625987231731, -0.039425820112228394, -0.0005914916982874274, 0.011911274865269661, 0.05135380104184151, -0.05543002858757973, -0.07350576668977737, -0.03309430181980133, 0.021216437220573425, -0.050017330795526505, 0.04794580489397049, -0.09502290934324265, -0.0486808642745018, 0.06725777685642242, -0.00969774927943945, 0.008173340000212193, -0.000985645456239581, -0.02505878359079361, -0.05833685025572777, -0.030154069885611534, -0.07617869973182678, 0.007622046861797571, -0.005876284558326006, 0.06124366819858551, -0.07551046460866928, -0.011167864315211773, 0.029652893543243408, 0.021283259615302086, -0.012420804239809513, -0.0499839223921299, -0.007033165078610182, 0.05152085795998573, -0.03172441944479942, 0.023956196382641792, -0.003658582456409931, 0.011184570379555225, -0.042265813797712326, -0.005926402285695076, -0.023772433400154114, -0.028266308829188347, -0.03952605649828911, -0.05335850268602371, -0.00802298728376627, 0.002700083889067173, 0.06358248740434647, 0.004995050840079784, 0.03135688975453377, -0.007045694626867771, -0.06622201204299927, 0.005617343820631504, 0.026061134412884712, 0.016664091497659683, -0.00047481173533014953, 0.03301076963543892, -0.05823661386966705, 0.027197133749723434, 0.05175474286079407, 0.019261851906776428, 0.020748673006892204, -0.009530690498650074, -0.013773977756500244, -0.1025739535689354, -0.040695466101169586, -0.038055937737226486, -0.0618450790643692, -0.02788207307457924, -0.012111745774745941, 0.04313451796770096, -0.05532979592680931, -0.008845750242471695, 0.02691313438117504, -0.0010242777643725276, -0.014475624077022076, 0.02886771969497204, 0.0004398338496685028, 0.008628574199974537, -0.06799283623695374, -0.027664897963404655, -0.023321375250816345, 0.03518253192305565, -0.005274874158203602, 0.009889866225421429, 0.009138103574514389, -0.05549685284495354, 0.019228439778089523, 0.0009976528817787766, 0.03260983154177666, 0.07945305109024048, -0.03905829042196274, 0.06983047723770142, 0.015252446755766869, 0.059506259858608246, -0.0022427611984312534, -0.017207032069563866, 0.04286722466349602, -0.06832695007324219, -0.013013862073421478, -0.0030676128808408976, -0.0795866996049881, 0.0021905554458498955, 0.002255290513858199, -0.03695335239171982, 0.014099742285907269, -0.056666262447834015, -0.02084890753030777, 0.021984906867146492, 0.030755480751395226, -0.04510581120848656, 0.0190780870616436, 0.005007580388337374, 0.0006692783208563924, 0.02676278166472912, -0.003717052983120084, 0.05282391607761383, -0.02584395930171013, -0.0005144881433807313, 0.03909170255064964, -0.0072754002176225185, 0.009881514124572277, 0.027848660945892334, 0.006912047974765301, 0.033645592629909515, -0.00702063599601388, 0.02024749666452408, -0.011268099769949913, 0.04731098189949989, 0.0230206698179245, -0.033044181764125824, 0.04156417027115822, -0.046007927507162094, 0.048446983098983765, 0.0299368929117918, 0.03849029168486595, 0.044905342161655426, -0.005283226724714041, 0.03835664317011833, 0.03912511467933655, -0.05913873016834259, -0.016739267855882645, 0.024440666660666466, 0.008678692393004894, 0.003286877181380987, -0.00030409879400394857, 0.018259501084685326, -0.008549221791327, 0.044170282781124115, -0.03605123609304428, 0.019829850643873215, 0.02243596501648426, 0.012796685099601746, 0.003485259134322405, -0.01972961612045765, -0.04513922333717346, 0.05242297425866127, -0.027514545246958733, -0.014550800435245037, -0.005132874008268118, 0.013281155377626419, -0.039960406720638275, -0.05045168474316597, 0.023054081946611404, 0.027063487097620964, 0.04099617153406143, -0.004698521923273802, -0.015085387974977493, -0.03182465583086014, 0.03190818428993225, -0.065821073949337, -0.003917523194104433, -0.02158396504819393, -0.013849154114723206, 0.05098627135157585, 0.021149612963199615, 0.011760922148823738, -0.020297614857554436, -0.05158768221735954, 0.018109148368239403, -0.041864875704050064, -0.02295384556055069, 0.02151714265346527, -0.006156107876449823, 0.0207152608782053, -0.01861032284796238, 0.007329694461077452, 0.03912511467933655, -0.0217009074985981, -0.0010556012857705355, 0.029652893543243408, 0.021216437220573425, -0.01217021606862545, 0.05953967198729515, 0.042265813797712326, -0.034046534448862076, 0.008887515403330326, 0.03468135744333267, -0.0506521537899971, -0.0190780870616436, -0.04704368859529495, 0.018075736239552498, -0.0031114656012505293, 0.015444563701748848, 0.06197872385382652, -0.005383462179452181, 0.03434723988175392, -0.0111762173473835, 0.03000371716916561, 0.058971669524908066, 0.0401274673640728, 0.03571711853146553, 0.01979643851518631, 0.00020399416098371148, -0.021350083872675896, -0.00806057546287775, -0.03145712614059448, -0.005888814106583595, 0.037254057824611664, 0.011702451854944229, 0.027514545246958733, 0.09382008761167526, -0.002510054735466838, 0.0038799350149929523, 0.05566390976309776, 0.05823661386966705, 0.016004210337996483, 0.07323846966028214, -0.06598813086748123, -0.018827499821782112, -0.0789852887392044, 0.032860416918992996, -0.015503033995628357, 0.022803492844104767, -0.010340924374759197, 0.00214670249260962, 0.05696696788072586, -0.02881760150194168, 0.029903482645750046 ]
716,708
pytorch_optimizer.optimizer.shampoo_utils
precondition_gradient
Get preconditioned gradient.
def precondition_gradient(self, grad: torch.Tensor) -> torch.Tensor: r"""Get preconditioned gradient.""" return grad
(self, grad: torch.Tensor) -> torch.Tensor
[ -0.02599884197115898, -0.02603219449520111, -0.007483630441129208, 0.02805006504058838, 0.005399053916335106, 0.010256117209792137, -0.0030413975473493338, -0.005328178405761719, 0.037288907915353775, -0.03959028050303459, 0.05516624078154564, -0.010864813812077045, -0.0003025241894647479, -0.0010683456202968955, -0.03738896921277046, -0.0101560577750206, 0.018811220303177834, 0.013916634023189545, 0.001958459848538041, -0.021529508754611015, -0.03999052196741104, -0.07684583961963654, 0.022763578221201897, 0.031802304089069366, -0.02541515976190567, 0.00039137928979471326, 0.019578345119953156, -0.010222764685750008, 0.028800511732697487, -0.02764982543885708, -0.050663553178310394, 0.021212652325630188, 0.01764385774731636, 0.02678264118731022, 0.018677808344364166, 0.02816680073738098, 0.0197451114654541, -0.02721623331308365, -0.0394902229309082, -0.04666116461157799, -0.04389284923672676, 0.00011621515295701101, -0.008150694891810417, -0.006412158254534006, 0.03735561668872833, 0.004927939269691706, -0.01205719169229269, -0.02758312039077282, -0.04349260777235031, 0.04512691870331764, 0.05263139307498932, 0.011773689649999142, 0.004056586418300867, -0.03201909735798836, -0.03340325877070427, -0.023480672389268875, 0.04526032879948616, -0.02411438338458538, -0.012474107556045055, 0.008405013009905815, 0.046360988169908524, -0.045093562453985214, -0.013633131980895996, -0.030451497063040733, -0.00021106339409016073, 0.004519362468272448, -0.018194185569882393, -0.026148930191993713, 0.05413229018449783, 0.016401449218392372, -0.042391952127218246, 0.026615876704454422, 0.0020751962438225746, -0.0343538261950016, 0.017293648794293404, -0.08144858479499817, 0.056633781641721725, -0.02281360886991024, -0.007216804660856724, -0.07491134852170944, 0.009505669586360455, 0.016518186777830124, 0.0026640892028808594, 0.007366894278675318, 0.04149141535162926, -0.07277674227952957, -0.025615278631448746, -0.023413965478539467, -0.010331162251532078, -0.013716515153646469, 0.007312695030122995, 0.005807630717754364, -0.018344275653362274, -0.008025620132684708, 0.09525682032108307, 0.020078644156455994, -0.00355211878195405, 0.021045885980129242, 0.013174525462090969, 0.016551539301872253, 0.011365112848579884, 0.1104658916592598, -0.038156092166900635, -0.019094722345471382, 0.07797984778881073, -0.044159673154354095, -0.017160234972834587, -0.04789523407816887, 0.02309711091220379, -0.08051469177007675, 0.011381789110600948, -0.04405961558222771, -0.0019344872562214732, -0.015167380683124065, 0.01869448460638523, 0.0002162748423870653, -0.0384562723338604, -0.039089981466531754, 0.010831460356712341, 0.03755573555827141, 0.051964327692985535, 0.022480076178908348, -0.02935084141790867, 0.03822280094027519, -0.013041112571954727, 0.022646842524409294, 0.03838956728577614, 0.05773443728685379, 0.03163553774356842, -0.054932765662670135, 0.015517589636147022, 0.004112869966775179, 0.0038147754967212677, 0.0006738394149579108, 0.029367517679929733, -0.004490178544074297, 0.030101288110017776, 0.020628971979022026, 0.015300793573260307, 0.007316864561289549, 0.03123529814183712, 0.03935680910944939, -0.008763561025261879, 0.026332372799515724, 0.004748665727674961, 0.02708282135426998, -0.027433030307292938, 0.04562721773982048, 0.008455043658614159, 0.02613225392997265, 0.034320469945669174, 0.023764174431562424, 0.010097689926624298, -0.06787382066249847, 0.011848734691739082, -0.019078046083450317, -0.018494365736842155, -0.04689463973045349, 0.03065161593258381, -0.04355931654572487, -0.03582136705517769, -0.03405364602804184, -0.02154618501663208, -0.001127755967900157, 0.016826704144477844, 0.0031581337098032236, 0.031802304089069366, -0.04385949298739433, -0.045026857405900955, 0.04152476787567139, 0.03393691033124924, -0.05870168283581734, 0.012599182315170765, 0.05263139307498932, -0.06747358292341232, 0.04876241832971573, 0.00918047595769167, 0.05399887636303902, -0.058835092931985855, 0.027933329343795776, 0.06247059628367424, 0.03485412150621414, -0.007913053035736084, -0.03398694097995758, 0.06270407140254974, -0.00030148192308843136, -0.05173085629940033, 0.01162359956651926, 0.03562124818563461, 0.008117341436445713, -0.02708282135426998, -0.009664097800850868, 0.06497208774089813, 0.0030330591835081577, -0.009605729952454567, -0.042892251163721085, 0.0326361320912838, 0.04232524707913399, 0.06113646551966667, 0.011373450979590416, 0.024481268599629402, -0.027282940223813057, 0.035554539412260056, 0.023447319865226746, -0.048028647899627686, -0.003689700737595558, -0.037188850343227386, 0.012891022488474846, -0.004873740486800671, 0.003391606267541647, -0.02483147755265236, 0.024598006159067154, -0.017527122050523758, 0.007541998755186796, -0.02154618501663208, -0.013141172006726265, 0.04229189455509186, 0.0030309746507555246, -0.005390715319663286, 0.003773083910346031, 0.026048870757222176, -0.0430256649851799, 0.06593932956457138, -0.042425304651260376, 0.015684355050325394, -0.04556050896644592, -0.013766544871032238, -0.042391952127218246, -0.02469806559383869, -0.037689149379730225, 0.027633149176836014, -0.03999052196741104, 0.048929184675216675, -0.003339492017403245, 0.08211565017700195, 0.028900571167469025, -0.05356528237462044, 0.004798695910722017, 0.05743425711989403, 0.007867192849516869, -0.028216831386089325, -0.0024472931399941444, 0.026332372799515724, 0.09879226237535477, 0.03243601322174072, 0.015192395076155663, 0.02609890140593052, 0.026832671836018562, 0.0017854400211945176, 0.022029807791113853, -0.07617877423763275, -0.022430045530200005, -0.028350243344902992, 0.015467559918761253, 0.008409182541072369, 0.05726749077439308, 0.06760699301958084, 0.020228732377290726, 0.03223589435219765, 0.007312695030122995, -0.020395498722791672, -0.07911385595798492, 0.03210248053073883, 0.009163799695670605, -0.02299705147743225, -0.00468195928260684, 0.04666116461157799, 0.054932765662670135, -0.006791551131755114, 0.026982761919498444, -0.02599884197115898, 0.04906259849667549, -0.021246006712317467, -0.04349260777235031, 0.04272548481822014, -0.031835656613111496, 0.01829424500465393, 0.04666116461157799, 0.05413229018449783, 0.012290664948523045, 0.03665519878268242, -0.04912930354475975, -0.038189444690942764, 0.038589686155319214, -0.046827930957078934, -0.0005258345045149326, 0.005015491507947445, -0.04135800153017044, 0.011907102540135384, 0.0017083106795325875, 0.01652652397751808, 0.008417520672082901, 0.030017904937267303, -0.046327631920576096, 0.053698696196079254, 0.008008943870663643, 0.039857108145952225, -0.031468771398067474, 0.009147122502326965, 0.014483639039099216, 0.07377734035253525, -0.012590843252837658, -0.07817996293306351, 0.0027995866257697344, -0.05056349188089371, -0.00838833674788475, 0.011990485712885857, 0.018861250951886177, -0.032369308173656464, -0.03408699855208397, -0.06323771923780441, -0.035954780876636505, -0.011940455995500088, 0.02216321974992752, -0.017560474574565887, -0.0820489376783371, 0.0018823727732524276, -0.04059087857604027, 0.041157882660627365, 0.03377014398574829, -0.000599315797444433, 0.03390355780720711, 0.04345925524830818, 0.029667695984244347, -0.08111505210399628, -0.020729031413793564, -0.0040044719353318214, 0.013966664671897888, -0.021346066147089005, 0.039390161633491516, -0.027166204527020454, -0.002605720888823271, 0.02346399612724781, 0.0116402767598629, 0.015267440117895603, -0.004335919860750437, 0.09979286044836044, 0.01807744987308979, -0.016601569950580597, -0.05096373334527016, 0.025315100327134132, -0.039023276418447495, -0.002922576619312167, 0.03095179609954357, 0.0018135817954316735, -0.029851138591766357, 0.006320436485111713, -0.0027349647134542465, 0.038056034594774246, 0.02259681187570095, -0.021346066147089005, -0.033703435212373734, -0.04639434069395065, 0.02299705147743225, 0.0032790391705930233, 0.006199531257152557, -0.03712214156985283, -0.015175718814134598, 0.04065758362412453, -0.0008885508286766708, 0.04185830056667328, 0.013024435378611088, 0.0010704301530495286, 0.049296069890260696, 0.01637643575668335, 0.008530087769031525, -0.045927394181489944, 0.01579275354743004, -0.03758908808231354, 0.020111996680498123, 0.017693886533379555, -0.022079836577177048, -0.01162359956651926, -0.016551539301872253, -0.0552329458296299, -0.04706140607595444, -0.04606080800294876, -0.007091729901731014, 0.044159673154354095, 0.02299705147743225, -0.025648633018136024, -0.008630148135125637, -0.03919004276394844, 0.01912807673215866, -0.038989923894405365, 0.023230522871017456, -0.011123301461338997, -0.06287083774805069, 0.02960098907351494, -0.024748094379901886, -0.007675411645323038, -0.024964891374111176, 0.016860056668519974, 0.017160234972834587, -0.042925603687763214, -0.010756416246294975, 0.06850752979516983, 0.011590247042477131, 0.018927955999970436, -0.009063739329576492, -0.042458660900592804, -0.02241336926817894, 0.007879700511693954, 0.0013382983161136508, -0.0193448718637228, -0.05803461745381355, 0.002278442494571209, 0.07704595476388931, 0.03955692797899246, 0.07104237377643585, 0.00327695463784039, -0.00679572019726038, 0.018744513392448425, 0.0400572270154953, -0.0057284170761704445, -0.004242113791406155, -0.009530684910714626, -0.03265281021595001, -0.0012663804227486253, 0.043259136378765106, 0.03568795323371887, -0.045060209929943085, 0.04686128720641136, -0.004127461928874254, -0.06257065385580063, 0.02396429516375065, -0.019244812428951263, 0.033019695430994034, -0.03588807210326195, 0.024097707122564316, 0.0009682858944870532, -0.014350226148962975, 0.010606326162815094, -0.0053073326125741005, -0.014867201447486877, -0.0020762383937835693, 0.009005371481180191, 0.0812484622001648, -0.01354141067713499, 0.026082225143909454, 0.06026928126811981, -0.01575940102338791, 0.018811220303177834, -0.0020137012470513582, -0.054899413138628006, -0.010397869162261486, -0.009422287344932556, -0.034253764897584915, -0.029851138591766357, -0.025898780673742294, 0.009113769978284836, 0.017510443925857544, 0.05002984032034874, 0.0013153678737580776, -0.002837108913809061, 0.0072626653127372265, -0.05993575230240822, -0.0481620617210865, -0.005244795233011246, 0.04539374262094498, 0.013524734415113926, 0.07671242207288742, -0.04312572255730629, -0.015500912442803383, 0.0018834150396287441, -0.02092915028333664, 0.04129129648208618, -0.030418144538998604, -0.03405364602804184, 0.013799898326396942, 0.027699856087565422, -0.028100093826651573, -0.01144015695899725, -0.04405961558222771, -0.033536672592163086, 0.001976178726181388, -0.05810132250189781, 0.07831338047981262, 0.0749780535697937, 0.01811080239713192, -0.04926271736621857, -0.04189165309071541, -0.02114594727754593, 0.0595688670873642, 0.01299942098557949, -0.016634922474622726, -0.08144858479499817, 0.04899589344859123, 0.03220254182815552, 0.025465190410614014, -0.0036730242427438498, -0.0054115611128509045, 0.054899413138628006, 0.0015394599176943302, -0.03745567426085472, -0.024231120944023132, 0.022046484053134918, -0.042025066912174225, 0.044193025678396225, 0.05476599931716919, -0.003322815289720893, 0.011465172283351421, -0.06500544399023056, 0.048062000423669815, -0.0006185981328599155, -0.09739142656326294, -0.04089105874300003, 0.0687076523900032, 0.047628410160541534, -0.015275778248906136, 0.015450882725417614, 0.0595688670873642, -0.025181686505675316, 0.03952357545495033, -0.016209669411182404, -0.02027876302599907, -0.04009057953953743, 0.07271003723144531, 0.014225151389837265, -0.041958361864089966, -0.034720711410045624, 0.08905311673879623, -0.027282940223813057, -0.051930975168943405, 0.002491069259122014, 0.04149141535162926, -0.002203397685661912, -0.07978092133998871, 0.00005341727955965325, 0.009105430915951729, -0.018894603475928307, -0.025465190410614014, 0.05143067613244057, 0.023080434650182724, -0.032736193388700485, 0.02244672179222107, 0.0007989140576682985, -0.042925603687763214, -0.11039918661117554, -0.042892251163721085, 0.010764754377305508, -0.00292883045040071, 0.07831338047981262, 0.047194816172122955, -0.002201313152909279, 0.01304945070296526, -0.00499881524592638, 0.028066741302609444, -0.0931222140789032, 0.001915725995786488, -0.05690060555934906, -0.009030386805534363, -0.0644717887043953, -0.021012533456087112, 0.03882315754890442, 0.07271003723144531, 0.005978566128760576, 0.03625495731830597, -0.005182257853448391, 0.01912807673215866, -0.033419933170080185, -0.10686374455690384, 0.0765790119767189, 0.01495058462023735, -0.0773794874548912, 0.00838833674788475, -0.00956403836607933, -0.0029997059609740973, -0.01471711229532957, -0.017360355705022812, -0.001034992397762835, -0.012699241749942303, 0.03482076898217201, 0.06717339903116226, 0.008254923857748508, -0.020695678889751434, 0.049362778663635254, -0.034720711410045624, -0.0014404425164684653, -0.012232296168804169, 0.029667695984244347, -0.02241336926817894, 0.000550849421415478, -0.027916651219129562, -0.027783239260315895, 0.031385388225317, -0.04779517650604248, 0.06754028797149658, 0.006904118228703737, -0.059735629707574844, 0.008580117486417294, 0.003118526889011264, -0.0042316908948123455, -0.060502756386995316, 0.001709352945908904, -0.04132464900612831, -0.024964891374111176, -0.021662920713424683, 0.037755854427814484, 0.012032177299261093, -0.0546659417450428, -0.012324017472565174, 0.05383211001753807, 0.014600375667214394, -0.028400273993611336, -0.017994066700339317, -0.026482462882995605, -0.01182371936738491, 0.015200733207166195, -0.09672436118125916, 0.01749376766383648, -0.03752238303422928, -0.07037530839443207, -0.025965487584471703, -0.00737523240968585, -0.02689937874674797, -0.08051469177007675, 0.05339851975440979, -0.007175113074481487, 0.08024786412715912, 0.010981550440192223, -0.00018565761274658144, 0.017527122050523758, 0.02061229571700096, 0.016393112018704414, -0.005991073790937662, 0.03835621103644371, -0.10079345852136612, -0.029951198026537895, -0.030234701931476593, -0.009589052759110928, 0.03822280094027519, 0.012932714074850082, -0.0014967260649427772, -0.035988133400678635, 0.004915432073175907, 0.023297229781746864, -0.01696011610329151, 0.01379156019538641, -0.03055155649781227, -0.017977390438318253, 0.0769125446677208, -0.015901152044534683, -0.014300196431577206, -0.015951180830597878, -0.01525910198688507, -0.003195656230673194, -0.055433064699172974, 0.02968437224626541, -0.06086964160203934, -0.04152476787567139, 0.08178211748600006, 0.024714741855859756, 0.0027975020930171013, 0.012424077838659286, 0.0047194818034768105, -0.010631341487169266, 0.06897447258234024, 0.012782624922692776, -0.018277568742632866, 0.047995295375585556, -0.005048844963312149, 0.0021679599303752184, 0.009972615167498589, -0.012866008095443249, 0.060936346650123596, 0.017477091401815414, 0.010189411230385303, -0.008096495643258095, -0.07230979949235916, -0.024247797206044197, 0.043259136378765106, -0.04472667723894119, -0.0376557931303978, 0.0733771026134491, -0.02975107915699482, 0.035988133400678635, -0.014658743515610695, 0.02504827454686165, 0.005178088787943125, 0.03929010406136513, 0.003141457214951515, 0.01966172829270363, 0.10332830250263214, 0.029234103858470917, 0.0009625533130019903, -0.012465769425034523, -0.033670082688331604, -0.006157839670777321, 0.04752834886312485, -0.039823755621910095, -0.03842291980981827, 0.019578345119953156, 0.013116156682372093, 0.07437770068645477, -0.04089105874300003, -0.06076958030462265, 0.03965698927640915, 0.00484455656260252, -0.0008187175262719393, 0.012824316509068012, -0.026882702484726906, -0.04469332471489906, 0.03929010406136513, -0.0005862872349098325, 0.010489590466022491, 0.06020257622003555, -0.05116385221481323, -0.02349734865128994, -0.01721026562154293, 0.030134640634059906, 0.0006696702912449837, 0.020345469936728477, -0.03742232173681259, 0.030851736664772034, 0.0181441567838192, -0.0013570594601333141, -0.06020257622003555, -0.006182854529470205, -0.003764745546504855, -0.000481016089906916, -0.005169750191271305, -0.014016694389283657, 0.03397026285529137, -0.03345328941941261, -0.002140860306099057, 0.011423480696976185, -0.04659445956349373, -0.06730681657791138, -0.003964865114539862, -0.003877312643453479, 0.04219183325767517, 0.020562265068292618, 0.00048753040027804673, 0.021879717707633972, -0.00005406871059676632, 0.04182494804263115, 0.037722501903772354, -0.038989923894405365, 0.013241231441497803, 0.013716515153646469, 0.06066952273249626, -0.03293631225824356, -0.02361408621072769, 0.008042297326028347, 0.029017308726906776, -0.03622160479426384, -0.05680054798722267, 0.02541515976190567, -0.03828950598835945, 0.06957483291625977, 0.020979180932044983, -0.0061203171499073505, -0.025114981457591057, 0.04455991089344025, -0.06817399710416794, 0.02609890140593052, -0.009105430915951729, -0.05693396180868149, 0.001140263513661921, -0.028833866119384766, 0.006103640887886286, -0.010447898879647255, 0.042058419436216354, -0.00539488485082984, 0.016584891825914383, -0.009397272020578384, 0.005098874680697918 ]
716,709
pytorch_optimizer.optimizer.shampoo_utils
update_momentum
Update momentum.
def update_momentum(self, update: torch.Tensor, unused_beta1: float) -> torch.Tensor: # noqa: ARG002 r"""Update momentum.""" return update
(self, update: torch.Tensor, unused_beta1: float) -> torch.Tensor
[ 0.03165271878242493, 0.01650218665599823, -0.0062621054239571095, 0.00037240065285004675, 0.017999274656176567, -0.03201201930642128, -0.023611217737197876, 0.004692301619797945, -0.029445583000779152, 0.027323994785547256, -0.026742270216345787, -0.0439031757414341, -0.019248275086283684, 0.05601675808429718, -0.040070630609989166, -0.0097952326759696, 0.01728922873735428, 0.02595522813498974, -0.012729525566101074, 0.001892747008241713, -0.024603571742773056, -0.005137150641530752, 0.009658356197178364, 0.06505061686038971, -0.040823452174663544, -0.05622207000851631, 0.04215800017118454, -0.023953408002853394, -0.014491812326014042, -0.06696688383817673, 0.04763306304812431, 0.005629051011055708, -0.022225340828299522, 0.04930980131030083, 0.005077267065644264, 0.017811069265007973, 0.009521479718387127, 0.07829342782497406, -0.09690864384174347, -0.02359410747885704, 0.055469248443841934, -0.0077591934241354465, 0.0846581906080246, 0.01798216626048088, 0.01113833487033844, -0.029975980520248413, 0.009521479718387127, 0.026177654042840004, 0.02272151969373226, 0.013251367956399918, -0.004114853218197823, -0.016014564782381058, 0.06156025826931, -0.024483805522322655, -0.0341678261756897, 0.07233929634094238, 0.05023371800780296, 0.016733167693018913, -0.03808591887354851, 0.03774372860789299, 0.005804424174129963, -0.02882963791489601, -0.018734987825155258, -0.018906082957983017, 0.01692137122154236, -0.045716792345047, 0.014466147869825363, 0.014834003522992134, 0.015492722392082214, 0.04930980131030083, -0.012857847847044468, 0.026588283479213715, -0.03093411587178707, 0.023337462916970253, -0.04116564244031906, -0.005470787174999714, -0.011557519435882568, -0.02355988882482052, -0.009273391216993332, 0.0022007194347679615, -0.022088464349508286, 0.0021515293046832085, 0.010188753716647625, 0.002339734695851803, 0.03911249339580536, -0.0477699413895607, 0.012053697369992733, 0.0033385062124580145, -0.04660648852586746, 0.010556609369814396, -0.0010918049374595284, -0.030865678563714027, -0.010676376521587372, 0.00793884415179491, 0.045648351311683655, 0.027375323697924614, -0.016433749347925186, -0.02359410747885704, -0.020599931478500366, -0.008601839654147625, -0.0014339964836835861, 0.06997817009687424, 0.045853666961193085, 0.02342301234602928, 0.0011891156900674105, -0.018615219742059708, -0.015176195651292801, -0.06197088956832886, -0.0035673468373715878, -0.01283218339085579, -0.01556971576064825, -0.015646709129214287, -0.0391809307038784, -0.02516818791627884, -0.0132428128272295, -0.015047873370349407, -0.01917983591556549, -0.011309430934488773, 0.020360397174954414, 0.043629422783851624, 0.016887152567505836, 0.06946488469839096, 0.010214418172836304, -0.06197088956832886, -0.015740811824798584, -0.05540081113576889, 0.03040371835231781, 0.0021600842010229826, 0.012241902761161327, -0.01786239817738533, -0.07890937477350235, -0.0024915821850299835, 0.030301062390208244, 0.05180780217051506, -0.03237131983041763, -0.03163560852408409, 0.02780306339263916, -0.041884247213602066, 0.0009902168530970812, 0.0043928842060267925, 0.03753841295838356, 0.06556390225887299, 0.02099345065653324, -0.03040371835231781, -0.043458327651023865, -0.010385513305664062, -0.017006920650601387, 0.030044417828321457, -0.033021483570337296, -0.02198580652475357, -0.054716430604457855, 0.018050603568553925, 0.03654605895280838, 0.019162727519869804, -0.007772025652229786, 0.013371135108172894, 0.010017657652497292, -0.02595522813498974, 0.00690799206495285, 0.03815435618162155, -0.01613433100283146, 0.009761014021933079, -0.005368129815906286, 0.010308520868420601, -0.0035844563972204924, -0.03384274244308472, -0.02706735208630562, -0.022054245695471764, -0.060088835656642914, 0.046264298260211945, 0.03346633538603783, 0.014260833151638508, 0.042055342346429825, 0.006394704803824425, 0.03409938886761665, 0.04794103652238846, 0.006976430304348469, -0.02421005256474018, 0.023748094215989113, 0.043218791484832764, 0.0175373163074255, 0.006634238641709089, -0.018837645649909973, -0.052663277834653854, 0.010009102523326874, 0.05560612678527832, -0.033637430518865585, -0.002425282495096326, -0.053313445299863815, -0.0337400883436203, 0.04417692869901657, -0.00400150241330266, 0.031532950699329376, 0.006527303718030453, -0.016108667477965355, 0.03634074330329895, 0.015321626327931881, -0.010719150304794312, 0.019898438826203346, -0.033483441919088364, 0.03312414139509201, -0.034886427223682404, 0.00046008723438717425, 0.05519549548625946, 0.053484540432691574, 0.007245906163007021, 0.002814525505527854, 0.01074481476098299, 0.007861850783228874, -0.04821478947997093, -0.08219441026449203, 0.07617183774709702, 0.010342739522457123, 0.023748094215989113, -0.058104123920202255, -0.05252640321850777, 0.0667615681886673, -0.03019840456545353, 0.047051336616277695, -0.003877457929775119, -0.008212597109377384, -0.015826359391212463, 0.042260657995939255, -0.02005242556333542, -0.00039138158899731934, -0.009316165000200272, -0.022191122174263, 0.04383473843336105, -0.045887887477874756, 0.0010233665816485882, 0.008879871107637882, -0.05252640321850777, -0.03572479635477066, -0.037641070783138275, 0.04404005408287048, 0.01320003904402256, -0.03675137087702751, -0.02710157074034214, -0.0110955610871315, 0.009555699303746223, -0.03007863648235798, -0.053484540432691574, 0.04376629739999771, 0.07083365321159363, 0.0013185067800804973, -0.0371277816593647, 0.026844926178455353, -0.0237652026116848, -0.05245796591043472, 0.0237652026116848, -0.006172280292958021, 0.015586825087666512, 0.039831098169088364, 0.08445287495851517, 0.0036742817610502243, -0.01000054832547903, 0.04944667965173721, 0.055879879742860794, -0.008627504110336304, -0.007207409478724003, -0.004384329076856375, -0.04479287564754486, -0.03692246973514557, 0.02248198539018631, -0.014158175326883793, 0.013473792001605034, -0.008888425305485725, 0.03654605895280838, -0.004084911663085222, 0.020617041736841202, 0.017332002520561218, -0.005432290956377983, 0.0050344932824373245, -0.014568805694580078, 0.03658027574419975, -0.027323994785547256, 0.027837282046675682, 0.006749728228896856, -0.02202002704143524, -0.010120315477252007, 0.004084911663085222, -0.051499828696250916, -0.008794322609901428, 0.025767024606466293, -0.028692761436104774, 0.01101001352071762, -0.0012329589808359742, 0.03315836191177368, -0.04852276295423508, -0.0083152549341321, 0.015432839281857014, -0.019607575610280037, 0.06474263966083527, 0.03081434965133667, 0.0029022120870649815, 0.0062278863042593, -0.017058249562978745, 0.0003606378159020096, 0.024843106046319008, 0.000293001503450796, 0.03213178738951683, -0.0022349385544657707, -0.10005681216716766, -0.005047325510531664, 0.026639612391591072, -0.012926286086440086, 0.05232108756899834, 0.03675137087702751, 0.025561708956956863, -0.008811432868242264, 0.02701602317392826, -0.0009319373057223856, -0.042055342346429825, 0.024535134434700012, -0.0371277816593647, -0.054305799305438995, 0.0015633876901119947, -0.008931199088692665, 0.033483441919088364, 0.028196584433317184, -0.009547144174575806, -0.02008664421737194, 0.06279215216636658, 0.04862542077898979, -0.125789612531662, -0.026348749175667763, 0.0005108813056722283, -0.001055981731042266, -0.013473792001605034, 0.014389154501259327, 0.015150531195104122, -0.07877249270677567, 0.023662544786930084, 0.02244776487350464, -0.055469248443841934, -0.03332945704460144, 0.008819987066090107, -0.03346633538603783, 0.03452712669968605, 0.0016778078861534595, 0.05786459147930145, 0.019658904522657394, -0.02326902560889721, 0.022464875131845474, 0.015535496175289154, -0.013790319673717022, 0.10943286120891571, -0.019693123176693916, 0.042021121829748154, 0.022533314302563667, -0.04811213165521622, 0.08650602400302887, -0.04650383070111275, 0.007275847718119621, 0.070149265229702, 0.02239643782377243, -0.03160138800740242, -0.037230439484119415, 0.0013078133342787623, -0.045648351311683655, -0.07117584347724915, 0.054887525737285614, -0.0014575221575796604, 0.02075391821563244, 0.00518847955390811, -0.03877030313014984, -0.037675291299819946, 0.0319264717400074, 0.03382563591003418, -0.0475304052233696, 0.008148436434566975, 0.009983438067138195, 0.008999637328088284, 0.015167640522122383, -0.04811213165521622, 0.00794312171638012, -0.07213398069143295, 0.011309430934488773, 0.042671285569667816, -0.05718020722270012, 0.014474702998995781, -0.03753841295838356, -0.04842010512948036, -0.0027888610493391752, 0.06354497373104095, 0.06624828279018402, 0.019693123176693916, -0.06672735512256622, -0.03262796252965927, 0.011249546892940998, 0.02616054378449917, 0.0048377332277596, 0.01185693684965372, 0.01262686774134636, -0.03336367756128311, 0.07049146294593811, 0.07021770626306534, -0.02037750743329525, -0.029668007045984268, -0.033722978085279465, 0.050473254173994064, 0.0009420961141586304, -0.02660539373755455, 0.03788060322403908, -0.0599861778318882, -0.060910094529390335, -0.0038646257016807795, 0.02622898295521736, -0.025014203041791916, 0.1064215749502182, -0.026502735912799835, 0.03545104339718819, -0.03305570408701897, 0.040070630609989166, 0.022670190781354904, 0.017879508435726166, 0.020907903090119362, -0.14194105565547943, 0.02722133696079254, -0.0019750867504626513, 0.015766475349664688, 0.01859811134636402, 0.010265746153891087, 0.034715332090854645, 0.0029428473208099604, -0.05858319252729416, 0.010111760348081589, -0.03527994826436043, -0.056495826691389084, 0.04972043260931969, -0.026536954566836357, -0.014500366523861885, -0.017186570912599564, -0.0314474031329155, 0.0011741447960957885, -0.024021847173571587, 0.005581999663263559, -0.05505862087011337, -0.02107900008559227, -0.00400150241330266, 0.017930837348103523, 0.03119076043367386, 0.045648351311683655, -0.014748455956578255, -0.036648716777563095, 0.0018435569945722818, -0.013294141739606857, -0.05663270130753517, -0.07206553965806961, -0.011343649588525295, -0.05061012879014015, 0.020120862871408463, 0.041473615914583206, -0.005355297587811947, -0.006339098326861858, -0.029873322695493698, -0.03476666286587715, -0.028744090348482132, 0.025441940873861313, -0.03233710303902626, -0.046264298260211945, 0.01859811134636402, -0.011172554455697536, 0.037435755133628845, 0.023816531524062157, 0.019111398607492447, 0.05622207000851631, -0.0737764984369278, -0.041850026696920395, 0.016716057434678078, 0.01723789982497692, -0.08684821426868439, 0.048077911138534546, -0.043047696352005005, -0.041884247213602066, -0.06015727296471596, -0.020309068262577057, -0.004709411412477493, 0.07247617095708847, -0.03510885313153267, -0.0355537012219429, -0.01002621278166771, 0.021814711391925812, 0.043424107134342194, -0.004953222814947367, 0.030386609956622124, 0.005509283859282732, -0.03043793886899948, 0.05765927582979202, -0.02788861095905304, -0.04236331209540367, 0.018991630524396896, 0.07055989652872086, -0.019077178090810776, -0.08493193984031677, -0.04852276295423508, -0.018786316737532616, 0.006099564488977194, 0.07480306923389435, 0.025065530091524124, 0.0071945772506296635, 0.06436622887849808, -0.0026327362284064293, -0.05639316886663437, -0.03678559139370918, -0.04790681600570679, -0.05194467678666115, -0.007091919891536236, -0.016895707696676254, 0.012378779239952564, 0.0031781040597707033, -0.0008073581848293543, -0.01572370156645775, 0.034424468874931335, 0.01220768317580223, 0.03788060322403908, -0.004270978271961212, 0.01769130304455757, 0.045477256178855896, -0.044382244348526, -0.04859120026230812, 0.004080634098500013, 0.03569057956337929, -0.03379141539335251, 0.0028722702991217375, 0.01827302947640419, -0.04318457469344139, -0.04089188948273659, 0.01559538021683693, 0.007395614869892597, -0.007955953478813171, -0.0028530219569802284, -0.014859667979180813, -0.0016681838314980268, -0.03832545503973961, -0.04236331209540367, 0.00018767068104352802, -0.016194215044379234, -0.1587768793106079, 0.020394615828990936, 0.002373953815549612, -0.038257014006376266, 0.05002840608358383, -0.03127630800008774, -0.042226437479257584, -0.0033128419890999794, 0.008999637328088284, 0.009786678478121758, -0.019316712394356728, 0.029257377609610558, -0.0882854163646698, -0.0070020947605371475, -0.04831744730472565, 0.06874628365039825, -0.010325630195438862, 0.00857617612928152, -0.06422935426235199, -0.0034732441417872906, 0.0017697719158604741, -0.0003277553478255868, -0.042671285569667816, -0.06662469357252121, 0.09280234575271606, 0.039625782519578934, -0.021523848176002502, 0.06662469357252121, -0.038838740438222885, 0.03237131983041763, -0.020925013348460197, 0.08287879079580307, 0.002579268766567111, -0.019727343693375587, -0.008144158869981766, -0.04691446200013161, 0.011463416740298271, -0.03647761791944504, 0.0284190084785223, -0.0022819899022579193, 0.0031631330493837595, 0.019316712394356728, 0.03119076043367386, -0.054716430604457855, 0.060499466955661774, -0.035245731472969055, -0.0030283951200544834, 0.004112714901566505, -0.052663277834653854, 0.03197779878973961, 0.04078923165798187, 0.03630652278661728, -0.0319264717400074, -0.01988132856786251, 0.03445868939161301, -0.022704409435391426, -0.029975980520248413, 0.004504096228629351, -0.0810309574007988, -0.025561708956956863, 0.07357118278741837, 0.054887525737285614, -0.0027888610493391752, 0.020771026611328125, 0.01489388756453991, 0.014526030980050564, -0.006488807033747435, -0.02350855991244316, 0.011087005957961082, -0.006779670249670744, 0.024073176085948944, -0.04732508957386017, 0.02701602317392826, -0.0299930889159441, -0.043663643300533295, 0.04229487478733063, 0.02095923200249672, -0.028247913345694542, 0.03247397765517235, -0.029445583000779152, 0.04913870617747307, 0.023080820217728615, -0.04975465312600136, 0.04492975026369095, -0.01113833487033844, -0.05786459147930145, -0.0013024666113778949, 0.007665090728551149, 0.025715695694088936, -0.05392938852310181, 0.020480163395404816, -0.034424468874931335, -0.03285038843750954, 0.013798873871564865, -0.0077035874128341675, -0.020942123606801033, 0.02958245947957039, 0.02195158787071705, -0.059541329741477966, -0.03180670365691185, 0.017212234437465668, -0.014423374086618423, 0.04715399444103241, 0.032730620354413986, 0.03285038843750954, 0.009256280958652496, -0.030095746740698814, 0.04835166782140732, -0.006989262532442808, 0.0073015121743083, 0.030301062390208244, 0.06994394958019257, -0.04681180417537689, 0.008216874673962593, 0.0003101110924035311, 0.043253012001514435, 0.00864033680409193, -0.009393158368766308, -0.012780854478478432, -0.004696579184383154, 0.02640007808804512, -0.05392938852310181, -0.0053852396085858345, -0.02359410747885704, -0.03589589521288872, 0.03384274244308472, 0.03148162364959717, 0.012199128977954388, -0.048899173736572266, 0.010907355695962906, 0.0391809307038784, -0.03242265060544014, 0.005120040848851204, 0.003520295489579439, -0.006347653456032276, -0.02862432226538658, -0.0013495179591700435, -0.01641663908958435, 0.0037491361144930124, 0.03367164731025696, 0.05820678174495697, 0.06244995817542076, 0.06693267077207565, 0.011454862542450428, -0.016057338565587997, 0.014449038542807102, -0.024843106046319008, 0.02107900008559227, -0.008263926021754742, 0.06696688383817673, 0.010625047609210014, 0.016510741785168648, 0.010342739522457123, -0.043081916868686676, -0.007754915859550238, 0.00033657747553661466, 0.03409938886761665, 0.012900621630251408, -0.06166291609406471, 0.03356898948550224, -0.042055342346429825, 0.014577359892427921, 0.0006736895884387195, 0.002277712570503354, -0.05601675808429718, 0.014149620197713375, 0.05064434930682182, 0.04239753261208534, 0.010017657652497292, 0.005462232511490583, -0.04694867879152298, 0.006976430304348469, 0.023662544786930084, 0.04174736887216568, 0.03569057956337929, 0.013952860608696938, 0.07138115912675858, 0.041644711047410965, -0.00019595812773332, -0.03043793886899948, 0.04876229539513588, 0.02119876630604267, -0.02198580652475357, 0.012926286086440086, 0.0007945260149426758, 0.028521666303277016, -0.004871952347457409, -0.01571514643728733, -0.05947289243340492, 0.006869495380669832, -0.03279906138777733, -0.020326178520917892, -0.0005221094470471144, 0.01280651893466711, 0.01964179426431656, -0.05084966495633125, 0.07144959270954132, -0.00964980199933052, 0.03226866200566292, 0.02958245947957039, -0.012926286086440086, 0.024860216304659843, -0.05837787687778473, 0.00526119489222765, -0.01206225249916315, -0.000664600171148777, 0.054716430604457855, 0.005680379923433065, -0.034424468874931335, -0.033483441919088364, 0.0649479553103447, 0.03678559139370918, 0.027323994785547256, -0.04219221696257591, 0.017306337133049965, 0.04581945016980171, 0.062894806265831, -0.036066990345716476, 0.042465969920158386, -0.0010752299567684531, -0.03447579964995384, -0.0299930889159441, 0.030711691826581955, -0.022088464349508286, 0.06792502105236053, 0.05937023460865021, -0.08363161236047745, 0.014449038542807102, -0.007049146108329296, 0.009829452261328697 ]
716,710
pytorch_optimizer.optimizer.gravity
Gravity
a Kinematic Approach on Optimization in Deep Learning. :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param lr: float. learning rate. :param alpha: float. alpha controls the V initialization. :param beta: float. beta will be used to compute running average of V.
class Gravity(Optimizer, BaseOptimizer): r"""a Kinematic Approach on Optimization in Deep Learning. :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param lr: float. learning rate. :param alpha: float. alpha controls the V initialization. :param beta: float. beta will be used to compute running average of V. """ def __init__( self, params: PARAMETERS, lr: float = 1e-2, alpha: float = 0.01, beta: float = 0.9, ): self.validate_learning_rate(lr) self.validate_range(alpha, 'alpha', 0.0, 1.0) self.validate_range(beta, 'beta', 0.0, 1.0, range_type='[]') defaults: DEFAULTS = {'lr': lr, 'alpha': alpha, 'beta': beta} super().__init__(params, defaults) def __str__(self) -> str: return 'Gravity' @torch.no_grad() def reset(self): for group in self.param_groups: for p in group['params']: state = self.state[p] state['v'] = torch.empty_like(p).normal_(mean=0.0, std=group['alpha'] / group['lr']) @torch.no_grad() def step(self, closure: CLOSURE = None) -> LOSS: loss: LOSS = None if closure is not None: with torch.enable_grad(): loss = closure() for group in self.param_groups: if 'step' in group: group['step'] += 1 else: group['step'] = 1 beta_t: float = (group['beta'] * group['step'] + 1) / (group['step'] + 2) for p in group['params']: if p.grad is None: continue grad = p.grad if grad.is_sparse: raise NoSparseGradientError(str(self)) state = self.state[p] if len(state) == 0: state['v'] = torch.empty_like(p).normal_(mean=0.0, std=group['alpha'] / group['lr']) v = state['v'] m = 1.0 / grad.abs().max() zeta = grad / (1.0 + (grad / m) ** 2) v.mul_(beta_t).add_(zeta, alpha=1.0 - beta_t) p.add_(v, alpha=-group['lr']) return loss
(params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], lr: float = 0.01, alpha: float = 0.01, beta: float = 0.9)
[ 0.008164002560079098, -0.038811370730400085, -0.06531202048063278, 0.02592538297176361, -0.011371118016541004, -0.001867222017608583, -0.07827471196651459, -0.060824938118457794, -0.00343482568860054, 0.0016598860966041684, -0.03311622515320778, -0.001265588216483593, 0.002787649864330888, 0.05269449204206467, -0.04241637885570526, 0.02571445144712925, -0.009702842682600021, 0.038868896663188934, 0.02774706296622753, -0.028667490929365158, -0.013988585211336613, -0.03873467072844505, -0.018609900027513504, 0.03541729599237442, -0.034036651253700256, -0.014956951141357422, 0.041227493435144424, -0.024257106706500053, -0.03950169309973717, -0.002203993033617735, -0.020287763327360153, -0.03798682242631912, 0.017948342487215996, 0.004038856364786625, 0.02617466449737549, -0.06933889538049698, 0.01790999062359333, 0.017267609015107155, -0.10761334747076035, -0.014928188174962997, -0.010565743781626225, -0.033154577016830444, 0.012128553353250027, -0.04479415342211723, 0.018887944519519806, -0.016884097829461098, 0.0016682753339409828, 0.056107744574546814, -0.0134996073320508, -0.029396163299679756, 0.037871766835451126, -0.05311635509133339, 0.04820740595459938, -0.025963732972741127, -0.031332895159721375, 0.053154703229665756, 0.06657761335372925, -0.024659793823957443, 0.049703098833560944, -0.05461204797029495, 0.03346138447523117, -0.0725603923201561, -0.0009342102566733956, -0.003976535517722368, 0.0038423065561801195, -0.00962614081799984, -0.05840881168842316, -0.009237835183739662, 0.021112311631441116, 0.04663500934839249, 0.008863911032676697, -0.020786328241229057, 0.027919642627239227, -0.010949255898594856, -0.01952073909342289, 0.013346202671527863, -0.07961700111627579, -0.058332111686468124, 0.014487150125205517, -0.06285754591226578, 0.012301133945584297, -0.021917685866355896, -0.0075743538327515125, -0.02767036110162735, 0.015867792069911957, -0.03284776583313942, -0.018360616639256477, -0.05123714730143547, 0.03482285141944885, -0.0842958465218544, 0.014918600209057331, 0.007488063536584377, 0.023317504674196243, 0.018820831552147865, 0.04034541919827461, 0.04548447206616402, -0.019770022481679916, -0.057871896773576736, -0.03413252905011177, -0.01690327376127243, 0.042723190039396286, 0.047900594770908356, 0.010843790136277676, 0.050661880522966385, 0.04145760089159012, -0.06024966761469841, -0.036587003618478775, -0.031352072954177856, 0.04038377106189728, -0.03512965887784958, -0.025426818057894707, -0.007027849555015564, -0.03794847056269646, -0.0002765477984212339, -0.033154577016830444, 0.024736497551202774, -0.01568562351167202, 0.008384522050619125, -0.04126584529876709, 0.015992432832717896, 0.04732532799243927, 0.019223518669605255, -0.028897598385810852, 0.005153436679393053, 0.017315547913312912, -0.007392185740172863, 0.02713344432413578, 0.016241716220974922, 0.02072880044579506, -0.037871766835451126, -0.011505347676575184, 0.021840984001755714, -0.02080550231039524, -0.015704799443483353, 0.04126584529876709, -0.015791088342666626, -0.0022986724507063627, 0.013988585211336613, -0.005599269177764654, 0.031332895159721375, 0.01628965511918068, -0.014170752838253975, -0.0067593916319310665, -0.02349008433520794, 0.022454602643847466, 0.01454467698931694, 0.034170880913734436, 0.023873595520853996, -0.0005483017303049564, -0.017679883167147636, 0.01346125639975071, 0.015551394782960415, 0.04456404596567154, 0.00504797138273716, -0.012790110893547535, 0.010699973441660404, -0.028782544657588005, -0.017018325626850128, -0.023317504674196243, 0.013950233347713947, -0.036644529551267624, -0.01144782081246376, -0.05741168186068535, -0.006773773115128279, 0.014698081649839878, -0.00008621520100859925, 0.036184318363666534, 0.007703789044171572, -0.04279989376664162, 0.04161100462079048, -0.009070049040019512, -0.08383563160896301, 0.01904135011136532, 0.02281893976032734, -0.0022279624827206135, 0.11513017863035202, 0.004563787952065468, 0.026308894157409668, 0.0243721604347229, -0.026423947885632515, 0.006586811505258083, -0.02423793263733387, -0.036395248025655746, -0.08421914279460907, -0.014755607582628727, 0.05070023238658905, -0.007809254340827465, -0.008398903533816338, -0.017066264525055885, 0.027095092460513115, 0.007315483409911394, -0.045331068336963654, 0.014765195548534393, -0.013700950890779495, -0.00503358943387866, 0.05346151441335678, 0.040422119200229645, 0.028840070590376854, 0.06611739844083786, 0.04479415342211723, 0.02552269585430622, 0.006452582310885191, 0.008907056413590908, 0.012857225723564625, -0.0370088666677475, 0.021917685866355896, -0.0015723974211141467, 0.031121965497732162, -0.00474835280328989, -0.006428612861782312, -0.05000991001725197, 0.005431482568383217, 0.02592538297176361, 0.0554557740688324, 0.02402700111269951, -0.04356691613793373, -0.00452783377841115, 0.04747873172163963, 0.04786224663257599, 0.015426753088831902, 0.01097801886498928, -0.05177406221628189, -0.008269468322396278, -0.019300220534205437, 0.0645066499710083, -0.022205321118235588, 0.03050834685564041, -0.026673229411244392, -0.05296294763684273, -0.05070023238658905, 0.03319292888045311, -0.06753639131784439, 0.011054721660912037, 0.0154555169865489, 0.058600571006536484, 0.002007443457841873, 0.0061841243878006935, -0.0054506585001945496, -0.017478540539741516, -0.02013435773551464, -0.006447788327932358, -0.04065222665667534, -0.050661880522966385, 0.04502426087856293, -0.023336678743362427, 0.030144009739160538, 0.04276154190301895, 0.04168770834803581, 0.014343333430588245, 0.041227493435144424, -0.05641455203294754, -0.03595421090722084, -0.04847586527466774, 0.039616744965314865, -0.0488593764603138, -0.0027924436144530773, 0.05595434084534645, 0.024276282638311386, 0.02161087654531002, -0.04295329749584198, -0.0376800112426281, -0.047018520534038544, -0.10009652376174927, 0.08644350618124008, 0.025695275515317917, 0.0309110339730978, 0.0779295563697815, -0.025484343990683556, 0.012128553353250027, 0.017047090455889702, 0.11842837184667587, 0.08759404718875885, -0.07117974758148193, -0.023240800946950912, 0.012847637757658958, 0.027900466695427895, -0.012742171995341778, 0.04287659376859665, 0.0007981834933161736, -0.00881597213447094, 0.06396973133087158, -0.04107408970594406, -0.046021390706300735, -0.006888826843351126, -0.06262744218111038, 0.03317375108599663, -0.028782544657588005, -0.016107486560940742, 0.047286976128816605, 0.028034696355462074, 0.03628019616007805, 0.021169839426875114, 0.07808295637369156, 0.008633804507553577, 0.11520687490701675, 0.001562809688039124, -0.02949204109609127, 0.06512026488780975, -0.0030609017703682184, -0.022569656372070312, 0.1067696213722229, -0.01588696800172329, 0.004901757463812828, -0.014669317752122879, -0.018887944519519806, 0.001885199104435742, 0.03917570784687996, -0.0004913742304779589, 0.04536942020058632, -0.020230235531926155, -0.02847573533654213, -0.029971430078148842, -0.00126199284568429, 0.01764153316617012, -0.0032886117696762085, -0.08475606143474579, -0.01831267774105072, -0.05292459949851036, 0.02617466449737549, 0.0514289028942585, -0.006649131886661053, 0.05372997373342514, -0.0036817111540585756, 0.01521582156419754, -0.03723897412419319, -0.060556478798389435, 0.03708557039499283, 0.03468862175941467, -0.038677141070365906, -0.007799666840583086, -0.02362431399524212, -0.024065351113677025, 0.03535976633429527, 0.02525423839688301, -0.0408056303858757, 0.004398398566991091, 0.058945730328559875, 0.02807304821908474, 0.017152555286884308, -0.03319292888045311, 0.05219592526555061, 0.05407513305544853, -0.040767282247543335, 0.04099738597869873, 0.012569592334330082, -0.03495708107948303, 0.042838241904973984, -0.023259976878762245, 0.03909900411963463, 0.023010695353150368, -0.020211059600114822, 0.0181113351136446, 0.011112247593700886, 0.04813070222735405, 0.04989485815167427, -0.040959037840366364, 0.015992432832717896, -0.026289718225598335, 0.008533132262527943, -0.03273271396756172, -0.015666447579860687, 0.052004169672727585, -0.0566830113530159, 0.09165927022695541, 0.07083459198474884, -0.030048131942749023, -0.029300285503268242, -0.04176441207528114, 0.019367335364222527, -0.024218756705522537, 0.009932950139045715, -0.10876388102769852, -0.009817896410822868, 0.02949204109609127, -0.042723190039396286, -0.007814048789441586, -0.00760791078209877, -0.019175579771399498, 0.06132350116968155, 0.008748858235776424, 0.04145760089159012, 0.0016922448994591832, 0.038408685475587845, 0.03204239159822464, 0.05196581780910492, -0.017392249777913094, 0.024468038231134415, -0.020306937396526337, 0.06370127201080322, -0.05729662999510765, 0.02396947331726551, -0.018935883417725563, 0.022320372983813286, 0.00797224696725607, -0.0709879919886589, 0.036855462938547134, 0.03346138447523117, 0.014400859363377094, -0.044065479189157486, -0.03188898786902428, -0.015407578088343143, -0.023394206538796425, -0.033691491931676865, 0.030546696856617928, 0.0033772988244891167, -0.09963630884885788, 0.05380667373538017, 0.07363422214984894, -0.01046986598521471, 0.09265639632940292, -0.02187933586537838, 0.008058536797761917, -0.019108464941382408, 0.04920453578233719, 0.009103606455028057, -0.05415183678269386, 0.05027836933732033, 0.006337529048323631, 0.017593594267964363, 0.057871896773576736, 0.03344221040606499, 0.01824556291103363, 0.07351917028427124, 0.024928253144025803, 0.008863911032676697, -0.008187972009181976, -0.05932924151420593, -0.03748825564980507, -0.03419005870819092, -0.03162052854895592, -0.009683667682111263, -0.023010695353150368, -0.022512130439281464, 0.0056520020589232445, -0.019271457567811012, -0.006577223539352417, 0.007929101586341858, 0.0370088666677475, 0.0269992146641016, 0.010632858611643314, 0.02356678619980812, -0.03233002498745918, -0.001826473861001432, 0.012809286825358868, -0.024046175181865692, -0.017085440456867218, 0.033423032611608505, -0.017133379355072975, -0.030872682109475136, 0.00349235231988132, 0.02276141196489334, 0.04161100462079048, 0.030738452449440956, 0.01709502935409546, 0.03426675871014595, 0.00841328501701355, -0.04172606021165848, -0.03687463700771332, -0.026807459071278572, -0.020076831802725792, 0.005719116423279047, 0.041380900889635086, -0.040575526654720306, 0.03942498937249184, -0.03938663750886917, 0.0257719773799181, 0.05311635509133339, 0.0008808781858533621, -0.025906207039952278, -0.04088233411312103, 0.006140979006886482, -0.0033557263668626547, 0.010901317000389099, -0.02780458889901638, -0.05000991001725197, -0.00042396006756462157, -0.04582963511347771, -0.005628032609820366, -0.0037392377853393555, -0.035724103450775146, 0.02166840434074402, -0.049703098833560944, 0.02235872484743595, 0.07662561535835266, 0.0031495888251811266, 0.04502426087856293, 0.017315547913312912, 0.033959951251745224, 0.006687483284622431, 0.027421077713370323, -0.04038377106189728, -0.042914945632219315, 0.07363422214984894, 0.02538846619427204, -0.05434359237551689, -0.005968398880213499, 0.012349072843790054, 0.0070422315038740635, 0.06979911029338837, 0.002612672746181488, 0.01843731850385666, 0.02970297262072563, -0.06577223539352417, 0.0018396570812910795, 0.04287659376859665, -0.05165901035070419, -0.03545564413070679, 0.027440253645181656, -0.04287659376859665, 0.04364361613988876, -0.011505347676575184, -0.022301198914647102, 0.027382725849747658, 0.007267544511705637, -0.002857161220163107, -0.025637749582529068, -0.030182361602783203, 0.05054682493209839, 0.02249295450747013, -0.04559952765703201, 0.016059547662734985, 0.034420162439346313, -0.01346125639975071, -0.03405582904815674, 0.00881597213447094, 0.05794860050082207, -0.012617531232535839, -0.019942602142691612, 0.050585176795721054, -0.002703756559640169, 0.009650110267102718, 0.0011493362253531814, -0.015704799443483353, 0.05576258525252342, 0.0003154982114210725, -0.011994324624538422, 0.017794936895370483, -0.04456404596567154, -0.09419044107198715, -0.030009781941771507, 0.01447756215929985, -0.014793959446251392, 0.016999151557683945, -0.007435330655425787, -0.009103606455028057, 0.02976049855351448, 0.01185050792992115, 0.02187933586537838, -0.03486120328307152, -0.006936765741556883, -0.05783354490995407, 0.024122878909111023, -0.049319587647914886, 0.026769109070301056, 0.043605268001556396, 0.024487214162945747, -0.04479415342211723, 0.02113148756325245, 0.0355515219271183, 0.042301326990127563, -0.017516890540719032, -0.036989692598581314, 0.01248330157250166, -0.00543627655133605, -0.018542785197496414, 0.02276141196489334, 0.00029647242627106607, -0.0012643897207453847, 0.000814362894743681, 0.03718144819140434, 0.013643424026668072, -0.045867983251810074, -0.007430536672472954, -0.014257042668759823, -0.014793959446251392, 0.027977170422673225, 0.006735422182828188, 0.022166969254612923, -0.040422119200229645, -0.05737333372235298, 0.053346458822488785, -0.052656140178442, 0.0067641856148839, -0.0038710699882358313, -0.014573439955711365, 0.039616744965314865, -0.06492850929498672, 0.03378736972808838, 0.03455439209938049, 0.03165888041257858, -0.0154555169865489, 0.04065222665667534, -0.012435362674295902, -0.039961908012628555, -0.02834150567650795, 0.02080550231039524, -0.052080873399972916, 0.013950233347713947, 0.0395783931016922, 0.009170720353722572, -0.06799660623073578, -0.01167792733758688, 0.04061387479305267, 0.011457408778369427, -0.02396947331726551, 0.004841833841055632, -0.013605073094367981, 0.036050088703632355, 0.03037411719560623, -0.07754603773355484, -0.03589668497443199, -0.04989485815167427, -0.021169839426875114, -0.004096383228898048, -0.03144795075058937, -0.005076734349131584, -0.03628019616007805, 0.02841820754110813, 0.08813095837831497, -0.023777717724442482, -0.02308739721775055, -0.028168926015496254, -0.015676036477088928, -0.010757499374449253, 0.009271392598748207, -0.04195616766810417, 0.04115079343318939, -0.10278110206127167, -0.018025044351816177, -0.007018262054771185, -0.019204342737793922, -0.017315547913312912, -0.017085440456867218, -0.020172709599137306, 0.021630052477121353, -0.002619863487780094, 0.011486171744763851, 0.013748889788985252, -0.0409206859767437, -0.04364361613988876, -0.024122878909111023, 0.041917815804481506, -0.010086354799568653, 0.005968398880213499, -0.029166055843234062, -0.04671170935034752, -0.005163024645298719, 0.04928123950958252, 0.05246438458561897, 0.01784287579357624, -0.01925228163599968, 0.03973180055618286, -0.012243607081472874, -0.003935787361115217, 0.00040148867992684245, -0.01925228163599968, 0.03727732598781586, 0.013288675807416439, 0.04866762086749077, -0.03405582904815674, -0.015973256900906563, -0.006610780954360962, -0.005954017397016287, 0.024276282638311386, -0.040767282247543335, -0.022262847051024437, -0.02214779332280159, -0.025215886533260345, 0.012118966318666935, 0.007919514551758766, -0.05852386727929115, -0.03512965887784958, -0.022703886032104492, 0.007852399721741676, -0.0097268121317029, -0.016941623762249947, 0.06899373233318329, -0.048092350363731384, -0.002064970089122653, -0.0037991616409271955, 0.028226451948285103, 0.05372997373342514, 0.007718170527368784, 0.028897598385810852, 0.03083433024585247, -0.011735454201698303, -0.03626101836562157, -0.006999086122959852, 0.030949383974075317, 0.015848616138100624, -0.040230363607406616, -0.013710538856685162, 0.04314505308866501, -0.003652947722002864, 0.038542915135622025, -0.07071953266859055, -0.02976049855351448, -0.03037411719560623, -0.01494736410677433, -0.057871896773576736, -0.015781501308083534, -0.01905093714594841, -0.0514289028942585, 0.010086354799568653, 0.0033557263668626547, 0.028629139065742493, 0.03254095837473869, -0.014103638008236885, -0.0039453753270208836, -0.025676099583506584, 0.038216929882764816, 0.0009893400128930807, 0.004825055133551359, 0.000931813265196979, 0.06611739844083786, -0.004947299137711525, 0.015369226224720478, -0.015378814190626144, -0.02423793263733387, 0.02483237534761429, -0.012569592334330082, 0.001797710545361042, -0.00835096463561058, -0.0046356962993741035, -0.028667490929365158, -0.03750743344426155, 0.014592615887522697, -0.04698016867041588, -0.0029770086985081434, -0.008159209042787552, 0.017679883167147636, 0.044525694102048874, 0.015934906899929047, -0.06623245030641556, -0.012090202420949936, -0.013442080467939377, 0.03037411719560623, 0.02195603772997856, -0.030259063467383385, 0.07179336994886398, -0.018293501809239388, 0.06005791202187538, -0.014726844616234303, -0.059751104563474655, 0.025752803310751915, 0.03539811819791794, -0.03257931023836136, -0.01494736410677433, 0.01356672216206789, -0.015187058597803116, 0.07931019365787506, 0.010210995562374592, 0.04233967885375023, 0.0003053111722692847, 0.08053743094205856, -0.033077873289585114, 0.00003674070831038989, -0.06308765709400177, -0.076472207903862, -0.09794885665178299, -0.016538936644792557, -0.0724453404545784, 0.04245473071932793, 0.0329819954931736, 0.0003205917018931359, 0.015187058597803116, 0.033959951251745224, 0.003974138759076595 ]
716,712
pytorch_optimizer.optimizer.gravity
__init__
null
def __init__( self, params: PARAMETERS, lr: float = 1e-2, alpha: float = 0.01, beta: float = 0.9, ): self.validate_learning_rate(lr) self.validate_range(alpha, 'alpha', 0.0, 1.0) self.validate_range(beta, 'beta', 0.0, 1.0, range_type='[]') defaults: DEFAULTS = {'lr': lr, 'alpha': alpha, 'beta': beta} super().__init__(params, defaults)
(self, params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], lr: float = 0.01, alpha: float = 0.01, beta: float = 0.9)
[ 0.00894186832010746, -0.012235751375555992, -0.03474394977092743, -0.0030705686658620834, -0.05683343484997749, -0.013501198031008244, -0.06237906962633133, -0.04209470748901367, -0.04328571632504463, 0.03316214308142662, -0.017269622534513474, 0.038447242230176926, 0.0036986395716667175, 0.0557168647646904, -0.015631986781954765, 0.0026332454290241003, 0.025718340650200844, 0.024415673688054085, -0.031189534813165665, -0.010579505003988743, -0.021326495334506035, 0.02769094705581665, -0.027877042070031166, 0.1098705306649208, 0.009030263870954514, 0.05292544141411781, 0.008834864012897015, -0.005382800009101629, -0.04633767530322075, 0.004754729103296995, 0.020470459014177322, -0.001257304917089641, 0.015371453016996384, 0.07056725025177002, 0.012784731574356556, -0.02862142212688923, -0.02357824705541134, -0.0026332454290241003, -0.10867952555418015, 0.05951320752501488, 0.019874954596161842, -0.026965176686644554, 0.03548832982778549, -0.042727429419755936, 0.002505304990336299, -0.02346658892929554, 0.036121055483818054, 0.018609507009387016, -0.026462720707058907, -0.04135032743215561, 0.025457806885242462, -0.004187139216810465, 0.028379499912261963, -0.03024045005440712, -0.03312492370605469, 0.06576599925756454, 0.0370701402425766, 0.042504116892814636, 0.04827306419610977, 0.01609722338616848, -0.0005609021754935384, -0.06152303144335747, -0.022201143205165863, -0.04209470748901367, 0.0046384199522435665, -0.021642858162522316, -0.07674560695886612, -0.02368990331888199, 0.022722208872437477, 0.06464943289756775, 0.09059108048677444, -0.005099005065858364, -0.015399367548525333, 0.00214823498390615, 0.015436586923897266, -0.0021493982058018446, -0.07637342065572739, -0.0011584418825805187, -0.03746093809604645, -0.009346624836325645, 0.0429135262966156, 0.04056872799992561, 0.005085047800093889, -0.020191315561532974, 0.005810818634927273, -0.06531937420368195, -0.056870654225349426, -0.06628706306219101, 0.03271551430225372, 0.0214567631483078, -0.06889239698648453, -0.015734339132905006, 0.003549763699993491, -0.023075789213180542, 0.04056872799992561, 0.004731467459350824, 0.024527331814169884, -0.025755558162927628, 0.010067743249237537, -0.03803783282637596, -0.019279450178146362, -0.004543046001344919, -0.045593295246362686, 0.019391106441617012, 0.019205011427402496, -0.04239245876669884, -0.03826114907860756, -0.03690265491604805, 0.027951480820775032, -0.004317405633628368, -0.013864083215594292, 0.04730536788702011, -0.0424668975174427, 0.045332759618759155, -0.067850261926651, 0.044030096381902695, -0.009253577329218388, 0.004773338790982962, -0.016488023102283478, -0.010142181999981403, 0.027002396062016487, 0.05430254340171814, -0.04406731575727463, 0.05273934453725815, 0.03474394977092743, 0.008839515969157219, 0.0036683992948383093, 0.024043483659625053, -0.007420541252940893, -0.032603856176137924, 0.037312064319849014, 0.009281491860747337, -0.04388121888041496, -0.011965913698077202, 0.03680960461497307, -0.051846086978912354, 0.023447979241609573, 0.04514666646718979, -0.014571244828402996, 0.015157444402575493, 0.04860803484916687, 0.029198316857218742, 0.045221105217933655, -0.05158555507659912, 0.007588026579469442, 0.02454594150185585, -0.007481022272258997, -0.011054047383368015, -0.019223621115088463, 0.02850976586341858, 0.018395498394966125, 0.01635775715112686, 0.016999784857034683, -0.007783426437526941, 0.0279142614454031, -0.060071490705013275, 0.03452063724398613, -0.06855742633342743, 0.03234332427382469, -0.008560373447835445, -0.01149137131869793, 0.025550853461027145, 0.00782995019108057, -0.061783567070961, -0.0018493197858333588, 0.04704483598470688, -0.04399287700653076, -0.0048663862980902195, -0.011044742539525032, -0.0139292161911726, -0.014440977945923805, -0.0977371335029602, -0.008416149765253067, 0.021363714709877968, -0.015241187065839767, 0.03453924506902695, 0.015687815845012665, 0.00684364652261138, 0.009230315685272217, 0.018767688423395157, 0.0690784901380539, 0.008551068603992462, -0.030742906033992767, -0.03971268981695175, 0.03453924506902695, 0.000016810347005957738, -0.06394226849079132, 0.05407923087477684, -0.059141017496585846, 0.017083527520298958, 0.057950008660554886, 0.02372712269425392, 0.000727515434846282, 0.010812124237418175, -0.02672325260937214, 0.018460631370544434, 0.04682151973247528, 0.003645137418061495, 0.04209470748901367, 0.052813783288002014, 0.08150964230298996, 0.04075482115149498, -0.009007001295685768, 0.00644819438457489, 0.00459422217682004, -0.011426237411797047, -0.012226446531713009, -0.0002457036462146789, -0.015529634431004524, -0.032213058322668076, -0.012980131432414055, -0.015855301171541214, 0.008681335486471653, 0.019744688645005226, -0.006527284625917673, -0.04585382714867592, -0.009583896957337856, 0.008267274126410484, 0.03701430931687355, 0.008634811267256737, 0.12691684067249298, -0.025401977822184563, 0.008430106565356255, -0.049017444252967834, 0.046151578426361084, 0.022517504170536995, 0.05002235621213913, -0.07142329216003418, -0.08284952491521835, 0.061150841414928436, -0.03109648823738098, -0.06930180639028549, -0.004235989414155483, 0.007066960446536541, 0.004040589556097984, 0.06312344968318939, -0.011351799592375755, 0.02216392382979393, -0.09327085316181183, -0.0343717597424984, 0.032324716448783875, 0.031412847340106964, -0.007322841323912144, -0.02649993821978569, 0.001200313214212656, 0.014468892477452755, 0.010960999876260757, 0.05873160809278488, -0.044253408908843994, -0.04001044109463692, -0.04838471859693527, -0.010170095600187778, 0.000938035489525646, 0.062453508377075195, -0.036121055483818054, 0.041313108056783676, 0.03212001174688339, -0.032808560878038406, 0.05322319269180298, -0.00813235528767109, -0.009937477298080921, -0.011407628655433655, -0.01245906576514244, 0.09609949588775635, 0.026202186942100525, 0.010821429081261158, 0.011342494748532772, 0.01890726014971733, 0.045221105217933655, -0.008257969282567501, 0.14790837466716766, 0.028472546488046646, -0.01576225273311138, -0.011668161489069462, 0.04049428924918175, -0.03621410205960274, 0.014924825169146061, -0.03533945605158806, 0.003735858714208007, 0.03440897911787033, 0.02927275560796261, -0.025885825976729393, 0.010756295174360275, -0.006052742246538401, 0.018600203096866608, -0.017492936924099922, -0.0003884734760504216, -0.021605638787150383, -0.03478116914629936, 0.011063352227210999, 0.004028958268463612, -0.014943434856832027, 0.05251603201031685, 0.029942698776721954, 0.08225402235984802, -0.007899736054241657, 0.048421937972307205, -0.002402952639386058, 0.03247359022498131, -0.003614896908402443, 0.04027097299695015, -0.045109447091817856, 0.0629001334309578, -0.026164967566728592, -0.046151578426361084, -0.06241628900170326, 0.0305009838193655, 0.03035210631787777, 0.02856559492647648, 0.02210809476673603, 0.019372496753931046, 0.05244159325957298, 0.010067743249237537, -0.00161902722902596, 0.02233140915632248, -0.05761503428220749, 0.013966435566544533, -0.0553818941116333, 0.030389325693249702, 0.03625132143497467, -0.0062946658581495285, 0.024806473404169083, -0.008244011551141739, -0.027616510167717934, -0.05266490578651428, -0.06986009329557419, 0.03018462099134922, 0.04499778896570206, -0.042950745671987534, -0.013938521035015583, -0.0314500667154789, -0.01907474547624588, 0.034222885966300964, -0.03407400846481323, -0.029403021559119225, -0.01576225273311138, 0.003168268594890833, 0.06431446224451065, 0.017223099246621132, -0.002444823971018195, 0.05653568357229233, -0.033943742513656616, -0.013454673811793327, 0.03007296472787857, 0.013268578797578812, -0.03792617842555046, 0.0028123618103563786, -0.03885665163397789, 0.024973958730697632, -0.03182225674390793, -0.038670558482408524, 0.013473283499479294, -0.013640768826007843, 0.04514666646718979, 0.019223621115088463, -0.03504170477390289, -0.004196444060653448, -0.015287710353732109, 0.02238723821938038, -0.04458837956190109, -0.02233140915632248, 0.013035960495471954, -0.0618952214717865, 0.03800061345100403, 0.0341484472155571, -0.0006670345319435, 0.00684364652261138, -0.032268885523080826, 0.04090369865298271, 0.0016888128593564034, 0.016562461853027344, -0.0629001334309578, -0.010514372028410435, -0.002447150181978941, 0.006024828180670738, 0.014078092761337757, -0.006252794526517391, -0.0074624125845730305, 0.033515725284814835, -0.013715207576751709, -0.011528589762747288, 0.0008792992448434234, 0.06825967133045197, 0.020730990916490555, -0.0015946022467687726, -0.03146867826581001, -0.014040873385965824, 0.0006862255977466702, 0.03131980076432228, -0.0034148446284234524, -0.008304492570459843, 0.010616724379360676, 0.0014515415532514453, -0.01554824411869049, -0.07253985852003098, 0.027355976402759552, 0.041536420583724976, 0.020302973687648773, -0.012673074379563332, -0.03424149379134178, -0.01886073686182499, -0.04458837956190109, -0.004624462686479092, 0.03522779792547226, 0.021977828815579414, -0.0005766039830632508, 0.03930328041315079, 0.015269100666046143, 0.009258230216801167, 0.05117614567279816, -0.017697641626000404, -0.043434590101242065, -0.016115833073854446, 0.00886277761310339, 0.007662464864552021, -0.036325760185718536, 0.05657290294766426, -0.028919175267219543, 0.010477152653038502, -0.014338625594973564, 0.023392152041196823, -0.002803057199344039, 0.06617540866136551, 0.05039454624056816, 0.05884326249361038, 0.058508291840553284, 0.0009560634498484433, -0.012021741829812527, 0.0008066058508120477, -0.05657290294766426, -0.04563051462173462, -0.0014724773354828358, -0.03952659294009209, -0.04927797615528107, 0.009946782141923904, -0.011519284918904305, -0.019037526100873947, 0.011389018967747688, 0.013277883641421795, -0.022033657878637314, 0.037423718720674515, -0.06435167789459229, 0.04172251746058464, 0.01739058457314968, -0.04008487984538078, -0.03024045005440712, 0.0046547031961381435, -0.002264544367790222, -0.027337366715073586, -0.029123879969120026, 0.009993305429816246, 0.010495762340724468, 0.02703961543738842, -0.012142703868448734, 0.011054047383368015, -0.024452893063426018, -0.04775199666619301, -0.014561939984560013, 0.05895492061972618, -0.03306909650564194, 0.04957572743296623, 0.018618812784552574, -0.007387974765151739, -0.011314581148326397, -0.04079204052686691, 0.03792617842555046, 0.067850261926651, -0.009890953078866005, -0.008444064296782017, 0.017539460211992264, 0.002803057199344039, 0.026518547907471657, 0.02264777012169361, -0.04228080064058304, -0.055158581584692, 0.02216392382979393, 0.0168509092181921, 0.00684364652261138, -0.004089439287781715, -0.019223621115088463, 0.0014178118435665965, -0.050915613770484924, 0.012580026872456074, 0.09833263605833054, 0.0010892377467826009, -0.0013852452393621206, -0.07253985852003098, 0.023671293631196022, -0.01097030472010374, 0.048682473599910736, -0.07209323346614838, -0.03342267498373985, 0.010672552511096, 0.061150841414928436, -0.053037095814943314, -0.03509753197431564, 0.04492335021495819, 0.021438153460621834, 0.03727484494447708, 0.03811227157711983, 0.01159372366964817, -0.024806473404169083, -0.023987654596567154, -0.009383844211697578, 0.04395565763115883, -0.031170925125479698, -0.09580174833536148, 0.02000522054731846, -0.027932871133089066, 0.001260794117115438, -0.034930046647787094, 0.008546416647732258, 0.0065924180671572685, 0.002891452284529805, -0.042131926864385605, -0.004617484286427498, -0.058396633714437485, 0.0615602508187294, -0.016655510291457176, -0.01435723528265953, 0.020023830235004425, 0.04499778896570206, 0.06249072775244713, -0.05891770124435425, 0.021047353744506836, 0.048049747943878174, -0.00647610891610384, -0.05742894113063812, 0.033739037811756134, 0.03712596744298935, 0.0053595383651554585, -0.030687078833580017, -0.02054489590227604, 0.022684989497065544, -0.032603856176137924, 0.04682151973247528, 0.022145314142107964, -0.041164230555295944, -0.018358279019594193, -0.019707469269633293, 0.032380543649196625, 0.032603856176137924, 0.0614485964179039, -0.02823062241077423, -0.02091708593070507, -0.028956394642591476, -0.03930328041315079, 0.07268873602151871, -0.048198625445365906, 0.008239359594881535, 0.03900552913546562, -0.033031877130270004, -0.05668456107378006, -0.015334234572947025, -0.014133920893073082, 0.011426237411797047, 0.016348453238606453, -0.010774904862046242, 0.06375617533922195, 0.02899361215531826, -0.004370908252894878, -0.018516460433602333, -0.016608985140919685, 0.026909347623586655, -0.0614485964179039, 0.00622953288257122, -0.011314581148326397, -0.02627662569284439, -0.0548236109316349, 0.008551068603992462, 0.020563505589962006, -0.043695125728845596, -0.015138834714889526, -0.014664292335510254, -0.031412847340106964, 0.03859611973166466, 0.012691684067249298, 0.023261884227395058, -0.07507075369358063, -0.020079659298062325, 0.0184234119951725, 0.0003079292073380202, -0.07529406994581223, -0.10674413293600082, 0.0172417089343071, 0.01659037545323372, -0.07253985852003098, 0.0016236795345321298, -0.011956608854234219, 0.021475372835993767, 0.02043323963880539, 0.06010871008038521, -0.024899521842598915, -0.04786365479230881, -0.05404201149940491, 0.02953328937292099, -0.0305009838193655, -0.048198625445365906, 0.03012879379093647, 0.03599078953266144, -0.059587642550468445, 0.001710911630652845, 0.012319494038820267, 0.010719076730310917, 0.018656032159924507, -0.023931827396154404, 0.001562035526148975, 0.03468812257051468, 0.0025890476536005735, -0.047119274735450745, 0.013324407860636711, -0.02677908167243004, -0.016785776242613792, -0.033087704330682755, 0.03239915147423744, -0.03046376444399357, -0.043918438255786896, 0.014487502165138721, 0.08902788162231445, -0.011063352227210999, -0.020079659298062325, -0.007322841323912144, 0.01170537993311882, 0.0433601513504982, -0.05776391178369522, -0.0075321984477341175, -0.006387713365256786, -0.10912615060806274, -0.005043176468461752, -0.03863333910703659, 0.013826863840222359, -0.01896308921277523, -0.042690210044384, -0.058992139995098114, -0.0035358064342290163, -0.006089961621910334, 0.020191315561532974, 0.005373495165258646, 0.03537667542695999, 0.005536328535526991, -0.01863742247223854, 0.031505897641181946, -0.0021691706497222185, -0.010719076730310917, 0.0005830010049976408, -0.003435780294239521, -0.07309814542531967, 0.014152530580759048, 0.07079056650400162, 0.014729425311088562, -0.00983512494713068, 0.02439706400036812, -0.025383368134498596, 0.02584860660135746, -0.009714162908494473, 0.011081961914896965, 0.03712596744298935, 0.032492201775312424, 0.06747807562351227, -0.002325025387108326, -0.04447672516107559, -0.019391106441617012, 0.03818671032786369, 0.030742906033992767, 0.0014317689929157495, 0.012338103726506233, -0.05370704084634781, -0.026890737935900688, -0.02190339006483555, -0.004487217403948307, -0.03390652313828468, -0.01831175573170185, -0.01674855686724186, 0.028975004330277443, 0.03574886545538902, 0.028863346204161644, -0.06833411008119583, -0.0627884790301323, 0.017920956015586853, -0.0007693868246860802, 0.029979916289448738, 0.027430415153503418, -0.014710815623402596, -0.048421937972307205, 0.010449239052832127, 0.020675163716077805, -0.0497618243098259, 0.04596548527479172, 0.014766644686460495, -0.006127180531620979, -0.04041985049843788, -0.03126397356390953, 0.012524198740720749, 0.012263665907084942, 0.003314818488433957, -0.00573172839358449, -0.06665925681591034, -0.06580322235822678, 0.016943957656621933, -0.004559329245239496, -0.030575420707464218, 0.002593700075522065, -0.07395418733358383, 0.0995236486196518, -0.006010870914906263, 0.021047353744506836, 0.00977929588407278, -0.011482066474854946, 0.009853734634816647, -0.07376808673143387, 0.0432484969496727, 0.033404067158699036, 0.028137575834989548, -0.07194435596466064, -0.0016585723496973515, 0.03760981559753418, 0.04894300550222397, -0.021959219127893448, -0.04458837956190109, 0.004284839145839214, -0.01989356428384781, -0.01279403641819954, 0.016599681228399277, -0.017055613920092583, 0.011119181290268898, -0.013408150523900986, -0.04198304936289787, -0.007327493745833635, 0.027672337368130684, -0.03593495860695839, 0.020247144624590874, 0.0279142614454031, -0.03225027769804001, -0.0028053834103047848, 0.0018737447680905461, -0.04816140606999397, 0.013296493329107761, 0.012673074379563332, 0.0557168647646904, 0.04075482115149498, 0.02672325260937214, 0.036493245512247086, -0.029068050906062126, -0.002668138127774, 0.0007094874745234847, 0.07845768332481384, -0.0123008843511343, -0.033031877130270004, 0.05668456107378006, -0.0037009657826274633, -0.010663247667253017, -0.040122099220752716, 0.01632053777575493, 0.060071490705013275, 0.03533945605158806, -0.03967547044157982, 0.024583159014582634, -0.025067007169127464, -0.058396633714437485, -0.0550469234585762, -0.0018109377706423402, -0.030203230679035187, 0.0732470229268074, 0.030426545068621635, -0.007867169566452503, 0.027579290792346, 0.032808560878038406, 0.001965629169717431 ]
716,715
pytorch_optimizer.optimizer.gravity
__str__
null
def __str__(self) -> str: return 'Gravity'
(self) -> str
[ 0.0755423977971077, -0.0432794988155365, 0.010212593711912632, -0.008433515205979347, 0.013505598530173302, -0.05607517808675766, -0.012333801947534084, -0.01132451742887497, 0.06620223820209503, -0.03094569779932499, -0.030381182208657265, -0.037668559700250626, 0.0021532834507524967, 0.016815710812807083, 0.006898204796016216, -0.018235551193356514, -0.02430836670100689, -0.0710262805223465, 0.03681323304772377, -0.015489955432713032, 0.04201361536979675, 0.04180833697319031, 0.0010151651222258806, -0.055801473557949066, 0.005264531821012497, 0.049882616847753525, 0.004674356896430254, 0.011983118019998074, -0.020733103156089783, -0.03243396431207657, -0.024975521489977837, -0.03111676312983036, 0.008972370065748692, 0.0105547234416008, -0.053611837327480316, -0.0033742613159120083, 0.003051375737413764, -0.018765853717923164, -0.04611918330192566, -0.0041526081040501595, -0.02661774680018425, 0.015626806765794754, -0.025351865217089653, -0.04652974009513855, -0.03169838339090347, -0.03125361353158951, -0.013787856325507164, 0.028892913833260536, 0.0027370434254407883, 0.02039097435772419, 0.03978976979851723, -0.003369984682649374, -0.04156884551048279, -0.013958921656012535, -0.04013190045952797, 0.049403633922338486, 0.0398239828646183, 0.0070863766595721245, -0.0009766754228621721, 0.013360192999243736, -0.010640256106853485, 0.0009905744809657335, 0.012462100945413113, -0.06271250545978546, -0.011923245154321194, 0.04006347432732582, -0.007189015857875347, 0.034230150282382965, 0.028242867439985275, 0.05751212686300278, 0.024872882291674614, -0.010700128972530365, -0.017585504800081253, 0.0033657080493867397, -0.018885599449276924, 0.00524742528796196, -0.07041044533252716, -0.032331325113773346, 0.035478927195072174, -0.06264407932758331, 0.00889539159834385, -0.015584041364490986, 0.044134825468063354, -0.013385852798819542, 0.033101119101047516, -0.056040965020656586, -0.03828439489006996, -0.0282086543738842, -0.010417871177196503, -0.03142467886209488, -0.036128971725702286, 0.012231162749230862, -0.0168926902115345, 0.02282010018825531, -0.02986798621714115, 0.012693039141595364, -0.002565978327766061, -0.0642520934343338, 0.004141916520893574, 0.05138799175620079, 0.018919812515378, 0.03551314026117325, -0.038797590881586075, 0.021554216742515564, -0.013924708589911461, -0.06462843716144562, -0.04191097617149353, 0.01849214918911457, 0.018098698928952217, 0.0037121151108294725, -0.021913453936576843, -0.014378031715750694, 0.047795619815588, -0.0002966912288684398, 0.022956952452659607, -0.02382938377559185, -0.039618704468011856, 0.024736030027270317, 0.03811332955956459, -0.005593832582235336, 0.007253164891153574, -0.01753418520092964, -0.017756570130586624, 0.01702098920941353, 0.07403702288866043, 0.06603117287158966, -0.03910550847649574, 0.0052260421216487885, 0.032451070845127106, -0.00014059421664569527, 0.04440852999687195, 0.01702098920941353, -0.06657858192920685, -0.033870913088321686, 0.07492656260728836, 0.00042953406227752566, 0.06401260197162628, 0.012042990885674953, 0.056519947946071625, 0.11365573108196259, -0.009819143451750278, 0.0038660739082843065, 0.007206121925264597, 0.004347194917500019, -0.020288335159420967, 0.058299023658037186, -0.011658094823360443, 0.034230150282382965, -0.042424172163009644, -0.004768442828208208, 0.018389509990811348, 0.04741927608847618, 0.05477508157491684, -0.020972594618797302, -0.01472871471196413, -0.02466760389506817, -0.02063046395778656, -0.026942770928144455, 0.030278543010354042, 0.01772235706448555, -0.015199144370853901, 0.004114118404686451, -0.03409329801797867, -0.0027413200587034225, 0.025522930547595024, 0.015934724360704422, 0.024530751630663872, 0.0031711214687675238, 0.021622642874717712, -0.00720184575766325, -0.025334758684039116, -0.06873400509357452, -0.0653126984834671, -0.010606043040752411, 0.02412019483745098, 0.053611837327480316, -0.016216982156038284, 0.06931562721729279, 0.017824996262788773, 0.005213212221860886, 0.01796184666454792, -0.02317933738231659, -0.06100185588002205, 0.026754599064588547, 0.048822011798620224, -0.0333235040307045, 0.022255584597587585, 0.030244329944252968, 0.01813291199505329, -0.02500973455607891, 0.03828439489006996, 0.003384952899068594, -0.055630408227443695, -0.020579146221280098, 0.02287141978740692, -0.025745315477252007, 0.03241685777902603, -0.07260007411241531, -0.01028101984411478, 0.03513679653406143, -0.006085644941776991, 0.0034084743820130825, -0.05162748321890831, 0.033699847757816315, 0.03234843164682388, 0.029132405295968056, 0.05665680021047592, -0.02899555303156376, -0.014429350383579731, -0.04488751292228699, -0.011059366166591644, 0.03414461761713028, -0.025351865217089653, -0.0007329075015150011, 0.03472623974084854, -0.05730684846639633, -0.0187829602509737, 0.007971638813614845, -0.059838611632585526, 0.04071352258324623, 0.03376827389001846, -0.035410501062870026, -0.009143435396254063, -0.04741927608847618, -0.01837240345776081, 0.005452703684568405, 0.0008970232447609305, -0.0030171626713126898, -0.05528827756643295, -0.05299600213766098, 0.010563276708126068, -0.057169996201992035, -0.0075995721854269505, 0.02887580730021, 0.012214056216180325, -0.007437060121446848, -0.005371447652578354, 0.004379269666969776, -0.050053682178258896, -0.028123121708631516, 0.012154183350503445, 0.0015139271272346377, -0.022734567523002625, 0.04930099472403526, 0.02644668146967888, -0.028858700767159462, -0.0211094468832016, 0.014266839250922203, 0.0033143884502351284, 0.0027113836258649826, 0.00004166373400948942, -0.06336255371570587, -0.017688143998384476, 0.009417139925062656, 0.003970851190388203, -0.028482358902692795, -0.05015632137656212, 0.025933487340807915, 0.027284901589155197, -0.010263913311064243, -0.05723842233419418, -0.004717123229056597, -0.06260986626148224, 0.06062551215291023, 0.036607954651117325, 0.030671993270516396, -0.000999127747491002, -0.006128411274403334, 0.0004084181855432689, -0.03183523565530777, 0.11228720843791962, 0.055151425302028656, -0.0467350147664547, 0.01277857180684805, -0.006042878609150648, -0.05470665544271469, 0.011743626557290554, 0.05436452478170395, -0.050943221896886826, -0.05049845203757286, 0.01416420005261898, -0.07034201920032501, 0.007792020682245493, 0.051353778690099716, -0.07759518176317215, -0.01571233943104744, 0.015182037837803364, 0.009887569583952427, 0.03527364879846573, 0.027370434254407883, 0.043074220418930054, 0.051593270152807236, -0.011598221957683563, 0.03051803447306156, 0.07581610232591629, 0.02152000367641449, 0.07773203402757645, 0.0316641703248024, -0.01880006678402424, 0.01588340476155281, 0.06507320702075958, -0.023812277242541313, -0.0026921387761831284, 0.004334365017712116, -0.03616318479180336, 0.03347746282815933, 0.04919835552573204, -0.02199898660182953, 0.02519790641963482, 0.021502897143363953, -0.03859231248497963, -0.0008483765413984656, 0.02358989231288433, 0.07054729759693146, 0.01707230880856514, 0.041226714849472046, -0.0055040232837200165, 0.012513420544564724, 0.01914219744503498, 0.05494614690542221, 0.013240447267889977, 0.02762703225016594, -0.039687130600214005, 0.024821562692523003, -0.014249732717871666, -0.022306904196739197, -0.057717401534318924, 0.05782004073262215, 0.03934499993920326, 0.03433278948068619, -0.051593270152807236, -0.024513645097613335, 0.03780541196465492, -0.01588340476155281, -0.01618276908993721, 0.009151988662779331, 0.04345056414604187, -0.023966236039996147, -0.0211094468832016, -0.045674413442611694, 0.08033222705125809, 0.043245285749435425, -0.04594811797142029, 0.032981373369693756, 0.01606302335858345, 0.029679814353585243, -0.00017173343803733587, -0.06750233471393585, 0.054261885583400726, 0.021964773535728455, -0.04423746466636658, 0.011632435023784637, 0.034469641745090485, 0.010400764644145966, 0.013676663860678673, -0.018475042656064034, 0.010982386767864227, 0.03753170743584633, -0.03224579244852066, 0.06035180762410164, -0.01885138638317585, -0.015284677036106586, -0.008202577009797096, 0.05316706746816635, -0.0073686339892446995, -0.015344549901783466, 0.016995329409837723, -0.009742164053022861, 0.05597253888845444, -0.013787856325507164, -0.0012017331318929791, 0.0031668448355048895, -0.05970175936818123, 0.01880006678402424, -0.05043002590537071, 0.07177896052598953, 0.03467492014169693, 0.008108491078019142, 0.0001578343944856897, -0.04262945055961609, 0.01660187914967537, 0.0017972539644688368, 0.0009766754228621721, 0.06644172966480255, 0.04167148470878601, -0.006098474841564894, 0.006804118864238262, -0.007099206559360027, 0.0003431995864957571, -0.01760261133313179, 0.01031523197889328, -0.0600096769630909, 0.009819143451750278, 0.008574644103646278, -0.05162748321890831, -0.047932472079992294, -0.03142467886209488, -0.03722378984093666, -0.05573304742574692, 0.04481908679008484, 0.03368274122476578, -0.0398239828646183, -0.06589432060718536, -0.008480558171868324, -0.03859231248497963, -0.024513645097613335, 0.01461752224713564, 0.035889480262994766, -0.03128782659769058, 0.04043981805443764, -0.015412976033985615, 0.012282482348382473, -0.07588452845811844, -0.03886601701378822, 0.03978976979851723, -0.06822080910205841, -0.01760261133313179, -0.01682426407933235, 0.004131224937736988, 0.007591018918901682, -0.04061088338494301, 0.04403218626976013, 0.06777603924274445, 0.044066399335861206, -0.007903212681412697, 0.003737774910405278, 0.03691587224602699, 0.03289584070444107, 0.07369489222764969, 0.020185695961117744, -0.05665680021047592, 0.03409329801797867, -0.02719936892390251, -0.025232119485735893, 0.03465781360864639, -0.03848967328667641, 0.021673962473869324, -0.020904168486595154, -0.044134825468063354, 0.013488491997122765, 0.05374868959188461, -0.04789825901389122, 0.011546902358531952, 0.028123121708631516, -0.023760957643389702, -0.04950627312064171, -0.06428630650043488, -0.01543863583356142, 0.038968656212091446, -0.0063721793703734875, -0.008527601137757301, 0.07478971034288406, 0.023812277242541313, -0.016199875622987747, 0.07348961383104324, -0.028978446498513222, -0.029440322890877724, -0.05703314393758774, -0.008728602901101112, -0.05108007416129112, -0.05703314393758774, 0.05173012241721153, -0.055630408227443695, 0.03958449140191078, 0.0053971074521541595, 0.01612289622426033, -0.0006088852533139288, 0.03140757232904434, -0.0431426465511322, -0.03695008531212807, 0.04550334811210632, -0.004644420463591814, -0.02844814583659172, -0.03948185220360756, -0.04023453965783119, 0.059188563376665115, -0.03848967328667641, 0.0432794988155365, 0.027045410126447678, -0.05234595388174057, -0.012573293410241604, -0.05060109123587608, -0.030261436477303505, 0.05922277644276619, -0.021485790610313416, 0.04440852999687195, -0.003414889331907034, 0.010546170175075531, -0.027661245316267014, -0.0039537446573376656, -0.014480669982731342, 0.012077203951776028, -0.046495527029037476, -0.032160259783267975, -0.019484328106045723, 0.06709177792072296, -0.017414439469575882, -0.03125361353158951, -0.06394417583942413, 0.04707714542746544, 0.011837712489068508, 0.011350177228450775, -0.02252928912639618, -0.0043685780838131905, 0.025745315477252007, -0.08450621366500854, 0.020373867824673653, 0.021725282073020935, 0.010426424443721771, -0.025351865217089653, 0.009374373592436314, -0.038626525551080704, 0.04830881580710411, 0.014660288579761982, -0.002719936892390251, -0.020065950229763985, 0.0036928702611476183, 0.027815204113721848, 0.0036992852110415697, -0.0005372517043724656, -0.015019525773823261, -0.0026600640267133713, -0.025916380807757378, -0.045605987310409546, -0.02685723826289177, 0.027165155857801437, -0.020835742354393005, -0.01259895320981741, -0.015276123769581318, 0.06110449507832527, 0.03551314026117325, 0.03169838339090347, -0.00815553404390812, 0.03409329801797867, -0.009802036918699741, 0.053201280534267426, -0.07472128421068192, -0.01316346786916256, -0.03224579244852066, 0.0042295875027775764, -0.0004880704509560019, -0.07581610232591629, 0.03277609497308731, -0.00951122585684061, 0.03630003705620766, -0.014027347788214684, 0.029714027419686317, -0.007099206559360027, 0.050703730434179306, -0.005820494145154953, -0.023983342573046684, -0.017705250531435013, -0.06141241267323494, -0.06206246092915535, 0.022614821791648865, 0.07773203402757645, -0.013120701536536217, 0.03294716030359268, 0.06866557896137238, 0.0161314494907856, -0.01606302335858345, -0.027404647320508957, 0.07704777270555496, 0.0553567036986351, -0.017876313999295235, 0.014899780042469501, -0.04403218626976013, 0.07260007411241531, 0.02021990902721882, -0.007993021979928017, 0.00007925130921648815, -0.06801553070545197, 0.03294716030359268, 0.03361431509256363, -0.02731911465525627, 0.052003826946020126, 0.027130942791700363, 0.04338213801383972, -0.043655842542648315, -0.021485790610313416, -0.003250239184126258, 0.03510258346796036, 0.01791052706539631, -0.0282086543738842, -0.02798626944422722, 0.021554216742515564, 0.0009852286893874407, -0.008241066709160805, 0.05621203035116196, 0.0029808112885802984, -0.03801069036126137, 0.009716504253447056, 0.012385121546685696, -0.0021319002844393253, -0.009784930385649204, -0.05025896057486534, 0.0007494794554077089, -0.013172021135687828, -0.0005404591793194413, 0.0041376398876309395, 0.042595237493515015, 0.024257047101855278, 0.008480558171868324, 0.04468223452568054, 0.031749702990055084, 0.06298620998859406, 0.03739485517144203, 0.017320353537797928, -0.017209161072969437, -0.046016544103622437, -0.03763434663414955, -0.04256102442741394, -0.04717978462576866, -0.007180462591350079, -0.023983342573046684, -0.005640875548124313, 0.012838444672524929, 0.00036672104033641517, -0.019484328106045723, 0.0020645433105528355, -0.02899555303156376, 0.048993077129125595, -0.06432051956653595, 0.003190366318449378, 0.0282086543738842, 0.023281976580619812, -0.012333801947534084, -0.05265387147665024, 0.020784422755241394, -0.06349940598011017, 0.030671993270516396, -0.0025317652616649866, -0.026395361870527267, -0.09162253141403198, -0.06165190413594246, 0.02406887523829937, -0.033699847757816315, 0.029611388221383095, -0.05316706746816635, 0.03190366178750992, -0.005893196444958448, 0.0521748885512352, -0.025146586820483208, 0.062438804656267166, -0.041466206312179565, 0.005935962777584791, -0.09552281349897385, -0.016045916825532913, -0.016798604279756546, -0.03695008531212807, -0.04293736815452576, -0.004811209160834551, 0.03000483848154545, -0.011341623961925507, -0.0022559224162250757, -0.026651959866285324, -0.023025378584861755, -0.03347746282815933, -0.02957717515528202, -0.023042485117912292, -0.017944740131497383, -0.004918124992400408, 0.012846997939050198, 0.020373867824673653, 0.028465252369642258, -0.02336750738322735, -0.004283045418560505, -0.07807416468858719, -0.01327466033399105, -0.029320577159523964, -0.0033443248830735683, 0.006859715096652508, 0.03647110238671303, -0.06076236441731453, -0.040508244186639786, 0.024342579767107964, 0.06541533768177032, 0.058538515120744705, 0.10544459521770477, 0.010956726968288422, 0.056280456483364105, -0.0011963873403146863, 0.003925946541130543, -0.012787125073373318, 0.052961789071559906, 0.06076236441731453, -0.10359709709882736, 0.011093579232692719, 0.0025317652616649866, 0.026224296540021896, -0.05477508157491684, -0.04173991084098816, -0.042116254568099976, 0.011658094823360443, 0.09613864868879318, -0.010931067168712616, -0.02305959165096283, 0.0001483456144342199, -0.014933993108570576, 0.003573124762624502, -0.013325979933142662, 0.019877778366208076, -0.019843565300107002, 0.026104550808668137, 0.01690124347805977, -0.03616318479180336, 0.04262945055961609, -0.006752799265086651, -0.03886601701378822, -0.04639288783073425, 0.07369489222764969, 0.050361599773168564, -0.04054245725274086, 0.01449777651578188, 0.028071802109479904, -0.06192560866475105, -0.028020482510328293, 0.03924236074090004, -0.039276573807001114, 0.003658657195046544, -0.008022958412766457, 0.020715996623039246, -0.013890495523810387, -0.030928591266274452, 0.030312756076455116, 0.038558099418878555, -0.020254122093319893, -0.009545438922941685, -0.056280456483364105, -0.0005709301331080496, -0.0014316020533442497, 0.06329412758350372, -0.015421529300510883, -0.029200831428170204, 0.00020848572603426874, 0.02531765215098858, -0.019997524097561836, 0.0053800009191036224, 0.04410061240196228, 0.04789825901389122, -0.002959428122267127, 0.04581126570701599, -0.02478734962642193, -0.06592853367328644, 0.0227687805891037, 0.04666658863425255, 0.0006238534697331488, 0.03181812912225723, -0.07109470665454865, 0.07003410160541534, 0.07458443194627762, 0.045845478773117065, 0.017380226403474808, -0.017234820872545242, 0.016439367085695267, -0.016216982156038284, 0.001343931071460247, -0.0102211469784379, 0.004392099566757679, 0.0000603071712248493, -0.01520769763737917, -0.05022474750876427, -0.0028033312410116196, 0.011906138621270657, -0.005640875548124313, 0.05963333323597908, -0.018423723056912422, -0.00039184626075439155 ]
716,751
pytorch_optimizer.loss.jaccard
JaccardLoss
Jaccard loss for image segmentation task. It supports binary, multiclass and multilabel cases. Reference : https://github.com/BloodAxe/pytorch-toolbelt :param mode: CLASS_MODE. loss mode 'binary', 'multiclass', or 'multilabel. :param classes: Optional[List[int]]. List of classes that contribute in loss computation. By default, all channels are included. :param log_loss: If True, loss computed as `-log(jaccard)`; otherwise `1 - jaccard` :param from_logits: bool. If True, assumes input is raw logits. :param label_smooth: float. Smoothness constant for dice coefficient (a). :param eps: float. epsilon.
class JaccardLoss(_Loss): r"""Jaccard loss for image segmentation task. It supports binary, multiclass and multilabel cases. Reference : https://github.com/BloodAxe/pytorch-toolbelt :param mode: CLASS_MODE. loss mode 'binary', 'multiclass', or 'multilabel. :param classes: Optional[List[int]]. List of classes that contribute in loss computation. By default, all channels are included. :param log_loss: If True, loss computed as `-log(jaccard)`; otherwise `1 - jaccard` :param from_logits: bool. If True, assumes input is raw logits. :param label_smooth: float. Smoothness constant for dice coefficient (a). :param eps: float. epsilon. """ def __init__( self, mode: CLASS_MODE, classes: List[int] = None, log_loss: bool = False, from_logits: bool = True, label_smooth: float = 0.0, eps: float = 1e-6, ): super().__init__() if classes is not None: if mode == 'binary': raise ValueError('[-] Masking classes is not supported with mode=binary') classes = torch.LongTensor(classes) self.mode = mode self.classes = classes self.log_loss = log_loss self.from_logits = from_logits self.label_smooth = label_smooth self.eps = eps def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor: if self.from_logits: # Apply activations to get [0..1] class probabilities # Using Log-Exp as this gives more numerically stable result and does not cause vanishing gradient on # extreme values 0 and 1 y_pred = y_pred.log_softmax(dim=1).exp() if self.mode == 'multiclass' else logsigmoid(y_pred).exp() bs: int = y_true.size(0) num_classes: int = y_pred.size(1) dims: Tuple[int, ...] = (0, 2) if self.mode == 'binary': y_true = y_true.view(bs, 1, -1) y_pred = y_pred.view(bs, 1, -1) if self.mode == 'multiclass': y_true = y_true.view(bs, -1) y_pred = y_pred.view(bs, num_classes, -1) y_true = one_hot(y_true, num_classes) y_true = y_true.permute(0, 2, 1) if self.mode == 'multilabel': y_true = y_true.view(bs, num_classes, -1) y_pred = y_pred.view(bs, num_classes, -1) scores = soft_jaccard_score( y_pred, y_true.type(y_pred.dtype), label_smooth=self.label_smooth, eps=self.eps, dims=dims ) loss = -torch.log(scores.clamp_min(self.eps)) if self.log_loss else 1.0 - scores # IoU loss is defined for non-empty classes # So we zero contribution of channel that does not have true pixels # NOTE: A better workaround would be to use loss term `mean(y_pred)` # for this case, however it will be a modified jaccard loss mask = y_true.sum(dims) > 0 loss *= mask.float() if self.classes is not None: loss = loss[self.classes] return loss.mean()
(mode: Literal['binary', 'multiclass', 'multilabel'], classes: List[int] = None, log_loss: bool = False, from_logits: bool = True, label_smooth: float = 0.0, eps: float = 1e-06)
[ -0.039985451847314835, -0.04795130342245102, 0.0036095264367759228, 0.014145243912935257, 0.03455773741006851, -0.05396474152803421, -0.02102750539779663, 0.03490917384624481, 0.05435522273182869, -0.03053576499223709, 0.006555232219398022, 0.033054377883672714, 0.06446873396635056, 0.031062915921211243, 0.005769385024905205, -0.015629079192876816, 0.07524605840444565, 0.024366134777665138, 0.002667486434802413, 0.02961812913417816, 0.04595984145998955, -0.03313247486948967, 0.025674251839518547, 0.05392569303512573, -0.056073348969221115, 0.01217330526560545, 0.06560113281011581, -0.009020155295729637, -0.030867675319314003, 0.01704457961022854, -0.06161820515990257, 0.023858506232500076, 0.005876767914742231, 0.004773653578013182, -0.03645158186554909, 0.0004417338059283793, 0.03055528923869133, 0.06325823068618774, -0.06275060772895813, -0.030145281925797462, -0.017649827525019646, -0.007331316825002432, -0.041820719838142395, -0.05052848905324936, -0.024268513545393944, 0.006345347501337528, -0.006096414756029844, 0.014652871526777744, -0.03809161111712456, -0.06716306507587433, -0.012114732526242733, -0.036334436386823654, 0.0019987844862043858, 0.014750492759048939, -0.02668950706720352, 0.045256972312927246, 0.05232471227645874, 0.03365962952375412, -0.04908370226621628, -0.04228930175304413, -0.03418678045272827, -0.01480906456708908, 0.058845777064561844, 0.03600252419710159, -0.008283118717372417, 0.002967670327052474, -0.04303121939301491, 0.0011287396773695946, -0.0018804193241521716, 0.00009617167233955115, -0.02126179449260235, -0.02873954363167286, 0.05216851830482483, 0.03664682060480118, 0.0033508315682411194, -0.05361330509185791, 0.01097257062792778, -0.04459315165877342, 0.00035753592965193093, -0.027782859280705452, 0.035260606557130814, -0.02178894728422165, 0.01436000969260931, -0.0425235889852047, 0.015258120372891426, -0.06415634602308273, 0.03252722695469856, 0.004004890564829111, -0.021847520023584366, 0.00014650735829491168, -0.0483417846262455, -0.027138562873005867, 0.005369140300899744, 0.015609554946422577, -0.01630266197025776, 0.06903737783432007, -0.026064734905958176, -0.00803418643772602, -0.007448461838066578, -0.012680932879447937, 0.015014068223536015, 0.08200141042470932, -0.010279462672770023, 0.05025515332818031, -0.014389296062290668, 0.010406370274722576, -0.0673973560333252, 0.07114598900079727, -0.003641253337264061, -0.04611603170633316, -0.019143424928188324, 0.02126179449260235, 0.015345978550612926, -0.025713300332427025, 0.0453350692987442, -0.08528146892786026, -0.0035533946938812733, 0.018040310591459274, -0.07466033846139908, 0.03781827166676521, 0.020168442279100418, -0.026826176792383194, -0.023526595905423164, -0.039965927600860596, 0.013159274123609066, 0.0012885936303064227, 0.04166452959179878, 0.038872573524713516, 0.016214802861213684, -0.016175754368305206, -0.014955496415495872, -0.005344734992831945, -0.02450280264019966, 0.029579080641269684, 0.05306662991642952, -0.061735350638628006, 0.032273415476083755, 0.03826732560992241, -0.01974867470562458, 0.06396110355854034, 0.04170357808470726, -0.03401106223464012, 0.047482725232839584, 0.02268705703318119, 0.0294619370251894, -0.03287866339087486, 0.07274696975946426, -0.006413681898266077, 0.06466396898031235, 0.004832226317375898, 0.056815266609191895, -0.026064734905958176, 0.019338667392730713, 0.027704764157533646, 0.005564381834119558, -0.004112273454666138, -0.0036900637205690145, -0.062477268278598785, 0.029696226119995117, 0.035943951457738876, -0.004920084960758686, -0.06934976577758789, -0.04900560528039932, 0.011324005201458931, -0.021710850298404694, -0.012300211936235428, 0.00019356361008249223, 0.036471106112003326, 0.0010665064910426736, 0.041078802198171616, 0.025498535484075546, -0.05365235358476639, 0.06548398733139038, 0.035006795078516006, -0.042562637478113174, 0.0906701385974884, -0.009928028099238873, 0.008073233999311924, -0.0074094133451581, 0.014535726979374886, 0.0004237349785398692, -0.008795628324151039, -0.013325230218470097, -0.029422888532280922, -0.00024298409698531032, 0.039809733629226685, 0.051153264939785004, 0.006228202488273382, 0.012661408632993698, 0.03932163119316101, -0.004985978826880455, -0.008224546909332275, -0.035221558064222336, -0.006154987029731274, 0.022003712132573128, -0.033757247030735016, 0.006794402841478586, 0.013549757190048695, 0.033581532537937164, 0.0027358210645616055, -0.06001722440123558, 0.06974025070667267, 0.050059910863637924, 0.02028558775782585, -0.004373408854007721, 0.02487376146018505, 0.0029627892654389143, 0.07852611690759659, -0.0015851166099309921, -0.09324732422828674, -0.006154987029731274, 0.006023199297487736, -0.033015333116054535, 0.048419881612062454, 0.04998181387782097, -0.019992725923657417, 0.005993912927806377, 0.01924104616045952, -0.014945734292268753, 0.010367321781814098, -0.03459678590297699, -0.004580852575600147, -0.10379035770893097, 0.06321918219327927, -0.011392339132726192, -0.001405738526955247, 0.04221120476722717, 0.012729743495583534, 0.06700687110424042, 0.005964626558125019, -0.035943951457738876, -0.005271519534289837, -0.011031142435967922, 0.03533870354294777, 0.033230096101760864, 0.08606243878602982, 0.0214375127106905, 0.015687651932239532, -0.037623029202222824, -0.010152556002140045, -0.022101333364844322, -0.045998889952898026, 0.018586987629532814, 0.004966454580426216, 0.04791225492954254, -0.03938020393252373, 0.02251134067773819, 0.04560840502381325, -0.03297628462314606, 0.013979288749396801, -0.059548646211624146, -0.01079685240983963, 0.0027992743998765945, -0.046389371156692505, -0.04299217090010643, -0.10433703660964966, -0.04178167134523392, -0.01959248073399067, 0.020090347155928612, -0.02545948699116707, -0.04935704171657562, -0.07454319298267365, -0.014975019730627537, -0.020383208990097046, -0.024014700204133987, -0.002992075402289629, 0.01519954763352871, 0.02491280995309353, 0.013793809339404106, 0.02489328570663929, 0.044944584369659424, 0.02817334234714508, -0.06275060772895813, -0.009576593525707722, -0.01831365004181862, 0.00663820980116725, -0.016956720501184464, 0.03381581977009773, 0.020539401099085808, 0.010748042725026608, 0.01663457229733467, -0.06321918219327927, -0.030477192252874374, -0.030106233432888985, 0.023643741384148598, -0.009195872582495213, 0.015619317069649696, -0.017522921785712242, 0.03658825159072876, -0.00998660083860159, 0.06224297732114792, 0.06856880336999893, 0.07821372896432877, 0.004239180125296116, 0.008615029975771904, 0.015677889809012413, -0.045998889952898026, 0.007287387736141682, -0.016595523804426193, 0.002669926965609193, -0.013744998723268509, -0.004400254227221012, 0.01069923210889101, -0.0670459195971489, -0.0289347842335701, -0.04389028251171112, -0.04045403003692627, -0.006120820064097643, 0.06329727917909622, 0.04264073446393013, 0.046545565128326416, -0.023136112838983536, 0.03326914459466934, 0.03967306390404701, -0.0250494796782732, -0.002215990563854575, 0.07794038951396942, -0.018440555781126022, 0.03838447108864784, 0.05837719887495041, 0.004334360361099243, 0.024424707517027855, -0.031238634139299393, 0.09004536271095276, -0.0402197428047657, -0.07950232177972794, 0.055370479822158813, 0.031238634139299393, -0.007707156706601381, -0.031590066850185394, -0.037623029202222824, 0.0023880470544099808, 0.011040904559195042, -0.019817007705569267, -0.05103611946105957, 0.01107995305210352, 0.014975019730627537, -0.024737093597650528, -0.01574622467160225, -0.04131309315562248, 0.021671801805496216, -0.0028968951664865017, -0.04814654588699341, 0.04756081849336624, 0.07200504839420319, -0.007536320481449366, 0.01662481017410755, 0.05052848905324936, 0.007975613698363304, 0.04064927250146866, 0.005256876349449158, -0.041078802198171616, 0.06622590124607086, 0.03879448026418686, 0.04615508019924164, -0.015404551289975643, -0.027119038626551628, -0.035221558064222336, 0.03196102753281593, -0.06208678334951401, 0.013686426915228367, -0.07102884352207184, -0.01143138762563467, 0.02307754009962082, 0.007541201543062925, 0.04342170059680939, -0.008834675885736942, -0.02083226479589939, 0.03422582894563675, -0.026787128299474716, -0.016039086505770683, -0.008951821364462376, -0.07626131176948547, -0.012446642853319645, -0.03666634485125542, 0.007482629269361496, -0.028114771470427513, 0.014291674830019474, -0.00772668095305562, -0.001283712568692863, 0.02872001938521862, -0.03774017468094826, -0.06923262029886246, 0.002217210829257965, -0.014340485446155071, 0.01480906456708908, 0.0081366878002882, 0.0011659576557576656, 0.008331929333508015, -0.041976913809776306, 0.009537545032799244, 0.002076881006360054, 0.04806844890117645, -0.05763528123497963, -0.055565718561410904, 0.023350879549980164, 0.016136707738041878, 0.08340715616941452, -0.008287999778985977, -0.03805256262421608, -0.030086709186434746, -0.031394828110933304, 0.08418811857700348, 0.005090921185910702, -0.04240644723176956, 0.06318013370037079, 0.028290487825870514, 0.040375933051109314, -0.05154374614357948, 0.0541599802672863, -0.034674882888793945, 0.03408915922045708, -0.005637597292661667, 0.004702878650277853, -0.022628486156463623, 0.01033803541213274, -0.002848084783181548, -0.02159370481967926, -0.021125126630067825, 0.052090421319007874, -0.023897554725408554, 0.011597342789173126, 0.06837356090545654, -0.005701050627976656, -0.05220756679773331, 0.005100683309137821, -0.030594337731599808, 0.02215990610420704, -0.0380135141313076, -0.00034533333382569253, -0.09410638362169266, -0.005354497116059065, -0.02747047320008278, -0.07782324403524399, 0.006975001189857721, -0.03859923779964447, -0.000650398142170161, -0.0071897669695317745, -0.027177611365914345, 0.023292306810617447, 0.0017108033644035459, -0.0010109846480190754, 0.03551442176103592, 0.04580364748835564, 0.01758149452507496, -0.010035411454737186, -0.017884118482470512, 0.015140975825488567, -0.044944584369659424, 0.025303293019533157, -0.0072190528735518456, 0.021164175122976303, 0.029579080641269684, 0.016741955652832985, 0.009020155295729637, -0.034850601106882095, -0.06548398733139038, -0.01868460886180401, 0.02157418243587017, -0.0070726219564676285, -0.012436880730092525, 0.024737093597650528, -0.042562637478113174, 0.026396645233035088, -0.015170261263847351, -0.003089696168899536, 0.031160537153482437, -0.013920716010034084, -0.030418619513511658, 0.014438105747103691, 0.00120134511962533, -0.043616943061351776, 0.07961946725845337, -0.01920199766755104, -0.04681890085339546, 0.014935972169041634, 0.020402733236551285, -0.0008791966829448938, -0.010728518478572369, 0.02268705703318119, 0.0036876231897622347, -0.043304555118083954, 0.022042760625481606, -0.07192695140838623, 0.011568056419491768, 0.001059184898622334, -0.009679095819592476, 0.009630285203456879, 0.03627586364746094, -0.018586987629532814, -0.0668506771326065, 0.00022864605125505477, 0.009586355648934841, -0.014145243912935257, -0.040336884558200836, -0.021339891478419304, -0.00814644992351532, 0.014574775472283363, -0.062125831842422485, -0.01959248073399067, -0.00219280575402081, 0.011665677651762962, -0.04123499616980553, -0.023526595905423164, 0.028505252674221992, -0.032995808869600296, 0.022765154018998146, -0.019865818321704865, 0.0033703558146953583, 0.01775721088051796, -0.033191047608852386, 0.017327679321169853, 0.025654727593064308, -0.020715119317173958, -0.010669945739209652, -0.0004868833930231631, -0.00736060319468379, 0.03893114626407623, 0.03988783061504364, -0.02048083022236824, 0.002202567644417286, 0.008649196475744247, 0.05576096102595329, 0.06603066623210907, -0.033230096101760864, 0.05908006802201271, 0.04467124491930008, 0.005291043780744076, 0.03885304927825928, 0.02983289584517479, -0.033776771277189255, 0.001932890503667295, -0.023311831057071686, 0.07438699901103973, -0.017630303278565407, 0.038540665060281754, -0.028251439332962036, -0.0007077503250911832, -0.007970732636749744, -0.006921309977769852, 0.01143138762563467, -0.004349003545939922, -0.00023566254822071642, -0.024619948118925095, -0.02028558775782585, 0.07481652498245239, -0.03680301457643509, 0.07333268970251083, -0.029403364285826683, -0.062321074306964874, -0.029032405465841293, 0.023175161331892014, -0.00887372437864542, -0.023702314123511314, 0.10332178324460983, 0.07348888367414474, 0.015033592469990253, 0.02854430116713047, 0.019299618899822235, 0.02926669456064701, -0.023526595905423164, -0.05728384479880333, 0.005349616054445505, -0.07259077578783035, -0.021827995777130127, -0.02069559507071972, 0.024639472365379333, 0.010211128741502762, -0.018811514601111412, -0.01181210856884718, -0.029012881219387054, 0.021339891478419304, -0.02745094895362854, 0.03932163119316101, -0.021867044270038605, -0.014311199076473713, 0.020754167810082436, -0.023175161331892014, 0.030848151072859764, -0.00997195765376091, 0.007814539596438408, -0.03367915377020836, 0.014516202732920647, 0.004239180125296116, 0.0002559493586886674, 0.04010259732604027, -0.01626361347734928, -0.009898741729557514, -0.001446007052436471, -0.03537775203585625, 0.032859139144420624, 0.056229542940855026, 0.025557108223438263, -0.017288630828261375, 0.013969526626169682, -0.007233696058392525, -0.063687764108181, 0.006730949506163597, 0.08145473897457123, 0.027294756844639778, 0.014164768159389496, -0.014770017005503178, -0.00333862891420722, -0.022003712132573128, 0.04303121939301491, -0.03803303837776184, -0.039067815989255905, 0.01334475353360176, 0.023858506232500076, -0.005784028209745884, -0.056268587708473206, 0.040375933051109314, 0.026494266465306282, -0.032117221504449844, -0.03112148866057396, -0.029520509764552116, 0.016556475311517715, 0.007267863489687443, 0.014682157896459103, 0.02542043849825859, -0.02764619141817093, 0.04752177372574806, 0.002200127113610506, 0.03420630469918251, -0.0017364287050440907, -0.037447310984134674, -0.018782228231430054, -0.024561375379562378, 0.00915682502090931, 0.019270332530140877, 0.028134293854236603, 0.0354558490216732, 0.042367398738861084, 0.005422831512987614, -0.029169075191020966, -0.024073272943496704, -0.01216354314237833, 0.0049591329880058765, 0.012505215592682362, 0.016966482624411583, -0.06677258014678955, -0.02668950706720352, -0.013871906325221062, 0.0012294111074879766, -0.04431981220841408, -0.07016978412866592, 0.029051929712295532, -0.006491778418421745, 0.014887161552906036, -0.03203912451863289, -0.012144018895924091, 0.033386290073394775, -0.00777061004191637, 0.019260570406913757, 0.01262236014008522, 0.06872499734163284, 0.011978063732385635, 0.0497475229203701, 0.023311831057071686, -0.04185976833105087, -0.011519246734678745, -0.03457726165652275, 0.05619049444794655, 0.03969258815050125, -0.014174530282616615, 0.02194514125585556, 0.05915816128253937, -0.0878586545586586, -0.015365502797067165, 0.007101908326148987, -0.08411002159118652, 0.011841394938528538, -0.012407595291733742, -0.0545114167034626, 0.0011897527147084475, -0.03160959109663963, 0.03317152336239815, 0.036881111562252045, 0.01774744875729084, -0.052402809262275696, 0.057166699320077896, 0.01217330526560545, -0.01400857511907816, -0.015687651932239532, 0.03143387660384178, 0.006442968267947435, 0.02303849346935749, -0.00850764662027359, -0.046584613621234894, -0.10222843289375305, -0.034694407135248184, 0.039809733629226685, 0.051660891622304916, 0.026064734905958176, 0.0078047774732112885, 0.004112273454666138, -0.04221120476722717, 0.04740462824702263, -0.006940833758562803, -0.04826368764042854, -0.031941503286361694, -0.017796259373426437, -0.05212946981191635, 0.025029955431818962, -0.04260168597102165, 0.06802212446928024, -0.06997454166412354, -0.02251134067773819, 0.04135214164853096, -0.01826483942568302, 0.005398426204919815, 0.05603430047631264, 0.03162911534309387, -0.02543996274471283, -0.022648010402917862, -0.020031774416565895, 0.024971382692456245, -0.024639472365379333, -0.008995749987661839, 0.03680301457643509, 0.009488735347986221, -0.011636391282081604, 0.052402809262275696, 0.05595620349049568, -0.06286775320768356, -0.058455292135477066, 0.006711425259709358, -0.06794402748346329, 0.048771318048238754, -0.012183067388832569, 0.014438105747103691, 0.02616235613822937, -0.035572994500398636, 0.03344486281275749, -0.005193423014134169, -0.04896656051278114, 0.0661478042602539, -0.05673716962337494, 0.022062284871935844, 0.033054377883672714, -0.019992725923657417, -0.04588174447417259, 0.02454185113310814, 0.031746260821819305, 0.02124227024614811, 0.025576632469892502, -0.014174530282616615, 0.05576096102595329, 0.02579139731824398, -0.04431981220841408, 0.0442807637155056, -0.03569013997912407, -0.0000029696150249947095, -0.02690427377820015, 0.10402464866638184, -0.03791589289903641, -0.010279462672770023, -0.026806652545928955, -0.038521140813827515, -0.0980893075466156, -0.0402197428047657, -0.04170357808470726, -0.023097064346075058, -0.002933502895757556, -0.004615020006895065, 0.027216659858822823, 0.022921347990632057, -0.012075684033334255 ]
716,757
pytorch_optimizer.loss.jaccard
__init__
null
def __init__( self, mode: CLASS_MODE, classes: List[int] = None, log_loss: bool = False, from_logits: bool = True, label_smooth: float = 0.0, eps: float = 1e-6, ): super().__init__() if classes is not None: if mode == 'binary': raise ValueError('[-] Masking classes is not supported with mode=binary') classes = torch.LongTensor(classes) self.mode = mode self.classes = classes self.log_loss = log_loss self.from_logits = from_logits self.label_smooth = label_smooth self.eps = eps
(self, mode: Literal['binary', 'multiclass', 'multilabel'], classes: Optional[List[int]] = None, log_loss: bool = False, from_logits: bool = True, label_smooth: float = 0.0, eps: float = 1e-06)
[ -0.0035106176510453224, -0.03287005424499512, 0.01490747183561325, -0.025158660486340523, -0.014290928840637207, -0.02017109841108322, -0.046894121915102005, -0.005074982065707445, 0.02580280974507332, 0.013794012367725372, -0.02556355483829975, 0.032557182013988495, 0.05005965754389763, 0.03220750018954277, 0.012137627229094505, 0.018956415355205536, 0.015441196039319038, -0.021882696077227592, -0.006487511098384857, 0.02438567951321602, 0.035115379840135574, 0.032005053013563156, 0.012413691729307175, 0.10873252153396606, 0.01587369665503502, 0.006193042267113924, -0.023943977430462837, -0.009257355704903603, -0.03905389457941055, -0.013435129076242447, -0.038796234875917435, 0.019950246438384056, -0.00691541051492095, 0.04707816615700722, -0.03465527296066284, -0.056832436472177505, 0.012606936506927013, 0.07008352130651474, -0.06268499791622162, -0.00524982251226902, -0.03275962918996811, -0.057384565472602844, -0.07251288741827011, 0.01148427464067936, -0.02641015127301216, -0.02087046019732952, 0.04553220421075821, -0.020520780235528946, -0.006901607383042574, -0.0262445118278265, -0.06301628053188324, 0.004621776286512613, -0.006459904368966818, 0.01888279803097248, -0.06360521167516708, 0.06629224121570587, -0.001670188969001174, 0.029023559764027596, -0.038943469524383545, 0.006427696906030178, -0.0809788629412651, -0.012754170224070549, 0.035538677126169205, 0.008824855089187622, 0.004364116583019495, -0.017410455271601677, -0.11741934716701508, 0.019526947289705276, 0.023520678281784058, 0.024643339216709137, -0.00334958010353148, -0.036826975643634796, 0.039642833173274994, 0.07604651153087616, -0.014511779882013798, -0.02569238469004631, -0.05418222025036812, 0.009625441394746304, -0.017134390771389008, -0.01326949056237936, 0.00645070243626833, 0.04155687987804413, 0.019398117437958717, -0.008962887339293957, -0.008189907297492027, -0.05646435171365738, 0.0025144857354462147, 0.0009029603097587824, 0.038096874952316284, -0.046047523617744446, -0.07394842058420181, 0.03206026554107666, -0.036366868764162064, -0.0005199210718274117, -0.02797451615333557, 0.06515117734670639, 0.011106986552476883, 0.004640180617570877, -0.020649610087275505, -0.023759933188557625, -0.018330669030547142, -0.011990392580628395, -0.019048437476158142, 0.04048943147063255, -0.0019658077508211136, -0.016085347160696983, -0.060402870178222656, 0.003802785649895668, -0.026152491569519043, -0.01915886253118515, 0.023594295606017113, 0.07678268104791641, -0.009607037529349327, 0.020336735993623734, -0.006004398688673973, -0.018339872360229492, 0.023778337985277176, -0.015514813363552094, -0.05381413549184799, 0.0184594988822937, 0.03062473237514496, 0.01389523595571518, -0.045900288969278336, 0.009929112158715725, 0.014566992409527302, 0.02002386376261711, 0.041520070284605026, -0.001550561166368425, 0.03320133313536644, -0.060660529881715775, 0.022747697308659554, -0.011005762964487076, -0.0028595661278814077, 0.018938010558485985, 0.027035897597670555, -0.04199858009815216, -0.01886439323425293, 0.04509050026535988, -0.04325007274746895, 0.07582566142082214, 0.020060671493411064, 0.03139771148562431, 0.0638260692358017, 0.019674181938171387, 0.003552027279511094, -0.005323439836502075, 0.03134249895811081, -0.033440589904785156, 0.05024370178580284, 0.011106986552476883, 0.029870156198740005, -0.025747597217559814, -0.006147031672298908, 0.0823039710521698, -0.027588024735450745, -0.005318838637322187, 0.042072199285030365, -0.06654989719390869, 0.06574010848999023, 0.023870360106229782, 0.009215946309268475, -0.007338709197938442, 0.0010916042374446988, -0.023778337985277176, -0.04089432582259178, -0.019931841641664505, -0.025177063420414925, -0.02399918995797634, 0.019471734762191772, 0.02300535887479782, 0.04623156785964966, -0.09305207431316376, 0.06883203238248825, 0.018404286354780197, -0.04612114280462265, 0.06423096358776093, 0.00007627713785041124, 0.019195670261979103, -0.0008517733658663929, 0.030422285199165344, 0.048734549432992935, 0.020668013021349907, -0.013922843150794506, -0.019066840410232544, 0.014778641983866692, 0.054255835711956024, -0.0019612067844718695, -0.0145577909424901, -0.02241642028093338, -0.00214524962939322, 0.01014996413141489, -0.02497461624443531, -0.017796944826841354, -0.016674283891916275, -0.0007954102475196123, 0.0001470186107326299, -0.004147866275161505, -0.03246515989303589, -0.0025351904332637787, 0.050170086324214935, -0.0015701156808063388, 0.07862310856580734, 0.025489937514066696, -0.004647082183510065, -0.015597633086144924, 0.02142258919775486, 0.04104156047105789, 0.0837763100862503, 0.02950207144021988, -0.0496915727853775, 0.019803011789917946, -0.047041356563568115, -0.0018312265165150166, 0.09246313571929932, 0.046894121915102005, -0.009179137647151947, -0.05940903723239899, 0.041188791394233704, -0.004826524294912815, 0.03217069432139397, 0.025158660486340523, -0.010444432497024536, -0.10622954368591309, 0.06032925099134445, -0.013692788779735565, 0.055139243602752686, 0.007476741448044777, -0.04026857763528824, 0.05178966373205185, -0.005714531056582928, -0.022379612550139427, -0.007426129654049873, -0.04785114526748657, 0.018385881558060646, 0.004499848000705242, 0.07251288741827011, 0.04593709856271744, 0.024330466985702515, -0.06640266627073288, -0.031121648848056793, 0.006975224707275629, -0.03091920167207718, -0.02098088711500168, -0.016665080562233925, 0.07365395128726959, -0.009699058718979359, -0.018827585503458977, 0.015496409498155117, -0.005778945982456207, 0.0255451500415802, -0.03912751376628876, 0.0010415675351396203, 0.0008046124130487442, 0.003961522597819567, 0.018689552322030067, -0.03931155428290367, -0.058672863990068436, -0.03231792896986008, -0.0032276518177241087, -0.0067313676699995995, -0.04383901134133339, -0.043765392154455185, -0.01856992579996586, 0.018956415355205536, 0.013002628460526466, -0.009496611542999744, -0.04615795239806175, 0.02469855174422264, 0.0014562391443178058, -0.014079279266297817, 0.08708908408880234, 0.020097481086850166, -0.007826423272490501, 0.027735259383916855, -0.011189806275069714, -0.034268781542778015, -0.038538575172424316, -0.02582121454179287, -0.023226208984851837, 0.0012146829394623637, 0.05374051630496979, -0.010011931881308556, -0.011456668376922607, -0.026078874245285988, 0.005424663424491882, 0.0057191322557628155, 0.035961974412202835, 0.014290928840637207, 0.024183232337236404, -0.050869446247816086, 0.017484072595834732, 0.09253675490617752, 0.09400909394025803, 0.02455131895840168, 0.021183334290981293, -0.031692180782556534, 0.022103548049926758, 0.01058246474713087, -0.03817049041390419, -0.04891859367489815, 0.005097987595945597, -0.08782525360584259, 0.029612496495246887, -0.03292526677250862, -0.0001698083069641143, -0.049323488026857376, -0.00453895702958107, 0.022508442401885986, 0.09695377945899963, 0.056832436472177505, 0.048587314784526825, 0.029557283967733383, 0.021680248901247978, -0.011401455849409103, -0.022655677050352097, 0.04104156047105789, 0.05307796224951744, -0.026336533948779106, 0.01945332996547222, 0.04586348310112953, -0.011907573789358139, 0.04313964769244194, -0.021901100873947144, 0.03458165377378464, -0.065335214138031, -0.048587314784526825, 0.05988754704594612, -0.008907674811780453, -0.022066740319132805, -0.018634339794516563, -0.029998987913131714, 0.027293557301163673, 0.0326860137283802, -0.011907573789358139, -0.10247506946325302, 0.007048841565847397, 0.04866093397140503, 0.02341025322675705, 0.0031747394241392612, -0.04030538722872734, 0.055691372603178024, 0.004584968090057373, -0.07291778177022934, 0.057826269418001175, 0.03066154196858406, -0.004469940904527903, -0.03458165377378464, 0.01389523595571518, 0.04354454204440117, 0.0276616420596838, 0.005194609984755516, -0.06327393651008606, 0.04516411945223808, 0.005028971470892429, 0.0694577768445015, -0.0297965407371521, -0.012183637358248234, -0.012450499460101128, 0.019214075058698654, -0.0625009536743164, -0.011106986552476883, -0.03091920167207718, -0.013646778650581837, 0.012386084534227848, 0.004281297326087952, 0.04129922017455101, 0.0032506571151316166, 0.0016931943828240037, 0.023483868688344955, -0.0007045390666462481, -0.013867629691958427, -0.043765392154455185, -0.06084457039833069, -0.015524015761911869, -0.001176724093966186, 0.014981089159846306, -0.0581575445830822, -0.00010668735194485635, -0.006855596788227558, 0.035685911774635315, 0.03237314149737358, -0.004331909120082855, -0.001998015446588397, -0.00236034975387156, 0.022655677050352097, 0.008038071915507317, 0.024035997688770294, 0.027146322652697563, 0.0695682018995285, -0.019637374207377434, 0.023502273485064507, 0.0006493262480944395, 0.022361207753419876, -0.04347092658281326, -0.06371563673019409, 0.016720294952392578, -0.017382849007844925, 0.06308989226818085, 0.0004641331033781171, -0.04155687987804413, -0.030992818996310234, -0.009169936180114746, 0.022213973104953766, 0.047593485563993454, 0.0027583425398916006, 0.047041356563568115, 0.013021032325923443, -0.04288198798894882, 0.006018201820552349, -0.026207704097032547, 0.032612394541502, 0.05543370917439461, 0.004877136088907719, 0.03842815011739731, -0.0326860137283802, 0.011171401478350163, 0.011263423599302769, -0.05304115265607834, -0.00236034975387156, -0.011300232261419296, 0.0017346040112897754, 0.03450803831219673, 0.06993629038333893, -0.039753258228302, 0.020612800493836403, 0.04751986637711525, 0.005291232373565435, 0.02199312299489975, 0.012892202474176884, -0.005470674019306898, -0.1378113031387329, 0.0071592675521969795, -0.06338436156511307, -0.039642833173274994, 0.006151632871478796, -0.027422387152910233, -0.0297965407371521, -0.018183434382081032, -0.04884497821331024, -0.011245018802583218, -0.003545125713571906, -0.06504075229167938, 0.048734549432992935, 0.029704518616199493, -0.0262445118278265, -0.04188815504312515, -0.03734229877591133, 0.03802325576543808, -0.07877034693956375, -0.01572646200656891, 0.0049967640079557896, 0.03360622748732567, 0.012965819798409939, 0.02226918749511242, 0.01846870221197605, -0.0369374044239521, -0.0979844182729721, -0.0055534932762384415, 0.0002908739843405783, -0.03091920167207718, -0.01221124455332756, -0.018671149387955666, -0.07177671790122986, -0.007877035066485405, 0.0015919707948341966, -0.01687673106789589, 0.08613206446170807, -0.017668114975094795, -0.024937808513641357, -0.03590676188468933, 0.010932146571576595, -0.04365496709942818, 0.05318838730454445, -0.025324298068881035, -0.022784506902098656, 0.05013327673077583, 0.02595004439353943, 0.013297096826136112, -0.006943017244338989, -0.009330973029136658, 0.03375346213579178, -0.04667327180504799, 0.025581957772374153, -0.033440589904785156, -0.013435129076242447, 0.010315602645277977, 0.008502780459821224, 0.014852259308099747, 0.01185236033052206, 0.015846090391278267, -0.011024167761206627, 0.016508644446730614, -0.040379006415605545, 0.023723125457763672, 0.030054200440645218, 0.0026755230501294136, -0.004090352449566126, 0.04001091793179512, -0.0022188667207956314, -0.016646677628159523, -0.012763372622430325, 0.013149863108992577, -0.0724392682313919, -0.017493274062871933, 0.04693093150854111, 0.007927646860480309, -0.04468560591340065, -0.0023971584159880877, -0.012965819798409939, 0.007403124123811722, -0.008976690471172333, -0.0026640205178409815, -0.020741630345582962, 0.033146120607852936, 0.018211040645837784, -0.015984123572707176, -0.036661338061094284, 0.025029828771948814, -0.0007672287174500525, -0.009280361235141754, 0.0002527713659219444, 0.058120738714933395, 0.047446250915527344, -0.019342904910445213, -0.04347092658281326, 0.050427746027708054, 0.04041581228375435, -0.006906208582222462, 0.07862310856580734, 0.045605823397636414, 0.0028181562665849924, -0.01049044355750084, 0.005617908667773008, 0.0866473838686943, 0.02670462056994438, 0.0022050635889172554, -0.008553392253816128, -0.0031034229323267937, 0.011962786316871643, 0.0028664676938205957, 0.00592618016526103, 0.0033587822690606117, 0.03575952723622322, 0.028692282736301422, 0.016306197270751, 0.07045160979032516, -0.008742036297917366, 0.08782525360584259, 0.00793684832751751, -0.023667912930250168, -0.018845990300178528, -0.02637334167957306, -0.033845484256744385, -0.011705126613378525, 0.05594903230667114, 0.02668621577322483, 0.004821923095732927, 0.0071730706840753555, -0.02169865369796753, 0.008990493603050709, -0.05580179765820503, -0.029299624264240265, 0.046341992914676666, -0.011171401478350163, -0.06853756308555603, -0.043618157505989075, -0.021238546818494797, 0.015413589775562286, -0.018919605761766434, 0.0014010262675583363, -0.008696025237441063, 0.025876427069306374, -0.04884497821331024, 0.024164827540516853, -0.029133984819054604, 0.025508340448141098, 0.014318535104393959, 0.02994377352297306, -0.00021768819715362042, 0.0034968145191669464, -0.03079037182033062, -0.005466073285788298, -0.004002932459115982, -0.04089432582259178, 0.02410961501300335, 0.006487511098384857, -0.027275152504444122, -0.036514103412628174, 0.02880270779132843, 0.004481443669646978, 0.055249668657779694, 0.052268173545598984, 0.05039093643426895, -0.001298652496188879, -0.029483666643500328, -0.031857818365097046, -0.028029728680849075, -0.023723125457763672, 0.04380220174789429, 0.050722215324640274, -0.03145292401313782, 0.02768004685640335, -0.02939164638519287, -0.007633178029209375, -0.014769439585506916, -0.06566649675369263, -0.037802405655384064, 0.08068439364433289, -0.013140660710632801, -0.008958286605775356, -0.019508544355630875, 0.03960602357983589, 0.021790675818920135, -0.00356583041138947, 0.00965304858982563, -0.014879865571856499, -0.014852259308099747, -0.00082934316014871, 0.03522580489516258, -0.01141985971480608, -0.04063666611909866, -0.013094649650156498, -0.01843189261853695, 0.025048233568668365, -0.029538879171013832, -0.02169865369796753, -0.052709877490997314, -0.07424288988113403, -0.01956375688314438, 0.011751136742532253, 0.025158660486340523, 0.009524218738079071, -0.009800282306969166, -0.03194984048604965, -0.01071129459887743, -0.012616137973964214, -0.030201435089111328, 0.02823217585682869, 0.028894729912281036, 0.018128221854567528, -0.052599452435970306, -0.041667304933071136, -0.0073203048668801785, -0.02782728150486946, -0.0191772673279047, -0.08414439857006073, 0.007692991755902767, -0.006400090642273426, 0.022600464522838593, 0.00010690302588045597, -0.014502577483654022, 0.01545960083603859, -0.0212937593460083, 0.02385195530951023, 0.013554757460951805, 0.028563452884554863, -0.01545960083603859, 0.03758155182003975, 0.06780139356851578, -0.04671007767319679, -0.07972736656665802, 0.0030482099391520023, 0.07847587764263153, 0.017916573211550713, -0.041225600987672806, -0.001404477166943252, 0.006694559007883072, -0.06452542543411255, -0.005272828042507172, 0.008677621372044086, -0.05705328658223152, -0.014879865571856499, -0.0708565041422844, -0.016830720007419586, -0.025710787624120712, 0.024864191189408302, 0.000708565057720989, -0.04369177669286728, 0.022103548049926758, -0.020189503207802773, 0.03275962918996811, 0.01646263338625431, -0.019876629114151, -0.04413348063826561, 0.045753058046102524, 0.04048943147063255, -0.056133072823286057, 0.03229952231049538, -0.012156031094491482, -0.02423844486474991, -0.036550913006067276, 0.04295560345053673, 0.03960602357983589, 0.021625036373734474, 0.03364303708076477, -0.01903003267943859, -0.07424288988113403, -0.05558094382286072, 0.02541632018983364, -0.006239053327590227, -0.01843189261853695, -0.014465768821537495, -0.07446373999118805, -0.010978156700730324, -0.04387582093477249, 0.015984123572707176, -0.04693093150854111, 0.019214075058698654, -0.017023965716362, 0.030422285199165344, 0.039642833173274994, 0.08340822905302048, 0.03734229877591133, -0.037949640303850174, -0.03287005424499512, 0.04586348310112953, 0.0177141260355711, -0.029005154967308044, -0.05970350652933121, 0.006984426639974117, 0.010968955233693123, 0.0006642797379754484, 0.022029930725693703, 0.043912626802921295, 0.013195873238146305, -0.04950753226876259, -0.024772169068455696, -0.009616239927709103, 0.045200929045677185, -0.038096874952316284, 0.07346991449594498, 0.03231792896986008, -0.10299038887023926, -0.010720496997237206, -0.027772068977355957, -0.010287996381521225, 0.05458711460232735, -0.017520880326628685, -0.0012767973821610212, 0.0383545346558094, -0.017493274062871933, -0.02596844919025898, 0.0212937593460083, 0.056537967175245285, -0.047630295157432556, 0.0034692080225795507, 0.013232681900262833, 0.02738557755947113, 0.0020831350702792406, -0.000953572103753686, 0.008962887339293957, -0.009671452455222607, 0.05061178654432297, -0.014180502854287624, 0.08186226338148117, -0.050170086324214935, 0.007347911596298218, -0.05178966373205185, -0.02398078516125679, -0.0880461037158966, -0.022103548049926758, -0.029446858912706375, 0.011760339140892029, 0.01489827036857605, 0.0018427291652187705, 0.050170086324214935, 0.048587314784526825, -0.009243552573025227 ]
716,787
pytorch_optimizer.loss.jaccard
forward
null
def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor: if self.from_logits: # Apply activations to get [0..1] class probabilities # Using Log-Exp as this gives more numerically stable result and does not cause vanishing gradient on # extreme values 0 and 1 y_pred = y_pred.log_softmax(dim=1).exp() if self.mode == 'multiclass' else logsigmoid(y_pred).exp() bs: int = y_true.size(0) num_classes: int = y_pred.size(1) dims: Tuple[int, ...] = (0, 2) if self.mode == 'binary': y_true = y_true.view(bs, 1, -1) y_pred = y_pred.view(bs, 1, -1) if self.mode == 'multiclass': y_true = y_true.view(bs, -1) y_pred = y_pred.view(bs, num_classes, -1) y_true = one_hot(y_true, num_classes) y_true = y_true.permute(0, 2, 1) if self.mode == 'multilabel': y_true = y_true.view(bs, num_classes, -1) y_pred = y_pred.view(bs, num_classes, -1) scores = soft_jaccard_score( y_pred, y_true.type(y_pred.dtype), label_smooth=self.label_smooth, eps=self.eps, dims=dims ) loss = -torch.log(scores.clamp_min(self.eps)) if self.log_loss else 1.0 - scores # IoU loss is defined for non-empty classes # So we zero contribution of channel that does not have true pixels # NOTE: A better workaround would be to use loss term `mean(y_pred)` # for this case, however it will be a modified jaccard loss mask = y_true.sum(dims) > 0 loss *= mask.float() if self.classes is not None: loss = loss[self.classes] return loss.mean()
(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor
[ -0.042362481355667114, -0.058219894766807556, 0.003360668197274208, 0.011855030432343483, 0.04251459240913391, -0.017530614510178566, -0.04125968739390373, 0.03713371977210045, 0.025002991780638695, 0.03135355934500694, 0.013414151966571808, -0.029509233310818672, 0.05285803601145744, 0.02403329312801361, 0.04574691876769066, 0.05795370042324066, 0.026847317814826965, -0.019907325506210327, 0.029243042692542076, 0.011465249583125114, 0.031866930425167084, -0.030497945845127106, -0.009026745334267616, 0.03521334007382393, -0.021884746849536896, -0.03515629842877388, -0.018671436235308647, -0.01608557440340519, -0.030707096680998802, 0.0138324536383152, -0.053390417248010635, 0.005014858674257994, 0.04574691876769066, 0.004857995547354221, 0.01673203893005848, 0.01446941215544939, -0.019983379170298576, 0.01763518899679184, -0.042894866317510605, -0.009364238008856773, -0.04251459240913391, -0.09126567095518112, -0.0138324536383152, 0.01577184908092022, -0.04433990642428398, 0.044834259897470474, -0.05962690711021423, 0.007595965638756752, 0.030003588646650314, -0.03519432619214058, -0.012320865876972675, -0.02897685021162033, -0.0431230291724205, 0.03268451988697052, -0.005480693653225899, 0.05860016494989395, 0.03435772284865379, -0.01447891816496849, -0.07065483927726746, -0.04627930000424385, -0.00829947181046009, -0.040537167340517044, 0.05434110388159752, 0.003657757071778178, 0.042818810790777206, 0.008423061110079288, -0.04186812788248062, 0.039852675050497055, 0.008489608764648438, 0.0022543095983564854, -0.03970056772232056, -0.025820579379796982, 0.03141060099005699, 0.04627930000424385, -0.024793840944767, -0.030516959726810455, -0.006754610221832991, -0.03585980460047722, 0.019061215221881866, -0.04772434011101723, -0.02293049916625023, 0.014792644418776035, 0.003643496660515666, -0.04000478610396385, -0.020059434697031975, -0.055253759026527405, 0.02528819628059864, -0.004475345369428396, -0.051603130996227264, 0.0430469736456871, -0.044149767607450485, 0.04011886939406395, 0.010200840421020985, 0.01883305236697197, 0.037932295352220535, 0.06590142101049423, -0.05167918652296066, -0.005033872090280056, 0.01204516738653183, 0.013680343516170979, 0.014726096764206886, 0.12868459522724152, -0.03464292734861374, 0.027512798085808754, 0.02599170245230198, -0.008608444593846798, -0.05981704220175743, 0.02351992391049862, -0.023253733292222023, -0.052135515958070755, -0.02907191962003708, -0.0433892197906971, 0.004154489375650883, -0.011056455783545971, 0.034776024520397186, -0.0683731958270073, -0.026048744097352028, 0.012168756686151028, -0.06301134079694748, 0.03905410319566727, 0.022341076284646988, -0.015201438218355179, -0.009316704235970974, -0.04570889100432396, -0.007334527559578419, 0.018490806221961975, 0.045975081622600555, -0.011731441132724285, 0.0339013934135437, -0.02412836253643036, -0.05065244808793068, 0.01138919498771429, -0.010352949611842632, 0.046051137149333954, 0.03319788724184036, -0.022436143830418587, -0.009468813426792622, 0.05369463562965393, 0.012187769636511803, 0.025725511834025383, 0.05981704220175743, 0.00491979019716382, 0.025516360998153687, 0.05137496814131737, 0.014326808974146843, -0.009773032739758492, 0.035536572337150574, 0.07962930202484131, 0.04506242647767067, -0.007372554857283831, 0.05917057767510414, -0.01966014690697193, 0.03452884405851364, -0.008323239162564278, -0.03276057168841362, 0.006749856751412153, -0.023329786956310272, -0.02838742733001709, 0.015923958271741867, -0.0020784330554306507, -0.02726561948657036, -0.08282359689474106, -0.040347032248973846, -0.013052892871201038, 0.0011574578238651156, -0.018785517662763596, 0.03624007850885391, 0.07168158143758774, 0.018272148445248604, 0.06578733772039413, 0.06053956225514412, -0.0861700028181076, 0.0679168701171875, 0.056470632553100586, -0.06593944877386093, 0.05008203908801079, 0.01626620441675186, -0.037380896508693695, -0.031182438135147095, 0.06209868565201759, 0.04004281386733055, -0.031733833253383636, -0.06301134079694748, -0.09369942545890808, 0.04030900448560715, 0.011170538142323494, 0.021143214777112007, 0.029147973284125328, -0.015410589054226875, 0.055291786789894104, -0.019527051597833633, -0.04616522043943405, 0.001345217926427722, -0.015591219067573547, 0.05080455541610718, -0.034129559993743896, 0.026162825524806976, 0.03932029381394386, 0.0554819218814373, -0.023634005337953568, -0.055862195789813995, 0.010448018088936806, 0.04091744124889374, -0.001407012459821999, -0.07229001820087433, 0.005347597878426313, -0.02644803188741207, 0.10244571417570114, 0.004582297056913376, -0.0989471971988678, -0.02593466080725193, 0.0021152719855308533, -0.03317887336015701, 0.05384674668312073, 0.02652408555150032, 0.008380279876291752, -0.028729673475027084, 0.007353541441261768, -0.03770412877202034, -0.005043379031121731, -0.016152122989296913, -0.04217234626412392, -0.07909691333770752, 0.029889507219195366, 0.008575170300900936, -0.028007153421640396, 0.025516360998153687, -0.013024372048676014, 0.024375539273023605, 0.0015412966022267938, -0.01386097352951765, 0.017397519201040268, 0.021789679303765297, 0.03578374907374382, 0.08350808918476105, 0.03901607543230057, 0.017131326720118523, 0.009706484153866768, -0.03939634934067726, 0.02287345938384533, -0.03015569970011711, -0.039244238287210464, 0.013851466588675976, -0.011702921241521835, 0.014745109714567661, -0.008898402564227581, 0.028178276494145393, 0.06472257524728775, -0.022664308547973633, 0.03281761333346367, -0.01885206438601017, -0.028710659593343735, -0.04259064793586731, -0.02536425180733204, -0.011902565136551857, -0.07529418170452118, -0.02599170245230198, -0.05844805762171745, 0.03802736476063728, -0.008912662975490093, -0.010894839651882648, 0.015800369903445244, -0.016522889956831932, 0.02024957165122032, -0.04376949369907379, -0.02226502075791359, 0.01967916078865528, 0.0002780750801321119, 0.03652528300881386, 0.05259184166789055, 0.05129891261458397, 0.028558550402522087, -0.058980438858270645, -0.010676181875169277, -0.03137257322669029, 0.01386097352951765, 0.0370766781270504, -0.05072850361466408, 0.002333929529413581, 0.008969704620540142, 0.017587656155228615, -0.11263705044984818, -0.02218896709382534, -0.039814651012420654, 0.04677365720272064, 0.027056468650698662, 0.030440904200077057, -0.019175298511981964, 0.05970295891165733, 0.0009203810477629304, 0.06734646111726761, 0.052705924957990646, 0.061794463545084, 0.017093298956751823, 0.0073820617981255054, 0.0016648855526000261, -0.050310201942920685, -0.007001788355410099, 0.011883551254868507, 0.0069685145281255245, -0.007229952607303858, -0.0025644702836871147, -0.010438511148095131, -0.05974098667502403, -0.03515629842877388, -0.05186932161450386, 0.017216889187693596, 0.04445398598909378, 0.006745103746652603, -0.008104581385850906, 0.05354252830147743, 0.012225797399878502, -0.012140235863626003, -0.00018062996969092637, -0.037000622600317, -0.01663697138428688, 0.05308619886636734, -0.013081412762403488, 0.04996795579791069, 0.06289725750684738, 0.0012834235094487667, 0.03874988481402397, -0.003434346290305257, 0.04825672507286072, -0.005143200978636742, -0.02905290573835373, 0.03593585640192032, 0.008874636143445969, -0.025820579379796982, -0.004211530555039644, 0.039890702813863754, -0.025459319353103638, -0.019251352176070213, -0.008308978751301765, -0.03464292734861374, -0.018338695168495178, 0.01752110756933689, 0.037285830825567245, 0.024964964017271996, 0.017625682055950165, -0.03867382928729057, -0.008342253044247627, -0.04567086324095726, 0.024470608681440353, 0.029205014929175377, -0.004789071157574654, -0.034148573875427246, 0.03215213492512703, 0.03757103532552719, 0.034224625676870346, -0.011189552024006844, -0.006821158342063427, 0.05818186700344086, 0.055519949644804, 0.004639338236302137, -0.016256697475910187, -0.023595979437232018, 0.009763525798916817, 0.014070124365389347, -0.04027097672224045, 0.004617948085069656, -0.032456353306770325, -0.03142961487174034, 0.02097209170460701, -0.012368399649858475, 0.03816045820713043, 0.0005897211958654225, -0.03595487028360367, -0.018300669267773628, 0.014146178960800171, -0.035536572337150574, -0.006374336779117584, -0.011921578086912632, 0.004703509621322155, -0.024280471727252007, 0.05019611865282059, -0.02652408555150032, -0.005956035573035479, 0.03188594430685043, -0.008717773482203484, 0.013461686670780182, 0.005789665970951319, -0.06997034698724747, 0.010780757293105125, 0.023253733292222023, 0.007063582539558411, -0.016057053580880165, -0.039890702813863754, 0.02042069472372532, -0.04692576453089714, 0.003940585535019636, -0.020629843696951866, -0.019279872998595238, -0.05487348511815071, -0.04449201375246048, -0.0037314349319785833, 0.01785384677350521, 0.10313020646572113, -0.025611428543925285, -0.04065125063061714, -0.02397625334560871, -0.014222233556210995, 0.046013109385967255, 0.021124200895428658, -0.040385060012340546, 0.06962810456752777, 0.03272254765033722, 0.060691673308610916, -0.05745934695005417, 0.06616761535406113, -0.022664308547973633, 0.05103272199630737, -0.041754044592380524, 0.0037575787864625454, -0.04205826297402382, 0.009326211176812649, -0.019298886880278587, 0.00407605804502964, 0.020268583670258522, 0.05323830991983414, 0.010676181875169277, 0.03137257322669029, 0.047876451164484024, -0.02159954234957695, -0.06890558451414108, 0.007239459082484245, -0.030421890318393707, 0.040423087775707245, -0.0004001785709988326, 0.012102208100259304, -0.0492074079811573, -0.03026978112757206, -0.010961387306451797, -0.05494954064488411, -0.01147475652396679, -0.02711351029574871, 0.015505657531321049, -0.010600127279758453, -0.03905410319566727, 0.06000717729330063, -0.01359478197991848, -0.03878790885210037, 0.03355914726853371, 0.0864742249250412, 0.0036862774286419153, -0.02401427924633026, -0.04399766027927399, -0.024451594799757004, -0.06909571588039398, 0.010001196525990963, -0.06327753514051437, 0.0025787304621189833, 0.0169697105884552, 0.032304245978593826, 0.015543684363365173, -0.008076061494648457, -0.06696618348360062, -0.03257043659687042, 0.03255142271518707, 0.005713611375540495, -0.01691266894340515, 0.039890702813863754, -0.055748116225004196, 0.04373146593570709, -0.0013654200593009591, -0.011436729691922665, 0.026390990242362022, -0.032418325543403625, -0.030383862555027008, 0.0017552004428580403, 0.008475348353385925, -0.03557460010051727, 0.06373386085033417, 0.00023692830291111022, -0.06928585469722748, 0.044149767607450485, 0.012254318222403526, 0.024223430082201958, 0.036106981337070465, -0.0036910308990627527, -0.025763537734746933, -0.006863939110189676, -0.025155100971460342, -0.050918638706207275, -0.0035721955355256796, 0.006502679083496332, -0.01981225609779358, -0.013461686670780182, 0.041677989065647125, 0.039928730577230453, -0.015828890725970268, -0.016465848311781883, 0.026999427005648613, -0.01885206438601017, -0.08913613855838776, -0.028197290375828743, -0.00207962142303586, 0.005908501334488392, -0.0007997629581950605, 0.03021273948252201, 0.01012478582561016, 0.011664893478155136, -0.08274754136800766, -0.009915634989738464, 0.019489023834466934, 0.020610831677913666, 0.014735603705048561, 0.0017207381315529346, -0.049017272889614105, 0.023614993318915367, -0.021428419277071953, 0.0062602548860013485, -0.025117073208093643, -0.018414750695228577, 0.00048574013635516167, -0.04114560782909393, 0.040347032248973846, 0.042324453592300415, 0.006250747945159674, -0.023139650002121925, -0.00134878302924335, 0.02840644121170044, 0.003614976303651929, 0.027912084013223648, -0.02228403463959694, 0.07453363388776779, 0.013005358166992664, 0.008713020011782646, 0.05513967573642731, -0.02711351029574871, -0.016589436680078506, -0.030440904200077057, -0.010676181875169277, 0.029338110238313675, -0.03778018429875374, 0.024223430082201958, 0.005200241692364216, -0.031163424253463745, -0.04981584474444389, -0.0006666671833954751, 0.004665482323616743, -0.029528247192502022, -0.0025407031644135714, -0.01542009599506855, -0.019279872998595238, -0.00039572225068695843, -0.03701963648200035, 0.048522915691137314, -0.017549628391861916, -0.014051110483705997, -0.09537262469530106, 0.009568635374307632, 0.001580512267537415, 0.026904359459877014, 0.07305056601762772, 0.1053357943892479, 0.046583518385887146, 0.08289965242147446, 0.018804531544446945, 0.05491151288151741, -0.021979816257953644, -0.042286429554224014, 0.027493784204125404, -0.041107580065727234, -0.012501495890319347, 0.004834228660911322, -0.00815211609005928, 0.0368485152721405, -0.01447891816496849, 0.03445279225707054, -0.028102220967411995, 0.05061442032456398, -0.036183036863803864, 0.027645893394947052, 0.013499713502824306, 0.006830665282905102, 0.05183129757642746, -0.04198220744729042, 0.030669068917632103, -0.02104814536869526, -0.023576965555548668, -0.04513847827911377, 0.03203805536031723, 0.025801565498113632, -0.022645294666290283, -0.018348202109336853, -0.026143811643123627, 0.05787764862179756, -0.007329774089157581, -0.029737398028373718, 0.0038478937931358814, 0.017768286168575287, 0.00417825672775507, 0.004976831376552582, 0.033064793795347214, -0.036164022982120514, -0.039282266050577164, -0.007377308327704668, 0.08860375732183456, 0.06905768811702728, 0.02097209170460701, -0.00106060691177845, -0.0046464684419333935, -0.021732637658715248, 0.024565676227211952, -0.05171721428632736, -0.03082117810845375, 0.03629711642861366, -0.017606670036911964, -0.03336901217699051, -0.016114095225930214, 0.030345836654305458, 0.02962331660091877, -0.015201438218355179, -0.02275937609374523, -0.007614979520440102, 0.00029634605743922293, 0.06312542408704758, 0.0015234712045639753, 0.024223430082201958, 0.04186812788248062, -0.006374336779117584, -0.015933465212583542, 0.03901607543230057, -0.025535374879837036, -0.03158172592520714, 0.0038574007339775562, -0.05015809088945389, 0.015885930508375168, 0.02047773450613022, -0.006973267532885075, 0.01023886725306511, 0.012701138854026794, -0.0011164596071466804, -0.010200840421020985, -0.01237790659070015, -0.0027569837402552366, 0.04122166335582733, 0.0017599539132788777, -0.06361977756023407, -0.052705924957990646, 0.004677365534007549, 0.011607852764427662, -0.01511587668210268, -0.02399526536464691, -0.04068927839398384, -0.015705300495028496, 0.01054308656603098, 0.03589783236384392, -0.03874988481402397, -0.00928818341344595, 0.034129559993743896, 0.05107074975967407, 0.032494381070137024, 0.026067757979035378, 0.02047773450613022, -0.007890678010880947, 0.06316345185041428, 0.02275937609374523, -0.034890104085206985, -0.04027097672224045, -0.02355795167386532, 0.07152947038412094, 0.012159249745309353, -0.005423652473837137, 0.023272747173905373, 0.03686752915382385, -0.06704223901033401, -0.03658232465386391, -0.06909571588039398, -0.04278078302741051, 0.05426504835486412, -0.034776024520397186, -0.00992514193058014, 0.03772314265370369, -0.05936071276664734, 0.027912084013223648, 0.019641133025288582, 0.017055273056030273, -0.059588879346847534, 0.03819848597049713, 0.030992301180958748, -0.0016684505390003324, 0.006892459467053413, 0.04376949369907379, -0.03591684624552727, -0.04030900448560715, -0.019450996071100235, -0.05133694037795067, -0.07962930202484131, -0.057041045278310776, 0.01787286065518856, 0.012549029663205147, -0.009625676088035107, 0.005328584462404251, -0.014745109714567661, -0.03705766424536705, 0.03572670742869377, -0.000553773483261466, -0.01571480743587017, -0.06590142101049423, -0.022017844021320343, -0.027493784204125404, -0.03966253995895386, 0.009007731452584267, 0.06601550430059433, -0.021656583994627, -0.023215705528855324, -0.03778018429875374, -0.026124797761440277, 0.028843754902482033, 0.023805130273103714, -0.028007153421640396, -0.005423652473837137, -0.03831256926059723, 0.008508622646331787, -0.0215805284678936, -0.0036743939854204655, -0.01628521829843521, 0.021143214777112007, 0.0277980025857687, -0.00026530027389526367, -0.005128940567374229, 0.05848608538508415, -0.058904387056827545, -0.06114799901843071, 0.020686885342001915, -0.04639338329434395, 0.02538326568901539, 0.006122405640780926, 0.02416638843715191, 0.02215093933045864, -0.018357709050178528, 0.030745122581720352, -0.02291148714721203, -0.0277219470590353, 0.057041045278310776, -0.07217593491077423, 0.07213790714740753, 0.027303647249937057, 0.03146764263510704, 0.0019203817937523127, 0.053998854011297226, 0.039092130959033966, 0.01047653891146183, 0.007044569123536348, -0.01851932518184185, 0.01735949143767357, 0.008822347968816757, -0.027950111776590347, 0.04118363559246063, -0.015914451330900192, -0.020858008414506912, -0.01080927811563015, 0.1356816291809082, 0.022531213238835335, 0.008280457928776741, -0.0372287891805172, -0.053390417248010635, -0.06669999659061432, -0.006573980208486319, -0.03454785794019699, -0.0021913268137723207, 0.02159954234957695, -0.014279275201261044, 0.05468335002660751, 0.019641133025288582, 0.008080814965069294 ]
716,821
pytorch_optimizer.optimizer.lars
LARS
Layer-wise Adaptive Rate Scaling (no rate scaling or weight decay for parameters <= 1D). :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param lr: float. learning rate. :param weight_decay: float. weight decay (L2 penalty). :param momentum: float. momentum. :param dampening: float. dampening for momentum. :param trust_coefficient: float. trust_coefficient. :param nesterov: bool. enables nesterov momentum.
class LARS(Optimizer, BaseOptimizer): r"""Layer-wise Adaptive Rate Scaling (no rate scaling or weight decay for parameters <= 1D). :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param lr: float. learning rate. :param weight_decay: float. weight decay (L2 penalty). :param momentum: float. momentum. :param dampening: float. dampening for momentum. :param trust_coefficient: float. trust_coefficient. :param nesterov: bool. enables nesterov momentum. """ def __init__( self, params: PARAMETERS, lr: float = 1e-3, weight_decay: float = 0.0, momentum: float = 0.9, dampening: float = 0.0, trust_coefficient: float = 1e-3, nesterov: bool = False, ): self.validate_learning_rate(lr) self.validate_non_negative(weight_decay, 'weight_decay') self.validate_range(momentum, 'momentum', 0.0, 1.0) self.validate_range(dampening, 'dampening', 0.0, 1.0) self.validate_non_negative(trust_coefficient, 'trust_coefficient') defaults: DEFAULTS = { 'lr': lr, 'weight_decay': weight_decay, 'momentum': momentum, 'dampening': dampening, 'trust_coefficient': trust_coefficient, 'nesterov': nesterov, } super().__init__(params, defaults) def __str__(self) -> str: return 'Lars' @torch.no_grad() def reset(self): for group in self.param_groups: for p in group['params']: state = self.state[p] state['mu'] = torch.zeros_like(p) @torch.no_grad() def step(self, closure: CLOSURE = None) -> LOSS: loss: LOSS = None if closure is not None: with torch.enable_grad(): loss = closure() for group in self.param_groups: for p in group['params']: if p.grad is None: continue grad = p.grad if grad.is_sparse: raise NoSparseGradientError(str(self)) if p.ndim > 1: # if not normalization gamma/beta or bias param_norm = torch.linalg.norm(p) update_norm = torch.linalg.norm(grad) one = torch.ones_like(param_norm) trust_ratio = torch.where( param_norm > 0.0, torch.where(update_norm > 0.0, (group['trust_coefficient'] * param_norm / update_norm), one), one, ) grad.add_(p, alpha=group['weight_decay']) grad.mul_(trust_ratio) if group['momentum'] > 0.0: state = self.state[p] if 'momentum_buffer' not in state: state['momentum_buffer'] = grad.clone().detach() mb = state['momentum_buffer'] mb.mul_(group['momentum']).add_(grad, alpha=1.0 - group['dampening']) if group['nesterov']: grad.add_(mb, alpha=group['momentum']) else: grad.copy_(mb) p.add_(grad, alpha=-group['lr']) return loss
(params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], lr: float = 0.001, weight_decay: float = 0.0, momentum: float = 0.9, dampening: float = 0.0, trust_coefficient: float = 0.001, nesterov: bool = False)
[ -0.021222878247499466, -0.04280785471200943, 0.0032538394443690777, 0.044537872076034546, -0.002376258373260498, -0.0005462879780679941, -0.056527286767959595, -0.038241416215896606, -0.021947070956230164, 0.04570462554693222, -0.06787297874689102, 0.0011868719011545181, 0.02896772138774395, 0.07732772082090378, -0.03341346234083176, 0.06155640631914139, -0.025125473737716675, 0.007538648322224617, -0.00567787466570735, -0.014252521097660065, -0.0099224504083395, -0.038140833377838135, 0.013437803834676743, 0.07177557796239853, -0.04630811884999275, -0.006226048339158297, 0.028303876519203186, -0.010712021961808205, -0.08529384434223175, -0.0037994987796992064, -0.022047653794288635, -0.021665440872311592, 0.004755031317472458, 0.028263643383979797, 0.024521980434656143, -0.04188249632716179, -0.017290107905864716, -0.010470624081790447, -0.07543677091598511, -0.03964956849813461, 0.018084708601236343, -0.0205690935254097, 0.04308948293328285, -0.0446988008916378, -0.004470886196941137, 0.01903018355369568, -0.0069955033250153065, 0.039066191762685776, -0.008594763465225697, -0.024703027680516243, 0.036531515419483185, -0.008574646897614002, 0.019875075668096542, -0.020860781893134117, -0.017853369936347008, 0.04276762157678604, 0.06445317715406418, 0.015851780772209167, 0.03311171382665634, -0.06984439492225647, 0.04212389513850212, -0.08851248025894165, -0.014433569274842739, 0.0033594509586691856, -0.016958186402916908, -0.05093491077423096, -0.059383828192949295, -0.013850191608071327, 0.042928554117679596, 0.02156485803425312, 0.027277937158942223, -0.02514559030532837, 0.001223961589857936, 0.011989417485892773, -0.029872961342334747, -0.02474326081573963, -0.05532030016183853, -0.036390699446201324, 0.004214400891214609, -0.04304925352334976, -0.015962421894073486, 0.015489684417843819, 0.00801138486713171, -0.0038523045368492603, -0.004008207004517317, -0.08199474215507507, -0.007956065237522125, -0.03852304443717003, 0.011546855792403221, -0.0558030940592289, -0.028987837955355644, 0.0014961626147851348, 0.02570885233581066, 0.0205690935254097, 0.036350466310977936, 0.052664924412965775, -0.019221289083361626, -0.060671281069517136, 0.008031501434743404, -0.02381790429353714, 0.010480682365596294, 0.016797253862023354, 0.013960831798613071, 0.060952913016080856, 0.02914876863360405, -0.006386979948729277, -0.03743675723671913, -0.019482804462313652, 0.004619244951754808, -0.023053478449583054, -0.011939126998186111, 0.015338810160756111, -0.046549517661333084, -0.004966254346072674, -0.05954476073384285, 0.005245370324701071, 0.0009882217273116112, -0.002249273005872965, -0.0347009152173996, 0.03132134675979614, 0.03293066471815109, 0.029349934309720993, -0.03614930063486099, -0.0021989818196743727, 0.011597146280109882, -0.012874542735517025, 0.025728968903422356, -0.005210166331380606, 0.01439333613961935, -0.03190472722053528, -0.027982013300061226, 0.01848703809082508, -0.04550345987081528, 0.02020699717104435, 0.041319236159324646, -0.053952381014823914, -0.0375373400747776, 0.03981050103902817, 0.0023171661887317896, 0.05021071434020996, 0.04244575649499893, 0.035565923899412155, 0.03618953377008438, 0.00475754588842392, 0.016244051977992058, -0.009494975209236145, 0.04240552335977554, 0.015570149756968021, 0.0013050561537966132, 0.007096085697412491, 0.0036762855015695095, 0.013890424743294716, 0.0640106201171875, 0.040574926882982254, 0.02395871840417385, 0.0018846620805561543, -0.046790916472673416, -0.02381790429353714, -0.018788784742355347, -0.02038804441690445, -0.04381367936730385, -0.049124427139759064, -0.03723559156060219, -0.061355240643024445, -0.019221289083361626, -0.027660150080919266, 0.004458313342183828, 0.032528337091207504, -0.024300700053572655, 0.046509284526109695, 0.001731273951008916, -0.10315727442502975, 0.03274961933493614, 0.04001166298985481, -0.021303344517946243, 0.11434203386306763, 0.0031909754034131765, 0.007463211193680763, 0.008901539258658886, -0.037959784269332886, 0.02868608944118023, -0.019724201411008835, -0.014453685842454433, -0.08827108144760132, -0.015861839056015015, 0.04063527658581734, -0.022148236632347107, -0.015047121793031693, -0.05182003229856491, 0.04964745417237282, 0.034278471022844315, -0.004073585849255323, 0.009263635613024235, -0.012955008074641228, -0.03518370911478996, 0.027760732918977737, 0.028746439144015312, 0.026915840804576874, 0.06107361242175102, 0.03695395961403847, 0.020287463441491127, 0.04916466027498245, 0.011737962253391743, 0.029410284012556076, 0.005061807576566935, -0.0032261793967336416, -0.029993660748004913, 0.04119853675365448, -0.0024127194192260504, -0.004131420515477657, -0.02900795452296734, 0.02643304504454136, 0.03705454245209694, 0.045785091817379, 0.024340931326150894, -0.02120276167988777, -0.013357337564229965, 0.04896349459886551, 0.052584458142519, -0.02317417599260807, 0.029209118336439133, -0.06767181307077408, -0.030456339940428734, 0.016445215791463852, 0.047153010964393616, 0.0008530641789548099, 0.06308525800704956, -0.01553997490555048, -0.004063527565449476, 0.02689572423696518, -0.0069502415135502815, -0.06743041425943375, 0.01977449283003807, 0.01659609004855156, 0.050009552389383316, -0.007065910845994949, -0.014473802410066128, 0.03526417538523674, -0.022952895611524582, -0.02381790429353714, -0.030838552862405777, -0.0354049913585186, -0.038321882486343384, 0.008428801782429218, -0.03305136412382126, 0.004242061171680689, 0.05290632322430611, 0.031421929597854614, -0.022691382095217705, 0.03339334577322006, -0.029048187658190727, -0.0024617533199489117, -0.01292483415454626, 0.05624565854668617, -0.06755111366510391, -0.049727920442819595, 0.03150239586830139, -0.009439654648303986, 0.007211755495518446, -0.08609850704669952, -0.02220858633518219, -0.036249883472919464, -0.105168916285038, 0.062320832163095474, -0.0034575187601149082, 0.0209211315959692, 0.049124427139759064, -0.01802435889840126, 0.03707465901970863, 0.0200259480625391, 0.09816838800907135, 0.038603510707616806, -0.08247753977775574, -0.0016533226007595658, 0.01561038289219141, 0.03808048367500305, 0.009183170273900032, 0.00899709202349186, 0.0013151144376024604, 0.011395981535315514, 0.05238329619169235, -0.010023032315075397, -0.05978615581989288, -0.004664507228881121, -0.009801751002669334, 0.048440467566251755, -0.03379567340016365, -0.030677620321512222, 0.013880366459488869, 0.03343357890844345, 0.0686374083161354, 0.024703027680516243, 0.09173111617565155, -0.0010988623835146427, 0.09792698919773102, 0.027117004618048668, -0.014383277855813503, 0.03347381204366684, 0.028665972873568535, -0.04514136537909508, 0.03357439488172531, -0.023294875398278236, 0.056124959141016006, -0.00330413063056767, -0.007176551502197981, -0.07825308293104172, 0.001968899741768837, 0.006547912023961544, 0.007438065949827433, 0.03132134675979614, 0.0286056250333786, 0.025024892762303352, 0.002407690277323127, -0.01156697142869234, 0.031663328409194946, -0.06175757199525833, -0.022047653794288635, -0.028545275330543518, 0.01909053325653076, 0.05278562381863594, -0.016103236004710197, 0.02510535717010498, -0.017873486503958702, -0.0032261793967336416, -0.0255680363625288, -0.05515936762094498, 0.045865558087825775, 0.031281113624572754, -0.051980964839458466, -0.009826896712183952, -0.0368332602083683, -0.027438869699835777, 0.0061707282438874245, 0.000878209772054106, -0.04807836934924126, 0.014916365034878254, 0.030878785997629166, 0.05797567591071129, 0.007126260548830032, -0.026835374534130096, 0.061355240643024445, 0.007005561608821154, -0.06123454496264458, 0.053268421441316605, -0.024159884080290794, -0.03520382568240166, 0.044899966567754745, 0.01738063246011734, 0.024803610518574715, -0.01745104044675827, -0.029349934309720993, -0.014051356352865696, -0.013266813941299915, 0.09325996786355972, 0.031140299513936043, 0.028404459357261658, -0.031421929597854614, 0.0011956728994846344, 0.02731817029416561, -0.07684492319822311, -0.011275283060967922, -0.00010961906082229689, -0.033815789967775345, 0.054837506264448166, 0.0582975372672081, 0.01802435889840126, 0.025346755981445312, -0.06413131207227707, 0.02546745538711548, -0.03456009924411774, -0.007956065237522125, -0.091570183634758, 0.006925095804035664, 0.01273372769355774, -0.04646905139088631, -0.00906750001013279, 0.007704609073698521, -0.022510332986712456, 0.026815257966518402, 0.009052412584424019, 0.04300902038812637, 0.014705142006278038, 0.04852093383669853, 0.040393877774477005, 0.049446288496255875, -0.0041540516540408134, 0.00936924759298563, -0.026935957372188568, 0.02910853549838066, -0.06308525800704956, 0.0346807986497879, 0.002044336637482047, 0.03351404517889023, 0.0024215204175561666, -0.10339867323637009, 0.030959252268075943, 0.037557452917099, 0.06425201147794724, -0.05379144847393036, -0.050009552389383316, -0.0041289059445261955, -0.04550345987081528, 0.000831061799544841, -0.005682903341948986, -0.02653362788259983, -0.048158835619688034, 0.06055058166384697, 0.10959454625844955, -0.027438869699835777, 0.0668671578168869, 0.003211091971024871, 0.005848864559084177, -0.016123352572321892, 0.0025925105437636375, 0.011587087996304035, -0.02528640627861023, 0.017330341041088104, 0.017732670530676842, 0.02110218070447445, 0.052624691277742386, 0.04856116697192192, -0.0336146242916584, 0.036893609911203384, 0.0482795350253582, 0.023717321455478668, -0.017038652673363686, -0.0514981709420681, -0.004377847537398338, -0.04373321309685707, -0.025588152930140495, -0.011727903969585896, -0.0026327434461563826, 0.011426156386733055, -0.04083643853664398, -0.011496564373373985, -0.027418753132224083, -0.0020267346408218145, 0.05572263151407242, 0.012009534053504467, -0.026332462206482887, 0.031240882351994514, -0.025688735768198967, -0.01351827010512352, 0.01709900237619877, -0.03212600573897362, -0.04097725450992584, 0.03136157989501953, 0.008549501188099384, -0.06775227934122086, 0.0002701579360291362, -0.015620441175997257, -0.02868608944118023, 0.05701008439064026, 0.006547912023961544, -0.006583115551620722, 0.03194496035575867, 0.02023717202246189, -0.041319236159324646, -0.007875598967075348, -0.02013658918440342, 0.007106143981218338, 0.006060087587684393, 0.019663851708173752, 0.03270938619971275, -0.009042354300618172, 0.008308103308081627, 0.06875810772180557, -0.02442139759659767, -0.013266813941299915, -0.002206525532528758, -0.018839076161384583, -0.001957584172487259, 0.022791963070631027, -0.028887255117297173, -0.0393478199839592, 0.003158286213874817, -0.021403927356004715, 0.013759667053818703, -0.027438869699835777, -0.022872429341077805, -0.0071614645421504974, -0.06827531009912491, 0.023294875398278236, 0.0371953584253788, 0.019754376262426376, -0.0008417486678808928, -0.00538115669041872, 0.03834199532866478, 0.02303336188197136, 0.038744326680898666, -0.05853893607854843, -0.03472103178501129, 0.05379144847393036, 0.047153010964393616, -0.06952252984046936, -0.01344786211848259, 0.014654850587248802, -0.028665972873568535, 0.05930336192250252, 0.007262046914547682, 0.023435691371560097, 0.005602437537163496, -0.04992908611893654, 0.0018771183677017689, 0.08609850704669952, 0.006402067374438047, -0.061516173183918, 0.01920117251574993, -0.028665972873568535, 0.037557452917099, -0.010983593761920929, 0.01774272881448269, 0.012773959897458553, 0.01577131450176239, -0.026614094153046608, -0.015087354928255081, -0.022128120064735413, 0.08682269603013992, 0.05141770467162132, -0.03995131328701973, 0.02924935147166252, 0.03757756948471069, 0.005401272792369127, -0.027298053726553917, 0.02446163073182106, 0.021665440872311592, -0.018195349723100662, -0.037678152322769165, 0.059343595057725906, 0.006744047626852989, -0.0008285472285933793, 0.008826102130115032, -0.025950249284505844, 0.05624565854668617, -0.011788252741098404, 0.02110218070447445, -0.018718378618359566, -0.04123876988887787, -0.10098469257354736, -0.052262596786022186, 0.010048178024590015, 0.009037325158715248, 0.03258868679404259, 0.0029269468504935503, -0.02506512589752674, 0.04073585569858551, -0.056849151849746704, 0.02078031562268734, -0.0475553423166275, -0.018547387793660164, -0.029450515285134315, 0.037175241857767105, -0.04461833834648132, 0.017189526930451393, 0.026593977585434914, -0.03319218009710312, -0.033312879502773285, 0.010631555691361427, -0.0005698619643226266, 0.04598625749349594, -0.04031341150403023, -0.04642881825566292, 0.008599791675806046, -0.015177878551185131, -0.015177878551185131, 0.02603071555495262, 0.015117528848350048, -0.011587087996304035, -0.025869784876704216, 0.0400518961250782, 0.00715140625834465, -0.018788784742355347, 0.012381688691675663, 0.0007122488459572196, -0.05443517491221428, 0.008695345371961594, 0.025306522846221924, -0.017692437395453453, -0.006321601569652557, -0.04156063124537468, 0.05849870294332504, -0.029349934309720993, -0.017119118943810463, -0.03999154642224312, -0.0033921401482075453, 0.033493928611278534, -0.09840978682041168, 0.045543693006038666, 0.004445740487426519, 0.04485973343253136, 0.005652728956192732, 0.01913076639175415, -0.008750665932893753, -0.046549517661333084, -0.00676919287070632, 0.031140299513936043, -0.06344735622406006, 0.0043149832636117935, 0.0729423314332962, 0.08312126249074936, -0.056165192276239395, -0.030657503753900528, 0.017531506717205048, -0.010712021961808205, -0.0026075977366417646, -0.02796189673244953, -0.009806780144572258, 0.014795665629208088, 0.014433569274842739, -0.03614930063486099, -0.022932779043912888, -0.019080474972724915, 0.01641504094004631, -0.050693511962890625, 0.0004403621715027839, -0.02546745538711548, -0.013669143430888653, 0.03476126492023468, 0.1198137104511261, -0.041359469294548035, -0.009736373089253902, -0.008262841030955315, -0.0035731885582208633, 0.006422183942049742, -0.053630515933036804, -0.03938805311918259, 0.012291165068745613, -0.08344312757253647, -0.01866808719933033, -0.05994708836078644, -0.027519334107637405, -0.04884279519319534, 0.02731817029416561, -0.02584966830909252, 0.03536475822329521, 0.001756419544108212, 0.05206143110990524, 0.0046418760903179646, 0.0073676579631865025, -0.015077296644449234, 0.0010083381785079837, -0.007659346796572208, -0.019804667681455612, -0.014242462813854218, -0.031059833243489265, -0.010581264272332191, 0.006075175013393164, 0.025024892762303352, 0.037859201431274414, 0.0286056250333786, -0.024562213569879532, 0.037356290966272354, -0.03940816968679428, 0.0015678276540711522, 0.026593977585434914, -0.009590527974069118, 0.03293066471815109, 0.04727371037006378, 0.05182003229856491, -0.043330881744623184, 0.0036737709306180477, -0.006200902629643679, 0.022449983283877373, 0.07394815236330032, -0.028122829273343086, -0.011043943464756012, -0.04530229791998863, 0.0036813144106417894, 0.02699630707502365, 0.009409479796886444, -0.06855694204568863, -0.029370050877332687, -0.04638858512043953, 0.047836970537900925, 0.016817370429635048, 0.0004994543269276619, -0.005320806987583637, -0.053630515933036804, -0.019181055948138237, -0.011959242634475231, 0.0027936750557273626, 0.0187787264585495, -0.008177346549928188, 0.010380099527537823, 0.03458021581172943, 0.0030954221729189157, -0.01902012526988983, 0.01802435889840126, 0.018316049128770828, -0.029068302363157272, -0.030778203159570694, -0.004015750717371702, 0.013830075040459633, 0.010274488478899002, 0.03458021581172943, -0.06143570691347122, -0.047153010964393616, -0.030737970024347305, 0.025165706872940063, -0.06252199411392212, -0.0003135340812150389, -0.00847406405955553, -0.048440467566251755, 0.008720491081476212, 0.01012361515313387, 0.06143570691347122, 0.009052412584424019, -0.0339767225086689, 0.01698836125433445, -0.021967187523841858, 0.0029244322795420885, 0.02442139759659767, 0.027660150080919266, -0.021906839683651924, 0.04622765630483627, 0.0057130781933665276, 0.02997354418039322, -0.04980838671326637, -0.01190895214676857, 0.031160416081547737, -0.0013943230733275414, -0.009132878854870796, 0.014353103004395962, 0.01598253846168518, -0.01799418404698372, -0.033996839076280594, 0.012482271529734135, -0.007910802960395813, 0.02707677148282528, -0.010274488478899002, 0.025668619200587273, 0.029490748420357704, 0.009188199415802956, -0.01895977556705475, 0.016958186402916908, -0.0031884608324617147, 0.052584458142519, 0.032387521117925644, 0.0036813144106417894, 0.045181598514318466, 0.0035882757510989904, 0.04896349459886551, -0.023154059424996376, -0.027197470888495445, -0.0024353505577892065, 0.05821707099676132, -0.04369297996163368, -0.02082054875791073, 0.038462694734334946, -0.023616738617420197, 0.07278139889240265, -0.027197470888495445, -0.009117791429162025, 0.0025673648342490196, 0.06747064739465714, -0.09430602192878723, 0.019804667681455612, -0.04385391250252724, -0.07274116575717926, -0.09663953632116318, -0.0025585638359189034, -0.057774510234594345, 0.09358183294534683, 0.04123876988887787, -0.012009534053504467, 0.0009580469923093915, 0.023878253996372223, 0.010661730542778969 ]
716,823
pytorch_optimizer.optimizer.lars
__init__
null
def __init__( self, params: PARAMETERS, lr: float = 1e-3, weight_decay: float = 0.0, momentum: float = 0.9, dampening: float = 0.0, trust_coefficient: float = 1e-3, nesterov: bool = False, ): self.validate_learning_rate(lr) self.validate_non_negative(weight_decay, 'weight_decay') self.validate_range(momentum, 'momentum', 0.0, 1.0) self.validate_range(dampening, 'dampening', 0.0, 1.0) self.validate_non_negative(trust_coefficient, 'trust_coefficient') defaults: DEFAULTS = { 'lr': lr, 'weight_decay': weight_decay, 'momentum': momentum, 'dampening': dampening, 'trust_coefficient': trust_coefficient, 'nesterov': nesterov, } super().__init__(params, defaults)
(self, params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], lr: float = 0.001, weight_decay: float = 0.0, momentum: float = 0.9, dampening: float = 0.0, trust_coefficient: float = 0.001, nesterov: bool = False)
[ 0.0009437057306058705, 0.004122041165828705, 0.011767875403165817, -0.00027111746021546423, -0.03175637125968933, -0.025975661352276802, -0.08280680328607559, -0.02409880794584751, -0.006944360211491585, 0.04275473952293396, -0.043467942625284195, 0.05424108728766441, 0.023535750806331635, 0.07912816852331161, -0.014282859861850739, 0.04448144510388374, 0.01161772757768631, 0.010407156310975552, -0.017877036705613136, 0.0001834331633290276, -0.009374886751174927, -0.03275110572576523, -0.005902706179767847, 0.10315190255641937, -0.0080282436683774, 0.029128776863217354, -0.01824302226305008, -0.0028880094178020954, -0.04710904136300087, -0.003704441012814641, -0.014714536257088184, -0.02057032100856304, -0.0034017981961369514, 0.08956348150968552, 0.052364230155944824, -0.02094569243490696, -0.05562995746731758, 0.0023836048785597086, -0.10037416219711304, 0.050149545073509216, 0.025262456387281418, -0.024004964157938957, 0.06328752636909485, -0.02424895577132702, -0.02135859988629818, 0.0072634257376194, 0.04917357861995697, 0.04729672521352768, -0.007000666111707687, -0.03344554081559181, -0.011467578820884228, 0.009440576657652855, 0.01840255595743656, -0.039526548236608505, -0.04252951592206955, 0.02886601723730564, 0.058820609003305435, 0.022691166028380394, 0.03188775107264519, 0.007380729075521231, 0.012162014842033386, -0.042416904121637344, 0.019800812005996704, -0.007113277446478605, -0.02302900142967701, 0.012077556923031807, -0.09459345042705536, -0.0071367379277944565, 0.03582914546132088, 0.04069019854068756, 0.10825695097446442, -0.0063156140968203545, -0.008093933574855328, 0.014273475855588913, 0.016825998201966286, -0.004861052148044109, -0.11231095343828201, -0.029560452327132225, -0.024980928748846054, 0.0016962069785222411, 0.039301324635744095, 0.040765274316072464, -0.02362959459424019, -0.014273475855588913, 0.013926258310675621, -0.033088937401771545, -0.06062239035964012, -0.06715384125709534, 0.016347398981451988, 0.008943210355937481, -0.045757703483104706, 0.005208270158618689, -0.009515650570392609, -0.05454138293862343, 0.07905309647321701, 0.03305140137672424, 0.012884603813290596, -0.04343040660023689, 0.009975479915738106, -0.015399588271975517, -0.011889871209859848, 0.034327663481235504, -0.02224072255194187, -0.0006744944839738309, 0.033295392990112305, -0.0238360483199358, -0.0663280263543129, -0.008187776431441307, 0.0310994740575552, -0.0279838964343071, -0.04249197989702225, 0.04481927677989006, -0.05480414256453514, 0.01888115331530571, -0.04602046310901642, 0.027495913207530975, 0.03982684388756752, 0.010866985656321049, 0.004506796132773161, 0.010228855535387993, 0.03751831501722336, 0.03504086658358574, -0.04861052334308624, 0.02717684768140316, 0.02051401697099209, -0.020232487469911575, -0.00891505740582943, 0.013203669339418411, 0.04459405690431595, -0.03427135571837425, 0.02924138866364956, -0.0228037778288126, -0.02404250204563141, -0.009815947152674198, 0.008943210355937481, -0.04373070225119591, 0.015202518552541733, 0.05202639847993851, -0.01347581297159195, 0.013869952410459518, 0.052364230155944824, 0.02244717627763748, 0.05495429039001465, 0.012649997137486935, -0.017257673665881157, -0.0058933221735060215, -0.04710904136300087, -0.0020586743485182524, 0.0155497370287776, 0.03695525974035263, 0.02224072255194187, 0.015146213583648205, 0.014339165762066841, 0.023479444906115532, 0.025468911975622177, -0.03611067309975624, 0.02032633125782013, -0.058220017701387405, 0.013391354121267796, 0.015521584078669548, -0.04628322273492813, -0.004173654597252607, 0.018496397882699966, -0.01702306792140007, -0.00893382541835308, -0.0013454698491841555, -0.024999696761369705, -0.00502527691423893, -0.005438184831291437, -0.00637661200016737, -0.01566234789788723, -0.10119997709989548, -0.03567899763584137, 0.033933524042367935, -0.003943739924579859, 0.06264939159154892, 0.009618877433240414, 0.003784207161515951, -0.0372743234038353, 0.004086849745362997, 0.04609553888440132, -0.009539111517369747, -0.013879336416721344, -0.08228128403425217, 0.02344190888106823, 0.007939092814922333, -0.0497366338968277, 0.05709390342235565, -0.050524912774562836, 0.030761640518903732, 0.06726645678281784, -0.00014435648336075246, 0.0005205337656661868, 0.04215414449572563, -0.012321547605097294, 0.01731397956609726, 0.033914756029844284, 0.0058229402638971806, 0.00709920097142458, 0.055517345666885376, 0.07214627414941788, 0.07079493999481201, 0.030799176543951035, -0.020213719457387924, 0.006770751439034939, -0.00514258025214076, -0.0456075556576252, 0.017060603946447372, -0.00797662977129221, -0.032863717526197433, 0.008361385203897953, -0.016131561249494553, 0.04508203640580177, 0.03138100355863571, 0.01077314279973507, -0.04286734759807587, 0.007549645844846964, 0.022916389629244804, 0.0003067483485210687, -0.034984562546014786, 0.08588484674692154, -0.03736816719174385, -0.009581340476870537, -0.003946085926145315, 0.04331779479980469, 0.02614457905292511, 0.03697402775287628, -0.06944360584020615, -0.06696615368127823, 0.045570019632577896, -0.022897621616721153, -0.027646061033010483, -0.022709935903549194, 0.01287521980702877, 0.041403401643037796, -0.00107684510294348, -0.035585153847932816, 0.029110008850693703, -0.07762669026851654, -0.03633589670062065, 0.026895320042967796, 0.006592450197786093, -0.018646545708179474, -0.01652570068836212, 0.01755797117948532, 0.016206635162234306, 0.042191680520772934, 0.02366713061928749, -0.037893686443567276, -0.010698068886995316, -0.017360901460051537, -0.01995095983147621, -0.01929406076669693, 0.05761942267417908, -0.034778106957674026, 0.04436883330345154, 0.025881819427013397, -0.005161349195986986, 0.020851850509643555, -0.01619725115597248, 0.003648135345429182, -0.005560180637985468, -0.0394139364361763, 0.08325725048780441, 0.012162014842033386, 0.0011354967718943954, -0.0023554519284516573, -0.010257008485496044, 0.029935823753476143, -0.01328812725841999, 0.10240116715431213, 0.017567355185747147, -0.011345583014190197, -0.0022932812571525574, -0.013569655828177929, -0.028134044259786606, -0.004588908515870571, -0.03027365729212761, -0.027083005756139755, 0.05150087922811508, 0.013625961728394032, -0.022165648639202118, 0.0002803551033139229, 0.022165648639202118, 0.00824408233165741, 0.007615335751324892, -0.008422383107244968, -0.006193618755787611, -0.0063156140968203545, 0.019218986853957176, -0.00561179406940937, 0.01524944044649601, 0.08791185170412064, -0.0011953215580433607, 0.07657565176486969, -0.03819398209452629, 0.028040200471878052, 0.0005483933491632342, 0.05540473386645317, -0.004907973576337099, 0.06865532696247101, -0.02698916383087635, 0.030742870643734932, -0.026275958865880966, -0.02445540949702263, -0.031606223434209824, 0.02117091417312622, 0.032694797962903976, 0.045119576156139374, 0.03250711411237717, 0.031868983060121536, 0.015033601783216, 0.02325422316789627, 0.02719561755657196, 0.04602046310901642, -0.06741660088300705, 0.003985968884080648, -0.06039716675877571, 0.050562452524900436, 0.046996429562568665, 0.027890052646398544, 0.02301023155450821, 0.019096991047263145, -0.0020434248726814985, -0.05555488169193268, -0.07785191386938095, 0.029372768476605415, 0.031662531197071075, -0.043693166226148605, -0.006362535525113344, -0.013757341541349888, -0.027852516621351242, 0.011232972145080566, -0.033070169389247894, -0.056756071746349335, 0.006174850277602673, 0.014555004425346851, 0.08055458217859268, -0.003448719624429941, -0.010820064693689346, 0.07387298345565796, -0.020701700821518898, -0.02426772378385067, 0.036223284900188446, -0.015559121035039425, -0.05544227361679077, 0.003758400445804, -0.03190651908516884, 0.034534115344285965, -0.022090572863817215, -0.013569655828177929, 0.00932796485722065, 0.00637661200016737, 0.0745486468076706, 0.029804443940520287, -0.009088666178286076, -0.008605376817286015, 0.0114018889144063, 0.012518617324531078, -0.07083247601985931, -0.045757703483104706, -0.010435309261083603, -0.02946661040186882, 0.04868559539318085, 0.009506266564130783, -0.002796512795612216, 0.04091542214155197, -0.031249621883034706, 0.03338923677802086, 0.01317551638931036, -0.005100351292639971, -0.11080946773290634, -0.021640129387378693, -0.01652570068836212, 0.042191680520772934, -0.019575588405132294, -0.033727068454027176, -0.003936701454222202, 0.04519464820623398, -0.01722952164709568, -0.00903705321252346, 0.019782042130827904, 0.04609553888440132, 0.01951928250491619, -0.002728476654738188, -0.014067022129893303, -0.006371919997036457, 0.05059998854994774, 0.05754435062408447, -0.026670098304748535, -0.012640613131225109, 0.00048270344268530607, 0.03481564670801163, -0.0076341042295098305, -0.06373796612024307, 0.05431615933775902, 0.015118060633540154, 0.0311370100826025, -0.05795725807547569, -0.04526972398161888, -0.026482412591576576, -0.04816007986664772, 0.0016563237877562642, 0.04065266251564026, -0.005874553695321083, -0.0010715664830058813, 0.006873978301882744, 0.033914756029844284, 0.017379669472575188, 0.037255555391311646, 0.01832748018205166, -0.0207204706966877, -0.03261972591280937, 0.017783192917704582, -0.013391354121267796, -0.03282617777585983, 0.002281550783663988, -0.009984863921999931, 0.045795243233442307, -0.020889386534690857, 0.022935157641768456, -0.023760974407196045, 0.06302476674318314, 0.030555186793208122, 0.05953381583094597, 0.041591089218854904, -0.01817733235657215, 0.02199673093855381, -0.019875885918736458, -0.04436883330345154, -0.045119576156139374, 0.03648604452610016, -0.030855482444167137, -0.037067871540784836, 0.025787975639104843, -0.006573681719601154, -0.008328540250658989, 0.011467578820884228, 0.0038874342571944, -0.01234031654894352, -0.008164315484464169, -0.05825755372643471, 0.012584307231009007, -0.012903372757136822, -0.03693649172782898, -0.012284010648727417, 0.0037630926817655563, 0.018214870244264603, -0.03918871656060219, -0.028565719723701477, 0.018599625676870346, -0.010660531930625439, 0.032694797962903976, -0.026182115077972412, -0.035810377448797226, -0.008910365402698517, -0.024211419746279716, -0.005058121867477894, 0.045757703483104706, -0.01305352058261633, 0.023329297080636024, -0.012434158474206924, -0.01933159865438938, -0.010294545441865921, -0.05225161835551262, 0.0331827811896801, 0.04309257119894028, -0.026857784017920494, 0.002321433974429965, 0.0010721529833972454, 0.0013349124928936362, 0.00240941159427166, 0.02614457905292511, -0.024399103596806526, -0.03295755758881569, 0.035979293286800385, -0.0332203172147274, -0.04793485626578331, 0.019153296947479248, -0.009919174015522003, -0.010350850410759449, -0.03851304575800896, 0.0311370100826025, 0.078752800822258, 0.006883362773805857, -0.03778107464313507, -0.06996912509202957, -0.006601834669709206, 0.02575043961405754, 0.03614821285009384, -0.054916754364967346, -0.022991463541984558, 0.03590422123670578, 0.03027365729212761, -0.023479444906115532, -0.006404764950275421, 0.011082824319601059, 0.007549645844846964, 0.028265424072742462, 0.015652963891625404, 0.013860568404197693, -0.002217033877968788, -0.040577586740255356, -0.0024375643115490675, 0.039338864386081696, -0.005926167126744986, -0.1036023497581482, 0.03719925135374069, -0.015305745415389538, 0.005006508436053991, 0.017717503011226654, 0.02468063309788704, -0.007713870611041784, 0.016516316682100296, -0.04688381776213646, -0.0456075556576252, -0.045157112181186676, 0.09909790009260178, 0.012537386268377304, -0.011692801490426064, 0.06351274251937866, 0.04628322273492813, 0.033257856965065, -0.04688381776213646, 0.022165648639202118, 0.045982927083969116, -0.016647696495056152, -0.029785675927996635, 0.07342253625392914, 0.03507840633392334, -0.00633438304066658, -0.04737180098891258, -0.04395592585206032, 0.059233516454696655, -0.025056002661585808, 0.037462010979652405, 0.029729370027780533, -0.01305352058261633, -0.02633226476609707, -0.034947026520967484, 0.014264091849327087, 0.012978446669876575, 0.03791245445609093, -0.004051658790558577, 0.0023308182135224342, 0.005381879396736622, -0.04391838610172272, 0.05878307297825813, -0.07184597849845886, -0.010707452893257141, 0.00147802266292274, -0.029841981828212738, -0.038306593894958496, 0.014967911876738071, 0.035585153847932816, -0.0007442900096066296, 0.02323545515537262, -0.012462311424314976, 0.04744687303900719, 0.05544227361679077, -0.02839680388569832, -0.03245081007480621, -0.01652570068836212, 0.0008557282271794975, -0.016657080501317978, 0.006231155712157488, -0.008117394521832466, -0.047221649438142776, -0.09369256347417831, 0.01807410642504692, 0.003814706113189459, 0.013062904588878155, 0.026463644579052925, 0.038888417184352875, -0.06816734373569489, 0.033314161002635956, 0.0004821169131901115, 0.024342797696590424, -0.014986680820584297, -0.04245444014668465, -0.0032164589501917362, -0.02633226476609707, -0.08948840945959091, -0.08258158713579178, -0.011364351958036423, -0.006404764950275421, -0.06324998289346695, 0.006226463709026575, -0.019594358280301094, 0.004375416319817305, 0.03419628366827965, 0.012771992944180965, -0.0372743234038353, -0.014798995107412338, -0.01989465393126011, 0.00857253186404705, -0.034552887082099915, -0.02321668528020382, 0.07574983686208725, 0.04418114572763443, -0.09286674112081528, -0.008211237378418446, 0.0321505106985569, -0.015080523677170277, 0.013457044027745724, -0.02015741355717182, -0.024736937135457993, 0.044931888580322266, 0.009271659888327122, -0.042191680520772934, 0.01745474338531494, -0.03406490385532379, -0.014395471662282944, -0.042003996670246124, 0.026444874703884125, -0.02036386728286743, -0.042041532695293427, 0.03680511191487312, 0.06478900462388992, -0.041403401643037796, 0.020833080634474754, -0.012471696361899376, -0.0043683783151209354, 0.021095840260386467, -0.1017254963517189, -0.042191680520772934, 0.007732639089226723, -0.1015753448009491, -0.0037091330159455538, -0.05934612825512886, 0.0077748685143888, -0.03903856500983238, -0.01813979633152485, -0.0685427114367485, 0.011767875403165817, 0.02346067689359188, 0.03582914546132088, 0.0031789217609912157, 0.059045832604169846, 0.0032352274283766747, 0.0026041350793093443, 0.06159835308790207, 0.00025645451387390494, -0.012725071050226688, -0.04102803394198418, -0.023141611367464066, -0.025487679988145828, 0.019838348031044006, 0.03960162401199341, 0.013569655828177929, -0.01194617711007595, 0.050112005323171616, -0.024361567571759224, 0.015484047122299671, -0.019406672567129135, -0.006146697327494621, 0.023760974407196045, 0.014020100235939026, 0.06674093753099442, -0.03836289793252945, -0.0016774383839219809, 0.005259883590042591, 0.03776230663061142, 0.03776230663061142, 0.03280740976333618, 0.009140280075371265, -0.03275110572576523, 0.004337879363447428, -0.02323545515537262, -0.013306896202266216, -0.020833080634474754, -0.015756191685795784, -0.005560180637985468, 0.04373070225119591, 0.04174123704433441, -0.0020926923025399446, -0.06677847355604172, -0.029597990214824677, -0.009332657791674137, -0.023779742419719696, 0.03671126812696457, 0.021827813237905502, 0.00477190176025033, -0.047822244465351105, 0.011176666244864464, 0.0005486865993589163, -0.06730399280786514, 0.020851850509643555, -0.03430889546871185, -0.038700733333826065, -0.07102016359567642, -0.02175273932516575, 0.003962508402764797, 0.000040359696868108585, 0.046771205961704254, -0.06978143751621246, -0.07428588718175888, -0.036223284900188446, 0.005794787313789129, -0.020701700821518898, -0.021227220073342323, 0.0048563601449131966, -0.061936188489198685, 0.03648604452610016, -0.012115093879401684, 0.0353223942220211, 0.01007870677858591, -0.01325997430831194, 0.02657625451683998, -0.0623115599155426, 0.03877580538392067, 0.023066537454724312, 0.03652358055114746, -0.06501422822475433, -0.001244588871486485, 0.038925956934690475, 0.052401769906282425, -0.01828056015074253, -0.036373432725667953, -0.0238735843449831, 0.013353817164897919, -0.04707150161266327, -0.0027495913673192263, 0.006160773802548647, 0.016131561249494553, -0.0497366338968277, -0.03990191966295242, 0.0032844948582351208, 0.059646423906087875, -0.0394890122115612, 0.021527517586946487, -0.0011818315833806992, 0.0036012139171361923, -0.03153115138411522, 0.0054991827346384525, -0.0196882002055645, 0.04714657738804817, 0.020833080634474754, 0.03500333055853844, 0.05101289600133896, 0.02036386728286743, 0.05769449844956398, -0.047184113413095474, -0.03470303490757942, 0.014583157375454903, 0.07154568284749985, -0.004084503743797541, -0.05086274817585945, 0.08633529394865036, 0.008675758726894855, 0.0029841980431228876, -0.023704668506979942, 0.012950293719768524, 0.012509233318269253, 0.049699097871780396, -0.028490645810961723, 0.013766725547611713, -0.023104075342416763, -0.07297208905220032, -0.07950354367494583, -0.011035902425646782, -0.07102016359567642, 0.05367802828550339, 0.018580855801701546, 0.00011657024151645601, 0.04320518299937248, 0.07203366607427597, 0.019200218841433525 ]
716,826
pytorch_optimizer.optimizer.lars
__str__
null
def __str__(self) -> str: return 'Lars'
(self) -> str
[ 0.014626202173531055, -0.03577582910656929, 0.02617952972650528, -0.004094306845217943, 0.020085277035832405, -0.07258167117834091, 0.021441463381052017, 0.02130412869155407, 0.0924266129732132, -0.04638497531414032, -0.05108870565891266, -0.01800808310508728, -0.007231558207422495, 0.03287462145090103, 0.010265808552503586, 0.00407928554341197, -0.0332522951066494, -0.05534609779715538, -0.005643619690090418, 0.018763426691293716, 0.0190209299325943, 0.0391748771071434, 0.049646686762571335, -0.019364267587661743, -0.02075478807091713, 0.06317421048879623, -0.008029819466173649, -0.00666075898334384, -0.03890020400285721, 0.01800808310508728, 0.0016619708621874452, -0.05119170993566513, 0.008613494224846363, 0.007437561172991991, -0.055552102625370026, 0.013330101035535336, -0.050264693796634674, 0.017578909173607826, -0.008497617207467556, -0.020342782139778137, -0.004147953353822231, 0.049646686762571335, -0.01864325813949108, -0.04260825738310814, -0.04051389545202255, -0.02358732558786869, 0.0012735696509480476, 0.0332522951066494, -0.00899545755237341, 0.00025777178234420717, 0.011493242345750332, 0.02538985200226307, -0.04102890193462372, -0.024411337450146675, -0.008154279552400112, 0.003856115974485874, 0.043981608003377914, 0.015536048449575901, -0.01563904993236065, 0.03296045586466789, -0.025767523795366287, -0.021870635449886322, 0.03490031510591507, -0.025681689381599426, -0.009158543311059475, -0.01187091413885355, 0.007059889379888773, 0.040376558899879456, 0.0474836565554142, 0.03450547903776169, 0.04394727572798729, -0.035569824278354645, -0.007098515052348375, 0.03428230807185173, 0.01888359524309635, -0.012411671690642834, -0.10149073600769043, -0.010677814483642578, 0.04116623476147652, -0.025681689381599426, 0.0014012485044077039, -0.0005713360151275992, -0.023312656208872795, -0.0024012206122279167, -0.040376558899879456, -0.07677039504051208, -0.04030789062380791, -0.06365487724542618, -0.003010645741596818, 0.012643424794077873, -0.057509128004312515, 0.019158264622092247, -0.025527186691761017, 0.048307668417692184, -0.07107098400592804, -0.00396984675899148, 0.033990468829870224, -0.07127698510885239, 0.043912939727306366, 0.045183293521404266, 0.011398824863135815, 0.030951928347349167, -0.0026501407846808434, 0.03088326007127762, -0.0660925805568695, -0.017887914553284645, -0.04944068565964699, 0.01647164486348629, -0.002959145000204444, 0.01919259876012802, -0.03405913710594177, 0.010437477380037308, 0.015244211070239544, 0.02947557531297207, -0.012609091587364674, -0.04968101903796196, -0.021887803450226784, -0.017046736553311348, 0.03996455296874046, -0.032273780554533005, 0.029544241726398468, -0.0010815149871632457, -0.0528397299349308, -0.01544163003563881, 0.0476209931075573, 0.07828108221292496, -0.053183067589998245, -0.031106431037187576, 0.026780370622873306, -0.01368202269077301, 0.049406349658966064, 0.02255731262266636, -0.07278767228126526, -0.016677647829055786, 0.10533612221479416, -0.008218655362725258, 0.004137224052101374, 0.03215361014008522, 0.06204119324684143, 0.1359618753194809, -0.00821436382830143, -0.001879776013083756, 0.0689079537987709, 0.03618783503770828, -0.02240280993282795, 0.010428894311189651, -0.02870306372642517, 0.05095137283205986, -0.035020485520362854, 0.006652175448834896, 0.027329711243510246, 0.0432606004178524, 0.0641012191772461, 0.009012624621391296, -0.002710225060582161, 0.008677870035171509, -0.032754454761743546, -0.05077970400452614, 0.05967215821146965, -0.02925240434706211, -0.005231614224612713, -0.06629858165979385, -0.005690828897058964, -0.022196806967258453, -0.009956804104149342, 0.03496898338198662, -0.014085444621741772, 0.024033665657043457, 0.020462950691580772, 0.02084062248468399, -0.02822239138185978, -0.059397488832473755, -0.083980493247509, 0.02193930372595787, 0.003948388155549765, 0.05534609779715538, 0.0017939414829015732, 0.08089045435190201, 0.03512348607182503, -0.024548672139644623, -0.005102862138301134, -0.03924354165792465, -0.0339561365544796, 0.0077165234833955765, 0.07944843173027039, -0.04789566248655319, 0.0038003234658390284, 0.04542362689971924, 0.03057425655424595, 0.005334615707397461, -0.013415935449302197, 0.006858178414404392, -0.049166012555360794, 0.012257169932126999, -0.022042304277420044, -0.035020485520362854, 0.020634619519114494, -0.05658211559057236, -0.007373185362666845, 0.0009093094849959016, -0.0016952317673712969, 0.06416989117860794, -0.03924354165792465, 0.020771954208612442, 0.04813599959015846, 0.02255731262266636, 0.001659825094975531, -0.006257336586713791, 0.0046822731383144855, -0.056650783866643906, 0.04631630703806877, 0.03217078000307083, -0.02949274145066738, 0.01640297658741474, 0.039037540555000305, -0.07800640910863876, -0.012042582966387272, -0.025904858484864235, -0.0061672101728618145, 0.025922024622559547, 0.08034110814332962, -0.0149352066218853, -0.03136393427848816, -0.016883650794625282, -0.041784245520830154, 0.009656383655965328, 0.00656204903498292, -0.025664521381258965, -0.0015675529139116406, -0.02013677917420864, -0.018746258690953255, -0.06839294731616974, -0.004429061431437731, 0.017046736553311348, -0.014643369242548943, 0.014763537794351578, -0.03083175979554653, 0.01816258393228054, -0.07855575531721115, -0.03476298227906227, -0.010506145656108856, 0.013750690035521984, -0.01972477324306965, 0.0006534152780659497, 0.02602502703666687, -0.035260822623968124, -0.009167127311229706, 0.04291725903749466, -0.026299696415662766, -0.025338349863886833, 0.03186177462339401, -0.04411894455552101, 0.006626424845308065, 0.00251709739677608, 0.021956469863653183, -0.06774060428142548, -0.023484325036406517, 0.009862386621534824, 0.02082345448434353, -0.01497812382876873, -0.06132018193602562, 0.021647466346621513, -0.038316529244184494, 0.04017055407166481, -0.02624819613993168, 0.007776607759296894, -0.03402480483055115, 0.018179751932621002, 0.04803299903869629, -0.006785219069570303, 0.09998004883527756, 0.011742162518203259, -0.07333701848983765, 0.03625650331377983, -0.02626536414027214, -0.011330156587064266, -0.01594805344939232, 0.0350891537964344, -0.07546570897102356, -0.050436366349458694, -0.01270350906997919, -0.02971591055393219, 0.007613522000610828, 0.010076972655951977, 0.007424686104059219, -0.056410446763038635, 0.015278545208275318, -0.03096909448504448, -0.0030149375088512897, 0.01600813865661621, 0.06935429573059082, -0.006695092655718327, -0.017973748967051506, 0.01926126703619957, 0.07100231945514679, 0.01695231720805168, 0.029355406761169434, 0.03464281186461449, -0.009973971173167229, -0.04645364359021187, -0.021716134622693062, -0.021956469863653183, 0.015870802104473114, -0.020977957174181938, -0.02980174496769905, -0.031037762761116028, -0.015038208104670048, -0.0202912800014019, -0.007124265190213919, 0.02382766269147396, -0.018059583380818367, 0.04435928165912628, 0.022608812898397446, 0.06451322883367538, 0.017098236829042435, 0.0728563442826271, -0.012626257725059986, 0.0019012346165254712, 0.0166261475533247, 0.05235905945301056, -0.026042193174362183, -0.009656383655965328, -0.05582677200436592, 0.002984895370900631, 0.01238592155277729, -0.025750355795025826, -0.04820466786623001, 0.07278767228126526, 0.019141098484396935, 0.02648853324353695, -0.032599952071905136, -0.045320626348257065, 0.025424184277653694, -0.015012457966804504, -0.01136449072510004, 0.006111417897045612, 0.019055264070630074, -0.00979371927678585, -0.019089598208665848, -0.04380993917584419, 0.09125926345586777, -0.014480283483862877, -0.04168124496936798, 0.032599952071905136, 0.028239557519555092, 0.05301139876246452, -0.030642924830317497, -0.005810996983200312, 0.03752685338258743, 0.030848927795886993, -0.02138996310532093, -0.037698522210121155, 0.00024999305605888367, -0.007132848724722862, 0.00024154370476026088, 0.0009597372263669968, -0.009493297897279263, 0.06008416414260864, -0.03615349903702736, 0.009725051000714302, -0.01878059282898903, -0.06870195269584656, 0.013896608725190163, 0.036977510899305344, -0.02145862951874733, 0.0031994818709790707, 0.028479894623160362, -0.016214141622185707, 0.03787019103765488, -0.03066009096801281, -0.016291392967104912, 0.005879664793610573, -0.044771287590265274, -0.01261767465621233, -0.02877173200249672, 0.07450436800718307, 0.06351754814386368, 0.02540701813995838, -0.05259939283132553, -0.03153560310602188, 0.04882267490029335, -0.012282920069992542, 0.03114076517522335, 0.04538929462432861, 0.02035994827747345, -0.006823844276368618, 0.017398657277226448, 0.006227294448763132, -0.01234300434589386, -0.0030192292761057615, -0.0003618461487349123, -0.028325391933321953, 0.013862275518476963, -0.00847615860402584, -0.039758551865816116, -0.05895115062594414, -0.031260933727025986, -0.0318446084856987, -0.04308892786502838, 0.0405825600028038, 0.04209325090050697, -0.030368253588676453, -0.021424297243356705, -0.009295878931879997, -0.05744045972824097, 0.06842727959156036, 0.01611972227692604, 0.006733718328177929, -0.06004983186721802, -0.0053818244487047195, 0.03694317862391472, -0.003429089207202196, -0.04954368621110916, -0.07374902069568634, 0.08308781683444977, 0.005995541345328093, 0.01854025572538376, 0.004944068379700184, 0.007107098121196032, 0.013072597794234753, -0.05596410855650902, 0.02375899627804756, 0.05761213228106499, 0.09668400138616562, 0.022110972553491592, 0.04291725903749466, 0.029887579381465912, 0.036531172692775726, 0.07141432166099548, -0.020462950691580772, -0.028256723657250404, 0.010969651862978935, -0.025922024622559547, -0.02123546041548252, 0.03742385283112526, -0.038179196417331696, 0.01442019920796156, -0.03151843696832657, -0.047208987176418304, 0.027879051864147186, 0.033286627382040024, -0.05850480869412422, -0.0069826385006308556, 0.05187838524580002, -0.0028261016122996807, -0.04676264524459839, -0.05246206000447273, 0.003229523776099086, 0.0569254532456398, 0.0010015815496444702, -0.02327832207083702, 0.034471143037080765, 0.003353983862325549, -0.015956638380885124, 0.04597296938300133, -0.01831708662211895, 0.009819469414651394, -0.06592091172933578, 0.005501993000507355, -0.007450436241924763, -0.05225605517625809, 0.04968101903796196, -0.0004970355075784028, 0.032737284898757935, 0.021990804001688957, 0.020171113312244415, -0.02090928889811039, 0.029921913519501686, -0.04205891489982605, -0.009879553690552711, 0.03237678110599518, -0.00932162906974554, -0.009184293448925018, -0.017956580966711044, 0.0008937519742175937, 0.049887023866176605, -0.04442794993519783, -0.005137196276336908, -0.02248864434659481, -0.04841066896915436, -0.05936315655708313, -0.021578798070549965, -0.005746621172875166, 0.046728312969207764, -0.0038239278364926577, 0.012454588897526264, 0.003843240672722459, 0.037629853934049606, -0.01572488434612751, 0.022368475794792175, 0.008815205655992031, 0.03766418620944023, -0.049646686762571335, -0.03421363979578018, -0.03505481779575348, 0.045629631727933884, -0.018042417243123055, -0.015544631518423557, -0.08734520524740219, 0.026780370622873306, 0.01950160227715969, -0.01325284969061613, 0.006223002914339304, 0.0013057576725259423, 0.04954368621110916, -0.0283940602093935, 0.02508084662258625, -0.0008894602069631219, -0.018265586346387863, -0.028754564002156258, 0.002205947181209922, -0.041475240141153336, 0.05081403627991676, -0.002407658379524946, -0.0010257224785163999, -0.010566229932010174, -0.012205668725073338, 0.030213750898838043, 0.008823788724839687, 0.03201627731323242, -0.021716134622693062, -0.033286627382040024, -0.019295601174235344, -0.05277106538414955, -0.004321767948567867, 0.033217959105968475, -0.016523145139217377, 0.01950160227715969, -0.012059750035405159, 0.09064125269651413, -0.007454728242009878, 0.04027355834841728, -0.0007671460043638945, 0.03143260255455971, -0.020411448553204536, 0.09771402180194855, -0.1027267575263977, 0.0352264866232872, 0.01854025572538376, 0.025492852553725243, 0.02664303593337536, -0.03560416027903557, 0.00686246994882822, -0.034711480140686035, 0.006291670259088278, -0.042264919728040695, -0.033767301589250565, -0.00026689170044846833, 0.014918039552867413, 0.011021152138710022, 0.007175765931606293, -0.031020596623420715, -0.03828219696879387, -0.05150071159005165, -0.00927012786269188, 0.02123546041548252, -0.009441797621548176, 0.01871192641556263, 0.04113190248608589, 0.033990468829870224, -0.015905136242508888, 0.004815316759049892, 0.07498503476381302, 0.01950160227715969, 0.03886587172746658, 0.0543847531080246, -0.014763537794351578, 0.017098236829042435, 0.01325284969061613, -0.05218739062547684, 0.019947942346334457, -0.04569830000400543, 0.0317072719335556, 0.05229039117693901, -0.0756717175245285, 0.06564623862504959, 0.03896887227892876, 0.015750635415315628, -0.02690053917467594, 0.01466053631156683, -0.02918373793363571, 0.0594661571085453, -0.002144790021702647, -0.04844500496983528, -0.031415436416864395, -0.0049054427072405815, -0.021183960139751434, -0.00018253247253596783, 0.011209988035261631, -0.028033554553985596, -0.0202912800014019, 0.024583006277680397, -0.039277877658605576, -0.019038096070289612, 0.07052164524793625, -0.0755343809723854, 0.0026673078536987305, -0.031157931312918663, 0.023930665105581284, 0.01006838958710432, 0.044221945106983185, 0.017939414829015732, -0.013510353863239288, 0.037389516830444336, 0.07601505517959595, 0.042024582624435425, 0.017578909173607826, 0.021321294829249382, -0.027570048347115517, 0.015630466863512993, -0.042573921382427216, -0.02973307855427265, 0.02044578269124031, -0.042024582624435425, 0.0005257364246062934, -0.014059694483876228, 0.0502990297973156, -0.03144976869225502, -0.01415411289781332, -0.001422707224264741, -0.00225959368981421, 0.06272786855697632, -0.015707718208432198, 0.04490862041711807, -0.04535496234893799, -0.004703731741756201, -0.014085444621741772, -0.013038263656198978, 0.04590430110692978, -0.10094139724969864, 0.007986902259290218, -0.017398657277226448, 0.009913886897265911, -0.08095911890268326, -0.038488198071718216, 0.0059440406039357185, 0.02200797200202942, 0.028737397864460945, -0.013424519449472427, 0.029921913519501686, -0.026351198554039, 0.009476130828261375, -0.042264919728040695, 0.0541100837290287, -0.05235905945301056, 0.023449990898370743, -0.06389521807432175, -0.03287462145090103, -0.005613577552139759, -0.07292500883340836, -0.039106208831071854, 0.01769907772541046, -0.0202912800014019, 0.030694425106048584, -0.01187091413885355, -0.0019430789398029447, 0.003995596896857023, -0.006901095621287823, -0.023364156484603882, -0.021733300760388374, 0.018608924001455307, -0.03419647365808487, 0.006832427810877562, -0.01981060765683651, 0.08013510704040527, 0.015433046966791153, -0.0298704132437706, -0.041955914348363876, 0.012789343483746052, -0.044942956417798996, -0.00039993523387238383, 0.026368364691734314, 0.008441825397312641, -0.05225605517625809, -0.03019658476114273, 0.001058446941897273, 0.0031157932244241238, 0.007570604793727398, 0.07656439393758774, -0.052702397108078, 0.000751052051782608, -0.021750466898083687, -0.02312381938099861, -0.06056483834981918, 0.02815372310578823, 0.08926790207624435, -0.04871967434883118, 0.031072096899151802, 0.05321740359067917, -0.07450436800718307, -0.05510576069355011, -0.028909066691994667, -0.04164690896868706, 0.03318362683057785, 0.08741387724876404, 0.028428392484784126, -0.004107181914150715, -0.056959789246320724, 0.0017950143665075302, -0.004849650431424379, 0.02540701813995838, 0.0418529137969017, -0.018282752484083176, 0.004785274621099234, 0.007785191293805838, -0.0352264866232872, -0.019381435588002205, 0.0010734680108726025, 0.008368865586817265, -0.03364713117480278, 0.05654778331518173, 0.06784360855817795, -0.03347546234726906, -0.041955914348363876, 0.02595635876059532, -0.07086498290300369, 0.012205668725073338, 0.01340735238045454, -0.0039655547589063644, 0.028806066140532494, 0.020480116829276085, -0.009905303828418255, -0.01893509551882744, 0.004712315276265144, 0.052805397659540176, 0.049578018486499786, -0.015802135691046715, -0.029424073174595833, -0.060873843729496, -0.007338851690292358, 0.021681800484657288, 0.03191327676177025, -0.014952373690903187, 0.010840900242328644, 0.038076192140579224, -0.0038754285778850317, 0.02271181344985962, 0.02351865917444229, 0.07917375862598419, 0.03852253407239914, 0.02563018724322319, 0.03601616621017456, -0.0028368309140205383, -0.031260933727025986, 0.005609286017715931, 0.04188724607229233, 0.039586879312992096, 0.03680584207177162, -0.04425627738237381, 0.03512348607182503, 0.05479675903916359, 0.027226710692048073, -0.0054290336556732655, 0.024960678070783615, -0.0019709751941263676, -0.026831870898604393, -0.0020428616553545, 0.02420533448457718, -0.0012252877932041883, 0.010471811518073082, -0.017355740070343018, -0.03584449738264084, 0.031878940761089325, 0.008064153604209423, -0.00392049178481102, 0.03153560310602188, 0.00048576973495073617, 0.022385643795132637 ]
716,862
pytorch_optimizer.loss.ldam
LDAMLoss
LDAM Loss. :param num_class_list: List[int]. list of number of class. :param max_m: float. max margin (`C` term in the paper). :param weight: Optional[torch.Tensor]. class weight. :param s: float. scaler.
class LDAMLoss(nn.Module): r"""LDAM Loss. :param num_class_list: List[int]. list of number of class. :param max_m: float. max margin (`C` term in the paper). :param weight: Optional[torch.Tensor]. class weight. :param s: float. scaler. """ def __init__( self, num_class_list: List[int], max_m: float = 0.5, weight: Optional[torch.Tensor] = None, s: float = 30.0 ): super().__init__() cls_num_list = np.asarray(num_class_list) m_list = 1.0 / np.sqrt(np.sqrt(cls_num_list)) m_list *= max_m / np.max(m_list) self.m_list = torch.FloatTensor(m_list).unsqueeze(0) self.weight = weight self.s = s def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor: index = torch.zeros_like(y_pred, dtype=torch.bool) index.scatter_(1, y_true.view(-1, 1), 1) batch_m = torch.matmul(self.m_list.to(index.device), index.float().transpose(0, 1)) batch_m = batch_m.view((-1, 1)) x_m = y_pred - batch_m output = torch.where(index, x_m, y_pred) return cross_entropy(self.s * output, y_true, weight=self.weight)
(num_class_list: List[int], max_m: float = 0.5, weight: Optional[torch.Tensor] = None, s: float = 30.0)
[ -0.04325573146343231, -0.005801465827971697, 0.02428261563181877, 0.037110816687345505, 0.0236885454505682, 0.007179894484579563, -0.054171767085790634, -0.011556520126760006, -0.0022579305805265903, 0.016624681651592255, -0.038837332278490067, -0.007959611713886261, 0.07102850824594498, 0.04689440876245499, -0.008006023243069649, 0.029350776225328445, -0.002025872003287077, 0.012642554938793182, 0.01705166883766651, 0.004003011621534824, 0.005963907111436129, 0.024616779759526253, -0.003701335284858942, 0.03258103132247925, -0.06256300956010818, -0.03681378439068794, -0.009523686952888966, -0.015278740786015987, -0.046783022582530975, -0.01761789247393608, -0.03768632188439369, -0.014898165129125118, 0.036164019256830215, 0.0008620978333055973, 0.004836102016270161, -0.03421472758054733, 0.02775421366095543, -0.006381612736731768, -0.11094259470701218, -0.01268896646797657, 0.03495731204748154, -0.036386795341968536, 0.05146132409572601, 0.016856739297509193, -0.020365465432405472, 0.0033462855499237776, -0.03087308071553707, 0.033564962446689606, -0.06534771621227264, -0.016253387555480003, -0.015482952818274498, -0.05149845406413078, 0.022129110991954803, -0.009820722043514252, -0.0007570913294330239, 0.054691579192876816, 0.013784282840788364, -0.002575850812718272, 0.003986767493188381, -0.030483223497867584, 0.041213613003492355, -0.054246027022600174, 0.05261233448982239, 0.01008990965783596, 0.028756706044077873, -0.010554026812314987, -0.04039676859974861, 0.033602092415094376, 0.014517588540911674, 0.04035963863134384, -0.018666796386241913, -0.04745135083794594, 0.01268896646797657, 0.047042928636074066, 0.04503794014453888, 0.002652430208399892, -0.008256646804511547, -0.013338730670511723, -0.002617621561512351, 0.008878563530743122, 0.02090384252369404, -0.0244311336427927, -0.0034135826863348484, 0.035105831921100616, 0.014053471386432648, -0.09653639793395996, 0.01686602272093296, -0.025990568101406097, -0.010321968235075474, -0.036999430507421494, -0.0481196790933609, 0.041213613003492355, 0.022073417901992798, 0.004149208310991526, 0.014731082133948803, 0.0435156375169754, -0.008070999756455421, 0.012642554938793182, 0.006070653907954693, 0.0059174951165914536, 0.04295869544148445, 0.0744815394282341, 0.06375114619731903, 0.07110276818275452, 0.0064744362607598305, -0.05324353277683258, -0.030446093529462814, 0.019233020022511482, -0.03828039392828941, 0.008530475199222565, -0.06501355022192001, 0.012354802340269089, -0.007741476409137249, 0.0036433206405490637, 0.003095662221312523, -0.054246027022600174, -0.00892497505992651, 0.0023635171819478273, -0.06649872660636902, 0.034288983792066574, 0.02233332395553589, -0.013904953375458717, -0.04544636234641075, -0.03148571774363518, -0.003088700585067272, -0.010748956352472305, 0.03727789968252182, -0.05339205265045166, 0.0477483868598938, -0.08762533962726593, -0.029944846406579018, 0.0037059765309095383, -0.03219117596745491, 0.0402853786945343, 0.04229036718606949, -0.0588129423558712, -0.019678572192788124, 0.04503794014453888, -0.010860344395041466, 0.03412190079689026, -0.0061866831965744495, 0.049085043370723724, 0.04611469432711601, 0.0244311336427927, -0.00031530967680737376, -0.012948872521519661, 0.031838446855545044, 0.03809474781155586, 0.01252188440412283, -0.02285313419997692, -0.0024575009010732174, -0.0613006092607975, 0.043589893728494644, 0.00673898309469223, -0.041176486760377884, 0.03272955119609833, -0.028793836012482643, -0.05331779271364212, 0.0047572022303938866, -0.0014526870800182223, -0.03367634862661362, -0.041659168899059296, -0.06939481943845749, -0.001555953174829483, -0.02703019045293331, -0.04269878938794136, 0.037110816687345505, 0.019362973049283028, -0.013923518359661102, 0.03508726507425308, 0.012791072018444538, -0.04834245517849922, 0.06787250936031342, 0.023131605237722397, -0.04336711764335632, 0.04496368393301964, 0.0015234649181365967, 0.02300165221095085, 0.03389912471175194, 0.006827165372669697, 0.01732085645198822, 0.03072456456720829, -0.0072448705323040485, -0.06850370764732361, -0.031225809827446938, 0.021739253774285316, -0.04247601330280304, 0.027308661490678787, -0.036423925310373306, 0.041250742971897125, 0.0034298268146812916, -0.049159303307533264, -0.023521464318037033, -0.02673315443098545, -0.033490702509880066, 0.051349934190511703, -0.057587672024965286, 0.0004322092281654477, 0.043849799782037735, 0.026343297213315964, 0.005239883903414011, 0.07407312095165253, 0.00839588139206171, 0.029981976374983788, -0.008349469862878323, -0.010071344673633575, -0.005843236576765776, 0.10574448108673096, -0.0844322144985199, -0.07849151641130447, -0.00310726510360837, 0.01773856207728386, 0.0176271740347147, 0.07177109271287918, 0.0652734562754631, -0.04013686254620552, -0.005597254261374474, 0.03259959816932678, -0.02108948864042759, -0.041659168899059296, -0.0031606387346982956, -0.028645318001508713, -0.07333052903413773, 0.06408531218767166, 0.011120250448584557, -0.015241611748933792, 0.059815436601638794, -0.007277358788996935, 0.02823689579963684, 0.025693532079458237, 0.025674967095255852, -0.02296452224254608, 0.00287056528031826, 0.01833263225853443, 0.07767466455698013, 0.03592267632484436, -0.010164168663322926, 0.03551425412297249, -0.05591684952378273, 0.007230947259813547, -0.04589191824197769, -0.023410076275467873, -0.0032000886276364326, 0.03657244145870209, 0.04425822198390961, 0.04266165941953659, 0.0353100411593914, 0.03595980629324913, -0.05057021975517273, 0.03050178848206997, -0.031021598726511, -0.015993481501936913, 0.010331250727176666, 0.0038011204451322556, -0.010526180267333984, -0.04344137758016586, -0.049419209361076355, -0.012401213869452477, -0.012828201986849308, -0.05888720229268074, -0.029684940353035927, -0.02134939469397068, -0.0456320121884346, 0.05524852126836777, 0.01045192126184702, -0.004204902332276106, 0.004840743262320757, 0.05008753761649132, 0.05049595981836319, 0.0051795486360788345, 0.09757601469755173, 0.06865222752094269, -0.046560246497392654, -0.03050178848206997, 0.0058153895661234856, 0.0017775691812857985, 0.005880366079509258, -0.01746937446296215, -0.036386795341968536, 0.04841671511530876, 0.03321223333477974, -0.07496422529220581, -0.057364895939826965, 0.007110276725143194, 0.02413409948348999, 0.005453377962112427, 0.01221556682139635, -0.02959211729466915, 0.034808795899152756, 0.0059871128760278225, 0.057624801993370056, 0.01242906041443348, 0.08198167383670807, -0.01114809699356556, 0.008247364312410355, -0.02951785922050476, -0.015919223427772522, 0.07841725647449493, -0.009690769016742706, -0.010108474642038345, 0.012494036927819252, -0.04032250866293907, 0.046560246497392654, -0.0338248685002327, -0.07782318443059921, -0.07277359068393707, -0.016968127340078354, 0.0074119530618190765, 0.044406741857528687, 0.003274347400292754, 0.04834245517849922, 0.03772345185279846, 0.006386253982782364, 0.0294064711779356, -0.03497587889432907, 0.006808600388467312, 0.02974063530564308, -0.0014503664569929242, 0.030520351603627205, 0.07708059996366501, -0.012475472874939442, 0.04058241471648216, -0.0009398374822922051, 0.02695593237876892, 0.027624260634183884, -0.0870312750339508, 0.05253807455301285, -0.006855012383311987, 0.025916308164596558, -0.037482112646102905, -0.015872811898589134, -0.03781627491116524, -0.006906065158545971, -0.026528943330049515, -0.05339205265045166, -0.013041695579886436, 0.0035574589855968952, -0.012094896286725998, 0.02936934120953083, -0.04221610724925995, -0.013412989675998688, 0.00769970566034317, -0.052092522382736206, 0.07633800804615021, 0.051609840244054794, -0.011389438062906265, -0.007472288329154253, 0.028812400996685028, -0.038688816130161285, 0.02240758202970028, -0.011491543613374233, 0.033267926424741745, 0.03764919191598892, 0.051349934190511703, 0.05781044811010361, -0.0009253338212147355, 0.004938208032399416, -0.016123434528708458, -0.01574285887181759, -0.06505067646503448, 0.002238205634057522, -0.007068505976349115, -0.04496368393301964, 0.024746732786297798, -0.00697568291798234, 0.021794946864247322, 0.006785394623875618, -0.07325626909732819, 0.06219171732664108, -0.000864998553879559, -0.03267385810613632, -0.063416987657547, -0.03516152501106262, 0.055062875151634216, -0.00949119869619608, -0.00769970566034317, -0.05354056879878044, 0.010795367881655693, 0.019084502011537552, 0.03068743459880352, 0.007978175766766071, -0.04006260260939598, 0.043961189687252045, 0.007927123457193375, 0.036201149225234985, -0.027735648676753044, 0.041027966886758804, -0.011510108597576618, 0.012772507965564728, -0.028515364974737167, 0.04177055507898331, -0.002828794764354825, 0.006279506720602512, -0.03712938353419304, -0.0977245345711708, -0.010340533219277859, -0.009653639048337936, 0.04281017929315567, -0.03577416017651558, -0.0613006092607975, -0.002575850812718272, 0.007806452456861734, -0.02029120735824108, 0.024579651653766632, -0.0626743957400322, 0.021664993837475777, 0.015761421993374825, 0.03746354579925537, -0.05554555729031563, 0.10849205404520035, -0.046188950538635254, 0.0705086961388588, -0.003877699840813875, 0.0005351852159947157, 0.035866983234882355, -0.04058241471648216, 0.03464171290397644, -0.000025453931812080555, -0.01140800304710865, 0.01545510534197092, 0.020773889496922493, 0.008989951573312283, 0.101214699447155, -0.0113151790574193, -0.028032682836055756, -0.04292156547307968, -0.05654804781079292, -0.0036433206405490637, -0.06412244588136673, -0.01973426714539528, -0.03946853429079056, -0.0034228649456053972, 0.004634210839867592, -0.05781044811010361, 0.013617200776934624, -0.014861035160720348, -0.030743129551410675, 0.03404764458537102, -0.016049176454544067, -0.03518008813261986, 0.0276056956499815, -0.012289825826883316, 0.03662813454866409, 0.0659046545624733, 0.0034228649456053972, -0.04217897728085518, -0.004269878845661879, -0.04047102853655815, -0.02790273167192936, -0.0005525896558538079, -0.03265529125928879, 0.026603203266859055, 0.04221610724925995, 0.04889939725399017, 0.016104869544506073, -0.03079882264137268, -0.027234401553869247, -0.07663504779338837, 0.052018266171216965, 0.029276518151164055, -0.034474629908800125, 0.0070963529869914055, -0.03328648954629898, 0.03542143106460571, 0.01984565518796444, -0.013839976862072945, 0.049382079392671585, -0.018815314397215843, -0.04021112248301506, -0.02233332395553589, 0.0420304611325264, -0.008929616771638393, 0.05810748413205147, -0.03532860800623894, -0.051795490086078644, -0.019715702161192894, -0.014638259075582027, -0.022908829152584076, 0.0034298268146812916, -0.0009299750090576708, 0.06211745738983154, -0.019288714975118637, 0.05406038090586662, -0.00014663205365650356, -0.05109003186225891, 0.007917840965092182, 0.001553632551804185, 0.010721108876168728, 0.006195965688675642, 0.004673661198467016, -0.01109240297228098, 0.009291628375649452, 0.040953706949949265, 0.0010448440443724394, -0.05123854801058769, -0.04518646001815796, -0.000743167765904218, -0.010591156780719757, 0.018481150269508362, -0.006604388821870089, -0.0010489050764590502, -0.00210825284011662, -0.07188248634338379, -0.031225809827446938, 0.06534771621227264, 0.03935714438557625, -0.03505013883113861, 0.029499294236302376, -0.030891645699739456, 0.049307819455862045, -0.028218330815434456, -0.036052629351615906, -0.00034953831345774233, 0.027809906750917435, 0.011909249238669872, -0.024041274562478065, 0.0014143973821774125, 0.08146186172962189, 0.031875573098659515, -0.020421160385012627, 0.018434738740324974, 0.033045150339603424, -0.041473519057035446, -0.0399140864610672, -0.044406741857528687, 0.03079882264137268, -0.02014268934726715, -0.023131605237722397, 0.02819976583123207, 0.05951840057969093, 0.00732377078384161, -0.00496141379699111, -0.012921025045216084, 0.023744240403175354, -0.019604314118623734, 0.030891645699739456, -0.017859233543276787, -0.00977430958300829, -0.0197713952511549, -0.007026735693216324, -0.020792454481124878, -0.03402907773852348, 0.016392622143030167, 0.005286295898258686, -0.016522575169801712, 0.023818498477339745, -0.04726570472121239, 0.0813133493065834, -0.043589893728494644, 0.03152284398674965, -0.04344137758016586, -0.004919643048197031, -0.057661931961774826, 0.018276939168572426, 0.06735269725322723, 0.056845083832740784, -0.005355913192033768, -0.01618841104209423, 0.024783862754702568, 0.056696567684412, -0.0559539794921875, -0.04496368393301964, 0.052241042256355286, 0.014786776155233383, -0.008743969723582268, -0.00671113608404994, 0.028218330815434456, -0.04281017929315567, -0.04273591935634613, 0.041362132877111435, -0.007036018185317516, -0.024820992723107338, -0.05253807455301285, 0.02428261563181877, -0.0435156375169754, 0.03076169267296791, 0.02255610004067421, -0.033416442573070526, 0.011732884682714939, -0.005704001523554325, 0.032209739089012146, 0.003030685940757394, 0.0031629593577235937, 0.012141307815909386, 0.05261233448982239, 0.010340533219277859, -0.05855303630232811, -0.015362282283604145, 0.00294714467599988, -0.005727207288146019, -0.023855628445744514, 0.015408693812787533, -0.011649344116449356, -0.009672204032540321, 0.044146835803985596, 0.01444332953542471, -0.016708221286535263, 0.024709604680538177, 0.06549622863531113, 0.07938262075185776, -0.008994593285024166, 0.031949833035469055, -0.012447625398635864, 0.004942848812788725, 0.05792183801531792, -0.03785340487957001, -0.003810402937233448, -0.015974916517734528, 0.0002168297942262143, -0.012874613516032696, -0.05302075669169426, 0.02405983954668045, 0.008878563530743122, 0.0021511835511773825, -0.00032256150734610856, -0.04763699695467949, -0.012271260842680931, 0.007722911424934864, 0.08651146292686462, 0.012085613794624805, 0.06649872660636902, 0.0014283208874985576, 0.007825016975402832, 0.0048778727650642395, 0.015000270679593086, -0.017933491617441177, -0.017200186848640442, -0.06746409088373184, 0.03152284398674965, 0.023521464318037033, -0.009588663466274738, 0.030520351603627205, 0.032098352909088135, -0.01988278515636921, 0.015000270679593086, 0.01248475443571806, 0.0199570432305336, -0.010303403250873089, 0.04604043439030647, -0.034326113760471344, -0.0652734562754631, -0.0025155155453830957, -0.0022033967543393373, -0.031225809827446938, -0.011834990233182907, -0.00025729500339366496, 0.021553605794906616, 0.0027290096040815115, 0.02767995372414589, 0.0037570293061435223, -0.012345519848167896, 0.007569752633571625, 0.011547237634658813, 0.01706095039844513, 0.030297575518488884, -0.03547712415456772, -0.011890684254467487, 0.04210472106933594, 0.034474629908800125, -0.07388746738433838, -0.034363243728876114, -0.03365778550505638, 0.025972003117203712, -0.019975608214735985, 0.01897311396896839, -0.023094475269317627, 0.02435687556862831, 0.005968548357486725, 0.014638259075582027, -0.0031884857453405857, -0.08458073437213898, 0.03389912471175194, -0.03777914494276047, -0.0238741934299469, 0.03226543217897415, -0.04990189149975777, 0.0584416463971138, -0.08242722600698471, -0.006604388821870089, -0.012605424970388412, -0.010925320908427238, 0.059369880706071854, -0.024950945749878883, 0.011194508522748947, -0.011732884682714939, 0.04340424761176109, -0.021924899891018867, -0.010359097272157669, -0.04470377787947655, -0.041213613003492355, -0.05821887031197548, 0.030891645699739456, 0.0395427905023098, -0.0435156375169754, 0.01589137502014637, -0.010117757134139538, -0.029981976374983788, -0.011621496640145779, -0.041139356791973114, -0.028793836012482643, 0.003081738715991378, -0.006585824303328991, -0.04889939725399017, 0.010396227240562439, -0.029350776225328445, 0.014564000070095062, -0.02285313419997692, -0.003401979571208358, -0.020736759528517723, 0.029870588332414627, 0.010461203753948212, 0.03233969211578369, 0.05261233448982239, 0.024078404530882835, 0.01679176278412342, -0.03532860800623894, -0.011853555217385292, -0.0036061913706362247, -0.0356256440281868, 0.023669980466365814, 0.024542521685361862, -0.020365465432405472, 0.0691349133849144, 0.027271531522274017, -0.0374264158308506, -0.05888720229268074, 0.018481150269508362, -0.04589191824197769, 0.020718194544315338, -0.03157854080200195, 0.015260175801813602, 0.023131605237722397, -0.01020129770040512, 0.027160143479704857, -0.011602931655943394, -0.006636877078562975, 0.016216257587075233, -0.03358352556824684, -0.005592613015323877, 0.01867607980966568, -0.010349815711379051, 0.014628976583480835, 0.04013686254620552, 0.005202754866331816, -0.0016139678191393614, -0.004850025754421949, -0.04789690300822258, 0.04347850754857063, 0.03703656047582626, -0.027215836569666862, 0.07455579936504364, -0.021516477689146996, -0.011983508244156837, 0.008743969723582268, 0.10737817734479904, -0.036126889288425446, 0.06118922308087349, -0.07878854870796204, -0.03289663419127464, -0.14005203545093536, 0.01811913773417473, -0.006683288607746363, 0.03375060856342316, 0.000730404572095722, -0.027420049533247948, 0.016049176454544067, 0.014898165129125118, 0.0022486483212560415 ]
716,868
pytorch_optimizer.loss.ldam
__init__
null
def __init__( self, num_class_list: List[int], max_m: float = 0.5, weight: Optional[torch.Tensor] = None, s: float = 30.0 ): super().__init__() cls_num_list = np.asarray(num_class_list) m_list = 1.0 / np.sqrt(np.sqrt(cls_num_list)) m_list *= max_m / np.max(m_list) self.m_list = torch.FloatTensor(m_list).unsqueeze(0) self.weight = weight self.s = s
(self, num_class_list: List[int], max_m: float = 0.5, weight: Optional[torch.Tensor] = None, s: float = 30.0)
[ -0.0025523363146930933, -0.029048128053545952, 0.012269692495465279, 0.016852349042892456, -0.011419683694839478, 0.01999368518590927, -0.02978726476430893, -0.006056312937289476, -0.04505046829581261, 0.047415707260370255, 0.0019148295978084207, 0.08344869315624237, 0.02708941139280796, -0.0017288902308791876, 0.005192445125430822, 0.026867669075727463, 0.05388316884636879, -0.02132413350045681, 0.0340927429497242, 0.02538939379155636, 0.0015152330743148923, 0.0403938964009285, -0.004148412495851517, 0.06951593607664108, -0.03115467168390751, 0.007839483208954334, -0.014865915291011333, 0.02217414230108261, -0.03636559471487999, -0.046380914747714996, -0.05587884038686752, 0.04257435351610184, -0.010883808135986328, 0.048043977469205856, 0.04375697672367096, -0.013415356166660786, 0.009913689456880093, 0.01326752919703722, -0.15137548744678497, 0.019457809627056122, 0.07805298268795013, -0.07317467033863068, 0.018247472122311592, 0.04150260239839554, -0.01571592316031456, 0.055139701813459396, 0.04575264826416969, 0.017850184813141823, -0.023948075249791145, -0.032392725348472595, -0.004090667236596346, -0.020326297730207443, 0.010477282106876373, -0.003931290935724974, -0.04357219114899635, 0.10488369315862656, 0.021545875817537308, -0.0029865799006074667, 0.025648092851042747, -0.01120718102902174, -0.007566926069557667, -0.021970879286527634, 0.05488100275397301, -0.04346131905913353, -0.010754459537565708, 0.002847991418093443, -0.06637459993362427, 0.018958892673254013, -0.012334367260336876, 0.052072279155254364, 0.037049297243356705, -0.014819718897342682, 0.01834910362958908, 0.053476642817258835, 0.03538623824715614, 0.029639437794685364, -0.02246979810297489, 0.003871235763654113, -0.0284198597073555, -0.012426759116351604, 0.03501666709780693, 0.017249634489417076, -0.006107128690928221, -0.010172388516366482, -0.021786095574498177, -0.06278978288173676, 0.022026315331459045, -0.027699200436472893, -0.05077878758311272, -0.022543711587786674, -0.13090135157108307, 0.04434828460216522, 0.0006675340700894594, 0.014976785518229008, 0.003074352629482746, 0.05144401267170906, -0.0069894748739898205, -0.07834863662719727, -0.014607216231524944, 0.005774516612291336, 0.010357172228395939, 0.020862173289060593, 0.03828735277056694, -0.001546415500342846, -0.023338286206126213, -0.07383989542722702, -0.055139701813459396, -0.0154387466609478, -0.06936810910701752, 0.035109058022499084, -0.04349827766418457, 0.0666702538728714, -0.0008118969853967428, 0.04959616810083389, -0.006139465607702732, -0.020049121230840683, -0.007349804509431124, -0.004109146073460579, 0.04375697672367096, 0.0268122348934412, 0.04567873477935791, 0.01700017601251602, -0.027828549966216087, 0.019587159156799316, -0.02490895427763462, 0.0529962033033371, 0.0368645116686821, -0.03497971221804619, 0.031247062608599663, -0.025241566821932793, 0.019624115899205208, -0.058983221650123596, -0.018977370113134384, 0.051259227097034454, 0.01862628012895584, -0.039802584797143936, -0.054807089269161224, -0.005132390186190605, 0.006116367876529694, 0.019587159156799316, 0.018099643290042877, 0.03935910388827324, 0.05735711753368378, 0.020381733775138855, -0.00887889601290226, 0.033797089010477066, 0.029195955023169518, 0.04072650894522667, -0.0022601457312703133, -0.010107713751494884, -0.05543535575270653, 0.011105549521744251, 0.0519244521856308, -0.023430677130818367, -0.01136424858123064, -0.003691070945933461, 0.021194785833358765, -0.06079410761594772, 0.02330132946372032, 0.029085084795951843, -0.025038303807377815, 0.00031730966293253005, -0.04493959620594978, 0.0021250220015645027, -0.06094193458557129, -0.018774107098579407, -0.01799801178276539, -0.03085901588201523, -0.03747430071234703, 0.0706985592842102, 0.024243729189038277, -0.10606631636619568, 0.01519852690398693, 0.012232735753059387, 0.0005647477228194475, 0.016658324748277664, 0.025777440518140793, -0.008994386531412601, 0.02463177777826786, 0.04109608009457588, 0.023061107844114304, -0.0016642155824229121, 0.01311046164482832, -0.056433193385601044, 0.015327876433730125, 0.0480809323489666, 0.01269469689577818, 0.03170902281999588, -0.023948075249791145, 0.015420268289744854, 0.030785102397203445, -0.035700369626283646, -0.025297001004219055, -0.03335360810160637, -0.006994094233959913, 0.02869703620672226, 0.025333957746624947, -0.02566657029092312, 0.014561020769178867, 0.02812420390546322, -0.018099643290042877, 0.012269692495465279, 0.041428688913583755, -0.044200457632541656, -0.001514078234322369, -0.019254546612501144, 0.00005583235542871989, 0.07871820777654648, 0.002081135753542185, -0.04076346755027771, -0.017924098297953606, 0.016076253727078438, 0.011715338565409184, 0.037326473742723465, 0.05720929056406021, -0.06330718100070953, 0.010070757009088993, -0.010310976766049862, 0.012001754716038704, -0.014413192868232727, 0.05569405481219292, 0.019494768232107162, -0.053735338151454926, 0.04845050349831581, 0.006162563804537058, -0.00019128085114061832, -0.008287586271762848, -0.04811789095401764, -0.020677387714385986, 0.028013333678245544, -0.00983977597206831, -0.03224489837884903, -0.007063388358801603, 0.027495937421917915, -0.004203848075121641, 0.05336577072739601, -0.00009975476859835908, -0.00887889601290226, -0.07827472686767578, -0.0069756158627569675, -0.033482957631349564, -0.030729666352272034, -0.03861996531486511, 0.012528390623629093, 0.02463177777826786, 0.01870943233370781, 0.014718087390065193, 0.03139489144086838, -0.04833963140845299, 0.03784387186169624, -0.03278077393770218, -0.028660079464316368, -0.018995849415659904, -0.041687387973070145, 0.003455470548942685, 0.002746359910815954, -0.045272208750247955, -0.0199752077460289, -0.020289340987801552, -0.031561195850372314, -0.044163502752780914, -0.06323326379060745, 0.013369160704314709, 0.0638984888792038, -0.0252046100795269, -0.01106859277933836, -0.03462861850857735, 0.03606994077563286, -0.03965475782752037, 0.00479515828192234, 0.10614023357629776, 0.05957452952861786, 0.00853242538869381, -0.016556693241000175, -0.004365534521639347, -0.04970703646540642, -0.018367581069469452, -0.043313492089509964, -0.06740939617156982, -0.0069756158627569675, 0.022081751376390457, -0.05170271173119545, -0.009290042333304882, -0.003711859229952097, 0.02298719435930252, 0.019882814958691597, 0.013350682333111763, -0.044163502752780914, -0.0032175604719668627, -0.03008292056620121, -0.010283258743584156, 0.002526928437873721, 0.05003964900970459, 0.012075669132173061, 0.04235261306166649, -0.11855775117874146, -0.008246009238064289, 0.0546962209045887, -0.006181042175740004, -0.028068769723176956, 0.04538308084011078, -0.06511806696653366, 0.062235426157712936, -0.001992208184674382, -0.03390796110033989, -0.05628536641597748, 0.018459973856806755, 0.017868664115667343, 0.050741828978061676, 0.0022971027065068483, 0.06242021173238754, 0.08906614035367966, -0.02075130119919777, 0.051591839641332626, 0.011475118808448315, 0.03599602356553078, -0.0036240865010768175, -0.020917607471346855, 0.004566487390547991, 0.0794573426246643, 0.009571838192641735, -0.0013431524857878685, -0.02594374679028988, 0.023079587146639824, -0.03366773948073387, -0.05029834806919098, -0.005049237050116062, -0.021213263273239136, -0.0259622260928154, -0.01914367638528347, -0.028567686676979065, 0.0000919591766432859, 0.04043085500597954, -0.020695867016911507, -0.053772296756505966, 0.02568504959344864, 0.045530907809734344, 0.04205695912241936, 0.01558657456189394, -0.04294392466545105, 0.04301783815026283, 0.007271271198987961, -0.02463177777826786, 0.08788351714611053, -0.020123034715652466, -0.015531139448285103, 0.024446992203593254, -0.038693878799676895, 0.009008245542645454, 0.008869657292962074, -0.020178470760583878, -0.016297994181513786, 0.02923291176557541, 0.020621953532099724, 0.040874335914850235, 0.021823052316904068, -0.025925269350409508, -0.02788398414850235, -0.01710180751979351, -0.037326473742723465, 0.014394714497029781, 0.025075260549783707, -0.037622127681970596, 0.03606994077563286, -0.017628444358706474, 0.00023430099827237427, 0.03390796110033989, -0.024982867762446404, 0.03876779228448868, 0.014450149610638618, -0.0067446352913975716, -0.05199836567044258, -0.03961780294775963, 0.04368306323885918, 0.014034384861588478, 0.03244816139340401, -0.10414455831050873, 0.027754636481404305, 0.02845681644976139, -0.004129934124648571, 0.00825524888932705, -0.03505362570285797, 0.02976878732442856, 0.0027994855772703886, 0.01326752919703722, -0.01051423978060484, 0.0340927429497242, -0.0002638954028952867, 0.022802410647273064, 0.017988773062825203, 0.008051985874772072, -0.0150137422606349, -0.01149359717965126, -0.052885331213474274, -0.050741828978061676, 0.011512075550854206, 0.0322633795440197, 0.04930051043629646, -0.043904803693294525, -0.019069762900471687, -0.0051970649510622025, -0.03198620304465294, -0.004998421296477318, 0.047415707260370255, -0.04020911082625389, -0.015420268289744854, 0.02431764267385006, 0.047711364924907684, -0.02324589341878891, 0.03935910388827324, 0.0021273319143801928, 0.02705245465040207, 0.014671890996396542, 0.013886556960642338, -0.0368645116686821, -0.012001754716038704, -0.00581609271466732, -0.028549209237098694, 0.0008869657176546752, -0.014533302746713161, 0.036790598183870316, 0.0696268081665039, 0.07975300401449203, 0.009405531920492649, 0.01862628012895584, -0.0315057598054409, 0.009248465299606323, -0.022543711587786674, 0.011234899051487446, -0.020030641928315163, -0.0705137774348259, 0.0339633971452713, -0.029639437794685364, -0.04815484583377838, 0.040356941521167755, -0.015263201668858528, -0.02793942019343376, -0.036790598183870316, -0.053772296756505966, -0.023171979933977127, 0.009294661693274975, -0.045863520354032516, -0.002596222562715411, 0.042241740971803665, -0.012352845631539822, -0.06378761678934097, -0.02568504959344864, -0.0069709960371255875, -0.03531232103705406, -0.05026138946413994, -0.01449634600430727, 0.009109877049922943, 0.0361068956553936, 0.028586165979504585, 0.09690100699663162, -0.014561020769178867, -0.04619613289833069, -0.028382902964949608, 0.04213087260723114, -0.04220478609204292, 0.016796912997961044, 0.01746213808655739, 0.005598971154540777, -0.035644933581352234, -0.04294392466545105, 0.020104555413126945, 0.06755722314119339, -0.01393275335431099, 0.008329162374138832, -0.033778611570596695, 0.06352891772985458, 0.014182211831212044, 0.00874030776321888, -0.06482241302728653, -0.031838372349739075, -0.006379685830324888, 0.02245132066309452, -0.031062278896570206, -0.012121864594519138, -0.042833052575588226, 0.07842255383729935, 0.008195193484425545, 0.04323957860469818, -0.011179463937878609, -0.04833963140845299, 0.020178470760583878, -0.001919449307024479, -0.038102567195892334, 0.036457985639572144, 0.001688468619249761, -0.0339633971452713, 0.027144847437739372, 0.03196772187948227, 0.04922659695148468, -0.023578505963087082, -0.016067015007138252, 0.012491433881223202, 0.015272441320121288, 0.03876779228448868, 0.024982867762446404, 0.008901994675397873, -0.00539108831435442, -0.04730483889579773, -0.02568504959344864, 0.005192445125430822, 0.029879657551646233, -0.04349827766418457, 0.0042546638287603855, -0.04737875238060951, 0.019605638459324837, 0.03751125931739807, -0.0151708098128438, -0.05828103795647621, 0.04024606943130493, 0.005635927896946669, -0.05820712447166443, -0.045826561748981476, 0.053994037210941315, 0.025851355865597725, -0.013905035331845284, 0.035109058022499084, 0.03603298217058182, -0.05525057390332222, -0.004850593861192465, -0.024132858961820602, 0.017573008313775063, -0.02895573526620865, -0.05029834806919098, 0.08396609127521515, 0.07723993062973022, -0.0047027659602463245, -0.023892639204859734, -0.04161347448825836, 0.06977463513612747, -0.029657917097210884, 0.013988188467919827, 0.0069756158627569675, 0.014838197268545628, 0.017018655315041542, -0.01585451140999794, -0.01872791163623333, 0.026054618880152702, 0.03741886466741562, -0.016732238233089447, -0.012750132009387016, 0.013239811174571514, -0.024243729189038277, 0.04889398440718651, -0.028844865038990974, 0.005460382904857397, -0.031117713078856468, -0.014727327041327953, -0.03965475782752037, -0.020621953532099724, 0.08100953698158264, 0.00546962209045887, 0.013341442681849003, -0.05351359769701958, 0.012334367260336876, 0.037548214197158813, -0.011124028824269772, -0.03037857636809349, 0.0743572935461998, 0.014385474845767021, -0.033482957631349564, -0.017988773062825203, 0.013027309440076351, 0.003654113970696926, -0.030230747535824776, 0.008703351020812988, 0.003977486863732338, 0.0116414250805974, -0.03806561231613159, 0.06393544375896454, -0.02076978050172329, -0.0076685575768351555, 0.02869703620672226, 0.013637097552418709, 0.0005563746672123671, -0.04368306323885918, -0.004545699339359999, 0.020695867016911507, 0.00772399315610528, -0.011318052187561989, 0.04257435351610184, 0.03370469808578491, -0.07476381957530975, -0.018099643290042877, -0.04863528534770012, 0.03250359743833542, 0.03961780294775963, 0.027717677876353264, -0.028900299221277237, 0.03220794349908829, -0.02350459061563015, -0.03525688871741295, -0.03662429377436638, -0.00005020220123697072, 0.042759139090776443, 0.07450512051582336, -0.026350272819399834, 0.04242652654647827, -0.011992515996098518, 0.014588737860321999, 0.04760049283504486, -0.08522262424230576, -0.0072204554453492165, 0.004217706620693207, -0.02601766027510166, -0.008869657292962074, -0.0028664700221270323, 0.04649178683757782, 0.02160130999982357, -0.028826385736465454, -0.04922659695148468, -0.03093292936682701, -0.0453091636300087, 0.015660488978028297, 0.07273118942975998, -0.0054003274999558926, -0.03636559471487999, 0.03939606249332428, 0.0031806037295609713, 0.013415356166660786, -0.015124613419175148, -0.005598971154540777, -0.021416526287794113, -0.06075715273618698, -0.0004203848075121641, -0.007774808909744024, 0.05558318644762039, -0.027699200436472893, 0.028826385736465454, -0.026036139577627182, -0.04981790855526924, -0.02130565606057644, -0.002894187578931451, 0.021730659529566765, 0.03725256025791168, -0.021527396515011787, -0.0170463714748621, 0.047157011926174164, 0.01382188219577074, -0.017508333548903465, 0.002246286952868104, -0.04660265892744064, -0.028087247163057327, -0.0010209345491603017, 0.028826385736465454, 0.028290510177612305, -0.04730483889579773, 0.02954704500734806, 0.0016676803352311254, 0.018284428864717484, 0.0009331618784926832, -0.034296005964279175, -0.012426759116351604, -0.005137010011821985, 0.03987650200724602, -0.019550202414393425, -0.08086171001195908, 0.0215828325599432, 0.04216782748699188, 0.003025846555829048, 0.004915268160402775, -0.02075130119919777, 0.00525250006467104, -0.0333351269364357, -0.027477458119392395, -0.026054618880152702, -0.04083738103508949, 0.0045503186993300915, -0.03061879612505436, -0.02487199753522873, -0.007068008184432983, 0.019254546612501144, 0.012038711458444595, -0.02928834781050682, -0.0020441787783056498, 0.007663938216865063, 0.062494125217199326, 0.0002543674490880221, -0.01860780082643032, -0.0018466903129592538, 0.009123736061155796, 0.035940591245889664, -0.10843156278133392, 0.04782223328948021, -0.020400211215019226, 0.00934547744691372, -0.029048128053545952, -0.014745805412530899, 0.004677358083426952, -0.024761125445365906, 0.0065090348944067955, 0.020621953532099724, -0.06312239170074463, -0.04778527840971947, 0.017850184813141823, 0.01040336862206459, -0.009497924707829952, -0.008851178921759129, -0.10089235007762909, 0.043350450694561005, -0.012630022130906582, -0.02269154042005539, -0.03196772187948227, 0.029085084795951843, 0.009812057949602604, -0.024021988734602928, 0.04301783815026283, 0.05392012372612953, 0.01637190952897072, -0.018136601895093918, -0.06009192764759064, 0.06108976528048515, 0.07347032427787781, 0.04889398440718651, -0.053735338151454926, 0.005862289108335972, 0.013452313840389252, -0.02322741411626339, 0.05706145986914635, 0.05214619264006615, -0.029343781992793083, 0.00677235284820199, 0.045789606869220734, -0.016353430226445198, 0.011558271944522858, -0.05750494450330734, 0.031006842851638794, 0.013461552560329437, -0.0388786643743515, -0.03438840061426163, -0.005104672629386187, -0.02653505839407444, 0.03207859396934509, -0.012223496101796627, -0.016103971749544144, 0.05066791549324989, -0.004109146073460579, 0.00034675971255637705, 0.014542542397975922, 0.01725887507200241, -0.052367933094501495, 0.015189288184046745, 0.0046034445986151695, 0.009068300947546959, 0.025038303807377815, -0.02461329847574234, 0.020862173289060593, 0.0025569559074938297, 0.019845858216285706, 0.02954704500734806, 0.08389217406511307, -0.038730837404727936, 0.02649810165166855, -0.08233998715877533, -0.043609146028757095, -0.11951863020658493, -0.0023444537073373795, -0.0029704112093895674, 0.04996573552489281, 0.0037049297243356705, -0.010144670493900776, 0.06615286320447922, 0.06563546508550644, 0.0033076428808271885 ]
716,898
pytorch_optimizer.loss.ldam
forward
null
def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor: index = torch.zeros_like(y_pred, dtype=torch.bool) index.scatter_(1, y_true.view(-1, 1), 1) batch_m = torch.matmul(self.m_list.to(index.device), index.float().transpose(0, 1)) batch_m = batch_m.view((-1, 1)) x_m = y_pred - batch_m output = torch.where(index, x_m, y_pred) return cross_entropy(self.s * output, y_true, weight=self.weight)
(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor
[ -0.028614219278097153, -0.04771457239985466, -0.002264989772811532, 0.00821115542203188, 0.0386364571750164, 0.0055512674152851105, -0.06282056123018265, 0.018446730449795723, 0.00951386522501707, 0.042122453451156616, 0.005369705148041248, -0.027052784338593483, 0.04600788652896881, 0.01656755991280079, 0.05984293669462204, 0.03676636517047882, 0.021533289924263954, -0.03780127316713333, 0.019772134721279144, -0.008651443757116795, 0.03878170996904373, -0.02527347207069397, -0.01520584337413311, 0.018119918182492256, -0.009014568291604519, -0.025636596605181694, -0.03262674808502197, -0.014143703505396843, -0.03998002037405968, 0.019626885652542114, -0.029703592881560326, 0.014506828039884567, 0.06332892924547195, 0.012673049233853817, 0.037038709968328476, 0.012255455367267132, -0.012582267634570599, -0.012709361501038074, -0.0139349065721035, -0.036838993430137634, -0.004393807612359524, -0.09245152771472931, 0.04782351106405258, 0.0635831207036972, -0.029503874480724335, 0.05011119693517685, -0.08133991062641144, -0.00862874835729599, 0.024038849398493767, -0.04281239211559296, -0.01564159244298935, -0.03162815421819687, -0.024565380066633224, 0.012082971632480621, 0.0144251249730587, 0.028378188610076904, 0.0212609451264143, -0.018083605915308, -0.059334561228752136, -0.027978751808404922, 0.005206299014389515, -0.04048839583992958, 0.03197312355041504, 0.01327220443636179, 0.054831817746162415, 0.0016544865211471915, -0.02062547765672207, 0.04092414304614067, 0.008206616155803204, 0.029358625411987305, -0.04034314304590225, -0.000953202077653259, 0.0400889553129673, 0.01868276111781597, 0.001938177621923387, -0.016349686309695244, -0.004498206079006195, -0.008642366155982018, 0.01161090936511755, -0.029848843812942505, -0.048077698796987534, -0.008764919824898243, 0.0015875353710725904, -0.02166038379073143, -0.030048562213778496, -0.027742721140384674, 0.01984475925564766, -0.006254821550101042, -0.08823928236961365, 0.017321044579148293, -0.04117833077907562, 0.03885433450341225, -0.01755707524716854, 0.014316188171505928, 0.0498570092022419, 0.043974392116069794, -0.029667280614376068, -0.0018224316881969571, 0.0161408893764019, 0.04372020438313484, 0.047206200659275055, 0.11561887711286545, 0.004375651478767395, -0.0016295217210426927, 0.043974392116069794, -0.013036173768341541, -0.04473695158958435, 0.018256090581417084, -0.04419226571917534, -0.03460577502846718, -0.01667649857699871, -0.01823793351650238, 0.018110839650034904, -0.02454722300171852, 0.007816256955265999, -0.05958874896168709, -0.03456946462392807, -0.005392400547862053, -0.04775088652968407, 0.05174525827169418, 0.026036035269498825, -0.06928417831659317, 0.006204891949892044, -0.05435975268483162, -0.04913076013326645, 0.024420130997896194, 0.06234849616885185, -0.031991276890039444, 0.018010981380939484, -0.04048839583992958, -0.06253005564212799, -0.0010814304696395993, -0.009173435159027576, 0.06688755005598068, 0.0024578997399657965, -0.0430302657186985, -0.0022820113226771355, 0.009568333625793457, 0.04324813932180405, 0.02171485126018524, 0.058789875358343124, 0.02792428247630596, 0.04408332705497742, 0.06332892924547195, -0.011719847097992897, -0.04048839583992958, 0.009876989759504795, 0.08279240876436234, 0.062057994306087494, -0.00796604622155428, 0.030048562213778496, 0.009522942826151848, 0.0547591894865036, -0.04186826944351196, -0.03907220810651779, 0.03596749156713486, -0.029249686747789383, -0.04321182891726494, 0.013798735104501247, 0.001087671727873385, -0.035077836364507675, -0.06409149616956711, -0.06343787163496017, 0.01604102924466133, 0.00685851601883769, -0.02489219233393669, 0.03335299715399742, 0.06830374151468277, -0.0009594433358870447, 0.03213652968406677, 0.06921155005693436, -0.08112204074859619, 0.07734554260969162, 0.038164395838975906, -0.030248280614614487, -0.00948663055896759, 0.01515137404203415, -0.029667280614376068, 0.0012913618702441454, 0.05294356867671013, 0.038019146770238876, -0.030048562213778496, -0.035422805696725845, -0.09528389573097229, 0.02004447765648365, -0.005778220482170582, 0.006690571084618568, 0.046915698796510696, 0.032045748084783554, 0.0581725612282753, -0.04281239211559296, -0.062312182039022446, -0.0003980186302214861, -0.02919521927833557, -0.0021605915389955044, -0.01329943910241127, -0.003004856174811721, 0.03355271369218826, 0.057373687624931335, -0.02253188192844391, -0.05504969134926796, -0.007666468154639006, 0.02253188192844391, 0.0003543302009347826, -0.03315327689051628, 0.01347192283719778, -0.0347147136926651, 0.07582041621208191, -0.03369796276092529, -0.07582041621208191, -0.025219004601240158, -0.003815077943727374, -0.017829418182373047, 0.05308881774544716, 0.04277607798576355, 0.0048159402795135975, -0.039580583572387695, 0.0057691424153745174, -0.056683752685785294, -0.02659887820482254, -0.005169986747205257, -0.05170894414186478, -0.06881211698055267, 0.04125095531344414, 0.01975397951900959, -0.021841945126652718, 0.02140619605779648, -0.005800915881991386, -0.024619849398732185, 0.017765872180461884, 0.004055648110806942, 0.015514498576521873, 0.0185738243162632, 0.021442508324980736, 0.07908853888511658, 0.0040306830778717995, 0.01920929178595543, 0.010276426561176777, -0.04462801292538643, 0.07720029354095459, -0.04520901292562485, -0.013254048302769661, 0.048477135598659515, -0.021133853122591972, 0.019281916320323944, 0.03725658357143402, 0.01564159244298935, 0.06478142738342285, -0.02122463285923004, 0.03553174436092377, -0.02605419047176838, 0.004116925410926342, -0.03035721741616726, -0.023385224863886833, -0.001218736986629665, -0.07425898313522339, 0.007149015553295612, -0.07255229353904724, 0.03460577502846718, 0.01838318258523941, -0.02365756779909134, 0.03148290514945984, -0.03237256035208702, -0.008034132421016693, -0.046516261994838715, -0.029394937679171562, -0.0161408893764019, 0.048368196934461594, 0.0017180333379656076, 0.056102752685546875, 0.09158002585172653, 0.02674412727355957, -0.04542689025402069, -0.03540464863181114, -0.007693702820688486, 0.007430437486618757, 0.07051879912614822, -0.030774811282753944, -0.041831955313682556, 0.0027188954409211874, 0.008842084556818008, -0.10189276933670044, -0.03939902037382126, -0.02033497765660286, 0.014288953505456448, 0.010076708160340786, 0.018564745783805847, -0.013644407503306866, 0.061912745237350464, 0.01188325323164463, 0.04103308171033859, 0.05080113187432289, 0.056393250823020935, -0.008755842223763466, -0.0024760558735579252, -0.035658836364746094, -0.0337342768907547, 0.006740500684827566, 0.006731422618031502, 0.03475102409720421, 0.0064409226179122925, 0.016848981380462646, -0.007979663088917732, -0.02004447765648365, -0.05911668762564659, -0.046661511063575745, 0.04459170252084732, 0.029503874480724335, -0.020807040855288506, -0.03335299715399742, 0.05443238094449043, 0.02215060032904148, -0.0488765724003315, 0.007893421687185764, -0.02405700460076332, -0.01920929178595543, 0.013553625904023647, 0.009377692826092243, 0.060206059366464615, 0.05940718576312065, 0.030865591019392014, 0.010376285761594772, 0.017030544579029083, 0.0630747452378273, 0.01926376111805439, -0.039616893976926804, 0.018846167251467705, -0.019826604053378105, -0.02850528247654438, 0.015105984173715115, 0.04408332705497742, -0.020607322454452515, -0.03823702037334442, 0.0171213261783123, -0.02527347207069397, -0.01227361150085926, -0.01999001018702984, 0.03827333450317383, 0.015441874042153358, 0.018010981380939484, -0.03867277130484581, -0.004870408680289984, -0.0361853688955307, 0.024365661665797234, 0.003545003943145275, 0.032245464622974396, -0.02278606966137886, 0.029758062213659286, 0.009886067360639572, 0.026435472071170807, -0.012963548302650452, 0.053306691348552704, 0.07545729726552963, 0.04317551478743553, 0.016213513910770416, -0.007779944688081741, -0.04364757984876633, 0.013217736035585403, -0.044264890253543854, -0.016494935378432274, -0.012082971632480621, -0.030920060351490974, -0.012092049233615398, 0.014724702574312687, -0.05799100175499916, 0.019772134721279144, 0.0037969218101352453, -0.053270380944013596, -0.03142843395471573, 0.029649123549461365, -0.054105568677186966, -0.006046024616807699, -0.004627569112926722, 0.0518178828060627, 0.003985292743891478, 0.014751937240362167, -0.0366755872964859, 0.007766327820718288, 0.04357495158910751, 0.02238663285970688, -0.02122463285923004, 0.011892330832779408, -0.020153416320681572, 0.002417048206552863, 0.013362986035645008, 0.02816031314432621, -0.015614358708262444, -0.04771457239985466, -0.016367841511964798, -0.0527983196079731, 0.007262492086738348, -0.049748070538043976, -0.0346965566277504, -0.07937903702259064, -0.03075665421783924, -0.03968951851129532, 0.017230262979865074, 0.0889655277132988, -0.05828149989247322, -0.03515046089887619, -0.023530473932623863, 0.03573146089911461, -0.013399298302829266, 0.018083605915308, -0.0659797415137291, 0.02385728619992733, 0.010893737897276878, 0.05980662256479263, -0.072334423661232, 0.07974216341972351, -0.04306657984852791, 0.04306657984852791, -0.03553174436092377, 0.0022456988226622343, -0.024311192333698273, 0.004652534145861864, -0.046516261994838715, -0.00027631514240056276, 0.013435610570013523, 0.05603012815117836, 0.033806901425123215, 0.03242702782154083, 0.060351308435201645, -0.04629838839173317, -0.08685940504074097, -0.009522942826151848, -0.025346098467707634, 0.03596749156713486, -0.016122732311487198, -0.007312421686947346, -0.02683490887284279, -0.0884571522474289, 0.015668826177716255, -0.018256090581417084, 0.015414639376103878, -0.015668826177716255, 0.0444827638566494, -0.025346098467707634, -0.047060947865247726, 0.031028997153043747, -0.023639412596821785, -0.04048839583992958, 0.03157368674874306, 0.0826471596956253, -0.04317551478743553, -0.015487264841794968, -0.05675637722015381, -0.041831955313682556, -0.007829874753952026, 0.015668826177716255, -0.012282690033316612, 0.040996767580509186, 0.03596749156713486, 0.03622167930006981, 0.04096045717597008, -0.006050563883036375, -0.08918340504169464, -0.06365574151277542, 0.021969038993120193, 0.007262492086738348, -0.0035586212761700153, 0.031065311282873154, -0.03998002037405968, 0.03338930755853653, 0.024038849398493767, -0.02605419047176838, -0.01298170443624258, 0.00578275928273797, 0.0010882390197366476, -0.0072261798195540905, 0.009305068291723728, -0.040306832641363144, 0.036893460899591446, 0.01676727831363678, -0.07226179540157318, 0.01897326111793518, -0.008837545290589333, 0.022332163527607918, 0.025745535269379616, -0.020788883790373802, -0.033806901425123215, -0.020080791786313057, -0.03021196834743023, -0.030883748084306717, -0.0031183327082544565, -0.015233077108860016, 0.0021605915389955044, -0.029467562213540077, 0.03142843395471573, 0.035767775028944016, 0.014524984173476696, -0.027306970208883286, 0.06790430098772049, -0.057918377220630646, -0.07887066900730133, -0.035277556627988815, -0.013753344304859638, 0.01829240284860134, 0.029812529683113098, 0.04306657984852791, -0.0026031495071947575, -0.0011063952697440982, -0.05261675640940666, -0.010285504162311554, 0.009795286692678928, 0.05973399803042412, 0.029413092881441116, 0.004548135679215193, -0.06449092924594879, 0.030466154217720032, 0.032590433955192566, -0.010585082694888115, -0.01493349950760603, 0.002825563307851553, 0.011710768565535545, -0.00974989589303732, 0.020080791786313057, 0.05352456867694855, 0.016994232311844826, -0.02278606966137886, -0.0024647084064781666, 0.02302210032939911, -0.025545816868543625, 0.001486541354097426, -0.017902042716741562, 0.0488765724003315, -0.01351731363683939, -0.0195542611181736, 0.033080652356147766, -0.011983112432062626, -0.0281058456748724, -0.018165308982133865, -0.017756793648004532, 0.019590573385357857, -0.07113610953092575, 0.007539374753832817, -0.0012698014033958316, -0.025146380066871643, -0.024710629135370255, -0.003594933543354273, -0.004584448412060738, -0.022695288062095642, -0.01347192283719778, -0.01984475925564766, -0.025927096605300903, -0.0072261798195540905, -0.051454756408929825, 0.019336385652422905, -0.032390713691711426, 0.019808446988463402, -0.07945166528224945, 0.0026916612405329943, 0.0018031406216323376, -0.001575052971020341, 0.07095454633235931, 0.08090416342020035, 0.07418635487556458, 0.05417819321155548, -0.009223365224897861, 0.07473104447126389, -0.009377692826092243, -0.042848702520132065, 0.0474240742623806, -0.008324631489813328, 0.03041168674826622, 0.01926376111805439, -0.03451499342918396, 0.007552992086857557, 0.0036221679765731096, 0.012890923768281937, -0.0173482783138752, 0.03505967929959297, 0.0014184555038809776, 0.030103029683232307, 0.01087558176368475, 0.018119918182492256, 0.07197129726409912, -0.06438199430704117, 0.04346601665019989, 0.00733511708676815, -0.017175793647766113, -0.030774811282753944, 0.02552765980362892, 0.04851344972848892, 0.0007812852854840457, 0.003540464909747243, -0.019717667251825333, 0.05911668762564659, -0.0008255410939455032, -0.0022071166895329952, -0.024383816868066788, 0.018165308982133865, -0.013036173768341541, 0.024565380066633224, 0.028686843812465668, -0.05268938094377518, -0.020316822454333305, 0.010067629627883434, 0.07102717459201813, 0.07316961139440536, 0.04629838839173317, 0.00547410361468792, 0.011919565498828888, -0.015233077108860016, 0.02278606966137886, -0.045935261994600296, -0.06314737349748611, -0.010739410296082497, -0.04738776013255119, -0.040742579847574234, -0.016694653779268265, 0.007035539485514164, 0.000565112684853375, -0.01960872858762741, 0.007235257886350155, -0.01202850230038166, 0.013798735104501247, 0.08380915969610214, 0.0017532110214233398, 0.030466154217720032, 0.07632879167795181, 0.0008232715772464871, -0.006191274616867304, 0.019681353121995926, 0.006958375219255686, -0.02619944140315056, 0.01642231084406376, -0.0073623512871563435, 0.015360170975327492, 0.0518178828060627, -0.010675863362848759, 0.018646448850631714, -0.004725159145891666, 0.01819254271686077, 0.011974033899605274, -0.013281282968819141, 0.0059643215499818325, 0.031065311282873154, 0.017003308981657028, -0.07153555005788803, -0.041686706244945526, 0.04528163745999336, 0.021496977657079697, -0.012718439102172852, -0.02590894140303135, -0.016413232311606407, -0.017829418182373047, 0.009205209091305733, 0.04234033077955246, -0.003279469208791852, -0.009858833625912666, 0.03696608543395996, 0.05504969134926796, 0.0635468065738678, 0.02688937820494175, -0.009804364293813705, -0.058499373495578766, 0.032880932092666626, 0.020462071523070335, -0.047932449728250504, -0.03798283264040947, 0.004450546111911535, 0.023239975795149803, -0.011992190033197403, -0.02556397207081318, 0.0022570465225726366, 0.017811262980103493, -0.0684853047132492, -0.06125912070274353, -0.029903311282396317, -0.026471784338355064, 0.030175654217600822, -0.03320774435997009, 0.009867911227047443, 0.04433751478791237, -0.08562478423118591, 0.027052784338593483, -0.009441239759325981, 0.004838635213673115, -0.018446730449795723, 0.02365756779909134, 0.015260311774909496, 0.02899550087749958, 0.042558204382658005, -0.0007676681270822883, -0.006608868017792702, -0.03435158729553223, -0.005188142880797386, -0.0586809366941452, -0.035313867032527924, -0.03480549529194832, 0.008460803888738155, 0.004005718510597944, -0.03318959102034569, -0.014597609639167786, 0.013462845236063004, -0.006268438417464495, 0.025346098467707634, 0.0029821607749909163, 0.013780578970909119, -0.07164448499679565, 0.02044391632080078, -0.030811123549938202, -0.03968951851129532, -0.022404788061976433, 0.03983477130532265, -0.02850528247654438, -0.020698102191090584, -0.031210560351610184, -0.02850528247654438, 0.05022013187408447, -0.0048885652795434, -0.005732829682528973, 0.015559889376163483, -0.023330755531787872, -0.014633921906352043, -0.028196625411510468, 0.020643634721636772, 0.026126815006136894, 0.02249556966125965, 0.009196130558848381, -0.01809268444776535, -0.005932548549026251, 0.02365756779909134, -0.06332892924547195, -0.06627023965120316, 0.03535018116235733, -0.04771457239985466, -0.009886067360639572, -0.006994687952101231, 0.008311014622449875, 0.0193182285875082, 0.027869813144207, 0.021351726725697517, -0.007208023685961962, -0.01608642004430294, 0.015968404710292816, -0.06528980284929276, 0.0713539868593216, 0.02708909660577774, 0.04956651106476784, 0.027270657941699028, 0.056393250823020935, 0.013653485104441643, 0.005315236281603575, 0.017929278314113617, -0.04709726199507713, -0.025636596605181694, 0.011374878697097301, -0.012210065498948097, 0.03598564863204956, 0.006599789950996637, -0.04716988652944565, -0.004738776013255119, 0.12571373581886292, 0.014216328971087933, 0.033806901425123215, -0.03358902782201767, -0.06332892924547195, -0.06496299058198929, -0.02801506407558918, -0.005092822480946779, -0.014633921906352043, 0.010911894962191582, -0.04477326571941376, 0.045644763857126236, 0.042667143046855927, 0.03021196834743023 ]
716,932
pytorch_optimizer.optimizer.lomo
LOMO
Full Parameter Fine-tuning for Large Language Models with Limited Resources. Reference : https://github.com/OpenLMLab/LOMO/blob/main/src/lomo.py Check the usage from here : https://github.com/OpenLMLab/LOMO/blob/main/src/lomo_trainer.py :param model: nn.Module. pytorch model. :param lr: float. learning rate. :param clip_grad_norm: Optional[float]. clip grad norm. :param clip_grad_value: Optional[float]. clip grad value.
class LOMO(BaseOptimizer, Optimizer): r"""Full Parameter Fine-tuning for Large Language Models with Limited Resources. Reference : https://github.com/OpenLMLab/LOMO/blob/main/src/lomo.py Check the usage from here : https://github.com/OpenLMLab/LOMO/blob/main/src/lomo_trainer.py :param model: nn.Module. pytorch model. :param lr: float. learning rate. :param clip_grad_norm: Optional[float]. clip grad norm. :param clip_grad_value: Optional[float]. clip grad value. """ def __init__( self, model: nn.Module, lr: float = 1e-3, clip_grad_norm: Optional[float] = None, clip_grad_value: Optional[float] = None, ): self.validate_learning_rate(lr) self.validate_non_negative(clip_grad_norm, 'clip_grad_norm') self.validate_non_negative(clip_grad_value, 'clip_grad_value') self.model = model self.lr = lr self.clip_grad_norm = clip_grad_norm self.clip_grad_value = clip_grad_value self.local_rank: int = int(os.environ.get('LOCAL_RANK', 0)) self.gather_norm: bool = False self.grad_norms: List[torch.Tensor] = [] self.clip_coef: Optional[float] = None p0: torch.Tensor = next(iter(self.model.parameters())) self.grad_func: Callable[[Any], Any] = ( self.fuse_update_zero3() if hasattr(p0, 'ds_tensor') else self.fuse_update() ) self.loss_scaler: Optional[DynamicLossScaler] = None if p0.dtype == torch.float16: if clip_grad_norm is None: raise ValueError( '[-] Loss scaling is recommended to be used with grad norm to get better performance.' ) self.loss_scaler = DynamicLossScaler(init_scale=2 ** 16) # fmt: skip for _, p in self.model.named_parameters(): if p.requires_grad: p.register_hook(self.grad_func) defaults: DEFAULTS = {'lr': lr} super().__init__(self.model.parameters(), defaults) def __str__(self) -> str: return 'LOMO' @torch.no_grad() def reset(self): pass def fuse_update(self) -> Callable[[Any], Any]: @torch.no_grad() def func(x: Any) -> Any: for _, p in self.model.named_parameters(): if not p.requires_grad or p.grad is None: continue if self.loss_scaler and self.loss_scaler.has_overflow_serial or has_overflow(p.grad): p.grad = None self.loss_scaler.has_overflow_serial = True break grad_fp32 = p.grad.to(torch.float32) p.grad = None if self.loss_scaler: grad_fp32.div_(self.loss_scaler.loss_scale) if self.gather_norm: self.grad_norms.append(torch.norm(grad_fp32, 2.0)) else: if self.clip_grad_value is not None and self.clip_grad_value > 0.0: grad_fp32.clamp_(min=-self.clip_grad_value, max=self.clip_grad_value) if self.clip_grad_norm is not None and self.clip_grad_norm > 0.0 and self.clip_coef is not None: grad_fp32.mul_(self.clip_coef) p_fp32 = p.to(torch.float32) p_fp32.add_(grad_fp32, alpha=-self.lr) p.copy_(p_fp32) return x return func def fuse_update_zero3(self) -> Callable[[Any], Any]: # pragma: no cover @torch.no_grad() def func(x: torch.Tensor) -> torch.Tensor: for _, p in self.model.named_parameters(): if p.grad is None: continue all_reduce(p.grad, op=ReduceOp.AVG, async_op=False) if self.loss_scaler and self.loss_scaler.has_overflow_serial or has_overflow(p.grad): p.grad = None self.loss_scaler.has_overflow_serial = True break grad_fp32 = p.grad.to(torch.float32) p.grad = None param_fp32 = p.ds_tensor.to(torch.float32) if self.loss_scaler: grad_fp32.div_(self.loss_scaler.loss_scale) if self.gather_norm: self.grad_norms.append(torch.norm(grad_fp32, 2.0)) else: one_dim_grad_fp32 = grad_fp32.view(-1) partition_size: int = p.ds_tensor.numel() start: int = partition_size * self.local_rank end: int = min(start + partition_size, grad_fp32.numel()) partitioned_grad_fp32 = one_dim_grad_fp32.narrow(0, start, end - start) if self.clip_grad_value is not None: partitioned_grad_fp32.clamp_(min=-self.clip_grad_value, max=self.clip_grad_value) if self.clip_grad_norm is not None and self.clip_grad_norm > 0 and self.clip_coef is not None: partitioned_grad_fp32.mul_(self.clip_coef) partitioned_p = param_fp32.narrow(0, 0, end - start) partitioned_p.add_(partitioned_grad_fp32, alpha=-self.lr) p.ds_tensor[: end - start] = partitioned_p # fmt: skip return x return func def fused_backward(self, loss, lr: float): self.lr = lr if self.clip_grad_norm is not None and self.clip_grad_norm > 0.0 and self.clip_coef is None: raise ValueError( 'clip_grad_norm is not None, but clip_coef is None. ' 'Please call optimizer.grad_norm() before optimizer.fused_backward().' ) if self.loss_scaler: loss = loss * self.loss_scaler.loss_scale loss.backward() self.grad_func(0) def grad_norm(self, loss): self.gather_norm = True self.grad_norms = [] if self.loss_scaler: self.loss_scaler.has_overflow_serial = False loss = loss * self.loss_scaler.loss_scale loss.backward(retain_graph=True) self.grad_func(0) if self.loss_scaler and self.loss_scaler.has_overflow_serial: self.loss_scaler.update_scale(overflow=True) with torch.no_grad(): for _, p in self.model.named_parameters(): p.grad = None return with torch.no_grad(): self.grad_norms = torch.stack(self.grad_norms) total_norm = torch.norm(self.grad_norms, 2.0) self.clip_coef = torch.clamp(float(self.clip_grad_norm) / (total_norm + 1e-6), max=1.0) self.gather_norm = False
(model: torch.nn.modules.module.Module, lr: float = 0.001, clip_grad_norm: Optional[float] = None, clip_grad_value: Optional[float] = None)
[ -0.03512955456972122, -0.04100106656551361, -0.038035452365875244, 0.05990932136774063, 0.021674834191799164, 0.017067190259695053, -0.04983818903565407, -0.03614462912082672, -0.012081381864845753, -0.053380999714136124, -0.021416090428829193, -0.0005324167432263494, 0.011961961165070534, 0.005931221880018711, -0.017783714458346367, 0.08152444660663605, -0.045817695558071136, 0.025516197085380554, 0.06361135840415955, -0.008334561251103878, -0.01747521199285984, -0.06886586546897888, 0.014638972468674183, 0.041717588901519775, -0.03297998383641243, -0.035507719963788986, 0.005647598300129175, -0.0014629020588472486, -0.04131951928138733, -0.02069956623017788, -0.0289594903588295, -0.014380227774381638, 0.01167336106300354, 0.022769523784518242, 0.016639266163110733, -0.048524562269449234, 0.01935608498752117, 0.020938407629728317, -0.12133130431175232, -0.03586598113179207, -0.010917031206190586, -0.07205041497945786, 0.004458368290215731, 0.0144498897716403, -0.022968556731939316, -0.016559652984142303, -0.03397515416145325, 0.0584762766957283, -0.0016159096267074347, -0.022988460958003998, 0.01644023321568966, -0.044105999171733856, -0.000823504407890141, 0.013703511096537113, -0.025575906038284302, 0.04223507642745972, 0.043150633573532104, 0.025018610060214996, 0.037020377814769745, -0.032860562205314636, 0.03508974611759186, -0.053818874061107635, -0.004689745604991913, 0.012121188454329967, 0.020251739770174026, -0.00954369455575943, -0.03755777329206467, 0.011752975173294544, 0.028680842369794846, 0.02111753821372986, -0.03337804973125458, -0.029676012694835663, 0.039488404989242554, 0.037458255887031555, 0.01908738911151886, -0.07228925824165344, -0.003654767293483019, -0.03315911442041397, 0.006453686859458685, -0.04737016186118126, 0.01722641848027706, -0.013076553121209145, -0.028322579339146614, -0.01850023679435253, -0.020958311855793, -0.06154140457510948, 0.025277355685830116, -0.022351551800966263, 0.04092144966125488, -0.04510116949677467, -0.019226713106036186, 0.053301382809877396, -0.011971913278102875, 0.031905196607112885, 0.03670192509889603, -0.007503592874854803, -0.031049350276589394, -0.03363679721951485, -0.0028163352981209755, -0.030213406309485435, 0.007901661098003387, 0.05827724188566208, 0.0031596694607287645, 0.06536286324262619, 0.06452691555023193, -0.06090449541807175, -0.02983524091541767, -0.007777265273034573, 0.02079908363521099, -0.04880321025848389, -0.04617595672607422, -0.016549700871109962, -0.007125427946448326, -0.01747521199285984, -0.02870074473321438, 0.013395007699728012, -0.04772842302918434, -0.001494001131504774, -0.0077374582178890705, 0.026829823851585388, 0.030631378293037415, 0.03417418897151947, -0.09975598752498627, -0.05342080444097519, -0.002159522147849202, 0.03085031546652317, 0.03262172266840935, 0.011683313176035881, 0.025973975658416748, -0.0445040687918663, -0.018171831965446472, 0.016858205199241638, -0.01917695440351963, 0.030890122056007385, 0.024600638076663017, -0.05819762870669365, -0.023326819762587547, 0.026949243620038033, -0.006597986910492182, 0.026192912831902504, -0.01814197562634945, 0.042314689606428146, 0.03837381303310394, 0.004799214657396078, 0.05003722012042999, 0.03355718031525612, 0.04040396213531494, 0.01508679986000061, 0.009066011756658554, -0.010946886613965034, 0.010399541817605495, 0.02217242121696472, -0.007657844573259354, -0.010708045214414597, -0.009608380496501923, 0.029377462342381477, -0.05795878544449806, -0.03401496261358261, -0.017614535987377167, -0.01487781386822462, -0.05350041761994362, -0.044185612350702286, -0.015604288317263126, -0.047847844660282135, 0.005941173527389765, -0.015952598303556442, 0.0359455943107605, -0.02503851428627968, -0.013146215118467808, 0.10222401469945908, -0.008558474481105804, -0.09290920943021774, 0.00851369183510542, 0.03960782289505005, -0.02233164757490158, 0.0990394651889801, -0.0012296587228775024, -0.01107625849545002, -0.042553532868623734, 0.0029705867636948824, 0.028521614149212837, -0.009379491209983826, -0.020251739770174026, -0.07567284256219864, -0.012379933148622513, 0.06110353022813797, -0.009777559898793697, -0.030631378293037415, -0.00228018662892282, 0.027984222397208214, -0.015156461857259274, -0.02054033987224102, 0.024501122534275055, -0.022132612764835358, 0.00382394646294415, -0.00447080796584487, 0.04669344425201416, 0.0022378917783498764, 0.06584054231643677, -0.0021508142817765474, 0.00992683507502079, 0.01816187985241413, 0.032940175384283066, -0.003443293273448944, -0.07993217557668686, -0.024182666093111038, -0.016828348860144615, 0.10588624328374863, -0.022809330374002457, 0.02531716227531433, -0.016141681000590324, 0.02029154635965824, 0.01942574791610241, 0.0724484845995903, 0.05377906560897827, -0.031984809786081314, -0.019893478602170944, 0.059949129819869995, 0.024302087724208832, 0.033457666635513306, -0.00605064257979393, -0.046653639525175095, -0.06902509182691574, -0.003206940134987235, 0.031586743891239166, -0.0013559211511164904, 0.013733366504311562, -0.02021193318068981, 0.06532305479049683, -0.022610295563936234, 0.026551175862550735, -0.04474290832877159, -0.0381946824491024, 0.02147580124437809, 0.0652434453368187, 0.041876815259456635, -0.014668827876448631, 0.04884301498532295, -0.02318749576807022, -0.047250740230083466, -0.029775530099868774, -0.04108067974448204, -0.014390179887413979, 0.01849028654396534, 0.047688618302345276, 0.011026499792933464, 0.06313367933034897, 0.021933579817414284, 0.004463343881070614, 0.036602407693862915, -0.026909437030553818, -0.01107625849545002, -0.04625556990504265, 0.04824591428041458, -0.040762223303318024, -0.06245696172118187, 0.008837122470140457, -0.019644685089588165, 0.009523791261017323, -0.06791049987077713, -0.04522059112787247, -0.06898528337478638, -0.034472741186618805, 0.05342080444097519, -0.014917620457708836, -0.01303674653172493, 0.02939736470580101, -0.01056872121989727, 0.01034978311508894, 0.017743907868862152, 0.08486822247505188, 0.040523383766412735, -0.06763185560703278, 0.01670892909169197, -0.008339537307620049, 0.019385939463973045, -0.009389443323016167, 0.022470971569418907, 0.04139913246035576, 0.056804388761520386, 0.07455825060606003, -0.009369539096951485, -0.062417153269052505, -0.033099401742219925, 0.0016383010661229491, 0.03437322378158569, -0.015743613243103027, -0.0664774551987648, 0.0012277928180992603, -0.0001327931968262419, 0.04323025047779083, 0.013584090396761894, 0.08216135948896408, -0.008623160421848297, 0.07531457394361496, 0.017534920945763588, 0.04370792955160141, 0.03134790062904358, 0.011335003189742565, -0.0432700552046299, 0.0402248315513134, -0.01722641848027706, 0.024919094517827034, -0.02581474743783474, 0.020998118445277214, -0.07025910913944244, -0.0036149604711681604, -0.012837711721658707, 0.031905196607112885, -0.006886586546897888, -0.010240314528346062, -0.023884115740656853, 0.04211565852165222, 0.0225903932005167, 0.011364858597517014, -0.0036323759704828262, 0.011394713073968887, -0.02217242121696472, 0.03733883425593376, 0.05771994590759277, -0.04263314604759216, 0.042314689606428146, 0.03793593496084213, 0.04219527170062065, -0.027824994176626205, -0.043946772813797, 0.03781651705503464, 0.01443993765860796, -0.026372043415904045, -0.04072241857647896, -0.017674244940280914, -0.02897939272224903, 0.011335003189742565, 0.016330763697624207, -0.022709812968969345, -0.009867125190794468, 0.05537134036421776, 0.007269727531820536, 0.03737863898277283, -0.015176365152001381, 0.07388152927160263, 0.04139913246035576, -0.04876340180635452, 0.04944011941552162, 0.006125280633568764, -0.03453245013952255, 0.04617595672607422, 0.008807267993688583, 0.020381111651659012, 0.005294312257319689, 0.000825370370876044, -0.017236370593309402, -0.053301382809877396, 0.08534590899944305, 0.06910470873117447, -0.006458662915974855, -0.025715230032801628, -0.01601230911910534, 0.044941943138837814, -0.07463786005973816, -0.010309976525604725, -0.015514723025262356, -0.046215761452913284, 0.061660826206207275, 0.039667535573244095, -0.010409493930637836, 0.020520435646176338, -0.01311635971069336, -0.0055729602463543415, -0.04386715963482857, -0.030571667477488518, -0.06854741275310516, 0.03620433807373047, -0.02079908363521099, -0.03801555186510086, -0.022948654368519783, -0.03467177599668503, 0.006966200191527605, 0.02454092912375927, 0.025536099448800087, 0.029616303741931915, 0.012499353848397732, -0.0014355347957462072, 0.0016681562410667539, 0.053380999714136124, -0.01014577317982912, 0.016241198405623436, -0.01677859015762806, 0.03142751380801201, -0.04267295449972153, 0.06655706465244293, 0.023147689178586006, 0.030034275725483894, -0.006732334848493338, -0.02607349306344986, 0.0485643669962883, 0.04740997031331062, 0.07742433995008469, -0.029875047504901886, -0.05541114881634712, -0.022948654368519783, -0.06369097530841827, -0.00634919386357069, 0.04159816727042198, -0.0465342178940773, -0.02802402898669243, 0.05664515867829323, 0.06277541816234589, 0.009568573907017708, 0.09537723660469055, -0.02804393135011196, 0.011434520594775677, -0.024580735713243484, 0.03562713786959648, 0.004973369650542736, -0.0007513544405810535, 0.015445061028003693, 0.00619991822168231, 0.002868581796064973, 0.06325309723615646, 0.05131104215979576, -0.014380227774381638, 0.06723378598690033, 0.013176070526242256, -0.02615310624241829, -0.03389554098248482, -0.06400942802429199, 0.01402196567505598, -0.04442445561289787, 0.00852364394813776, -0.026790015399456024, -0.014728537760674953, 0.013255683705210686, -0.07006007432937622, -0.025456486269831657, 0.004719600547105074, 0.004893755540251732, 0.03337804973125458, 0.01014079712331295, -0.01824149303138256, 0.05803839862346649, -0.02615310624241829, 0.027466733008623123, 0.005259481258690357, -0.00830470584332943, -0.019107291474938393, -0.0352688767015934, 0.016410376876592636, -0.07754375785589218, 0.0008937883540056646, -0.010290073230862617, 0.04024473577737808, 0.03297998383641243, 0.024421507492661476, -0.0032591866329312325, -0.00023510925529990345, -0.04983818903565407, -0.010066159069538116, 0.013414911925792694, -0.004744479898363352, -0.028840068727731705, 0.05178872495889664, -0.01610187441110611, -0.004157328978180885, -0.009921859949827194, 0.036423277109861374, 0.09139654785394669, -0.027307504788041115, -0.05863550305366516, -0.016818398609757423, -0.01248940173536539, -0.04108067974448204, 0.02880026213824749, -0.0652434453368187, -0.0038761929608881474, 0.00046586463577114046, -0.04334966838359833, 0.03449264168739319, 0.03538829833269119, -0.0305915717035532, 0.030492054298520088, -0.07551360875368118, 0.015952598303556442, 0.05803839862346649, -0.010409493930637836, 0.011772878468036652, -0.008548523299396038, 0.03051195666193962, -0.0030029299668967724, 0.04006560519337654, -0.043508898466825485, -0.014380227774381638, 0.03333824500441551, -0.005289336200803518, -0.04474290832877159, -0.00701098283752799, -0.008031033910810947, -0.001986611168831587, 0.05242563411593437, -0.005008200649172068, 0.017515018582344055, -0.00647359061986208, -0.05648593232035637, -0.0055729602463543415, 0.03536839410662651, 0.004488223232328892, -0.05358003079891205, 0.02905900776386261, -0.04303121566772461, -0.00707566924393177, -0.04006560519337654, -0.024938996881246567, 0.022112710401415825, 0.018938113003969193, 0.0033164089545607567, -0.01915705017745495, -0.00037785415770485997, 0.05768013745546341, 0.00517986761406064, -0.04812649264931679, -0.019057534635066986, 0.03737863898277283, -0.03184548765420914, -0.023127784952521324, 0.02215251699090004, 0.04100106656551361, -0.04223507642745972, -0.02913862094283104, 0.07157273590564728, -0.00749861728399992, 0.0154649643227458, 0.004102594219148159, 0.030014371499419212, 0.038911204785108566, 0.03801555186510086, -0.025516197085380554, -0.00818528514355421, -0.07913603633642197, -0.08534590899944305, -0.047250740230083466, -0.0128178084269166, 0.01935608498752117, 0.001589786377735436, -0.015902839601039886, 0.004458368290215731, -0.0036846224684268236, 0.006324314512312412, 0.061302561312913895, -0.04490213841199875, -0.00641388026997447, -0.058237433433532715, 0.012240609154105186, -0.005008200649172068, -0.008170357905328274, 0.041916623711586, 0.026869630441069603, -0.02513803169131279, 0.005065422970801592, -0.00409015454351902, 0.026093395426869392, -0.03572665527462959, -0.05640631914138794, 0.028342483565211296, -0.02583465166389942, -0.07232905924320221, 0.03266152739524841, 0.015415206551551819, -0.001737818238325417, -0.031228480860590935, -0.00019794583204202354, 0.003806530963629484, -0.02897939272224903, -0.0018360913963988423, -0.005976004526019096, -0.0292978473007679, 0.017067190259695053, 0.03138770908117294, -0.056366510689258575, 0.019286423921585083, -0.030452247709035873, 0.033616892993450165, -0.02113744243979454, -0.009483983740210533, -0.01660941168665886, 0.015146509744226933, 0.050753746181726456, -0.031566839665174484, 0.06739301234483719, 0.02464044652879238, 0.009190408512949944, 0.011016548611223698, 0.022789426147937775, -0.003012881614267826, -0.060546234250068665, 0.008558474481105804, 0.035069841891527176, -0.09219268709421158, 0.015056944452226162, 0.08646050095558167, 0.048604175448417664, -0.07085620611906052, -0.001036844332702458, 0.029934758320450783, -0.016858205199241638, -0.03162654861807823, -0.03731893002986908, -0.009434225969016552, 0.010797610506415367, 0.0345921590924263, -0.032084327191114426, -0.032840657979249954, 0.015046992339193821, -0.0013385056518018246, -0.026531271636486053, -0.020301498472690582, -0.03942869231104851, -0.05827724188566208, 0.0068766348995268345, 0.10278131067752838, 0.0003069482045248151, -0.015315689146518707, 0.020898601040244102, 0.0067273592576384544, 0.012240609154105186, -0.020560242235660553, -0.004020492546260357, 0.03248239681124687, -0.0976860299706459, -0.030392536893486977, -0.011743023060262203, -0.04062290117144585, -0.0289594903588295, 0.01918690651655197, 0.03427370637655258, 0.013504477217793465, -0.02700895443558693, 0.048365332186222076, 0.015066896565258503, -0.02131657302379608, -0.043071020394563675, -0.011354906484484673, 0.01960487850010395, 0.014907668344676495, -0.02521764487028122, -0.055092692375183105, 0.015096751041710377, 0.012379933148622513, 0.009638235904276371, 0.05238582566380501, 0.008473885245621204, -0.013882641680538654, 0.053659647703170776, -0.024401605129241943, -0.003731893142685294, 0.00882717128843069, 0.01822158880531788, 0.034811098128557205, 0.0014852933818474412, 0.03867236524820328, -0.03741844743490219, -0.00015938293654471636, 0.006005859933793545, 0.05103239417076111, 0.011832589283585548, -0.021018020808696747, -0.009284949861466885, 0.012021671049296856, 0.03393534570932388, 0.04422542080283165, 0.0073493411764502525, -0.0525052472949028, -0.00619991822168231, -0.0663580372929573, 0.031487226486206055, 0.03765728697180748, -0.01816187985241413, 0.03640337288379669, -0.02495890110731125, -0.042553532868623734, -0.008802291937172413, 0.04549923911690712, 0.04932069778442383, -0.027546346187591553, 0.023804502561688423, 0.04062290117144585, 0.03383582830429077, -0.010588624514639378, 0.017176659777760506, 0.009692969731986523, -0.023565661162137985, -0.04534001275897026, -0.005533153191208839, 0.03069108910858631, -0.01722641848027706, 0.03041244111955166, -0.09147616475820541, -0.05377906560897827, -0.04084183648228645, 0.0007389148231595755, -0.04100106656551361, -0.009518815204501152, -0.022968556731939316, -0.06257638335227966, 0.009812390431761742, 0.014907668344676495, 0.04601673036813736, -0.0029656109400093555, -0.029198331758379936, -0.03423389792442322, -0.005468467250466347, 0.021077731624245644, 0.03713979944586754, 0.02565552107989788, -0.010717996396124363, 0.014688731171190739, -0.019893478602170944, -0.02257048897445202, -0.001899533555842936, -0.015027089044451714, 0.005294312257319689, 0.040185023099184036, 0.03877187892794609, 0.035567428916692734, 0.010926982387900352, -0.02531716227531433, -0.02087869681417942, 0.0016420328756794333, -0.02241126075387001, -0.017584679648280144, -0.023486046120524406, 0.053739260882139206, 0.007991227321326733, 0.024083150550723076, 0.0048614125698804855, 0.05214698612689972, -0.020779181271791458, 0.08606243133544922, 0.04251372441649437, -0.07734473049640656, -0.003721941262483597, -0.00012820606934837997, 0.016221294179558754, -0.030452247709035873, 0.021515607833862305, -0.03220374882221222, 0.05246543884277344, 0.009374515153467655, -0.03244258835911751, 0.02044082246720791, -0.02284913696348667, 0.08733624964952469, 0.013146215118467808, 0.016420328989624977, 0.011942057870328426, 0.05533153563737869, -0.05326157808303833, 0.0001503641833551228, -0.02872064895927906, -0.08068850636482239, -0.09243152290582657, 0.0030775677878409624, -0.01585308089852333, 0.03483100235462189, 0.03431351110339165, -0.002848678268492222, 0.005612767301499844, 0.008961519226431847, -0.004147377330809832 ]
716,934
pytorch_optimizer.optimizer.lomo
__init__
null
def __init__( self, model: nn.Module, lr: float = 1e-3, clip_grad_norm: Optional[float] = None, clip_grad_value: Optional[float] = None, ): self.validate_learning_rate(lr) self.validate_non_negative(clip_grad_norm, 'clip_grad_norm') self.validate_non_negative(clip_grad_value, 'clip_grad_value') self.model = model self.lr = lr self.clip_grad_norm = clip_grad_norm self.clip_grad_value = clip_grad_value self.local_rank: int = int(os.environ.get('LOCAL_RANK', 0)) self.gather_norm: bool = False self.grad_norms: List[torch.Tensor] = [] self.clip_coef: Optional[float] = None p0: torch.Tensor = next(iter(self.model.parameters())) self.grad_func: Callable[[Any], Any] = ( self.fuse_update_zero3() if hasattr(p0, 'ds_tensor') else self.fuse_update() ) self.loss_scaler: Optional[DynamicLossScaler] = None if p0.dtype == torch.float16: if clip_grad_norm is None: raise ValueError( '[-] Loss scaling is recommended to be used with grad norm to get better performance.' ) self.loss_scaler = DynamicLossScaler(init_scale=2 ** 16) # fmt: skip for _, p in self.model.named_parameters(): if p.requires_grad: p.register_hook(self.grad_func) defaults: DEFAULTS = {'lr': lr} super().__init__(self.model.parameters(), defaults)
(self, model: torch.nn.modules.module.Module, lr: float = 0.001, clip_grad_norm: Optional[float] = None, clip_grad_value: Optional[float] = None)
[ -0.03888947144150734, -0.027101926505565643, -0.027347106486558914, 0.037531547248363495, 0.018341422080993652, 0.029365135356783867, -0.05367577075958252, -0.02853529155254364, 0.01162723544985056, -0.04420801252126694, -0.024857576936483383, 0.0349477156996727, 0.028440991416573524, 0.03053445927798748, -0.0203500185161829, 0.08479489386081696, 0.0037814448587596416, 0.003581056371331215, 0.04880987107753754, -0.02568742074072361, -0.0015983912162482738, -0.08102287352085114, 0.010222160257399082, 0.05597670003771782, -0.029780056327581406, -0.00006203196244314313, -0.022254886105656624, 0.0165402851998806, -0.03896491229534149, -0.01559728104621172, -0.001065594144165516, 0.003609346691519022, 0.008034391328692436, 0.04635806009173393, 0.016219662502408028, -0.047112464904785156, -0.012051586993038654, 0.016521424055099487, -0.14590153098106384, 0.0003306406724732369, 0.011532935313880444, -0.06005047261714935, 0.005393981002271175, 0.01985965669155121, -0.011730966158211231, -0.018907222896814346, -0.015436970628798008, 0.013994175009429455, 0.005978643428534269, -0.043453607708215714, -0.046131741255521774, 0.012221327982842922, 0.009580917656421661, -0.028554150834679604, -0.04205796495079994, 0.03881403058767319, 0.044924695044755936, 0.06404881179332733, 0.02925197407603264, -0.018643183633685112, -0.013352932408452034, -0.030911659821867943, -0.0026734154671430588, 0.014069614931941032, 0.024442655965685844, -0.0319301038980484, -0.06940507143735886, -0.00480696139857173, 0.029214253649115562, 0.0036635692231357098, -0.002416447037830949, -0.002508389763534069, 0.01659686490893364, 0.04907391220331192, 0.05246872454881668, -0.0785333439707756, -0.016917485743761063, -0.02779974788427353, -0.008425737731158733, -0.020934682339429855, 0.005214810371398926, 0.002715850481763482, -0.02448037639260292, -0.015795310959219933, -0.05816446617245674, -0.08283344656229019, 0.01687033660709858, -0.02913881279528141, 0.06770766526460648, 0.015003188513219357, -0.034683674573898315, 0.04650894179940224, -0.0323638878762722, 0.006563305389136076, 0.025706280022859573, 0.03053445927798748, -0.004788101185113192, -0.02417861483991146, -0.01777561940252781, -0.017275827005505562, -0.030308138579130173, 0.0815509557723999, -0.012523088604211807, 0.05258188396692276, 0.035475797951221466, -0.0381162092089653, -0.0629926472902298, 0.0021488696802407503, 0.005356261041015387, -0.047829147428274155, -0.0019673414062708616, -0.002682845573872328, 0.0005142316804267466, -0.01720038801431656, -0.02872389182448387, -0.013673553243279457, -0.03338233008980751, -0.022745247930288315, 0.01938815601170063, -0.0021476908586919308, 0.04484925419092178, 0.025046177208423615, -0.07498764991760254, -0.025234779343008995, -0.04175620153546333, 0.052921365946531296, 0.007110247854143381, 0.014682567678391933, 0.0039228955283761024, -0.055825818330049515, -0.01247593853622675, -0.023895712569355965, -0.006596310529857874, 0.03181694447994232, 0.04005879536271095, -0.05759866535663605, -0.026196641847491264, 0.04745194688439369, -0.02234918810427189, 0.05778726562857628, 0.008972680196166039, 0.07212091982364655, 0.04005879536271095, 0.012211897410452366, 0.024008873850107193, 0.041416723281145096, 0.005780612584203482, 0.033099427819252014, 0.02749798819422722, 0.0003377131943125278, 0.0028219386003911495, 0.026064621284604073, 0.017275827005505562, 0.03155290335416794, 0.013371792621910572, 0.028422130271792412, -0.03651310130953789, -0.058126747608184814, 0.023669391870498657, -0.009250866249203682, -0.05099763721227646, -0.0053185406140983105, 0.019265566021203995, -0.06427513062953949, -0.030440159142017365, -0.04356677085161209, -0.00496962945908308, -0.05616530030965805, -0.022028565406799316, 0.08328608423471451, -0.01889779418706894, -0.09588461369276047, 0.013588682748377323, 0.040021076798439026, -0.046207182109355927, 0.05563721805810928, 0.019671056419610977, 0.007081957533955574, -0.07627014070749283, -0.011655525304377079, 0.040134236216545105, 0.002232561120763421, 0.005016779527068138, -0.043038688600063324, -0.006436000112444162, 0.05028095468878746, -0.03228844702243805, -0.016644014045596123, 0.0034608235582709312, 0.02549881860613823, 0.008920814841985703, 0.007756205275654793, 0.00599750317633152, -0.028629591688513756, -0.007223408203572035, -0.012098737061023712, 0.051337119191884995, -0.024310635402798653, 0.028308970853686333, 0.012617389671504498, 0.01993509754538536, 0.01374899409711361, 0.008166411891579628, 0.010523920878767967, -0.053713489323854446, -0.015653861686587334, -0.019293855875730515, 0.11293411999940872, -0.033721812069416046, -0.0025437523145228624, 0.001110976212657988, 0.030440159142017365, 0.04718790575861931, 0.06329440325498581, 0.04560365900397301, -0.028139229863882065, -0.026026900857686996, 0.032194145023822784, 0.041416723281145096, 0.030459018424153328, -0.010806822218000889, -0.03226958587765694, -0.05080903694033623, 0.0058183325454592705, -0.02101012133061886, 0.009854388423264027, 0.0025555400643497705, -0.025291359052062035, 0.06491637229919434, 0.004545277915894985, 0.019765356555581093, -0.02180224470794201, -0.03877631202340126, 0.0048281787894666195, -0.01359811332076788, 0.047527384012937546, -0.013352932408452034, 0.07053667306900024, -0.04979059472680092, -0.037342946976423264, -0.033533211797475815, 0.001295451307669282, -0.004590070340782404, 0.015210648998618126, 0.07276216149330139, -0.021066702902317047, 0.04484925419092178, 0.005747607443481684, -0.003500901162624359, 0.04119040071964264, -0.02695104479789734, 0.012843710370361805, -0.0381162092089653, 0.06412424892187119, -0.022632088512182236, -0.0661611407995224, -0.037588126957416534, -0.03749382495880127, -0.0020368879195302725, -0.03756926581263542, -0.06665150076150894, -0.11029370874166489, -0.013616973534226418, -0.01447510626167059, -0.030006377026438713, -0.026008041575551033, -0.012202467769384384, 0.01232505775988102, 0.021915405988693237, 0.02713964506983757, 0.10697434097528458, 0.03245818614959717, -0.04107724130153656, 0.019708776846528053, 0.0069310772232711315, 0.0005949763581156731, -0.02023685909807682, 0.0022408124059438705, 0.03670170158147812, 0.04809318855404854, 0.08668089658021927, 0.0032392176799476147, -0.045528218150138855, -0.032250724732875824, 0.053411729633808136, 0.007746775168925524, -0.010542781092226505, -0.01957675628364086, -0.006002218462526798, 0.000752634834498167, 0.036739423871040344, 0.010901122353971004, 0.10086367279291153, -0.003974760416895151, 0.07136651873588562, -0.012881429865956306, 0.03526833653450012, 0.036626264452934265, 0.006704756058752537, -0.039945635944604874, 0.02974233590066433, -0.03179808333516121, 0.011212313547730446, 0.017040075734257698, -0.00413507129997015, -0.05326084792613983, -0.01982193812727928, 0.02719622664153576, 0.02059520035982132, 0.0021913046948611736, 0.029270833358168602, -0.005747607443481684, 0.03421217203140259, 0.016115933656692505, 0.02744140662252903, 0.01613479293882847, 0.029308553785085678, -0.04598085954785347, 0.015738731250166893, 0.03340119123458862, -0.03181694447994232, 0.02150048315525055, 0.041529882699251175, 0.03685258328914642, -0.03575870022177696, -0.020991262048482895, 0.013673553243279457, 0.04650894179940224, -0.04145444184541702, 0.007449728902429342, -0.027309386059641838, 0.021217582747340202, 0.01681375503540039, 0.007737345062196255, -0.035117458552122116, -0.007473303936421871, 0.05518457666039467, 0.006704756058752537, 0.012579669244587421, -0.04730106517672539, 0.05880570784211159, 0.015078628435730934, -0.025668559595942497, 0.027309386059641838, 0.007100817747414112, -0.02696990594267845, -0.004186936188489199, 0.009387601166963577, 0.007374288979917765, -0.008081541396677494, -0.008034391328692436, 0.0037955897860229015, -0.048734430223703384, 0.07721313834190369, 0.020255718380212784, 0.023367630317807198, -0.027479127049446106, -0.04235972464084625, 0.05246872454881668, -0.08207903802394867, -0.007100817747414112, -0.017190957441926003, -0.035042017698287964, 0.02998751774430275, 0.02593260072171688, -0.002524892333894968, 0.016804326325654984, -0.026668144389986992, 0.007822215557098389, -0.017370127141475677, -0.0349477156996727, -0.056919701397418976, 0.02319789119064808, -0.026498403400182724, -0.030006377026438713, -0.05857938900589943, -0.04715018346905708, -0.008916099555790424, 0.017370127141475677, -0.02508389763534069, 0.004804603755474091, -0.0068273465149104595, 0.016992926597595215, -0.017511578276753426, 0.03785216808319092, -0.03404243290424347, 0.03660740330815315, 0.021726803854107857, 0.013833863660693169, -0.04111495986580849, 0.06238912418484688, -0.009015114977955818, 0.03108140081167221, -0.014956038445234299, -0.03211870416998863, 0.026762444525957108, 0.048017747700214386, 0.07151740044355392, -0.0003951774851884693, -0.0500546358525753, -0.0026687004137784243, -0.049526553601026535, 0.02084038220345974, 0.03870087116956711, -0.031420882791280746, -0.01738898828625679, 0.020500900223851204, 0.03907807171344757, 0.046320341527462006, 0.06657605618238449, -0.00010977152123814449, 0.01848287135362625, -0.0069216471165418625, 0.013522672466933727, 0.0016384689370170236, -0.018944943323731422, 0.021425044164061546, -0.013070031069219112, -0.012768269516527653, 0.030326997861266136, 0.05080903694033623, -0.017737898975610733, 0.06876382976770401, -0.0009447718039155006, -0.008274856954813004, -0.024084314703941345, -0.014126195572316647, 0.02872389182448387, -0.04511329531669617, -0.013334072194993496, -0.06031451374292374, 0.005752322264015675, 0.015380389988422394, -0.04258604720234871, -0.009986408986151218, 0.020821521058678627, 0.0028125084936618805, 0.028855912387371063, -0.03338233008980751, 0.01208930741995573, 0.03257134556770325, -0.04285008832812309, 0.0024376644287258387, -0.01347552239894867, -0.033646371215581894, -0.013975314795970917, -0.029591456055641174, 0.01902981474995613, -0.08720897883176804, -0.005431700963526964, 0.013673553243279457, 0.034381914883852005, 0.05239328369498253, 0.031232282519340515, -0.023179030045866966, 0.009500762447714806, -0.06480321288108826, 0.012900290079414845, 0.03441963344812393, -0.02429177425801754, -0.04356677085161209, 0.03941755369305611, -0.0003674767503980547, -0.03472139686346054, -0.025706280022859573, 0.054731935262680054, 0.09196171909570694, -0.03749382495880127, -0.06220052391290665, -0.02610234171152115, -0.02297157049179077, -0.038323670625686646, 0.04598085954785347, -0.03702232614159584, -0.01793592981994152, 0.003856885014101863, -0.03551352024078369, 0.009524337016046047, 0.014550547115504742, -0.024329494684934616, 0.03325030952692032, -0.07144195586442947, 0.011514075100421906, 0.07144195586442947, -0.025668559595942497, 0.01993509754538536, -0.01914297416806221, 0.03349548950791359, 0.02472555637359619, 0.05559949576854706, -0.04115268215537071, 0.0062851193360984325, 0.0025956176687031984, 0.01241935882717371, -0.026026900857686996, -0.009099985472857952, 0.013437801972031593, 0.019539035856723785, 0.05541089549660683, 0.0025437523145228624, 0.0033382331021130085, 0.004222298972308636, -0.033948130905628204, -0.016889195889234543, 0.01563500054180622, 0.040134236216545105, -0.0863036960363388, 0.02544223889708519, -0.02387685328722, -0.03888947144150734, -0.0018659685738384724, 0.004368464462459087, -0.01637997478246689, 0.03015725687146187, -0.030006377026438713, -0.011561225168406963, -0.03530605882406235, 0.044622935354709625, 0.010193869471549988, -0.02508389763534069, -0.009151850827038288, 0.04039827734231949, -0.018152819946408272, 0.00006626811227761209, 0.005672167055308819, 0.034985437989234924, 0.005823047831654549, -0.0003495007404126227, 0.0569574236869812, 0.0063605597242712975, 0.020217997953295708, 0.012749409303069115, 0.010363610461354256, 0.04518873617053032, 0.028610732406377792, 0.017049506306648254, -0.018303701654076576, -0.049187071621418, -0.07702454179525375, -0.04507557675242424, -0.012183607555925846, 0.04930023103952408, 0.037342946976423264, -0.0019944526720792055, 0.018737483769655228, -0.013796144165098667, -0.003201497485861182, 0.06408652663230896, -0.07762806117534637, -0.004524060059338808, -0.03296740725636482, -0.005653306841850281, -0.020444320514798164, -0.02163250371813774, 0.051110800355672836, 0.042133405804634094, -0.024631256237626076, -0.015814172104001045, 0.014682567678391933, 0.05088447779417038, -0.03543807938694954, -0.06257772445678711, 0.046433500945568085, -0.004851753823459148, -0.08803882449865341, 0.04790458828210831, 0.02240576781332493, -0.034985437989234924, -0.04209568351507187, -0.017398416996002197, -0.01308889128267765, -0.043529048562049866, -0.023160170763731003, 0.04390625283122063, -0.035230617970228195, 0.03321259096264839, 0.02514047734439373, -0.03743724524974823, 0.019972817972302437, 0.00516294501721859, 0.047829147428274155, -0.04367993026971817, 0.013805573806166649, -0.034570515155792236, -0.004425044637173414, 0.04281236603856087, -0.014258215203881264, 0.04854582995176315, -0.007303563412278891, 0.0011251212563365698, 0.03441963344812393, 0.0399833545088768, -0.025404518470168114, -0.04349132999777794, 0.03781444579362869, -0.020331159234046936, -0.12145887315273285, -0.03436305373907089, 0.08969850838184357, 0.07740174233913422, -0.0445852130651474, -0.013833863660693169, 0.02514047734439373, 0.012513658963143826, -0.038323670625686646, -0.061332959681749344, -0.04477381333708763, 0.014890028163790703, 0.004017195664346218, -0.04745194688439369, -0.0330805703997612, 0.0031284147407859564, -0.014286505989730358, -0.021594785153865814, -0.0030694769229739904, -0.06740590184926987, -0.0516388826072216, 0.004851753823459148, 0.09890222549438477, 0.022575508803129196, 0.011900706216692924, 0.010712522082030773, 0.004736235830932856, 0.03047787956893444, -0.02932741492986679, 0.002282068831846118, 0.03015725687146187, -0.07800526171922684, -0.02787518873810768, 0.008892524987459183, -0.0173324067145586, -0.00324157509021461, 0.01813396066427231, 0.02084038220345974, 0.009958119131624699, -0.02949715591967106, 0.05669338256120682, 0.010957702994346619, 0.02010483853518963, -0.018822353333234787, -0.002548467367887497, -0.014956038445234299, 0.018341422080993652, -0.008416308090090752, -0.08268256485462189, 0.04745194688439369, 0.01980307698249817, 0.0030364717822521925, 0.03247704729437828, -0.0053374008275568485, -0.00664817588403821, 0.052242401987314224, -0.034683674573898315, 0.0043543195351958275, 0.0036895019002258778, 0.0222926065325737, 0.03555123880505562, 0.0023362915962934494, 0.046735260635614395, -0.03519289568066597, -0.0073695736937224865, 0.015314379706978798, 0.06352072954177856, 0.007779780309647322, -0.018822353333234787, -0.010618221014738083, 0.008406877517700195, 0.02163250371813774, 0.034928854554891586, 0.004361391998827457, -0.04590541869401932, -0.011768685653805733, -0.1310397982597351, 0.055222295224666595, 0.009675217792391777, -0.017973650246858597, 0.004073775839060545, -0.04715018346905708, -0.05028095468878746, -0.02302815020084381, 0.0553731769323349, 0.035834141075611115, -0.03587185963988304, -0.0004868256510235369, 0.05137484148144722, 0.035343777388334274, -0.00014955448568798602, 0.031835805624723434, -0.00004733436435344629, -0.04364221170544624, -0.040813200175762177, 0.013654693029820919, 0.030855080112814903, -0.020331159234046936, 0.024272914975881577, -0.08517209440469742, -0.06853751093149185, -0.07064983248710632, -0.031100261956453323, -0.023556232452392578, -0.0043802522122859955, -0.0043189567513763905, -0.05427929013967514, 0.03877631202340126, -0.010307029820978642, -0.003267507767304778, 0.016342254355549812, -0.010655941441655159, -0.018737483769655228, -0.01293801050633192, 0.04160532355308533, 0.0460185781121254, 0.059824153780937195, -0.02949715591967106, 0.005445846356451511, 0.0030058242846280336, -0.018407432362437248, -0.012721119448542595, -0.021406183019280434, -0.007746775168925524, 0.053826648741960526, 0.010750241577625275, 0.025611979886889458, 0.0038946052081882954, 0.00023354074801318347, -0.07404465228319168, -0.0132680619135499, 0.008656773716211319, 0.02374483272433281, -0.0326467864215374, 0.04039827734231949, -0.004894189070910215, 0.028874773532152176, 0.01933157630264759, 0.06310580670833588, -0.01078796200454235, 0.05080903694033623, 0.04669754207134247, -0.04858354851603508, 0.009976979345083237, 0.013541532680392265, 0.0015512410318478942, -0.01763416826725006, -0.01232505775988102, -0.04054915904998779, 0.07513853162527084, -0.005568436812609434, -0.032382745295763016, 0.060503117740154266, -0.03417445346713066, 0.07891054451465607, 0.02410317398607731, 0.04707474261522293, -0.0036187765654176474, 0.05895658954977989, -0.07336568832397461, 0.011891276575624943, -0.0288370531052351, -0.05899431183934212, -0.04820634797215462, 0.00829843245446682, -0.03568325936794281, 0.028610732406377792, 0.0222926065325737, 0.0063369846902787685, 0.011127443052828312, 0.020519759505987167, -0.01126889418810606 ]
716,937
pytorch_optimizer.optimizer.lomo
__str__
null
def __str__(self) -> str: return 'LOMO'
(self) -> str
[ 0.000777419947553426, -0.03808728978037834, 0.02318429760634899, 0.008243585005402565, 0.01756843365728855, -0.08174015581607819, 0.01141612883657217, 0.03654502332210541, 0.05756679177284241, -0.0466703400015831, -0.030878867954015732, 0.0009764897404238582, -0.00040992660797201097, 0.01672186329960823, 0.006060103420168161, 0.014291116036474705, -0.04103771597146988, -0.09005498141050339, 0.015431052073836327, 0.013897167518734932, 0.01735050417482853, 0.04908432438969612, 0.043049365282058716, -0.032655827701091766, -0.017803125083446503, 0.055488087236881256, -0.035840943455696106, 0.0037613713648170233, -0.03493570163846016, -0.026553815230727196, -0.027911679819226265, -0.05357701703906059, -0.0025816208217293024, 0.007267095148563385, -0.0549851730465889, 0.006831237114965916, -0.024827146902680397, 0.02185995876789093, -0.05786854028701782, -0.033393435180187225, -0.008834508247673512, -0.0060265762731432915, -0.020552383735775948, -0.011625676415860653, -0.05139772593975067, -0.05327526852488518, -0.013922312296926975, 0.06645159423351288, 0.02199406921863556, -0.027609933167696, -0.0025418070144951344, 0.02881692349910736, -0.04599979147315025, -0.016755390912294388, -0.02356986328959465, 0.02028416469693184, 0.02931983768939972, 0.005532044917345047, -0.0025418070144951344, 0.04750853031873703, -0.04787733405828476, 0.007803536020219326, 0.0480784997344017, -0.010158846154808998, 0.005288970191031694, 0.01507901307195425, 0.003574874484911561, 0.06987140327692032, 0.05240355059504509, 0.04314994812011719, 0.029370129108428955, -0.04787733405828476, -0.01411509606987238, 0.047676168382167816, 0.02856546826660633, -0.04006541520357132, -0.04787733405828476, -0.011583766900002956, 0.022647855803370476, -0.021206172183156013, -0.02063620276749134, 0.0047022379003465176, -0.019730959087610245, 0.016411732882261276, -0.04898374155163765, -0.1164746880531311, -0.019093936309218407, -0.04371991753578186, -0.012539301998913288, -0.0023427370470017195, -0.0739617645740509, 0.0376514308154583, -0.05327526852488518, 0.05840498208999634, -0.05853909254074097, -0.01882571540772915, 0.005909229628741741, -0.009605641476809978, 0.0324714258313179, -0.01013370044529438, 0.009027291089296341, 0.06474168598651886, -0.050257787108421326, 0.03408074751496315, -0.031197380274534225, -0.05290646478533745, -0.03159971162676811, 0.03775201365351677, 0.016629662364721298, 0.002420269651338458, -0.06464110314846039, 0.027626696974039078, 0.012966778129339218, 0.02943718433380127, 0.009261984378099442, -0.03674618899822235, -0.007811917923390865, 0.010376774705946445, 0.01661289855837822, -0.02479361928999424, -0.00891832634806633, 0.021038534119725227, -0.06410466134548187, -0.030878867954015732, 0.043049365282058716, 0.09669344127178192, -0.022815493866801262, -0.03394663706421852, 0.015615453943610191, -0.054281093180179596, 0.03996483236551285, 0.01281590387225151, -0.023737501353025436, -0.0037718487437814474, 0.07013962417840958, -0.021642029285430908, 0.024357760325074196, 0.017149338498711586, 0.05981313809752464, 0.12559418380260468, -0.04009894281625748, 0.01648717001080513, 0.05019073560833931, 0.01968066766858101, -0.005439843982458115, 0.036209747195243835, -0.019496267661452293, 0.036813244223594666, -0.01238842774182558, 0.0016470405971631408, 0.035740360617637634, 0.006034958176314831, 0.03175058588385582, -0.01746785081923008, -0.03322579711675644, 0.01043544802814722, -0.007216803729534149, -0.030459774658083916, 0.026469996199011803, -0.02931983768939972, 0.006386997178196907, -0.031180616468191147, 0.024391287937760353, -0.018641315400600433, -0.010494121350347996, 0.026687925681471825, 0.01154185738414526, -0.014131859876215458, 0.009722988121211529, 0.02112235315144062, -0.052235912531614304, -0.06467463076114655, -0.03761790320277214, 0.01216211635619402, 0.007686189375817776, 0.033896345645189285, -0.005934375338256359, 0.07329121232032776, -0.0020608962513506413, 0.0006946488283574581, -0.014450371265411377, 0.006705509033054113, -0.06507696211338043, 0.02051885798573494, 0.06467463076114655, -0.022027596831321716, 0.03216967731714249, 0.027995498850941658, 0.0005330355488695204, -0.010242665186524391, 0.004329244140535593, 0.01368761993944645, -0.02419012226164341, -0.00885127205401659, 0.003551824251189828, -0.02162526547908783, 0.025682099163532257, -0.07503464072942734, -0.005473371595144272, 0.025564752519130707, -0.008545332588255405, 0.06135540455579758, -0.025464169681072235, 0.028381066396832466, 0.03577388823032379, -0.006169068161398172, 0.009924152866005898, 0.02063620276749134, 0.02296636812388897, -0.037182047963142395, 0.058203816413879395, 0.02211141586303711, -0.033410198986530304, 0.029772458598017693, 0.062361232936382294, -0.03771848604083061, -0.042680565267801285, 0.010636613704264164, -0.03285699337720871, 0.030493302270770073, 0.046603284776210785, -0.009144637733697891, -0.05126361548900604, -0.0322367325425148, -0.03124767169356346, 0.016168657690286636, 0.005817029159516096, -0.02465950883924961, 0.015548398718237877, -0.008101092651486397, -0.010100172832608223, -0.07557108253240585, -0.04076949506998062, 0.03664560616016388, 0.011634058319032192, 0.03946191817522049, -0.030962686985731125, 0.023754265159368515, -0.08925032615661621, -0.03969661146402359, -0.01733374036848545, -0.024273941293358803, -0.003604210913181305, 0.023670446127653122, 0.04774322360754013, -0.039026062935590744, 0.001758100581355393, 0.005825410597026348, -0.006642644759267569, 0.0010990748414769769, 0.0707431212067604, -0.031951747834682465, 0.001959265908226371, -0.0020766123197972775, 0.026101192459464073, -0.08113665878772736, -0.017434323206543922, -0.00890994444489479, 0.010192373767495155, -0.04211059585213661, -0.06333353370428085, -0.024273941293358803, -0.018959825858473778, 0.046335067600011826, -0.022932840511202812, 0.012069916352629662, -0.04693856090307236, 0.021642029285430908, 0.06574751436710358, -0.02015005424618721, 0.06967023760080338, 0.0007077454938553274, -0.07127955555915833, 0.022815493866801262, -0.01239680964499712, -0.027392003685235977, -0.0018293466418981552, 0.026469996199011803, -0.07490053027868271, -0.024642745032906532, -0.023988958448171616, -0.027794335037469864, -0.0010115888435393572, -0.02782786265015602, -0.037550847977399826, -0.04496043547987938, 0.008109474554657936, -0.022564036771655083, -0.007401205599308014, 0.0014092045603320003, 0.06487579643726349, 0.03567330539226532, -0.03661207854747772, 0.021642029285430908, 0.05468342453241348, 0.014400079846382141, 0.041942957788705826, 0.05572277680039406, 0.0058002653531730175, -0.029705403372645378, -0.03332637995481491, -0.04154062643647194, 0.00020928522280883044, -0.06581456959247589, -0.027660224586725235, -0.007355105131864548, 0.01098865270614624, -0.04589920863509178, 0.015581926330924034, 0.012438719160854816, -0.008549523539841175, 0.058304399251937866, 0.04019952565431595, 0.06045016273856163, 0.01484431978315115, 0.11707818508148193, 0.017057137563824654, 0.005863129161298275, 0.03822140023112297, 0.05605805292725563, -0.025413878262043, 0.011575384996831417, -0.060886021703481674, 0.002698967233300209, 0.0420435406267643, -0.045128073543310165, -0.01197771541774273, 0.02479361928999424, 0.04874904826283455, -0.002296636812388897, -0.03855667635798454, -0.04164120927453041, 0.02784462459385395, -0.015037103556096554, 0.002072421368211508, -0.02603413723409176, 0.03580741584300995, -0.014718592166900635, -0.017283448949456215, -0.011793313547968864, 0.08925032615661621, -0.0383555106818676, -0.03674618899822235, 0.03506981208920479, 0.03996483236551285, 0.04650270566344261, -0.009622405283153057, 0.003365327138453722, 0.03567330539226532, 0.011432892642915249, -0.012899722903966904, 0.0009225313551723957, 0.007740671746432781, 0.0013170038582757115, 0.004647755995392799, 0.00010018973262049258, -0.0258832648396492, 0.05629274621605873, -0.013955839909613132, 0.011005416512489319, -0.01185198687016964, -0.06739036738872528, 0.0041574155911803246, 0.03567330539226532, -0.026419704779982567, -0.005976284854114056, 0.029504239559173584, 0.005796074401587248, 0.0566280223429203, -0.02004947140812874, -0.04234528914093971, 0.024760091677308083, -0.010200755670666695, -0.00021400002879090607, -0.01465153694152832, 0.0803990513086319, 0.04422283172607422, 0.012095061130821705, -0.059276700019836426, -0.012363282032310963, 0.052101802080869675, 0.00022146514675114304, 0.037550847977399826, 0.02321782521903515, 0.026956144720315933, 0.004350198898464441, 0.04801144450902939, 0.02269814722239971, -0.00787897314876318, -0.015975873917341232, 0.0034701009280979633, -0.013000305742025375, 0.0034680054523050785, -0.003136920975521207, -0.03185116872191429, -0.06095307692885399, -0.031331490725278854, -0.017166102305054665, -0.043183475732803345, 0.008750689215958118, 0.03347725421190262, -0.021960541605949402, -0.02601737342774868, 0.0012258508941158652, -0.08415413647890091, 0.05907553434371948, -0.021155880764126778, 0.008147193118929863, -0.026352649554610252, -0.03102974221110344, -0.008172338828444481, 0.010209137573838234, -0.030727993696928024, -0.09448061883449554, 0.07134661078453064, 0.0038221399299800396, 0.01087968796491623, -0.005708064418286085, -0.008809362538158894, 0.002330164425075054, -0.040367163717746735, 0.019211282953619957, 0.0651775449514389, 0.04030010849237442, 0.016755390912294388, 0.030627410858869553, 0.050492480397224426, 0.025263004004955292, 0.0734923779964447, 0.005171623546630144, -0.051129505038261414, 0.020300928503274918, -0.016931409016251564, -0.05022425949573517, 0.03369518369436264, -0.04371991753578186, -0.005091995932161808, -0.05314115807414055, -0.0385902039706707, 0.02749258652329445, 0.03185116872191429, -0.05005662515759468, 0.014861083589494228, 0.053174685686826706, 0.029353365302085876, -0.05273882672190666, -0.05957844480872154, -0.009370948188006878, 0.056594494730234146, 0.0011085044825449586, -0.020971478894352913, 0.058438509702682495, 0.013469690456986427, -0.039394862949848175, 0.08676928281784058, -0.04076949506998062, -0.006852191872894764, -0.04335111379623413, 0.030258608981966972, -0.01588367484509945, -0.06454052031040192, 0.05421403795480728, 0.0021415718365460634, 0.012874577194452286, 0.029504239559173584, 0.003589542815461755, -0.0015454102540388703, 0.020300928503274918, -0.03221996873617172, -0.01216211635619402, 0.03711499273777008, -0.02465950883924961, 0.0025313296355307102, -0.0346674807369709, -0.0029001326765865088, 0.043887555599212646, -0.04261351004242897, -0.004434017930179834, 0.0176857803016901, -0.04777675122022629, -0.047575585544109344, -0.07422998547554016, 0.0251791849732399, 0.025967083871364594, -0.025698862969875336, 0.027174074202775955, -0.008943472057580948, 0.018641315400600433, -0.013461308553814888, -0.01699008233845234, 0.0007161273970268667, 0.06822855025529861, -0.06430582702159882, -0.029034852981567383, -0.009119492024183273, 0.08073432743549347, -0.022547272965312004, -0.020435038954019547, -0.08636695146560669, 0.004077787511050701, 0.015917202457785606, -0.010594704188406467, 0.008109474554657936, -0.02782786265015602, 0.02662087045609951, -0.02725789323449135, 0.025564752519130707, -0.006537870969623327, -0.03196851164102554, -0.035338032990694046, -0.009379330091178417, -0.05042542517185211, 0.0381208173930645, 0.013478072360157967, -0.008155575022101402, -0.003637738525867462, -0.019211282953619957, 0.05605805292725563, -0.01325176190584898, 0.012740466743707657, -0.003480578074231744, -0.04770969599485397, -0.010116936638951302, -0.04314994812011719, -0.027609933167696, 0.016562607139348984, -0.059544917196035385, 0.014911375008523464, -0.02955453097820282, 0.10574587434530258, 0.01434978935867548, 0.017006846144795418, -0.010829396545886993, 0.04117182269692421, 0.003539251396432519, 0.08884799480438232, -0.10990329086780548, -0.0034701009280979633, 0.029604822397232056, 0.038154345005750656, -0.013176324777305126, -0.06514401733875275, -0.019596850499510765, -0.03183440491557121, 0.0015171213308349252, -0.031080033630132675, 0.007518551778048277, 0.04948665574193001, -0.005389552563428879, 0.01756843365728855, 0.02269814722239971, -0.024609217420220375, -0.045027490705251694, -0.06464110314846039, -0.0034826735500246286, 0.0510624498128891, -0.014123477973043919, -0.0017518141539767385, 0.036209747195243835, 0.020317692309617996, -0.028280483558773994, -0.021088825538754463, 0.05273882672190666, 0.07382765412330627, 0.0019582181703299284, 0.06440640985965729, -0.03178411349654198, 0.032186441123485565, -0.0019760297145694494, -0.03233731538057327, 0.05847203731536865, -0.07630869001150131, 0.023134006187319756, 0.029722167178988457, -0.043183475732803345, 0.07630869001150131, 0.05676213279366493, 0.026805272325873375, -0.026956144720315933, 0.02222876250743866, -0.056728605180978775, 0.0681614950299263, -0.005762546788901091, -0.027878152206540108, 0.0027324948459863663, -0.016881119459867477, 0.0049411216750741005, 0.016269240528345108, 0.0436863899230957, -0.04006541520357132, -0.020787077024579048, 0.012681793421506882, -0.026721453294157982, 0.002648676047101617, 0.042077068239450455, -0.0702737346291542, -0.01214535254985094, -0.03483511880040169, 0.014928138814866543, 0.03674618899822235, 0.03250495344400406, 0.02990656904876232, 0.00123737589456141, 0.022513745352625847, 0.04113829508423805, 0.03506981208920479, 0.014274352230131626, 0.011709494516253471, -0.0027785953134298325, 0.037047937512397766, -0.00989062525331974, -0.005087804980576038, -0.008243585005402565, -0.030124498531222343, -0.012773994356393814, -0.028146373108029366, 0.03188469633460045, -0.02916896343231201, 0.016436878591775894, -0.00848246831446886, 0.02051885798573494, 0.03530450537800789, -0.018389858305454254, 0.024592453613877296, -0.05015720799565315, 0.012380045838654041, -0.016034547239542007, -0.04107123985886574, 0.03631033003330231, -0.08341652899980545, -0.007589797955006361, -0.009546968154609203, 0.00023691925161983818, -0.06454052031040192, -0.047810278832912445, -0.00678094569593668, 0.02051885798573494, 0.010343247093260288, -0.010485739447176456, 0.02271491102874279, -0.042311761528253555, 0.02502831257879734, -0.012111824937164783, 0.030258608981966972, -0.0549851730465889, 0.04288173094391823, -0.06658570468425751, -0.00971460621803999, -0.014685064554214478, -0.060886021703481674, -0.014433607459068298, 0.0031934985890984535, -0.0011682254262268543, 0.029286310076713562, -0.0016208472661674023, -0.0209044236689806, 0.024625981226563454, 0.005054277367889881, 0.0004672901413869113, -0.0217258483171463, -0.008029846474528313, -0.03506981208920479, 0.035237450152635574, -0.03275641053915024, 0.09454767405986786, 0.015322087332606316, -0.000571015989407897, -0.013444545678794384, 0.007841254584491253, -0.03983072191476822, 0.005364406853914261, 0.03698088228702545, 0.017384031787514687, -0.021692320704460144, 0.01756843365728855, 0.024961257353425026, 0.019077172502875328, 0.005054277367889881, 0.060383107513189316, -0.017023609951138496, 0.010577940382063389, 0.015699272975325584, -0.021440865471959114, -0.06920085102319717, 0.02759316936135292, 0.10360011458396912, -0.0478438064455986, 0.05304057523608208, 0.04603331908583641, -0.06608279049396515, -0.06695450842380524, 0.001944597577676177, -0.048782575875520706, 0.03932780772447586, 0.07925911247730255, 0.03300786763429642, -0.02259756438434124, -0.054884590208530426, -0.017300212755799294, 0.019093936309218407, 0.0341980941593647, 0.03453337028622627, -0.010644995607435703, 0.016948172822594643, 0.02004947140812874, -0.03724910318851471, -0.0038682403974235058, -0.017451087012887, -0.002359500853344798, -0.025598280131816864, 0.055018700659275055, 0.08160604536533356, -0.028381066396832466, -0.04284820333123207, 0.04314994812011719, -0.0767110213637352, -0.01793723553419113, 0.0383555106818676, -0.02745905891060829, 0.014282734133303165, 0.005511090159416199, -0.03066093847155571, 0.011466420255601406, -0.0017518141539767385, 0.05364407226443291, 0.056359801441431046, -0.0258832648396492, -0.021206172183156013, -0.061154238879680634, -0.01770254410803318, -0.012304608710110188, 0.02638617716729641, -0.03079504892230034, 0.01391393132507801, 0.03996483236551285, -0.015682509168982506, 0.00891832634806633, 0.018976589664816856, 0.040467746555805206, 0.020367983728647232, 0.020552383735775948, 0.0009188642725348473, 0.019496267661452293, -0.00564520014449954, -0.015950730070471764, 0.022916076704859734, 0.03257200866937637, 0.0466703400015831, -0.03101297840476036, 0.05951138958334923, 0.050391897559165955, 0.019462740048766136, 0.026084428653120995, -0.00022735865786671638, -0.014198915101587772, -0.00506685022264719, -0.007702953182160854, 0.03262230008840561, 0.006525298114866018, 0.00916140154004097, -0.00577092869207263, -0.033644892275333405, 0.02527976781129837, 0.018624551594257355, -0.005326688755303621, 0.036343857645988464, -0.015422670170664787, -0.009605641476809978 ]
716,948
pytorch_optimizer.optimizer.lomo
fuse_update
null
def fuse_update(self) -> Callable[[Any], Any]: @torch.no_grad() def func(x: Any) -> Any: for _, p in self.model.named_parameters(): if not p.requires_grad or p.grad is None: continue if self.loss_scaler and self.loss_scaler.has_overflow_serial or has_overflow(p.grad): p.grad = None self.loss_scaler.has_overflow_serial = True break grad_fp32 = p.grad.to(torch.float32) p.grad = None if self.loss_scaler: grad_fp32.div_(self.loss_scaler.loss_scale) if self.gather_norm: self.grad_norms.append(torch.norm(grad_fp32, 2.0)) else: if self.clip_grad_value is not None and self.clip_grad_value > 0.0: grad_fp32.clamp_(min=-self.clip_grad_value, max=self.clip_grad_value) if self.clip_grad_norm is not None and self.clip_grad_norm > 0.0 and self.clip_coef is not None: grad_fp32.mul_(self.clip_coef) p_fp32 = p.to(torch.float32) p_fp32.add_(grad_fp32, alpha=-self.lr) p.copy_(p_fp32) return x return func
(self) -> Callable[[Any], Any]
[ -0.02004615031182766, -0.06410279870033264, 0.011032862588763237, 0.07603325694799423, -0.003106498857960105, 0.017830228433012962, -0.06428980082273483, -0.05191055312752724, 0.029770029708743095, -0.035772655159235, -0.02694636397063732, -0.039157312363386154, 0.005633304826915264, 0.016474494710564613, -0.00026252720272168517, 0.06200842931866646, -0.04379485547542572, 0.03302378952503204, 0.03930690884590149, -0.00594652583822608, 0.00008648642688058317, -0.04514123871922493, 0.0006007300107739866, 0.03734343498945236, -0.019466457888484, -0.00870474148541689, 0.06563618034124374, -0.0054509821347892284, 0.0031929851975291967, -0.02324381098151207, -0.0015310434391722083, 0.010490569286048412, 0.03547345846891403, 0.03132211044430733, 0.012912189587950706, -0.042897265404462814, -0.012594292871654034, 0.052508946508169174, -0.05897906422615051, -0.06328000873327255, 0.005212560296058655, -0.06563618034124374, 0.02114943601191044, 0.011304009705781937, 0.010724316351115704, 0.025188585743308067, -0.050638969987630844, 0.07191930711269379, -0.0006878008134663105, -0.0014375445898622274, -0.015128111466765404, -0.047983601689338684, 0.01922336034476757, 0.03235059604048729, 0.007035787217319012, 0.0437200553715229, 0.04701121523976326, 0.03758653253316879, 0.06170923262834549, -0.025861777365207672, 0.05778228119015694, -0.03205139935016632, -0.0059138014912605286, -0.019335558637976646, 0.01364148035645485, -0.03388397768139839, -0.04678681865334511, 0.002685754094272852, -0.021018538624048233, 0.06017585098743439, -0.018269672989845276, 0.006820740178227425, 0.02060714364051819, -0.0007421470363624394, 0.024627594277262688, -0.03547345846891403, 0.00555383088067174, -0.02621707320213318, 0.008227897807955742, -0.06664597243070602, 0.02459019422531128, -0.02889114059507847, -0.0307611171156168, 0.008901089429855347, -0.03358478099107742, -0.05179835483431816, 0.017026137560606003, -0.03870851919054985, -0.009055362083017826, -0.026011375710368156, -0.01974695362150669, 0.02030794695019722, -0.017540382221341133, 0.014183773659169674, 0.04443064704537392, 0.003111173864454031, -0.030312322080135345, -0.05497731640934944, 0.014501669444143772, 0.00601665023714304, 0.02595527656376362, 0.06604757905006409, 0.020401446148753166, 0.014735416509211063, 0.1000063568353653, -0.05512691289186478, 0.0037025539204478264, -0.039680905640125275, -0.0015170186525210738, -0.016231397166848183, 0.0019669816829264164, -0.04278506711125374, -0.005147111136466265, 0.0062737721018493176, -0.03253759443759918, -0.012837390415370464, -0.04540303349494934, -0.005058287177234888, 0.011575155891478062, 0.02533818408846855, 0.029059438034892082, 0.03889551758766174, -0.051125165075063705, -0.06462639570236206, -0.0009455069666728377, 0.04132648557424545, 0.035361260175704956, 0.051424358040094376, 0.04024190083146095, -0.03283679112792015, -0.05097556486725807, 0.027694355696439743, -0.013183335773646832, 0.039419110864400864, 0.028704142197966576, -0.04345826059579849, 0.003889551619067788, -0.009948275983333588, 0.0009472600650042295, 0.02272021770477295, -0.02159823104739189, 0.07565926015377045, 0.052172351628541946, 0.011201160959899426, 0.06376620382070541, 0.028498444706201553, 0.0272829607129097, 0.03124731034040451, -0.009321833960711956, -0.0291342381387949, 0.0009834908414632082, 0.056735094636678696, 0.0038615018129348755, 0.014193123206496239, -0.03289289027452469, 0.04458024352788925, -0.04293466731905937, -0.04140128567814827, -0.011191810481250286, -0.017502982169389725, -0.053593531250953674, -0.019877852872014046, 0.0023491582833230495, -0.03208880126476288, 0.008854339830577374, -0.05161135643720627, 0.024683693423867226, -0.008826290257275105, -0.010350321419537067, 0.09933316707611084, 0.002690429100766778, -0.05905386433005333, 0.02889114059507847, 0.033547382801771164, 0.02273891679942608, 0.1013527363538742, -0.013706929050385952, -0.028386246412992477, -0.0181574746966362, 0.020158348605036736, 0.02159823104739189, -0.035136863589286804, 0.012650392949581146, -0.08355055749416351, 0.002040612045675516, 0.0534813329577446, -0.020476244390010834, -0.004922713618725538, -0.007638854905962944, 0.00568472919985652, 0.013033737428486347, -0.02191612683236599, 0.024234898388385773, -0.013417082838714123, -0.013996776193380356, -0.010976763442158699, 0.0015520807355642319, 0.009443382732570171, 0.05666029453277588, -0.01176215335726738, -0.012248347513377666, -0.04357045888900757, 0.024777190759778023, 0.03904511407017708, -0.07816502451896667, -0.021523432806134224, 0.02565607987344265, 0.07049812376499176, -0.014679317362606525, -0.006666467059403658, 0.0066617922857403755, 0.03440757095813751, -0.0013802765170112252, 0.05793187767267227, -0.0015801303088665009, -0.03307988867163658, 0.024739792570471764, 0.023973101750016212, 0.038334522396326065, 0.03096681460738182, -0.006960988510400057, -0.060475047677755356, -0.007779103238135576, -0.023879602551460266, 0.04749741032719612, 0.005497731734067202, -0.005039587151259184, -0.011724754236638546, 0.03595965355634689, -0.049292586743831635, 0.04723561182618141, -0.040503695607185364, -0.026497570797801018, 0.031060313805937767, 0.01707288809120655, -0.007162010762840509, -0.021729130297899246, 0.020925039425492287, -0.0012353534111753106, -0.016352945938706398, -0.014333372004330158, -0.023711305111646652, 0.015941550955176353, 0.038858115673065186, 0.030125325545668602, -0.0251137875020504, 0.05078856647014618, 0.035361260175704956, -0.027189461514353752, 0.034613270312547684, -0.010499918833374977, 0.005708103999495506, -0.032967690378427505, 0.07203150540590286, -0.04323386028409004, -0.03979310393333435, -0.0034781566355377436, 0.0006632573786191642, -0.0009969313396140933, -0.04214927554130554, -0.03390267863869667, -0.03302378952503204, -0.04024190083146095, 0.05127476155757904, -0.04132648557424545, -0.02943343296647072, 0.013959376141428947, -0.0014842940727248788, -0.021018538624048233, 0.047160811722278595, 0.018241623416543007, 0.031116412952542305, -0.019840452820062637, 0.010481219738721848, 0.005656679626554251, 0.01522161066532135, 0.03442627191543579, 0.0043547083623707294, 0.06638417392969131, -0.003143898444250226, 0.06941353529691696, -0.047460008412599564, -0.04547783359885216, 0.004417819902300835, -0.020214447751641273, 0.015885451808571815, 0.014071574434638023, -0.005109711550176144, -0.011649955064058304, -0.0314343087375164, 0.04091509059071541, -0.003361283103004098, 0.06967533379793167, 0.008470994420349598, 0.042897265404462814, 0.007007737644016743, -0.0033308961428701878, 0.01602569967508316, 0.028479745611548424, -0.0075313313864171505, 0.004324321169406176, -0.03446367010474205, -0.06335481256246567, -0.0008362302323803306, 0.08542053401470184, -0.08841250091791153, 0.005404232535511255, -0.018269672989845276, -0.025207286700606346, 0.015062662772834301, 0.01456711906939745, -0.03384657949209213, -0.015305759385228157, -0.00920496042817831, 0.020195748656988144, -0.028947239741683006, -0.015474057756364346, 0.006694516632705927, 0.038072727620601654, 0.06746876239776611, -0.013127236627042294, 0.0119024021551013, 0.025038987398147583, 0.0550147145986557, -0.06836634874343872, -0.02941473387181759, 0.03605315089225769, 0.010303571820259094, -0.02806835062801838, -0.027395159006118774, -0.051199961453676224, -0.03199530020356178, 0.03154650703072548, 0.00499751279130578, -0.07711783796548843, 0.001443388289771974, 0.05591230466961861, -0.0029241761658340693, 0.05931566283106804, 0.014062224887311459, 0.008470994420349598, 0.0743502750992775, -0.05400492623448372, 0.0238048043102026, -0.034070976078510284, 0.00446924427524209, 0.025861777365207672, 0.02266411855816841, 0.06447679549455643, -0.021186836063861847, 0.0006241047522053123, -0.018531469628214836, -0.05093816667795181, 0.05232194811105728, 0.08355055749416351, 0.023730004206299782, -0.029003338888287544, -0.0119024021551013, 0.031677406281232834, -0.06765575706958771, -0.019840452820062637, -0.04267286881804466, -0.03149040788412094, 0.0534813329577446, 0.06687036901712418, 0.014062224887311459, -0.010827165096998215, -0.020139649510383606, -0.0055164312943816185, -0.03543606027960777, -0.03364088013768196, -0.027675654739141464, -0.005151785910129547, -0.021186836063861847, -0.039381708949804306, -0.016240747645497322, -0.05748308449983597, 0.010593418031930923, 0.03154650703072548, -0.004759090952575207, 0.021429933607578278, -0.014539068564772606, 0.00018758204532787204, 0.0008338927291333675, 0.06387840211391449, 0.010743016377091408, -0.008456969633698463, -0.044468045234680176, 0.03070501796901226, -0.012771940790116787, 0.051985353231430054, 0.015586256049573421, -0.00007779395673424006, -0.011444257572293282, -0.05318213626742363, 0.037549134343862534, 0.07068511843681335, 0.027170762419700623, -0.04551523178815842, -0.06402800232172012, -0.013323584571480751, -0.0291342381387949, 0.004464569501578808, 0.030648918822407722, -0.01659604348242283, -0.029470833018422127, 0.035697855055332184, 0.08512134104967117, 0.008106349036097527, 0.09933316707611084, -0.020420145243406296, 0.015446007251739502, -0.028722843155264854, 0.031415607780218124, 0.017007438465952873, 0.009013287723064423, -0.0395687073469162, -0.039942704141139984, -0.010714966803789139, 0.04293466731905937, 0.057557884603738785, 0.006512193940579891, -0.008340096101164818, 0.035379961133003235, -0.01765258051455021, -0.058380674570798874, -0.028965938836336136, 0.0054603321477770805, -0.034295372664928436, 0.062382422387599945, -0.039119914174079895, -0.03799792751669884, 0.011416207998991013, -0.021504731848835945, -0.006643092259764671, -0.01633424684405327, 0.026647169142961502, 0.01242599543184042, 0.004857264459133148, 0.008559818379580975, 0.03448237106204033, 0.016979388892650604, 0.013781728222966194, -0.027862653136253357, -0.052172351628541946, -0.014969163574278355, -0.052733343094587326, 0.014090274460613728, -0.08557013422250748, -0.004728703759610653, 0.03549215942621231, 0.01360408030450344, 0.02644147165119648, 0.02565607987344265, 0.0023047463037073612, -0.019559957087039948, -0.06481339037418365, -0.057296086102724075, 0.0036698293406516314, 0.007545356173068285, -0.042037077248096466, 0.00894783902913332, -0.026347972452640533, 0.00480116531252861, -0.02967653051018715, -0.006956313271075487, 0.0743502750992775, -0.03908251225948334, -0.035379961133003235, -0.016689542680978775, 0.024421896785497665, -0.06945093721151352, 0.010499918833374977, -0.04566483199596405, 0.005862377118319273, -0.0020090562757104635, -0.051648758351802826, 0.04297206550836563, 0.03517426177859306, -0.0476096086204052, -0.02911553718149662, -0.05639849603176117, 0.012865439988672733, 0.06122303754091263, 0.0157639030367136, 0.016745641827583313, 0.009976325556635857, 0.004186410456895828, 0.03096681460738182, 0.05441632121801376, -0.06447679549455643, 0.0009063543402589858, 0.061559632420539856, -0.0038451396394521, -0.06391580402851105, -0.046637218445539474, -0.009354558773338795, -0.01625009812414646, 0.05482771620154381, 0.014417520724236965, 0.033248186111450195, -0.0013849515235051513, -0.03796052560210228, 0.014735416509211063, 0.03747433423995972, 0.007096561603248119, -0.05553830787539482, -0.0058156275190413, -0.039643507450819016, 0.016446445137262344, -0.03412707522511482, -0.0304432213306427, 0.002158654388040304, 0.04678681865334511, 0.0181574746966362, -0.04570223018527031, 0.026030076667666435, 0.046338021755218506, 0.012379245832562447, -0.0839245542883873, -0.01948515698313713, 0.04282246530056, -0.02808704972267151, -0.033491283655166626, 0.02273891679942608, 0.02427229844033718, 0.01785827800631523, -0.03199530020356178, 0.027974851429462433, -0.025431683287024498, -0.013576030731201172, -0.005652004852890968, 0.0051564606837928295, -0.007447182200849056, 0.011416207998991013, -0.046113625168800354, -0.011649955064058304, -0.06283121556043625, -0.15498366951942444, -0.037231236696243286, -0.007933376356959343, 0.017764778807759285, 0.022888515144586563, -0.006119498983025551, -0.006058724597096443, -0.03442627191543579, -0.007456532213836908, 0.0014948126627132297, -0.013781728222966194, -0.035136863589286804, -0.11586375534534454, 0.0029545631259679794, 0.007727678865194321, 0.04080289229750633, 0.012902839109301567, -0.0005358651978895068, -0.04383225366473198, 0.008924463763833046, -0.047123413532972336, 0.015567556023597717, -0.03201400116086006, -0.025843078270554543, 0.09312484413385391, -0.01468866690993309, -0.060250651091337204, 0.029246436432003975, 0.037773530930280685, 0.011855652555823326, -0.014305321499705315, -0.013940676115453243, -0.024683693423867226, 0.04783400520682335, -0.010369020514190197, -0.011575155891478062, -0.02320641092956066, -0.0030948114581406116, 0.060512445867061615, -0.06922654062509537, 0.00005646453064400703, -0.07259249687194824, 0.013893927447497845, -0.03554825857281685, -0.0034501070622354746, -0.01606309972703457, 0.009312484413385391, 0.034052275121212006, -0.039157312363386154, 0.0891604870557785, 0.01044381968677044, 0.00654024351388216, -0.01468866690993309, -0.03440757095813751, -0.03530516102910042, -0.042859867215156555, 0.010771065950393677, 0.013940676115453243, -0.08788890391588211, 0.02722686156630516, 0.07565926015377045, 0.025151187554001808, -0.04906819015741348, 0.00019254916696809232, 0.02272021770477295, -0.03719383850693703, -0.06040024757385254, -0.03736213594675064, -0.028479745611548424, 0.014193123206496239, -0.0014878002693876624, -0.027058562263846397, 0.004062524531036615, 0.01685784012079239, -0.0009951782412827015, -0.009003938175737858, 0.0036113925743848085, -0.01785827800631523, -0.035772655159235, 0.031135112047195435, 0.06451419740915298, 0.006255072075873613, -0.040503695607185364, 0.03390267863869667, -0.017026137560606003, -0.014062224887311459, 0.013650829903781414, -0.011201160959899426, 0.03799792751669884, -0.06578578054904938, -0.017465582117438316, 0.009541556239128113, -0.05179835483431816, -0.028704142197966576, 0.050077974796295166, 0.02030794695019722, 0.06544918566942215, -0.023711305111646652, 0.012491444125771523, 0.03653934597969055, -0.04454284533858299, -0.05314473807811737, 0.0341457761824131, 0.03341648355126381, 0.018849365413188934, -0.012986988760530949, -0.018325772136449814, 0.022271422669291496, -0.01818552426993847, 0.00041519326623529196, 0.04405665025115013, 0.005909126251935959, -0.025450382381677628, 0.0384841226041317, -0.004324321169406176, 0.03014402464032173, 0.0645889937877655, 0.012369896285235882, 0.013192685320973396, -0.009041337296366692, 0.047983601689338684, -0.04667462036013603, -0.04772180691361427, 0.0026951038744300604, 0.029302535578608513, 0.0406532920897007, -0.022608019411563873, -0.030892014503479004, -0.038334522396326065, -0.005217235069721937, 0.007152660749852657, -0.016091149300336838, -0.02617967501282692, 0.004988162778317928, -0.07248029857873917, 0.027413858100771904, 0.019840452820062637, -0.06657116860151291, 0.026852864772081375, 0.000011093856301158667, -0.030237523838877678, 0.018568869680166245, 0.035940952599048615, -0.0009455069666728377, -0.00614287331700325, 0.06141003593802452, 0.004406132735311985, 0.006189622916281223, -0.004579105414450169, 0.048432398587465286, 0.0005279762553982437, 0.009195610880851746, -0.023692604154348373, -0.0437200553715229, 0.02139253355562687, -0.03528646007180214, 0.008737466298043728, -0.08078299462795258, -0.039381708949804306, -0.016362296417355537, 0.036184050142765045, -0.03558565676212311, 0.007031112443655729, 0.01376302819699049, -0.04832020029425621, 0.0006509856320917606, 0.048245400190353394, 0.053518734872341156, 0.015146811492741108, -0.021448632702231407, -0.041251685470342636, 0.020401446148753166, 0.022907214239239693, 0.004160698037594557, 0.015361858531832695, 0.04188747704029083, 0.030013127252459526, 0.00207099923864007, 0.013398382812738419, -0.02911553718149662, 0.026834165677428246, 0.02408530004322529, 0.00893848855048418, 0.04413145035505295, 0.026591068133711815, 0.014043524861335754, 0.0036721667274832726, -0.013463832437992096, 0.028741542249917984, -0.0031836354173719883, -0.01599765010178089, 0.0013639142271131277, 0.09028247743844986, 0.02778785489499569, 0.023038113489747047, -0.009396633133292198, 0.05523911118507385, 0.00013842211046721786, 0.06687036901712418, 0.06578578054904938, -0.08160578459501266, -0.020102249458432198, -0.012313797138631344, 0.019120512530207634, -0.030648918822407722, 0.02006484940648079, 0.013529281131923199, 0.02988222800195217, -0.0014527381863445044, -0.030368421226739883, 0.010976763442158699, -0.03736213594675064, 0.09110526740550995, 0.06496299058198929, -0.008718766272068024, 0.030013127252459526, 0.11930451542139053, -0.07334049046039581, 0.011406858451664448, -0.01869976706802845, -0.04431844875216484, -0.07749183475971222, -0.0003476988058537245, -0.009714528918266296, 0.040728092193603516, 0.026366671547293663, -0.026366671547293663, 0.02756345644593239, -0.006858139764517546, 0.03998010233044624 ]
716,949
pytorch_optimizer.optimizer.lomo
fuse_update_zero3
null
def fuse_update_zero3(self) -> Callable[[Any], Any]: # pragma: no cover @torch.no_grad() def func(x: torch.Tensor) -> torch.Tensor: for _, p in self.model.named_parameters(): if p.grad is None: continue all_reduce(p.grad, op=ReduceOp.AVG, async_op=False) if self.loss_scaler and self.loss_scaler.has_overflow_serial or has_overflow(p.grad): p.grad = None self.loss_scaler.has_overflow_serial = True break grad_fp32 = p.grad.to(torch.float32) p.grad = None param_fp32 = p.ds_tensor.to(torch.float32) if self.loss_scaler: grad_fp32.div_(self.loss_scaler.loss_scale) if self.gather_norm: self.grad_norms.append(torch.norm(grad_fp32, 2.0)) else: one_dim_grad_fp32 = grad_fp32.view(-1) partition_size: int = p.ds_tensor.numel() start: int = partition_size * self.local_rank end: int = min(start + partition_size, grad_fp32.numel()) partitioned_grad_fp32 = one_dim_grad_fp32.narrow(0, start, end - start) if self.clip_grad_value is not None: partitioned_grad_fp32.clamp_(min=-self.clip_grad_value, max=self.clip_grad_value) if self.clip_grad_norm is not None and self.clip_grad_norm > 0 and self.clip_coef is not None: partitioned_grad_fp32.mul_(self.clip_coef) partitioned_p = param_fp32.narrow(0, 0, end - start) partitioned_p.add_(partitioned_grad_fp32, alpha=-self.lr) p.ds_tensor[: end - start] = partitioned_p # fmt: skip return x return func
(self) -> Callable[[Any], Any]
[ -0.06700048595666885, -0.050801731646060944, -0.02528678998351097, 0.07605049759149551, 0.017301488667726517, 0.02492555044591427, -0.05346349999308586, -0.04270235449075699, 0.04540214687585831, -0.0438050851225853, 0.00024864947772584856, 0.006882569752633572, -0.001988007454201579, -0.018442245200276375, -0.006478551775217056, 0.09437866508960724, -0.02823374606668949, 0.050801731646060944, 0.05741812288761139, -0.00386906904168427, -0.015172073617577553, -0.07924461364746094, -0.017805323004722595, 0.0593954361975193, -0.02796757034957409, -0.022491933777928352, 0.02686483785510063, 0.001372473780065775, 0.006183856166899204, -0.03696054220199585, -0.017291981726884842, -0.0024668879341334105, 0.004472719971090555, 0.05749417468905449, 0.02213069424033165, -0.04601055011153221, 0.015286149457097054, 0.04038281366229057, -0.08289504051208496, -0.04582042247056961, 0.04760761186480522, -0.053919799625873566, 0.001510315341874957, -0.015143554657697678, 0.008180181495845318, 0.029165364801883698, 0.004807817284017801, 0.06080237030982971, -0.011949433945119381, -0.009981627576053143, 0.010799170471727848, -0.04270235449075699, 0.01595159061253071, 0.03287282586097717, -0.019621027633547783, 0.018765460699796677, 0.06034606695175171, 0.015362200327217579, 0.008717288263142109, -0.029488580301404, 0.048101939260959625, -0.03600991144776344, 0.011588194407522678, 0.011806839145720005, 0.00804234016686678, -0.026047294959425926, -0.04000256210565567, -0.018765460699796677, -0.01633184403181076, 0.042208023369312286, -0.037568945437669754, 0.004791181068867445, 0.04563029855489731, -0.0005017550429329276, 0.03083847649395466, -0.05795047804713249, 0.0365612767636776, -0.026237420737743378, -0.012196598574519157, -0.04262630268931389, 0.02642754651606083, -0.03661831468343735, -0.05437610298395157, 0.008745807223021984, -0.0187369417399168, -0.04745550826191902, 0.014287986792623997, -0.030515260994434357, -0.021465253084897995, -0.037055604159832, -0.004232685547322035, 0.03832944855093956, -0.03138984367251396, 0.0296216681599617, 0.05563093721866608, 0.007248562760651112, -0.035971883684396744, -0.07909251749515533, -0.008726794272661209, -0.0009625140810385346, 0.0223018079996109, 0.05319732055068016, 0.01402181014418602, 0.00895494595170021, 0.08380764722824097, -0.06175300106406212, -0.002799608977511525, -0.01702580414712429, -0.010219285264611244, -0.0446416400372982, 0.0019000740721821785, -0.031598981469869614, 0.0075337523594498634, 0.00007114880281733349, -0.011341029778122902, -0.01414539199322462, -0.04266432672739029, 0.02682681195437908, 0.002452628454193473, 0.023157376796007156, 0.05433807894587517, 0.04920466989278793, -0.07840806245803833, -0.040534913539886475, -0.007880732417106628, 0.030154021456837654, 0.03741684556007385, 0.05502253398299217, 0.023993931710720062, -0.04559227079153061, -0.023898867890238762, 0.03600991144776344, -0.03534446656703949, 0.02781546860933304, 0.013803165405988693, -0.027682380750775337, 0.018822498619556427, -0.0035220885183662176, -0.007899745367467403, 0.002747324062511325, -0.01608468033373356, 0.04030676186084747, 0.03403259813785553, 0.03874772787094116, 0.06038409471511841, 0.036123987287282944, 0.049584921449422836, 0.013945759274065495, -0.0005228471709415317, -0.02370874211192131, 0.01717790588736534, 0.06403451412916183, -0.012966609559953213, 0.014211936853826046, -0.036238059401512146, 0.02817670814692974, -0.05007925257086754, -0.043576933443546295, -0.013660570606589317, -0.023955905809998512, -0.06376834213733673, -0.006778000388294458, 0.00316797848790884, -0.009839032776653767, 0.0092734070494771, -0.03568669408559799, 0.011179422959685326, -0.02802460826933384, -0.029013264924287796, 0.07878831028938293, 0.011749801225960255, -0.05490845814347267, 0.008641237393021584, 0.030629336833953857, 0.012576851062476635, 0.07722927629947662, -0.039204031229019165, -0.052246689796447754, -0.027530279010534286, 0.008237219415605068, 0.03812031075358391, -0.02796757034957409, 0.037664007395505905, -0.07548011839389801, -0.019716091454029083, 0.058216653764247894, -0.0112079419195652, -0.012966609559953213, 0.0024086618795990944, 0.006022248417139053, -0.014402062632143497, -0.008527161553502083, 0.03154194355010986, -0.003531594993546605, 0.023328488692641258, -0.028785113245248795, 0.04319668188691139, 0.0071677593514323235, 0.05570698902010918, -0.022548971697688103, -0.0029398270417004824, -0.049660973250865936, 0.04026873782277107, 0.013479949906468391, -0.09688833355903625, -0.046466853469610214, 0.011987459845840931, 0.07053683698177338, -0.03091452643275261, 0.03954625874757767, -0.02370874211192131, 0.05338744819164276, -0.0009607316460460424, 0.058368753641843796, -0.0218645166605711, -0.02226378209888935, 0.019735103473067284, 0.04696118086576462, 0.05776035040616989, 0.04593449831008911, -0.019849179312586784, -0.07072696089744568, -0.009430261328816414, -0.004071078263223171, 0.05646749213337898, -0.013527481816709042, -0.004779298324137926, -0.01317574828863144, 0.03829142451286316, -0.03505927696824074, 0.06255153566598892, -0.022434895858168602, -0.03646621108055115, -0.0028780358843505383, 0.0439952127635479, 0.001235820585861802, -0.014173910953104496, -0.006321697495877743, 0.019307319074869156, -0.02682681195437908, -0.018195081502199173, -0.0371316559612751, 0.005884407088160515, 0.040420837700366974, 0.04745550826191902, 0.018927067518234253, 0.02087586186826229, 0.015942085534334183, -0.012092028744518757, 0.03798722103238106, -0.022834161296486855, 0.030363161116838455, -0.05566896125674248, 0.046428829431533813, -0.03722671791911125, -0.0439571850001812, 0.020077330991625786, 0.007552764844149351, 0.0013629674213007092, -0.046466853469610214, -0.02222575806081295, -0.06730468571186066, -0.016617033630609512, 0.015828009694814682, -0.04308260604739189, -0.01571393385529518, 0.03534446656703949, -0.0015221982030197978, -0.007761903572827578, 0.05030740424990654, -0.007771410048007965, 0.05430005490779877, 0.009278160519897938, -0.015457263216376305, 0.02074277214705944, 0.02671273611485958, 0.021503277122974396, 0.004817323759198189, 0.08365554362535477, 0.012339193373918533, 0.07745742797851562, -0.024374183267354965, -0.059433463960886, 0.005946198012679815, 0.023955905809998512, 0.011749801225960255, -0.004641456995159388, -0.03564867004752159, 0.00008956728561315686, -0.02785349451005459, 0.06030804291367531, -0.005451869685202837, 0.07110721617937088, -0.023081324994564056, 0.03876674175262451, 0.01036188006401062, 0.013137723319232464, 0.02368973009288311, 0.01719691790640354, 0.007818941958248615, -0.0112079419195652, -0.020286470651626587, -0.02049560844898224, -0.011920914985239506, 0.09019588679075241, -0.06057421863079071, -0.018252119421958923, -0.005133408587425947, 0.005295015871524811, -0.0003642105730250478, -0.009244888089597225, -0.031884171068668365, -0.0012019543210044503, -0.015447757206857204, 0.018851015716791153, -0.00087695725960657, 0.021065987646579742, 0.00737689808011055, 0.05468030646443367, 0.03591484576463699, -0.013803165405988693, 0.018822498619556427, 0.01538121234625578, 0.05350152403116226, -0.06886372715234756, -0.03985045850276947, 0.034698039293289185, -0.008503396064043045, -0.0591292604804039, -0.02338552661240101, -0.04563029855489731, -0.015999123454093933, 0.0021008949261158705, 0.02519172616302967, -0.06175300106406212, -0.0028970486018806696, 0.06452884525060654, -0.007947276346385479, 0.06551750004291534, 0.006825531832873821, 0.03412766009569168, 0.039318107068538666, -0.03509730473160744, 0.030039945617318153, -0.04608660191297531, 0.012709938921034336, 0.0446036159992218, 0.012139560654759407, 0.03270171210169792, -0.003721721237525344, 0.02673174999654293, -0.0148773780092597, -0.052398793399333954, 0.06620195508003235, 0.07985302060842514, 0.01935485191643238, -0.013698595575988293, -0.022720085456967354, 0.0590912364423275, -0.0586729571223259, 0.010903739370405674, -0.0373217798769474, -0.03505927696824074, 0.05315929651260376, 0.09118454158306122, 0.0033652344718575478, 0.01565689593553543, 0.0028685296420007944, -0.025952231138944626, -0.05057357996702194, -0.031922195106744766, -0.049394797533750534, 0.0012750340392813087, -0.01328031811863184, -0.0294125284999609, -0.026142358779907227, -0.04920466989278793, -0.002623742213472724, 0.028842151165008545, -0.00386906904168427, -0.007595543283969164, -0.02040054462850094, 0.0016731108771637082, -0.01397427823394537, 0.037055604159832, 0.021598340943455696, -0.009715450927615166, -0.04623870179057121, 0.03928007930517197, -0.008973958902060986, 0.0893593356013298, 0.021180063486099243, 0.03089551441371441, -0.028594985604286194, -0.04000256210565567, 0.06289376318454742, 0.0733126774430275, 0.04087714105844498, -0.015371706336736679, -0.04152357205748558, -0.04871034249663353, -0.05718997120857239, 0.014173910953104496, 0.018689408898353577, -0.017729271203279495, -0.039432182908058167, 0.03372839465737343, 0.045212019234895706, 0.021617352962493896, 0.0876101702451706, -0.01796692982316017, 0.02815769612789154, 0.002191204810515046, 0.03190318122506142, 0.04566832259297371, 0.013983785174787045, -0.007548011839389801, -0.00554693304002285, -0.024279121309518814, 0.05608724057674408, 0.05137211084365845, -0.016360362991690636, 0.018442245200276375, 0.033291105180978775, -0.009035749360918999, -0.07620259374380112, -0.057113923132419586, 0.014554163441061974, -0.011436093598604202, 0.05513660982251167, -0.01920275017619133, -0.04536411911249161, 0.009358963929116726, -0.03958428278565407, -0.02521074004471302, 0.02829078398644924, 0.03737881779670715, 0.040687013417482376, -0.0007016846793703735, 0.013470443896949291, 0.059737663716077805, 0.004482225980609655, 0.002074752701446414, -0.036390163004398346, -0.03196021914482117, -0.0013285070890560746, -0.0445655919611454, 0.02806263230741024, -0.09042403846979141, 0.00842734519392252, 0.0017859983490779996, 0.010266817174851894, 0.01623678021132946, 0.016598021611571312, 0.007909251376986504, -0.021389201283454895, -0.06319796293973923, -0.024868512526154518, 0.003203627187758684, 0.0023421177174896, -0.03361431881785393, 0.033519256860017776, -0.024868512526154518, -0.037797097116708755, -0.026161370798945427, -0.015980109572410583, 0.050877783447504044, -0.04232209920883179, -0.05198051407933235, -0.02825275994837284, 0.00737689808011055, -0.042246051132678986, 0.0003291560569778085, -0.061372749507427216, 0.020153380930423737, -0.01687370426952839, -0.03855760022997856, 0.021370189264416695, 0.024374183267354965, -0.023404540494084358, -0.0009547902154736221, -0.04232209920883179, 0.013479949906468391, 0.06392043828964233, 0.0008353671873919666, 0.02802460826933384, -0.030420199036598206, 0.02635149657726288, 0.04525004327297211, 0.05167631059885025, -0.05281706899404526, -0.0041043502278625965, 0.04859626665711403, 0.015010466799139977, -0.049622949212789536, -0.04566832259297371, 0.018632370978593826, -0.0035981391556560993, 0.05802652984857559, 0.006773247383534908, 0.037549931555986404, 0.014373543672263622, -0.046695005148649216, 0.008845623582601547, 0.0014532774221152067, -0.001258398056961596, -0.05798850208520889, -0.01329933013767004, -0.011312510818243027, -0.0019820660818368196, -0.03730276972055435, -0.0016362739261239767, 0.0035220885183662176, 0.04772168770432472, 0.020096343010663986, -0.0295075923204422, 0.01702580414712429, 0.02671273611485958, -0.009720204398036003, -0.05673367157578468, -0.037283755838871, 0.03578175976872444, -0.03859562799334526, -0.008645990863442421, 0.010666081681847572, 0.043576933443546295, 0.014173910953104496, -0.048101939260959625, 0.019678065553307533, -0.021046975627541542, -0.03401358425617218, 0.009059514850378036, 0.011369548738002777, 0.020324494689702988, 0.003861939301714301, -0.03513532876968384, 0.008018573746085167, -0.06452884525060654, -0.15788082778453827, -0.04190382361412048, 0.006896829232573509, 0.0297357439994812, 0.015295656397938728, -0.034698039293289185, 0.007567024324089289, -0.027150027453899384, -0.019525965675711632, 0.037911172956228256, -0.00857944693416357, -0.006602133624255657, -0.0898156389594078, -0.010105209425091743, 0.031675033271312714, 0.010666081681847572, 0.051067907363176346, 0.011797333136200905, -0.028804125264286995, -0.0018501660088077188, -0.03422272205352783, 0.011112879030406475, -0.022815149277448654, -0.03395654633641243, 0.06338808685541153, -0.024184057489037514, -0.059965815395116806, -0.010960777290165424, 0.02059067226946354, 0.0015245748218148947, -0.007329366635531187, 0.0019048273097723722, -0.031941208988428116, 0.010333361104130745, 0.010390399023890495, -0.000037728175811935216, -0.029811793938279152, -0.0292984526604414, 0.03380444645881653, -0.09970220178365707, 0.0019250281620770693, -0.06232338026165962, 0.0371696799993515, -0.046504877507686615, 0.013536987826228142, -0.02199760638177395, 0.03302492946386337, 0.05293114483356476, -0.02946956641972065, 0.0891311839222908, -0.012348699383437634, -0.01042842399328947, -0.005936692003160715, -0.005580205004662275, -0.012310674414038658, -0.02644656039774418, 0.01640789397060871, 0.02821473404765129, -0.0740731805562973, 0.019982267171144485, 0.06456687301397324, 0.0027497007977217436, -0.05300719663500786, 0.01702580414712429, 0.030344147235155106, -0.011673751287162304, -0.05475635826587677, -0.0366753526031971, -0.03815833479166031, 0.018480271100997925, 0.024260107427835464, -0.057113923132419586, -0.007776163052767515, 0.028347821906208992, -0.0022078410256654024, -0.019421394914388657, -0.011683257296681404, -0.024298133328557014, -0.06468094885349274, 0.03448890149593353, 0.06768494099378586, 0.005005073267966509, -0.03161799535155296, 0.021237101405858994, -0.014734783209860325, 0.005988976452499628, 0.007643074728548527, 0.017263462767004967, 0.03566768392920494, -0.07760953158140182, -0.009268654510378838, 0.025952231138944626, -0.02057165838778019, -0.0218645166605711, 0.034564949572086334, 0.04745550826191902, 0.04912862181663513, -0.042284075170755386, 0.031846143305301666, 0.0447176918387413, -0.02047659642994404, -0.06772296875715256, 0.009116552770137787, 0.01762470230460167, 0.017558157444000244, -0.009268654510378838, -0.006326450500637293, -0.008684015832841396, -0.010095703415572643, 0.012139560654759407, 0.04699920490384102, 0.0015233864542096853, -0.024393197149038315, 0.025724079459905624, 0.0036741895601153374, 0.01903163641691208, 0.05589711293578148, 0.02372775413095951, 0.013204267248511314, -0.02089487388730049, 0.036257073283195496, -0.056923795491456985, -0.01899361051619053, -0.0012090840609744191, 0.0009553843410685658, 0.04540214687585831, -0.010694600641727448, -0.040763065218925476, -0.005988976452499628, -0.004952788352966309, 0.0064357733353972435, -0.0186418779194355, -0.053957827389240265, 0.01779581606388092, -0.061410773545503616, 0.03391852229833603, 0.0442994125187397, -0.06673430651426315, 0.05585908889770508, 0.00591767905279994, -0.039127979427576065, -0.004529757425189018, 0.053957827389240265, -0.00023216196859721094, -0.015390719287097454, 0.05023135244846344, 0.007833201438188553, -0.0295266043394804, -0.024792460724711418, 0.03562965616583824, 0.02498258836567402, 0.004831583239138126, -0.013556000776588917, -0.0439191609621048, 0.034717049449682236, -0.021636366844177246, -0.0043229954317212105, -0.08046142756938934, -0.02349960245192051, 0.010742132551968098, 0.01833767630159855, -0.029013264924287796, 0.009111800231039524, 0.004120986443012953, -0.0743013322353363, 0.001881061471067369, 0.010504474863409996, 0.05764627456665039, -0.004658092744648457, -0.012149066664278507, -0.04935677349567413, 0.004014040343463421, -0.012405737303197384, -0.006987139116972685, -0.002168627455830574, 0.015238618478178978, 0.01681666634976864, -0.0015982487238943577, 0.009610881097614765, -0.022891199216246605, 0.01181634608656168, 0.027682380750775337, -0.004824453499168158, 0.04167567193508148, 0.014791821129620075, 0.03218837082386017, -0.015124542638659477, -0.011949433945119381, 0.018746446818113327, -0.01710185594856739, -0.025838155299425125, 0.005005073267966509, 0.10129926353693008, 0.030039945617318153, 0.04289247840642929, -0.004299229476600885, 0.08289504051208496, 0.005247484426945448, 0.0893593356013298, 0.022948237136006355, -0.09415051341056824, -0.03190318122506142, -0.014107367023825645, 0.0004530351725406945, -0.020286470651626587, 0.011569181457161903, -0.01177832018584013, 0.019735103473067284, -0.018128536641597748, -0.02367071621119976, 0.012833520770072937, -0.030115995556116104, 0.08259084075689316, 0.06585972756147385, -0.01042842399328947, 0.018023967742919922, 0.10806775093078613, -0.06171497702598572, -0.010171753354370594, -0.02222575806081295, -0.041941847652196884, -0.07114523649215698, -0.033348143100738525, -0.020324494689702988, 0.039166003465652466, 0.0183947142213583, -0.013489456847310066, 0.005033592227846384, 0.006326450500637293, 0.004527381155639887 ]
716,950
pytorch_optimizer.optimizer.lomo
fused_backward
null
def fused_backward(self, loss, lr: float): self.lr = lr if self.clip_grad_norm is not None and self.clip_grad_norm > 0.0 and self.clip_coef is None: raise ValueError( 'clip_grad_norm is not None, but clip_coef is None. ' 'Please call optimizer.grad_norm() before optimizer.fused_backward().' ) if self.loss_scaler: loss = loss * self.loss_scaler.loss_scale loss.backward() self.grad_func(0)
(self, loss, lr: float)
[ -0.0752149298787117, 0.0022603177931159735, -0.036305803805589676, 0.04918169975280762, -0.0420401506125927, -0.004294164013117552, -0.020896945148706436, -0.014028041623532772, 0.010510037653148174, -0.02478433959186077, -0.016684135422110558, -0.042884472757577896, 0.0046217781491577625, -0.02795054391026497, 0.014239122159779072, 0.09843376278877258, -0.0197535939514637, 0.015426448546350002, 0.04685981571674347, 0.01355311181396246, -0.004322747699916363, -0.06673654168844223, 0.016842445358633995, 0.05966535210609436, -0.025874922052025795, 0.004443679004907608, -0.010325342416763306, 0.007744006812572479, -0.045769236981868744, 0.016912804916501045, 0.037150125950574875, -0.03088807687163353, 0.035549432039260864, 0.018188081681728363, 0.002675882074981928, 0.00008588877972215414, 0.007682441733777523, -0.002554950537160039, -0.01848711259663105, -0.024608440697193146, -0.058152612298727036, 0.00018950499361380935, 0.052418265491724014, 0.05400136485695839, 0.012233859859406948, -0.018082542344927788, -0.03845178708434105, -0.012057960033416748, 0.04890025779604912, 0.0005549102206714451, -0.01088822353631258, -0.022321736440062523, 0.0009993331041187048, -0.002737447153776884, -0.0015094437403604388, 0.028583785519003868, 0.04182907193899155, 0.013957682065665722, 0.010281367227435112, -0.04263821244239807, 0.033579349517822266, -0.06645510345697403, -0.02318364754319191, -0.023693758994340897, 0.02877727523446083, -0.005386943928897381, -0.04904098063707352, 0.025804560631513596, 0.05491604655981064, 0.021547775715589523, -0.0386628657579422, 0.022304147481918335, 0.015347293578088284, 0.020052624866366386, -0.013315645977854729, -0.09055343270301819, 0.012506505474448204, -0.043236274272203445, -0.012893485836684704, -0.02429181896150112, 0.029920626431703568, 0.003964351024478674, -0.010536422953009605, 0.026385031640529633, -0.01334203127771616, -0.03605954349040985, -0.030782537534832954, -0.039823807775974274, 0.046261757612228394, 0.014626102522015572, 0.004019320011138916, -0.015417654067277908, -0.029674366116523743, 0.013315645977854729, 0.0380999855697155, -0.00966571643948555, -0.032172150909900665, -0.004144649021327496, -0.016226794570684433, 0.00034547902760095894, 0.012884690426290035, 0.061459533870220184, 0.007374616339802742, 0.05896175280213356, 0.11285758018493652, -0.019788773730397224, -0.008948923088610172, -0.06233903765678406, 0.020474784076213837, -0.022673537954688072, 0.002361460356041789, -0.02928738482296467, -0.007893522270023823, 0.013421186245977879, -0.04956867918372154, 0.02543517015874386, -0.033579349517822266, 0.004771293140947819, 0.001982175512239337, 0.03539112210273743, 0.015435243956744671, -0.01435345783829689, -0.05502158775925636, -0.052277542650699615, 0.008526762947440147, -0.001303860335610807, 0.047176435589790344, 0.0386628657579422, 0.0402107872068882, -0.026525752618908882, 0.0165873896330595, 0.021899577230215073, -0.03915538638830185, -0.045769236981868744, 0.050659261643886566, -0.0397886298596859, -0.013808166608214378, 0.05294596403837204, 0.011503874324262142, -0.015083443373441696, 0.012911075726151466, 0.032523948699235916, 0.04967422038316727, 0.007818764075636864, 0.03250635787844658, 0.0816880613565445, -0.025716612115502357, 0.042391952127218246, 0.028671734035015106, 0.02668406255543232, 0.020562734454870224, 0.051503583788871765, 0.00015734824410174042, -0.0012961647007614374, 0.008258515037596226, 0.039401646703481674, -0.04193460941314697, -0.015285728499293327, -0.009973541833460331, 0.002007461152970791, 0.0183463916182518, -0.028531014919281006, -0.025646250694990158, -0.06427393853664398, 0.030483506619930267, -0.02865414507687092, 0.05597144737839699, 0.02527686022222042, 0.0027638322208076715, 0.07095814496278763, 0.007783584296703339, -0.11166145652532578, 0.018117722123861313, 0.04587477445602417, -0.017132680863142014, 0.044643472880125046, -0.008619110099971294, -0.023078108206391335, -0.07359664887189865, 0.02059791423380375, 0.07401881366968155, 0.002700068289414048, 0.021195976063609123, -0.0839395821094513, 0.03992934897542, 0.008711458183825016, -0.06610330194234848, -0.00710636842995882, -0.019102763384580612, 0.006613848265260458, 0.0014291892293840647, -0.03576051443815231, 0.0058794645592570305, -0.02837270498275757, 0.01568150334060192, -0.0431659109890461, 0.0716969296336174, 0.0378185473382473, 0.044643472880125046, -0.0021569763775914907, 0.027493203058838844, 0.009674511849880219, 0.007497746497392654, -0.013992861844599247, -0.044643472880125046, -0.006081749685108662, -0.026086002588272095, 0.07739609479904175, -0.020773814991116524, -0.017273401841521263, 0.03424777090549469, -0.001328046666458249, 0.003117831191048026, 0.026877552270889282, 0.04619139805436134, 0.007550516631454229, -0.04897062107920647, 0.0359891839325428, 0.0372556671500206, 0.039964526891708374, -0.05343848466873169, -0.0778886154294014, -0.054810505360364914, -0.011240024119615555, 0.022093066945672035, 0.004696535877883434, 0.01645546592772007, -0.03187311813235283, 0.0739484503865242, 0.0421808697283268, -0.0061828927136957645, -0.02731730416417122, -0.028812455013394356, -0.0025659443344920874, 0.044362034648656845, 0.046894997358322144, -0.009964747354388237, 0.05681576952338219, -0.02184680663049221, -0.0028012108523398638, -0.0077528017573058605, -0.023218827322125435, -0.035285584628582, 0.026490572839975357, 0.04773931950330734, 0.04003489017486572, 0.06603293865919113, -0.001039460301399231, 0.003102439921349287, 0.050026021897792816, -0.0650830790400505, -0.013412391766905785, -0.02759874425828457, 0.04960386082530022, -0.020756226032972336, -0.043236274272203445, -0.0013863135827705264, -0.051785022020339966, -0.0023944417480379343, 0.007308654021471739, -0.046402476727962494, 0.002651695627719164, 0.023359548300504684, 0.033368270844221115, -0.03241841122508049, -0.016156435012817383, 0.012919871136546135, -0.025962872430682182, 0.011248818598687649, 0.02402796968817711, 0.04840773716568947, 0.009780052118003368, -0.011908444575965405, 0.02429181896150112, -0.012198680080473423, 0.029797496274113655, -0.021371876820921898, 0.018451932817697525, 0.0826731026172638, 0.040386687964200974, 0.10610301047563553, -0.021547775715589523, -0.04770413786172867, -0.031134337186813354, 0.0015842013526707888, 0.0335969403386116, 0.01667534001171589, -0.07781825214624405, -0.005554049275815487, 0.006402767729014158, 0.05463460832834244, 0.010510037653148174, 0.11940106749534607, 0.04031632840633392, 0.060333773493766785, 0.0027902170550078154, 0.07852185517549515, -0.0402107872068882, 0.0738077312707901, -0.0027990122325718403, 0.013306851498782635, -0.017774716019630432, 0.01235699001699686, 0.0038807985838502645, 0.01681606099009514, -0.0766221359372139, -0.000594212906435132, 0.023447498679161072, 0.0043975054286420345, -0.0009910877561196685, -0.011758929118514061, -0.051081422716379166, -0.005246223881840706, 0.035883642733097076, -0.008192552253603935, -0.013245286419987679, -0.004434884060174227, -0.04615621641278267, 0.00449864799156785, 0.007176728919148445, -0.015699094161391258, -0.003755469573661685, 0.017255811020731926, 0.035109683871269226, -0.07218945026397705, -0.011125688441097736, 0.02058032527565956, 0.057167571038007736, -0.01246253028512001, -0.028478244319558144, 0.02297256886959076, -0.039472006261348724, 0.0047581009566783905, -0.026103591546416283, -0.0008267310331575572, -0.009234760887920856, 0.05245344340801239, 0.01463489793241024, 0.03419500216841698, 0.0007613181369379163, 0.01284951064735651, 0.04872436076402664, -0.01127520389854908, 0.024274230003356934, 0.01530331838876009, 0.0089972959831357, -0.021512595936655998, 0.0003289883607067168, 0.04728197678923607, -0.035619791597127914, -0.030870487913489342, -0.0386628657579422, -0.06856590509414673, 0.035619791597127914, -0.003718090709298849, -0.013350826688110828, -0.017255811020731926, -0.005765129346400499, 0.06230385601520538, -0.10209248214960098, -0.01018462236970663, -0.020193343982100487, -0.0351448617875576, 0.05428280681371689, 0.008896153420209885, 0.018047362565994263, -0.029463285580277443, -0.017554841935634613, -0.03201383724808693, -0.018803732469677925, -0.015188983641564846, -0.02710622362792492, 0.06554041802883148, -0.0194017942994833, -0.06177615374326706, -0.019859133288264275, -0.0027308508288115263, -0.005800309590995312, 0.07964761555194855, 0.04341217130422592, -0.006174097303301096, 0.0018755360506474972, -0.034546803683042526, -0.022163426503539085, 0.06729942560195923, 0.00850477535277605, -0.02219860628247261, -0.032453589141368866, 0.013412391766905785, -0.043728794902563095, 0.050448182970285416, 0.03183794021606445, 0.016613775864243507, -0.0189796332269907, -0.053614385426044464, 0.06121327355504036, 0.014283097349107265, 0.04657837748527527, 0.01452935766428709, -0.027282122522592545, -0.04116065055131912, -0.025646250694990158, -0.025646250694990158, 0.031204698607325554, -0.013333235867321491, 0.04777449741959572, -0.019243482500314713, 0.05041300132870674, 0.00751093914732337, 0.06452019512653351, -0.022867027670145035, -0.037290845066308975, -0.02779223397374153, 0.021389465779066086, 0.007053598761558533, -0.029674366116523743, 0.023289188742637634, -0.010940993204712868, 0.008500377647578716, 0.05407172441482544, 0.01576945371925831, -0.0409143902361393, 0.05484568700194359, 0.005958619527518749, -0.019278664141893387, -0.02758115343749523, -0.04559333622455597, -0.022005116567015648, -0.06265565752983093, -0.02184680663049221, -0.04812629893422127, -0.0388035885989666, 0.00000910421022126684, -0.04524153470993042, -0.009199581108987331, 0.03468752279877663, 0.035479072481393814, 0.032119378447532654, 0.03160926699638367, -0.004766895901411772, 0.022233787924051285, -0.03817034512758255, -0.020562734454870224, -0.0167984701693058, -0.049955662339925766, -0.028830045834183693, -0.02072104439139366, 0.0031837939750403166, -0.0794365331530571, 0.02457325905561447, -0.052418265491724014, 0.04151245206594467, -0.0023350752890110016, 0.047106076031923294, -0.018750963732600212, 0.027915364131331444, -0.08330634236335754, -0.029516056180000305, 0.032453589141368866, 0.02682478353381157, -0.03546148166060448, 0.04879472032189369, -0.014458997175097466, 0.013843346387147903, -0.0065478854812681675, 0.050799980759620667, 0.0726819708943367, -0.029093895107507706, -0.019736003130674362, -0.012022779323160648, -0.010967378504574299, -0.05931355059146881, 0.07004346698522568, -0.035250402987003326, 0.022603178396821022, 0.012286629527807236, -0.017458096146583557, 0.02640262246131897, 0.02863655425608158, -0.0040940772742033005, -0.00829369481652975, -0.04010524973273277, -0.05484568700194359, 0.038416605442762375, 0.03468752279877663, 0.03356176242232323, -0.05769526958465576, 0.012682405300438404, 0.003419060492888093, 0.08640218526124954, -0.027334893122315407, -0.04735233634710312, -0.008636700920760632, -0.009252351708710194, -0.0019392998656257987, -0.01806495152413845, -0.011002558283507824, 0.016763290390372276, 0.042391952127218246, 0.017827486619353294, 0.012427350506186485, -0.011644594371318817, -0.0708526074886322, 0.0020921132527291775, 0.0029661173466593027, -0.0069436607882380486, -0.05667505040764809, 0.044924914836883545, -0.038205526769161224, -0.018258443102240562, -0.005351764149963856, 0.02177644707262516, 0.024889880791306496, 0.050096381455659866, -0.04369361326098442, -0.021125616505742073, -0.03143336996436119, 0.029146665707230568, 0.06093183532357216, -0.020773814991116524, -0.03394874185323715, 0.028935585170984268, -0.017941821366548538, -0.04116065055131912, 0.03901466727256775, 0.005954222287982702, -0.011134483851492405, -0.0030342787504196167, 0.05519748851656914, -0.05217200517654419, 0.013790576718747616, 0.04879472032189369, 0.05034264177083969, 0.03291093185544014, 0.029463285580277443, -0.0007393306004814804, -0.015936559066176414, -0.0702897235751152, -0.09498611837625504, -0.06793266534805298, 0.0038588109891861677, 0.0341598205268383, 0.05069444328546524, 0.0021130014210939407, -0.028812455013394356, 0.0069084810093045235, -0.0404922291636467, 0.024977831169962883, -0.05811743065714836, -0.0008470694883726537, -0.055303025990724564, 0.023412318900227547, -0.004291965160518885, 0.030026165768504143, 0.02773946337401867, 0.059067290276288986, -0.03468752279877663, 0.0746520534157753, 0.04988529905676842, 0.022286556661128998, -0.05034264177083969, -0.04168834909796715, 0.0038060408551245928, 0.0012862703297287226, -0.060263413935899734, 0.007594491820782423, 0.014546947553753853, -0.005580434110015631, -0.0095953568816185, -0.01883891224861145, -0.03904984891414642, 0.005043938755989075, -0.006517102941870689, -0.012585660442709923, -0.012787945568561554, 0.05519748851656914, 0.028460655361413956, -0.0708526074886322, 0.017774716019630432, -0.014758028090000153, -0.014907543547451496, -0.057167571038007736, -0.019384203478693962, 0.009938362054526806, -0.01362347137182951, -0.005989402066916227, -0.03509209305047989, 0.014538153074681759, -0.010897018015384674, 0.011547849513590336, 0.037572287023067474, 0.008764227852225304, 0.0097712567076087, -0.0776071771979332, 0.008104602806270123, -0.006125724874436855, -0.0787329375743866, 0.010615577921271324, 0.060052331537008286, 0.057660091668367386, -0.01630594953894615, -0.017590021714568138, 0.04390469193458557, 0.006987635977566242, -0.023553038015961647, 0.005769527051597834, -0.06036895513534546, 0.004415095318108797, -0.008495979942381382, -0.0407736711204052, -0.07486312836408615, 0.04573405534029007, 0.011204843409359455, 0.011037738062441349, 0.003372886683791876, -0.025734201073646545, 0.0034366503823548555, -0.027053453028202057, 0.04130136966705322, 0.07095814496278763, -0.0021635727025568485, 0.001394009217619896, 0.0165873896330595, 0.06955094635486603, -0.021371876820921898, 0.012708790600299835, 0.030870487913489342, -0.0678974837064743, -0.04432685300707817, -0.013896116986870766, -0.08780938386917114, -0.04650801792740822, 0.005699167028069496, 0.014854772947728634, -0.0004999414086341858, -0.02395760826766491, 0.0372556671500206, -0.0023108890745788813, -0.008878563530743122, -0.07584816962480545, -0.044784195721149445, 0.02809126488864422, 0.007831957191228867, -0.025030599907040596, -0.08555786311626434, 0.017387736588716507, -0.010334137827157974, 0.016692930832505226, 0.009094040840864182, -0.026156362146139145, -0.00910283625125885, 0.02722935378551483, -0.009955951943993568, 0.01226024515926838, 0.005386943928897381, 0.031556498259305954, 0.08703542500734329, 0.025716612115502357, 0.05758972838521004, -0.028900405392050743, -0.0021382870618253946, -0.010430882684886456, 0.05656950920820236, 0.00770442932844162, -0.0754963755607605, 0.020193343982100487, 0.005628807004541159, -0.015725478529930115, 0.017035935074090958, -0.06371105462312698, -0.0688825249671936, 0.0038720034062862396, -0.10068528354167938, 0.02219860628247261, 0.004470064304769039, -0.022093066945672035, -0.043447352945804596, -0.05055372044444084, -0.011046533472836018, -0.053403306752443314, 0.034845832735300064, 0.06226867437362671, -0.021934757009148598, 0.0021053056698292494, 0.05090552195906639, 0.05744900926947594, -0.007040406111627817, 0.0418994314968586, 0.017000755295157433, -0.050026021897792816, -0.020879356190562248, 0.004775690846145153, 0.017123885452747345, 0.0015754062915220857, 0.02513614110648632, -0.026068411767482758, -0.04907615855336189, -0.063816599547863, 0.006086147390305996, -0.006081749685108662, -0.024186279624700546, 0.006336805410683155, -0.022374507039785385, 0.021794036030769348, 0.017897846177220345, 0.014362252317368984, 0.030835308134555817, -0.04355289414525032, -0.08119554072618484, 0.00150614557787776, 0.006297227460891008, -0.022374507039785385, 0.008043037727475166, 0.004406300373375416, 0.0006024582544341683, -0.04418613389134407, -0.030923258513212204, -0.03440608084201813, -0.003975344821810722, 0.005061528645455837, 0.017132680863142014, -0.001203817082569003, 0.019788773730397224, 0.002205349039286375, 0.0032475576736032963, -0.07472240924835205, -0.016974370926618576, -0.002840788569301367, -0.031890708953142166, -0.007075585890561342, 0.02905871532857418, -0.022779077291488647, 0.042391952127218246, 0.0750742107629776, 0.033931151032447815, 0.024819519370794296, 0.038135167211294174, 0.018539883196353912, -0.011037738062441349, 0.009419456124305725, 0.036727964878082275, 0.018539883196353912, -0.023711347952485085, 0.035883642733097076, -0.032523948699235916, 0.0760592520236969, -0.02682478353381157, -0.021934757009148598, -0.02548794075846672, -0.029146665707230568, 0.061389174312353134, 0.020334064960479736, 0.0376778244972229, 0.021829215809702873, 0.032682258635759354, -0.01632354035973549, 0.00075307278893888, -0.009305121377110481, -0.05748419091105461, -0.0406329482793808, 0.02898835577070713, -0.009445841424167156, 0.028935585170984268, 0.045628514140844345, -0.002667086897417903, -0.0038258295971900225, 0.014687667600810528, -0.012779150158166885 ]
716,953
pytorch_optimizer.optimizer.lomo
grad_norm
null
def grad_norm(self, loss): self.gather_norm = True self.grad_norms = [] if self.loss_scaler: self.loss_scaler.has_overflow_serial = False loss = loss * self.loss_scaler.loss_scale loss.backward(retain_graph=True) self.grad_func(0) if self.loss_scaler and self.loss_scaler.has_overflow_serial: self.loss_scaler.update_scale(overflow=True) with torch.no_grad(): for _, p in self.model.named_parameters(): p.grad = None return with torch.no_grad(): self.grad_norms = torch.stack(self.grad_norms) total_norm = torch.norm(self.grad_norms, 2.0) self.clip_coef = torch.clamp(float(self.clip_grad_norm) / (total_norm + 1e-6), max=1.0) self.gather_norm = False
(self, loss)
[ -0.05337759107351303, 0.025927294045686722, -0.007111875340342522, 0.044819772243499756, 0.009627548046410084, 0.020107252523303032, 0.003703251713886857, -0.041918814182281494, 0.028483763337135315, -0.010234935209155083, -0.034793343394994736, -0.024984484538435936, 0.03655204549431801, -0.012682617641985416, 0.007275053765624762, 0.05798285827040672, -0.02636243775486946, 0.026199258863925934, 0.021050062030553818, -0.007986694574356079, 0.015311609022319317, -0.05584340542554855, 0.00438542990013957, 0.01407870277762413, -0.07212501764297485, -0.01138625293970108, -0.007052949629724026, -0.013353463262319565, -0.050549160689115524, 0.009799792431294918, 0.029227131977677345, -0.014069637283682823, 0.05979595705866814, 0.013063367456197739, 0.007868843153119087, -0.03778495267033577, -0.0024408826138824224, -0.0004155959468334913, -0.04173750430345535, -0.05022280290722847, -0.029571620747447014, 0.0068897707387804985, -0.0012578364694491029, 0.05504564195871353, 0.03595372289419174, -0.023751577362418175, -0.03970683738589287, -0.0016159232473000884, -0.06737470626831055, -0.006595142185688019, -0.04235395789146423, 0.024241114035248756, 0.014785810373723507, -0.007628608029335737, 0.0267975814640522, 0.02407793514430523, 0.043187983334064484, 0.02518392540514469, 0.03477521240711212, -0.039960671216249466, 0.02871946431696415, -0.05294244736433029, -0.0688614472746849, -0.004890830721706152, 0.03687840327620506, -0.028520025312900543, -0.03901785984635353, 0.03029686026275158, 0.06965921074151993, 0.028211798518896103, -0.04456593841314316, 0.020850621163845062, -0.014640762470662594, -0.016698628664016724, 0.00662233866751194, -0.060013528913259506, 0.04101226478815079, -0.014541042037308216, 0.01847546361386776, -0.034358199685811996, 0.015474787913262844, -0.0029054887127131224, -0.011667282320559025, 0.040613386780023575, -0.026162996888160706, -0.05232599377632141, -0.02797609567642212, -0.024150459095835686, 0.015982454642653465, -0.016816480085253716, 0.01696152798831463, 0.028955167159438133, -0.007547018583863974, 0.016979658976197243, 0.022917553782463074, 0.017813682556152344, -0.051564496010541916, -0.021521467715501785, -0.004845503251999617, -0.029317786917090416, 0.021575860679149628, 0.06247934326529503, 0.018674904480576515, 0.05928828939795494, 0.0712909922003746, -0.014885530807077885, 0.01630881242454052, -0.0739743784070015, 0.0024794109631329775, 0.02001659758388996, 0.015003382228314877, -0.0041497270576655865, -0.0054755546152591705, -0.021031931042671204, -0.059179503470659256, -0.014885530807077885, -0.032599493861198425, -0.011848592199385166, -0.009536893106997013, 0.01624535396695137, 0.03463016450405121, 0.010216804221272469, -0.02556467615067959, -0.050114016979932785, -0.02902769111096859, 0.04772072657942772, 0.00861674640327692, 0.006291448604315519, 0.01881995238363743, -0.010234935209155083, 0.0026584542356431484, 0.027033284306526184, -0.005561676807701588, -0.005285179242491722, 0.05544452369213104, -0.06574291735887527, -0.04068591073155403, 0.03475708141922951, 0.03301650658249855, 0.027595344930887222, -0.008213331922888756, 0.01792246848344803, 0.03414062783122063, 0.01377047598361969, 0.03658830747008324, 0.07876095920801163, -0.007270521018654108, 0.06762854009866714, 0.03847393020987511, -0.0007575348136015236, 0.03528288006782532, 0.04960634931921959, 0.05762023851275444, -0.006554347462952137, -0.006676731631159782, 0.0576927624642849, -0.04137488454580307, -0.04456593841314316, 0.009070020169019699, 0.002183649456128478, -0.023715315386652946, -0.06262438744306564, 0.0031457243021577597, -0.06926032900810242, 0.014631696976721287, -0.01449571456760168, 0.06875266134738922, -0.0014278143644332886, -0.03125780075788498, 0.08840663731098175, 0.01232906337827444, -0.06429243832826614, 0.008403707295656204, 0.017160968855023384, 0.007284119259566069, 0.06813620775938034, 0.02163025364279747, 0.02719646319746971, -0.06842630356550217, 0.030441908165812492, 0.028084881603717804, -0.015112168155610561, 0.05827295407652855, -0.06092007830739021, 0.031547896564006805, 0.01611843705177307, -0.046306509524583817, -0.032472576946020126, -0.0036783216055482626, -0.00230603339150548, -0.021249502897262573, -0.013262808322906494, -0.0017609710339456797, -0.007107342593371868, 0.0323093980550766, -0.015592639334499836, 0.01921883411705494, 0.023787839338183403, 0.07031192630529404, -0.02639869973063469, -0.004034142009913921, -0.014704220928251743, -0.00485003599897027, 0.0008600881556048989, -0.04746689274907112, -0.04753941670060158, -0.04529117792844772, 0.06534403562545776, 0.027812916785478592, -0.009618482552468777, -0.002145121106877923, 0.02487569861114025, 0.01930948905646801, 0.03446698561310768, 0.03323407843708992, -0.017006855458021164, 0.02784917876124382, -0.0031683880370110273, 0.026598140597343445, 0.026126734912395477, -0.05566209554672241, -0.10109832137823105, -0.004575804807245731, -0.01401524432003498, -0.024114197120070457, 0.009691006503999233, 0.01514843013137579, -0.032943982630968094, 0.04561753571033478, 0.021031931042671204, 0.011467842385172844, -0.045073606073856354, -0.03720476105809212, 0.027305249124765396, 0.04199133813381195, 0.029063953086733818, -0.03181986138224602, 0.05366768687963486, 0.060267362743616104, 0.0029349515680223703, -0.050549160689115524, -0.03165668249130249, -0.05682247877120972, 0.05196337401866913, 0.07390185445547104, 0.035228487104177475, 0.0461614653468132, 0.024730650708079338, 0.023189516738057137, 0.07132725417613983, -0.07774562388658524, -0.021865956485271454, -0.027033284306526184, 0.020089121535420418, 0.012011771090328693, -0.04743063077330589, -0.03428567573428154, 0.016934331506490707, -0.0062506538815796375, -0.02732338011264801, -0.04877232387661934, -0.05820043012499809, -0.024639995768666267, 0.022790636867284775, -0.03270827978849411, -0.027432166039943695, 0.019418274983763695, -0.013888327404856682, 0.01254663523286581, 0.05178206413984299, 0.05504564195871353, 0.04819213226437569, -0.05236225575208664, 0.023352695629000664, 0.007914170622825623, 0.04848222807049751, 0.01398804783821106, 0.022573065012693405, 0.09290311485528946, 0.04199133813381195, 0.06929659098386765, -0.02995237149298191, -0.06327710300683975, -0.012909254990518093, 0.019327620044350624, 0.019889680668711662, 0.014704220928251743, -0.09515135735273361, 0.014704220928251743, -0.00515372958034277, 0.042535267770290375, 0.02237362414598465, 0.08434529602527618, -0.006413832772523165, 0.02565533109009266, -0.04869979992508888, 0.04264405369758606, -0.009754464961588383, -0.021920349448919296, 0.025383366271853447, 0.025637200102210045, -0.003646592376753688, -0.028121143579483032, 0.009151609614491463, 0.019019393250346184, -0.04706801101565361, -0.006527150981128216, 0.005493685603141785, 0.04173750430345535, -0.010389048606157303, -0.046995487064123154, -0.036751486361026764, -0.00042437814408913255, 0.04815587028861046, 0.00821786466985941, 0.0006804781733080745, 0.02652561664581299, -0.06802742183208466, 0.005897099617868662, 0.05145571008324623, -0.04173750430345535, 0.04268031567335129, 0.04035955294966698, 0.05366768687963486, -0.09703698009252548, -0.017985926941037178, 0.025782248005270958, 0.05040411278605461, -0.003673788858577609, -0.014096833765506744, -0.00009235465404344723, -0.034176889806985855, 0.011785133741796017, 0.014332535676658154, 0.01600058563053608, -0.029879847541451454, 0.08166190981864929, -0.03673335537314415, 0.04050460085272789, -0.052471041679382324, -0.0018731564050540328, 0.05892566964030266, -0.013353463262319565, 0.009400910697877407, 0.01698872447013855, 0.0002123307203873992, 0.016236288473010063, 0.006350374314934015, -0.007909637875854969, -0.033342864364385605, -0.023787839338183403, -0.02360652945935726, -0.08528810739517212, 0.048663537949323654, -0.0009802058339118958, 0.03497465327382088, -0.009654744528234005, -0.011068960651755333, 0.040395814925432205, -0.06958668678998947, -0.007501691114157438, 0.005362235940992832, -0.033215947449207306, 0.030931444838643074, 0.020596787333488464, 0.006599674932658672, 0.0003099263703916222, -0.05674995481967926, -0.01847546361386776, -0.0013688886538147926, -0.031765468418598175, -0.018856214359402657, 0.008041087538003922, -0.038945335894823074, -0.0861583948135376, -0.008711934089660645, -0.05178206413984299, -0.04645155742764473, 0.09812483936548233, -0.008181602694094181, 0.009863250888884068, -0.009600351564586163, -0.012075229547917843, -0.0005960558191873133, 0.06606927514076233, -0.03760364279150963, 0.05087551847100258, -0.01844826713204384, 0.006522618234157562, -0.042934149503707886, 0.028646940365433693, 0.015492918901145458, 0.039126645773649216, -0.026851974427700043, -0.03825635835528374, 0.021213240921497345, 0.055589571595191956, 0.05635107308626175, -0.02237362414598465, -0.006232522893697023, -0.05888940766453743, 0.009382779709994793, -0.007877908647060394, 0.028483763337135315, -0.04935251548886299, -0.02320764772593975, -0.017750224098563194, 0.04010571911931038, 0.03221874311566353, 0.08151686936616898, -0.03711410611867905, 0.012483176775276661, 0.002104326384142041, 0.028266191482543945, 0.05388525873422623, -0.024621864780783653, 0.005267048254609108, -0.025474021211266518, -0.022971946746110916, 0.05682247877120972, 0.000926379521843046, -0.019907811656594276, 0.047176796942949295, 0.026471223682165146, 0.009419041685760021, -0.03919916972517967, -0.025600938126444817, -0.04304293543100357, -0.05783781036734581, 0.017369475215673447, -0.031112754717469215, 0.003429020754992962, -0.005344104953110218, -0.056206025183200836, 0.0024499481078237295, 0.023842232301831245, 0.014822072349488735, 0.08876925706863403, -0.018711166456341743, -0.0075968788005411625, 0.003991080913692713, -0.012338128872215748, 0.014350666664540768, -0.013997113332152367, 0.006345841567963362, -0.012274670414626598, -0.01621815748512745, -0.016508253291249275, -0.07600504904985428, 0.001139985048212111, -0.037821214646101, 0.015955258160829544, 0.013516642153263092, 0.031239671632647514, -0.035881198942661285, 0.033778008073568344, -0.06882518529891968, -0.032943982630968094, 0.001292965142056346, 0.008838851004838943, -0.04202760010957718, 0.028266191482543945, -0.052471041679382324, 0.021956611424684525, -0.013716083019971848, -0.015538246370851994, 0.09246797859668732, 0.023660922423005104, -0.04260779172182083, -0.003349697683006525, 0.006450094748288393, -0.030713872984051704, 0.06331336498260498, -0.024966353550553322, 0.011132419109344482, -0.026543747633695602, -0.051818326115608215, -0.004800175782293081, 0.035699889063835144, -0.026743188500404358, -0.045254915952682495, -0.027087677270174026, -0.016607973724603653, 0.05178206413984299, -0.0025360703002661467, 0.024186721071600914, -0.037857476621866226, 0.038945335894823074, 0.03307089954614639, 0.06454627215862274, -0.022881291806697845, -0.023896625265479088, 0.019817156717181206, 0.010815126821398735, -0.023008208721876144, -0.028773857280611992, -0.02215605229139328, 0.017469195649027824, 0.051346924155950546, 0.025691593065857887, 0.01921883411705494, 0.011186812072992325, -0.032073695212602615, 0.034267544746398926, -0.008648475632071495, 0.010343721136450768, -0.09674688428640366, 0.04032329097390175, -0.007030285894870758, 0.0012453714152798057, 0.016562646254897118, -0.0167983490973711, 0.00000509491019329289, 0.06012231484055519, 0.006277850363403559, -0.012537569738924503, -0.029970502480864525, 0.01869303546845913, 0.06817246973514557, -0.002106592757627368, -0.04619772732257843, 0.022210445255041122, -0.09130759537220001, -0.05196337401866913, -0.005752052180469036, 0.03038751520216465, -0.03254510089755058, -0.015973389148712158, 0.022083528339862823, -0.044602200388908386, 0.017432933673262596, 0.021122585982084274, 0.07781814783811569, 0.016970593482255936, 0.012718879617750645, -0.006871639750897884, -0.006635936908423901, -0.07172613590955734, -0.10240375250577927, -0.03477521240711212, -0.004516879096627235, 0.0070257531479001045, 0.05696752667427063, 0.01315402239561081, -0.030369384214282036, 0.022573065012693405, -0.0003714016929734498, 0.01596432365477085, -0.07299530506134033, 0.002454480854794383, -0.04137488454580307, 0.03611690178513527, -0.018946869298815727, 0.0064818235114216805, 0.013561969622969627, 0.03698718920350075, -0.06334962695837021, 0.035518579185009, 0.0063775707967579365, 0.018838083371520042, -0.033469781279563904, -0.09493378549814224, 0.04518239200115204, -0.015003382228314877, -0.08804401755332947, 0.0321824811398983, 0.015556377358734608, -0.0047004553489387035, -0.014459452591836452, 0.0046324641443789005, -0.05490059405565262, 0.018493594601750374, 0.00422451738268137, 0.011676347814500332, 0.00011650568194454536, 0.03394118696451187, 0.05569835752248764, -0.08920440077781677, 0.013978982344269753, -0.029752930626273155, 0.04935251548886299, -0.06973173469305038, -0.011186812072992325, 0.017441999167203903, -0.013879261910915375, 0.01773209311068058, -0.051600757986307144, 0.028229929506778717, 0.03339725732803345, -0.03336099535226822, 0.020161645486950874, 0.009944840334355831, -0.0025677992962300777, -0.08492548763751984, 0.031185278668999672, -0.030151812359690666, -0.07868843525648117, -0.0026380568742752075, 0.05747519060969353, 0.05573461949825287, -0.009106282144784927, 0.04510986804962158, 0.059650909155607224, 0.04409453272819519, -0.033832401037216187, -0.03901785984635353, -0.001570595777593553, -0.03720476105809212, -0.03087705187499523, -0.04322424530982971, -0.058961931616067886, 0.00824506115168333, -0.014042440801858902, -0.004831905011087656, 0.010126150213181973, -0.019508929923176765, -0.03676961734890938, -0.02683384343981743, 0.04790203645825386, 0.05461049824953079, 0.014241881668567657, 0.007442765403538942, 0.01736040972173214, 0.02701515331864357, -0.01346224918961525, -0.019418274983763695, 0.061935413628816605, -0.030985837802290916, -0.05649612098932266, -0.04869979992508888, -0.08441781997680664, -0.02395101822912693, -0.011504104360938072, 0.004167858045548201, 0.016227222979068756, -0.011902985163033009, 0.03007928840816021, 0.006463692989200354, 0.0028601614758372307, -0.01791340298950672, -0.013942720368504524, 0.0031207941938191652, -0.0054075634106993675, -0.013471314683556557, -0.08369258046150208, 0.030659480020403862, 0.018946869298815727, 0.017006855458021164, 0.004018277395516634, -0.0189106073230505, 0.009600351564586163, 0.05120187625288963, 0.00982698891311884, 0.016517318785190582, -0.0061146714724600315, 0.023352695629000664, 0.011640085838735104, 0.023805970326066017, 0.03007928840816021, -0.048881109803915024, -0.02837497740983963, 0.0061056059785187244, 0.03734980896115303, 0.015565442852675915, -0.04035955294966698, 0.01123213954269886, -0.004045473877340555, -0.012755141593515873, 0.0026765852235257626, -0.0533413290977478, -0.06897023320198059, 0.023062601685523987, -0.07234258949756622, 0.010914847254753113, -0.0021791167091578245, -0.016354139894247055, 0.009845119901001453, -0.03793000057339668, -0.0030120082665234804, 0.0037757756654173136, 0.0029054887127131224, 0.045436225831508636, -0.045254915952682495, 0.025546545162796974, 0.04155619442462921, 0.009836054407060146, 0.02688823640346527, 0.039126645773649216, 0.014305339194834232, -0.009310255758464336, -0.04340555518865585, -0.007991227321326733, 0.010733537375926971, -0.020288562402129173, -0.002502074697986245, -0.06175410374999046, -0.02036108635365963, -0.033832401037216187, 0.04326050728559494, -0.011286532506346703, 0.015973389148712158, -0.014740482904016972, -0.053268805146217346, 0.03339725732803345, 0.0428253635764122, -0.008186135441064835, 0.03546418622136116, -0.017351344227790833, -0.04159245640039444, 0.06625058501958847, 0.013317201286554337, -0.005747519433498383, 0.03020620532333851, -0.004936158191412687, -0.004489682614803314, -0.03707784414291382, 0.012945516034960747, -0.017904337495565414, -0.011730740778148174, -0.036624569445848465, 0.03278080374002457, -0.01961771585047245, 0.04035955294966698, 0.029662275686860085, 0.00020510665490292013, 0.0032363790087401867, 0.027178332209587097, 0.007120940834283829, -0.026017948985099792, -0.026289913803339005, 0.027740392833948135, -0.02766786888241768, 0.05345011502504349, 0.050984304398298264, 0.0430791974067688, 0.027921702712774277, 0.03880028799176216, 0.03562736511230469, -0.07868843525648117, -0.019236965104937553, 0.035319142043590546, 0.008766327053308487, 0.0011887120781466365, -0.00866660661995411, -0.03803878650069237, 0.0375673808157444, 0.000448458333266899, -0.04913494363427162, 0.017840879037976265, -0.10428936779499054, 0.08122677356004715, 0.015184692107141018, 0.02259119600057602, 0.0042562466114759445, 0.026598140597343445, -0.02661627158522606, 0.01853892207145691, -0.01900126226246357, -0.04492855817079544, -0.04133862257003784, 0.03528288006782532, -0.005792846437543631, -0.011177746579051018, 0.0574389286339283, -0.013725148513913155, 0.024639995768666267, 0.04514613002538681, 0.0017541719134896994 ]
716,977
pytorch_optimizer.optimizer.lamb
Lamb
Large Batch Optimization for Deep Learning. This Lamb implementation is based on the paper v3, which does not use de-biasing. :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param lr: float. learning rate. :param betas: BETAS. coefficients used for computing running averages of gradient and the squared hessian trace. :param weight_decay: float. weight decay (L2 penalty). :param weight_decouple: bool. the optimizer uses decoupled weight decay as in AdamW. :param fixed_decay: bool. fix weight decay. :param rectify: bool. perform the rectified update similar to RAdam. :param degenerated_to_sgd: bool. degenerated to SGD. :param n_sma_threshold: int. (recommended is 5). :param grad_averaging: bool. whether apply (1 - beta2) to gradient when calculating running averages of gradient. :param max_grad_norm: float. max gradient norm to clip. :param r: float. EMA factor. between 0.9 ~ 0.99 is preferred. :param adanorm: bool. whether to use the AdaNorm variant. :param adam_debias: bool. Only correct the denominator to avoid inflating step sizes early in training. :param adam: bool. always use trust ratio = 1, which turns this into Adam. Useful for comparison purposes. :param pre_norm: bool. perform pre-normalization of all gradients. :param eps: float. term added to the denominator to improve numerical stability.
class Lamb(Optimizer, BaseOptimizer): r"""Large Batch Optimization for Deep Learning. This Lamb implementation is based on the paper v3, which does not use de-biasing. :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param lr: float. learning rate. :param betas: BETAS. coefficients used for computing running averages of gradient and the squared hessian trace. :param weight_decay: float. weight decay (L2 penalty). :param weight_decouple: bool. the optimizer uses decoupled weight decay as in AdamW. :param fixed_decay: bool. fix weight decay. :param rectify: bool. perform the rectified update similar to RAdam. :param degenerated_to_sgd: bool. degenerated to SGD. :param n_sma_threshold: int. (recommended is 5). :param grad_averaging: bool. whether apply (1 - beta2) to gradient when calculating running averages of gradient. :param max_grad_norm: float. max gradient norm to clip. :param r: float. EMA factor. between 0.9 ~ 0.99 is preferred. :param adanorm: bool. whether to use the AdaNorm variant. :param adam_debias: bool. Only correct the denominator to avoid inflating step sizes early in training. :param adam: bool. always use trust ratio = 1, which turns this into Adam. Useful for comparison purposes. :param pre_norm: bool. perform pre-normalization of all gradients. :param eps: float. term added to the denominator to improve numerical stability. """ clamp: float = 10.0 def __init__( self, params: PARAMETERS, lr: float = 1e-3, betas: BETAS = (0.9, 0.999), weight_decay: float = 0.0, weight_decouple: bool = True, fixed_decay: bool = False, rectify: bool = False, degenerated_to_sgd: bool = False, n_sma_threshold: int = 5, grad_averaging: bool = True, max_grad_norm: float = 1.0, adam: bool = False, pre_norm: bool = False, r: float = 0.95, adanorm: bool = False, adam_debias: bool = False, eps: float = 1e-6, ): self.validate_learning_rate(lr) self.validate_betas(betas) self.validate_non_negative(weight_decay, 'weight_decay') self.validate_non_negative(max_grad_norm, 'max_grad_norm') self.validate_non_negative(eps, 'eps') self.degenerated_to_sgd = degenerated_to_sgd self.n_sma_threshold = n_sma_threshold self.pre_norm = pre_norm defaults: DEFAULTS = { 'lr': lr, 'betas': betas, 'weight_decay': weight_decay, 'weight_decouple': weight_decouple, 'fixed_decay': fixed_decay, 'rectify': rectify, 'grad_averaging': grad_averaging, 'max_grad_norm': max_grad_norm, 'adam': adam, 'adanorm': adanorm, 'adam_debias': adam_debias, 'eps': eps, } if adanorm: defaults.update({'r': r}) super().__init__(params, defaults) def __str__(self) -> str: return 'Lamb' @torch.no_grad() def reset(self): for group in self.param_groups: for p in group['params']: state = self.state[p] state['step'] = 0 state['exp_avg'] = torch.zeros_like(p) state['exp_avg_sq'] = torch.zeros_like(p) if group['adanorm']: state['exp_grad_norm'] = torch.zeros((1,), dtype=p.dtype, device=p.device) @torch.no_grad() def get_global_gradient_norm(self) -> Union[torch.Tensor, float]: if self.defaults['max_grad_norm'] == 0.0: return 1.0 global_grad_norm = get_global_gradient_norm(self.param_groups, self.param_groups[0]['params'][0].device) global_grad_norm.sqrt_().add_(self.defaults['eps']) return torch.clamp(self.defaults['max_grad_norm'] / global_grad_norm, max=1.0) @torch.no_grad() def step(self, closure: CLOSURE = None) -> LOSS: loss: LOSS = None if closure is not None: with torch.enable_grad(): loss = closure() grad_norm = 1.0 if self.pre_norm: grad_norm = self.get_global_gradient_norm() for group in self.param_groups: if 'step' in group: group['step'] += 1 else: group['step'] = 1 beta1, beta2 = group['betas'] beta3: float = 1.0 - beta1 if group['grad_averaging'] else 1.0 bias_correction1: float = 1.0 - beta1 ** group['step'] step_size, n_sma = self.get_rectify_step_size( is_rectify=group['rectify'], step=group['step'], lr=group['lr'], beta2=beta2, n_sma_threshold=self.n_sma_threshold, degenerated_to_sgd=self.degenerated_to_sgd, ) step_size = self.apply_adam_debias( adam_debias=group['adam_debias'], step_size=step_size, bias_correction1=bias_correction1, ) for p in group['params']: if p.grad is None: continue grad = p.grad if grad.is_sparse: raise NoSparseGradientError(str(self)) if self.pre_norm: grad.div_(grad_norm) state = self.state[p] if len(state) == 0: state['exp_avg'] = torch.zeros_like(p) state['exp_avg_sq'] = torch.zeros_like(p) if group['adanorm']: state['exp_grad_norm'] = torch.zeros((1,), dtype=grad.dtype, device=grad.device) s_grad = self.get_adanorm_gradient( grad=grad, adanorm=group['adanorm'], exp_grad_norm=state.get('exp_grad_norm', None), r=group.get('r', None), ) exp_avg, exp_avg_sq = state['exp_avg'], state['exp_avg_sq'] exp_avg.mul_(beta1).add_(s_grad, alpha=beta3) exp_avg_sq.mul_(beta2).addcmul_(grad, grad, value=1.0 - beta2) self.apply_weight_decay( p=p, grad=None, lr=group['lr'], weight_decay=group['weight_decay'], weight_decouple=group['weight_decouple'], fixed_decay=group['fixed_decay'], ) if group['rectify']: update = p.clone() if n_sma >= self.n_sma_threshold: de_nom = exp_avg_sq.sqrt().add_(group['eps']) update.addcdiv_(exp_avg, de_nom, value=-step_size) else: update.add_(exp_avg, alpha=-step_size) else: update = exp_avg / exp_avg_sq.sqrt().add_(group['eps']) weight_norm = torch.linalg.norm(p).clamp_(min=0, max=self.clamp) p_norm = torch.linalg.norm(update) trust_ratio: float = 1.0 if weight_norm == 0 or p_norm == 0 else weight_norm / (p_norm + group['eps']) state['weight_norm'] = weight_norm state['adam_norm'] = p_norm state['trust_ratio'] = trust_ratio if group['adam']: trust_ratio = 1.0 if group['rectify']: if n_sma >= self.n_sma_threshold: p.addcdiv_(exp_avg, de_nom, value=-step_size * trust_ratio) else: p.add_(exp_avg, alpha=-step_size * trust_ratio) else: p.add_(update, alpha=-step_size * trust_ratio) return loss
(params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], lr: float = 0.001, betas: Union[Tuple[float, float], Tuple[float, float, float]] = (0.9, 0.999), weight_decay: float = 0.0, weight_decouple: bool = True, fixed_decay: bool = False, rectify: bool = False, degenerated_to_sgd: bool = False, n_sma_threshold: int = 5, grad_averaging: bool = True, max_grad_norm: float = 1.0, adam: bool = False, pre_norm: bool = False, r: float = 0.95, adanorm: bool = False, adam_debias: bool = False, eps: float = 1e-06)
[ -0.021948134526610374, -0.03867979720234871, -0.01356065645813942, 0.04939412325620651, 0.005062248092144728, -0.015995729714632034, -0.0645889863371849, -0.0753682479262352, -0.06796561926603317, -0.00036898136022500694, -0.04322526976466179, -0.011926451697945595, 0.02158016711473465, 0.07874488085508347, -0.03900447487831116, 0.0402165986597538, -0.0008198082214221358, 0.03396116569638252, 0.004458891227841377, -0.03402610123157501, -0.03194817155599594, -0.0475759357213974, -0.03820360451936722, 0.03352826461195946, -0.042532626539468765, -0.028982792049646378, 0.035108353942632675, -0.005995693150907755, -0.04883135110139847, 0.03106072172522545, 0.012402643449604511, -0.07545482367277145, 0.030043402686715126, -0.021212199702858925, 0.014253299683332443, -0.08489209413528442, 0.009107177145779133, 0.001785720931366086, -0.12207837402820587, -0.05753268301486969, 0.03419926017522812, -0.05013005807995796, 0.0621214434504509, 0.016558503732085228, 0.0037256632931530476, 0.007608253508806229, -0.01844162680208683, 0.02945898473262787, -0.024350740015506744, -0.01319268997758627, -0.0014191069640219212, -0.056363847106695175, 0.05372314527630806, 0.019004398956894875, -0.0018668901175260544, 0.05441578850150108, 0.054026175290346146, -0.009567135013639927, 0.04121227562427521, -0.06666691601276398, 0.052554309368133545, -0.07636392116546631, 0.03329016640782356, -0.022684067487716675, -0.008533581160008907, -0.021212199702858925, -0.06987038999795914, -0.0021428652107715607, 0.009561724029481411, 0.02077929861843586, 0.002731341402977705, -0.022489260882139206, 0.02097410336136818, 0.030497949570417404, -0.03480532392859459, -0.012619094923138618, -0.02865811437368393, -0.01476196013391018, -0.008192671462893486, -0.015054168179631233, 0.0340910367667675, 0.02172086015343666, -0.006742449477314949, -0.007440503686666489, 0.005817121360450983, -0.06839852035045624, 0.0034009867813438177, -0.01762993633747101, 0.011158050037920475, -0.06272750347852707, 0.017489243298768997, 0.012056321837008, 0.06480543315410614, 0.05658029764890671, 0.03365813568234444, 0.012240305542945862, -0.04402613639831543, -0.02993517555296421, 0.01944812387228012, -0.0068614971823990345, -0.0040259892120957375, 0.02632044441998005, 0.02619057334959507, 0.05519501119852066, 0.03125552833080292, -0.024567190557718277, -0.02205635979771614, -0.04450232908129692, 0.053896304219961166, -0.029978467151522636, -0.04402613639831543, -0.009577957913279533, -0.041666820645332336, -0.013658059760928154, -0.04978373646736145, 0.008593105711042881, -0.0011370442807674408, 0.009978392161428928, -0.028766341507434845, 0.049740444868803024, 0.05658029764890671, -0.0023728443775326014, -0.05259759724140167, -0.020497912541031837, 0.03870144113898277, 0.0023823140654712915, 0.03534645214676857, -0.0016274411464110017, 0.01950223743915558, -0.052684180438518524, -0.020898345857858658, 0.014058494009077549, -0.021277135238051414, 0.013712172396481037, 0.016926469281315804, -0.05025992542505264, -0.00022930280829314142, 0.027424344792962074, -0.016850711777806282, 0.007196996361017227, 0.02044379897415638, 0.02586589753627777, 0.032099686563014984, -0.011861516162753105, 0.013484898954629898, -0.025238189846277237, 0.04684000089764595, 0.001236476469784975, -0.010238133370876312, 0.007283576764166355, 0.014610444195568562, -0.010184020735323429, 0.012067144736647606, 0.004997313022613525, 0.015162394382059574, 0.012153725139796734, -0.03883131220936775, 0.006845263764262199, -0.023463290184736252, -0.013160222209990025, -0.04415600746870041, -0.05385301262140274, -0.012218659743666649, -0.007738124113529921, -0.009350684471428394, -0.010984889231622219, 0.010660212486982346, 0.046666841953992844, -0.034718744456768036, 0.03445900231599808, 0.020692717283964157, -0.06692665815353394, -0.010081206448376179, 0.024805286899209023, -0.0467534214258194, 0.11653722822666168, 0.013722994364798069, 0.009009773842990398, -0.018593143671751022, -0.006931844167411327, 0.023160260170698166, 0.0032711161766201258, -0.003227825975045562, -0.06796561926603317, -0.035108353942632675, 0.022965453565120697, -0.019751155748963356, 0.0005455242353491485, -0.016872357577085495, 0.0412772111594677, -0.014090961776673794, -0.04000014811754227, 0.02952392026782036, -0.025562865659594536, -0.044805362820625305, 0.027554215863347054, 0.0010849607642740011, 0.013571479357779026, 0.09393974393606186, 0.02238103561103344, -0.015162394382059574, 0.019058512523770332, 0.006845263764262199, 0.0015895621618255973, -0.01232688594609499, -0.011093114502727985, -0.032034751027822495, 0.04147201403975487, -0.009426441974937916, 0.004805212840437889, -0.06242447346448898, 0.01329009234905243, 0.03642870858311653, 0.06787904351949692, 0.05961061269044876, -0.04441574960947037, 0.041407082229852676, 0.04891793057322502, 0.040130019187927246, 0.006747860461473465, -0.0025676502846181393, -0.06696994602680206, -0.022965453565120697, -0.016937293112277985, 0.04108240455389023, 0.0006946725188754499, 0.030497949570417404, 0.006298724561929703, 0.003054664935916662, 0.029112663120031357, 0.01256498135626316, -0.03012998215854168, -0.017197033390402794, -0.0015016290126368403, 0.02740269899368286, 0.024761997163295746, -0.017943790182471275, -0.0005478916573338211, -0.01877712644636631, -0.024480611085891724, -0.019394012168049812, -0.013852865435183048, -0.013744640164077282, 0.029697081074118614, 0.004870147909969091, 0.010140730068087578, 0.06666691601276398, 0.026645120233297348, -0.033701423555612564, 0.01984855905175209, -0.06337685883045197, -0.002313320292159915, -0.00678032822906971, 0.06160195916891098, -0.05203482508659363, -0.02500009350478649, 0.05233785882592201, 0.05138547345995903, 0.011504371650516987, -0.054545655846595764, 0.015919972211122513, -0.06913445889949799, -0.044069427996873856, 0.03322523087263107, -0.01924249529838562, 0.035974159836769104, 0.051948245614767075, -0.01469702459871769, 0.03313865140080452, 0.02720789425075054, 0.0936800017952919, 0.07575786113739014, -0.07727301120758057, -0.00417479919269681, 0.005159651394933462, 0.05138547345995903, 0.013506543822586536, 0.01025977823883295, 0.0052651711739599705, 0.020032541826367378, 0.0637664720416069, -0.04002179205417633, -0.04075772687792778, 0.004669930785894394, -0.033052071928977966, 0.03623390197753906, -0.04329020529985428, -0.029307467862963676, 0.0317966565489769, 0.002927500056102872, 0.03365813568234444, 0.007673188578337431, 0.0635933130979538, 0.0024810698814690113, 0.0650651752948761, 0.007835526950657368, 0.016266293823719025, 0.027381055057048798, -0.02272735722362995, -0.017868032678961754, 0.052943918853998184, -0.021547699347138405, 0.06519504636526108, -0.0013568773865699768, -0.025974122807383537, -0.053030502051115036, 0.005643960554152727, 0.016320407390594482, 0.03294384479522705, -0.0032197090331465006, -0.0004285053873900324, 0.006937255151569843, 0.015324732288718224, 0.0008515994995832443, 0.015292264521121979, -0.0797838494181633, 0.004058456514030695, -0.031839944422245026, 0.032640814781188965, 0.05160192400217056, -0.03796551004052162, 0.015032523311674595, 0.025974122807383537, -0.00001134042668127222, -0.028982792049646378, -0.05939416214823723, 0.07779249548912048, 0.015151571482419968, -0.028549889102578163, -0.045065101236104965, -0.05930757895112038, -0.03941573202610016, 0.017348550260066986, 0.006477296818047762, -0.04709974303841591, -0.0285282451659441, -0.0012060380540788174, 0.0022659716196358204, 0.01512992661446333, -0.055498041212558746, 0.058485064655542374, 0.050086766481399536, -0.04060621187090874, 0.06389634311199188, 0.025757672265172005, -0.04415600746870041, 0.06454569101333618, 0.024264158681035042, -0.007234875578433275, 0.04779238626360893, -0.009112588129937649, -0.011309565976262093, -0.023420000448822975, 0.0993943065404892, 0.06692665815353394, 0.010930776596069336, -0.024567190557718277, -0.02887456677854061, 0.013041174039244652, -0.05458894744515419, -0.008511936292052269, 0.011645064689218998, -0.05177508294582367, 0.06982710212469101, 0.06428595632314682, 0.008771677501499653, -0.02519489824771881, -0.0454547144472599, 0.03562783822417259, -0.04335514083504677, 0.020681895315647125, -0.08186177909374237, -0.006174265407025814, 0.008912370540201664, -0.034913551062345505, -0.005855000112205744, -0.03796551004052162, 0.005102832801640034, 0.02779231034219265, 0.05766255035996437, 0.037251219153404236, 0.009978392161428928, 0.01135285571217537, 0.026233863085508347, 0.06255434453487396, -0.011547662317752838, 0.029891885817050934, -0.041060760617256165, 0.026039058342576027, -0.06956735998392105, 0.05151534453034401, 0.011904805898666382, 0.0003060752642340958, -0.031104011461138725, -0.09471897035837173, 0.045541293919086456, 0.035649482160806656, 0.059437450021505356, -0.0667102038860321, -0.0435715913772583, -0.005424803588539362, -0.013235979713499546, 0.0006645722896791995, -0.004163976758718491, -0.06246776506304741, -0.06813877820968628, 0.03108236752450466, 0.048528317362070084, -0.020281460136175156, 0.09194839745759964, -0.0046131121926009655, 0.04320362210273743, -0.05316036939620972, 0.010882074944674969, -0.0029816129244863987, -0.03339839354157448, 0.0013108814600855112, -0.020692717283964157, -0.022359389811754227, 0.023268485441803932, 0.04164517670869827, 0.025411350652575493, 0.046536970883607864, 0.025952477008104324, 0.009908045642077923, -0.018160240724682808, -0.09653715789318085, -0.012316063046455383, -0.0993943065404892, -0.03950231149792671, 0.011158050037920475, -0.009864754974842072, -0.033571552485227585, -0.016926469281315804, -0.012045498937368393, 0.011147228069603443, -0.00995674729347229, 0.0376841239631176, 0.0296754352748394, -0.03716463968157768, 0.044329170137643814, -0.039653826504945755, 0.0385066382586956, 0.02324683964252472, 0.006028160918504, -0.043008819222450256, -0.006390716414898634, -0.022142939269542694, -0.059091128408908844, 0.006953489035367966, 0.025281479582190514, 0.008290073834359646, 0.0614720918238163, 0.02365809679031372, -0.0094210309907794, -0.006331192329525948, 0.005303049925714731, -0.029307467862963676, 0.01890699751675129, 0.008457823656499386, -0.015443780459463596, 0.03025985322892666, -0.018084483221173286, 0.050216637551784515, 0.022965453565120697, 0.027770666405558586, 0.07506521791219711, -0.0004890440031886101, 0.003538974095135927, 0.021277135238051414, -0.014610444195568562, -0.03339839354157448, 0.0157792791724205, -0.02571438066661358, -0.021948134526610374, -0.028246859088540077, -0.02551957592368126, 0.0032846443355083466, -0.0029762014746665955, -0.009383152239024639, 0.029891885817050934, -0.05740281194448471, 0.02311696857213974, 0.0483984500169754, 0.026774991303682327, 0.013387495651841164, 0.014686201699078083, 0.024870222434401512, 0.011417791247367859, 0.037186287343502045, -0.08601763844490051, -0.05610410496592522, 0.07424270361661911, 0.03816031664609909, -0.08324706554412842, -0.06086602807044983, 0.01005956158041954, 0.0039421143010258675, 0.08112584054470062, -0.030368078500032425, 0.01490265317261219, -0.011742467992007732, -0.04370146244764328, -0.02551957592368126, 0.028766341507434845, 0.003722957568243146, -0.057359520345926285, 0.005151534453034401, -0.029783660545945168, 0.029220888391137123, -0.04965386539697647, -0.02432909421622753, 0.024004418402910233, 0.010276012122631073, -0.009329038672149181, -0.01349572092294693, 0.020552024245262146, 0.052078116685152054, 0.04348501190543175, -0.042337819933891296, 0.03854992613196373, 0.022424325346946716, -0.03666680306196213, -0.0578790046274662, 0.01711045391857624, 0.045324843376874924, -0.0002276117738801986, -0.01360394712537527, 0.032034751027822495, -0.0007379627204500139, -0.007445915136486292, -0.0037716589868068695, 0.04268414154648781, 0.056753456592559814, -0.003909646533429623, 0.0038203606382012367, -0.004477830603718758, -0.04614735767245293, -0.08606092631816864, -0.030952496454119682, -0.01562776416540146, 0.010481640696525574, 0.008111502043902874, -0.025497930124402046, -0.048268578946590424, 0.049134381115436554, -0.025476284325122833, 0.04878805950284004, -0.044935233891010284, -0.022662421688437462, 0.010984889231622219, 0.017023872584104538, -0.011850693263113499, 0.01738101616501808, 0.05653700605034828, -0.023636450991034508, -0.0288529209792614, 0.008966483175754547, 0.011039001867175102, 0.012056321837008, -0.04588761553168297, -0.04774909466505051, 0.00871756486594677, -0.04896122217178345, 0.010173197835683823, 0.024567190557718277, 0.006028160918504, 0.002387725282460451, -0.05671016871929169, 0.02932911366224289, 0.0023620217107236385, -0.020346395671367645, -0.013961090706288815, -0.014751137234270573, -0.03668844699859619, 0.017889676615595818, 0.017586644738912582, -0.03508671000599861, -0.000036082215956412256, -0.019794445484876633, 0.0814288780093193, -0.022943807765841484, -0.03253258764743805, -0.019210027530789375, 0.022489260882139206, 0.051212310791015625, -0.08181848376989365, 0.05238114669919014, 0.0008042508270591497, 0.0296754352748394, -0.04060621187090874, 0.033701423555612564, -0.01683988980948925, -0.061775121837854385, -0.013225157745182514, 0.054026175290346146, -0.03445900231599808, 0.016212182119488716, 0.03352826461195946, 0.034047745168209076, -0.008338775485754013, 0.0042559681460261345, 0.029350759461522102, 0.015735989436507225, 0.0015327438013628125, -0.02192648872733116, 0.010714325122535229, 0.005779242143034935, 0.031969815492630005, -0.027878891676664352, -0.03948066756129265, -0.016872357577085495, -0.007191585376858711, -0.02580096200108528, -0.043658170849084854, -0.04002179205417633, -0.004623935092240572, 0.02165592461824417, 0.1260610818862915, 0.011699177324771881, -0.0067316265776753426, 0.00320618087425828, -0.020010896027088165, 0.022272810339927673, -0.004485947545617819, -0.05164521560072899, 0.03158020228147507, -0.07173186540603638, -0.0069047873839735985, -0.0376841239631176, -0.02192648872733116, 0.011049824766814709, 0.029480628669261932, -0.04818199574947357, 0.049480702728033066, 0.015194862149655819, 0.062251314520835876, 0.025216544046998024, -0.02632044441998005, -0.02324683964252472, -0.00887990277260542, 0.006001104600727558, -0.014080138877034187, -0.014848540537059307, -0.02045462094247341, 0.005508678499609232, 0.002616351703181863, 0.020757652819156647, 0.07134225964546204, 0.05246772617101669, -0.015660231932997704, 0.03694818913936615, -0.04844173789024353, -0.007824704051017761, -0.006320369895547628, 0.0233767107129097, 0.021829085424542427, 0.04870148003101349, -0.0034361600410193205, -0.04809541627764702, -0.03218626603484154, -0.017121275886893272, -0.004797095898538828, 0.007159117609262466, -0.011417791247367859, 0.008338775485754013, -0.016872357577085495, 0.02270571142435074, 0.03212133049964905, 0.023636450991034508, -0.10632073879241943, -0.030389724299311638, -0.05112573131918907, 0.014891830272972584, 0.018322579562664032, -0.0007284929743036628, 0.02004336379468441, -0.06580111384391785, -0.014783605001866817, -0.006401538848876953, 0.036710094660520554, 0.028181923553347588, -0.015400489792227745, 0.015173216350376606, 0.028030406683683395, 0.020140767097473145, -0.013387495651841164, 0.015984907746315002, 0.004320903681218624, -0.007705656345933676, -0.03813866898417473, -0.014220831915736198, 0.023484935984015465, -0.0026704645715653896, 0.03783563897013664, -0.03829018399119377, -0.035584546625614166, -0.011536839418113232, -0.00003897809438058175, -0.03649364411830902, -0.008073623292148113, -0.026839926838874817, -0.05835519731044769, -0.002493245294317603, 0.0065043531358242035, 0.06367988884449005, 0.01562776416540146, 0.007548729423433542, -0.020941635593771935, -0.004231617320328951, 0.007732712663710117, 0.0292641781270504, 0.031428687274456024, -0.006688336376100779, 0.055281590670347214, -0.01770569384098053, 0.011818225495517254, -0.02225116454064846, -0.05220798775553703, 0.0526408888399601, -0.017586644738912582, 0.0332685224711895, 0.026168929412961006, -0.011807403527200222, -0.06134222075343132, -0.06251105666160583, 0.020671073347330093, -0.03372306749224663, 0.042987171560525894, -0.022207874804735184, 0.042727433145046234, 0.0380953811109066, 0.014729492366313934, 0.022835582494735718, 0.009258692152798176, -0.010070383548736572, 0.03829018399119377, 0.006439418066293001, -0.009063886478543282, 0.028246859088540077, 0.04058456793427467, 0.020952459424734116, -0.037575896829366684, -0.021601811051368713, -0.016948115080595016, 0.049610573798418045, -0.021742505952715874, -0.029762014746665955, 0.022684067487716675, -0.05056295916438103, 0.06121234968304634, -0.0013906977837905288, 0.009778174571692944, 0.06398291885852814, 0.05826861411333084, -0.04337678477168083, 0.04891793057322502, -0.05290063098073006, -0.06008680537343025, -0.08831201493740082, 0.025909187272191048, -0.04558458551764488, 0.05536817014217377, 0.013365850783884525, -0.013896155171096325, 0.009209991432726383, 0.007862583734095097, 0.006893964949995279 ]
716,979
pytorch_optimizer.optimizer.lamb
__init__
null
def __init__( self, params: PARAMETERS, lr: float = 1e-3, betas: BETAS = (0.9, 0.999), weight_decay: float = 0.0, weight_decouple: bool = True, fixed_decay: bool = False, rectify: bool = False, degenerated_to_sgd: bool = False, n_sma_threshold: int = 5, grad_averaging: bool = True, max_grad_norm: float = 1.0, adam: bool = False, pre_norm: bool = False, r: float = 0.95, adanorm: bool = False, adam_debias: bool = False, eps: float = 1e-6, ): self.validate_learning_rate(lr) self.validate_betas(betas) self.validate_non_negative(weight_decay, 'weight_decay') self.validate_non_negative(max_grad_norm, 'max_grad_norm') self.validate_non_negative(eps, 'eps') self.degenerated_to_sgd = degenerated_to_sgd self.n_sma_threshold = n_sma_threshold self.pre_norm = pre_norm defaults: DEFAULTS = { 'lr': lr, 'betas': betas, 'weight_decay': weight_decay, 'weight_decouple': weight_decouple, 'fixed_decay': fixed_decay, 'rectify': rectify, 'grad_averaging': grad_averaging, 'max_grad_norm': max_grad_norm, 'adam': adam, 'adanorm': adanorm, 'adam_debias': adam_debias, 'eps': eps, } if adanorm: defaults.update({'r': r}) super().__init__(params, defaults)
(self, params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], lr: float = 0.001, betas: Union[Tuple[float, float], Tuple[float, float, float]] = (0.9, 0.999), weight_decay: float = 0.0, weight_decouple: bool = True, fixed_decay: bool = False, rectify: bool = False, degenerated_to_sgd: bool = False, n_sma_threshold: int = 5, grad_averaging: bool = True, max_grad_norm: float = 1.0, adam: bool = False, pre_norm: bool = False, r: float = 0.95, adanorm: bool = False, adam_debias: bool = False, eps: float = 1e-06)
[ 0.0037416997365653515, -0.04211609810590744, -0.021647218614816666, 0.020963020622730255, -0.030826855450868607, -0.025904441252350807, -0.09700386226177216, -0.02229340374469757, -0.03983544185757637, 0.012980728410184383, -0.041089802980422974, 0.05751052126288414, 0.022806551307439804, 0.06845766305923462, -0.06028531491756439, 0.05583803728222847, 0.017466016113758087, 0.03523612022399902, -0.008409915491938591, -0.011906920000910759, -0.004361752886325121, -0.015061826445162296, -0.049224138259887695, 0.07830249518156052, 0.009241404943168163, 0.04112781211733818, 0.0037060645408928394, -0.0058584329672157764, -0.02881227619946003, 0.019936727359890938, 0.0010328278876841068, -0.0341528095304966, 0.011498303152620792, 0.04215410724282265, 0.029781553894281387, -0.03084586001932621, -0.019147999584674835, 0.011336755938827991, -0.1347867101430893, 0.029629511758685112, 0.047817736864089966, -0.04690547287464142, 0.08255971223115921, -0.027139795944094658, -0.018406787887215614, -0.009079857729375362, 0.012058963999152184, 0.03983544185757637, -0.03156806901097298, -0.0326513797044754, 0.026151511818170547, -0.03238530084490776, 0.025353282690048218, 0.005791913717985153, -0.05515384301543236, 0.06674717366695404, 0.04234416410326958, 0.0676974430680275, 0.051390763372182846, -0.005696886219084263, 0.0320051945745945, -0.03367767482995987, 0.02506820112466812, -0.00896107405424118, -0.01292371191084385, -0.004060041159391403, -0.09251857548952103, -0.017637066543102264, 0.015470444224774837, 0.04462481662631035, 0.09996871650218964, 0.0028959568589925766, 0.0031976685859262943, 0.03620539978146553, -0.004060041159391403, 0.00583467585965991, -0.07586979120969772, -0.04796977713704109, -0.03841003403067589, -0.024916157126426697, 0.067735455930233, 0.051922913640737534, -0.012667138129472733, -0.04709552600979805, 0.001471735187806189, -0.0591069795191288, -0.0317201130092144, -0.0449669174849987, 0.010015876963734627, -0.023224670439958572, -0.03441888839006424, -0.0059439572505652905, 0.03424783796072006, 0.0050269439816474915, 0.04690547287464142, 0.00909886322915554, -0.0010833111591637135, -0.06948395818471909, 0.018492311239242554, -0.016487235203385353, -0.03411480039358139, 0.010861620306968689, -0.03306949883699417, 0.01680082641541958, 0.03141602501273155, -0.03736473247408867, -0.044852882623672485, -0.025828419253230095, 0.0431043803691864, -0.04234416410326958, -0.037269704043865204, 0.035065073519945145, -0.02468809112906456, 0.02056390605866909, -0.06336420029401779, -0.007131798658519983, 0.010966150090098381, 0.010348472744226456, -0.010424494743347168, 0.01222051028162241, 0.03975941985845566, 0.02886929176747799, -0.04120383411645889, 0.044852882623672485, 0.041165824979543686, -0.00809632521122694, 0.013645919971168041, 0.021514179185032845, 0.02369980700314045, -0.03706064447760582, 0.018729880452156067, -0.00795853603631258, -0.02487814612686634, -0.01234404556453228, 0.02586643025279045, -0.040481626987457275, 0.018796399235725403, 0.05059253051877022, -0.030693816021084785, 0.01499530766159296, 0.0609695129096508, 0.010044384747743607, 0.03434286639094353, -0.027063773944973946, -0.011707362718880177, 0.0009336431976407766, -0.007089036051183939, -0.010234439745545387, -0.02265450730919838, 0.03177712857723236, 0.03059878945350647, -0.0011029106099158525, -0.006499866954982281, 0.032100219279527664, 0.004036284517496824, -0.05188490450382233, 0.012743160128593445, -0.018492311239242554, -0.014358624815940857, 0.013379842974245548, -0.04968027025461197, -0.002722532022744417, 0.02636057138442993, -0.03953135386109352, -0.001604773453436792, 0.02043086849153042, -0.019414076581597328, 0.01896744780242443, -0.027234822511672974, -0.006115006282925606, -0.009027592837810516, -0.09000985324382782, -0.06518872827291489, 0.026930736377835274, -0.03544517979025841, 0.0726388618350029, 0.03120696358382702, 0.011488799937069416, -0.031168952584266663, -0.007663951255381107, 0.053291305899620056, -0.004223963245749474, -0.017580049112439156, -0.07830249518156052, 0.006856219377368689, -0.00102570082526654, -0.021324126049876213, 0.02807106263935566, -0.019309546798467636, 0.023243676871061325, 0.060057252645492554, -0.01151730865240097, 0.014016525819897652, 0.008894555270671844, -0.00593920610845089, 0.0006865722243674099, 0.02531527169048786, -0.019290540367364883, 0.024155938997864723, 0.05059253051877022, 0.06883777678012848, 0.024783119559288025, 0.0098543306812644, -0.02482113055884838, 0.022008322179317474, -0.019366562366485596, -0.024060910567641258, 0.004043411463499069, -0.020164791494607925, -0.00347799900919199, -0.023072628304362297, -0.03439988195896149, 0.052607111632823944, 0.04074770584702492, 0.016335193067789078, -0.056370191276073456, 0.029382439330220222, 0.03263237327337265, 0.01951860636472702, 0.015384919010102749, 0.0676974430680275, -0.037098657339811325, -0.019537612795829773, -0.020240813493728638, 0.0461832657456398, 0.0023222295567393303, 0.02924940176308155, -0.04268626123666763, -0.05146678164601326, -0.00023593496007379144, 0.001107068033888936, -0.045651111751794815, -0.02265450730919838, 0.0020407112315297127, 0.017532536759972572, 0.007321853190660477, -0.014206580817699432, 0.029781553894281387, -0.08141938596963882, -0.04720956087112427, 0.029838571324944496, 0.03495103865861893, 0.0005170078948140144, 0.016734307631850243, 0.015251881442964077, -0.01021543424576521, 0.03818196803331375, 0.01422558631747961, -0.05013640224933624, -0.023984888568520546, -0.03763080760836601, -0.01597408764064312, -0.011184712871909142, 0.05564798414707184, -0.05412754788994789, -0.012420067563652992, 0.03688959777355194, 0.02271152287721634, 0.027747970074415207, -0.01809319667518139, 0.00023697431606706232, -0.02504919469356537, -0.026094496250152588, 0.059259023517370224, 0.0010571787133812904, 0.02966752089560032, 0.015850553289055824, 0.00008418824290856719, 0.013902493752539158, 0.004036284517496824, 0.09677579998970032, 0.051124684512615204, -0.043560512363910675, -0.0024136933498084545, -0.009436210617423058, 0.009659525007009506, 0.0004071325820405036, -0.032423313707113266, 0.002648885827511549, 0.05283517763018608, 0.05431760102510452, -0.03529313951730728, 0.0212481040507555, 0.0209250096231699, 0.005549594294279814, 0.006076995749026537, -0.020601917058229446, -0.007792238146066666, 0.006423845421522856, 0.01391199603676796, -0.0020656557753682137, 0.005107717122882605, 0.06929390132427216, 0.0024493285454809666, 0.1021733507514, -0.012448575347661972, 0.04359852150082588, -0.010167920961976051, 0.031682100147008896, -0.025942452251911163, 0.06271801888942719, -0.0360153466463089, 0.060361336916685104, 0.0038676110561937094, -0.06043735891580582, -0.03810594603419304, 0.02966752089560032, 0.010253445245325565, 0.03890417516231537, 0.023566769436001778, 0.00852394849061966, 0.0366235189139843, 0.08476434648036957, 0.012904706411063671, 0.04112781211733818, -0.06271801888942719, 0.0000827776821097359, -0.0609695129096508, 0.03497004508972168, 0.05811869353055954, -0.02641758881509304, 0.02345273643732071, 0.01781761832535267, -0.03460894152522087, -0.035369157791137695, -0.05762455239892006, 0.016373202204704285, 0.028109073638916016, -0.031606078147888184, -0.014757739380002022, -0.047627680003643036, -0.018957946449518204, 0.023186659440398216, -0.01761806011199951, -0.04333244636654854, 0.011184712871909142, 0.0006978567107580602, 0.028223106637597084, 0.007901519536972046, -0.042382173240184784, 0.0856005847454071, 0.0017330603441223502, -0.017218945547938347, 0.06910385191440582, -0.005345285404473543, -0.029097357764840126, 0.03282242640852928, -0.0357302650809288, 0.028223106637597084, 0.012258521281182766, -0.01018692646175623, 0.027614932507276535, -0.011906920000910759, 0.12163493782281876, 0.04671541973948479, -0.0015085582854226232, -0.015232875943183899, -0.0027249075938016176, 0.03145403414964676, -0.05146678164601326, -0.01773209311068058, 0.0036371697206050158, -0.03622440621256828, 0.052607111632823944, 0.0230916328728199, -0.008614224381744862, -0.02837515063583851, -0.038999203592538834, 0.040101516991853714, -0.027367861941456795, 0.016724804416298866, -0.07431134581565857, -0.027063773944973946, -0.01564149372279644, 0.009787811897695065, -0.010414991527795792, -0.03681357577443123, 0.004646834917366505, 0.03649048134684563, -0.003936505876481533, 0.004765619058161974, 0.011213220655918121, 0.04538503661751747, 0.0341908223927021, 0.029971608892083168, -0.04055764898657799, 0.01046250481158495, 0.006038984749466181, 0.059753164649009705, -0.022692518308758736, 0.00794428214430809, -0.012591117061674595, 0.008923063054680824, -0.020278824493288994, -0.0652647465467453, 0.019281039014458656, 0.03514109551906586, 0.056180138140916824, -0.058156706392765045, -0.03700362890958786, -0.03021867945790291, -0.056370191276073456, -0.017161929979920387, 0.017532536759972572, -0.03141602501273155, -0.031301990151405334, 0.042572230100631714, 0.023167654871940613, 0.009640519507229328, 0.07366515696048737, -0.004354625940322876, 0.0030836358200758696, -0.04530901461839676, -0.002241456415504217, -0.0304847564548254, -0.02961050532758236, -0.0031454034615308046, 0.00874251127243042, 0.012581613846123219, -0.0030099896248430014, 0.03004763089120388, 0.024726102128624916, 0.05751052126288414, 0.03713666647672653, 0.057776596397161484, 0.030921882018446922, -0.054279591888189316, 0.00898958183825016, -0.04413067549467087, -0.06009526178240776, -0.02295859530568123, 0.007578426972031593, -0.04363653436303139, -0.027443883940577507, 0.010110904462635517, 0.018425792455673218, -0.027538910508155823, -0.00020193299860693514, 0.015869557857513428, -0.023224670439958572, 0.04200206324458122, -0.06883777678012848, -0.0004184170684311539, -0.030560778453946114, -0.04591719061136246, -0.049908336251974106, -0.006252795923501253, -0.014890776947140694, -0.03911323472857475, -0.02537228725850582, 0.025087205693125725, 0.02820410206913948, 0.049718279391527176, 0.002988608554005623, -0.03563523665070534, -0.030256690457463264, 0.007654448505491018, -0.03348761796951294, 0.030579783022403717, -0.014368127100169659, 0.03749777004122734, -0.004710978362709284, -0.03603434935212135, 0.015261383727192879, -0.016268672421574593, 0.04637331888079643, 0.07807442545890808, -0.025581348687410355, -0.022635502740740776, -0.007350361440330744, 0.005981968250125647, -0.01578403450548649, 0.030579783022403717, -0.03668053448200226, -0.032480329275131226, 0.0103104617446661, -0.03189115971326828, -0.023357709869742393, -0.03384872153401375, 0.005411804653704166, 0.017960159108042717, -0.04717154800891876, 0.0019563743844628334, 0.09609159827232361, 0.015689006075263023, -0.003630042774602771, -0.0449289046227932, -0.0006049081566743553, 0.0028318134136497974, 0.035996340215206146, -0.07605984807014465, -0.03620539978146553, 0.04131786897778511, 0.06294608116149902, -0.042458195239305496, -0.001016792026348412, 0.02666465938091278, 0.007112793158739805, 0.03700362890958786, -0.007854006253182888, 0.015717513859272003, -0.044472772628068924, -0.058460790663957596, -0.022692518308758736, 0.028356144204735756, -0.028736254200339317, -0.0941910520195961, 0.011612335219979286, -0.03122597001492977, 0.015631990507245064, -0.0304847564548254, 0.00008433672337559983, -0.02708277851343155, 0.02869824320077896, -0.016781819984316826, -0.027139795944094658, -0.0394173227250576, 0.04538503661751747, -0.025087205693125725, -0.03736473247408867, 0.04295233637094498, 0.04652536287903786, 0.01737098954617977, -0.03557822108268738, 0.0068704732693731785, 0.05245506763458252, 0.012391559779644012, -0.02573339082300663, 0.08940167725086212, 0.01995573192834854, 0.011536314152181149, -0.04945220425724983, -0.022445447742938995, 0.04477686062455177, 0.015536963008344173, 0.05116269737482071, 0.02419394999742508, -0.0298575758934021, -0.053595393896102905, -0.043446481227874756, 0.010224937461316586, 0.021229097619652748, 0.014111553318798542, -0.04527100548148155, -0.019138498231768608, 0.016268672421574593, -0.024954168125987053, 0.05013640224933624, -0.03785887360572815, -0.03818196803331375, 0.044662829488515854, -0.0017425630940124393, -0.02419394999742508, 0.02949647232890129, 0.052112970501184464, -0.009516983292996883, -0.006542629096657038, -0.014092547819018364, 0.054583679884672165, 0.018758388236165047, -0.02658863738179207, -0.021723240613937378, -0.008718754164874554, -0.0029743544291704893, -0.04230615124106407, 0.02653162181377411, 0.035198111087083817, -0.010975652374327183, -0.07005412131547928, 0.010833111591637135, -0.004423520527780056, -0.010319964028894901, -0.0072648366913199425, 0.0007483399822376668, -0.05237904563546181, 0.03109293058514595, -0.003273690352216363, 0.0026275047566741705, -0.05743449926376343, -0.026493610814213753, 0.03238530084490776, -0.02426997199654579, -0.06860970705747604, -0.07339908182621002, 0.010110904462635517, 0.016667786985635757, -0.0726388618350029, 0.021761251613497734, -0.009089360944926739, 0.015498952008783817, -0.01732347533106804, 0.04200206324458122, -0.024517042562365532, -0.04519498348236084, -0.04956623911857605, 0.041774000972509384, -0.005293020512908697, -0.032670386135578156, 0.039493344724178314, 0.05363340675830841, -0.06857169419527054, -0.009778308682143688, 0.022692518308758736, 0.026018474251031876, 0.008956322446465492, -0.012933215126395226, 0.00035427362308837473, 0.0335446372628212, 0.025961456820368767, -0.04766569286584854, -0.0007792238029651344, -0.013626914471387863, 0.009317426010966301, -0.05196092650294304, -0.003069381695240736, -0.05291119962930679, -0.041774000972509384, 0.0344759039580822, 0.11486899852752686, 0.012999733909964561, 0.02487814612686634, -0.009326929226517677, -0.025353282690048218, 0.04280029237270355, -0.0597151517868042, -0.030332712456583977, 0.014976302161812782, -0.12574011087417603, 0.0021975061390548944, -0.053785450756549835, 0.023984888568520546, -0.032100219279527664, 0.02708277851343155, -0.08537252247333527, 0.014121056534349918, 0.030579783022403717, 0.03554020822048187, 0.049908336251974106, 0.01410205103456974, -0.009127371944487095, 0.0304847564548254, 0.03688959777355194, -0.009203393943607807, 0.00505070062354207, -0.017599055543541908, -0.019499601796269417, -0.03219524770975113, -0.005164733622223139, 0.060741446912288666, 0.03983544185757637, -0.03202419728040695, 0.06944594532251358, -0.06826760619878769, -0.01773209311068058, 0.003504131454974413, 0.013398848474025726, 0.011469794437289238, 0.031016908586025238, 0.030142657458782196, -0.025904441252350807, -0.032233260571956635, -0.012591117061674595, 0.04352250322699547, 0.012819182127714157, 0.003551645204424858, -0.007887265644967556, -0.033772699534893036, 0.008186601102352142, -0.0034732476342469454, -0.006210033781826496, -0.0634022131562233, 0.001901733805425465, -0.035616230219602585, 0.024859139695763588, 0.017114415764808655, 0.013940504752099514, -0.02364279143512249, -0.0634402260184288, 0.016857841983437538, -0.010719078592956066, 0.04789375886321068, 0.06446652114391327, -0.005140976514667273, -0.04758967086672783, 0.021343130618333817, 0.002015766454860568, -0.062033817172050476, 0.015983590856194496, -0.005948708858340979, -0.01932855136692524, -0.06127360090613365, -0.013275313191115856, 0.024726102128624916, -0.0022093846928328276, 0.042496208101511, -0.026645652949810028, -0.06385834515094757, -0.05009838938713074, 0.009127371944487095, -0.018273748457431793, -0.002157119568437338, -0.02691172994673252, -0.05500179901719093, 0.06336420029401779, -0.02573339082300663, 0.028223106637597084, 0.01671530120074749, 0.018710874021053314, 0.018264247104525566, -0.04690547287464142, 0.03348761796951294, 0.05800466239452362, 0.039189256727695465, -0.04268626123666763, -0.000820798275526613, 0.013151777908205986, 0.02160920761525631, 0.0012062527239322662, -0.047437626868486404, 0.013303820975124836, -0.03436186909675598, 0.014643706381320953, 0.03576827421784401, 0.0038652352523058653, -0.007811243645846844, -0.06484662741422653, -0.00036615206045098603, -0.0059106978587806225, 0.05336732789874077, -0.03934130072593689, 0.04720956087112427, 0.02850818820297718, -0.023813840001821518, -0.00020341780327726156, 0.01010140124708414, -0.01764656975865364, 0.0516948476433754, 0.013778957538306713, 0.04272427037358284, 0.07837851345539093, 0.02554333768785, 0.04025356099009514, -0.05473572388291359, -0.014301608316600323, -0.01600259728729725, 0.05690234526991844, -0.011393772438168526, -0.0072553339414298534, 0.04717154800891876, -0.020639928057789803, 0.04105179011821747, -0.018273748457431793, 0.009692784398794174, 0.05424157902598381, 0.04542304575443268, -0.04211609810590744, 0.03489402309060097, -0.03145403414964676, -0.039683397859334946, -0.09213846921920776, 0.0029648516792804003, -0.0473996140062809, 0.06336420029401779, 0.018729880452156067, 0.012524597346782684, 0.03626241534948349, 0.01333232969045639, 0.0014325365191325545 ]
716,982
pytorch_optimizer.optimizer.lamb
__str__
null
def __str__(self) -> str: return 'Lamb'
(self) -> str
[ 0.009261107072234154, -0.04012863710522652, 0.03480752557516098, -0.023843325674533844, -0.007761366665363312, -0.07368214428424835, 0.013582391664385796, 0.00008446629362879321, 0.08120626211166382, -0.06432783603668213, -0.05863390490412712, -0.02340272255241871, -0.02330104634165764, 0.03402800112962723, 0.006566658616065979, 0.013243467546999454, -0.000485085416585207, -0.045924242585897446, -0.004410252440720797, 0.018420536071062088, 0.014743207022547722, 0.02469063550233841, 0.04511082544922829, -0.01647172123193741, -0.02711394429206848, 0.05426178127527237, -0.003122340189293027, -0.03358739987015724, -0.019369523972272873, 0.04507693275809288, 0.01688690297305584, -0.05985403060913086, 0.01445512194186449, -0.025114290416240692, -0.026198849081993103, -0.011930135078728199, -0.031282711774110794, 0.02043713629245758, -0.06409058719873428, -0.031706370413303375, 0.016649655997753143, 0.012125017121434212, -0.0005571068031713367, -0.001869379309937358, -0.02992701530456543, -0.0513470321893692, 0.011811511591076851, 0.02691059000790119, 0.004422962199896574, 0.017132623121142387, -0.015666775405406952, 0.02084384486079216, -0.0420943982899189, -0.018132450059056282, -0.029757553711533546, 0.012209747917950153, 0.03602765500545502, -0.00957461167126894, -0.004211134277284145, 0.05466848984360695, -0.026503881439566612, -0.03758670389652252, 0.05605807900428772, -0.03928132727742195, -0.04317895695567131, -0.002785534132272005, -0.0039018660318106413, 0.05273662135004997, 0.03240116313099861, 0.048330605030059814, 0.022657088935375214, -0.02114887721836567, -0.015488840639591217, 0.05558358505368233, 0.020165996626019478, -0.008744247257709503, -0.08751025795936584, 0.008998440578579903, 0.009150955826044083, -0.0037429952062666416, 0.02340272255241871, -0.02613106369972229, -0.043314527720212936, -0.00911706406623125, -0.04100983962416649, -0.09449209272861481, -0.04039977863430977, -0.07252980023622513, -0.00047767144860699773, 0.003874328453093767, -0.036163222044706345, 0.019877910614013672, -0.0038616186939179897, 0.06897109746932983, -0.05456681177020073, -0.020860791206359863, -0.005198251456022263, -0.020759113132953644, 0.03741724416613579, 0.04334842041134834, 0.0017369870329275727, 0.021962294355034828, -0.0011120954295620322, 0.02330104634165764, -0.051211461424827576, 0.0030206628143787384, -0.0328587107360363, 0.0049948967061936855, 0.012379210442304611, 0.020962467417120934, -0.048906777054071426, 0.005998960230499506, 0.0130909513682127, 0.028266286477446556, -0.0028702651616185904, -0.04029810056090355, 0.0006370717892423272, -0.012184328399598598, 0.038332339376211166, -0.008358720690011978, 0.018251074478030205, -0.004948294721543789, -0.03187583014369011, -0.0323503240942955, 0.06280267238616943, 0.09408538788557053, -0.03177415207028389, -0.05605807900428772, 0.038840726017951965, -0.026164956390857697, 0.058193303644657135, 0.014565272256731987, -0.06246374920010567, -0.012396156787872314, 0.09903368353843689, -0.005143176298588514, 0.03240116313099861, 0.02314852923154831, 0.0785626545548439, 0.14180593192577362, -0.01843748241662979, -0.008786612190306187, 0.07327543199062347, 0.04036588594317436, -0.014548325911164284, -0.002908394206315279, 0.0026880933437496424, 0.03836623206734657, -0.01750544086098671, 0.015005873516201973, 0.045212503522634506, 0.042636677622795105, 0.015895549207925797, -0.007511409930884838, -0.02043713629245758, 0.013116370886564255, -0.018352750688791275, -0.034417763352394104, 0.03358739987015724, -0.020352404564619064, 0.0020261318422853947, -0.03846791014075279, -0.015395636670291424, 0.033400990068912506, 0.0044356719590723515, 0.03297733515501022, -0.0003542818012647331, 0.035248126834630966, 0.02423308789730072, -0.02350440062582493, -0.031706370413303375, -0.04944905638694763, -0.09259411692619324, 0.034316085278987885, 0.029893124476075172, 0.04121319577097893, -0.00995590165257454, 0.08344316482543945, 0.02752065286040306, -0.010277879424393177, -0.0087273009121418, -0.01786131039261818, -0.043822914361953735, -0.01606501266360283, 0.05009301379323006, -0.04785611107945442, -0.01388742309063673, 0.05232991278171539, 0.03189277648925781, -0.006748830433934927, -0.011498006992042065, 0.010176202282309532, -0.02807987853884697, 0.021589478477835655, -0.01992874965071678, -0.039654143154621124, 0.0044271987862885, -0.0456869974732399, 0.022877391427755356, 0.01159968413412571, -0.02823239378631115, 0.04531417787075043, -0.024673689156770706, 0.03721388801932335, 0.07673246413469315, 0.01054901909083128, 0.0016437828307971358, 0.0008356602629646659, -0.0016681430861353874, -0.055888619273900986, 0.013074005022644997, 0.01991180330514908, -0.0003521635371726006, 0.020877737551927567, 0.05805773288011551, -0.06910666823387146, 0.016556452959775925, -0.01530243270099163, -0.008405323140323162, 0.025605730712413788, 0.059684570878744125, -0.03856958448886871, 0.002450846368446946, -0.02048797346651554, -0.04300949349999428, 0.003976005595177412, -0.00026015087496489286, -0.02319936826825142, -0.016717441380023956, 0.017674902454018593, -0.020504919812083244, -0.03707831725478172, -0.037857845425605774, -0.005668508820235729, -0.0431111715734005, 0.026859750971198082, -0.01884419098496437, -0.020776059478521347, -0.09252633154392242, -0.03717999532818794, -0.00302913598716259, 0.027588438242673874, 0.0013016811572015285, 0.021165823563933372, 0.059989601373672485, -0.04267057031393051, 0.013031639158725739, 0.016149742528796196, -0.03829844668507576, -0.0161666888743639, 0.003270619548857212, -0.011667469516396523, 0.004795779008418322, 0.0061684222891926765, 0.01329430565237999, -0.0621248260140419, -0.04609370604157448, 0.038332339376211166, 0.012726607732474804, 0.0013313370291143656, -0.05744766816496849, -0.03229948505759239, -0.03289260342717171, 0.04399237409234047, -0.010608330368995667, 0.02582603134214878, -0.04555142670869827, 0.028300179168581963, 0.06717479974031448, -0.00919332168996334, 0.07863043993711472, -0.00381289841607213, -0.055786941200494766, 0.01869167573750019, -0.02992701530456543, 0.005537176039069891, -0.011667469516396523, 0.041247088462114334, -0.08561228215694427, -0.03731556609272957, -0.0075622485019266605, -0.05812551826238632, -0.015522733330726624, 0.015277013182640076, 0.002177588641643524, -0.03514644876122475, 0.028622157871723175, -0.04697490856051445, 0.028893297538161278, 0.002239018678665161, 0.08906930685043335, -0.01037108339369297, -0.018284965306520462, 0.015132970176637173, 0.03174025937914848, 0.005821024999022484, 0.03958635777235031, 0.03168942406773567, -0.018030773848295212, -0.019386470317840576, -0.014650003053247929, -0.045212503522634506, 0.008879817090928555, -0.02484315074980259, -0.033756859600543976, -0.03633268550038338, -0.021860618144273758, -0.00803674291819334, -0.010066051967442036, 0.018708622083067894, -0.027961255982518196, 0.0034104257356375456, 0.028520479798316956, 0.04609370604157448, 0.024199195206165314, 0.04717826470732689, 0.005676981993019581, -0.00131862738635391, 0.012946908362209797, 0.041247088462114334, -0.009066225029528141, -0.026978375390172005, -0.04429740831255913, 0.018183289095759392, 0.0043636504560709, -0.014344971626996994, -0.020199889317154884, 0.07869822531938553, 0.023012960329651833, 0.026351364329457283, -0.062294285744428635, -0.0426027849316597, 0.025283753871917725, -0.025029560551047325, -0.048025574535131454, -0.01843748241662979, 0.004927112255245447, -0.014370390214025974, -0.019996533170342445, -0.04585645720362663, 0.07788480818271637, -0.01564982905983925, -0.03423135355114937, 0.04090816527605057, 0.05846444144845009, 0.05937953665852547, -0.03457028046250343, 0.019115330651402473, 0.01940341666340828, 0.047517187893390656, -0.026876697316765785, -0.01992874965071678, 0.0130909513682127, 0.0035565870348364115, 0.0034739740658551455, 0.049008455127477646, -0.005249090027064085, 0.056295327842235565, -0.027690116316080093, 0.004744940437376499, 0.0012804983416572213, -0.06087080389261246, 0.006524292752146721, 0.02064049057662487, 0.008252806961536407, 0.0014171272050589323, -0.0013376919087022543, 0.01836969703435898, 0.04300949349999428, -0.04914402589201927, -0.008871343918144703, 0.005765949841588736, -0.047822218388319016, -0.01237073726952076, -0.023385776206851006, 0.04507693275809288, 0.046534307301044464, 0.025436269119381905, -0.03650214895606041, 0.0031371680088341236, 0.04378902167081833, -0.015887076035141945, 0.027588438242673874, 0.029198328033089638, 0.009125537239015102, 0.018911976367235184, 0.02684280462563038, -0.003785360837355256, 0.0015728205908089876, -0.02858826518058777, 0.004821198061108589, -0.03701053559780121, 0.005054208915680647, -0.02552100084722042, -0.050906430929899216, -0.06290435045957565, -0.02114887721836567, -0.04968630149960518, -0.03633268550038338, 0.0328587107360363, 0.03448554873466492, 0.0034909204114228487, -0.04538196325302124, -0.0021098037250339985, -0.07103853672742844, 0.06697144359350204, 0.008604440838098526, -0.0019297503167763352, -0.045822564512491226, 0.009100117720663548, 0.01301469374448061, 0.0061091105453670025, -0.062395963817834854, -0.08052841573953629, 0.09123842418193817, -0.003207071218639612, -0.012031813152134418, -0.032519787549972534, -0.005566831678152084, 0.0011120954295620322, -0.05653257295489311, 0.02891024388372898, 0.06232817843556404, 0.07015733420848846, 0.04544974863529205, 0.03673939406871796, 0.006371777039021254, 0.019589824602007866, 0.034773632884025574, 0.0003243611427024007, -0.028164610266685486, -0.0033214581198990345, -0.031909722834825516, -0.01991180330514908, 0.052702728658914566, -0.030452348291873932, 0.0045542954467237, -0.04589034989476204, -0.02258930541574955, 0.006045562215149403, 0.04138265922665596, -0.03521423414349556, 0.022352058440446854, 0.05612586438655853, -0.02043713629245758, -0.0508386455476284, -0.049110133200883865, -0.025944655761122704, 0.055210769176483154, 0.009922008961439133, 0.000253398873610422, 0.02941863052546978, 0.0015569335082545877, -0.03853569179773331, 0.06432783603668213, -0.02587687037885189, -0.003359587164595723, -0.0544312447309494, 0.01550578698515892, 0.008947601541876793, -0.06181979179382324, 0.05477016791701317, -0.014616110362112522, 0.05785438045859337, 0.037146102637052536, 0.025809084996581078, 0.0036582641769200563, 0.03531591221690178, -0.02691059000790119, -0.0006783781573176384, 0.0032854473683983088, -0.0032515551429241896, -0.011353963986039162, -0.02711394429206848, -0.007206378038972616, 0.029706714674830437, -0.0728687271475792, -0.023436615243554115, 0.0028850932139903307, -0.03619711473584175, -0.03412967920303345, 0.00023168654297478497, 0.024300873279571533, 0.057786595076322556, -0.0026224267203360796, 0.010659169405698776, -0.0025504054501652718, 0.04389069601893425, -0.0008139478741213679, -0.0021691154688596725, -0.012777445837855339, 0.018301911652088165, -0.027757899835705757, -0.04141654819250107, -0.06287045776844025, 0.028113771229982376, -0.02752065286040306, -0.010438868775963783, -0.08229082077741623, 0.022911282256245613, 0.005753240082412958, 0.0024084807373583317, -0.005850680638104677, -0.014955034479498863, 0.018268020823597908, -0.027012266218662262, 0.03558705374598503, -0.02458895742893219, 0.0014838529750704765, -0.0243856031447649, -0.0012677886988967657, -0.04609370604157448, 0.03279092535376549, 0.006181132048368454, 0.0022369003854691982, -0.012218221090734005, -0.013192628510296345, 0.017259720712900162, 0.0024932119995355606, 0.03802730515599251, 0.017708795145154, -0.04328063502907753, -0.028994973748922348, -0.03948467969894409, -0.00395482312887907, 0.03028288669884205, -0.004558532033115625, 0.0031011574901640415, -0.03333320468664169, 0.09462766349315643, -0.01693774200975895, 0.03028288669884205, 0.024707581847906113, 0.054804060608148575, -0.015310905873775482, 0.07639353722333908, -0.0857478454709053, -0.0019647018052637577, 0.02674112841486931, 0.04450076073408127, 0.010557492263615131, -0.04514471814036369, 0.015641355887055397, -0.01448054052889347, 0.0001768761285347864, -0.027012266218662262, -0.05097421631217003, 0.02264014445245266, 0.019284792244434357, -0.0002477060188539326, 0.024317819625139236, -0.05893893539905548, -0.05612586438655853, -0.04219607636332512, 0.0012773210182785988, 0.012582564726471901, -0.042941708117723465, 0.025080397725105286, 0.059989601373672485, 0.03741724416613579, -0.035451482981443405, 0.011447167955338955, 0.07490227371454239, 0.033909376710653305, 0.05473627522587776, 0.03907797113060951, -0.023639969527721405, 0.01611584983766079, 0.007786785718053579, -0.05504130572080612, 0.03941689804196358, -0.06134529784321785, 0.036061547696590424, 0.054905738681554794, -0.0780203714966774, 0.08337537944316864, 0.036163222044706345, 0.002302567008882761, -0.015014346688985825, 0.026266634464263916, -0.030723487958312035, 0.04853396117687225, -0.017539333552122116, -0.02833407185971737, -0.029249167069792747, 0.0033151032403111458, -0.03890851140022278, -0.03151996061205864, -0.004380596801638603, -0.03126576542854309, -0.056091971695423126, 0.019183116033673286, -0.019318684935569763, -0.02084384486079216, 0.06388723105192184, -0.04477190226316452, -0.009015386924147606, -0.029689768329262733, 0.02006431855261326, -0.019996533170342445, 0.05663425102829933, 0.018522214144468307, 0.006172658875584602, 0.06378555297851562, 0.07056403905153275, 0.062192611396312714, 0.009294998832046986, 0.00775289349257946, -0.017827417701482773, 0.046941015869379044, -0.03673939406871796, -0.02064049057662487, 0.00582526158541441, -0.002633018186315894, -0.006820851471275091, -0.017776580527424812, 0.061379190534353256, -0.02365691587328911, -0.020301565527915955, 0.03023204766213894, 0.0012444877065718174, 0.059582892805337906, -0.0446702241897583, 0.06473454087972641, -0.030418455600738525, -0.022572359070181847, -0.002514394698664546, -0.02865605056285858, 0.041653797030448914, -0.09306861460208893, 0.007528356276452541, 0.006100637372583151, -0.006113347131758928, -0.0759868323802948, -0.03568872809410095, 0.01447206735610962, 0.03650214895606041, 0.03663771599531174, -0.04172158241271973, 0.03687496483325958, -0.07456334680318832, -0.0006704346160404384, -0.014505960047245026, 0.03223169967532158, -0.05687149986624718, 0.033655185252428055, -0.07056403905153275, -0.03497698903083801, -0.0004120048542972654, -0.05592251196503639, -0.035756513476371765, 0.012404629960656166, 0.015980280935764313, 0.04161990433931351, -0.03301122784614563, -0.0029253403190523386, 0.030892949551343918, 0.010404976084828377, -0.02187756448984146, -0.05127924680709839, -0.015988754108548164, -0.05893893539905548, 0.0017835891339927912, -0.037247780710458755, 0.09123842418193817, 0.030147317796945572, -0.02218259498476982, -0.03060486540198326, -0.01930173859000206, -0.03701053559780121, -0.0238772165030241, 0.03768838196992874, -0.0009267461718991399, -0.07768145203590393, -0.031384389847517014, 0.013565445318818092, 0.014946562238037586, -0.00939667597413063, 0.06659862399101257, -0.05883726105093956, 0.043924588710069656, -0.03772227466106415, -0.015395636670291424, -0.04351788014173508, 0.029893124476075172, 0.0867646187543869, -0.05446513742208481, 0.02248762734234333, 0.043043386191129684, -0.07171638309955597, -0.03989139199256897, -0.040637023746967316, -0.030774326995015144, 0.05066918209195137, 0.07205531001091003, 0.06276877969503403, -0.008888290263712406, -0.03368907421827316, -0.0251481831073761, 0.0002053404605248943, 0.01864083670079708, 0.05124535411596298, -0.018759461119771004, -0.013531552627682686, -0.009693235158920288, -0.03116408921778202, 0.006490400526672602, 0.005681218579411507, 0.0027707060799002647, -0.013751853257417679, 0.05277051404118538, 0.06032852455973625, -0.02675807476043701, -0.010701535269618034, 0.05727820843458176, -0.07910493016242981, -0.0032303722109645605, 0.021911457180976868, -0.034163568168878555, 0.031757205724716187, 0.017014000564813614, -0.027249513193964958, -0.014056885614991188, -0.00962545070797205, 0.051313139498233795, 0.00015053004608489573, -0.014167035929858685, -0.01965760998427868, -0.0508386455476284, -0.009642396122217178, 0.017259720712900162, 0.04765275865793228, 0.0070411525666713715, 0.05304165184497833, 0.03717999532818794, 0.021013306453824043, 0.03050318732857704, -0.0006693755276501179, 0.07178416848182678, 0.05382118001580238, 0.04707658663392067, 0.027656223624944687, 0.012870650738477707, -0.01219280157238245, 0.0006307169678620994, 0.04039977863430977, 0.04429740831255913, 0.02941863052546978, -0.01730208657681942, 0.02203007973730564, 0.05314332991838455, 0.021843671798706055, 0.007863043807446957, 0.02382637932896614, 0.01216738298535347, -0.04026420786976814, 0.012396156787872314, 0.000764168391469866, -0.0018259546486660838, 0.0011756436433643103, -0.013379037380218506, -0.02372470125555992, 0.02684280462563038, -0.007075044792145491, -0.02936779148876667, 0.032824818044900894, 0.01704789325594902, 0.016920795664191246 ]
716,994
pytorch_optimizer.optimizer.lamb
get_global_gradient_norm
null
@torch.no_grad() def step(self, closure: CLOSURE = None) -> LOSS: loss: LOSS = None if closure is not None: with torch.enable_grad(): loss = closure() grad_norm = 1.0 if self.pre_norm: grad_norm = self.get_global_gradient_norm() for group in self.param_groups: if 'step' in group: group['step'] += 1 else: group['step'] = 1 beta1, beta2 = group['betas'] beta3: float = 1.0 - beta1 if group['grad_averaging'] else 1.0 bias_correction1: float = 1.0 - beta1 ** group['step'] step_size, n_sma = self.get_rectify_step_size( is_rectify=group['rectify'], step=group['step'], lr=group['lr'], beta2=beta2, n_sma_threshold=self.n_sma_threshold, degenerated_to_sgd=self.degenerated_to_sgd, ) step_size = self.apply_adam_debias( adam_debias=group['adam_debias'], step_size=step_size, bias_correction1=bias_correction1, ) for p in group['params']: if p.grad is None: continue grad = p.grad if grad.is_sparse: raise NoSparseGradientError(str(self)) if self.pre_norm: grad.div_(grad_norm) state = self.state[p] if len(state) == 0: state['exp_avg'] = torch.zeros_like(p) state['exp_avg_sq'] = torch.zeros_like(p) if group['adanorm']: state['exp_grad_norm'] = torch.zeros((1,), dtype=grad.dtype, device=grad.device) s_grad = self.get_adanorm_gradient( grad=grad, adanorm=group['adanorm'], exp_grad_norm=state.get('exp_grad_norm', None), r=group.get('r', None), ) exp_avg, exp_avg_sq = state['exp_avg'], state['exp_avg_sq'] exp_avg.mul_(beta1).add_(s_grad, alpha=beta3) exp_avg_sq.mul_(beta2).addcmul_(grad, grad, value=1.0 - beta2) self.apply_weight_decay( p=p, grad=None, lr=group['lr'], weight_decay=group['weight_decay'], weight_decouple=group['weight_decouple'], fixed_decay=group['fixed_decay'], ) if group['rectify']: update = p.clone() if n_sma >= self.n_sma_threshold: de_nom = exp_avg_sq.sqrt().add_(group['eps']) update.addcdiv_(exp_avg, de_nom, value=-step_size) else: update.add_(exp_avg, alpha=-step_size) else: update = exp_avg / exp_avg_sq.sqrt().add_(group['eps']) weight_norm = torch.linalg.norm(p).clamp_(min=0, max=self.clamp) p_norm = torch.linalg.norm(update) trust_ratio: float = 1.0 if weight_norm == 0 or p_norm == 0 else weight_norm / (p_norm + group['eps']) state['weight_norm'] = weight_norm state['adam_norm'] = p_norm state['trust_ratio'] = trust_ratio if group['adam']: trust_ratio = 1.0 if group['rectify']: if n_sma >= self.n_sma_threshold: p.addcdiv_(exp_avg, de_nom, value=-step_size * trust_ratio) else: p.add_(exp_avg, alpha=-step_size * trust_ratio) else: p.add_(update, alpha=-step_size * trust_ratio) return loss
(self) -> Union[torch.Tensor, float]
[ -0.004407595843076706, -0.018799642100930214, -0.020121412351727486, 0.06120813637971878, 0.014508971944451332, -0.006090311333537102, -0.038270335644483566, -0.04799043387174606, -0.047258373349905014, 0.0235885176807642, -0.01950119622051716, 0.0075747608207166195, 0.036480862647295, 0.08109569549560547, -0.030665073543787003, 0.036806222051382065, 0.018992824479937553, 0.048437800258398056, 0.03021770529448986, -0.017640551552176476, -0.010360646061599255, -0.06726794689893723, -0.03528110310435295, 0.0345287099480629, -0.0671052634716034, 0.00024799079983495176, 0.04965789616107941, 0.010604665614664555, -0.02077212929725647, 0.00597338518127799, 0.002892643678933382, -0.07487320899963379, 0.03971411660313606, -0.004478767979890108, 0.046485647559165955, -0.06649521738290787, 0.0008763083606027067, 0.0023613935336470604, -0.08963637053966522, -0.0466889962553978, -0.0184946171939373, -0.019399521872401237, 0.02515430748462677, 0.01750837452709675, 0.0009379485854879022, 0.015647727996110916, -0.03143779933452606, 0.03566746413707733, 0.0027477573603391647, -0.013278708793222904, 0.007422249298542738, -0.047258373349905014, 0.06564114987850189, 0.012404306791722775, 0.023527512326836586, 0.09557416290044785, 0.06425837427377701, -0.04786842316389084, 0.02539832703769207, -0.06189952418208122, 0.06551913917064667, -0.06690191477537155, 0.029566986486315727, -0.020019738003611565, 0.003187500173225999, -0.0029816089663654566, -0.06466507166624069, -0.018362440168857574, 0.007645933423191309, 0.029017943888902664, 0.005500598344951868, -0.002278782892972231, 0.001958507811650634, -0.005754784680902958, -0.05331818386912346, -0.014366627670824528, -0.020944977179169655, -0.04925119876861572, 0.030929427593946457, -0.03050239384174347, 0.018423445522785187, 0.010909689590334892, -0.01892165094614029, 0.014285287819802761, 0.012750000692903996, -0.03548445180058479, -0.004021232016384602, -0.019419856369495392, -0.01750837452709675, -0.025581341236829758, 0.0340406708419323, 0.013349880464375019, 0.03674521669745445, 0.04384210705757141, 0.05579904466867447, 0.03707057610154152, -0.04319138824939728, -0.03322727233171463, -0.013776914216578007, -0.016186604276299477, 0.008683014661073685, 0.04481818526983261, 0.029465312138199806, 0.05112200975418091, 0.041625600308179855, -0.03001435473561287, -0.007625598460435867, -0.030095694586634636, 0.043964117765426636, -0.055921055376529694, -0.025662681087851524, -0.01532236859202385, -0.04656698554754257, -0.02267344668507576, -0.05209808796644211, -0.02222607657313347, -0.0077577754855155945, 0.017406698316335678, -0.025845695286989212, 0.032861243933439255, 0.043964117765426636, -0.0154443783685565, -0.05929665267467499, -0.012546651065349579, 0.029424643144011497, 0.009257476776838303, 0.05779186636209488, 0.020345095545053482, 0.015393541194498539, -0.06576316058635712, -0.02277512103319168, 0.0011393914464861155, -0.0013992972671985626, 0.001381504232995212, 0.008840610273182392, -0.020639952272176743, -0.00013392456457950175, 0.018260765820741653, -0.009969199076294899, 0.00011811734293587506, 0.0024910287465900183, 0.007910287007689476, -0.003617075504735112, 0.0018326854333281517, 0.01935885287821293, 0.015413876622915268, 0.04125957190990448, 0.04782775416970253, 0.001281100558117032, -0.004016148392111063, 0.01951136440038681, 0.01600358821451664, 0.02564234472811222, 0.01004545483738184, 0.014600479044020176, 0.008011962287127972, -0.026984451338648796, 0.040547847747802734, -0.018758971244096756, -0.020639952272176743, -0.029811006039381027, -0.024727273732423782, -0.007966208271682262, -0.005932715721428394, 0.011367225088179111, 0.006644438020884991, -0.0013713367516174912, 0.04904785007238388, -0.0360131599009037, 0.03477272763848305, 0.016064593568444252, -0.024645933881402016, 0.03428468853235245, 0.033979665488004684, -0.04058851674199104, 0.1274593323469162, 0.023120814934372902, 0.004702452104538679, -0.03129545599222183, -0.004379635211080313, 0.002925687935203314, -0.003306967904791236, -0.0235885176807642, -0.028001196682453156, -0.009811603464186192, 0.026008374989032745, 0.002643540734425187, -0.003284091129899025, 0.0189826563000679, 0.009603170678019524, -0.00921680685132742, -0.029994020238518715, 0.043272729963064194, -0.02145335078239441, -0.014600479044020176, 0.024483254179358482, 0.011346890591084957, 0.0015848535113036633, 0.08654545992612839, 0.0006716881180182099, -0.02120933122932911, -0.017599880695343018, 0.033735647797584534, -0.0036450361367315054, -0.028529904782772064, -0.016674641519784927, -0.03280024230480194, 0.05474162846803665, -0.018026914447546005, 0.0177523922175169, -0.07747607678174973, 0.0016611095052212477, 0.02934330329298973, 0.07625598460435867, 0.05299282446503639, -0.06222488358616829, 0.03420335054397583, 0.02802153304219246, 0.06897608190774918, 0.007162978872656822, -0.05063397437334061, -0.06490909308195114, 0.015505383722484112, -0.00659360084682703, 0.06311962008476257, -0.019043661653995514, 0.0238325372338295, -0.028082536533474922, -0.002187275793403387, 0.001737365499138832, -0.003581489436328411, -0.022978469729423523, 0.009903110563755035, -0.014071770943701267, 0.04241866245865822, 0.019277513027191162, -0.0433133989572525, -0.01571889966726303, 0.01479366049170494, -0.00028548334375955164, -0.029546651989221573, -0.03284091129899025, -0.02399521693587303, 0.04750239476561546, -0.016867823898792267, 0.024442585185170174, 0.07340909540653229, 0.012750000692903996, -0.024971293285489082, 0.031356461346149445, -0.035789474844932556, -0.035443782806396484, -0.02295813523232937, 0.040059808641672134, -0.04799043387174606, -0.013563397340476513, 0.077882781624794, 0.055921055376529694, 0.03979545459151268, -0.04534689337015152, 0.04020215570926666, -0.06173684448003769, -0.033491626381874084, 0.03822966665029526, -0.047746412456035614, 0.005358253605663776, 0.05201674997806549, -0.04018181934952736, 0.042784690856933594, 0.04457416385412216, 0.04583492875099182, 0.09614354372024536, -0.06405502557754517, -0.024706939235329628, 0.00958791933953762, 0.0403851680457592, 0.01219078991562128, 0.00839324202388525, -0.00946590956300497, -0.02442224882543087, 0.06576316058635712, -0.04884449765086174, -0.05697847157716751, 0.020375598222017288, -0.0637703388929367, 0.029668660834431648, -0.030299043282866478, -0.02340550348162651, 0.06706459820270538, -0.0016445873770862818, 0.025479666888713837, 0.01726435497403145, 0.08052632212638855, -0.0010599581291899085, 0.07434450089931488, -0.00023432828311342746, -0.007284988183528185, 0.0012258149217814207, -0.03873803839087486, 0.005505681969225407, 0.08735885471105576, -0.012455143965780735, 0.013360048644244671, 0.012546651065349579, -0.023669857531785965, -0.024015551432967186, 0.0076357657089829445, 0.011184210889041424, 0.027411485090851784, -0.026333732530474663, -0.010111543349921703, 0.004471142310649157, -0.0033984750043600798, 0.02413756027817726, 0.003556070616468787, -0.09126316010951996, -0.0009741701651364565, -0.04677033796906471, 0.030339714139699936, 0.06454306095838547, -0.03532177209854126, 0.021107656881213188, 0.03922607749700546, 0.02301913872361183, -0.030543062835931778, -0.03902272880077362, 0.07629664987325668, 0.017254186794161797, -0.030543062835931778, -0.039815790951251984, -0.09077512472867966, -0.012475479394197464, 0.05425358936190605, 0.03263756260275841, -0.04888517037034035, -0.023120814934372902, 0.01756937801837921, -0.01388875674456358, 0.022592106834053993, -0.05201674997806549, 0.060394737869501114, 0.04758373275399208, -0.020182417705655098, 0.040263161063194275, 0.025174641981720924, -0.04530622065067291, 0.061330147087574005, 0.007645933423191309, 0.01726435497403145, 0.012343301437795162, -0.01917583867907524, -0.013360048644244671, -0.03284091129899025, 0.07361244410276413, 0.041808612644672394, 0.036948565393686295, -0.010401315987110138, -0.03922607749700546, 0.020517943426966667, -0.07511723041534424, 0.0131363645195961, 0.030380383133888245, -0.05222009867429733, 0.09142584353685379, 0.06625119596719742, -0.005439593456685543, -0.03825000301003456, -0.030868422240018845, 0.05380622297525406, -0.027899522334337234, 0.022205742076039314, -0.05124402046203613, 0.00044292016536928713, 0.015230861492455006, -0.04130024090409279, -0.009593002498149872, -0.036704547703266144, -0.013431220315396786, 0.059825360774993896, 0.05270813778042793, 0.05030861496925354, -0.02326315827667713, -0.04660765826702118, 0.03723325580358505, 0.05262679606676102, -0.029648326337337494, 0.02145335078239441, -0.05474162846803665, 0.028204547241330147, -0.06560048460960388, 0.06072009727358818, 0.021046651527285576, 0.004600777756422758, -0.009470992721617222, -0.06531579047441483, 0.041767943650484085, 0.029119618237018585, 0.04530622065067291, -0.05433493107557297, -0.010035287588834763, -0.0128923449665308, 0.009028708562254906, 0.024340910837054253, 0.0006767718587070704, -0.03151914104819298, -0.08292584121227264, 0.006247906945645809, 0.03273923695087433, 0.012180622667074203, 0.06885407119989395, -0.0014412380987778306, 0.013654904440045357, -0.06515311449766159, 0.002239383989945054, 0.0064512561075389385, -0.0462009571492672, -0.023954546079039574, -0.03021770529448986, -0.02438157983124256, -0.008139055222272873, 0.038514357060194016, 0.02676076628267765, 0.02568301558494568, 0.046933017671108246, -0.024198565632104874, -0.0466889962553978, -0.05856459587812424, -0.014356459490954876, -0.06364832818508148, -0.0004108291177544743, -0.016369618475437164, -0.031742822378873825, -0.034223686903715134, -0.009669259190559387, -0.022388756275177002, 0.010396232828497887, -0.011733254417777061, 0.03574880585074425, 0.03963277488946915, -0.006156399846076965, -0.003919557668268681, -0.012861842289566994, 0.008047548122704029, -0.0025812650565057993, 0.010126794688403606, -0.03389832749962807, 0.03532177209854126, -0.047217704355716705, -0.08361722528934479, 0.011377392336726189, 0.008921950124204159, 0.007559509947896004, 0.05299282446503639, 0.026435406878590584, 0.017732057720422745, 0.0008502542041242123, -0.044208135455846786, -0.032718900591135025, -0.008937201462686062, 0.01955203339457512, -0.008266149088740349, 0.028062202036380768, -0.030543062835931778, 0.0137464115396142, 0.013593900017440319, 0.006258074194192886, 0.08410526812076569, 0.03737559914588928, -0.005744617432355881, 0.010838516987860203, 0.007549342233687639, -0.042215313762426376, 0.03576913848519325, -0.017630383372306824, -0.008820275776088238, -0.0321088545024395, -0.04010048136115074, -0.002666417509317398, 0.015525718219578266, -0.03178349509835243, 0.012485646642744541, -0.04860047996044159, 0.01687799021601677, 0.038066986948251724, -0.00035300166928209364, 0.03580981120467186, 0.009516746737062931, 0.00106758379843086, 0.0433133989572525, 0.053887560963630676, -0.06104545667767525, -0.06873206049203873, 0.06287559866905212, 0.03755861520767212, -0.05852392688393593, -0.06019138917326927, 0.03930741921067238, 0.010386064648628235, 0.09467943012714386, -0.04900717735290527, 0.014427632093429565, 0.02480861358344555, -0.05681579187512398, -0.008840610273182392, 0.004382177256047726, 0.0019661334808915854, -0.06539712846279144, 0.015363038517534733, -0.052911486476659775, 0.018901316449046135, 0.0010472488356754184, -0.015149521641433239, 0.0074883378110826015, -0.00032853620359674096, -0.0030553231481462717, -0.03499641269445419, 0.04270334914326668, 0.06238756328821182, 0.03944976255297661, -0.058401916176080704, 0.01566806249320507, -0.004194078966975212, -0.020568780601024628, -0.014702153392136097, -0.013085526414215565, 0.051447369158267975, -0.002783343428745866, 0.004999850876629353, 0.0016865282086655498, 0.001073938445188105, -0.014783493243157864, 0.018647130578756332, 0.05893062427639961, 0.07560526579618454, -0.010482655838131905, -0.03133612498641014, -0.02004007250070572, -0.06978947669267654, -0.1138756051659584, -0.037395935505628586, -0.00417374400421977, -0.005566686857491732, 0.02271411567926407, -0.02836722508072853, -0.038209330290555954, 0.031498804688453674, 0.01605442725121975, 0.01104186661541462, -0.033349283039569855, -0.01692882925271988, -0.01615610159933567, 0.035199761390686035, 0.009796352125704288, 0.03440669924020767, 0.04514354094862938, 0.0029688996728509665, -0.019450359046459198, 0.017833732068538666, -0.0060191391967237, -0.006639354396611452, -0.06214354187250137, -0.07462918758392334, 0.017915071919560432, -0.04677033796906471, -0.007595095783472061, 0.026496412232518196, 0.020589115098118782, -0.020060406997799873, -0.04681100696325302, 0.0154443783685565, -0.022836124524474144, 0.017437200993299484, 0.006974880583584309, -0.019084330648183823, -0.040791869163513184, 0.0045956941321492195, 0.01668480969965458, -0.04742105305194855, 0.003901764517650008, -0.023120814934372902, 0.05555502697825432, -0.05360287427902222, -0.014000598341226578, -0.012485646642744541, 0.0060648927465081215, 0.054375600069761276, -0.1080191433429718, 0.05608373507857323, -0.014702153392136097, 0.027614833787083626, -0.04441148415207863, 0.011712918989360332, -0.06295693665742874, -0.07564593851566315, 0.00897278729826212, 0.01456997636705637, -0.03300359100103378, 0.010223385877907276, 0.022388756275177002, 0.02505263313651085, -0.038412682712078094, 0.013278708793222904, 0.04052751511335373, -0.001514952164143324, -0.006466507446020842, -0.017061006277799606, -0.001065041869878769, 0.030624402686953545, 0.018555622547864914, -0.037294261157512665, -0.04835646227002144, -0.016705144196748734, -0.005055771674960852, -0.023913877084851265, -0.052382778376340866, -0.024056220427155495, -0.01566806249320507, -0.002785885240882635, 0.08243780583143234, 0.009984450414776802, -0.02777751348912716, -0.003495065961033106, -0.04355741664767265, -0.006364832632243633, 0.024361245334148407, -0.03540311008691788, 0.06686124950647354, -0.06987081468105316, -0.03589114919304848, -0.04888517037034035, -0.0374569408595562, 0.028712918981909752, 0.03188516944646835, -0.06360765546560287, 0.06572248786687851, 0.03231220319867134, 0.04831578955054283, 0.03926674649119377, -0.025215312838554382, -0.05823923647403717, -0.0020856012124568224, 0.02952631749212742, -0.005795454606413841, -0.033349283039569855, -0.008062799461185932, 0.007361244410276413, -0.021046651527285576, 0.030807416886091232, 0.04900717735290527, 0.025601675733923912, -0.02680143713951111, 0.04109689220786095, -0.04636363685131073, 0.014366627670824528, 0.01126555074006319, 0.024747608229517937, 0.030827753245830536, 0.01737619750201702, 0.0033679725602269173, -0.034955743700265884, -0.026842106133699417, -0.013085526414215565, -0.024117225781083107, 0.0034289774484932423, -0.0085152518004179, -0.005642942618578672, -0.006141148507595062, -0.01231279969215393, -0.0019076705211773515, -0.004346590954810381, -0.09248325973749161, -0.03255622088909149, -0.06360765546560287, 0.008581340312957764, 0.02680143713951111, -0.014722488820552826, 0.03007536008954048, -0.03808732330799103, -0.03294258564710617, 0.01663397252559662, 0.03595215454697609, 0.036907896399497986, -0.019043661653995514, 0.026211723685264587, 0.04105622321367264, -0.009801436215639114, 0.007727272808551788, 0.017843900248408318, -0.0020017195492982864, 0.004989683162420988, -0.03944976255297661, -0.019104665145277977, 0.001850478583946824, 0.01902332529425621, 0.03231220319867134, -0.07527990639209747, -0.04384210705757141, -0.005071023013442755, 0.02159569412469864, -0.05063397437334061, 0.0179964117705822, -0.021005982533097267, -0.021005982533097267, -0.017000000923871994, 0.03605382889509201, 0.03652153164148331, 0.012282297015190125, 0.0004969348083250225, 0.0011285885702818632, 0.02413756027817726, 0.0013166866265237331, 0.03707057610154152, -0.025988038629293442, 0.009028708562254906, 0.010421651415526867, -0.017894737422466278, -0.030177034437656403, -0.030543062835931778, -0.06348564475774765, 0.052667465060949326, -0.02655741758644581, -0.008581340312957764, 0.035342104732990265, -0.0137464115396142, -0.06486842036247253, -0.023568183183670044, 0.03158014640212059, -0.020558612421154976, 0.043720096349716187, -0.0033679725602269173, 0.018789473921060562, 0.00934389978647232, -0.0007822592742741108, 0.016318781301379204, -0.008744019083678722, 0.0005423706606961787, 0.03341028839349747, 0.021392345428466797, -0.02316148392856121, 0.004987141117453575, 0.03381698578596115, 0.01741686649620533, -0.004463517107069492, -0.039287082850933075, 0.016471292823553085, 0.04916985705494881, -0.02432057447731495, -0.04022248834371567, 0.02369019202888012, -0.05620574206113815, 0.06759330630302429, 0.04020215570926666, 0.02539832703769207, 0.05161004886031151, 0.07365310937166214, -0.04388277605175972, 0.020660288631916046, -0.05974402278661728, -0.055921055376529694, -0.06499043107032776, 0.006054725032299757, -0.03127511963248253, 0.06438038498163223, 0.03375598043203354, 0.011733254417777061, 0.02106698602437973, 0.03548445180058479, 0.024361245334148407 ]
717,019
pytorch_optimizer.optimizer.shampoo_utils
LayerWiseGrafting
Layer-wise grafting. Grafting is a technique to fix the layer-wise scale of Shampoo optimizer. https://arxiv.org/pdf/2002.11803.pdf studies this in detail. This allows us to plugin the Shampoo optimizer into settings where SGD/AdaGrad is already well tuned. Grafting onto Shampoo means take the Shampoo direction, but use the step magnitude from the grafted optimizer such as Adagrad or SGD.
class LayerWiseGrafting(IntEnum): r"""Layer-wise grafting. Grafting is a technique to fix the layer-wise scale of Shampoo optimizer. https://arxiv.org/pdf/2002.11803.pdf studies this in detail. This allows us to plugin the Shampoo optimizer into settings where SGD/AdaGrad is already well tuned. Grafting onto Shampoo means take the Shampoo direction, but use the step magnitude from the grafted optimizer such as Adagrad or SGD. """ NONE = 0 SGD = 1 ADAGRAD = 2 RMSPROP = 3 SQRTN = 4
(value, names=None, *, module=None, qualname=None, type=None, start=1)
[ 0.02023649588227272, -0.07937639206647873, -0.0595322921872139, 0.01638726331293583, 0.04559284448623657, -0.04286474734544754, -0.015107300132513046, -0.05340341851115227, -0.00769846374168992, -0.012500660493969917, -0.033092182129621506, 0.017741968855261803, -0.016078950837254524, 0.044434335082769394, -0.014229077845811844, -0.009875334799289703, -0.03669850155711174, -0.011463610455393791, 0.02763598971068859, -0.030550941824913025, 0.04985315725207329, -0.02062889188528061, -0.004414470866322517, 0.03531576693058014, 0.0041014873422682285, 0.02814050018787384, 0.01214563474059105, -0.0020273865666240454, -0.0670812726020813, -0.06334415078163147, -0.022833792492747307, -0.07250009477138519, -0.05269336700439453, -0.037408553063869476, -0.04648975282907486, -0.024085726588964462, -0.01965724118053913, 0.018367936834692955, -0.03415726125240326, -0.044509079307317734, 0.009314767085015774, -0.0020484079141169786, -0.014191706664860249, -0.016770318150520325, -0.0393892265856266, -0.005825233180075884, 0.009006454609334469, 0.003909959923475981, -0.015331527218222618, -0.012939771637320518, 0.01133281085640192, -0.03920236974954605, 0.0031415149569511414, 0.016742289066314697, -0.006166245322674513, -0.015200728550553322, 0.01443461887538433, 0.02675776742398739, 0.03071911260485649, -0.02343173138797283, -0.008146917447447777, 0.015294156037271023, 0.005890632513910532, 0.012444604188203812, 0.010006134398281574, -0.00299203023314476, -0.07653617858886719, 0.020722320303320885, -0.0072126383893191814, 0.0650632306933403, 0.008062832988798618, 0.017274828627705574, -0.0019386301282793283, -0.009884677827358246, -0.06334415078163147, -0.003629676066339016, 0.010454588569700718, 0.0008099036058411002, 0.010613415390253067, -0.013257427141070366, 0.04428485035896301, 0.024216527119278908, 0.03464308753609657, 0.0014247763901948929, 0.025898229330778122, -0.06446529179811478, 0.020535465329885483, -0.025898229330778122, 0.015948152169585228, -0.09925786405801773, -0.004694754723459482, -0.02386149950325489, 0.007721820380538702, -0.04193046689033508, -0.008464572951197624, 0.018153052777051926, -0.07231324166059494, -0.04731191694736481, -0.028084443882107735, -0.05104903504252434, -0.0323447585105896, 0.012061549350619316, -0.03191499039530754, 0.015677211806178093, 0.012033521197736263, 0.0017879775259643793, 0.004061780404299498, -0.0375019833445549, -0.08767279237508774, -0.03045751340687275, 0.052095428109169006, -0.02096523344516754, -0.01707863062620163, -0.0073901512660086155, 0.020180437713861465, 0.000620712002273649, -0.0038001821376383305, 0.0022656279616057873, 0.035297080874443054, 0.038062550127506256, -0.0010399699676781893, 0.004414470866322517, 0.019152730703353882, 0.038062550127506256, 0.03411988914012909, 0.05844853073358536, 0.03935185447335243, 0.02879449538886547, 0.010669472627341747, 0.008553329855203629, 0.02621588483452797, 0.01744299940764904, -0.09454908967018127, -0.005586992017924786, 0.000417798146372661, 0.016331207007169724, 0.043201085180044174, 0.04607866704463959, 0.04174361005425453, 0.057887960225343704, 0.0010773411486297846, -0.02929900772869587, 0.0009325277642346919, 0.025337662547826767, -0.0034077847376465797, 0.04282737523317337, 0.0055916630662977695, 0.028402099385857582, 0.05131063237786293, 0.036212675273418427, 0.03639953210949898, 0.0017284172354266047, 0.015378241427242756, -0.004300021566450596, 0.016985202208161354, 0.01223906222730875, -0.011202012188732624, -0.03645559027791023, -0.010744214989244938, 0.024309953674674034, -0.01671426184475422, -0.02117077447474003, 0.00576450489461422, -0.015527726151049137, 0.02440338209271431, 0.022759050130844116, 0.019414329901337624, -0.00579253351315856, 0.00859537161886692, 0.021731343120336533, 0.0461907833814621, -0.038268089294433594, -0.022871164605021477, 0.015658525750041008, 0.06020497530698776, 0.08662640303373337, -0.03458702936768532, 0.0517217181622982, 0.03651164472103119, -0.03299875557422638, 0.017386943101882935, 0.025692688301205635, -0.06764183938503265, -0.05131063237786293, -0.02498263493180275, -0.02752387523651123, 0.03673587366938591, -0.0055589633993804455, 0.018508078530430794, -0.0007993929320946336, 0.06140085309743881, -0.0019035945879295468, 0.011108583770692348, -0.018442679196596146, -0.03464308753609657, 0.008095532655715942, -0.03241949900984764, -0.02513211965560913, 0.08714959770441055, 0.0674549862742424, -0.01715337298810482, 0.019414329901337624, -0.0103518171235919, 0.0609150268137455, -0.014313163235783577, -0.03281189873814583, 0.014500019140541553, -0.060466572642326355, -0.03879128769040108, -0.010146276094019413, -0.03172813355922699, 0.016770318150520325, 0.044471707195043564, 0.06158770993351936, 0.02802838757634163, -0.04861990734934807, -0.023263560608029366, 0.06689441949129105, -0.011594409123063087, 0.006311058532446623, -0.03258766978979111, -0.013257427141070366, -0.001956147840246558, -0.026963308453559875, 0.07470499724149704, -0.03010248765349388, 0.038062550127506256, -0.031896304339170456, -0.037221696227788925, -0.03382091969251633, -0.0106975007802248, -0.03796911984682083, -0.0371282696723938, 0.021264202892780304, 0.024851836264133453, 0.02860764041543007, 0.0013371875975281, -0.03905288502573967, 0.00630171550437808, -0.027355706319212914, 0.023768072947859764, -0.037109583616256714, -0.026346683502197266, 0.021133404225111008, -0.05108640715479851, 0.0046270196326076984, 0.029710089787840843, 0.009800592437386513, -0.010230361483991146, 0.04738666117191315, -0.03492337092757225, -0.06117662414908409, -0.02802838757634163, 0.0051291948184370995, -0.02567400224506855, -0.014098278246819973, -0.13139708340168, 0.013687195256352425, -0.009361481294035912, -0.06401683390140533, -0.02397361397743225, -0.018610848113894463, -0.07616247236728668, 0.017601827159523964, 0.03557736426591873, -0.0009307760046795011, 0.07653617858886719, -0.014032878912985325, 0.04865727946162224, -0.030177230015397072, 0.10374240577220917, 0.021301573142409325, -0.044658564031124115, 0.0031788861379027367, -0.04170623794198036, -0.0011287265224382281, 0.002594961551949382, 0.0626714751124382, 0.039837680757045746, -0.01700388826429844, 0.057925332337617874, -0.020367294549942017, -0.0680902972817421, 0.049367330968379974, -0.05265599489212036, 0.04790985584259033, -0.024347325786948204, -0.022179797291755676, 0.030924653634428978, -0.016377920284867287, 0.028850553557276726, 0.07907742261886597, 0.06401683390140533, 0.007021110970526934, 0.1201857253909111, 0.04525650292634964, 0.04114567115902901, -0.01765788346529007, 0.0361192487180233, 0.04615341126918793, 0.08602846413850784, -0.029747461900115013, 0.04065984487533569, 0.01896587572991848, -0.006147559732198715, 0.002373069990426302, 0.04802196845412254, -0.00787130557000637, 0.002012204611673951, 0.015294156037271023, -0.03630610555410385, -0.030139857903122902, -0.007904005236923695, -0.03553999587893486, 0.027038050815463066, -0.06113925576210022, 0.007460222113877535, -0.011491638608276844, -0.02991563081741333, 0.06794080883264542, -0.0017692919354885817, 0.00810487475246191, -0.002777145942673087, 0.01385536603629589, -0.04675135016441345, -0.10194858908653259, 0.01620974950492382, -0.0025015335995703936, -0.0041738939471542835, -0.006801555398851633, -0.11323468387126923, -0.06080291420221329, 0.03953871130943298, 0.030158543959259987, -0.04989052936434746, 0.005904647056013346, 0.07070627808570862, 0.03454965725541115, -0.02313276194036007, -0.03770752251148224, 0.04499490559101105, 0.024141784757375717, -0.03563342243432999, 0.05848589912056923, 0.03634347394108772, 0.013472311198711395, -0.009062511846423149, -0.014313163235783577, 0.043425314128398895, 0.018181079998612404, -0.009450238198041916, -0.0680902972817421, -0.0016723604639992118, 0.04671397805213928, 0.048320937901735306, 0.04495753347873688, 0.028962666168808937, -0.06517533957958221, 0.027692046016454697, 0.020684950053691864, 0.05164697393774986, -0.012958457693457603, 0.004521912895143032, 0.07451813668012619, -0.03497942537069321, -0.01643397845327854, 0.0011409888975322247, -0.0461907833814621, 0.0306443702429533, -0.0034031132236123085, 0.01779802516102791, -0.048208825290203094, -0.05508512258529663, 0.018508078530430794, -0.0333537794649601, 0.047237176448106766, -0.021133404225111008, 0.0003126916999462992, 0.030625684186816216, -0.017956852912902832, 0.05859801545739174, 0.04652712121605873, 0.005236636847257614, 0.0643158033490181, 0.05355290323495865, -0.003190564690157771, 0.004120172932744026, -0.028981352224946022, 0.01428513415157795, -0.051945943385362625, -0.03593239188194275, 0.005082480609416962, 0.06095239892601967, -0.0014738260069862008, -0.03735249862074852, -0.0025832829996943474, -0.026421425864100456, 0.01784474030137062, -0.002648682566359639, 0.01935827173292637, 0.058112189173698425, 0.002959330566227436, -0.02883186750113964, -0.03654901683330536, -0.03400777652859688, -0.04488278925418854, 0.018106337636709213, 0.09925786405801773, -0.03404514864087105, 0.020722320303320885, -0.01904061809182167, 0.026645652949810028, -0.027692046016454697, 0.008296402171254158, -0.007077167741954327, -0.053067080676555634, 0.02077837660908699, 0.0626714751124382, -0.0292616356164217, 0.031092824414372444, 0.026159828528761864, -0.006147559732198715, 0.06678230315446854, 0.07705938071012497, -0.018339907750487328, -0.011416896246373653, -0.012276433408260345, -0.012696859426796436, -0.023300932720303535, 0.028981352224946022, -0.025393718853592873, 0.01181863620877266, 0.028701068833470345, -0.0595322921872139, 0.05142274871468544, -0.050974294543266296, -0.029392434284090996, 0.008333773352205753, -0.01096844207495451, -0.014584103599190712, 0.06450266391038895, -0.02937375009059906, 0.006007417570799589, 0.021768713369965553, 0.05422558635473251, -0.07548978924751282, -0.03692272678017616, 0.03651164472103119, 0.03142916411161423, 0.005330064799636602, -0.009496951475739479, 0.023992300033569336, 0.027822844684123993, 0.03180287778377533, 0.025655316188931465, -0.01798488199710846, -0.0347365140914917, 0.00031473542912863195, -0.0479472279548645, -0.025076063349843025, 0.02817787230014801, -0.01252868864685297, -0.06876297295093536, 0.04051036015152931, 0.0032185930758714676, 0.013005171902477741, 0.034101203083992004, -0.009641764685511589, -0.013631138950586319, 0.006325072608888149, -0.025898229330778122, 0.008660771884024143, 0.01976935565471649, -0.05594465881586075, 0.019956210628151894, 0.015331527218222618, -0.043612170964479446, 0.016125665977597237, 0.001320837764069438, -0.03339115157723427, 0.041070930659770966, -0.022497452795505524, -0.01671426184475422, 0.01569589599967003, -0.03204578906297684, 0.018395964056253433, -0.06416632235050201, 0.06072816997766495, 0.01729351468384266, -0.05631837248802185, 0.008226331323385239, -0.014677532017230988, 0.03462440147995949, -0.0011748565593734384, 0.02074100635945797, 0.02309539169073105, -0.026776451617479324, -0.012706202454864979, -0.0002522554714232683, 0.049442075192928314, 0.030756482854485512, 0.01245394628494978, -0.0828145369887352, -0.012416575103998184, 0.02821524254977703, -0.05157223343849182, -0.021843455731868744, -0.02401098422706127, 0.018078310415148735, 0.015107300132513046, -0.010491959750652313, -0.017863424494862556, 0.05396398901939392, -0.005292693618685007, 0.0042626503854990005, -0.015789324417710304, 0.047162432223558426, 0.051833830773830414, 0.017433656379580498, 0.0031461864709854126, 0.010473273694515228, -0.03654901683330536, -0.006586670875549316, 0.03333509340882301, -0.010688157752156258, 0.04536861553788185, -0.0007386647630482912, -0.0268698800355196, 0.018181079998612404, 0.011631780304014683, 0.0551224946975708, -0.0011567549081519246, 0.00984730664640665, 0.08625268936157227, -0.01762985624372959, -0.0003518146404530853, -0.022142425179481506, -0.004638697952032089, -0.015649182721972466, -0.01040787436068058, 0.007030453532934189, -0.052020687609910965, 0.00879157055169344, 0.022291909903287888, 0.0008209981606341898, 0.05508512258529663, -0.0037768250331282616, -0.030009059235453606, 0.020647577941417694, -0.03935185447335243, -0.024646295234560966, 0.03608187660574913, -0.027617303654551506, -0.04690083488821983, 0.06446529179811478, 0.0654369443655014, 0.002809845842421055, 0.027112793177366257, 0.005068466532975435, -0.0031485222280025482, -0.06517533957958221, -0.06259673088788986, 0.026626966893672943, 0.0038422245997935534, -0.023917557671666145, -0.0327184721827507, 0.0036156619898974895, 0.00503109535202384, -0.02089049108326435, 0.020535465329885483, 0.022927220910787582, -0.010370503179728985, 0.04308897256851196, -0.0010849321261048317, -0.022852478548884392, -0.016480691730976105, -0.026010343804955482, -0.023450417444109917, 0.024029670283198357, -0.020647577941417694, -0.017788682132959366, -0.02382412925362587, 0.004652712028473616, -0.040958814322948456, 0.012369861826300621, 0.04166886955499649, -0.0175551138818264, -0.003293335437774658, -0.022497452795505524, 0.023188818246126175, 0.022927220910787582, 0.013874051161110401, 0.0465644933283329, -0.020255180075764656, -0.030887281522154808, -0.005143208894878626, -0.024926578626036644, -0.02027386613190174, 0.054524555802345276, 0.03462440147995949, 0.00979124940931797, 0.024123098701238632, -0.011463610455393791, 0.03557736426591873, 0.04237892106175423, 0.028476841747760773, 0.03492337092757225, 0.009109226055443287, -0.006170916371047497, -0.07578875869512558, -0.01131412573158741, -0.01189337857067585, -0.04170623794198036, -0.06315729767084122, -0.017031917348504066, 0.006166245322674513, 0.052058055996894836, 0.03438148647546768, 0.00884762778878212, -0.0629330724477768, -0.04731191694736481, 0.04424748197197914, -0.05149748921394348, 0.0026066398713737726, 0.029710089787840843, -0.049628932029008865, 0.008600043132901192, -0.026776451617479324, 0.017414970323443413, -0.05007738620042801, 0.0030691083520650864, 0.022179797291755676, 0.011089898645877838, -0.09970631450414658, -0.012911743484437466, 0.019246159121394157, -0.022815106436610222, 0.042042579501867294, -0.04805934056639671, 0.018040938302874565, -0.007511607836931944, 0.08288928121328354, 0.018629534170031548, -0.011183326132595539, -0.020498093217611313, 0.002683717990294099, -0.021338945254683495, -0.023768072947859764, -0.0034007776994258165, -0.011865350417792797, -0.032438185065984726, 0.030663054436445236, 0.0268698800355196, -0.05818692967295647, -0.0513480044901371, 0.006647399161010981, 0.0025832829996943474, 0.03299875557422638, 0.04129515588283539, -0.07795628905296326, -0.03909025713801384, -0.009109226055443287, 0.044509079307317734, 0.06244724616408348, -0.03935185447335243, 0.042266808450222015, 0.000017955684597836807, -0.04918047785758972, 0.08789702504873276, -0.01278094481676817, -0.06371786445379257, -0.023076705634593964, -0.013135970570147038, 0.016041580587625504, -0.05396398901939392, 0.003963680937886238, 0.03204578906297684, 0.06005549058318138, 0.03636215999722481, -0.026683025062084198, -0.031354423612356186, 0.026197198778390884, -0.025300290435552597, 0.00421593664214015, 0.07063153386116028, -0.01258474588394165, -0.10157487541437149, -0.01947038620710373, 0.019806725904345512, 0.0157332681119442, -0.0698467418551445, -0.02490789256989956, 0.004393449518829584, -0.002830867189913988, 0.004622348118573427, -0.028458155691623688, 0.028402099385857582, -0.012154976837337017, 0.01428513415157795, -0.039613451808691025, 0.011108583770692348, -0.017956852912902832, -0.024795779958367348, 0.025730058550834656, 0.0037114254664629698, 0.01954512856900692, 0.003255964256823063, -0.02012438140809536, 0.027878902852535248, -0.030887281522154808, -0.03894077241420746, 0.050824809819459915, -0.06140085309743881, 0.05280547961592674, 0.01553706917911768, -0.030775168910622597, -0.016555434092879295, 0.041070930659770966, -0.06072816997766495, -0.009595051407814026, -0.0025645974092185497, 0.03931448236107826, 0.006932354532182217, 0.04622815176844597, -0.04970367252826691, -0.01791948266327381, 0.04308897256851196, -0.00971650704741478, -0.020143067464232445, -0.04813408479094505, 0.04305160045623779, 0.012538031674921513, -0.000028521073545562103, -0.01744299940764904, 0.0347365140914917, 0.024197841063141823, 0.055496204644441605, 0.015471669845283031, 0.03404514864087105, 0.005783190485090017, 0.027934959158301353, 0.02864501066505909, -0.045704957097768784, -0.07743308693170547, -0.03118625096976757, 0.06622173637151718, 0.01006219070404768, -0.026851193979382515, -0.03496074303984642, 0.03953871130943298, 0.06622173637151718, -0.014714903198182583, 0.04271526262164116, -0.015546412207186222, 0.0455554723739624, -0.03578290715813637, -0.010174304246902466, -0.04017402231693268, -0.051945943385362625, -0.07119210064411163, -0.04402325302362442, -0.06995885074138641, 0.05422558635473251, -0.009506294503808022, 0.006465214770287275, 0.005390793085098267, 0.002538904780521989, -0.019264845177531242 ]
717,020
pytorch_optimizer.lr_scheduler.linear_warmup
LinearScheduler
Linear LR Scheduler w/ linear warmup.
class LinearScheduler(BaseLinearWarmupScheduler): r"""Linear LR Scheduler w/ linear warmup.""" def _step(self) -> float: return self.max_lr + (self.min_lr - self.max_lr) * (self.step_t - self.warmup_steps) / ( self.total_steps - self.warmup_steps )
(optimizer: Type[torch.optim.optimizer.Optimizer], t_max: int, max_lr: float, min_lr: float = 0.0, init_lr: float = 0.0, warmup_steps: int = 0)
[ -0.010994759388267994, 0.007051282096654177, -0.025079254060983658, 0.01824931427836418, -0.007259070873260498, -0.004964355379343033, -0.040798962116241455, -0.011744608171284199, -0.1080503910779953, 0.013172029517591, 0.0021829160396009684, 0.04289492219686508, 0.06670936942100525, 0.06370998173952103, -0.036444421857595444, 0.02628985233604908, 0.006021370179951191, 0.023724107071757317, -0.05503704026341438, -0.04293105751276016, 0.02161007933318615, 0.019297294318675995, -0.000354314484866336, 0.08781352639198303, -0.02782568708062172, 0.04943576455116272, -0.017382020130753517, -0.03196340054273605, -0.0371490977704525, -0.02137518674135208, -0.013479196466505527, 0.014716897159814835, -0.0034307807218283415, -0.07581596076488495, 0.007923092693090439, -0.051893096417188644, -0.009386652149260044, -0.04213603958487511, -0.11094137281179428, -0.013840568251907825, 0.06638413667678833, -0.012702245265245438, 0.02488050051033497, 0.023380804806947708, 0.01862875558435917, -0.021519735455513, 0.006667323410511017, 0.004336470738053322, 0.04329243302345276, -0.05413360893726349, 0.012593833729624748, -0.05528999865055084, 0.03290297091007233, 0.00032354137510992587, -0.02482629381120205, 0.07155176252126694, 0.00657246308401227, -0.013497265055775642, 0.025711657479405403, -0.056337978690862656, 0.005348313599824905, -0.044015176594257355, -0.019459912553429604, 0.056193429976701736, 0.054675668478012085, -0.03516154736280441, -0.03105997107923031, -0.009531200863420963, 0.0010773419635370374, 0.045641351491212845, -0.009106588549911976, -0.0045442599803209305, -0.013596641831099987, -0.011762676760554314, -0.0007571884198114276, 0.01324430387467146, -0.043870627880096436, -0.06649255007505417, 0.0022337341215461493, -0.027121009305119514, 0.040871236473321915, 0.040690548717975616, -0.003306558821350336, -0.029831303283572197, -0.036552831530570984, -0.07086515426635742, -0.009102070704102516, -0.05229060724377632, -0.06710688024759293, -0.02450105920433998, -0.049977824091911316, 0.017345882952213287, -0.003656638553366065, 0.03210794925689697, 0.05037533491849899, 0.019405705854296684, -0.045352254062891006, 0.007950196042656898, -0.03888368606567383, -0.03848617523908615, 0.024446852505207062, 0.039136648178100586, -0.02453719638288021, 0.048568472266197205, -0.0017775011947378516, -0.017427191138267517, -0.03819707781076431, -0.04004007950425148, -0.0016103663947433233, 0.006522774696350098, -0.044159725308418274, 0.017499465495347977, -0.07914058864116669, 0.02021879330277443, -0.06938353180885315, 0.05037533491849899, -0.037871841341257095, 0.037546608597040176, 0.02769920602440834, 0.04752048850059509, 0.03516154736280441, -0.007923092693090439, -0.008171536959707737, -0.017842769622802734, -0.023850588127970695, -0.005596757400780916, 0.016415348276495934, 0.026904186233878136, 0.01824931427836418, -0.042569685727357864, -0.012557696551084518, 0.011202548630535603, 0.00022896338487043977, 0.0062472280114889145, -0.015584191307425499, -0.02300136350095272, 0.024952774867415428, 0.07050378620624542, -0.019279224798083305, 0.03985939174890518, 0.018276415765285492, 0.06414362788200378, 0.039498019963502884, -0.011816882528364658, 0.03225250169634819, 0.020453685894608498, 0.003121355315670371, 0.0917886272072792, 0.007417171727865934, 0.04437654837965965, -0.0004689373599831015, -0.051856961101293564, 0.0396425686776638, 0.02786182425916195, 0.03077087178826332, 0.03140327334403992, -0.01680382341146469, -0.013217201456427574, 0.01862875558435917, -0.03729364648461342, -0.048713020980358124, -0.02142939157783985, -0.02460947073996067, -0.04495474696159363, -0.012946171686053276, 0.0435815304517746, -0.02954220585525036, 0.00689318124204874, -0.017869872972369194, 0.015719706192612648, 0.0010502389632165432, -0.05413360893726349, 0.028909804299473763, 0.01154585275799036, 0.03586622700095177, 0.04289492219686508, 0.023995136842131615, 0.04350925609469414, 0.02493470534682274, 0.056193429976701736, 0.014201940968632698, 0.031692370772361755, -0.023958999663591385, -0.10848403722047806, -0.03534223511815071, 0.03852231428027153, -0.04043758660554886, 0.014445867389440536, -0.010037122294306755, 0.04939962923526764, -0.008862662129104137, -0.024356510490179062, 0.01714712753891945, -0.034583352506160736, -0.03693227469921112, 0.03395095095038414, -0.0066176350228488445, 0.037871841341257095, 0.08008015900850296, -0.017607877030968666, -0.02014651894569397, 0.0868016853928566, 0.03405936434864998, 0.030174607411026955, -0.004483278375118971, -0.029939714819192886, -0.03899209946393967, 0.02291101962327957, -0.066962331533432, 0.020688578486442566, -0.02486243098974228, -0.031873058527708054, -0.027410108596086502, 0.08174247294664383, 0.022856812924146652, -0.04166625440120697, -0.05547068640589714, 0.025079254060983658, 0.031457480043172836, -0.019423775374889374, 0.05977101996541023, -0.04795413836836815, -0.0067938040010631084, -0.07408137619495392, 0.023543421179056168, -0.011247720569372177, 0.04050986096262932, -0.05398906022310257, -0.03666124492883682, 0.051531724631786346, -0.007512032054364681, -0.08550074696540833, 0.021899176761507988, -0.0020462721586227417, 0.04148557037115097, 0.01395801454782486, -0.009323411621153355, 0.05586819723248482, -0.006138816010206938, -0.013334646821022034, -0.03413163870573044, 0.03358957916498184, 0.002175010973587632, -0.028096714988350868, 0.019062401726841927, 0.025838136672973633, 0.023724107071757317, 0.042280588299036026, -0.08022470772266388, -0.0075572035275399685, -0.03245125338435173, -0.004083510022610426, 0.000785420648753643, 0.01711099036037922, -0.020742785185575485, -0.021086087450385094, 0.028747186064720154, 0.0029022733215242624, 0.010326220653951168, 0.0071100047789514065, 0.0007007239619269967, -0.022278618067502975, -0.05391678586602211, 0.03870299831032753, -0.04173852875828743, 0.014346490614116192, -0.041196469217538834, 0.007647546473890543, 0.010479804128408432, 0.04206376522779465, 0.12575764954090118, 0.012946171686053276, -0.06049376353621483, 0.002606399590149522, 0.009874504990875721, 0.025910411030054092, -0.043979037553071976, -0.031782716512680054, 0.018845578655600548, -0.03676965832710266, 0.03418584167957306, -0.02605496160686016, -0.03899209946393967, -0.021122224628925323, -0.022658059373497963, -0.051495589315891266, -0.025278009474277496, -0.0016792530659586191, 0.0053076595067977905, -0.03077087178826332, 0.02912662737071514, -0.008704561740159988, 0.025982685387134552, -0.010326220653951168, 0.1323346346616745, 0.017354916781187057, -0.015087303705513477, -0.009237585589289665, 0.010841176845133305, 0.025512902066111565, 0.06201152876019478, -0.039136648178100586, -0.010976690798997879, -0.004733980167657137, -0.04802641272544861, -0.015981700271368027, -0.022621922194957733, 0.022784538567066193, 0.004027045331895351, -0.013172029517591, -0.021953381597995758, 0.0368780680000782, 0.0013517591869458556, -0.06175857037305832, -0.014608485624194145, -0.015891358256340027, -0.0198212843388319, 0.039498019963502884, 0.026868049055337906, 0.02320011705160141, -0.029759028926491737, 0.037907980382442474, 0.039570294320583344, 0.002448298968374729, 0.0037740846164524555, -0.03666124492883682, 0.0728527083992958, -0.012033705599606037, -0.045677490532398224, -0.040798962116241455, 0.015954598784446716, -0.045316118746995926, 0.0026990012265741825, 0.0022732592187821865, -0.01082310825586319, 0.0015764877898618579, 0.0432201586663723, 0.05435043200850487, 0.025711657479405403, -0.03583008795976639, 0.09308956563472748, 0.06045762822031975, -0.018990127369761467, 0.04788186401128769, 0.05084511637687683, -0.043039470911026, 0.036010775715112686, 0.022242480888962746, 0.0343845970928669, -0.004334211815148592, -0.04004007950425148, -0.030463706701993942, -0.05528999865055084, 0.02643440291285515, 0.029759028926491737, 0.024338440969586372, -0.03095155954360962, -0.0682271346449852, 0.04968872666358948, -0.04802641272544861, -0.03700454905629158, 0.018095729872584343, -0.0616140179336071, 0.056410256773233414, -0.005068250000476837, -0.010109396651387215, -0.04014848917722702, -0.03259580209851265, 0.04130488261580467, 0.009016244672238827, -0.017960214987397194, -0.01398511789739132, 0.015358333475887775, 0.048460058867931366, -0.02623564749956131, 0.005032112821936607, 0.019044334068894386, 0.002739655552431941, -0.012133083306252956, 0.004919183906167746, 0.048604607582092285, 0.02020072564482689, 0.020742785185575485, -0.003015202237293124, 0.05051988363265991, -0.0013325612526386976, 0.009666715748608112, -0.025025049224495888, 0.010488837957382202, -0.04582203924655914, 0.04668933153152466, -0.023525353521108627, -0.02027300000190735, -0.04329243302345276, -0.053338587284088135, -0.007764992769807577, 0.03272228315472603, 0.05561523512005806, -0.02137518674135208, -0.045641351491212845, 0.005881338380277157, 0.015005995519459248, -0.023977069184184074, 0.0055425516329705715, 0.013795397244393826, -0.04477405920624733, 0.07202155143022537, 0.019658666104078293, -0.025133460760116577, 0.07133494317531586, -0.019640598446130753, -0.00022134068422019482, -0.031222587451338768, -0.02439264766871929, -0.040798962116241455, -0.05229060724377632, 0.010226842947304249, -0.02182690240442753, 0.007661098148673773, 0.03711296245455742, 0.012873897328972816, 0.03725751116871834, 0.036155324429273605, 0.02636212669312954, 0.013470161706209183, -0.003719878615811467, -0.01069662719964981, -0.03422198072075844, -0.03568553924560547, -0.03725751116871834, 0.0009632837027311325, -0.024031274020671844, -0.06190311908721924, -0.01714712753891945, -0.009793195873498917, -0.06616731733083725, 0.005375416483730078, 0.024121617898344994, 0.020435618236660957, -0.04943576455116272, 0.025332216173410416, -0.041196469217538834, 0.08239293843507767, 0.013271407224237919, -0.031240656971931458, -0.028855597600340843, -0.026615088805556297, -0.013226235285401344, -0.04336470738053322, 0.0031936299055814743, -0.03250546008348465, 0.030192676931619644, -0.004338729195296764, 0.0494719035923481, 0.017237471416592598, -0.031222587451338768, -0.01987549103796482, -0.04791799932718277, -0.033174000680446625, -0.005890372674912214, 0.014283250086009502, 0.045677490532398224, -0.003561778226867318, 0.0049372524954378605, -0.023579558357596397, 0.03579395264387131, 0.029939714819192886, 0.0067170122638344765, -0.010317185893654823, -0.0037740846164524555, 0.001972868340089917, 0.005027595441788435, 0.0521460585296154, -0.08658486604690552, -0.00046526716323569417, 0.023832520470023155, -0.02627178467810154, 0.001767337671481073, 0.0492912158370018, -0.01232280395925045, 0.01314492616802454, -0.03649862855672836, 0.07043150812387466, 0.06201152876019478, -0.010985725559294224, 0.031818851828575134, -0.043870627880096436, -0.01068759337067604, 0.02310977503657341, 0.016180455684661865, -0.04748435318470001, 0.023977069184184074, 0.061071962118148804, 0.051531724631786346, -0.060819000005722046, -0.011130274273455143, 0.033264342695474625, 0.009323411621153355, 0.07169631123542786, 0.051712412387132645, 0.0124583188444376, -0.02020072564482689, -0.019423775374889374, 0.03095155954360962, 0.051567863672971725, 0.0184390340000391, -0.04517157003283501, -0.03190919756889343, -0.09041541069746017, 0.008316085673868656, 0.03250546008348465, -0.026506677269935608, -0.006342088337987661, -0.006545360200107098, -0.041051920503377914, -0.03985939174890518, -0.02459140121936798, 0.04347311705350876, 0.043039470911026, -0.014418764971196651, 0.019767077639698982, 0.03514347970485687, 0.023525353521108627, -0.05854235216975212, 0.005610308609902859, 0.006283365190029144, 0.0020485306158661842, -0.02184497006237507, 0.03586622700095177, 0.06038535386323929, 0.03695034235715866, -0.009901607409119606, 0.0016939338529482484, -0.0009717533830553293, 0.04470178484916687, 0.06923898309469223, -0.06891374289989471, -0.06761280447244644, -0.010226842947304249, -0.02912662737071514, -0.018276415765285492, -0.036010775715112686, 0.05106193944811821, -0.01086827926337719, -0.016632171347737312, 0.0020135226659476757, -0.04961645230650902, 0.0678657665848732, -0.04795413836836815, 0.015575156547129154, -0.009079485200345516, -0.001609237166121602, -0.06707074493169785, -0.0018317070789635181, -0.034691765904426575, -0.012955205515027046, -0.007990850135684013, 0.05528999865055084, 0.00014779572666157037, 0.04614727571606636, -0.03351730480790138, 0.027102941647171974, 0.02484436333179474, -0.026759637519717216, -0.022097932174801826, -0.01466269139200449, -0.01824931427836418, 0.051423314958810806, -0.014319387264549732, 0.03265000879764557, 0.0057774437591433525, -0.005221833474934101, -0.009748024865984917, -0.04491860792040825, -0.04596658796072006, 0.020833127200603485, 0.0437622144818306, -0.02021879330277443, -0.04217217490077019, -0.05980715528130531, 0.028150921687483788, 0.015493848361074924, -0.033300481736660004, -0.06114423647522926, -0.01824931427836418, -0.011274823918938637, -0.07202155143022537, 0.05980715528130531, -0.05749437212944031, -0.02180883288383484, -0.023687969893217087, 0.051965370774269104, -0.03230670467019081, -0.015728740021586418, 0.009865470230579376, 0.007918575778603554, -0.03689613565802574, 0.010253946296870708, 0.019694803282618523, 0.04278650879859924, -0.021068019792437553, 0.03554099053144455, -0.010814073495566845, 0.01691223494708538, 0.04506315663456917, -0.023760244250297546, 0.0045668454840779305, -0.045749764889478683, -0.042641960084438324, -0.010434632189571857, 0.006644737906754017, -0.013162994757294655, 0.043834488838911057, 0.01699354499578476, 0.030463706701993942, -0.048713020980358124, -0.03400515764951706, -0.060927413403987885, 0.0762496069073677, -0.05051988363265991, 0.015990735962986946, -0.01374119147658348, -0.017806632444262505, -0.012720313854515553, 0.02618144080042839, 0.01873716711997986, 0.06533616036176682, -0.03666124492883682, 0.051893096417188644, -0.06941966712474823, -0.017282642424106598, 0.02614530362188816, 0.0042551616206765175, -0.0871630609035492, 0.011708470992743969, 0.028566500172019005, -0.006649254821240902, 0.031692370772361755, 0.02479015663266182, -0.06277041137218475, 0.005470276810228825, 0.03812480345368385, -0.031439412385225296, -0.05221833288669586, -0.023995136842131615, -0.015963632613420486, -0.025205735117197037, 0.016325004398822784, 0.0762496069073677, 0.0583978034555912, -0.032975245267152786, 0.031439412385225296, -0.028801392763853073, 0.07509321719408035, -0.014996960759162903, 0.015060201287269592, -0.02948799915611744, -0.03355344012379646, 0.0405460000038147, -0.0343845970928669, -0.044087450951337814, -0.004106095526367426, 0.011319994926452637, -0.019062401726841927, 0.015746809542179108, 0.02802444063127041, 0.011220617219805717, -0.0015403504949063063, -0.007932127453386784, -0.03140327334403992, -0.034800175577402115, -0.02477208897471428, 0.03377026319503784, -0.00038988710730336607, 0.0023692487739026546, 0.03207181394100189, -0.054928626865148544, -0.05377223715186119, 0.039606429636478424, -0.02021879330277443, -0.007182279601693153, -0.0033472131472080946, -0.050266921520233154, -0.01832158863544464, -0.021086087450385094, 0.020977675914764404, -0.005185696296393871, -0.0064008114859461784, 0.019586391746997833, 0.011518750339746475, 0.004711394663900137, 0.025621313601732254, -0.03086121566593647, 0.0371490977704525, 0.02329046092927456, -0.009350514970719814, -0.04343698173761368, -0.06670936942100525, 0.02793409861624241, -0.019152745604515076, 0.01844806782901287, 0.006039438769221306, -0.04629182443022728, 0.007055799011141062, -0.005768409464508295, 0.05290494114160538, 0.0059355441480875015, 0.006811872590333223, 0.006414362695068121, -0.006211090832948685, 0.09280046820640564, 0.014310352504253387, 0.04173852875828743, 0.005781960673630238, 0.044159725308418274, -0.0792851373553276, -0.004121905658394098, 0.008207674138247967, -0.011717504821717739, 0.02155587263405323, -0.003794411662966013, 0.005650963168591261, 0.018068628385663033, -0.01716519519686699, -0.01065145619213581, 0.01246735267341137, -0.014301318675279617, 0.005081801675260067, -0.034673694521188736, 0.0107598677277565, 0.007150659337639809, 0.03201760724186897, -0.0138857401907444, 0.04275037348270416, 0.09547463059425354, 0.01473496574908495, -0.017806632444262505, 0.025639383122324944, 0.04123260825872421, 0.02448298968374729, 0.01692126877605915, -0.0034827280323952436, 0.009029796347022057, -0.05088125541806221, 0.016325004398822784, 0.05865076556801796, -0.029018215835094452, 0.0043432461097836494, 0.04329243302345276, -0.004878529347479343, 0.05276039242744446, -0.04144943132996559, -0.00536638218909502, 0.04004007950425148, 0.025386421009898186, -0.06587821245193481, 0.04166625440120697, -0.007173245307058096, -0.034709833562374115, -0.051423314958810806, 0.022368960082530975, -0.0701785460114479, 0.03138520568609238, 0.031439412385225296, 0.025567108765244484, 0.01835772581398487, 0.020887333899736404, 0.053049489855766296 ]
717,023
pytorch_optimizer.lr_scheduler.linear_warmup
_step
null
def _step(self) -> float: return self.max_lr + (self.min_lr - self.max_lr) * (self.step_t - self.warmup_steps) / ( self.total_steps - self.warmup_steps )
(self) -> float
[ -0.04774610698223114, -0.016195612028241158, -0.014920657500624657, 0.06260208785533905, 0.016509730368852615, 0.02117532305419445, 0.012620197609066963, -0.033481400460004807, -0.10022247582674026, 0.03810080140829086, 0.008134760893881321, 0.009266513399779797, 0.0581674687564373, 0.07228434830904007, 0.003910320810973644, 0.02241332270205021, 0.030580420047044754, 0.0362899973988533, -0.01903192326426506, -0.00029708509100601077, 0.034534625709056854, 0.033795520663261414, -0.027365317568182945, 0.019826458767056465, -0.04194413870573044, -0.0013650322798639536, 0.0343128927052021, -0.008855387568473816, -0.011871854774653912, -0.022320935502648354, -0.033462923020124435, 0.0047025480307638645, 0.01291583850979805, -0.04257237911224365, 0.011474586091935635, -0.07834500074386597, -0.013673420064151287, -0.021618785336613655, -0.09201842546463013, -0.04807870090007782, -0.024538246914744377, -0.010735482908785343, -0.028085943311452866, 0.04848520830273628, -0.01650049164891243, 0.0007997333887033165, -0.01839444600045681, -0.02603493072092533, 0.045861389487981796, -0.046563539654016495, 0.0034530004486441612, -0.029028302058577538, 0.03209558129310608, 0.015789104625582695, 0.031097792088985443, 0.038322530686855316, 0.013728853315114975, -0.09253579378128052, -0.02010362409055233, 0.01255552563816309, 0.016454298049211502, -0.04231369122862816, 0.001987496390938759, 0.029841315001249313, 0.04434622824192047, 0.013045181520283222, -0.028085943311452866, 0.030229344964027405, -0.01562280673533678, 0.02779030241072178, 0.007076918613165617, -0.028104422613978386, 0.01956777274608612, -0.011160467751324177, 0.00820867158472538, 0.013728853315114975, -0.013497883453965187, -0.030986927449703217, 0.030746717005968094, -0.043902765959501266, 0.02100902609527111, 0.05484149977564812, 0.012684868648648262, -0.031116269528865814, -0.006878284737467766, -0.048706941306591034, -0.05510018765926361, -0.03325967118144035, -0.08277962356805801, 0.005908210761845112, -0.012657152488827705, 0.02655230462551117, 0.016103224828839302, 0.037250831723213196, 0.024445857852697372, 0.05048079043626785, -0.09711823612451553, -0.00367704126983881, -0.01993732526898384, -0.029564151540398598, 0.04645267501473427, 0.06408029794692993, 0.004808794241398573, 0.04915040358901024, 0.027679437771439552, -0.01802489347755909, -0.00029910606099292636, -0.039763785898685455, 0.012315317057073116, -0.0011450335150584579, -0.015659762546420097, 0.018246624618768692, -0.06208471953868866, 0.06456071883440018, -0.05277201160788536, -0.003289011772722006, 0.008776857517659664, 0.018976489081978798, 0.03405420854687691, 0.0800449401140213, 0.015225538052618504, -0.01042136363685131, -0.009525200352072716, -0.01685156673192978, -0.02549908123910427, -0.016860805451869965, 0.03281620889902115, 0.052328549325466156, -0.04563966020941734, -0.021618785336613655, 0.019844936206936836, -0.005062860902398825, -0.004538559354841709, -0.04523315280675888, -0.016648313030600548, 0.01409840490669012, 0.030561942607164383, 0.030931493267416954, 0.018606938421726227, 0.021249234676361084, 0.006079128943383694, 0.05827833339571953, 0.03752799332141876, -0.03701062127947807, 0.03906163573265076, 0.038285575807094574, 0.005284592043608427, 0.11012646555900574, 0.031134746968746185, 0.0015602018684148788, -0.005002808757126331, -0.029711972922086716, 0.0893576517701149, 0.010772437788546085, 0.011437631212174892, 0.029360897839069366, -0.023725232109427452, 0.01837596856057644, -0.019604727625846863, -0.033278148621320724, -0.050517745316028595, -0.05291983112692833, 0.0018662370275706053, -0.0185607448220253, 0.006342434324324131, 0.026607736945152283, -0.013183764182031155, 0.050702519714832306, -0.028270719572901726, 0.006910620257258415, 0.04286802187561989, -0.0423506461083889, 0.016158657148480415, 0.016999388113617897, 0.012934315949678421, 0.08433174341917038, 0.03983769565820694, 0.011825661174952984, 0.00018419852131046355, 0.0737995132803917, 0.03252056613564491, 0.01346092764288187, -0.002524501411244273, -0.07583204656839371, -0.010171916335821152, 0.011631646193563938, -0.014329374767839909, -0.00659650145098567, 0.013932106085121632, 0.01362722646445036, 0.028270719572901726, 0.002161878626793623, 0.011243616230785847, -0.039209455251693726, -0.028492450714111328, 0.016962431371212006, 0.028455495834350586, 0.017618386074900627, 0.13348214328289032, -0.02330024726688862, -0.03821166604757309, 0.001987496390938759, -0.0027785683050751686, 0.03440527990460396, -0.06119779497385025, -0.032539043575525284, -0.03536611795425415, 0.018939534202218056, -0.03575414791703224, 0.03486722335219383, -0.0614195242524147, -0.011770227923989296, 0.01635267212986946, 0.01498532947152853, 0.009885513223707676, -0.060902152210474014, -0.0311901792883873, 0.005206062458455563, 0.03647477179765701, 0.02370675466954708, 0.012592480517923832, -0.07431688904762268, 0.032003194093704224, -0.04519619792699814, 0.02566538006067276, -0.06008913740515709, 0.0012807282619178295, -0.04752437397837639, -0.0609760619699955, 0.009141789749264717, -0.019290609285235405, -0.029822837561368942, 0.02653382532298565, 0.0351443849503994, 0.03301946073770523, 0.06433898210525513, -0.03194776177406311, 0.012814211659133434, -0.019955802708864212, -0.000777791254222393, -0.03787906840443611, -0.012527809478342533, -0.0014054520288482308, 0.0063793896697461605, -0.030451076105237007, 0.04201805219054222, 0.047635238617658615, -0.018921056762337685, -0.01958625018596649, 0.030395643785595894, -0.011927287094295025, -0.007515761535614729, 0.0027924266178160906, 0.031836897134780884, 0.027383795008063316, 0.04471578076481819, 0.08625341206789017, 0.0642281174659729, 0.013387017883360386, 0.026644691824913025, 0.002723135519772768, -0.06300859898328781, 0.0006836710381321609, 0.013756569474935532, -0.1065787672996521, 0.03689975664019585, -0.008799954317510128, -0.004739502910524607, 0.0010203097481280565, 0.025591468438506126, 0.18226300179958344, 0.041168082505464554, -0.063267283141613, -0.03924641013145447, 0.013497883453965187, -0.0043029701337218285, 0.017378177493810654, 0.005723434966057539, -0.005076718982309103, -0.002256576204672456, 0.035587847232818604, -0.0930531695485115, -0.04175936430692673, -0.00034443390904925764, -0.06663020700216293, -0.0014828270068392158, 0.018625415861606598, 0.00209836196154356, 0.0285109281539917, -0.018237385898828506, 0.0010231968481093645, -0.020547086372971535, 0.03965291753411293, 0.034331370145082474, 0.08640123158693314, -0.00446926848962903, -0.03858121857047081, -0.050665564835071564, 0.003446071408689022, 0.05938699096441269, 0.01938299648463726, -0.036714982241392136, -0.024150216951966286, 0.04272019863128662, -0.01742437109351158, 0.028584839776158333, 0.02638600580394268, 0.020602518692612648, 0.009673020802438259, -0.02187747322022915, -0.06940184533596039, 0.015197821892797947, -0.0019008825765922666, -0.01685156673192978, -0.038692083209753036, -0.04031811282038689, -0.029102211818099022, 0.004305279813706875, -0.020491652190685272, 0.020306875929236412, -0.009802363812923431, 0.05687403678894043, 0.013082137331366539, 0.027919646352529526, -0.00534464418888092, -0.059645675122737885, 0.06855187565088272, -0.010476795956492424, -0.031282566487789154, -0.060236960649490356, -0.03372161090373993, -0.0737995132803917, -0.011779466643929482, 0.04427231848239899, 0.0015059240395203233, -0.021434010937809944, 0.03141191229224205, 0.04053984209895134, 0.024279559031128883, -0.005497084464877844, 0.03338901326060295, 0.026977287605404854, 0.0007217810489237309, 0.033481400460004807, 0.05251332372426987, -0.026349050924181938, 0.03625304251909256, -0.004069690126925707, 0.03529220446944237, -0.005788106471300125, -0.04508533328771591, -0.042239781469106674, -0.03625304251909256, 0.001768074813298881, -0.031079314649105072, 0.008832290768623352, -0.059867408126592636, -0.05136771500110626, 0.0189118180423975, -0.040798529982566833, -0.034700922667980194, 0.03178146481513977, -0.047080911695957184, 0.09275752305984497, 0.03459005802869797, 0.007243216969072819, -0.06249122694134712, -0.012084347195923328, -0.004247537348419428, 0.03691823408007622, -0.024445857852697372, -0.011095795780420303, -0.01606626808643341, 0.018339013680815697, -0.02224702388048172, 0.029102211818099022, -0.014772837050259113, 0.018366729840636253, 0.008966253139078617, 0.01819119229912758, 0.030783673748373985, 0.032760776579380035, -0.03479330986738205, -0.007136971224099398, 0.06799755245447159, -0.011964242905378342, -0.00799155980348587, -0.06707367300987244, 0.01057842280715704, -0.05162639915943146, 0.014449479058384895, -0.00923879723995924, -0.0409463495016098, -0.03861817345023155, -0.04360712319612503, -0.0027092774398624897, -0.0015347952721640468, 0.0271066315472126, -0.016278760507702827, 0.03296402841806412, -0.002942556980997324, 0.0059636435471475124, 0.02043621987104416, 0.009252655319869518, 0.000774904154241085, -0.06330423802137375, 0.040281157940626144, 0.054250217974185944, -0.004663283005356789, 0.015724433586001396, -0.017599908635020256, 0.01975254900753498, -0.012934315949678421, 0.019955802708864212, -0.016676029190421104, -0.02099054865539074, -0.029693495482206345, -0.02764248102903366, -0.022320935502648354, 0.00726631423458457, 0.012324555777013302, 0.05144162476062775, 0.017812401056289673, 0.022690486162900925, 0.020565563812851906, -0.013266912661492825, 0.005233778618276119, -0.019623205065727234, -0.005215301178395748, 0.004490055609494448, -0.0337400883436203, 0.0027577809523791075, -0.046193987131118774, 0.014042971655726433, -0.004430003464221954, 0.005432412959635258, -0.005672621540725231, 0.008998588658869267, 0.01057842280715704, -0.019771026447415352, 0.0063793896697461605, -0.019161265343427658, 0.04597225785255432, 0.017904790118336678, -0.001458575134165585, -0.03392486274242401, -0.040650710463523865, -0.06881055980920792, -0.046009212732315063, 0.0036816608626395464, -0.01993732526898384, -0.020935114473104477, 0.010966452769935131, 0.003021086798980832, 0.0162325669080019, 0.0030187771189957857, -0.09127932041883469, -0.03159668669104576, 0.0038248621858656406, -0.026847945526242256, 0.02960110642015934, 0.08447956293821335, 0.008762999437749386, -0.003568485612049699, -0.0002334239979973063, -0.005173726473003626, 0.024150216951966286, 0.05399153381586075, -0.02278287522494793, 0.00489194318652153, 0.011178945191204548, 0.03143038973212242, 0.043163660913705826, -0.027402272447943687, 0.02636752836406231, -0.004490055609494448, -0.03407268598675728, -0.012777256779372692, 0.02352197840809822, -0.031836897134780884, -0.023207860067486763, -0.0623803585767746, 0.04072462022304535, 0.01839444600045681, 0.01541955303400755, 0.06603892147541046, -0.08137533068656921, 0.028658749535679817, 0.056800127029418945, 0.01068928837776184, -0.026145797222852707, 0.0006138025783002377, 0.010088766925036907, 0.005788106471300125, -0.07694070786237717, -0.04371798783540726, 0.07413210719823837, 0.026866422966122627, 0.0681823268532753, 0.05040687695145607, 0.014680448919534683, -0.0185607448220253, 0.013876673765480518, -0.003058041911572218, -0.01685156673192978, 0.002723135519772768, -0.06511504203081131, -0.021803561598062515, -0.055358875542879105, 0.04072462022304535, 0.06578023731708527, 0.0011698626913130283, -0.03891381621360779, -0.021969860419631004, 0.007307888939976692, -0.02402087301015854, -0.019087355583906174, 0.04915040358901024, 0.04020724818110466, -0.023466546088457108, -0.031116269528865814, -0.007072299253195524, 0.00023068122391123325, -0.06570632755756378, -0.008915439248085022, 0.04859607294201851, -0.0018697016639634967, -0.011280572041869164, 0.0005401809467002749, 0.04290497675538063, 0.025074096396565437, -0.013784285634756088, 0.024371948093175888, 0.0502590574324131, 0.008139380253851414, 0.021415531635284424, -0.05343720316886902, -0.07856673002243042, -0.03780515864491463, -0.017082536593079567, -0.010818631388247013, -0.0889141857624054, 0.013405495323240757, -0.004617088939994574, -0.0014481814578175545, -0.010541467927396297, -0.03752799332141876, 0.07431688904762268, -0.027587048709392548, 0.026238184422254562, -0.0058065843768417835, 0.01248161494731903, -0.02657078206539154, -0.003508433233946562, 0.027365317568182945, 0.030580420047044754, -0.007548097521066666, 0.044937510043382645, 0.017359700053930283, 0.01328539103269577, -0.03895077109336853, -0.04830043390393257, 0.05920221284031868, -0.05133076012134552, -0.01517010573297739, -0.03497808799147606, -0.03695518895983696, 0.031485822051763535, -0.06478244811296463, 0.008402686566114426, -0.0054370323196053505, 0.048189569264650345, 0.001877785543911159, -0.019346041604876518, -0.02581319957971573, -0.01905040070414543, 0.030765196308493614, 0.01048603467643261, -0.0022380987647920847, -0.02352197840809822, 0.019438430666923523, 0.002619198989123106, 0.02601645328104496, -0.02241332270205021, -0.010384408757090569, 0.009414334781467915, -0.040465932339429855, 0.020898159593343735, -0.040983304381370544, -0.01819119229912758, -0.05853702127933502, -0.004090477712452412, -0.0739842876791954, -0.03449767082929611, -0.013470166362822056, -0.029896749183535576, -0.024556724354624748, -0.016962431371212006, 0.03943118825554848, 0.033130329102277756, -0.009081738069653511, -0.007589672226458788, 0.003309799125418067, 0.019290609285235405, 0.021212279796600342, -0.03534764051437378, -0.010522990487515926, -0.008532029576599598, -0.050332967191934586, -0.06186298653483391, 0.029194599017500877, -0.022690486162900925, 0.02461215667426586, -0.007206262089312077, -0.022136159241199493, -0.013664181344211102, 0.03048803098499775, -0.059645675122737885, 0.04556575044989586, 0.006873665377497673, 0.01202891394495964, -0.02888048067688942, -0.02099054865539074, -0.007926887832581997, 0.05399153381586075, -0.010181155055761337, 0.036511726677417755, -0.02636752836406231, 0.016020074486732483, -0.08728815615177155, -0.014902180060744286, 0.024630634114146233, 0.0080839479342103, -0.11116120964288712, 0.04501141980290413, 0.05402848869562149, -0.017027104273438454, 0.023946963250637054, -0.02006666734814644, -0.06156734749674797, 0.015650521963834763, 0.07180393487215042, -0.025868631899356842, -0.002194214379414916, -0.00914640910923481, -0.02187747322022915, -0.04855911806225777, 0.032539043575525284, 0.06334119290113449, 0.06925402581691742, -0.013996778056025505, 0.038876861333847046, 0.023374157026410103, 0.026866422966122627, -0.011021885089576244, -0.0574653185904026, -0.009839319624006748, 0.05144162476062775, 0.024002395570278168, -0.0723952203989029, -0.10184850543737411, 0.02097206935286522, -0.012546286918222904, -0.024704543873667717, 0.016020074486732483, 0.007012247107923031, -0.023004606366157532, -0.042424559593200684, -0.027919646352529526, -0.06544764339923859, -0.04379190132021904, -0.024686066433787346, -0.006162277888506651, 0.03159668669104576, -0.0033444445580244064, -0.0009233023156411946, -0.003478407161310315, -0.028473973274230957, 0.04844825342297554, -0.010846348479390144, -0.01752599887549877, 0.006804374512284994, -0.04896562546491623, 0.002420564880594611, 0.03802689164876938, -0.02115684561431408, -0.017904790118336678, 0.04283106327056885, -0.001393903512507677, 0.0814492404460907, -0.048374343663454056, -0.02100902609527111, -0.05831528827548027, 0.049446042627096176, 0.022173114120960236, -0.04264628887176514, 0.0041297422721982, -0.01693471521139145, 0.05007428303360939, -0.037213876843452454, 0.012906599789857864, 0.0012114372802898288, -0.03497808799147606, -0.02673707902431488, 0.014320136047899723, 0.05059165507555008, 0.04793088138103485, -0.005857397802174091, -0.054804544895887375, 0.017359700053930283, 0.06991922110319138, 0.005155249033123255, -0.006384009029716253, 0.00021220362395979464, 0.012149018235504627, 0.009663782082498074, -0.046304851770401, -0.008749141357839108, -0.02976740524172783, 0.017359700053930283, -0.06430202722549438, -0.02621970698237419, 0.025794722139835358, 0.029305465519428253, -0.06504113227128983, 0.013793524354696274, 0.015548896044492722, 0.02224702388048172, -0.005658763460814953, 0.03658563643693924, -0.04970473051071167, 0.023632843047380447, -0.022191591560840607, 0.01705482043325901, 0.01991884782910347, 0.01579834334552288, -0.005104435607790947, 0.030617374926805496, 0.04268324375152588, -0.018921056762337685, 0.04970473051071167, 0.017211880534887314, 0.014301658608019352, -0.04286802187561989, 0.026275139302015305, 0.04020724818110466, -0.010181155055761337, -0.031652119010686874, 0.015401075594127178, -0.04464187100529671, 0.061271704733371735, 0.009446670301258564, 0.0026376766618341208, 0.0013650322798639536, 0.05184813216328621, -0.043902765959501266, 0.05170030891895294, -0.030746717005968094, -0.012426182627677917, 0.00650411332026124, -0.0011502302950248122, -0.07671897113323212, 0.06186298653483391, 0.03385095298290253, 0.019105833023786545, 0.04127894714474678, 0.013183764182031155, 0.004432313144207001 ]
717,027
pytorch_optimizer.optimizer.lion
Lion
Symbolic Discovery of Optimization Algorithms. :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param lr: float. learning rate. :param betas: BETAS. coefficients used for computing running averages of gradient and the squared hessian trace. :param weight_decay: float. weight decay (L2 penalty). :param weight_decouple: bool. the optimizer uses decoupled weight decay as in AdamW. :param fixed_decay: bool. fix weight decay. :param use_gc: bool. use gradient centralization. :param r: float. EMA factor. between 0.9 ~ 0.99 is preferred. :param adanorm: bool. whether to use the AdaNorm variant.
class Lion(Optimizer, BaseOptimizer): r"""Symbolic Discovery of Optimization Algorithms. :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param lr: float. learning rate. :param betas: BETAS. coefficients used for computing running averages of gradient and the squared hessian trace. :param weight_decay: float. weight decay (L2 penalty). :param weight_decouple: bool. the optimizer uses decoupled weight decay as in AdamW. :param fixed_decay: bool. fix weight decay. :param use_gc: bool. use gradient centralization. :param r: float. EMA factor. between 0.9 ~ 0.99 is preferred. :param adanorm: bool. whether to use the AdaNorm variant. """ def __init__( self, params: PARAMETERS, lr: float = 1e-4, betas: BETAS = (0.9, 0.99), weight_decay: float = 0.0, weight_decouple: bool = True, fixed_decay: bool = False, use_gc: bool = False, r: float = 0.95, adanorm: bool = False, ): self.validate_learning_rate(lr) self.validate_betas(betas) self.validate_non_negative(weight_decay, 'weight_decay') self.use_gc = use_gc defaults: DEFAULTS = { 'lr': lr, 'betas': betas, 'weight_decay': weight_decay, 'weight_decouple': weight_decouple, 'fixed_decay': fixed_decay, 'adanorm': adanorm, } if adanorm: defaults.update({'r': r}) super().__init__(params, defaults) def __str__(self) -> str: return 'Lion' @torch.no_grad() def reset(self): for group in self.param_groups: for p in group['params']: state = self.state[p] state['exp_avg'] = torch.zeros_like(p) if group['adanorm']: state['exp_grad_norm'] = torch.zeros((1,), dtype=p.dtype, device=p.device) @torch.no_grad() def step(self, closure: CLOSURE = None) -> LOSS: loss: LOSS = None if closure is not None: with torch.enable_grad(): loss = closure() for group in self.param_groups: beta1, beta2 = group['betas'] for p in group['params']: if p.grad is None: continue grad = p.grad if grad.is_sparse: raise NoSparseGradientError(str(self)) state = self.state[p] if len(state) == 0: state['exp_avg'] = torch.zeros_like(p) if group['adanorm']: state['exp_grad_norm'] = torch.zeros((1,), dtype=grad.dtype, device=grad.device) if self.use_gc: centralize_gradient(grad, gc_conv_only=False) self.apply_weight_decay( p=p, grad=p.grad, lr=group['lr'], weight_decay=group['weight_decay'], weight_decouple=group['weight_decouple'], fixed_decay=group['fixed_decay'], ) s_grad = self.get_adanorm_gradient( grad=grad, adanorm=group['adanorm'], exp_grad_norm=state.get('exp_grad_norm', None), r=group.get('r', None), ) exp_avg = state['exp_avg'] update = exp_avg.clone() update.mul_(beta1).add_(grad, alpha=1.0 - beta1).sign_() exp_avg.mul_(beta2).add_(s_grad, alpha=1.0 - beta2) p.add_(update, alpha=-group['lr']) return loss
(params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], lr: float = 0.0001, betas: Union[Tuple[float, float], Tuple[float, float, float]] = (0.9, 0.99), weight_decay: float = 0.0, weight_decouple: bool = True, fixed_decay: bool = False, use_gc: bool = False, r: float = 0.95, adanorm: bool = False)
[ -0.009503071196377277, -0.03745751082897186, -0.019725292921066284, 0.0005644054035656154, 0.017167169600725174, 0.005285762250423431, -0.07207950949668884, -0.06529894471168518, -0.029670128598809242, -0.0018762145191431046, -0.03347135707736015, 0.003947627265006304, 0.027697600424289703, 0.06764131784439087, -0.03306041285395622, 0.03517677262425423, -0.01605762168765068, 0.048039309680461884, -0.02391691878437996, -0.038998547941446304, -0.028046902269124985, -0.058312900364398956, -0.024307314306497574, 0.027492128312587738, -0.04138202220201492, -0.006102512590587139, 0.057491011917591095, -0.0050674485974013805, -0.0678057000041008, -0.000907286477740854, -0.016016528010368347, -0.04045739769935608, 0.014506310224533081, 0.0032002234365791082, 0.044875044375658035, -0.06476471573114395, 0.026505863294005394, 0.02950575202703476, -0.06821664422750473, -0.014968621544539928, 0.006184701342135668, -0.04491613805294037, 0.03412886708974838, -0.03355354815721512, -0.014845338650047779, 0.0021279174834489822, -0.0114242322742939, 0.05732663348317146, -0.028560582548379898, -0.036512341350317, 0.014978894963860512, -0.07951758801937103, 0.03945058584213257, 0.0064107202924788, -0.009862646460533142, 0.045902401208877563, 0.06386063992977142, -0.006734338589012623, 0.0630798488855362, -0.06110731512308121, 0.055107541382312775, -0.06981932371854782, 0.02247861586511135, -0.026875711977481842, -0.02517029643058777, -0.014547403901815414, -0.07405204325914383, -0.014372752979397774, 0.022396426647901535, 0.04265594854950905, 0.03347135707736015, -0.036902736872434616, 0.03776571899652481, -0.017701396718621254, -0.029361922293901443, -0.023300502449274063, -0.0618470162153244, -0.07709302008152008, 0.03314260393381119, -0.06073746830224991, -0.0077822450548410416, 0.011547516100108624, -0.008588721975684166, -0.020002679899334908, 0.0013355667470023036, -0.050176214426755905, 0.013324846513569355, -0.03336862102150917, 0.0038834172300994396, -0.058312900364398956, 0.0017734785797074437, -0.0010864322539418936, 0.029279733076691628, 0.018893133848905563, 0.03236180916428566, 0.04627225175499916, -0.01528710313141346, -0.06275109201669693, 0.03564935922622681, -0.034457623958587646, 0.006189838517457247, 0.008932886645197868, 0.0034185373224318027, 0.05371033027768135, 0.012975544668734074, -0.030738582834601402, -0.04906667023897171, -0.015389838255941868, 0.02480044774711132, -0.06739475578069687, -0.06077856197953224, 0.022293690592050552, -0.00013122906966600567, 0.005059743300080299, -0.028231827542185783, 0.019540369510650635, -0.004183919634670019, -0.019191067665815353, -0.04240938276052475, 0.03063584677875042, 0.026814071461558342, 0.0140645457431674, -0.0561348982155323, 0.005003238562494516, 0.038402680307626724, 0.010376326739788055, 0.023629257455468178, 0.017352094873785973, 0.03164266049861908, -0.053792521357536316, 0.000688330561388284, 0.015215187333524227, -0.031971413642168045, 0.0070836408995091915, 0.027635958045721054, -0.025622334331274033, -0.020351983606815338, 0.01576996222138405, -0.042738135904073715, 0.026916807517409325, 0.03460145369172096, 0.005398771725594997, 0.01379743218421936, -0.0046154106967151165, 0.011670798994600773, 0.005244668107479811, 0.002368062501773238, -0.007879843935370445, -0.0029048577416688204, 0.0111776664853096, 0.011855723336338997, -0.0015808487078174949, 0.007474036887288094, 0.030656393617391586, -0.009097264148294926, 0.017167169600725174, -0.04117655009031296, -0.008799330331385136, -0.03527950868010521, -0.0074945841915905476, -0.04269704222679138, -0.050874821841716766, -0.04228609800338745, -0.02147180400788784, -0.01867738738656044, -0.008218872360885143, 0.014496035873889923, 0.004381686449050903, -0.012502959929406643, 0.02611546777188778, -0.00431490782648325, -0.08268185704946518, 0.022869013249874115, 0.029813960194587708, -0.0008925182046368718, 0.12155712395906448, 0.008768509142100811, 0.011855723336338997, 0.0008726131054572761, -0.007556225638836622, 0.03527950868010521, -0.03421105816960335, -0.0335329994559288, -0.09944835305213928, -0.013725517317652702, 0.05346376448869705, -0.0065494137816131115, 0.016037074849009514, -0.0071966503746807575, 0.06554550677537918, 0.018297264352440834, -0.01814316026866436, 0.014557677321135998, -0.0049698492512106895, -0.0008103294530883431, 0.02950575202703476, 0.0033055278472602367, 0.04865572601556778, 0.04454628750681877, 0.050463877618312836, -0.0009689279831945896, 0.05436784029006958, 0.005093132611364126, 0.011588609777390957, 0.00031607341952621937, 0.012615969404578209, -0.02206767164170742, 0.027944166213274002, -0.01127012912184, 0.004833724349737167, -0.04462847858667374, 0.0066059185191988945, 0.033985037356615067, 0.06928509473800659, 0.03832049295306206, -0.040662869811058044, 0.011907091364264488, 0.058148521929979324, 0.0419778898358345, -0.026259297505021095, 0.015482300892472267, -0.05560067296028137, 0.01743428222835064, -0.004843997769057751, 0.05317610502243042, -0.02831401489675045, 0.0453270822763443, -0.01445494219660759, -0.0014729760587215424, 0.0017298158491030335, 0.0069295368157327175, -0.06977822631597519, 0.00043309605098329484, 0.02605382539331913, 0.0855584591627121, 0.024163484573364258, -0.019191067665815353, 0.02736884541809559, -0.04043685272336006, -0.023958012461662292, -0.028478393331170082, -0.008922613225877285, -0.04074506089091301, -0.004879955668002367, -0.03003997914493084, 0.019232161343097687, 0.06049090251326561, 0.04306689277291298, -0.04442300647497177, 0.00554773909971118, -0.046477723866701126, -0.030245451256632805, -0.004605136811733246, 0.040477946400642395, -0.08264075964689255, -0.0167664997279644, 0.004908207803964615, 0.0316632054746151, 0.00392451137304306, -0.07828476279973984, -0.0005464265705086291, -0.00794148538261652, -0.06439486891031265, 0.0627099946141243, 0.0035777778830379248, 0.023403238505125046, 0.07380547374486923, -0.02777978964149952, 0.0013445561053231359, 0.02051636017858982, 0.07129871845245361, 0.06907962262630463, -0.06965494155883789, -0.0033877163659781218, -0.0070065888576209545, 0.04306689277291298, 0.0008976549725048244, 0.014711781404912472, -0.0062514799647033215, 0.016201451420783997, 0.05888821929693222, -0.03852596506476402, -0.05876493826508522, 0.005604243837296963, -0.042368289083242416, 0.04356002435088158, -0.023526521399617195, 0.023218315094709396, 0.040128644555807114, 0.026444222778081894, 0.05810742825269699, 0.006261753384023905, 0.08440782129764557, 0.012872808612883091, 0.11843395233154297, 0.03180703520774841, -0.009441429749131203, 0.04771055281162262, -0.016078168526291847, -0.023752542212605476, 0.062586709856987, -0.00948252435773611, 0.03324533998966217, -0.019540369510650635, -0.00750999478623271, -0.05001183971762657, 0.027697600424289703, 0.006980904843658209, 0.03741641715168953, 0.015184367075562477, 0.004674483556300402, -0.020002679899334908, 0.020660189911723137, 0.012009827420115471, 0.00026085288845933974, -0.08025728911161423, -0.019828028976917267, -0.04882010072469711, 0.05034059286117554, 0.06538113206624985, -0.01933489739894867, 0.0567513145506382, -0.011218761093914509, -0.01861574687063694, -0.02301284298300743, -0.079723060131073, 0.04586130753159523, 0.04187515377998352, -0.03534115105867386, -0.020362256094813347, -0.02800580859184265, -0.03758079558610916, 0.01700279302895069, 0.00264031277038157, -0.03908073902130127, -0.005075153894722462, 0.04758727177977562, 0.03667671978473663, -0.007299385964870453, -0.0670659989118576, 0.04368330538272858, 0.06205248832702637, -0.040128644555807114, 0.06386063992977142, 0.007335343863815069, -0.05818961560726166, 0.0454503633081913, 0.008254829794168472, 0.010674260556697845, 0.010951647534966469, -0.007777107879519463, -0.009770184755325317, -0.014958348125219345, 0.07988744229078293, 0.07491502165794373, 0.028355110436677933, -0.03478637710213661, -0.0009663596283644438, 0.028704412281513214, -0.07335343956947327, -0.01945818029344082, -0.004633389413356781, -0.058025240898132324, 0.07701083272695541, 0.07150419056415558, -0.006847348064184189, -0.008573311381042004, -0.0514090470969677, 0.034519262611866, -0.06098403409123421, -0.00333891692571342, -0.10873568058013916, -0.00033742323284968734, -0.0022486320231109858, -0.010890006087720394, -0.012913903221487999, 0.0018402568530291319, -0.010797543451189995, 0.030245451256632805, 0.009318146854639053, 0.03889581561088562, 0.025314126163721085, 0.03945058584213257, 0.029608488082885742, 0.04099162667989731, -0.024779900908470154, 0.0072480179369449615, 0.0014948074240237474, 0.05420346185564995, -0.048573534935712814, 0.032033056020736694, 0.010920826345682144, 0.010417420417070389, 0.009400335140526295, -0.07047683000564575, 0.04175187274813652, 0.02790307253599167, 0.03205360099673271, -0.09081853926181793, -0.03871088847517967, -0.0073610274121165276, -0.03462199866771698, 0.013520045205950737, 0.02231423929333687, -0.031128980219364166, -0.058436181396245956, 0.04610787332057953, 0.073271244764328, -0.035546623170375824, 0.08687347918748856, -0.016396651044487953, 0.016869235783815384, -0.0371287576854229, 0.03509458526968956, -0.014609045349061489, -0.022437522187829018, 0.014496035873889923, 0.005902177654206753, 0.02385527640581131, 0.050587158650159836, 0.041299834847450256, -0.006272026803344488, 0.05329938605427742, 0.0507926307618618, 0.014783697202801704, 0.019375991076231003, -0.0632031261920929, -0.007823338732123375, -0.05313501134514809, -0.04997074604034424, -0.029012620449066162, -0.0036728086415678263, -0.019715020433068275, -0.03811502084136009, -0.03254673629999161, -0.04051904007792473, 0.0041993302293121815, 0.027553770691156387, 0.023834729567170143, -0.024759354069828987, 0.02009514346718788, -0.015811055898666382, 0.021985484287142754, 0.012841988354921341, -0.02646476961672306, -0.006713791284710169, 0.03295767679810524, 0.004903071094304323, -0.0563814640045166, -0.009667448699474335, 0.027492128312587738, -0.0059073143638670444, 0.04840916022658348, 0.01600625365972519, 0.011475600302219391, -0.006600781809538603, 0.024820994585752487, -0.04109436273574829, -0.0023141263518482447, 0.008676047436892986, 0.00794148538261652, 0.029218090698122978, 0.0010459799086675048, 0.025314126163721085, -0.03273165971040726, 0.001984087284654379, 0.0616004504263401, -0.009359240531921387, -0.02379363588988781, -0.010653713718056679, -0.002472082618623972, -0.0027122278697788715, 0.036430150270462036, -0.039162926375865936, -0.05132685974240303, -0.00014455262862611562, 0.0002926368033513427, 0.005162479355931282, 0.039409492164850235, -0.04343673959374428, 0.05502535030245781, -0.059216976165771484, 0.019293803721666336, 0.040724512189626694, 0.018348632380366325, 0.04705304279923439, -0.00475924089550972, 0.013252931647002697, 0.003685650648549199, 0.048203688114881516, -0.06353188306093216, -0.03735477477312088, 0.06406611204147339, 0.007114461623132229, -0.047135233879089355, -0.02194438874721527, 0.015132999047636986, -0.004515243228524923, 0.0563814640045166, 0.0013471245765686035, 0.007771971169859171, -0.001805583480745554, -0.06973712891340256, 0.0025324400048702955, 0.06949056684970856, -0.04216281697154045, -0.044464100152254105, 0.0032284758053719997, -0.05280625447630882, 0.02712227962911129, -0.030060525983572006, -0.03258782997727394, 0.0565047487616539, 0.002040592022240162, -0.008691458031535149, -0.03086186572909355, 0.0012199889170005918, 0.06977822631597519, 0.04709414020180702, -0.05013512074947357, 0.03503294289112091, 0.043929874897003174, -0.0075716362334787846, -0.028560582548379898, 0.02379363588988781, 0.03176594153046608, 0.01778358593583107, -0.01742400974035263, 0.055477388203144073, -0.005522055085748434, 0.012472138740122318, -0.011896817944943905, -0.016971971839666367, 0.041423115879297256, 0.005763484165072441, 0.020002679899334908, 0.03326588496565819, -0.03205360099673271, -0.06118950620293617, -0.03332752734422684, 0.009256505407392979, 0.003947627265006304, 0.041012171655893326, -0.019232161343097687, -0.01772194355726242, 0.05551848188042641, -0.010653713718056679, 0.028457846492528915, -0.02159508690237999, -0.030245451256632805, -0.04019028693437576, 0.029587941244244576, -0.033985037356615067, 0.010725628584623337, 0.041957344859838486, -0.010330094955861568, -0.02517029643058777, -0.007453490048646927, -0.0024990509264171124, 0.0342726968228817, -0.05502535030245781, -0.03406722471117973, -0.0023629257921129465, -0.02890988439321518, 0.024081295356154442, 0.03474528342485428, 0.00859385821968317, -0.030533110722899437, -0.033882301300764084, 0.00948252435773611, 0.006564824376255274, -0.014383026398718357, 0.007587046828120947, -0.00257353438064456, -0.055107541382312775, 0.025129202753305435, -0.001375376945361495, -0.00972909014672041, -0.0017644892213866115, -0.06053199619054794, 0.06907962262630463, -0.04976527392864227, -0.04025192931294441, -0.022704634815454483, 0.02342378720641136, 0.03474528342485428, -0.06472361832857132, 0.057614296674728394, 0.014300838112831116, -0.0062874373979866505, -0.00135354558005929, 0.03566990792751312, -0.007520268205553293, -0.047381799668073654, -0.022170407697558403, 0.026814071461558342, -0.08305170387029648, 0.017886321991682053, 0.041197098791599274, 0.025067560374736786, -0.0685453936457634, -0.006744612008333206, 0.02630039118230343, -0.01588297076523304, 0.0019673926290124655, 0.004438191186636686, 0.009949972853064537, 0.03431379422545433, 0.029361922293901443, -0.06118950620293617, -0.026608599349856377, -0.03603975474834442, 0.0024309884756803513, -0.04388877749443054, -0.02058827504515648, -0.019715020433068275, 0.006919263396412134, 0.04335455223917961, 0.09788677096366882, -0.03088241256773472, -0.014157007448375225, -0.004309771116822958, -0.004867113661020994, 0.00453579006716609, -0.027635958045721054, -0.04931323602795601, 0.03332752734422684, -0.0736410990357399, -0.00270709116011858, -0.025416862219572067, -0.02075265347957611, -0.016704857349395752, -0.0016630374593660235, -0.021081408485770226, 0.03811502084136009, 0.0072891125455498695, 0.06151825934648514, 0.028355110436677933, -0.02985505387187004, -0.028457846492528915, -0.02051636017858982, 0.023115579038858414, -0.017711669206619263, 0.00012360414257273078, -0.028540033847093582, -0.025437410920858383, 0.023362144827842712, 0.0228484645485878, 0.07787381857633591, 0.026197655126452446, -0.012975544668734074, 0.04680647701025009, -0.0371287576854229, -0.010920826345682144, 0.00584567291662097, -0.014043997973203659, 0.004982691258192062, 0.01688978262245655, 0.0315399244427681, -0.027800336480140686, 0.012728978879749775, -0.014290564693510532, 0.0072531551122665405, 0.03400558605790138, -0.025005919858813286, -0.012831714935600758, -0.019375991076231003, 0.001155136851593852, 0.008881518617272377, 0.02545795775949955, -0.10035242885351181, -0.04090943932533264, -0.023588163778185844, 0.00942601915448904, -0.0043482971377670765, -0.0026557231321930885, 0.020187605172395706, -0.019108878448605537, 0.021389614790678024, -0.004949302412569523, 0.04384768381714821, 0.02640312723815441, 0.01642747037112713, 0.00046199053758755326, 0.02743048593401909, -0.006831937935203314, -0.03665617108345032, 0.0037036293651908636, 0.026978448033332825, -0.02913590334355831, -0.06065527722239494, 0.005732663441449404, 0.038813624531030655, -0.004137688782066107, 0.03532060608267784, -0.06414829939603806, -0.0569978803396225, -0.04799821600317955, 0.011917364783585072, -0.07269592583179474, 0.014948073774576187, -0.005434729158878326, -0.048861198127269745, -0.006487772334367037, 0.00694494741037488, 0.05346376448869705, -0.0015474596293643117, -0.030307091772556305, 0.011670798994600773, 0.0063079847022891045, 0.02178001217544079, 0.02237587980926037, -0.011074930429458618, 0.011578336358070374, 0.06431267410516739, -0.011475600302219391, 0.04598459228873253, -0.027163373306393623, -0.036080848425626755, 0.02623875066637993, 0.01749592460691929, -0.010920826345682144, 0.04111490771174431, 0.02765650488436222, -0.022827917709946632, -0.05366923660039902, 0.02062937058508396, -0.04031356796622276, 0.020331434905529022, -0.009051033295691013, 0.0370054729282856, 0.033882301300764084, 0.00027594223502092063, -0.0034082636702805758, -0.01210229005664587, -0.0015538805164396763, 0.073271244764328, 0.022211503237485886, 0.0014845338882878423, 0.034950755536556244, -0.009287325665354729, 0.05436784029006958, -0.04475175961852074, -0.020773200318217278, 0.008162368088960648, 0.037560246884822845, -0.0256428811699152, -0.02580725960433483, 0.050176214426755905, -0.016581574454903603, 0.06546331942081451, 0.02225259691476822, 0.02480044774711132, 0.028478393331170082, 0.0678057000041008, -0.07195622473955154, 0.028046902269124985, -0.058970410376787186, -0.08153121173381805, -0.11514640599489212, -0.0006613623700104654, -0.05280625447630882, 0.051244668662548065, 0.006641876418143511, 0.0009663596283644438, -0.00939519889652729, 0.020865662023425102, -0.010776996612548828 ]
717,029
pytorch_optimizer.optimizer.lion
__init__
null
def __init__( self, params: PARAMETERS, lr: float = 1e-4, betas: BETAS = (0.9, 0.99), weight_decay: float = 0.0, weight_decouple: bool = True, fixed_decay: bool = False, use_gc: bool = False, r: float = 0.95, adanorm: bool = False, ): self.validate_learning_rate(lr) self.validate_betas(betas) self.validate_non_negative(weight_decay, 'weight_decay') self.use_gc = use_gc defaults: DEFAULTS = { 'lr': lr, 'betas': betas, 'weight_decay': weight_decay, 'weight_decouple': weight_decouple, 'fixed_decay': fixed_decay, 'adanorm': adanorm, } if adanorm: defaults.update({'r': r}) super().__init__(params, defaults)
(self, params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], lr: float = 0.0001, betas: Union[Tuple[float, float], Tuple[float, float, float]] = (0.9, 0.99), weight_decay: float = 0.0, weight_decouple: bool = True, fixed_decay: bool = False, use_gc: bool = False, r: float = 0.95, adanorm: bool = False)
[ -0.005328772123903036, -0.04157104343175888, -0.025967717170715332, 0.00868112314492464, -0.025532715022563934, -0.015139954164624214, -0.08979950100183487, -0.035707972943782806, -0.04962803050875664, 0.017201485112309456, -0.01982095092535019, 0.06366156786680222, 0.012908205389976501, 0.0815533846616745, -0.05931155011057854, 0.04228974133729935, 0.01852540299296379, 0.02812381274998188, -0.013021684251725674, -0.015726260840892792, -0.006926930975168943, -0.0015922484453767538, -0.0421762615442276, 0.11128480732440948, 0.0131257064640522, 0.033060137182474136, -0.007569977082312107, 0.006529755424708128, -0.04047407954931259, 0.023074008524417877, 0.01949942857027054, -0.023395532742142677, -0.010969610884785652, 0.059765465557575226, 0.02420879527926445, -0.023811619728803635, -0.00894117821007967, 0.02375488169491291, -0.0884377583861351, 0.02655402384698391, 0.059462856501340866, -0.026799893006682396, 0.08094815909862518, -0.0469045415520668, -0.03372209519147873, -0.021920308470726013, 0.03143360838294029, 0.03565123677253723, -0.004253088496625423, -0.036653630435466766, 0.04686671495437622, -0.0293720792979002, 0.02935316599905491, -0.008638568222522736, -0.04278148338198662, 0.040247123688459396, 0.03307905048131943, 0.07852727919816971, 0.034573186188936234, 0.0010945969261229038, 0.012123310938477516, -0.04342452809214592, 0.007792206481099129, -0.01281363982707262, 0.007858402095735073, 0.006917474325746298, -0.0899508073925972, -0.013097336515784264, 0.028502075001597404, 0.027877941727638245, 0.10076911747455597, -0.0000413355155615136, -0.009508572518825531, 0.023376619443297386, -0.022695746272802353, -0.002015429548919201, -0.08352034538984299, -0.04735845699906349, -0.04565627500414848, -0.009153950959444046, 0.0546589232981205, 0.03812885284423828, -0.013258098624646664, -0.05307022109627724, 0.012293529696762562, -0.05965198576450348, -0.042743656784296036, -0.06301852315664291, 0.01437397301197052, 0.007366660982370377, -0.060711123049259186, -0.034005794674158096, 0.01646387204527855, -0.0145252775400877, 0.06604462116956711, 0.007877315394580364, 0.028861423954367638, -0.048379767686128616, 0.026762068271636963, -0.0007009675609879196, -0.027291635051369667, -0.006676332093775272, -0.04853107035160065, 0.0029669960495084524, 0.011565374210476875, -0.025797497481107712, -0.05715545639395714, -0.03686167299747467, 0.043840616941452026, -0.06093807891011238, -0.03682385012507439, 0.060068074613809586, -0.013589078560471535, 0.04353800788521767, -0.06861680746078491, 0.020728781819343567, 0.002586369402706623, 0.006335895974189043, -0.0012317170621827245, 0.03029882162809372, 0.05049803480505943, 0.026194673031568527, -0.028502075001597404, 0.03219013288617134, 0.04558062553405762, 0.0039055596571415663, 0.0008014435297809541, 0.009224874898791313, 0.00620350381359458, -0.012359725311398506, 0.03699406608939171, -0.013352664187550545, -0.023679228499531746, -0.028691206127405167, 0.028483161702752113, -0.013693100772798061, 0.011139828711748123, 0.05110325664281845, -0.02872903272509575, 0.0160288717597723, 0.06812506169080734, 0.022412048652768135, 0.04917411878705025, -0.026780981570482254, -0.0017045451095327735, 0.015196693129837513, -0.009948302060365677, -0.019168449565768242, -0.01985877752304077, 0.029731428250670433, 0.03236035257577896, 0.01326755527406931, -0.006629049312323332, 0.04981716349720955, 0.00343745993450284, -0.03264404833316803, 0.014175385236740112, -0.01685159094631672, -0.018950948491692543, 0.017504094168543816, -0.02470053732395172, 0.01934812404215336, 0.016085609793663025, -0.0443323589861393, 0.006383178755640984, 0.010733196511864662, -0.027253808453679085, -0.00020257727010175586, -0.0052625760436058044, -0.007541607599705458, -0.005962361581623554, -0.09872649610042572, -0.037107545882463455, 0.022128352895379066, -0.02437901496887207, 0.06525027006864548, 0.011253307573497295, -0.008458893746137619, -0.015035931952297688, -0.01897931843996048, 0.07890554517507553, -0.014998105354607105, -0.007943511009216309, -0.08193164318799973, 0.029277512803673744, 0.0058441548608243465, -0.023698141798377037, 0.04372713714838028, -0.03217121958732605, 0.0352918840944767, 0.05965198576450348, 0.013910600915551186, 0.014903539791703224, 0.009205962531268597, -0.012756900861859322, 0.011934179812669754, 0.03714537248015404, -0.03236035257577896, 0.0024610699620097876, 0.06827636808156967, 0.06888159364461899, 0.03604841232299805, 0.007801662664860487, -0.022260744124650955, 0.023868359625339508, 0.005711762700229883, -0.018260618671774864, 0.0023464092519134283, -0.005811056587845087, -0.026516197249293327, -0.0016182539984583855, -0.024738363921642303, 0.05341065675020218, 0.02500314638018608, -0.009967215359210968, -0.03580253943800926, -0.012728530913591385, 0.03723993897438049, 0.021352915093302727, 0.008506176993250847, 0.10258477181196213, -0.01635039411485195, -0.016218002885580063, -0.009938845410943031, 0.04463496804237366, 0.0105440653860569, 0.020426170900464058, -0.04565627500414848, -0.07867858558893204, 0.015489846467971802, -0.01880910061299801, -0.044899750500917435, -0.026818806305527687, -0.005238934885710478, 0.03222795948386192, -0.007007311563938856, -0.0172109417617321, 0.04902281239628792, -0.09327951818704605, -0.03839363902807236, 0.047585416585206985, 0.04977933689951897, 0.00022533211449626833, -0.023660315200686455, 0.010269825346767902, -0.0013463778886944056, 0.0322846993803978, 0.01983986422419548, -0.07126464694738388, -0.04728280380368233, -0.03652123734354973, -0.02173117734491825, -0.0019114073365926743, 0.050384558737277985, -0.05549110099673271, 0.00801443587988615, 0.04879585653543472, -0.001164339017122984, 0.017551377415657043, -0.0056692082434892654, -0.0006460013100877404, 0.008208295330405235, -0.021958135068416595, 0.06763332337141037, 0.016038326546549797, 0.02044508419930935, 0.0026218316052109003, -0.014099732041358948, 0.025835324078798294, -0.0049363248981535435, 0.11438655853271484, 0.04372713714838028, -0.007744923233985901, 0.004461132455617189, -0.014251037500798702, -0.021428566426038742, 0.0030733824241906404, -0.028861423954367638, -0.015953218564391136, 0.05220021679997444, 0.025873150676488876, -0.03918799012899399, 0.016879960894584656, 0.01896040514111519, -0.005574642680585384, 0.0011318321339786053, -0.02279031276702881, 0.015726260840892792, -0.00384882022626698, 0.0174284428358078, 0.008161012083292007, 0.006411548238247633, 0.07330726087093353, 0.031660567969083786, 0.10046650469303131, -0.025986630469560623, 0.04785019904375076, -0.012123310938477516, 0.056323278695344925, -0.004941053222864866, 0.04297061264514923, -0.03031773492693901, 0.06612027436494827, 0.001813295530155301, -0.03971755504608154, -0.04493757709860802, 0.051292385905981064, 0.004532056860625744, 0.02330096624791622, 0.057079803198575974, 0.03625645488500595, 0.03402470797300339, 0.05344848334789276, 0.025381410494446754, 0.03453535959124565, -0.07330726087093353, 0.00005348867489374243, -0.057722847908735275, 0.026837719604372978, 0.03831798583269119, -0.015631696209311485, 0.016000501811504364, 0.004151430446654558, -0.02313074842095375, -0.058214589953422546, -0.05605849251151085, 0.026440544053912163, 0.023527923971414566, -0.037410154938697815, -0.005848883185535669, -0.03623754158616066, -0.010477869771420956, 0.004945781547576189, -0.028653379529714584, -0.053032394498586655, 0.0012039383873343468, 0.008354871533811092, 0.04962803050875664, -0.0013948427513241768, -0.020426170900464058, 0.08238556236028671, -0.011678853072226048, -0.015489846467971802, 0.06264025717973709, -0.02313074842095375, -0.03447861969470978, 0.02018030174076557, -0.01970747299492359, 0.041154954582452774, -0.01637876406311989, -0.01225570309907198, 0.005886709317564964, -0.005697578191757202, 0.09774301201105118, 0.02513553947210312, -0.015981588512659073, -0.02470053732395172, 0.027140330523252487, 0.029315339401364326, -0.04682888835668564, -0.03137686848640442, -0.0033901771530508995, -0.04206278175115585, 0.05144369229674339, 0.013352664187550545, 0.0010213085915893316, -0.013853861950337887, -0.026932286098599434, 0.02704576402902603, 0.0009633871377445757, 0.027783377096056938, -0.0768251046538353, -0.01141406875103712, 0.0020036089699715376, 0.026818806305527687, -0.005735404323786497, -0.04168451949954033, 0.0019929702393710613, 0.057571541517972946, -0.00441621383652091, -0.0033334377221763134, 0.014553647488355637, 0.05889546126127243, 0.019073883071541786, 0.004595888778567314, -0.027234895154833794, -0.0045178718864917755, 0.016993440687656403, 0.05511283874511719, -0.011565374210476875, -0.006955300457775593, -0.00648720096796751, 0.01921573281288147, -0.020728781819343567, -0.08140207827091217, 0.0363699346780777, 0.03290883079171181, 0.046639759093523026, -0.0490606389939785, -0.036804936826229095, -0.006260243244469166, -0.035556670278310776, -0.005480077117681503, 0.021012479439377785, -0.021674437448382378, 0.0036194988060742617, 0.0159248486161232, 0.05049803480505943, 0.006137308198958635, 0.06676331907510757, -0.016775939613580704, -0.005059259943664074, -0.02876685932278633, 0.005626653786748648, -0.05201108381152153, -0.04077669233083725, 0.018705077469348907, -0.01751355081796646, 0.024114230647683144, -0.003943386022001505, 0.02687554620206356, 0.019650733098387718, 0.05307022109627724, 0.03107425943017006, 0.06816288828849792, 0.05934937670826912, -0.014298319816589355, 0.011026349849998951, 0.0022423870395869017, -0.049136292189359665, -0.04573192819952965, -0.0075226943008601665, -0.040057990700006485, -0.0363699346780777, 0.02470053732395172, 0.015017018653452396, -0.0026738427113741636, 0.012823096476495266, 0.009882106445729733, -0.015470934100449085, 0.015527673065662384, -0.06396418064832687, 0.003404361894354224, -0.04622367024421692, -0.06797376275062561, -0.025078799575567245, 0.011953093111515045, -0.003480014391243458, -0.032095566391944885, -0.029750341549515724, 0.02922077290713787, 0.02231748402118683, 0.0406632125377655, -0.0013712013605982065, -0.029239686205983162, -0.023962926119565964, -0.00835014320909977, -0.030658170580863953, 0.03922581672668457, -0.014241580851376057, 0.04138191044330597, -0.017154201865196228, -0.017636485397815704, 0.00458879629150033, -0.0462614968419075, 0.04096582159399986, 0.0761820524930954, -0.025684019550681114, -0.01500756200402975, 0.0015059573343023658, 0.004522600211203098, 0.004796840716153383, 0.03793972358107567, -0.027613157406449318, -0.04418105259537697, 0.013872775249183178, -0.003047376871109009, -0.02231748402118683, -0.019726386293768883, -0.01639767736196518, 0.002607646631076932, -0.03599167242646217, 0.0014882262330502272, 0.07474465668201447, 0.018213337287306786, 0.0006424551247619092, -0.05087629705667496, 0.015234519727528095, 0.019310297444462776, 0.04924976825714111, -0.08382295817136765, -0.01374983973801136, 0.026780981570482254, 0.05061151459813118, -0.04573192819952965, -0.007399758789688349, 0.023509010672569275, 0.02184465527534485, 0.03697515279054642, 0.01626528427004814, 0.013154076412320137, -0.05549110099673271, -0.05235152319073677, -0.024473579600453377, 0.025400321930646896, -0.04603453725576401, -0.09191777557134628, -0.0009468381758779287, -0.027783377096056938, 0.011423525400459766, -0.026308152824640274, 0.0024374285712838173, -0.017835073173046112, 0.004657356068491936, -0.030979692935943604, -0.024738363921642303, -0.04550497233867645, 0.04576975479722023, -0.024152057245373726, -0.045088883489370346, 0.05095195025205612, 0.0649854838848114, 0.04232756793498993, -0.0324927419424057, 0.020690955221652985, 0.040549732744693756, 0.026327066123485565, -0.03608623519539833, 0.09343082457780838, 0.022676832973957062, 0.005333500448614359, -0.06366156786680222, -0.05999242141842842, 0.03483797237277031, 0.002801506081596017, 0.04206278175115585, 0.015347998589277267, -0.017920183017849922, -0.05450761690735817, -0.044786274433135986, 0.02470053732395172, 0.00984427984803915, 0.030204255133867264, -0.04141973704099655, -0.01227461639791727, -0.00009611707355361432, -0.013995709829032421, 0.042743656784296036, -0.03565123677253723, -0.027877941727638245, 0.022090526297688484, -0.026970112696290016, -0.04202495887875557, 0.03217121958732605, 0.024246621876955032, -0.020388346165418625, -0.0000189315924217226, -0.01833627186715603, 0.06385070085525513, 0.012785270810127258, -0.011820700950920582, -0.01320135872811079, -0.009815909899771214, 0.012832553125917912, -0.010345477610826492, 0.015716804191470146, 0.010099607519805431, -0.024908581748604774, -0.06248895451426506, 0.011328959837555885, -0.007484868168830872, 0.006699973251670599, 0.004011945798993111, 0.01039276085793972, -0.03831798583269119, 0.013929514214396477, -0.0030662899371236563, 0.025892063975334167, -0.041154954582452774, -0.031206650659441948, 0.0059718182310462, -0.03423275053501129, -0.10144998878240585, -0.08215860277414322, 0.016747569665312767, -0.00948965921998024, -0.0462614968419075, 0.024776190519332886, -0.0006329985335469246, 0.012009832076728344, -0.0023085828870534897, 0.03434623032808304, -0.026005541905760765, -0.03445970639586449, -0.04266800358891487, 0.01790126971900463, -0.02825620397925377, -0.01093178428709507, 0.0329277440905571, 0.060521990060806274, -0.07455552369356155, -0.021315088495612144, 0.018799643963575363, 0.016293654218316078, -0.013097336515784264, -0.010997980833053589, -0.021050304174423218, 0.048379767686128616, 0.02454923279583454, -0.04826628789305687, 0.002640744671225548, -0.026005541905760765, -0.0011838432401418686, -0.011518090963363647, -0.0025225377175956964, -0.06245112791657448, -0.05080064386129379, 0.030242081731557846, 0.0832933858036995, 0.007645629346370697, -0.000834541511721909, -0.02470053732395172, -0.016284197568893433, 0.04493757709860802, -0.08223425596952438, -0.012123310938477516, 0.016359850764274597, -0.12081702053546906, 0.006165677681565285, -0.019593995064496994, 0.03341948613524437, -0.03128230199217796, -0.007432857062667608, -0.04890933260321617, 0.011026349849998951, 0.024870755150914192, 0.02623249962925911, 0.03964190185070038, 0.03612406179308891, -0.0168894175440073, 0.03014751709997654, 0.049930643290281296, -0.014582017436623573, 0.00026448818971402943, -0.012681248597800732, -0.02640271745622158, -0.031641654670238495, -0.009622050449252129, 0.05136803910136223, 0.0415332168340683, -0.04221408814191818, 0.04720715060830116, -0.041797999292612076, -0.01116819866001606, -0.004056864883750677, 0.0010419947793707252, 0.020823346450924873, 0.03419492393732071, 0.051594994962215424, -0.023357706144452095, -0.02969360165297985, -0.015574956312775612, 0.04588323459029198, 0.007040409836918116, -0.009272158145904541, -0.005697578191757202, -0.03682385012507439, 0.0003297975636087358, -0.02814272604882717, -0.01530071534216404, -0.05140586569905281, -0.01837409846484661, -0.036180801689624786, 0.00483703101053834, 0.019140079617500305, 0.020672041922807693, -0.0593872033059597, -0.04656410589814186, 0.03046903945505619, -0.018601056188344955, 0.0456184484064579, 0.0518597811460495, 0.0068654632195830345, -0.0512167327105999, 0.01842138171195984, -0.010109063237905502, -0.06706593185663223, 0.046791065484285355, -0.009853736497461796, -0.03060143068432808, -0.06320765614509583, -0.011016893200576305, 0.02246878854930401, -0.009957758709788322, 0.02672424167394638, -0.03697515279054642, -0.06566636264324188, -0.06838984787464142, 0.019206276163458824, -0.01704072207212448, -0.013040597550570965, -0.009172864258289337, -0.05136803910136223, 0.054772403091192245, -0.038961030542850494, 0.029712514951825142, 0.017825618386268616, -0.002763679949566722, 0.015801914036273956, -0.05446979030966759, 0.037391241639852524, 0.058517199009656906, 0.03128230199217796, -0.05931155011057854, -0.017541920766234398, 0.0322846993803978, 0.033835574984550476, 0.003915016073733568, -0.04890933260321617, 0.009059385396540165, -0.035216234624385834, 0.004714095499366522, 0.0324927419424057, 0.006298069842159748, 0.025816410779953003, -0.07905685156583786, -0.02980707958340645, 0.01790126971900463, 0.025986630469560623, -0.03595384582877159, 0.04750976338982582, 0.01949942857027054, -0.026043368503451347, -0.013872775249183178, -0.005792143754661083, -0.025040972977876663, 0.04482409730553627, 0.002327496185898781, 0.06112721189856529, 0.07050812244415283, 0.003886646591126919, 0.03599167242646217, -0.046148017048835754, -0.017248766496777534, 0.0076787276193499565, 0.05416718125343323, -0.017144745215773582, -0.011858527548611164, 0.06354808807373047, -0.004640807397663593, 0.012397551909089088, -0.019802039489150047, 0.019953344017267227, 0.04520236328244209, 0.04671541228890419, -0.0385260283946991, 0.013721469789743423, -0.024946408346295357, -0.07028116285800934, -0.0966082289814949, -0.0027684082742780447, -0.06551505625247955, 0.04887150600552559, 0.01953725516796112, 0.024719450622797012, 0.009834823198616505, 0.04123060777783394, 0.0031277574598789215 ]
717,032
pytorch_optimizer.optimizer.lion
__str__
null
def __str__(self) -> str: return 'Lion'
(self) -> str
[ 0.009730728343129158, -0.03165065497159958, 0.016874045133590698, -0.03771946579217911, 0.01851589046418667, -0.062029093503952026, 0.008196333423256874, 0.03417789191007614, 0.08644187450408936, -0.05463648959994316, -0.03713493421673775, 0.0015848965849727392, 0.007263661827892065, 0.03600025549530983, 0.017235079780220985, -0.0023488705046474934, 0.0197881069034338, -0.06257923692464828, -0.019478648900985718, 0.013641930185258389, 0.017260868102312088, 0.04294586181640625, 0.04353039339184761, -0.03299163654446602, -0.022332536056637764, 0.06959361582994461, -0.012051661498844624, -0.009919840842485428, -0.02102593705058098, 0.001339909271337092, -0.033627744764089584, -0.0482754148542881, 0.015154835768043995, -0.007598907686769962, -0.030447207391262054, 0.030361246317625046, -0.03792577236890793, 0.024567509070038795, 0.009232156910002232, 0.0008203854667954147, -0.015851115807890892, 0.010719274170696735, -0.04844733700156212, -0.021593276411294937, -0.06034426763653755, -0.0356907993555069, -0.0033868434838950634, 0.06006919592618942, -0.007216383703052998, 0.0026690734084695578, -0.012120429426431656, 0.00143016770016402, -0.0540519580245018, -0.020028796046972275, -0.03426385298371315, 0.021662045270204544, 0.04497453197836876, -0.014114713296294212, 0.011475726030766964, 0.03675670921802521, -0.011767991818487644, 0.004304471891373396, 0.05570239946246147, -0.039335522800683975, -0.006451335269957781, 0.009765111841261387, 0.008914103731513023, 0.03201168775558472, 0.04528398811817169, 0.04205187410116196, 0.04861925542354584, -0.029553217813372612, 0.0115874744951725, 0.024756623432040215, 0.00007877473399275914, -0.04181118309497833, -0.10727869719266891, -0.005342444870620966, 0.05298604816198349, -0.03424666076898575, 0.01332387700676918, 0.008785163052380085, -0.006692024413496256, 0.003601744771003723, -0.050132159143686295, -0.07633291929960251, -0.04225818067789078, -0.061341408640146255, -0.03244148939847946, 0.015275180339813232, -0.059106435626745224, 0.020131947472691536, -0.036928627640008926, 0.04225818067789078, -0.057971756905317307, 0.007934154011309147, 0.02663056179881096, -0.07482001185417175, 0.018481506034731865, 0.022831108421087265, 0.010831022635102272, 0.05917520448565483, -0.031805384904146194, 0.014510131441056728, -0.06013796105980873, -0.024068938568234444, -0.050338465720415115, 0.04380546882748604, -0.01022929884493351, 0.010573141276836395, -0.05288289859890938, 0.028745189309120178, 0.008682009764015675, 0.027765240520238876, 0.024619085714221, -0.04009197652339935, -0.026699330657720566, -0.022934259846806526, 0.031891342252492905, -0.026510216295719147, 0.01511185523122549, -0.030481591820716858, -0.04187995195388794, -0.02945006638765335, 0.04122665524482727, 0.09483161568641663, -0.04837856814265251, -0.02761051058769226, 0.034212276339530945, -0.046659357845783234, 0.03433262184262276, -0.004244299605488777, -0.05828121677041054, -0.013994368724524975, 0.0801839530467987, 0.004689144901931286, 0.009550211019814014, 0.008699201978743076, 0.035965871065855026, 0.11456815153360367, -0.02112909033894539, 0.0057894391939044, 0.05126683786511421, 0.053708117455244064, -0.014106117188930511, 0.012928458862006664, -0.023140564560890198, 0.04662497341632843, 0.002660477301105857, 0.012859690003097057, 0.03388562798500061, 0.024240858852863312, 0.027644895017147064, 0.01631530188024044, -0.010040185414254665, 0.042430099099874496, -0.006047321017831564, -0.06481420993804932, 0.03524380177259445, -0.022040270268917084, 0.0016708570765331388, -0.05649323761463165, -0.015292372554540634, 0.009696343913674355, -0.010573141276836395, 0.04652182012796402, -0.011707819066941738, 0.01008316595107317, 0.03134119510650635, -0.0022865491919219494, -0.03202887997031212, -0.03600025549530983, -0.06673973053693771, 0.023295294493436813, 0.0511636883020401, 0.04408054053783417, -0.009988609701395035, 0.06725548952817917, 0.023329678922891617, 0.0023746585939079523, -0.012765133753418922, -0.03902606666088104, -0.03397158905863762, -0.011406958103179932, 0.05848751962184906, -0.035381339490413666, 0.016848256811499596, 0.05473964288830757, 0.050819844007492065, 0.010925578884780407, 0.005681988783180714, 0.005583134014159441, -0.04934132471680641, 0.01794855110347271, -0.0018545977072790265, -0.025117656216025352, -0.004706337116658688, -0.036240946501493454, 0.013151955790817738, -0.015670597553253174, -0.01144134160131216, 0.08183439075946808, -0.03232114762067795, 0.012619000859558582, 0.05577116832137108, 0.013977176509797573, 0.01390840858221054, -0.00120129797141999, 0.014002964831888676, -0.04095157980918884, 0.03251025825738907, 0.027558933943510056, -0.006670534610748291, 0.003674811217933893, 0.04806910827755928, -0.06209786236286163, -0.0048696622252464294, -0.04304901510477066, -0.046384282410144806, -0.0014785205712541938, 0.0733758807182312, -0.0035566154401749372, 0.0048309797421097755, -0.016942813992500305, -0.03495153784751892, 0.003934841603040695, 0.004491435829550028, -0.03524380177259445, 0.005192013923078775, -0.003060193732380867, -0.00893129501491785, -0.06326692551374435, -0.0192895345389843, 0.02664775401353836, 0.0055788359604775906, 0.03275094926357269, -0.043771084398031235, -0.004637568723410368, -0.09483161568641663, -0.04593728855252266, -0.025719380006194115, 0.016349686309695244, -0.015550253912806511, -0.018670620396733284, 0.024773815646767616, -0.037410005927085876, -0.016960006207227707, 0.04287709668278694, -0.04298024624586105, 0.0012163410428911448, 0.053226739168167114, -0.035862717777490616, -0.00930952187627554, -0.004050888121128082, -0.0020834675524383783, -0.04074527323246002, -0.06629273295402527, -0.004381836391985416, 0.023484406992793083, -0.0035695096012204885, -0.06099756807088852, 0.01805170439183712, -0.01038402784615755, 0.0463155135512352, -0.028263811022043228, 0.0038660732097923756, -0.05511786788702011, 0.0366535559296608, 0.02683686651289463, -0.02133539505302906, 0.098476342856884, 0.02403455413877964, -0.05645885318517685, 0.03275094926357269, -0.035278186202049255, -0.031203659251332283, -0.018395546823740005, 0.033455826342105865, -0.08437882363796234, -0.04466507211327553, -0.0027915670070797205, -0.03582833334803581, -0.010435604490339756, 0.008896911516785622, -0.009696343913674355, -0.0530892014503479, 0.0385790690779686, 0.0231577567756176, 0.03147873282432556, 0.0231577567756176, 0.06436721980571747, 0.008871123194694519, -0.013985772617161274, 0.029776714742183685, 0.04844733700156212, 0.023690711706876755, 0.004543012008070946, 0.05460210517048836, -0.02829819545149803, -0.0299314446747303, 0.009335310198366642, -0.03447015956044197, -0.02093997597694397, -0.03988566994667053, -0.012077449820935726, -0.009094620123505592, 0.0066361501812934875, -0.021851157769560814, 0.007646186277270317, -0.0027636298909783363, -0.0027292456943541765, 0.009343906305730343, 0.03484838455915451, 0.0858917236328125, 0.010702081955969334, 0.07860227674245834, -0.01677948795258999, 0.005522961728274822, 0.04524960368871689, 0.05532417446374893, -0.009730728343129158, 0.0026776695158332586, -0.05783422291278839, 0.002462768228724599, 0.01563621498644352, -0.047622114419937134, -0.049650780856609344, 0.0742698684334755, 0.004650462884455919, 0.04091719537973404, -0.017811015248298645, -0.040298279374837875, 0.028435731306672096, -0.010745061561465263, -0.025702187791466713, 0.007848192937672138, 0.02296864427626133, 0.02190273441374302, -0.0040831235237419605, -0.0482410304248333, 0.07674553245306015, 0.01066769752651453, -0.02981109917163849, 0.02210903912782669, 0.05185136944055557, 0.045902904123067856, -0.027283860370516777, 0.011853951960802078, 0.03679109364748001, -0.004736423492431641, -0.01592847891151905, -0.026183566078543663, 0.010693485848605633, -0.018601851537823677, -0.006292308215051889, 0.021455740556120872, -0.015025894157588482, 0.03871660679578781, -0.025994453579187393, -0.017252271994948387, -0.02008037082850933, -0.06333569437265396, -0.0019362601451575756, 0.042326949536800385, -0.012464271858334541, 0.005075967404991388, 0.01668493263423443, -0.00031026365468278527, 0.04301463067531586, -0.03844153508543968, -0.015945671126246452, 0.004414071328938007, -0.037788234651088715, -0.007667676080018282, -0.0012990779941901565, 0.05817806348204613, 0.05075107514858246, 0.03204607218503952, -0.03012055717408657, -0.040882810950279236, 0.045696597546339035, 0.005441299173980951, 0.01805170439183712, 0.0347624234855175, 0.0027915670070797205, -0.004287279676645994, 0.0154385045170784, 0.02403455413877964, -0.00296778604388237, -0.011037327349185944, -0.020097563043236732, -0.0328369103372097, -0.006502911448478699, -0.0030924289021641016, -0.0453871414065361, -0.0626823902130127, -0.02740420587360859, -0.05047600343823433, -0.07103775441646576, 0.045421525835990906, 0.03727247193455696, -0.008200631476938725, -0.027919968590140343, -0.0003693615144584328, -0.03785700350999832, 0.06213224679231644, 0.0021844711154699326, 0.018086088821291924, -0.05831560119986534, -0.028023121878504753, 0.004388283472508192, -0.021386971697211266, -0.06543312966823578, -0.05566801503300667, 0.08080286532640457, 0.013547373935580254, -0.012438483536243439, -0.007250767666846514, 0.002649732166901231, -0.0007274406962096691, -0.05143876001238823, 0.02382824942469597, 0.0530892014503479, 0.08836738765239716, -0.00161068479064852, 0.0530892014503479, 0.04459630325436592, 0.03950744494795799, 0.0849289670586586, -0.01968495361506939, -0.06199470907449722, 0.00038816535379737616, -0.03459050506353378, -0.02587410993874073, 0.024344012141227722, -0.0675649493932724, 0.00873788446187973, -0.059794120490550995, -0.0366879403591156, 0.04383985325694084, 0.009670555591583252, -0.012197794392704964, 0.012490060180425644, 0.048997484147548676, 0.010392623953521252, -0.023192141205072403, -0.05357057973742485, 0.006399759091436863, 0.05528979003429413, -0.0038768183439970016, -0.024189284071326256, 0.04095157980918884, 0.006765090860426426, -0.03030967153608799, 0.07660799473524094, -0.0337824746966362, -0.022229384630918503, -0.04507768526673317, 0.018670620396733284, -0.0035243802703917027, -0.06732425838708878, 0.05769668519496918, -0.0030709386337548494, 0.022246576845645905, 0.02345002256333828, -0.011630455031991005, -0.016358282417058945, 0.03514065220952034, -0.05914082005620003, -0.01350439339876175, 0.027146324515342712, -0.01336685661226511, 0.006722110789269209, -0.03823522850871086, 0.0006860722205601633, 0.04555906355381012, -0.02664775401353836, -0.014054540544748306, 0.05143876001238823, -0.04958201199769974, -0.04311778396368027, -0.0356907993555069, -0.02924375981092453, 0.05143876001238823, -0.03407473862171173, 0.039129216223955154, -0.008290889672935009, 0.021404163911938667, -0.008544472977519035, 0.006941310130059719, 0.01409752108156681, 0.02530677057802677, -0.06343884766101837, -0.05202329158782959, -0.033627744764089584, 0.05659639090299606, -0.04518083482980728, -0.005707777105271816, -0.09001783281564713, 0.019478648900985718, 0.01603163219988346, 0.003030107356607914, 0.010366835631430149, -0.012257966212928295, 0.041364189237356186, -0.026475831866264343, 0.015197815373539925, -0.010899790562689304, -0.03820084407925606, -0.04325532168149948, 0.015558850020170212, -0.04604044184088707, 0.0713815987110138, -0.008363956585526466, 0.010934174992144108, -0.019633376970887184, -0.004573098383843899, 0.04789718985557556, 0.04813787713646889, 0.026510216295719147, 0.006378268823027611, -0.04837856814265251, -0.022452881559729576, -0.026286719366908073, -0.006060214713215828, 0.010280875489115715, -0.0052221002988517284, 0.0308770090341568, -0.019650569185614586, 0.08706078678369522, 0.001799797872081399, 0.041467342525720596, 0.00390905374661088, 0.03491715341806412, -0.011372573673725128, 0.08369113504886627, -0.07399479299783707, 0.01622074469923973, 0.06426406651735306, 0.034504543989896774, 0.0035050392616540194, -0.05398319289088249, 0.024189284071326256, -0.009515826590359211, 0.02124943397939205, -0.026510216295719147, -0.01697719842195511, 0.006756494753062725, 0.023965785279870033, 0.016272321343421936, -0.02326091006398201, -0.023415638133883476, -0.04022951051592827, -0.054498955607414246, -0.004964218474924564, 0.016186362132430077, -0.004143295809626579, 0.0012571722036227584, 0.040401432663202286, 0.03782261908054352, -0.027472974732518196, 0.012619000859558582, 0.05673392862081528, 0.019650569185614586, 0.055839937180280685, 0.0588657483458519, -0.04875679314136505, 0.024859774857759476, 0.01423505786806345, -0.0627511590719223, 0.026475831866264343, -0.03165065497159958, 0.04353039339184761, 0.05326112359762192, -0.07206927984952927, 0.0694560781121254, 0.04978831857442856, 0.05009777843952179, -0.03349021077156067, 0.007199191488325596, -0.03447015956044197, 0.04813787713646889, -0.005032986868172884, -0.02800592966377735, -0.022917067632079124, -0.017553133890032768, -0.03484838455915451, -0.0051404377445578575, 0.01259321253746748, -0.050544772297143936, -0.015902692452073097, 0.023690711706876755, -0.027490166947245598, -0.009851072914898396, 0.07124406099319458, -0.0743386372923851, -0.024584701284766197, -0.032303955405950546, 0.020613327622413635, -0.0012646937975659966, 0.028521692380309105, 0.02508327178657055, -0.003427674761041999, 0.029295336455106735, 0.05724969133734703, 0.05879697948694229, 0.011484322138130665, 0.011131884530186653, -0.027043171226978302, 0.025891300290822983, -0.01910042203962803, -0.0038832654245197773, -0.010040185414254665, -0.05494594946503639, -0.015619021840393543, -0.01404594536870718, 0.053433045744895935, -0.014166289940476418, -0.024395588785409927, -0.02047578990459442, 0.019667761400341988, 0.07365095615386963, -0.028332579880952835, 0.026303911581635475, -0.04421807825565338, -0.01939268782734871, -0.003489996073767543, -0.025994453579187393, 0.030378438532352448, -0.09565684199333191, 0.029965829104185104, -0.027455782517790794, -0.013710699044167995, -0.07062514126300812, -0.04191433638334274, 0.01361614279448986, 0.031891342252492905, 0.03751315921545029, -0.013427029363811016, 0.0356907993555069, -0.02539272978901863, -0.013624738901853561, -0.03988566994667053, 0.05281412973999977, -0.04875679314136505, -0.0008295187726616859, -0.06409214437007904, -0.024275243282318115, 0.006133281160145998, -0.05938151106238365, -0.009008659981191158, 0.018120473250746727, -0.005054477136582136, 0.05181698501110077, -0.01622934080660343, -0.04273955896496773, 0.008363956585526466, -0.0009831731440499425, -0.017424192279577255, -0.02896868623793125, 0.006425546947866678, -0.026131991297006607, -0.0030687896069139242, -0.014682052657008171, 0.0830034539103508, 0.01872219517827034, -0.010547352954745293, -0.03204607218503952, -0.032768141478300095, -0.013573162257671356, 0.005673392675817013, 0.013341069221496582, 0.005613220389932394, -0.05924397334456444, -0.004577396437525749, -0.01023789495229721, 0.011656243354082108, 0.035175032913684845, 0.075301393866539, -0.03706616535782814, 0.01698579452931881, -0.029278144240379333, -0.00960178766399622, -0.061341408640146255, 0.03232114762067795, 0.069524846971035, -0.059519048780202866, 0.014260846190154552, 0.04741580784320831, -0.058349985629320145, -0.07193174213171005, -0.0015397673705592752, -0.04806910827755928, 0.04084842652082443, 0.07096898555755615, 0.036447249352931976, -0.018653428182005882, -0.06254485994577408, -0.02759331837296486, -0.00586680369451642, 0.047828420996665955, 0.0386134535074234, -0.011458533816039562, -0.03261341154575348, -0.0013667718740180135, -0.03436700627207756, -0.007543033454567194, -0.016366878524422646, 0.02432681992650032, -0.01968495361506939, 0.06199470907449722, 0.059587813913822174, -0.04968516528606415, -0.005123245529830456, 0.023415638133883476, -0.07997764647006989, 0.01882534846663475, 0.03051597625017166, -0.024292435497045517, 0.02430962771177292, 0.017931358888745308, -0.03610340878367424, 0.008553069084882736, 0.004899748135358095, 0.0646422952413559, 0.05088861286640167, -0.015558850020170212, -0.03833838179707527, -0.06302623450756073, 0.007624696008861065, 0.01765628531575203, 0.03400597348809242, -0.025616226717829704, 0.020630517974495888, 0.030636319890618324, 0.006631852127611637, 0.028263811022043228, 0.018292393535375595, 0.08169685304164886, 0.00016050436533987522, 0.007783723063766956, 0.028710804879665375, -0.0021135536953806877, -0.04449315369129181, 0.012214986607432365, 0.023965785279870033, 0.033266711980104446, 0.012558828108012676, -0.03051597625017166, 0.061238255351781845, 0.044561922550201416, 0.04837856814265251, -0.007899769581854343, 0.0016869747778400779, 0.006107493303716183, -0.013590354472398758, 0.02064771018922329, 0.02401736192405224, -0.002535834675654769, -0.0015096812276169658, -0.012636193074285984, -0.016813872382044792, 0.03782261908054352, -0.0058882939629256725, -0.00644703721627593, 0.043186552822589874, 0.005037284921854734, 0.01390840858221054 ]
717,053
pytorch_optimizer.optimizer.lion
reset
null
@torch.no_grad() def step(self, closure: CLOSURE = None) -> LOSS: loss: LOSS = None if closure is not None: with torch.enable_grad(): loss = closure() for group in self.param_groups: beta1, beta2 = group['betas'] for p in group['params']: if p.grad is None: continue grad = p.grad if grad.is_sparse: raise NoSparseGradientError(str(self)) state = self.state[p] if len(state) == 0: state['exp_avg'] = torch.zeros_like(p) if group['adanorm']: state['exp_grad_norm'] = torch.zeros((1,), dtype=grad.dtype, device=grad.device) if self.use_gc: centralize_gradient(grad, gc_conv_only=False) self.apply_weight_decay( p=p, grad=p.grad, lr=group['lr'], weight_decay=group['weight_decay'], weight_decouple=group['weight_decouple'], fixed_decay=group['fixed_decay'], ) s_grad = self.get_adanorm_gradient( grad=grad, adanorm=group['adanorm'], exp_grad_norm=state.get('exp_grad_norm', None), r=group.get('r', None), ) exp_avg = state['exp_avg'] update = exp_avg.clone() update.mul_(beta1).add_(grad, alpha=1.0 - beta1).sign_() exp_avg.mul_(beta2).add_(s_grad, alpha=1.0 - beta2) p.add_(update, alpha=-group['lr']) return loss
(self)
[ -0.0032027156557887793, -0.02179097943007946, -0.03549696505069733, 0.06564243882894516, -0.008027242496609688, -0.0073198056779801846, -0.024562977254390717, -0.0497034527361393, -0.013301737606525421, 0.011915738694369793, -0.03470771759748459, -0.0008097023237496614, 0.01731535792350769, 0.07884792238473892, -0.02042423002421856, 0.0352659672498703, -0.003190684365108609, 0.053938448429107666, 0.020135480910539627, -0.013455737382173538, -0.027354223653674126, -0.07380443066358566, -0.024890225380659103, 0.039269961416721344, -0.05209045112133026, -0.019240356981754303, 0.057903945446014404, -0.007642242591828108, -0.007416055537760258, 0.009716427884995937, -0.005977119319140911, -0.06048344075679779, 0.015351860783994198, 0.01641060970723629, 0.045891955494880676, -0.04015546292066574, -0.00978380348533392, 0.024986475706100464, -0.062331441789865494, -0.033398717641830444, -0.02015473134815693, -0.032859720289707184, -0.014360486529767513, 0.01437973603606224, 0.018672483041882515, 0.004810089245438576, -0.02288822829723358, 0.04104096069931984, 0.0011525925947353244, -0.02188722975552082, -0.002762372372671962, -0.02641097456216812, 0.056055948138237, -0.008907929062843323, 0.027777723968029022, 0.09624990820884705, 0.0632939413189888, -0.05767294391989708, 0.031435221433639526, -0.039462462067604065, 0.06075294315814972, -0.07184093445539474, 0.015332610346376896, -0.010366114787757397, 0.009225553832948208, -0.01978898048400879, -0.07603742927312851, -0.015265235677361488, 0.020000731572508812, 0.04319695755839348, 0.01998148113489151, 0.018778357654809952, 0.010038865730166435, -0.007993554696440697, -0.05440044775605202, -0.022657228633761406, -0.02631472423672676, -0.062061939388513565, 0.027816222980618477, -0.03501571714878082, -0.014033236540853977, 0.0018479982390999794, -0.042542457580566406, 0.021944979205727577, -0.018056482076644897, -0.04901045188307762, -0.01638173498213291, -0.05532444640994072, -0.02494797669351101, -0.010712615214288235, 0.031319718807935715, 0.01197348814457655, 0.016718609258532524, 0.030357221141457558, 0.050242453813552856, 0.040193960070610046, -0.040925461798906326, -0.020116230472922325, -0.03468846529722214, -0.034842465072870255, 0.02142523042857647, 0.024351226165890694, 0.02358122728765011, 0.043620459735393524, 0.05359194800257683, -0.04735495522618294, 0.0017060296377167106, -0.037306465208530426, 0.03769146278500557, -0.044967956840991974, -0.010462365113198757, -0.02477472648024559, -0.03786471486091614, -0.013503862544894218, -0.029433222487568855, -0.01873023249208927, -0.01383111160248518, 0.012685737572610378, -0.03767221421003342, 0.029818221926689148, 0.03418796882033348, -0.005577682051807642, -0.051859449595212936, 0.0006172025459818542, 0.005697994492948055, 0.04712395370006561, 0.049934450536966324, 0.014350861310958862, 0.020866980776190758, -0.05470844730734825, -0.012801237404346466, 0.013080362230539322, -0.010828115046024323, -0.014658860862255096, 0.020501229912042618, -0.017065107822418213, -0.003746527712792158, 0.007772180251777172, 0.00015505259216297418, -0.007719242479652166, 0.004133933689445257, 0.010327614843845367, -0.00958649069070816, 0.020231731235980988, 0.04573795571923256, 0.02296522818505764, 0.03907746449112892, 0.03803796321153641, -0.002870653523132205, 0.001337873749434948, 0.031242720782756805, 0.018354857340455055, 0.01636248454451561, 0.01851848140358925, -0.004078589845448732, 0.03193571791052818, -0.015621360391378403, 0.028143472969532013, -0.025005726143717766, -0.04935695230960846, -0.03199347108602524, -0.01501498557627201, -0.02810497395694256, 0.00013565221161115915, 0.02125198021531105, 0.007420867681503296, 0.01080886460840702, 0.051859449595212936, -0.039096713066101074, 0.010289114899933338, -0.002870653523132205, -0.04123346135020256, 0.05205195024609566, 0.030453471466898918, -0.03491946682333946, 0.13313287496566772, 0.0010274677770212293, 0.007314993068575859, -0.02822047285735607, 0.0007399211754091084, 0.00795986782759428, -0.01687260903418064, -0.023253977298736572, -0.045160457491874695, 0.011771364137530327, 0.015332610346376896, 0.004112277179956436, 0.0053707449696958065, 0.021482979878783226, -0.004160402342677116, -0.0043986206874251366, -0.0048413705080747604, 0.04150296002626419, -0.006559431087225676, -0.006670118775218725, 0.019336607307195663, 0.019673481583595276, 0.024736225605010986, 0.08169692009687424, 0.016526108607649803, -0.021309729665517807, -0.027508223429322243, 0.016323983669281006, 0.0018395764054730535, -0.03336021676659584, 0.0020717792212963104, -0.026603475213050842, 0.05994444340467453, -0.0040208399295806885, -0.002786434954032302, -0.05055045336484909, 0.01039499044418335, 0.03680596500635147, 0.07122493535280228, 0.04635395482182503, -0.07946392148733139, 0.0006923977634869516, 0.013080362230539322, 0.06002144142985344, 0.002047716872766614, -0.067875437438488, -0.06918443739414215, 0.04681595414876938, -0.01401398703455925, 0.05751894414424896, -0.022021979093551636, 0.015371110290288925, -0.04619995504617691, -0.02179097943007946, -0.0024411382619291544, -0.005048307590186596, -0.034033969044685364, 0.00853736698627472, -0.005895306821912527, 0.03961646184325218, 0.022483978420495987, -0.05713394656777382, -0.030665220692753792, -0.013648237101733685, -0.004052121192216873, -0.02225297875702381, -0.03568946570158005, -0.038480713963508606, 0.027508223429322243, -0.014639611355960369, 0.03961646184325218, 0.05778844654560089, 0.02585272490978241, -0.011626988649368286, 0.05370744690299034, -0.02017397992312908, -0.021020980551838875, -0.027893222868442535, 0.03336021676659584, -0.05570944771170616, -0.02648797444999218, 0.06260094046592712, 0.03176246955990791, 0.050665952265262604, -0.04754745587706566, 0.0352659672498703, -0.043004460632801056, -0.04889495298266411, 0.05235994979739189, -0.029163721948862076, 0.018181607127189636, 0.04412095621228218, -0.04188796132802963, 0.058096446096897125, 0.0479324534535408, 0.08647091686725616, 0.07857842743396759, -0.04115645959973335, -0.03636321425437927, 0.003693590173497796, 0.032416969537734985, 0.012262238189578056, 0.015457735396921635, 0.011559613980352879, -0.0329752191901207, 0.08970491588115692, -0.05316844955086708, -0.09686590731143951, -0.009273678995668888, -0.06221593916416168, 0.037826213985681534, -0.010520114563405514, -0.008513304404914379, 0.05913594365119934, 0.002379779005423188, 0.04088696092367172, 0.009345865808427334, 0.0958649069070816, -0.0035034967586398125, 0.06248544156551361, -0.0017204671166837215, -0.007738492451608181, 0.0055824946612119675, -0.02966422215104103, 0.018306732177734375, 0.08516191691160202, -0.024351226165890694, -0.0019177794456481934, -0.01275311317294836, -0.025121226906776428, -0.011761738918721676, 0.028624722734093666, 0.009620178490877151, 0.0026300286408513784, -0.016112234443426132, 0.005211932584643364, -0.007902117446064949, -0.0022053259890526533, 0.027777723968029022, -0.010366114787757397, -0.09594190865755081, 0.0003531168622430414, -0.06467993557453156, 0.02785472385585308, 0.05936694145202637, -0.019750481471419334, 0.014995736069977283, 0.03002997115254402, 0.03709471598267555, -0.03172396868467331, -0.006429493892937899, 0.06005994230508804, 0.03807646408677101, -0.025063475593924522, -0.018431857228279114, -0.07557542622089386, -0.013628986664116383, 0.054477449506521225, 0.030049221590161324, -0.04231145977973938, 0.0015724828699603677, 0.03778771311044693, -0.003231590613722801, 0.02406247705221176, -0.05674894526600838, 0.04820195212960243, 0.019692732021212578, -0.029086722061038017, 0.022098978981375694, 0.005895306821912527, -0.022310728207230568, 0.014581860974431038, 0.016930358484387398, 0.04816345497965813, 0.004598339553922415, -0.0049231830053031445, -0.009875240735709667, -0.010779989883303642, 0.05432344973087311, 0.03709471598267555, 0.03851921483874321, -0.00011580067075556144, -0.008571053855121136, 0.01501498557627201, -0.07288043200969696, 0.024428226053714752, 0.008224554359912872, -0.04392845928668976, 0.09170690923929214, 0.10471989959478378, 0.007223555818200111, -0.03153146803379059, -0.03644021600484848, 0.036382466554641724, -0.03397621586918831, 0.018720606341958046, -0.04011696204543114, 0.006265868898481131, 0.027257973328232765, -0.03370671719312668, -0.029875971376895905, -0.0343804657459259, -0.019500231370329857, 0.07646092772483826, 0.03996296226978302, 0.021540729328989983, -0.0443134568631649, -0.017786983400583267, 0.03130047023296356, 0.035227466374635696, -0.031223470345139503, 0.0207899808883667, -0.0605989433825016, 0.019827481359243393, -0.05778844654560089, 0.06621993333101273, 0.005226369947195053, -0.0009125694632530212, 0.015496235340833664, -0.04646945744752884, 0.029279222711920738, 0.039462462067604065, 0.01775810867547989, -0.03736421465873718, -0.025640975683927536, -0.025178976356983185, -0.013532737269997597, -0.005341869778931141, 0.018508857116103172, -0.01653573475778103, -0.07915592193603516, -0.013176612555980682, 0.04835595563054085, 0.027796972543001175, 0.062254440039396286, -0.003159403335303068, 0.011184239760041237, -0.05540144816040993, 0.0015219516353681684, 0.01795060746371746, -0.030799970030784607, -0.012550988234579563, -0.008931991644203663, 0.009913740679621696, 0.006809681188315153, 0.0542464479804039, 0.009138928726315498, 0.02993372082710266, 0.021771728992462158, -0.03588196635246277, -0.05821194499731064, -0.025159725919365883, -0.023850727826356888, -0.04131045937538147, 0.0006737493677064776, -0.04331246018409729, -0.05081995204091072, -0.026179974898695946, -0.012098613195121288, -0.030684471130371094, 0.01500536035746336, -0.012281488627195358, 0.04304295778274536, 0.04346645995974541, 0.022002728655934334, -0.012377738021314144, 0.024197226390242577, -0.012387363240122795, -0.019095981493592262, -0.012040863744914532, -0.02976047247648239, 0.047701455652713776, -0.033052217215299606, -0.09363190829753876, 0.02152147889137268, 0.0049857450649142265, 0.009552803821861744, 0.05921294167637825, 0.005115682724863291, 0.026353225111961365, 0.014408611692488194, -0.04673895612359047, -0.04739345610141754, -0.004432308487594128, 0.02386997640132904, 0.013628986664116383, 0.004624808207154274, -0.017892858013510704, 0.011732864193618298, -0.023350227624177933, -0.020193230360746384, 0.06852993369102478, 0.05043495073914528, -0.00569318188354373, 0.002702216152101755, -0.005837556906044483, -0.028181973844766617, 0.027354223653674126, -0.03110796958208084, -0.01012548990547657, -0.02487097680568695, -0.026507224887609482, 0.0032724968623369932, 0.045968957245349884, -0.050665952265262604, -0.01076073944568634, -0.044159457087516785, 0.027277223765850067, 0.031954970210790634, -0.012281488627195358, 0.04581495746970177, 0.015496235340833664, 0.009620178490877151, 0.038211215287446976, 0.07484392821788788, -0.051859449595212936, -0.06922293454408646, 0.06425643712282181, 0.025814225897192955, -0.05586344748735428, -0.0415799617767334, 0.03713321313261986, 0.02161772921681404, 0.08092692494392395, -0.026102975010871887, 0.010548990219831467, 0.05251394957304001, -0.048240453004837036, -0.027777723968029022, -0.0017637795535847545, -0.03878871351480484, -0.04739345610141754, -0.0019995919428765774, -0.05008845031261444, 0.029702721163630486, -0.0010082178050652146, -0.016449108719825745, -0.016102610155940056, 0.0038307462818920612, -0.018162358552217484, -0.046430956572294235, 0.05767294391989708, 0.06360194087028503, 0.046161454170942307, -0.04954945296049118, 0.033302467316389084, 0.014110236428678036, -0.010577864944934845, -0.00017370100249536335, -0.02369672805070877, 0.045160457491874695, -0.004778807982802391, -0.0023340603802353144, -0.004514120519161224, -0.009750115685164928, -0.02433197759091854, 0.023350227624177933, 0.05532444640994072, 0.061599940061569214, -0.017132483422756195, -0.05686444416642189, -0.007916554808616638, -0.06610443443059921, -0.14506785571575165, -0.03830746188759804, 0.00030830048490315676, -0.017084358260035515, 0.0203472301363945, -0.009360303170979023, -0.018826482817530632, 0.03680596500635147, 0.016391359269618988, 0.0030703721567988396, -0.03563171625137329, -0.02132898010313511, -0.03262871876358986, 0.03786471486091614, -0.02991447225213051, 0.026872973889112473, 0.020289480686187744, 0.013118862174451351, -0.024177977815270424, 0.02540997602045536, -0.003874058835208416, 0.007690367754548788, -0.03836521506309509, -0.06475693732500076, 0.00797430519014597, -0.02071298100054264, 0.0020404979586601257, 0.02061673067510128, 0.03407246619462967, -0.016420233994722366, -0.043966956436634064, 0.013089987449347973, -0.02017397992312908, 0.008489241823554039, -0.004056933801621199, -0.02585272490978241, -0.011078364215791225, 0.011809864081442356, 0.01888423226773739, -0.044082459062337875, -0.00793580524623394, -0.028008723631501198, 0.03468846529722214, -0.05097395181655884, -0.01346536260098219, -0.015476984903216362, -0.01802760735154152, 0.06190793961286545, -0.10156290233135223, 0.03595896437764168, 0.010154365561902523, 0.02648797444999218, -0.03002997115254402, 0.015217110514640808, -0.08416091650724411, -0.06202344223856926, 0.00967311579734087, 0.009846366010606289, -0.04404395818710327, 0.011367114260792732, 0.009629803709685802, 0.027469724416732788, -0.051204949617385864, 0.005534369498491287, 0.047239456325769424, 0.024389727041125298, -0.011213114485144615, 0.008080179803073406, -0.031685471534729004, 0.056556444615125656, 0.01726723276078701, -0.023311728611588478, -0.04927995428442955, -0.03798021376132965, 0.00834005419164896, -0.010327614843845367, -0.05162845179438591, -0.021174980327486992, -0.03266721963882446, 0.006044494453817606, 0.05316844955086708, 0.016131484881043434, -0.03890421241521835, 0.007440118119120598, -0.034303467720746994, -0.0032676844857633114, 0.0266804751008749, -0.03830746188759804, 0.058635443449020386, -0.07495942711830139, -0.02142523042857647, -0.022811228409409523, -0.06768293678760529, 0.030318720266222954, 0.024351226165890694, -0.03343721851706505, 0.07014693319797516, 0.007642242591828108, 0.061330441385507584, 0.03233996778726578, -0.023542728275060654, -0.08446891605854034, -0.036112964153289795, 0.05386145040392876, -0.0028225285932421684, -0.030453471466898918, -0.001937029417604208, -0.005505494773387909, -0.0361514650285244, 0.03518896549940109, 0.046315453946590424, -0.015063110738992691, -0.007858805358409882, 0.05074295029044151, -0.04088696092367172, 0.03428421542048454, 0.03299446776509285, 0.010885864496231079, 0.036651965230703354, 0.022291479632258415, 0.024639977142214775, -0.03216671943664551, -0.021136479452252388, -0.02585272490978241, -0.0020669668447226286, 0.0032676844857633114, -0.030318720266222954, -0.0035732777323573828, -0.023735227063298225, -0.026815224438905716, -0.027796972543001175, -0.032224468886852264, -0.08754891902208328, -0.02641097456216812, -0.05644094571471214, 0.00479324534535408, 0.014793611131608486, -0.018787981942296028, 0.026237724348902702, -0.025371475145220757, -0.03374521806836128, 0.026545723900198936, 0.04385145753622055, 0.04131045937538147, -0.01653573475778103, 0.044428955763578415, 0.036825213581323624, -0.009215928614139557, 0.0019935762975364923, 0.02186797931790352, 0.005919369403272867, 0.005750931799411774, -0.05051195248961449, -0.030992470681667328, 0.03984746336936951, 0.02406247705221176, 0.0039053400978446007, -0.07060893625020981, -0.03153146803379059, -0.028874972835183144, 0.011559613980352879, -0.04296595975756645, -0.007728867698460817, -0.02685372345149517, -0.0192018561065197, 0.0013150143204256892, 0.03942396119236946, 0.027065474539995193, 0.04978045076131821, -0.025544725358486176, 0.026468724012374878, 0.017305733636021614, 0.007055118214339018, 0.008763554506003857, -0.04319695755839348, 0.03155072033405304, 0.005577682051807642, -0.0026540912222117186, -0.02213747799396515, -0.034399718046188354, -0.05570944771170616, 0.03742196410894394, -0.014447111636400223, -0.023638976737856865, 0.03505421802401543, 0.0014966860180720687, -0.03726796433329582, -0.022002728655934334, 0.047701455652713776, -0.0069444309920072556, 0.024023976176977158, 0.020270230248570442, 0.019923731684684753, -0.00841224193572998, 0.00256506004370749, 0.0009594912989996374, -0.01888423226773739, 0.0009492647368460894, 0.05316844955086708, 0.030857721343636513, -0.030992470681667328, 0.011954238638281822, 0.010000365786254406, 0.03667121380567551, 0.013888861984014511, -0.03370671719312668, 0.03145447000861168, 0.03270572051405907, -0.02161772921681404, -0.023812226951122284, 0.03436121717095375, -0.0804649218916893, 0.06833743304014206, 0.06075294315814972, 0.03988596051931381, 0.05081995204091072, 0.07222592830657959, -0.04889495298266411, 0.024023976176977158, -0.06795243173837662, -0.06833743304014206, -0.06980043649673462, -0.022714978083968163, -0.01755598373711109, 0.06587343662977219, 0.03505421802401543, 0.016978483647108078, 0.02252247929573059, 0.061599940061569214, 0.020751480013132095 ]
717,068
pytorch_optimizer.optimizer.lookahead
Lookahead
k steps forward, 1 step back. :param optimizer: OPTIMIZER. base optimizer. :param k: int. number of lookahead steps. :param alpha: float. linear interpolation factor. :param pullback_momentum: str. change to inner optimizer momentum on interpolation update.
class Lookahead(Optimizer, BaseOptimizer): r"""k steps forward, 1 step back. :param optimizer: OPTIMIZER. base optimizer. :param k: int. number of lookahead steps. :param alpha: float. linear interpolation factor. :param pullback_momentum: str. change to inner optimizer momentum on interpolation update. """ def __init__( self, optimizer: OPTIMIZER, k: int = 5, alpha: float = 0.5, pullback_momentum: str = 'none', ): self.validate_positive(k, 'k') self.validate_range(alpha, 'alpha', 0.0, 1.0) self.validate_options(pullback_momentum, 'pullback_momentum', ['none', 'reset', 'pullback']) self._optimizer_step_pre_hooks: Dict[int, Callable] = {} self._optimizer_step_post_hooks: Dict[int, Callable] = {} self.alpha = alpha self.k = k self.pullback_momentum = pullback_momentum self.optimizer = optimizer self.param_groups = self.optimizer.param_groups self.state: STATE = defaultdict(dict) for group in self.param_groups: if 'counter' not in group: group['counter'] = 0 for p in group['params']: state = self.state[p] state['slow_params'] = torch.empty_like(p) state['slow_params'].copy_(p) if self.pullback_momentum == 'pullback': state['slow_momentum'] = torch.zeros_like(p) self.defaults: DEFAULTS = { 'lookahead_alpha': alpha, 'lookahead_k': k, 'lookahead_pullback_momentum': pullback_momentum, **optimizer.defaults, } def __getstate__(self): return { 'state': self.state, 'optimizer': self.optimizer, 'alpha': self.alpha, 'k': self.k, 'pullback_momentum': self.pullback_momentum, } @torch.no_grad() def reset(self): for group in self.param_groups: group['counter'] = 0 def backup_and_load_cache(self): r"""Backup cache parameters.""" for group in self.param_groups: for p in group['params']: state = self.state[p] state['backup_params'] = torch.empty_like(p) state['backup_params'].copy_(p) p.data.copy_(state['slow_params']) def clear_and_load_backup(self): r"""Load backup parameters.""" for group in self.param_groups: for p in group['params']: state = self.state[p] p.data.copy_(state['backup_params']) del state['backup_params'] def state_dict(self) -> STATE: return self.optimizer.state_dict() def load_state_dict(self, state: STATE): r"""Load state.""" self.optimizer.load_state_dict(state) @torch.no_grad() def zero_grad(self): self.optimizer.zero_grad(set_to_none=True) @torch.no_grad() def update(self, group: Dict): for p in group['params']: if p.grad is None: continue state = self.state[p] slow = state['slow_params'] p.mul_(self.alpha).add_(slow, alpha=1.0 - self.alpha) slow.copy_(p) if 'momentum_buffer' not in self.optimizer.state[p]: self.optimizer.state[p]['momentum_buffer'] = torch.zeros_like(p) if self.pullback_momentum == 'pullback': internal_momentum = self.optimizer.state[p]['momentum_buffer'] self.optimizer.state[p]['momentum_buffer'] = internal_momentum.mul_(self.alpha).add_( state['slow_momentum'], alpha=1.0 - self.alpha ) state['slow_momentum'] = self.optimizer.state[p]['momentum_buffer'] elif self.pullback_momentum == 'reset': self.optimizer.state[p]['momentum_buffer'] = torch.zeros_like(p) def step(self, closure: CLOSURE = None) -> LOSS: loss: LOSS = self.optimizer.step(closure) for group in self.param_groups: group['counter'] += 1 if group['counter'] >= self.k: group['counter'] = 0 self.update(group) return loss
(optimizer: Type[torch.optim.optimizer.Optimizer], k: int = 5, alpha: float = 0.5, pullback_momentum: str = 'none')
[ 0.0021065790206193924, -0.03425975888967514, -0.04626057296991348, 0.027546430006623268, -0.01772397942841053, 0.005837031174451113, -0.05921195074915886, -0.02241736836731434, -0.043092042207717896, -0.02241736836731434, -0.025744326412677765, 0.028061315417289734, -0.00018302607350051403, 0.05996447801589966, -0.029804008081555367, 0.07481697201728821, 0.04348810762166977, 0.030714962631464005, -0.013070196844637394, -0.029566368088126183, 0.009649171493947506, -0.07374759763479233, -0.010376944206655025, 0.09458069503307343, -0.03651733696460724, -0.029645582661032677, -0.0038245178293436766, -0.023189697414636612, -0.0497063547372818, 0.00980759784579277, -0.014476233161985874, -0.04178502410650253, -0.006460835691541433, 0.005356800276786089, -0.0019283490255475044, -0.049033042043447495, 0.023585764691233635, 0.041349347680807114, -0.12151322513818741, -0.04261676222085953, 0.07030181586742401, -0.05996447801589966, 0.026378033682703972, -0.006119228433817625, 0.01588226854801178, -0.007351985666900873, 0.007985692471265793, 0.012248358689248562, 0.040121544152498245, -0.029625779017806053, 0.03901255503296852, -0.04111170768737793, 0.01853591576218605, -0.0006807394092902541, -0.019595393911004066, 0.017585355788469315, 0.06927204132080078, -0.007505461573600769, 0.04673585295677185, -0.05370662733912468, 0.029903026297688484, -0.032715097069740295, 0.024595733731985092, 0.05018163472414017, -0.0166942048817873, -0.039527442306280136, -0.046379394829273224, -0.027427610009908676, -0.0025212112814188004, -0.004898848477751017, 0.01908050663769245, -0.0007426248048432171, 0.01831807941198349, 0.020021164789795876, -0.05069652199745178, -0.03382408618927002, -0.035586580634117126, -0.026437442749738693, -0.013892035000026226, -0.01978352479636669, -0.012773146852850914, 0.0040473053231835365, -0.04245833680033684, -0.028120726346969604, -0.0019716687966138124, -0.06277655065059662, 0.010693796910345554, -0.03285372257232666, 0.024932390078902245, -0.05255803465843201, -0.026991935446858406, 0.00877782516181469, 0.03875511512160301, 0.06055857613682747, 0.05727122351527214, 0.01691204309463501, -0.02819993905723095, -0.013189016841351986, -0.02691272273659706, -0.03437857702374458, -0.009084776975214481, 0.020001361146569252, -0.01094133872538805, 0.034715235233306885, 0.021050937473773956, -0.025051210075616837, -0.02275402471423149, -0.01987263932824135, 0.00840156152844429, -0.05877627804875374, -0.03542815521359444, -0.004807258024811745, -0.07358916848897934, -0.011406716890633106, -0.0170704685151577, 0.019298342987895012, -0.02998223900794983, 0.0024469487834721804, -0.008817431516945362, 0.04495355486869812, 0.060281332582235336, 0.0014703971100971103, -0.07133159041404724, -0.0023962026461958885, -0.01879335753619671, -0.008253036998212337, 0.06986614316701889, 0.022714417427778244, -0.010951240547001362, -0.09553125500679016, -0.03738868236541748, 0.027427610009908676, -0.0333884097635746, 0.014268297702074051, -0.0021362840197980404, -0.014911905862390995, 0.023051073774695396, -0.0019394884584471583, -0.0474487729370594, 0.006752934772521257, 0.02588295005261898, 0.0157733503729105, 0.015981286764144897, -0.026298819109797478, 0.01901119574904442, -0.030239682644605637, 0.06891558319330215, 0.005906342528760433, 0.0382402278482914, 0.004693388938903809, 0.026952330023050308, -0.009550155140459538, 0.0026338426396250725, -0.020110279321670532, 0.02344714105129242, 0.006728180684149265, -0.021744053810834885, 0.025110621005296707, -0.03867590054869652, -0.004586945753544569, -0.014812889508903027, -0.032061588019132614, -0.043250467628240585, -0.05101337283849716, 0.0019889967516064644, 0.03416074067354202, -0.0017649716464802623, 0.020555853843688965, -0.04570608213543892, 0.040418591350317, 0.005544932093471289, -0.029843615368008614, 0.0189121775329113, 0.023486746475100517, -0.005960801616311073, 0.05944959074258804, 0.007153952494263649, 0.009980877861380577, 0.007391592022031546, -0.028972269967198372, 0.026061179116368294, 0.005658801179379225, -0.04059682413935661, -0.09917506575584412, -0.04154738411307335, 0.008574841544032097, 0.019575590267777443, 0.017357617616653442, -0.018872572109103203, 0.0674501359462738, 0.009055071510374546, -0.025308653712272644, 0.07778747379779816, -0.024140257388353348, -0.04847854748368263, 0.023268910124897957, 0.03416074067354202, 0.04142856225371361, 0.10495764017105103, 0.02901187539100647, -0.022456973791122437, -0.0022885221987962723, 0.04091367498040199, -0.0006634115125052631, 0.0029160401318222284, -0.007792609743773937, -0.013713805004954338, 0.032120998948812485, -0.005032520741224289, 0.03528952971100807, -0.07137119770050049, -0.03069515898823738, 0.06004369258880615, 0.040002722293138504, 0.0015223808586597443, -0.01722889579832554, 0.032616082578897476, 0.05204314738512039, 0.08198577910661697, 0.019427064806222916, 0.03348742797970772, -0.034061726182699203, -0.015515907667577267, 0.017318010330200195, 0.05818217992782593, 0.0049904389306902885, 0.023585764691233635, -0.007099492941051722, -0.009391728788614273, -0.02338773012161255, 0.03534894064068794, -0.0653509795665741, -0.0021598003804683685, -0.02722957544028759, 0.06127149611711502, 0.012010718695819378, -0.030813978984951973, -0.03911157324910164, -0.02663547731935978, -0.050062812864780426, 0.0008769161067903042, 0.004866668023169041, 0.0021845547016710043, -0.0005817227647639811, -0.02097172476351261, -0.017011059448122978, 0.06329143792390823, -0.013000885024666786, 0.006663819774985313, 0.03091299533843994, -0.028338562697172165, 0.02922971174120903, -0.03269529342651367, 0.03566579520702362, -0.035210318863391876, -0.04713192209601402, 0.04938950017094612, 0.00015626063395757228, 0.007099492941051722, -0.011931505054235458, -0.030457518994808197, -0.07018299400806427, -0.08586723357439041, 0.023803601041436195, -0.006871754769235849, 0.02528885006904602, 0.026873115450143814, -0.039151180535554886, -0.01922903209924698, 0.0023739240132272243, 0.09957113116979599, 0.007030181586742401, -0.07331191748380661, 0.02156582474708557, -0.018021028488874435, 0.019526081159710884, 0.005480571184307337, -0.008277791552245617, -0.020110279321670532, -0.018347783014178276, 0.06661839783191681, -0.03911157324910164, -0.05279567465186119, -0.025269046425819397, -0.009906615130603313, 0.04063642770051956, -0.05077573284506798, -0.0038195669185370207, 0.0579049326479435, 0.02166484110057354, 0.0579049326479435, -0.023744190111756325, 0.07065827399492264, -0.008253036998212337, 0.07248017936944962, -0.005728112533688545, -0.028813842684030533, 0.012337473221123219, -0.008847136981785297, -0.025090817362070084, 0.059726838022470474, -0.06863833218812943, 0.018011126667261124, 0.03586382791399956, 0.0007958462228998542, 0.021209364756941795, -0.012010718695819378, 0.019060702994465828, 0.04721113294363022, -0.022555990144610405, 0.03376467525959015, 0.004096813499927521, 0.012624621391296387, -0.02576413005590439, 0.02338773012161255, -0.10329415649175644, -0.013981149531900883, -0.0274474136531353, 0.0025472030974924564, 0.04396338760852814, -0.025308653712272644, 0.0222589410841465, -0.004881520289927721, 0.0017464059637859464, -0.02156582474708557, -0.03637871518731117, 0.0363193042576313, 0.01961519569158554, -0.048953827470541, -0.03328939527273178, -0.07125237584114075, -0.009772942401468754, 0.012446391396224499, 0.039369016885757446, -0.061073463410139084, -0.0014963890425860882, 0.0030620896723121405, 0.019268637523055077, 0.03732927516102791, -0.021209364756941795, 0.12087951600551605, 0.007054935675114393, -0.044517882168293, 0.025249242782592773, 0.028655415400862694, -0.013228623196482658, 0.06919282674789429, 0.03378447890281677, 0.05034006014466286, 0.03560638427734375, -0.0025521540082991123, 0.004052256233990192, -0.007569822017103434, 0.06919282674789429, 0.06483609974384308, 0.0020335542503744364, -0.01853591576218605, -0.018872572109103203, 0.035368744283914566, -0.0638459324836731, 0.005027569830417633, 0.02144700475037098, -0.042814794927835464, 0.04511198028922081, 0.05937037616968155, -0.01767447032034397, -0.030021846294403076, -0.01659518852829933, -0.0011628266656771302, -0.0467754602432251, -0.01626843400299549, -0.07972820103168488, 0.028160331770777702, 0.047726020216941833, -0.028219742700457573, -0.014268297702074051, -0.03905216231942177, -0.0014753479044884443, 0.034774646162986755, 0.05030045285820961, 0.06907401233911514, -0.006089523434638977, -0.005940998438745737, 0.03301214799284935, 0.02463534101843834, 0.006970771588385105, 0.0029903026297688484, -0.04218108952045441, 0.09608574956655502, -0.05152826011180878, 0.0408344641327858, -0.003770058508962393, 0.008817431516945362, -0.01967460662126541, -0.03992351144552231, 0.06325183063745499, 0.0764012411236763, 0.04198305681347847, -0.04435945674777031, -0.03641831874847412, 0.029645582661032677, -0.030734766274690628, 0.0035299432929605246, -0.00003776943412958644, 0.015605022199451923, -0.05160747468471527, 0.06539058685302734, 0.10369022935628891, -0.03326959162950516, 0.05077573284506798, -0.052439212799072266, -0.029704991728067398, -0.006574704777449369, 0.005361751187592745, -0.005574637092649937, -0.035091497004032135, -0.012485998682677746, 0.0016907091485336423, -0.006148933432996273, 0.014070264995098114, 0.04998360201716423, 0.01105025690048933, 0.0028244496788829565, 0.0022291122004389763, 0.010396746918559074, 0.009045169688761234, -0.07049984484910965, -0.011228486895561218, -0.05992487072944641, 0.01115917507559061, -0.008248086087405682, -0.06020211800932884, -0.004423568490892649, -0.0008874366176314652, -0.016783321276307106, 0.010119500569999218, 0.016723910346627235, 0.005688506178557873, 0.03663615882396698, -0.023189697414636612, 0.023625370115041733, 0.015506005845963955, 0.04598332941532135, 0.017268503084778786, 0.02210051380097866, -0.025863146409392357, 0.04396338760852814, 0.009352121502161026, -0.027685053646564484, 0.0026066130958497524, 0.02441750280559063, 0.018248766660690308, 0.021149953827261925, 0.010802715085446835, 0.008361955173313618, -0.019852835685014725, -0.048438940197229385, 0.020060772076249123, -0.0452704094350338, -0.004631503485143185, 0.0006609360571019351, 0.044280242174863815, 0.0031883358024060726, 0.02616019733250141, -0.0035225169267505407, 0.0600832961499691, 0.060598183423280716, -0.024991801008582115, -0.038339242339134216, 0.018060635775327682, -0.051251012831926346, -0.05885549262166023, -0.020872708410024643, -0.011802783235907555, -0.04029977321624756, -0.026932526379823685, -0.010951240547001362, 0.011505733244121075, 0.006574704777449369, -0.015357481315732002, 0.0218826774507761, -0.06055857613682747, 0.024358093738555908, 0.04649821296334267, -0.004715667571872473, 0.0032328933011740446, -0.0026684985496103764, 0.02388281375169754, -0.016446664929389954, 0.0005733682191930711, -0.08618408441543579, -0.03560638427734375, 0.08412453532218933, 0.03495287522673607, -0.03808179870247841, 0.014674265868961811, 0.008025298826396465, 0.03960665687918663, 0.09402620047330856, -0.026457246392965317, 0.008243135176599026, -0.0043146503157913685, -0.02113015204668045, -0.03534894064068794, 0.012792949564754963, -0.006000408437103033, -0.028496989980340004, -0.010713600553572178, -0.033527035266160965, 0.050379667431116104, 0.03176453709602356, -0.02301146648824215, 0.012792949564754963, 0.03273490071296692, -0.014189084991812706, -0.012188948690891266, -0.026714690029621124, 0.01825866848230362, 0.017278403043746948, -0.04614175483584404, 0.045468442142009735, 0.053191740065813065, 0.023684781044721603, -0.0608358234167099, 0.04095328226685524, 0.01647636853158474, 0.006817295681685209, -0.029942631721496582, 0.036061860620975494, -0.005995457526296377, 0.005980605259537697, -0.02031821385025978, 0.006317261606454849, 0.08103521913290024, 0.02782367542386055, -0.039527442306280136, -0.004903798922896385, -0.03723025694489479, -0.1097104400396347, -0.016991255804896355, 0.017110075801610947, 0.027249379083514214, 0.021486610174179077, -0.049904387444257736, 0.009817499667406082, 0.04689428210258484, -0.04273558408021927, 0.03889373689889908, -0.071291983127594, 0.004156223498284817, -0.04241872951388359, -0.0037056978326290846, -0.021149953827261925, 0.013436557725071907, 0.016872435808181763, -0.024655142799019814, -0.00961451604962349, 0.029209909960627556, 0.03079417534172535, 0.03439838066697121, -0.015010923147201538, -0.005698407534509897, 0.009550155140459538, -0.026080982759594917, -0.02360556647181511, 0.031546700745821, -0.0007048746920190752, 0.01483269315212965, -0.017417026683688164, 0.051092587411403656, 0.03594304248690605, -0.03879471868276596, 0.0007636658265255392, -0.020189493894577026, -0.040557216852903366, -0.016614992171525955, 0.029150499030947685, -0.004797356203198433, 0.017872503027319908, -0.014357413165271282, 0.09394698590040207, -0.03467562794685364, 0.009797696955502033, -0.011505733244121075, -0.006406376603990793, 0.059568412601947784, -0.0645192414522171, 0.05152826011180878, -0.014099969528615475, 0.0029581221751868725, -0.026774099096655846, 0.027546430006623268, 0.01525846403092146, -0.030219879001379013, -0.0033319098874926567, 0.020130082964897156, -0.054974038153886795, 0.006030113436281681, 0.05513246729969978, 0.026279017329216003, -0.012070128694176674, -0.006178638432174921, 0.009411531500518322, 0.007703494746237993, -0.03956704959273338, -0.00942638423293829, -0.019852835685014725, 0.010495764203369617, 0.02560570277273655, -0.007569822017103434, 0.0004638310638256371, -0.02128857746720314, 0.0035101398825645447, -0.0077232979238033295, -0.04931028559803963, -0.027922693639993668, 0.005022618919610977, 0.017199190333485603, 0.07065827399492264, -0.005629096180200577, -0.020813297480344772, 0.02917030267417431, 0.007856970652937889, 0.042656369507312775, -0.018892375752329826, -0.03235863894224167, 0.03721045330166817, -0.11161155998706818, -0.0036512387450784445, -0.039527442306280136, 0.010594780556857586, -0.0024036290124058723, 0.0006296839565038681, -0.004765175748616457, -0.03469543159008026, -0.006876705680042505, 0.05711279809474945, 0.0020434558391571045, -0.036121271550655365, -0.04063642770051956, -0.007119296584278345, 0.00026270351372659206, 0.004629028029739857, -0.00794113427400589, -0.03216060623526573, -0.03122984804213047, -0.015793154016137123, 0.04063642770051956, 0.06206363067030907, 0.08507509529590607, -0.008342152461409569, 0.018387390300631523, -0.02913069538772106, 0.013139508664608002, -0.01156514324247837, -0.0035695498809218407, 0.0296653863042593, 0.06855912506580353, 0.0579049326479435, -0.05754847079515457, -0.037309471517801285, 0.0007407682714983821, -0.026774099096655846, 0.019595393911004066, -0.025744326412677765, -0.0009301375830546021, -0.03986410051584244, -0.0021610381081700325, -0.0031561553478240967, 0.05204314738512039, -0.0860256552696228, -0.04673585295677185, -0.0482013002038002, 0.008594644255936146, 0.035685598850250244, -0.023486746475100517, -0.005332046188414097, -0.03798278421163559, -0.03905216231942177, -0.010169008746743202, 0.05849903076887131, 0.022001497447490692, -0.006099425256252289, 0.04776562750339508, 0.02128857746720314, 0.046220969408750534, -0.0024605635553598404, 0.03047732263803482, 0.038814522325992584, -0.008079757913947105, -0.023328321054577827, 0.004807258024811745, 0.021209364756941795, 0.02328871376812458, 0.008485726080834866, -0.06111307069659233, -0.061350710690021515, -0.03701242059469223, 0.04618136212229729, -0.09101609885692596, 0.015030725859105587, 0.0004279375425539911, -0.05917234346270561, -0.03265568986535072, -0.020298412069678307, 0.05034006014466286, -0.009837303310632706, -0.01983303390443325, 0.010555174201726913, -0.019912246614694595, 0.005426112096756697, 0.021486610174179077, 0.009109530597925186, -0.02457593008875847, 0.0630141869187355, -0.013297935016453266, 0.017466535791754723, -0.029190106317400932, -0.031051618978381157, 0.06139031797647476, -0.028536595404148102, 0.024595733731985092, 0.007852019742131233, 0.012386981397867203, -0.045349620282649994, -0.019892442971467972, -0.013981149531900883, -0.03461621701717377, -0.014466331340372562, -0.014911905862390995, 0.01483269315212965, 0.033091362565755844, -0.0018280947115272284, -0.0318833589553833, 0.03608166426420212, -0.04582490026950836, 0.03808179870247841, -0.0031710078474134207, 0.025684917345643044, 0.06709367781877518, 0.02156582474708557, 0.02513042278587818, -0.0526372455060482, 0.007302477490156889, 0.012783048674464226, 0.04649821296334267, 0.0006943541811779141, -0.043408896774053574, 0.02350655011832714, -0.06531137973070145, 0.04891422018408775, -0.028496989980340004, 0.02166484110057354, 0.011139372363686562, 0.046973492950201035, -0.024952193722128868, 0.01998155750334263, -0.029031679034233093, -0.07014338672161102, -0.08562958985567093, -0.021050937473773956, -0.07719337195158005, 0.08103521913290024, 0.006391524337232113, -0.005267685279250145, 0.0016127335838973522, 0.02366497740149498, 0.012990983203053474 ]
717,069
pytorch_optimizer.optimizer.lookahead
__getstate__
null
def __getstate__(self): return { 'state': self.state, 'optimizer': self.optimizer, 'alpha': self.alpha, 'k': self.k, 'pullback_momentum': self.pullback_momentum, }
(self)
[ 0.01935344561934471, -0.041571348905563354, -0.0005789737333543599, 0.0012761522084474564, 0.0030779140070080757, -0.011852608062326908, -0.05960273742675781, -0.02104274183511734, 0.04619854688644409, -0.04124083369970322, -0.04359115660190582, 0.01755397953093052, -0.004636380355805159, 0.034483652561903, -0.04550079628825188, 0.0314539410173893, 0.008056284859776497, 0.0071152374148368835, -0.060006700456142426, -0.008588779717683792, 0.0024536093696951866, -0.03549356013536453, 0.009263579733669758, 0.04410529136657715, -0.010576455853879452, -0.0032271044328808784, 0.011136494576931, -0.05732586234807968, 0.049797482788562775, -0.007441161200404167, -0.05736258625984192, -0.004103885497897863, 0.007900209166109562, 0.01221066527068615, 0.007514609023928642, -0.011696532368659973, 0.003073323518037796, 0.01738872192800045, -0.05993325263261795, -0.04259961470961571, 0.015295465476810932, -0.0775606781244278, -0.015387274324893951, 0.005201009102165699, 0.020032836124300957, -0.016498170793056488, 0.032114967703819275, -0.013009408488869667, 0.07616517692804337, -0.07645896077156067, 0.04102049022912979, -0.034226588904857635, 0.024458054453134537, 0.04057980701327324, -0.012385103851556778, -0.029984988272190094, 0.05321279540657997, 0.00560956122353673, -0.003906494937837124, 0.018876036629080772, -0.026202436536550522, 0.007197866216301918, 0.016406361013650894, -0.019610513001680374, -0.011191579513251781, -0.048732489347457886, -0.04245271906256676, 0.02073058858513832, -0.024604950100183487, 0.06147565320134163, 0.028479311615228653, -0.034244950860738754, 0.021758854389190674, -0.015928950160741806, -0.05291900411248207, -0.037146128714084625, -0.05688517540693283, -0.010558093897998333, -0.0018304522382095456, -0.0491364523768425, -0.05156022310256958, 0.03356555849313736, -0.0715012475848198, 0.017425445839762688, 0.0015401046257466078, -0.05552639439702034, 0.012605446390807629, -0.008428113535046577, -0.03885378688573837, -0.01174243725836277, -0.03655854985117912, 0.05475519597530365, 0.0016674903454259038, 0.04730026051402092, 0.011118132621049881, -0.001297957031056285, -0.036099500954151154, -0.008809123188257217, 0.017287731170654297, -0.05963946133852005, -0.044435806572437286, -0.005155104212462902, -0.04807146266102791, 0.03589751943945885, -0.014616074971854687, -0.03615458682179451, 0.012660532258450985, -0.056811727583408356, 0.014359008520841599, -0.06162254512310028, -0.006564380135387182, 0.035934243351221085, -0.035915881395339966, 0.021428341045975685, 0.014276379719376564, -0.016094207763671875, -0.030609292909502983, -0.0160207599401474, -0.01518529374152422, 0.028883272781968117, -0.02410917915403843, 0.03793569281697273, -0.017939578741788864, 0.039257749915122986, -0.006316494662314653, 0.03490597754716873, 0.02150178886950016, 0.012431008741259575, 0.028754740953445435, -0.036980871111154556, -0.01221066527068615, -0.0027726474218070507, -0.03141721710562706, 0.0399555005133152, -0.023448150604963303, 0.007037199568003416, 0.0896795317530632, 0.009786894544959068, -0.007050970569252968, 0.051156263798475266, 0.05504898354411125, 0.041865140199661255, -0.02853439748287201, -0.015763694420456886, 0.03158247470855713, -0.004723599646240473, 0.049026280641555786, 0.025137444958090782, -0.018527159467339516, -0.026918549090623856, 0.0723826214671135, 0.00339236157014966, 0.019904302433133125, -0.012844150885939598, -0.01768251322209835, -0.02440296858549118, -0.019261635839939117, -0.03753172978758812, -0.025835197418928146, -0.007909390144050121, -0.045390624552965164, -0.010649903677403927, -0.03797241672873497, -0.0781482607126236, 0.020400073379278183, 0.04685957729816437, 0.028626207262277603, -0.053763650357723236, -0.025743387639522552, -0.022346435114741325, -0.04957713931798935, -0.04865904152393341, -0.04315047338604927, 0.051192983984947205, -0.033345215022563934, 0.06386269629001617, -0.007482475601136684, 0.018802588805556297, -0.003807799657806754, -0.008579599671065807, 0.024439692497253418, -0.019004570320248604, -0.12126200646162033, 0.019628874957561493, -0.007881847210228443, -0.02454986423254013, 0.02836913987994194, -0.01589222624897957, 0.0275979395955801, 0.04608837515115738, 0.0015182998031377792, -0.005761046893894672, 0.018820950761437416, 0.00030784879345446825, -0.026165712624788284, -0.009410475380718708, -0.011274208314716816, -0.013743884861469269, 0.06099824234843254, 0.0491364523768425, -0.0074365707114338875, -0.05214780569076538, -0.036815617233514786, 0.03396952152252197, -0.024513140320777893, -0.0024260664358735085, -0.024494778364896774, -0.028644569218158722, 0.004367837682366371, 0.04175496846437454, -0.06114513799548149, -0.018986208364367485, 0.033051423728466034, 0.0540207177400589, 0.01372552290558815, -0.08666818588972092, 0.07289675623178482, 0.04836525395512581, 0.03523649275302887, 0.0295993871986866, 0.0551958791911602, -0.02638605423271656, 0.040359463542699814, -0.0457211397588253, -0.014744607731699944, -0.027689749374985695, -0.00358516164124012, -0.0028116663452237844, -0.0655519962310791, -0.03977188095450401, 0.02440296858549118, -0.032280225306749344, -0.018058931455016136, -0.01891276054084301, 0.04726354032754898, 0.04730026051402092, -0.017342817038297653, -0.033510472625494, -0.03720121458172798, -0.0023342568892985582, 0.024898741394281387, -0.024127541109919548, 0.056517936289310455, -0.018710779026150703, -0.042930129915475845, -0.03139885514974594, 0.08013134449720383, 0.05868464335799217, -0.039588261395692825, 0.0084005706012249, 0.01281660795211792, -0.013523541390895844, -0.016424722969532013, 0.033767540007829666, -0.0034313807263970375, -0.031362131237983704, 0.013899960555136204, 0.024439692497253418, 0.04179169237613678, -0.018949484452605247, 0.012623808346688747, -0.02882818691432476, -0.05479191988706589, 0.03641165420413017, 0.020051198080182076, 0.03661363571882248, 0.04865904152393341, -0.0015710903098806739, -0.05563656613230705, 0.010695808567106724, 0.15027381479740143, 0.0017971713095903397, -0.08336304128170013, -0.003683856688439846, -0.014239655807614326, -0.05894170701503754, 0.014487541280686855, -0.016957217827439308, -0.03630148246884346, 0.006325675640255213, 0.0537269301712513, -0.007863485254347324, -0.020840760320425034, 0.0073768943548202515, -0.03797241672873497, -0.007151961326599121, -0.030388949438929558, -0.020840760320425034, 0.061108414083719254, -0.006995885167270899, 0.02407245524227619, 0.013707160949707031, 0.002701495075598359, -0.0008257118170149624, 0.11949926614761353, -0.03127032145857811, -0.0793234184384346, -0.009777713567018509, 0.04215892776846886, 0.06470734626054764, 0.06235702335834503, -0.024788569658994675, -0.02107946388423443, 0.04315047338604927, -0.022548416629433632, 0.0390741303563118, 0.07829515635967255, 0.023411426693201065, 0.010016418062150478, -0.019481979310512543, 0.009258989244699478, 0.012935960665345192, 0.022181179374456406, 0.034538738429546356, -0.006261408794671297, -0.11707549542188644, -0.031362131237983704, -0.034557100385427475, -0.0013748474884778261, 0.10752730071544647, -0.06430338323116302, -0.013780607841908932, -0.0013966521946713328, 0.01600239798426628, 0.003922561649233103, -0.03782552108168602, -0.0025316474493592978, -0.011228303425014019, 0.022676950320601463, 0.003715990111231804, -0.10936349630355835, -0.03914757817983627, 0.021685408428311348, 0.04832853004336357, -0.03674216940999031, 0.015910588204860687, 0.017765142023563385, 0.048732489347457886, 0.0014838712522760034, -0.04656578600406647, 0.061365481466054916, -0.010916151106357574, -0.06753508001565933, 0.028093712404370308, -0.001536661759018898, -0.023080911487340927, 0.02163032256066799, -0.013220570050179958, 0.06786559522151947, -0.023117635399103165, -0.09327846765518188, 0.031821176409721375, -0.0027451044879853725, 0.09834635257720947, 0.05435123294591904, 0.0011602427111938596, -0.019481979310512543, -0.053322967141866684, -0.0044366950169205666, 0.006949980277568102, 0.05291900411248207, 0.018508797511458397, -0.04531717672944069, 0.044325634837150574, 0.038523271679878235, -0.012045408599078655, -0.014092760160565376, -0.00915340892970562, 0.027047082781791687, -0.07374140620231628, -0.01644308492541313, -0.07377813011407852, -0.033492110669612885, 0.044619426131248474, -0.0003649428253993392, 0.03830292820930481, -0.031802814453840256, -0.02256677858531475, 0.015065941028296947, 0.007528380025178194, 0.05905187875032425, 0.010236760601401329, -0.0008871094323694706, 0.057766545563936234, 0.022530054673552513, 0.01937180757522583, 0.008519923314452171, -0.0251558069139719, 0.06059427931904793, -0.006073199212551117, -0.09063435345888138, -0.0034405614715069532, -0.01801302656531334, -0.0059354850091040134, 0.0254495982080698, 0.013450093567371368, 0.0649644136428833, -0.022970741614699364, -0.024274436756968498, -0.024200988933444023, 0.003727466333657503, 0.006155828014016151, 0.004438990261405706, -0.005577428266406059, 0.0023434378672391176, -0.0799110010266304, 0.04300357773900032, 0.10128425806760788, -0.00396617129445076, -0.040836870670318604, -0.025982093065977097, -0.016415541991591454, -0.05967618525028229, -0.04039618745446205, -0.0047832755371928215, -0.03767862543463707, 0.023870473727583885, -0.007083103992044926, 0.052992451936006546, 0.026753293350338936, 0.025982093065977097, 0.055599842220544815, 0.03373081609606743, 0.014616074971854687, 0.018095655366778374, 0.028405863791704178, -0.028956720605492592, 0.03152738884091377, 0.0057197329588234425, 0.040469635277986526, -0.00560038024559617, -0.01061317976564169, 0.012476912699639797, -0.018040569499135017, 0.008249085396528244, -0.027359236031770706, 0.005503980442881584, -0.015047580003738403, 0.00735394237563014, 0.053029175847768784, 0.020473521202802658, 0.04755732789635658, 0.02880982682108879, 0.024788569658994675, 0.01995938830077648, -0.030939806252717972, -0.004023551940917969, 0.014597713015973568, 0.026606397703289986, -0.028901634737849236, 0.00538003770634532, -0.003651723498478532, 0.0168011412024498, -0.03483252972364426, 0.02425607480108738, 0.03740319609642029, -0.06041065976023674, -0.017930397763848305, -0.04550079628825188, -0.01964723691344261, -0.0013805855996906757, 0.01950034126639366, -0.06610284745693207, 0.054681748151779175, 0.006711275782436132, -0.018104836344718933, -0.0012841855641454458, -0.00852910429239273, -0.030242053791880608, 0.02440296858549118, -0.007950703613460064, 0.019261635839939117, -0.041277557611465454, -0.043407537043094635, -0.03310650959610939, -0.020987655967473984, -0.030884720385074615, 0.006298132706433535, -0.03464891016483307, -0.07675275206565857, -0.009869523346424103, -0.011393561027944088, -0.00937375146895647, 0.009474742226302624, 0.013945865444839, 0.004269142635166645, 0.013918322511017323, 0.040653254836797714, 0.024660035967826843, -0.02163032256066799, -0.06452372670173645, -0.016277827322483063, 0.04498666152358055, 0.022474968805909157, -0.030315501615405083, 0.043701328337192535, 0.008221542462706566, 0.007601827848702669, 0.04175496846437454, 0.013312379829585552, 0.008579599671065807, -0.02166704647243023, -0.004122247453778982, 0.03264746442437172, -0.0015079713193699718, -0.04785111919045448, -0.058060336858034134, -0.027891730889678, 0.021318169310688972, 0.031068339943885803, 0.032280225306749344, -0.007840532809495926, 0.040359463542699814, 0.002370980801060796, -0.02133653126657009, -0.0399555005133152, -0.0457211397588253, 0.0350712351500988, -0.021538512781262398, 0.024806931614875793, 0.015800418332219124, 0.04223237559199333, 0.038045864552259445, -0.04381150007247925, -0.029691196978092194, 0.053139347583055496, -0.011154856532812119, -0.040175843983888626, 0.008501561358571053, 0.0314539410173893, -0.003236285410821438, -0.06595595926046371, -0.0005164284957572818, 0.12383267283439636, -0.049026280641555786, -0.013523541390895844, 0.024623312056064606, -0.014588532038033009, -0.10965728759765625, -0.03323504328727722, 0.05747275799512863, -0.009649179875850677, 0.006100742146372795, 0.007046380080282688, 0.05104609206318855, 0.028718017041683197, -0.01677359826862812, -0.00043322614510543644, -0.03778879716992378, -0.03340030089020729, -0.009832799434661865, -0.04954041540622711, -0.0011808999115601182, -0.06397286802530289, 0.03573226183652878, -0.015038399025797844, 0.053029175847768784, 0.016424722969532013, 0.03160083666443825, 0.006775542162358761, -0.000784397532697767, 0.0036241805646568537, -0.006770951673388481, -0.003649428253993392, -0.024347882717847824, 0.004657037556171417, -0.008193999528884888, 0.0554896704852581, -0.011338475160300732, 0.020032836124300957, 0.046455614268779755, -0.009594094008207321, 0.04351770877838135, -0.0005508571048267186, 0.027836645022034645, -0.009401294402778149, 0.008441885001957417, 0.03037058748304844, 0.006610285025089979, -0.015442360192537308, 0.08600715547800064, 0.00816186610609293, 0.004230123478919268, -0.017755961045622826, -0.017618246376514435, 0.04149790108203888, -0.06422993540763855, 0.049173176288604736, 0.03756845369935036, -0.00800119899213314, -0.040028948336839676, 0.002380161779001355, 0.011659808456897736, -0.0024742663372308016, -0.002740513999015093, -0.003087094984948635, -0.001442556967958808, 0.00936916097998619, -0.0021357189398258924, 0.011880150996148586, -0.015625979751348495, -0.0028667522128671408, 0.0274510458111763, -0.0020117759704589844, -0.025523046031594276, -0.01614929363131523, 0.014129484072327614, 0.04895283281803131, -0.017434626817703247, -0.011439465917646885, -0.004067161586135626, -0.06764525175094604, -0.0003247761633247137, -0.0488426610827446, 0.01663588359951973, -0.03628312051296234, 0.03597096726298332, 0.023907197639346123, -0.026459502056241035, -0.004367837682366371, -0.00875862780958414, 0.011678170412778854, -0.02350323647260666, 0.02778155915439129, 0.0016973284073174, -0.03903740644454956, 0.04252616688609123, -0.053910546004772186, 0.008827485144138336, -0.03611786291003227, 0.0006191403954289854, 0.017150018364191055, 0.038817062973976135, -0.07289675623178482, -0.000881371321156621, 0.021116187795996666, 0.06298132985830307, 0.036815617233514786, -0.009130456484854221, 0.022934017702937126, 0.0011395856272429228, 0.04814491048455238, 0.014992494136095047, -0.008083827793598175, -0.0244213305413723, -0.014524265192449093, -0.04223237559199333, -0.00636239955201745, 0.05938239395618439, -0.007689047139137983, -0.021006017923355103, -0.013027770444750786, -0.02500891126692295, 0.0014310808619484305, -0.035787347704172134, -0.020932570099830627, 0.016883770003914833, 0.04410529136657715, 0.050421785563230515, -0.061402205377817154, -0.10539732128381729, 0.03696250915527344, -0.06221012771129608, -0.008974379859864712, 0.056811727583408356, 0.02286056987941265, -0.09166262298822403, 0.0508991964161396, 0.029360683634877205, -0.010585636831820011, 0.026900187134742737, -0.028332415968179703, 0.01935344561934471, 0.006256818305701017, -0.034703996032476425, -0.0029723329935222864, 0.03991877660155296, 0.019904302433133125, 0.056811727583408356, -0.010402018204331398, 0.04138772934675217, 0.06547854840755463, 0.003458923427388072, 0.02179557830095291, 0.0672045648097992, 0.011769980192184448, -0.04204875975847244, 0.02500891126692295, 0.04557424411177635, 0.013009408488869667, -0.04770422354340553, -0.026753293350338936, 0.011448646895587444, 0.02410917915403843, -0.009281941689550877, -0.02488037943840027, -0.03079291060566902, -0.04160807281732559, 0.028258968144655228, -0.05369020625948906, -0.0049577136524021626, 0.02012464590370655, 0.0015561713371425867, -0.03977188095450401, 0.03398788347840309, 0.0026923140976577997, 0.0001774505799403414, -0.03841309994459152, -0.009355389513075352, -0.04946696758270264, 0.020822398364543915, -0.0036149995867162943, -0.024292796850204468, 0.008093008771538734, 0.044545978307724, 0.018215008080005646, -0.01274316105991602, -0.0051183803007006645, -0.0326291024684906, 0.056040529161691666, -0.04351770877838135, 0.019169826060533524, 0.010769256390631199, 0.03617294877767563, -0.012522817589342594, 0.03885378688573837, 0.003100866451859474, -0.02120799757540226, 0.005122970789670944, 0.003126113908365369, -0.034869253635406494, 0.009084551595151424, -0.04377477616071701, -0.014478360302746296, -0.0008842403767630458, -0.024513140320777893, 0.06698422133922577, 0.035291578620672226, 0.03444692865014076, 0.0802047923207283, 0.026771655306220055, 0.04722681641578674, -0.011292570270597935, 0.024604950100183487, 0.0034130187705159187, 0.024347882717847824, -0.0179763026535511, -0.035475198179483414, 0.006197142414748669, -0.036356568336486816, 0.042195651680231094, 0.03371245414018631, 0.04116738587617874, -0.027689749374985695, 0.03341866284608841, -0.04102049022912979, -0.0056141517125070095, -0.0127247991040349, 0.001552728470414877, -0.04230582341551781, -0.06738818436861038, -0.07506345957517624, 0.02137325517833233, 0.060631003230810165, -0.010080684907734394, 0.022511692717671394, 0.00400978047400713, -0.014368189498782158 ]
717,070
pytorch_optimizer.optimizer.lookahead
__init__
null
def __init__( self, optimizer: OPTIMIZER, k: int = 5, alpha: float = 0.5, pullback_momentum: str = 'none', ): self.validate_positive(k, 'k') self.validate_range(alpha, 'alpha', 0.0, 1.0) self.validate_options(pullback_momentum, 'pullback_momentum', ['none', 'reset', 'pullback']) self._optimizer_step_pre_hooks: Dict[int, Callable] = {} self._optimizer_step_post_hooks: Dict[int, Callable] = {} self.alpha = alpha self.k = k self.pullback_momentum = pullback_momentum self.optimizer = optimizer self.param_groups = self.optimizer.param_groups self.state: STATE = defaultdict(dict) for group in self.param_groups: if 'counter' not in group: group['counter'] = 0 for p in group['params']: state = self.state[p] state['slow_params'] = torch.empty_like(p) state['slow_params'].copy_(p) if self.pullback_momentum == 'pullback': state['slow_momentum'] = torch.zeros_like(p) self.defaults: DEFAULTS = { 'lookahead_alpha': alpha, 'lookahead_k': k, 'lookahead_pullback_momentum': pullback_momentum, **optimizer.defaults, }
(self, optimizer: Type[torch.optim.optimizer.Optimizer], k: int = 5, alpha: float = 0.5, pullback_momentum: str = 'none')
[ -0.004810182843357325, -0.04187912866473198, -0.047872770577669144, 0.05363735556602478, -0.030960777774453163, 0.017036063596606255, -0.06627362966537476, -0.02223755046725273, -0.05409546568989754, -0.008126727305352688, -0.024050913751125336, 0.069938525557518, -0.009462889283895493, 0.04359705373644829, -0.03084625117480755, 0.059478290379047394, 0.026933204382658005, 0.0073345741257071495, -0.020481452345848083, -0.022581135854125023, 0.009462889283895493, -0.06341042369604111, -0.030483577400445938, 0.09673811495304108, -0.01962249167263508, 0.006833513267338276, -0.01492683682590723, -0.008837755769491196, -0.03521740809082985, -0.0028059398755431175, -0.011834576725959778, -0.013361618854105473, -0.0016678163083270192, 0.048254530876874924, 0.010632030665874481, -0.030120905488729477, 0.0030874882359057665, 0.020328747108578682, -0.10231181979179382, -0.009663313627243042, 0.07310713827610016, -0.058485712856054306, 0.03517923131585121, -0.007864266633987427, -0.0034024405758827925, 0.008160131052136421, 0.034892912954092026, -0.015098628588020802, 0.05608062073588371, -0.04508591815829277, 0.012493113055825233, -0.004542950075119734, 0.00961559358984232, -0.019355257973074913, -0.042146362364292145, 0.023077424615621567, 0.07177098095417023, -0.002419407246634364, 0.01958431489765644, -0.017446456477046013, -0.02989184856414795, -0.01714104786515236, 0.021760350093245506, 0.06745708733797073, -0.032258763909339905, -0.04829270765185356, -0.08452177792787552, -0.014220579527318478, -0.0011578081175684929, 0.007420470006763935, 0.05936376005411148, 0.02414635382592678, 0.019889723509550095, 0.023306479677557945, -0.0395885668694973, -0.03250690922141075, -0.05646238103508949, -0.009019092656672001, -0.05172855034470558, -0.007964478805661201, -0.021435853093862534, 0.028632039204239845, -0.06627362966537476, -0.031476154923439026, 0.001889714621938765, -0.07963524758815765, -0.002729587722569704, -0.043673403561115265, 0.018152713775634766, -0.0319533571600914, -0.0524538978934288, 0.0009251727606169879, 0.029376473277807236, 0.057531312108039856, 0.04096290469169617, 0.03811878710985184, -0.018715810030698776, -0.020309660583734512, -0.04012303054332733, -0.034530241042375565, -0.020080603659152985, 0.0010528239654377103, -0.008312835358083248, 0.03876778110861778, 0.023554624989628792, -0.02756310999393463, -0.02756310999393463, -0.036439042538404465, -0.0076781585812568665, -0.05703502148389816, -0.01304666604846716, -0.006103396415710449, -0.06260872632265091, -0.001056999433785677, -0.033995773643255234, 0.0058409362100064754, -0.010288446210324764, -0.032621435821056366, -0.0034286866430193186, 0.02208484709262848, 0.023630976676940918, -0.005945920012891293, -0.0456203818321228, 0.03615272045135498, -0.0437115803360939, -0.013819730840623379, 0.0642121210694313, 0.017608704045414925, -0.005258751101791859, -0.06207426264882088, 0.021932141855359077, 0.009314957074820995, -0.011968192644417286, 0.015365861356258392, -0.008021743036806583, -0.014497355557978153, 0.03428209573030472, 0.019488874822854996, -0.03449206426739693, 0.016072118654847145, 0.03865325450897217, 0.010918350890278816, -0.026723237708210945, -0.018773073330521584, -0.006122484337538481, -0.02340191975235939, 0.021760350093245506, -0.010088021866977215, 0.039664920419454575, -0.02051962912082672, 0.01825769804418087, -0.008465539664030075, 0.03458750247955322, -0.02571157179772854, 0.03403395041823387, -0.01920255459845066, -0.004473756067454815, -0.00855620764195919, -0.003347562626004219, 0.006480385083705187, -0.021015917882323265, -0.01025981456041336, -0.03391942381858826, -0.06986217945814133, -0.019946986809372902, 0.005024923011660576, -0.00335472053848207, -0.015671269968152046, -0.057531312108039856, 0.03876778110861778, 0.005750267766416073, -0.04970522224903107, 0.0032067883294075727, 0.037183474749326706, -0.05390458554029465, 0.046689312905073166, 0.03222058713436127, 0.013313897885382175, 0.004132557660341263, -0.03514105826616287, 0.020309660583734512, 0.02017604373395443, -0.061005331575870514, -0.07932984083890915, -0.019889723509550095, -0.00981124583631754, -0.006623545195907354, 0.015174981206655502, -0.013657483272254467, 0.06123438850045204, 0.03876778110861778, -0.005640511866658926, 0.055278923362493515, -0.015251332893967628, -0.03842419758439064, 0.008064690977334976, 0.049361634999513626, 0.024680817499756813, 0.06875506788492203, 0.02912832796573639, 0.006819197442382574, 0.017427368089556694, 0.009310184977948666, 0.016787918284535408, 0.02490987442433834, 0.007549314294010401, -0.009963950142264366, 0.046536609530448914, 0.0043854741379618645, 0.014354195445775986, -0.06948041915893555, -0.04886534810066223, 0.03267870098352432, 0.06921318173408508, -0.026875941082835197, -0.034377533942461014, 0.03596184030175209, 0.0551643967628479, 0.08070417493581772, 0.008236483670771122, 0.05768401548266411, -0.007110289763659239, -0.000767696532420814, 0.0016189032467082143, 0.03403395041823387, 0.006504245102405548, 0.01770414412021637, -0.025558866560459137, -0.03706894814968109, -0.008317607454955578, 0.009439028799533844, -0.08696504682302475, -0.012998946011066437, -0.027639461681246758, 0.033022284507751465, 0.023650065064430237, -0.022371167317032814, -0.025215283036231995, -0.04527679830789566, -0.07360342890024185, 0.036076370626688004, -0.01576671004295349, 0.008327151648700237, 0.0007486085523851216, -0.0513467900454998, -0.022390255704522133, 0.043291643261909485, 0.0033976687118411064, 0.0034286866430193186, 0.03277414292097092, -0.030960777774453163, 0.0009108567610383034, -0.023497359827160835, 0.029815496876835823, -0.03615272045135498, -0.026379652321338654, 0.025577954947948456, 0.0028918359894305468, 0.015671269968152046, -0.014392372220754623, -0.029796408489346504, -0.058485712856054306, -0.09055359661579132, 0.04077202454209328, 0.0018527315696701407, 0.005988868419080973, 0.02128314971923828, -0.04565855860710144, -0.010536590591073036, -0.02571157179772854, 0.09765434265136719, 0.0013290038332343102, -0.03955039009451866, 0.02263839915394783, -0.024299057200551033, -0.011672328226268291, -0.017646880820393562, -0.027925781905651093, -0.04932345822453499, -0.001274125766940415, 0.07009123265743256, -0.03231602907180786, -0.03294593468308449, 0.001442339038476348, -0.013991523534059525, 0.03296502307057381, -0.05401911586523056, -0.03447297587990761, 0.05001062899827957, -0.00998303759843111, 0.03256417438387871, -0.01653023064136505, 0.0758558139204979, 0.007654298562556505, 0.09437119960784912, -0.025577954947948456, -0.037794291973114014, 0.019679754972457886, 0.004077679477632046, -0.0131134744733572, 0.06505199521780014, -0.09269145876169205, 0.0034597048070281744, 0.04508591815829277, 0.0021831931080669165, 0.01368611492216587, 0.023726416751742363, 0.032067883759737015, 0.05352282524108887, -0.00512990728020668, 0.04145919159054756, 0.02529163472354412, 0.006766705308109522, -0.00816967524588108, 0.02036692388355732, -0.1087253987789154, -0.008914108388125896, -0.0677243173122406, 0.006718985270708799, 0.05665326118469238, -0.0059745521284639835, 0.007687702775001526, -0.010040301829576492, -0.009963950142264366, -0.025005314499139786, -0.04092472791671753, 0.0159766785800457, -0.004981975071132183, -0.03120892308652401, -0.02359279990196228, -0.07402336597442627, -0.008723228238523006, 0.028479335829615593, 0.033804893493652344, -0.06703715026378632, 0.0033976687118411064, 0.013915170915424824, 0.036801714450120926, -0.0016224822029471397, -0.03159068524837494, 0.11048149317502975, -0.007787914946675301, -0.04126831144094467, 0.033003196120262146, 0.029815496876835823, 0.0018240995705127716, 0.046116672456264496, -0.03136162832379341, 0.05363735556602478, 0.027544021606445312, -0.02662779577076435, 0.00940562505275011, -0.002817869884893298, 0.06696079671382904, 0.08505624532699585, 0.019660666584968567, -0.025730660185217857, -0.012445393018424511, -0.0007330995285883546, -0.047491010278463364, 0.047109249979257584, 0.02475716918706894, -0.026952292770147324, 0.02679958939552307, 0.06676991283893585, -0.021244972944259644, -0.02223755046725273, -0.041802778840065, 0.028765656054019928, -0.026016980409622192, -0.0018181344494223595, -0.09498202055692673, 0.01903076283633709, 0.061730675399303436, 0.0005452017649076879, -0.005215803161263466, -0.040275733917951584, -0.00921951700001955, 0.04703289642930031, 0.019154833629727364, 0.057531312108039856, 0.01018346194177866, 0.01939343474805355, 0.03535102307796478, 0.0037340952549129725, -0.006823969539254904, -0.020290572196245193, -0.0256733950227499, 0.09750163555145264, -0.02723861299455166, 0.026341475546360016, 0.0018360295798629522, 0.03590457886457443, -0.008899792097508907, 0.0007325030164793134, 0.04966704547405243, 0.0616925023496151, 0.016807006672024727, -0.03630542755126953, -0.02208484709262848, 0.011643695645034313, -0.03517923131585121, 0.01121421530842781, 0.009496293030679226, 0.02053871564567089, -0.03178156539797783, 0.04126831144094467, 0.08910290896892548, -0.01123330369591713, 0.06573916226625443, -0.023860033601522446, -0.02628421224653721, -0.02511984296143055, -0.00003608829865697771, -0.027467669919133186, -0.036629922688007355, 0.04016120731830597, -0.008145814761519432, 0.013103930279612541, -0.013829275034368038, 0.026685060933232307, 0.03369036689400673, 0.016864271834492683, -0.018801705911755562, 0.024299057200551033, 0.04058114439249039, -0.034530241042375565, -0.0002599252329673618, -0.050163332372903824, -0.020080603659152985, -0.03176247701048851, -0.0014626199845224619, -0.0007295205141417682, 0.025215283036231995, 0.018983041867613792, 0.020347835496068, -0.003724551061168313, -0.006952813360840082, 0.018687177449464798, -0.02153129316866398, 0.010946983471512794, -0.013457058928906918, 0.021187709644436836, 0.00509650306776166, 0.00940562505275011, -0.038347844034433365, 0.02532981149852276, 0.03935950994491577, -0.014755044132471085, -0.013266177847981453, 0.038519635796546936, 0.01619618944823742, 0.01674019917845726, 0.005058326758444309, 0.020347835496068, -0.00979215744882822, -0.0540572889149189, 0.024814434349536896, -0.011185583658516407, -0.0053255595266819, -0.0001934153842739761, 0.03220149874687195, -0.016845183447003365, 0.003817605320364237, 0.002146210055798292, 0.1023881733417511, 0.06734255701303482, -0.013838819228112698, -0.017608704045414925, 0.0032998425886034966, -0.05001062899827957, -0.042528122663497925, -0.02758219838142395, 0.014029699377715588, -0.04485686123371124, -0.034530241042375565, -0.022123022004961967, 0.009481976740062237, -0.008961828425526619, -0.019756106659770012, 0.03044540248811245, -0.022542959079146385, 0.028402982279658318, 0.06493746489286423, -0.007511138450354338, -0.0027176577132195234, 0.01159597560763359, 0.0036959191784262657, -0.011319199576973915, 0.009563101455569267, -0.08467448502779007, -0.005316015332937241, 0.10162465274333954, 0.02968188002705574, -0.0007724685710854828, 0.013437970541417599, 0.01619618944823742, 0.05646238103508949, 0.0833001434803009, -0.008909336291253567, -0.02185579016804695, 0.011090143583714962, -0.045582205057144165, -0.028269367292523384, 0.015585373155772686, -0.003440616652369499, -0.06218878924846649, -0.014373283833265305, -0.03619089722633362, 0.036248162388801575, 0.05214848741889, -0.017818672582507133, -0.016129381954669952, 0.02628421224653721, -0.031285274773836136, 0.004939026664942503, -0.0543626993894577, 0.02834571897983551, -0.023478271439671516, -0.02053871564567089, 0.05428634583950043, 0.05466810613870621, 0.031514331698417664, -0.060203634202480316, 0.028441159054636955, 0.02072959579527378, 0.021073181182146072, -0.000314057688228786, 0.06123438850045204, -0.004247085656970739, -0.02303924784064293, -0.04546767845749855, -0.03876778110861778, 0.09139347076416016, -0.0038629393093287945, -0.020691420882940292, -0.001320652780123055, 0.023306479677557945, -0.06745708733797073, -0.019107114523649216, 0.01958431489765644, 0.0548589862883091, 0.014287387952208519, -0.04852176457643509, -0.0026031294837594032, 0.03974127024412155, -0.0453149750828743, 0.06268507987260818, -0.07348889857530594, 0.003963151481002569, -0.01772323250770569, -0.0019815757405012846, -0.03725982829928398, 0.005607107654213905, 0.01656840741634369, -0.005635739769786596, 0.03210606053471565, 0.013628850691020489, 0.039664920419454575, 0.02834571897983551, -0.0029944342095404863, -0.004173119552433491, 0.01465005986392498, 0.00017104661674238741, -0.0264750923961401, 0.009830333292484283, 0.0089427400380373, -0.002667551627382636, -0.029261944815516472, 0.040237560868263245, 0.01532768551260233, -0.08192580938339233, -0.0038629393093287945, 0.01056522224098444, -0.061196211725473404, 0.0007760475855320692, 0.02798304706811905, 0.025043491274118423, 0.0070864297449588776, -0.008155358955264091, 0.07280173152685165, -0.022695662453770638, 0.007682930678129196, 0.0011548255570232868, -0.029930025339126587, 0.04134466499090195, -0.04409334063529968, 0.007577946409583092, -0.03160976991057396, -0.010240726172924042, -0.01633935049176216, 0.007687702775001526, -0.022409342229366302, -0.013075297698378563, -0.020233307033777237, -0.023153776302933693, -0.060241810977458954, -0.004886534530669451, 0.08497989177703857, 0.03920680657029152, -0.02851751074194908, -0.026761412620544434, 0.0008380836807191372, 0.01672111079096794, -0.02870839089155197, 0.002005435759201646, -0.0316479466855526, 0.03670627623796463, 0.015575829893350601, -0.01862036995589733, -0.007697246503084898, -0.03790881857275963, -0.0017739934846758842, 0.02055780403316021, -0.029605528339743614, -0.04130648821592331, 0.013476146385073662, 0.03559916839003563, 0.06726620346307755, -0.0038390792906284332, -0.02053871564567089, 0.043864283710718155, 0.01285578589886427, 0.06363947689533234, -0.02473808266222477, -0.043482523411512375, 0.05081232637166977, -0.12788978219032288, 0.014325563795864582, -0.013667026534676552, 0.0012371427146717906, 0.025005314499139786, -0.008465539664030075, -0.030369048938155174, -0.0256733950227499, -0.025807011872529984, 0.05692049488425255, 0.028689304366707802, 0.007606578525155783, -0.025272546336054802, 0.004266174044460058, 0.03630542755126953, 0.02490987442433834, -0.0038557813968509436, -0.012130441144108772, -0.021569469943642616, -0.010803822427988052, 0.035847313702106476, 0.06455570459365845, 0.06474658846855164, -0.006399260833859444, 0.015098628588020802, -0.03903501480817795, 0.020271483808755875, -0.03231602907180786, 0.008603927679359913, 0.04313893988728523, 0.05233936756849289, 0.07963524758815765, -0.04890352487564087, -0.053751882165670395, -0.005650055594742298, -0.004249471705406904, 0.03563734516501427, -0.009019092656672001, 0.012731713242828846, -0.05497351661324501, -0.03267870098352432, -0.010164373554289341, 0.035274673253297806, -0.059249233454465866, -0.033423133194446564, -0.028441159054636955, 0.02017604373395443, 0.012283144518733025, 0.0037961311172693968, 0.01712195947766304, -0.03842419758439064, -0.028040310367941856, -0.008355783298611641, 0.04718559980392456, 0.04489503800868988, -0.01349523477256298, 0.01884942688047886, 0.005072643049061298, 0.009973493404686451, -0.049399811774492264, 0.02662779577076435, 0.05001062899827957, -0.036801714450120926, -0.03861507773399353, -0.0039178174920380116, 0.023554624989628792, 0.03307954967021942, 0.009634681046009064, -0.051652200520038605, -0.07054934650659561, -0.05310288816690445, 0.03830966725945473, -0.04035208746790886, 0.01634889468550682, -0.005273067392408848, -0.08215486258268356, -0.019116658717393875, -0.017417823895812035, 0.018410401418805122, -0.014354195445775986, -0.01019300613552332, 0.052606601268053055, -0.04684201627969742, 0.01886851340532303, 0.025654306635260582, 0.013915170915424824, -0.03903501480817795, 0.05634785443544388, 0.03594275191426277, 0.0015139190945774317, -0.021779438480734825, -0.04814000055193901, 0.03596184030175209, -0.00461214454844594, 0.0071723260916769505, 0.005965008400380611, 0.013065754435956478, -0.023497359827160835, -0.03422483056783676, 0.025158017873764038, -0.011624608188867569, 0.038920484483242035, -0.010040301829576492, 0.005053555127233267, 0.015728533267974854, -0.004516704007983208, -0.06161614879965782, 0.007177097722887993, -0.06562463194131851, 0.04191730543971062, -0.002171263098716736, 0.055469803512096405, 0.10368616133928299, 0.03006364218890667, 0.02951008826494217, -0.05749313533306122, -0.0025053033605217934, 0.03559916839003563, 0.04336799681186676, -0.0035432148724794388, -0.049018051475286484, 0.05913470685482025, -0.031285274773836136, 0.0068955495953559875, -0.023497359827160835, 0.04344434663653374, 0.029338296502828598, 0.029395559802651405, -0.043482523411512375, 0.003910659346729517, -0.012760345824062824, -0.060241810977458954, -0.10139559209346771, -0.031170746311545372, -0.08200216293334961, 0.056195151060819626, -0.022981984540820122, -0.012607641518115997, 0.0025220054667443037, 0.0616925023496151, 0.004247085656970739 ]
717,082
pytorch_optimizer.optimizer.lookahead
backup_and_load_cache
Backup cache parameters.
def backup_and_load_cache(self): r"""Backup cache parameters.""" for group in self.param_groups: for p in group['params']: state = self.state[p] state['backup_params'] = torch.empty_like(p) state['backup_params'].copy_(p) p.data.copy_(state['slow_params'])
(self)
[ 0.017491891980171204, -0.011350649408996105, -0.04593507573008537, 0.014376898296177387, -0.04156875982880592, 0.006895586382597685, -0.05761408805847168, -0.02403249405324459, -0.002547018462792039, -0.020003411918878555, -0.02788408286869526, 0.0028487558010965586, -0.04632556065917015, 0.04529610276222229, 0.004747926257550716, 0.002153206616640091, 0.010969040915369987, 0.02625115029513836, -0.00034999314812012017, -0.05456121638417244, 0.01925794407725334, -0.035782501101493835, 0.010631805285811424, 0.037628423422575, 0.010862545110285282, -0.04337918385863304, 0.028860291466116905, -0.03663446754217148, 0.02270129881799221, 0.06027647480368614, 0.028860291466116905, -0.034060824662446976, -0.000024422561182291247, 0.051756832748651505, 0.0004517740453593433, -0.016817420721054077, 0.030901456251740456, 0.049307435750961304, -0.0757538303732872, 0.0029219714924693108, 0.03666996583342552, -0.059814997017383575, 0.002008994109928608, -0.021015120670199394, 0.04203024134039879, 0.01913369819521904, -0.016977164894342422, -0.00106828345451504, 0.06198040395975113, -0.03246339038014412, 0.01833498291671276, 0.005551080219447613, 0.02106836810708046, 0.04447963833808899, -0.020198654383420944, -0.005218281410634518, 0.06364883482456207, 0.05718810483813286, 0.014155032113194466, -0.002928627422079444, 0.028540804982185364, -0.0626903772354126, 0.009815338999032974, 0.017429770901799202, 0.01206949446350336, -0.02932177297770977, -0.06730518490076065, -0.018601221963763237, 0.0023717444855719805, 0.024351980537176132, 0.0027311670128256083, -0.01964842714369297, 0.02431648224592209, 0.02403249405324459, -0.08029764145612717, 0.016240570694208145, -0.007561183534562588, -0.01638256385922432, -0.04621906578540802, 0.0018259547650814056, -0.05683312192559242, -0.05814656615257263, -0.06936409324407578, -0.00282435049302876, -0.056442636996507645, -0.015965456143021584, 0.005156158935278654, -0.04011332243680954, 0.047071028500795364, -0.05754309147596359, -0.03329760581254959, 0.048916950821876526, 0.011102160438895226, 0.03613748773932457, 0.09314809739589691, -0.043201692402362823, -0.0482424795627594, 0.026996619999408722, -0.03887087106704712, -0.02658838778734207, -0.04181724786758423, -0.08036863803863525, 0.023553263396024704, -0.03063521720468998, 0.04589957743883133, -0.06950609385967255, 0.027937330305576324, -0.06829913705587387, 0.005426835268735886, -0.018760964274406433, -0.052679795771837234, 0.02953476272523403, -0.049733418971300125, -0.0030262484215199947, 0.021245861425995827, -0.027759836986660957, -0.03595999628305435, 0.00626105023548007, -0.023038536310195923, 0.02319827862083912, 0.022949788719415665, 0.05814656615257263, -0.03024473413825035, 0.04192374646663666, -0.012806088663637638, 0.04866846278309822, 0.04206573963165283, 0.03613748773932457, -0.030919205397367477, -0.04621906578540802, -0.010090452618896961, -0.020180905237793922, -0.05250230059027672, 0.03143393248319626, 0.009646721184253693, -0.06584974378347397, 0.06471379101276398, -0.01586783491075039, 0.00454159127548337, -0.005551080219447613, -0.008186845108866692, 0.024369729682803154, 0.041497763246297836, 0.01562822051346302, 0.07717376947402954, -0.036492470651865005, 0.06634671986103058, 0.0006029200740158558, -0.022133324295282364, -0.044444140046834946, 0.09037921577692032, 0.04323719069361687, -0.05189882591366768, -0.05378025025129318, -0.025168446823954582, -0.01601870357990265, -0.031700171530246735, 0.023180529475212097, -0.021405603736639023, -0.04614806920289993, -0.02658838778734207, 0.033244356513023376, -0.033350855112075806, -0.017172405496239662, 0.0058838785625994205, 0.026819126680493355, 0.03544526547193527, 0.007911731489002705, -0.010418813675642014, 0.0006234426400624216, -0.030688464641571045, -0.036385975778102875, 0.00325698871165514, 0.02259480394423008, -0.04256271943449974, 0.043343685567379, -0.03777042031288147, -0.07759974896907806, 0.03766392171382904, 0.00221976637840271, -0.0361197367310524, -0.003929241560399532, -0.01715465635061264, -0.017128033563494682, -0.016781922429800034, -0.03223264962434769, 0.007676553446799517, 0.015965456143021584, 0.008550704456865788, 0.020908623933792114, 0.02403249405324459, 0.026304399594664574, 0.014518892392516136, -0.03777042031288147, -0.046254564076662064, -0.009495852515101433, -0.00993070937693119, -0.03830289468169212, 0.03947434574365616, 0.11813905090093613, -0.0444086417555809, -0.06070245802402496, 0.05793357640504837, -0.04813598468899727, 0.030262483283877373, -0.0162050724029541, -0.052182815968990326, -0.003946991171687841, -0.00488548306748271, 0.057152606546878815, 0.012291360646486282, -0.0037450932431966066, 0.05221831426024437, -0.024209987372159958, 0.030794961377978325, -0.010977915488183498, 0.013516059145331383, 0.06485578417778015, 0.0678376629948616, -0.011261903680860996, -0.01562822051346302, -0.0025891729164868593, -0.059708502143621445, 0.035090282559394836, -0.011421646922826767, 0.010489811189472675, 0.010374440811574459, -0.04650305211544037, -0.08256954699754715, 0.024760212749242783, 0.0444086417555809, -0.0010771580273285508, -0.017598388716578484, -0.05864354595541954, 0.04746151342988014, -0.0015109054511412978, -0.04934293404221535, -0.010667303577065468, 0.005697511602193117, -0.009398231282830238, 0.004233197774738073, 0.008129159919917583, 0.014882751740515232, -0.02625115029513836, -0.008173532783985138, -0.036279480904340744, 0.023091783747076988, -0.02635764703154564, 0.01851247437298298, 0.014066286385059357, 0.04394716024398804, 0.04806498810648918, -0.04380516707897186, 0.031806670129299164, -0.015273235738277435, -0.06574324518442154, 0.03370583802461624, 0.022009078413248062, 0.021458851173520088, -0.01863672025501728, -0.00742806401103735, -0.04203024134039879, -0.03136293590068817, -0.04845547303557396, 0.013205447234213352, 0.048490971326828, 0.031096698716282845, -0.004894357640296221, -0.016009829938411713, -0.0009157507447525859, 0.06027647480368614, 0.04536709934473038, -0.0313451886177063, 0.047390516847372055, 0.000008961294952314347, 0.027830835431814194, 0.011208655312657356, -0.01303682941943407, -0.007481311913579702, 0.011670136824250221, 0.10216472297906876, 0.010951291769742966, -0.001061627408489585, -0.03400757536292076, 0.00648735323920846, -0.009096493944525719, -0.01924019493162632, 0.004282008390873671, 0.037699420005083084, 0.009371607564389706, 0.016213946044445038, 0.041781749576330185, 0.03972283750772476, -0.05097586661577225, -0.021103866398334503, 0.0034078573808073997, -0.02607365883886814, 0.008155783638358116, 0.02035839855670929, 0.0637553334236145, -0.005218281410634518, -0.05026589706540108, 0.06528176367282867, 0.07546984404325485, 0.05037239193916321, 0.01196299958974123, -0.002271904842928052, 0.012504351325333118, 0.001710584620013833, 0.004113390110433102, 0.05729459971189499, -0.02115711383521557, 0.014634262770414352, 0.024653717875480652, 0.016737548634409904, -0.08001364767551422, 0.015814587473869324, 0.006314298138022423, -0.016755297780036926, 0.016560057178139687, -0.026393145322799683, 0.016755297780036926, -0.02749359980225563, 0.05097586661577225, -0.010480936616659164, 0.006536163855344057, 0.03808990493416786, 0.0324101448059082, 0.014385772868990898, -0.05427722632884979, -0.043343685567379, 0.0026690445374697447, -0.004412909038364887, 0.0724879652261734, -0.02484896034002304, 0.06606273353099823, -0.0425272211432457, -0.01562822051346302, 0.05761408805847168, 0.03439806029200554, 0.07696077972650528, -0.008768132887780666, -0.04771000146865845, -0.03688295558094978, 0.018689967691898346, 0.00448168721050024, 0.02809707447886467, 0.05243130400776863, -0.01501587126404047, -0.02026965096592903, -0.02964125946164131, 0.018192987889051437, 0.016542308032512665, 0.11331125348806381, 0.10308768600225449, 0.0019191383616998792, 0.04249172285199165, -0.025310439988970757, 0.0035609446931630373, -0.06016997992992401, 0.057969074696302414, -0.02168959192931652, -0.05896303057670593, 0.0019768234342336655, 0.08469945192337036, 0.012140491977334023, -0.005333651788532734, -0.03178891912102699, -0.002815475920215249, -0.09236713498830795, 0.007796361111104488, -0.029854251071810722, 0.03713144734501839, -0.010001705959439278, 0.012140491977334023, -0.05782707780599594, -0.07972966134548187, 0.013090076856315136, -0.00651397742331028, 0.04856196790933609, 0.025700924918055534, -0.034966036677360535, 0.04508311301469803, -0.014980372972786427, 0.008129159919917583, 0.04756800830364227, 0.037095945328474045, -0.026819126680493355, 0.06968358159065247, -0.011119909584522247, 0.026641635224223137, 0.025931663811206818, -0.007259446196258068, 0.02665938436985016, 0.04135577008128166, 0.046361058950424194, 0.042917702347040176, 0.018547972664237022, -0.04568658769130707, -0.07674778997898102, 0.018405979499220848, -0.07128101587295532, -0.03826739639043808, 0.042385224252939224, 0.01283271238207817, -0.051756832748651505, 0.00971771776676178, 0.059211522340774536, 0.005049663595855236, -0.03198416158556938, -0.02870054915547371, -0.043911661952733994, 0.020642386749386787, -0.0030883706640452147, 0.031078949570655823, -0.029996244236826897, 0.03523227572441101, -0.013516059145331383, 0.026215652003884315, 0.046254564076662064, 0.04785199835896492, 0.020198654383420944, 0.010480936616659164, -0.046077072620391846, 0.02442297711968422, -0.013081202283501625, -0.06158992275595665, -0.03759292513132095, -0.05385124683380127, 0.021955830976366997, -0.004024643916636705, -0.02777758799493313, -0.016063077375292778, -0.004610369447618723, 0.030652966350317, 0.016515683382749557, 0.06261938065290451, 0.005160596687346697, 0.0027311670128256083, 0.039154861122369766, 0.012033996172249317, -0.015042494982481003, 0.03024473413825035, -0.018175238743424416, -0.035480763763189316, 0.022364063188433647, -0.009966207668185234, 0.06705669313669205, 0.013471686281263828, 0.038835372775793076, 0.0019468716345727444, 0.030102739110589027, 0.04242072254419327, -0.037699420005083084, -0.005697511602193117, -0.0029086594004184008, -0.011652386747300625, -0.025825168937444687, -0.012628596276044846, 0.002806601347401738, 0.042917702347040176, -0.020997371524572372, 0.009939583949744701, 0.037734922021627426, 0.02078437991440296, 0.0017139125848188996, 0.01821073703467846, 0.00031976395985111594, 0.02554118074476719, 0.00908318255096674, -0.05285728722810745, -0.04132027179002762, -0.01629381813108921, -0.05718810483813286, -0.02067788504064083, -0.016453560441732407, 0.007618868723511696, 0.02381950244307518, -0.004361880011856556, -0.013258694671094418, -0.010401064530014992, -0.021707341074943542, 0.02749359980225563, 0.04305969551205635, -0.0059593128971755505, -0.035072531551122665, 0.006860087625682354, 0.04405365511775017, -0.011989623308181763, 0.0075389971025288105, -0.06751817464828491, -0.03642147406935692, 0.017598388716578484, 0.03164692595601082, -0.029463766142725945, 0.0019091544672846794, -0.031309690326452255, 0.06364883482456207, 0.03269413113594055, -0.04884595423936844, -0.0009612332214601338, -0.007494623772799969, 0.009655595757067204, -0.0006822370924055576, -0.02350001595914364, 0.020819878205657005, 0.004306413233280182, -0.014323649927973747, 0.014483394101262093, 0.034256067126989365, -0.025203945115208626, -0.0392613559961319, -0.023837251588702202, 0.03528552129864693, -0.05133084952831268, -0.00810253620147705, -0.040255315601825714, 0.018565723672509193, 0.012238112278282642, -0.017944497987627983, 0.0629388615489006, 0.05527118593454361, 0.07923268526792526, -0.05566167086362839, -0.006238863803446293, -0.005466771312057972, -0.003114994615316391, -0.023287024348974228, 0.0003605317906476557, -0.017509641125798225, -0.02902003563940525, -0.030599718913435936, 0.045438095927238464, 0.04561559110879898, 0.05903402715921402, -0.03684745728969574, 0.02870054915547371, -0.067589171230793, -0.056549131870269775, -0.044941119849681854, -0.02362426184117794, -0.002540362300351262, 0.05086937174201012, -0.04465712979435921, 0.017988871783018112, 0.07447588443756104, -0.04785199835896492, 0.039545346051454544, -0.035888995975255966, -0.019488684833049774, -0.023837251588702202, -0.044834621250629425, -0.024511724710464478, -0.033528346568346024, -0.003547632833942771, -0.03104345127940178, -0.034149568527936935, 0.006527289282530546, 0.02543468587100506, 0.020429395139217377, 0.05239580571651459, -0.018370481207966805, 0.0329781211912632, 0.028753796592354774, -0.016560057178139687, -0.018956206738948822, -0.033954329788684845, 0.028256816789507866, -0.03217940405011177, 0.008910126984119415, 0.04998190701007843, -0.03645697236061096, 0.03519677743315697, -0.03551626205444336, 0.023269275203347206, -0.0077120522037148476, 0.014652011916041374, -0.015450728125870228, 0.02788408286869526, -0.0010655100923031569, 0.055626172572374344, -0.010054954327642918, -0.018672218546271324, -0.001345615484751761, 0.00878144521266222, 0.059814997017383575, -0.01084479596465826, 0.06528176367282867, 0.04994640871882439, 0.028150321915745735, 0.005728572607040405, 0.11103934794664383, 0.0425272211432457, -0.013906543143093586, -0.009788715280592442, -0.020606886595487595, -0.007286069914698601, -0.017979998141527176, -0.045154109597206116, -0.016373690217733383, 0.025221694260835648, 0.001239120028913021, 0.05154384300112724, -0.027635592967271805, -0.04934293404221535, -0.011971874162554741, -0.0347352959215641, 0.046964533627033234, 0.014847253449261189, 0.05211181938648224, -0.004565996117889881, -0.012433354742825031, 0.023482266813516617, -0.03706044703722, -0.02096187323331833, -0.024706965312361717, -0.015104617923498154, -0.029357271268963814, -0.004162200726568699, -0.026091407984495163, -0.0899532362818718, 0.018405979499220848, 0.006833463907241821, 0.012131617404520512, -0.053602755069732666, -0.04568658769130707, -0.0037694985512644053, -0.028647299855947495, -0.0008342150831595063, -0.011066662147641182, -0.011545891873538494, -0.06989657133817673, 0.0580400712788105, 0.04124927148222923, 0.0036563468165695667, -0.048206981271505356, 0.056868620216846466, -0.010454311966896057, -0.027866333723068237, -0.0425272211432457, 0.017944497987627983, -0.005848380271345377, 0.020819878205657005, -0.024795711040496826, -0.04888145253062248, -0.05062087997794151, -0.018707716837525368, -0.025363687425851822, 0.006567224860191345, -0.008950063027441502, -0.008714885450899601, -0.00010691153875086457, -0.013933166861534119, 0.016923915594816208, -0.002268576994538307, 0.03084820881485939, 0.03400757536292076, 0.06059596315026283, 0.0329781211912632, -0.08278253674507141, -0.05850154906511307, 0.01995016448199749, -0.03601324185729027, -0.012167115695774555, 0.020198654383420944, -0.0012746185529977083, -0.049520425498485565, 0.055413179099559784, 0.0026246714405715466, 0.009584599174559116, -0.07206198573112488, -0.049839913845062256, -0.043521177023649216, -0.00274891615845263, -0.010054954327642918, -0.025487933307886124, -0.018991705030202866, -0.0324101448059082, -0.04203024134039879, 0.03819639980792999, 0.029694506898522377, -0.000784295320045203, 0.050123900175094604, 0.03475304692983627, -0.03271188214421272, 0.08704235404729843, 0.015077994205057621, 0.0029685632325708866, 0.005156158935278654, 0.006993207149207592, 0.009353858418762684, -0.009123117662966251, 0.08562241494655609, -0.017030412331223488, -0.006238863803446293, -0.04092978686094284, 0.029960745945572853, -0.03851588815450668, 0.01803324557840824, -0.03540976718068123, -0.08107860386371613, -0.00443287706002593, -0.05047888681292534, 0.003137181280180812, -0.012451103888452053, 0.013471686281263828, -0.01441239658743143, 0.0090299341827631, -0.060418471693992615, -0.008515206165611744, 0.03890636935830116, -0.00915861688554287, 0.00925623718649149, 0.0012579786125570536, 0.01883196085691452, 0.014039662666618824, 0.0018181895138695836, -0.06801515072584152, -0.019683925434947014, 0.04014882072806358, -0.034948285669088364, 0.011803255416452885, 0.02229306660592556, -0.020944124087691307, -0.0020056660287082195, -0.027830835431814194, -0.049839913845062256, -0.017403146252036095, 0.023961497470736504, -0.011359523981809616, 0.005169471260160208, 0.027209611609578133, 0.038125403225421906, 0.008825818076729774, 0.012433354742825031, -0.0294282678514719, 0.06446529924869537, -0.011572515591979027, 0.0005186111084185541, 0.04430214688181877, 0.012806088663637638, 0.023943748325109482, -0.0128770861774683, 0.07696077972650528, -0.05335426703095436, 0.009992831386625767, 0.007858483120799065, -0.026091407984495163, 0.0021543160546571016, -0.06450080126523972, 0.03125644102692604, 0.020021161064505577, 0.016950540244579315, 0.05221831426024437, 0.06883161514997482, 0.003940335009247065, 0.050443388521671295, -0.011687885969877243, -0.017323274165391922, -0.0498754121363163, -0.029357271268963814, -0.0700385645031929, -0.03237464651465416, 0.026535138487815857, 0.04671604558825493, -0.03830289468169212, 0.04490562155842781, -0.027440350502729416 ]
717,083
pytorch_optimizer.optimizer.lookahead
clear_and_load_backup
Load backup parameters.
def clear_and_load_backup(self): r"""Load backup parameters.""" for group in self.param_groups: for p in group['params']: state = self.state[p] p.data.copy_(state['backup_params']) del state['backup_params']
(self)
[ 0.018612604588270187, -0.0007808294612914324, -0.04670710116624832, 0.005408190656453371, -0.05306347832083702, 0.0012093802215531468, -0.026373708620667458, -0.009982326067984104, -0.0064661237411201, 0.009780396707355976, -0.042422689497470856, -0.025074338540434837, -0.05443308502435684, 0.037260327488183975, -0.017629295587539673, -0.007480159401893616, -0.02330087311565876, 0.03697938099503517, 0.011237798258662224, -0.0840025469660759, -0.01004378218203783, -0.0020302664488554, 0.016075318679213524, 0.048884425312280655, 0.015416854992508888, -0.06314238160848618, 0.021825911477208138, -0.03813827782869339, 0.013985791243612766, 0.06198348104953766, 0.03167654573917389, -0.02200150303542614, -0.031342923641204834, 0.04214174300432205, 0.0006474903202615678, -0.022212211042642593, 0.0454077310860157, 0.018243864178657532, -0.06928805261850357, -0.002208051737397909, 0.034608907997608185, -0.04154473543167114, 0.028094496577978134, -0.027602842077612877, 0.06928805261850357, 0.04481071978807449, -0.002302431734278798, 0.014108704403042793, 0.03232622891664505, -0.002251949394121766, 0.03680378943681717, 0.017602957785129547, -0.00942921545356512, 0.05559198558330536, -0.014117483980953693, -0.012212326750159264, 0.04084237292408943, 0.04702316224575043, 0.04677733778953552, -0.01096563320606947, 0.02851591445505619, -0.03796268627047539, -0.019841738045215607, -0.01646161824464798, 0.04407324269413948, -0.0454428493976593, -0.04667198285460472, 0.005092127248644829, -0.005232600029557943, 0.038559697568416595, -0.013011263683438301, 0.0006617570761591196, 0.007357246242463589, 0.021527407690882683, -0.022440478205680847, 0.017023509368300438, -0.0009427020559087396, -0.00466193025931716, -0.04351134970784187, -0.01100075151771307, -0.03687402606010437, -0.039894185960292816, -0.041053082793951035, 0.03817339614033699, -0.024108588695526123, -0.008810258470475674, 0.03281788527965546, -0.011483625508844852, 0.057804424315690994, -0.04379229620099068, 0.012870791368186474, 0.03947276622056961, -0.016470398753881454, 0.0129234679043293, 0.08737388253211975, -0.051974818110466, -0.03999954089522362, 0.050113558769226074, -0.042317334562540054, -0.05285277217626572, -0.04807670786976814, -0.11785641312599182, 0.019244730472564697, -0.04017512872815132, 0.047514818608760834, -0.06212395429611206, 0.05959545075893402, -0.08920002728700638, -0.0004768382350448519, 0.020263155922293663, -0.03487229347229004, -0.0031079535838216543, -0.056540172547101974, 0.025478195399045944, 0.023441344499588013, -0.011729451827704906, -0.02070213109254837, 0.010904176160693169, -0.02258095145225525, -0.014187720604240894, -0.00012510830129031092, 0.06809403747320175, -0.02963969297707081, 0.03968347609043121, 0.037225209176540375, 0.04656662791967392, 0.0451970212161541, 0.028744181618094444, -0.02340622805058956, -0.03796268627047539, 0.016382602974772453, -0.009200947359204292, -0.08863813430070877, -0.015372957102954388, 0.004225148819386959, -0.06781309098005295, 0.04705828055739403, -0.01097441278398037, 0.006356379948556423, -0.025407960638403893, 0.005482816603034735, 0.04014001041650772, 0.02653173916041851, 0.03160630911588669, 0.056540172547101974, -0.020912840962409973, 0.06022757664322853, -0.0031518512405455112, -0.051377810537815094, -0.009622365236282349, 0.04733922705054283, 0.0259698498994112, -0.0519045814871788, -0.0842132493853569, -0.018349217250943184, -0.0290075670927763, -0.032782766968011856, 0.018278982490301132, -0.04210662469267845, -0.0710790753364563, 0.006575867999345064, 0.04157985374331474, -0.015890950337052345, -0.025671346113085747, -0.022194651886820793, 0.03999954089522362, 0.042387571185827255, 0.0006507826619781554, -0.017813665792346, -0.019227171316742897, -0.06714584678411484, -0.04790111631155014, -0.022897014394402504, -0.009200947359204292, -0.027515048161149025, 0.058155607432127, -0.03553953766822815, -0.08512632548809052, 0.031220009550452232, 0.00028423729236237705, -0.029569458216428757, -0.01158897951245308, 0.013476578518748283, -0.031992606818675995, 0.011193901300430298, -0.033221740275621414, -0.015267603099346161, 0.016970831900835037, 0.007488938979804516, -0.008046438917517662, -0.005425749812275171, 0.015530988574028015, 0.006211517378687859, 0.0031694103963673115, -0.014187720604240894, -0.017067406326532364, 0.0005273205460980535, -0.022282447665929794, 0.04786599799990654, 0.05629434809088707, -0.039051350206136703, -0.08259782195091248, 0.05632946640253067, -0.07487183064222336, 0.010579333640635014, -0.009315081872045994, -0.020333392545580864, -0.022387802600860596, 0.009710160084068775, 0.03676867112517357, 0.040561430156230927, -0.01822630502283573, 0.044319067150354385, -0.031413160264492035, 0.03803292289376259, -0.04895465821027756, 0.005978859961032867, 0.009086813777685165, 0.06595183163881302, 0.0010650667827576399, -0.02381008490920067, 0.010157916694879532, -0.026233235374093056, -0.009885750710964203, -0.019947092980146408, 0.01935008354485035, -0.026830244809389114, -0.035890720784664154, -0.08948097378015518, 0.02008756436407566, 0.06862080842256546, -0.04316017031669617, -0.003147461451590061, -0.048849307000637054, 0.04797135293483734, -0.005298446398228407, -0.036487728357315063, -0.03740079700946808, 0.010403743013739586, -0.014345752075314522, -0.013546815142035484, 0.0022146364208310843, -0.0004979639779776335, -0.035170797258615494, -0.016400162130594254, 0.0012324264971539378, 0.03148339316248894, -0.02851591445505619, 0.02725166082382202, -0.026847802102565765, 0.06739167124032974, 0.035890720784664154, -0.006848033517599106, 0.017137642949819565, 0.019227171316742897, -0.05703182891011238, 0.04277386888861656, 0.014758390374481678, 0.0178487841039896, -0.0089156124740839, 0.006119332276284695, -0.026356149464845657, 0.00466632004827261, 0.01361705083400011, 0.03513567894697189, 0.05257182568311691, 0.03553953766822815, -0.005399411078542471, 0.004771674517542124, -0.02070213109254837, 0.06019245833158493, 0.011738231405615807, -0.01577681489288807, 0.03806804120540619, -0.007278230506926775, 0.02651418000459671, 0.01516224816441536, -0.04804158955812454, 0.040526311844587326, 0.010122798383235931, 0.08709293603897095, -0.019051579758524895, 0.028937330469489098, 0.00290163466706872, 0.027602842077612877, 0.023774966597557068, 0.0040254145860672, -0.0519396997988224, 0.0003605094680096954, 0.019156934693455696, 0.019648589193820953, 0.009903309866786003, 0.044354185461997986, -0.026988275349140167, -0.0357326865196228, -0.012414255179464817, -0.03172922134399414, 0.0033054931554943323, 0.0014541096752509475, 0.06876128166913986, -0.005491596180945635, -0.06022757664322853, 0.049516551196575165, 0.05432773381471634, 0.01455646101385355, -0.019192053005099297, 0.026145441457629204, -0.011062207631766796, -0.005100906826555729, 0.0064573441632092, 0.033871427178382874, -0.003762028645724058, 0.009762837551534176, 0.00010487422696314752, 0.03411725535988808, -0.08084191381931305, 0.028322763741016388, 0.0005920695839449763, -0.0037269105669111013, 0.011378270573914051, -0.009192167781293392, -0.0003912378160748631, -0.0355570986866951, 0.05675088241696358, -0.010649570263922215, 0.01803315430879593, 0.0006568186217918992, 0.03683890774846077, 0.01591728813946247, -0.03030693717300892, -0.0839323103427887, -0.03185213357210159, -0.011808468028903008, 0.034679144620895386, 0.006224686745554209, 0.02521480992436409, -0.04470536857843399, -0.01689181663095951, 0.042949460446834564, 0.042422689497470856, 0.03381875157356262, 0.0026580027770251036, -0.046917807310819626, -0.027444811537861824, 0.0021685438696295023, 0.024319298565387726, 0.02384520322084427, 0.031992606818675995, -0.007401143666356802, -0.015785595402121544, -0.025004101917147636, 0.04709339886903763, 0.030816150829195976, 0.07178144156932831, 0.08020978420972824, -0.02721654251217842, 0.06152694672346115, 0.025495754554867744, 0.026127882301807404, -0.04909513145685196, 0.08182521909475327, -0.016540635377168655, -0.06756726652383804, 0.0009059377480298281, 0.10184255242347717, 0.011518743820488453, -0.03295835480093956, -0.03257205709815025, -0.030201584100723267, -0.06535482406616211, 0.013397563248872757, -0.04017512872815132, 0.01808583177626133, -0.0387352854013443, 0.026900479570031166, -0.005425749812275171, -0.033853866159915924, 0.01940276101231575, 0.008906832896173, 0.059841275215148926, 0.025495754554867744, -0.03158874809741974, 0.07311592996120453, -0.005934962537139654, -0.02189614810049534, 0.03348512947559357, -0.001981979003176093, -0.024775834754109383, 0.042984578758478165, -0.007993762381374836, 0.04579402878880501, 0.019244730472564697, -0.030763473361730576, 0.01386287808418274, 0.053906314074993134, 0.03624190017580986, 0.02835788205265999, -0.007089470513164997, -0.028867095708847046, -0.04979749396443367, 0.035170797258615494, -0.04330064356327057, -0.06268584728240967, 0.038559697568416595, 0.01996465213596821, -0.053414661437273026, -0.03299347311258316, 0.027620401233434677, -0.013459019362926483, -0.05257182568311691, 0.03757638856768608, -0.02261606976389885, 0.06356380134820938, 0.010632011108100414, 0.03810315951704979, -0.026672212406992912, 0.028761740773916245, 0.015065673738718033, 0.03446843475103378, 0.015346618369221687, 0.04410836100578308, 0.03992930427193642, 0.019911974668502808, -0.027585282921791077, 0.04347623139619827, 0.008502975106239319, -0.06862080842256546, -0.04916536808013916, -0.040456075221300125, 0.009113152511417866, -0.005728643387556076, -0.03834898769855499, -0.040491193532943726, 0.022387802600860596, 0.020491423085331917, 0.04277386888861656, 0.052080173045396805, 0.045583318918943405, 0.008322994224727154, 0.05099150910973549, 0.006150060798972845, -0.008432738482952118, 0.030570324510335922, -0.018401894718408585, -0.04323040693998337, 0.021702999249100685, 0.002758967224508524, 0.06809403747320175, -0.0070236241444945335, 0.0518343448638916, -0.016365043818950653, 0.0003201784857083112, 0.03441575914621353, -0.08793577551841736, -0.014661815017461777, 0.003294518683105707, 0.041825681924819946, 0.00233535491861403, -0.021685440093278885, -0.00516236387193203, 0.06619765609502792, -0.028621267527341843, -0.015926066786050797, 0.02384520322084427, 0.03290567919611931, 0.0022717034444212914, 0.03106197714805603, 0.02258095145225525, 0.03431040421128273, 0.037190090864896774, -0.0454779677093029, -0.021808352321386337, -0.008748801425099373, -0.009174608625471592, -0.028673944994807243, 0.015443193726241589, 0.03446843475103378, 0.026057645678520203, -0.01593484729528427, -0.01165043655782938, -0.005399411078542471, -0.023599376901984215, 0.019051579758524895, 0.044845838099718094, -0.015083232894539833, -0.02008756436407566, -0.021808352321386337, 0.019104257225990295, -0.012528389692306519, -0.02402079477906227, -0.055943164974451065, -0.033414892852306366, -0.01033350732177496, 0.03494253009557724, -0.02395055815577507, -0.025004101917147636, -0.028270086273550987, 0.04379229620099068, 0.054046787321567535, -0.06289655715227127, 0.015715358778834343, 0.01806827262043953, 0.02077236771583557, -0.015724139288067818, -0.019736383110284805, -0.013011263683438301, 0.0066022067330777645, 0.013371224515140057, 0.011395829729735851, 0.026689771562814713, -0.044880956411361694, -0.035170797258615494, 0.0011479235254228115, 0.0450565479695797, -0.054749149829149246, -0.009315081872045994, -0.03172922134399414, 0.027637960389256477, 0.0452321395277977, 0.012063073925673962, 0.03757638856768608, 0.02851591445505619, 0.04906001314520836, -0.0518694631755352, -0.010491538792848587, -0.026777567341923714, -0.05692647397518158, -0.03438064083456993, -0.007089470513164997, 0.01740102842450142, -0.0010134869953617454, -0.03343245014548302, 0.04825229570269585, 0.010114018805325031, 0.05380095914006233, -0.025583550333976746, 0.014433547854423523, -0.10493294149637222, -0.04639103636145592, -0.026689771562814713, -0.012905909679830074, -0.003937619272619486, 0.04835765063762665, -0.0009597123716957867, 0.0011775544844567776, 0.08154427260160446, -0.015293941833078861, 0.030043551698327065, -0.04403812438249588, 0.017207879573106766, -0.006286143325269222, -0.052747417241334915, -0.05892820656299591, -0.02138693444430828, -0.0454779677093029, -0.045513082295656204, -0.040526311844587326, 0.022879455238580704, 0.055346157401800156, -0.0031781899742782116, 0.02788378670811653, 0.017207879573106766, 0.04207150638103485, 0.010737365111708641, 0.019631030037999153, -0.025355283170938492, -0.04800647124648094, 0.0035447352565824986, -0.048182062804698944, 0.009200947359204292, 0.027954023331403732, -0.04396788775920868, 0.03153607249259949, -0.044283948838710785, 0.0259522907435894, 0.006646104156970978, 0.022932132706046104, 0.019929533824324608, 0.0080947270616889, -0.003331831656396389, 0.07599560916423798, -0.0018755270866677165, -0.008322994224727154, -0.025407960638403893, 0.01805071346461773, 0.06352867931127548, 0.0054696472361683846, 0.03968347609043121, 0.01873551681637764, 0.017102524638175964, -0.007111419457942247, 0.11961232125759125, 0.040456075221300125, -0.023476462811231613, -0.038594815880060196, 0.007914746180176735, 0.050851039588451385, -0.02063189633190632, -0.07374805212020874, 0.002442904282361269, 0.043125052005052567, -0.007111419457942247, 0.0776812806725502, -0.01736591011285782, -0.030008433386683464, -0.0007062034565024078, -0.020368508994579315, 0.056048519909381866, 0.019648589193820953, 0.04846300557255745, 0.018507249653339386, -0.03708473592996597, 0.006571478210389614, -0.03153607249259949, -0.021492289379239082, -0.022229770198464394, -0.022844336926937103, -0.06342332810163498, 0.004539017099887133, 0.012185988016426563, -0.08070144057273865, -0.013028822839260101, -0.024371976032853127, 0.0324842631816864, -0.07255403697490692, -0.0004463842196855694, -0.042387571185827255, 0.024389535188674927, -0.009262404404580593, -0.013327326625585556, -0.01777854934334755, -0.0904642790555954, 0.039086468517780304, 0.03954300284385681, 0.003665453754365444, -0.05292300879955292, 0.06289655715227127, -0.033274419605731964, -0.026303471997380257, -0.04010489210486412, 0.03729544207453728, -0.02716386690735817, 0.0003031681408174336, -0.0012719343649223447, -0.03301103413105011, -0.02402079477906227, -0.03599607199430466, -0.02654929831624031, -0.009771617129445076, -0.010886617004871368, 0.0007939987699501216, 0.012660082429647446, -0.022914573550224304, -0.007155316881835461, -0.033291976898908615, 0.002813839353621006, 0.05099150910973549, 0.02014024183154106, 0.02402079477906227, -0.05067544803023338, -0.09404632449150085, 0.004400739446282387, -0.01687425747513771, 0.011404609307646751, 0.03546930104494095, 0.009903309866786003, -0.045548200607299805, 0.08941073715686798, 0.008814647793769836, -0.015337838791310787, -0.050815921276807785, -0.048814188688993454, -0.02263362891972065, -0.017699532210826874, -0.057874660938978195, 0.0000699275842634961, -0.019631030037999153, -0.04087749123573303, 0.0028928550891578197, 0.04674221947789192, 0.0388055220246315, -0.005904234014451504, 0.050254032015800476, 0.01233523990958929, -0.01574169658124447, 0.09390585124492645, -0.007651360239833593, -0.0026360538322478533, 0.027444811537861824, 0.033239301294088364, 0.011255357414484024, 0.01069346722215414, 0.07936695218086243, -0.011264136992394924, -0.05432773381471634, -0.026040086522698402, 0.032080404460430145, -0.07985860854387283, 0.013792641460895538, -0.016048980876803398, -0.07367781549692154, -0.03313394635915756, -0.053976550698280334, 0.014389649964869022, 0.0010195228969678283, 0.020228037610650063, -0.015425634570419788, 0.014073587022721767, -0.06833986192941666, -0.0017295674188062549, 0.04656662791967392, -0.028744181618094444, -0.02532016485929489, -0.024389535188674927, 0.022317565977573395, 0.04280898720026016, -0.039086468517780304, -0.07725986838340759, -0.042422689497470856, 0.027479929849505424, -0.028691504150629044, 0.026707330718636513, 0.012747877277433872, -0.007695258129388094, 0.044389303773641586, -0.0012335239443928003, -0.04832253232598305, -0.016329925507307053, 0.02853347361087799, -0.007546006236225367, 0.008226419799029827, 0.025706464424729347, 0.005416970234364271, 0.044916074723005295, 0.013722405768930912, -0.0053686825558543205, 0.07683844864368439, 0.00870929379016161, 0.006435395684093237, 0.02338866889476776, -0.0081122862175107, 0.014082366600632668, 0.0035293709952384233, 0.08674176037311554, -0.050815921276807785, 0.022124415263533592, 0.035205915570259094, -0.02381008490920067, 0.004247097764164209, -0.0454779677093029, 0.0003083809860982001, 0.003704961622133851, 0.03810315951704979, 0.03771686181426048, 0.00008697222074260935, 0.011553861200809479, 0.017813665792346, -0.006474903319031, -0.026268353685736656, -0.02205418050289154, -0.02012268267571926, -0.05643481761217117, -0.025987409055233, 0.01676890254020691, 0.08554773777723312, -0.005026280879974365, 0.02712874859571457, -0.03127268701791763 ]
717,087
pytorch_optimizer.optimizer.lookahead
load_state_dict
Load state.
def load_state_dict(self, state: STATE): r"""Load state.""" self.optimizer.load_state_dict(state)
(self, state: Dict)
[ -0.012886308133602142, -0.009438959881663322, -0.006291192956268787, 0.014866145327687263, -0.0024270371068269014, 0.0026441244408488274, -0.028638169169425964, 0.010984621942043304, -0.017297523096203804, -0.056963734328746796, -0.03612334281206131, 0.05317772924900055, -0.027926122769713402, 0.03490765392780304, -0.06092340871691704, 0.0036774605978280306, -0.014032529667019844, 0.051267359405756, -0.12295830249786377, -0.06651557981967926, -0.03461241349577904, -0.012269780039787292, 0.02348017320036888, 0.025008467957377434, -0.012512917630374432, -0.049773797392845154, 0.00739833852276206, -0.04626566544175148, 0.025251606479287148, -0.02556421235203743, -0.007367946207523346, -0.013858859427273273, -0.01985047198832035, 0.046091996133327484, -0.011279861442744732, -0.021291932091116905, 0.04508471116423607, -0.006634190678596497, -0.03259784355759621, -0.027353011071681976, -0.022195015102624893, -0.03574126958847046, -0.0030413945205509663, 0.02513003721833229, 0.05349033325910568, -0.015569508075714111, -0.013424684293568134, -0.03435191139578819, 0.050954755395650864, -0.03779057413339615, 0.010689383372664452, -0.050468478351831436, 0.04570992290973663, 0.04105556756258011, 0.020840389654040337, -0.05362927168607712, 0.01558687537908554, -0.016047099605202675, 0.032267872244119644, 0.013268381357192993, -0.017558028921484947, -0.03977040946483612, -0.04393848776817322, -0.007511224132031202, 0.02521687187254429, -0.04828023537993431, -0.02679726853966713, 0.02351490594446659, -0.03155582398176193, -0.01745382696390152, 0.021239830181002617, -0.02196924388408661, 0.04303540661931038, -0.010906470939517021, -0.0520315058529377, 0.0151961175724864, -0.09996440261602402, -0.0023336894810199738, -0.019607333466410637, -0.0037273906636983156, -0.037964243441820145, -0.033032018691301346, -0.04748135432600975, 0.01623813807964325, -0.07231615483760834, -0.048905447125434875, 0.04029142111539841, -0.025321073830127716, -0.05022533982992172, -0.04699508100748062, -0.013667822815477848, 0.06870382279157639, -0.036331746727228165, 0.023219667375087738, 0.04831496998667717, 0.008735597133636475, 0.011271177791059017, 0.036713819950819016, -0.017358308658003807, -0.03461241349577904, -0.016125252470374107, -0.09197558462619781, -0.025477377697825432, -0.026953570544719696, -0.016029734164476395, -0.052170444279909134, 0.016507325693964958, -0.03193789720535278, 0.0031412546522915363, -0.03581073880195618, -0.05206624045968056, -0.005731107201427221, 0.008679154329001904, 0.02349754050374031, 0.01464037410914898, 0.005687689874321222, 0.037547435611486435, -0.010194424539804459, -0.031816329807043076, 0.04376481845974922, -0.010489663109183311, 0.057067934423685074, -0.02469586208462715, 0.04327854514122009, 0.004289647098630667, 0.03622754290699959, 0.004650012124329805, 0.013355216942727566, 0.05074635148048401, -0.06029819697141647, 0.03367459774017334, -0.03574126958847046, -0.04876651242375374, 0.028481867164373398, -0.0074026803486049175, -0.015404521487653255, 0.026467295363545418, 0.004393849056214094, 0.02519950456917286, 0.0397009439766407, 0.06661978363990784, 0.01398042868822813, -0.013641771860420704, -0.02561631239950657, 0.08023550361394882, -0.007467806339263916, -0.012999193742871284, 0.012243729084730148, -0.019190525636076927, -0.009352125227451324, 0.05324719846248627, -0.005557437427341938, -0.03159055858850479, -0.010715434327721596, -0.04591832682490349, -0.025842083618044853, -0.012591068632900715, -0.06394526362419128, -0.021778207272291183, -0.02108352817595005, 0.008531535044312477, 0.006412761751562357, -0.059811919927597046, -0.06470941007137299, -0.06609877198934555, 0.007029289845377207, -0.011922439560294151, -0.008566268719732761, -0.039179932326078415, -0.051093690097332, -0.07502540200948715, -0.0858624055981636, -0.021743474528193474, 0.04570992290973663, -0.001144050620496273, 0.0503295436501503, -0.03461241349577904, 0.009612630121409893, -0.022646557539701462, -0.0028004273772239685, 0.06238223612308502, 0.012547651305794716, -0.08426464349031448, 0.02033674716949463, -0.01860004849731922, 0.015812646597623825, 0.00005942767529631965, -0.002178472001105547, 0.053316663950681686, 0.059881389141082764, 0.00720295961946249, -0.016177352517843246, 0.004011774901300669, -0.004658695310354233, -0.0026680040173232555, 0.017714330926537514, -0.041611313819885254, -0.04143764078617096, 0.005757157690823078, 0.057415273040533066, 0.014475387521088123, -0.02320230007171631, 0.00015521749446634203, 0.0027830605395138264, -0.03608860820531845, 0.0020514759235084057, -0.03202473372220993, -0.009656047448515892, 0.05314299464225769, 0.03831158205866814, -0.018443744629621506, -0.06651557981967926, 0.021743474528193474, 0.035498131066560745, 0.010220474563539028, -0.05428921803832054, 0.0020482195541262627, 0.063076913356781, 0.03126058354973793, -0.022090813145041466, 0.10156216472387314, 0.040812429040670395, 0.0003321437106933445, -0.06085393950343132, -0.004059534519910812, -0.04640460014343262, -0.008735597133636475, -0.010672016069293022, -0.04796763136982918, 0.04109030216932297, 0.029367582872509956, -0.0337093323469162, 0.029332848265767097, -0.03046170435845852, 0.08607081323862076, 0.0231675673276186, 0.00010148836008738726, -0.005006035324186087, 0.029020242393016815, 0.015352420508861542, -0.0026983963325619698, -0.003848959458991885, -0.028655536472797394, -0.09614366292953491, -0.07585901767015457, -0.004044338129460812, 0.05609538406133652, 0.02764825150370598, -0.06130548194050789, 0.00801920797675848, 0.03688748925924301, 0.0051710219122469425, -0.02148296870291233, 0.01076753530651331, 0.0034126138780266047, -0.01953786611557007, 0.057484742254018784, -0.0028351612854748964, 0.010368093848228455, -0.01873898319900036, 0.02877710573375225, -0.02721407637000084, -0.056234318763017654, 0.0017291010590270162, 0.013841492123901844, 0.03695695847272873, 0.042028121650218964, -0.020614618435502052, -0.017080435529351234, -0.030704841017723083, 0.11107927560806274, 0.030201198533177376, -0.014631690457463264, 0.019329462200403214, 0.027926122769713402, -0.015083231963217258, 0.03256310895085335, -0.03249363973736763, 0.01565634272992611, 0.059499312192201614, 0.04129870608448982, 0.001555431168526411, -0.0009090534877032042, 0.026067854836583138, -0.060749735683202744, 0.0033388042356818914, -0.022177647799253464, -0.012808156199753284, 0.01484009437263012, -0.001996118575334549, 0.06675871461629868, 0.02917654626071453, 0.02354964055120945, 0.04373008385300636, 0.0243137888610363, -0.01792273484170437, -0.03733903169631958, 0.036366481333971024, 0.018513213843107224, 0.05043374374508858, 0.05241358280181885, -0.020458316430449486, 0.019294727593660355, 0.02603312022984028, 0.013494152575731277, -0.0019939476624131203, 0.02516477182507515, 0.016159985214471817, -0.039492540061473846, 0.003004489466547966, -0.008179852738976479, 0.03004489652812481, -0.03435191139578819, 0.03134742006659508, 0.02882920578122139, -0.05446288734674454, -0.02759614959359169, -0.04393848776817322, 0.005926486104726791, 0.02601575292646885, -0.08878006041049957, 0.056581657379865646, -0.032198403030633926, -0.020840389654040337, -0.022021345794200897, -0.0663071721792221, 0.07773465663194656, -0.02844713255763054, 0.03848525509238243, -0.03452558070421219, -0.029350215569138527, -0.0463351346552372, 0.042792268097400665, 0.03360512852668762, -0.020788289606571198, 0.030513804405927658, 0.030149098485708237, 0.04911385104060173, -0.04175024852156639, 0.008023549802601337, 0.064952552318573, -0.007880272343754768, -0.025789983570575714, 0.020875124260783195, 0.025720514357089996, -0.04098610207438469, -0.024834798648953438, -0.020423581823706627, 0.043209075927734375, -0.03862418979406357, -0.09968653321266174, 0.017175955697894096, 0.012243729084730148, 0.06196542829275131, 0.018391644582152367, 0.00840996578335762, 0.03379616513848305, -0.006121864542365074, -0.021674005314707756, -0.02644992806017399, 0.036366481333971024, -0.00335182948037982, -0.09260080009698868, -0.0035645749885588884, 0.06995424628257751, 0.02311546541750431, 0.009430276229977608, -0.04702981188893318, 0.011410113424062729, -0.020423581823706627, -0.001199407852254808, -0.10128429532051086, -0.03938833624124527, 0.07189934700727463, 0.0429312027990818, 0.01598631590604782, -0.011071457527577877, -0.004676062613725662, -0.003920598421245813, 0.06950270384550095, 0.03172949329018593, 0.010307309217751026, 0.04873177781701088, 0.028203994035720825, 0.013242331333458424, 0.013251014985144138, 0.03256310895085335, 0.01952049881219864, 0.05029480904340744, -0.06054133176803589, -0.03862418979406357, 0.018756350502371788, -0.008145119063556194, 0.030548539012670517, 0.03275414556264877, 0.015908164903521538, 0.03865892440080643, 0.008735597133636475, 0.0037056817673146725, 0.00811038538813591, 0.015777911990880966, 0.00330407009460032, -0.0036622644402086735, 0.026901470497250557, 0.0025507768150418997, -0.07578954845666885, -0.03938833624124527, 0.06700185686349869, -0.014458020217716694, -0.07572008669376373, 0.06203489378094673, 0.00823629554361105, -0.02966282144188881, 0.0043026721104979515, -0.03601914271712303, -0.02596365287899971, 0.057380542159080505, -0.0103507274761796, 0.00890058372169733, 0.013233647681772709, 0.08655709028244019, 0.025772616267204285, 0.04213232174515724, 0.004320039413869381, 0.021396134048700333, 0.008648761548101902, -0.021621905267238617, -0.00319335563108325, 0.05067688226699829, 0.020579885691404343, -0.03945780545473099, 0.020823022350668907, 0.016767829656600952, -0.011462214402854443, 0.029471784830093384, -0.014701158739626408, 0.011575100012123585, -0.01420619897544384, 0.01687203161418438, 0.04508471116423607, 0.008566268719732761, 0.0023944738786667585, 0.03360512852668762, 0.024921633303165436, 0.005201414227485657, -0.010012070648372173, -0.001326404046267271, 0.039110466837882996, 0.0680091381072998, -0.010107588954269886, -0.019294727593660355, -0.06519568711519241, 0.027735086157917976, -0.04741188883781433, -0.014709842391312122, 0.06241696700453758, 0.018131138756871223, 0.01440591923892498, -0.041194505989551544, -0.005917802453041077, -0.02311546541750431, 0.009951286017894745, -0.0354112945497036, 0.029384950175881386, 0.023045998066663742, 0.0066298493184149265, -0.07717891037464142, 0.01479667704552412, 0.021656638011336327, 0.014588273130357265, -0.03159055858850479, 0.04147237539291382, 0.01076753530651331, -0.05387241020798683, -0.0006094728596508503, 0.004472000524401665, 0.0009047117200680077, 0.010628598742187023, -0.00710309948772192, -0.030583271756768227, 0.07349710911512375, 0.0021448235493153334, -0.0048888083547353745, 0.001693281694315374, 0.01823534071445465, 0.011375379748642445, -0.002581169130280614, 0.05151049792766571, 0.04834970459342003, 0.0014490584144368768, -0.0423407256603241, -0.014058579690754414, 0.05428921803832054, 0.01983310468494892, 0.02759614959359169, 0.0012764738639816642, -0.01698491722345352, 0.0009595262818038464, 0.05758894607424736, -0.010611232370138168, 0.003275848925113678, 0.010003386996686459, -0.02875973843038082, 0.0655430257320404, -0.024417990818619728, 0.05286512151360512, -0.029020242393016815, 0.04015248641371727, 0.017228055745363235, 0.03396983444690704, -0.003998749889433384, 0.01299051009118557, 0.05307352542877197, 0.012460816651582718, 0.014631690457463264, -0.044042691588401794, -0.021413501352071762, 0.0805133730173111, -0.03172949329018593, 0.03133005276322365, 0.039978813380002975, 0.02356700785458088, 0.036713819950819016, -0.04425109550356865, -0.0207014549523592, -0.013780707493424416, 0.018131138756871223, -0.06384105980396271, 0.025321073830127716, 0.012912358157336712, 0.006147915031760931, -0.025425275787711143, 0.01903422363102436, 0.058978304266929626, -0.003367025637999177, 0.0008298165630549192, 0.05588698014616966, -0.04991273581981659, -0.08002709597349167, -0.009152404963970184, 0.042062852531671524, -0.0324762761592865, 0.05401134490966797, 0.0438690222799778, 0.04473737254738808, 0.04664773866534233, -0.05161469802260399, 0.004571860656142235, -0.0423407256603241, -0.01457958947867155, -0.021656638011336327, -0.015864746645092964, -0.04265333339571953, -0.07474753260612488, 0.039179932326078415, -0.0846814513206482, 0.03478608280420303, 0.006000295747071505, -0.009803666733205318, 0.025494743138551712, 0.004828023724257946, -0.0012243728851899505, -0.017340941354632378, 0.01988520473241806, 0.013711240142583847, 0.02231658436357975, -0.056963734328746796, 0.024435358121991158, -0.035498131066560745, 0.03205946832895279, 0.08551506698131561, -0.024886898696422577, -0.007168225944042206, 0.017974836751818657, -0.008579294197261333, -0.012044008821249008, 0.004927883855998516, 0.02473059669137001, 0.03409140557050705, -0.00874428078532219, 0.05029480904340744, 0.02797822281718254, 0.027439847588539124, 0.05234411358833313, -0.010472295805811882, 0.05974245071411133, -0.051093690097332, 0.08294475078582764, 0.029054976999759674, -0.03002752922475338, -0.028238728642463684, -0.012634486891329288, 0.03214630112051964, 0.006764443125575781, -0.0168546661734581, -0.006621165666729212, 0.05929090827703476, 0.010645966045558453, -0.031816329807043076, -0.0003929281956516206, -0.05588698014616966, 0.00910898670554161, 0.04498050734400749, -0.027040407061576843, -0.014605640433728695, -0.004589227493852377, 0.029541252180933952, 0.09621313214302063, -0.008970051072537899, -0.003592796390876174, -0.00559651292860508, -0.06891222298145294, 0.010385461151599884, -0.03042696975171566, -0.016932817175984383, -0.049669597297906876, 0.04091663286089897, -0.02191714383661747, 0.01768828183412552, -0.026658331975340843, -0.03779057413339615, -0.034716617316007614, -0.010863053612411022, 0.02556421235203743, -0.02233395166695118, -0.012955775484442711, 0.016012366861104965, -0.015830013900995255, -0.015934213995933533, -0.06863435357809067, -0.039110466837882996, 0.0032628236804157495, -0.0024596001021564007, -0.05081581696867943, 0.041263971477746964, -0.0033822215627878904, 0.08614028245210648, 0.030982714146375656, -0.01872161775827408, 0.022646557539701462, -0.0019516156753525138, 0.007020606193691492, -0.018113771453499794, -0.0018962584435939789, -0.0053403498604893684, 0.02356700785458088, -0.036297012120485306, 0.04220179095864296, 0.06651557981967926, 0.020875124260783195, 0.031382154673337936, -0.033500928431749344, -0.04327854514122009, 0.006365002598613501, 0.0025334099773317575, -0.012981826439499855, 0.010845686309039593, -0.01076753530651331, 0.0398746132850647, -0.028186626732349396, -0.03172949329018593, 0.02921128086745739, -0.06332005560398102, 0.014293034560978413, 0.05519229918718338, -0.008440357632935047, -0.07565061748027802, 0.03775583952665329, 0.04352167993783951, -0.020770922303199768, -0.0071248081512749195, -0.03478608280420303, 0.023740677163004875, 0.011522999033331871, -0.02153507061302662, 0.014727208763360977, 0.012538967654109001, -0.03567180037498474, 0.05154523253440857, 0.010837002657353878, -0.016568109393119812, 0.03169475868344307, 0.048037100583314896, -0.01765354722738266, -0.01378939114511013, 0.0520315058529377, -0.042827002704143524, 0.01138406340032816, 0.015647659078240395, 0.005027743987739086, -0.027491947636008263, 0.021257197484374046, -0.004558835178613663, 0.002090551657602191, 0.0053967926651239395, -0.0617222897708416, -0.02921128086745739, -0.06863435357809067, 0.0034712273627519608, -0.011080141179263592, -0.007380971685051918, -0.0064909132197499275, 0.00739833852276206, -0.03865892440080643, 0.01482272706925869, 0.002472625346854329, -0.052552517503499985, -0.018461111932992935, -0.04102083295583725, -0.01903422363102436, 0.022577090188860893, -0.08502878993749619, -0.02721407637000084, 0.031069548800587654, 0.035949673503637314, 0.03327515721321106, -0.017097802832722664, -0.04591832682490349, -0.03699169307947159, -0.0025985362008213997, -0.046856142580509186, -0.025025835260748863, -0.04508471116423607, 0.02024991251528263, -0.0024357205256819725, -0.006456179078668356, -0.044841572642326355, -0.04004828259348869, 0.019694168120622635, 0.042757533490657806, -0.029350215569138527, -0.010255208238959312, -0.07061418890953064, -0.024626394733786583, -0.039179932326078415, 0.004788947757333517, 0.038346316665410995, 0.041541844606399536, 0.03172949329018593, 0.04272279888391495, -0.0026918838266283274, 0.03542866185307503, -0.007337553892284632, 0.027874020859599113, 0.010020754300057888, 0.015109282918274403, -0.02143086865544319, -0.038276851177215576, -0.008761647157371044, 0.04838443920016289, 0.02551211044192314, 0.08614028245210648, 0.049739062786102295, 0.00293502165004611, 0.0008135350071825087, -0.05022533982992172, -0.0062521169893443584, -0.004875782877206802, -0.012070058844983578, -0.039492540061473846, -0.05307352542877197, -0.09023889154195786, 0.03831158205866814, -0.0231675673276186, 0.07040578126907349, -0.02846449986100197, -0.003486423520371318, -0.026224156841635704 ]
717,095
pytorch_optimizer.optimizer.lookahead
reset
null
@torch.no_grad() def update(self, group: Dict): for p in group['params']: if p.grad is None: continue state = self.state[p] slow = state['slow_params'] p.mul_(self.alpha).add_(slow, alpha=1.0 - self.alpha) slow.copy_(p) if 'momentum_buffer' not in self.optimizer.state[p]: self.optimizer.state[p]['momentum_buffer'] = torch.zeros_like(p) if self.pullback_momentum == 'pullback': internal_momentum = self.optimizer.state[p]['momentum_buffer'] self.optimizer.state[p]['momentum_buffer'] = internal_momentum.mul_(self.alpha).add_( state['slow_momentum'], alpha=1.0 - self.alpha ) state['slow_momentum'] = self.optimizer.state[p]['momentum_buffer'] elif self.pullback_momentum == 'reset': self.optimizer.state[p]['momentum_buffer'] = torch.zeros_like(p)
(self)
[ 0.02174769528210163, -0.006604889407753944, -0.04737050086259842, 0.06471795588731766, -0.04392998293042183, -0.008963454514741898, -0.06240013241767883, -0.0015369156608358026, -0.036270301789045334, 0.007360897958278656, -0.04012730345129967, -0.027397388592362404, 0.0065505653619766235, 0.05186128243803978, -0.023359306156635284, 0.04019973799586296, -0.000016321948351105675, 0.034531936049461365, 0.01680421456694603, -0.02567712962627411, -0.005907731596380472, -0.06660118699073792, -0.019411765038967133, 0.07000548392534256, -0.020570676773786545, -0.03306518867611885, -0.003001399338245392, -0.032340869307518005, -0.01750137098133564, 0.012992482632398605, 0.010086149908602238, -0.044907815754413605, 0.016315298154950142, 0.037012729793787, 0.011326547712087631, -0.03523814678192139, 0.0045224702917039394, 0.04103270545601845, -0.09604477882385254, -0.007388059515506029, 0.07395303249359131, -0.040561895817518234, 0.03467680141329765, 0.02223661169409752, 0.03447761386632919, -0.014902875758707523, -0.0009223757078871131, 0.05359964817762375, 0.04048946499824524, -0.01343612838536501, 0.011987488716840744, -0.06033582240343094, 0.011281277053058147, 0.012684646993875504, -0.02957034669816494, 0.05961150303483009, 0.05446883291006088, 0.014314365573227406, 0.03485788032412529, -0.022019315510988235, 0.023105794563889503, -0.05479477718472481, 0.007582720834761858, -0.0008018444059416652, -0.03132682293653488, -0.06663740426301956, -0.05207857862114906, 0.0005381468217819929, -0.018415825441479683, 0.013897881843149662, 0.003841157304123044, 0.039366770535707474, 0.016487324610352516, 0.014223826117813587, -0.06801360845565796, -0.00929845217615366, -0.04537862166762352, -0.012204784899950027, -0.02419227361679077, -0.015989353880286217, -0.014205717481672764, 0.00935277622193098, -0.00785886775702238, 0.0423726961016655, -0.0271257683634758, -0.05950285494327545, 0.011480465531349182, -0.028538191691040993, 0.01047547161579132, -0.06392120569944382, 0.002720725489780307, -0.0027071444783359766, 0.028683055192232132, 0.03744732216000557, 0.04262620583176613, 0.03634273633360863, -0.026999011635780334, -0.01959284394979477, -0.0754740983247757, -0.04070676118135452, -0.015147333033382893, -0.004517943598330021, 0.024916592985391617, -0.00007674674998270348, 0.06308823823928833, -0.03809921070933342, -0.0012358702952042222, -0.06388498842716217, -0.0014542979188263416, -0.007098332047462463, -0.016831375658512115, -0.006903671193867922, -0.0708746686577797, -0.024264706298708916, -0.023105794563889503, -0.01979203335940838, -0.01700340211391449, -0.01119979191571474, -0.006369485519826412, 0.03766461834311485, 0.03139925375580788, 0.04273485392332077, -0.026256585493683815, -0.010846685618162155, -0.008963454514741898, -0.014930037781596184, 0.044364575296640396, 0.03741110488772392, 0.046754829585552216, -0.05993744358420372, -0.08546970784664154, 0.0032684921752661467, -0.024373354390263557, -0.007618936710059643, 0.010819523595273495, -0.05001426860690117, -0.006957994773983955, -0.03599868342280388, 0.0009948076913133264, 0.007424275856465101, 0.0007995808846317232, 0.04671861231327057, 0.013372750021517277, 0.00467638811096549, 0.02243579924106598, 0.006374012213200331, 0.037121377885341644, 0.029534131288528442, -0.0456683486700058, -0.03187006339430809, 0.024952810257673264, 0.006301580462604761, 0.025007134303450584, 0.013870719820261002, 0.031037094071507454, 0.01101871207356453, -0.02882791869342327, 0.0010621467372402549, -0.04682726040482521, -0.012186677195131779, -0.022417690604925156, -0.029298726469278336, -0.03505706787109375, -0.0224901232868433, -0.01014952827244997, -0.013798288069665432, 0.03342735022306442, 0.015672465786337852, -0.05407045781612396, 0.054830990731716156, -0.00925318244844675, -0.05070237070322037, 0.008546970784664154, 0.049145083874464035, 0.007908664643764496, 0.10560579597949982, -0.008574132807552814, -0.016695566475391388, 0.002897278405725956, 0.0019149199360981584, -0.013101130723953247, 0.008746159262955189, -0.0010678054532036185, -0.06265364587306976, -0.03139925375580788, 0.018316231667995453, -0.005233209114521742, -0.011281277053058147, -0.009017778560519218, 0.012358702719211578, 0.02947980724275112, -0.013073968701064587, 0.03389815613627434, -0.04990562051534653, -0.012277216650545597, 0.03071114979684353, 0.01859690435230732, -0.007772854529321194, 0.0767054408788681, 0.03556409105658531, 0.0030987297650426626, -0.04903643578290939, 0.0022872653789818287, 0.04447322338819504, 0.020136084407567978, -0.008619403466582298, 0.00019720732234418392, 0.061856891959905624, 0.007704949472099543, 0.012422081083059311, -0.03360842913389206, 0.003288863692432642, 0.04878292232751846, 0.0767778754234314, -0.0053554377518594265, -0.017075834795832634, -0.0072477227076888084, 0.037628401070833206, 0.05758340656757355, 0.018316231667995453, -0.049833185970783234, -0.033191945403814316, 0.03275735303759575, 0.002942548366263509, 0.007551031652837992, 0.016496378928422928, 0.03741110488772392, 0.008144068531692028, -0.013653424568474293, -0.011561951600015163, 0.06714442372322083, -0.05490342527627945, -0.045994292944669724, -0.010792361572384834, 0.0535634346306324, -0.0019669802859425545, -0.041865672916173935, -0.009561018086969852, -0.013264101929962635, -0.021765803918242455, 0.01004993449896574, -0.0390770398080349, -0.008940819650888443, 0.029461698606610298, -0.05646071210503578, -0.028157923370599747, 0.07261303812265396, -0.01895906589925289, -0.025604696944355965, 0.04389376565814018, -0.005219628103077412, 0.00256228051148355, -0.016885699704289436, 0.05519315227866173, -0.018940957263112068, -0.08561457693576813, 0.03715759515762329, 0.03563652187585831, 0.008841225877404213, -0.0542515367269516, -0.050340209156274796, -0.041684590280056, -0.08134108781814575, 0.05171641707420349, 0.019122036173939705, 0.009778314270079136, 0.04157594218850136, -0.00688103586435318, -0.02428281307220459, 0.015971247106790543, 0.10502634197473526, -0.016469215974211693, -0.06388498842716217, 0.011969381012022495, -0.01226816326379776, 0.05396180972456932, 0.008673726581037045, 0.0018764403648674488, -0.0004662807332351804, -0.036234088242053986, 0.09293020516633987, -0.024518217891454697, -0.05044885724782944, -0.0018605958903208375, 0.0060390145517885685, 0.02638334035873413, -0.010267229750752449, 0.04114135354757309, 0.01263937633484602, 0.03809921070933342, 0.03641516715288162, -0.011589113622903824, 0.03889596089720726, -0.017039617523550987, 0.010285338386893272, 0.008542443625628948, -0.011109251528978348, 0.04838454723358154, -0.010421147570014, -0.01599840819835663, 0.04603051021695137, -0.032829783856868744, 0.0012539782328531146, 0.03511139005422592, 0.025242537260055542, 0.01681326888501644, 0.018071774393320084, -0.005618003662675619, 0.03648759797215462, -0.01730218343436718, 0.04273485392332077, -0.0005050431354902685, -0.03375329077243805, 0.017492318525910378, 0.01690380834043026, -0.0642109289765358, -0.018035557121038437, -0.02214607037603855, 0.009642504155635834, 0.05993744358420372, -0.0442921407520771, -0.028592515736818314, 0.02891846001148224, 0.023902546614408493, -0.034332748502492905, -0.003845684230327606, 0.046284019947052, 0.03565463051199913, -0.025803884491324425, 0.005473139695823193, -0.057076383382081985, -0.029805751517415047, 0.03264870494604111, 0.042807288467884064, -0.03972892835736275, -0.021602831780910492, 0.010828577913343906, -0.03576327860355377, 0.05740232765674591, -0.00030755289481021464, 0.05519315227866173, 0.022580662742257118, -0.07130926102399826, 0.034043021500110626, 0.021711479872465134, 0.001481459941715002, 0.049543458968400955, 0.05439640209078789, 0.04432835802435875, 0.008737104944884777, -0.02459065057337284, 0.014948145486414433, -0.01465841755270958, 0.09408911317586899, 0.06580443680286407, 0.046356454491615295, -0.014033691957592964, -0.038026779890060425, 0.01970149204134941, -0.034133560955524445, -0.005975636653602123, 0.0009003066224977374, -0.00021149565873201936, 0.05924934148788452, 0.0701141357421875, -0.0019918789621442556, -0.03980135917663574, -0.016840429976582527, 0.0396927148103714, -0.0647541731595993, -0.016134219244122505, -0.04251755774021149, 0.02459065057337284, 0.03690408170223236, -0.034586258232593536, -0.007474072743207216, -0.05291154608130455, -0.004775982350111008, 0.08619403094053268, -0.003992811776697636, 0.0377008356153965, -0.02897278405725956, -0.003992811776697636, 0.06355904042720795, 0.04182945564389229, 0.009017778560519218, 0.033336807042360306, -0.057619623839855194, 0.028701163828372955, -0.05146290734410286, 0.07047629356384277, 0.016994347795844078, 0.013979367911815643, -0.02502524107694626, -0.07076602429151535, 0.04588564485311508, 0.06189310923218727, -0.0006354772485792637, -0.06703577935695648, -0.06471795588731766, 0.011824517510831356, -0.0377008356153965, -0.05649692565202713, 0.017772991210222244, -0.007089277729392052, -0.0668184831738472, 0.031942494213581085, 0.08047190308570862, -0.02024473249912262, 0.0350208505988121, -0.015935031697154045, -0.012748024426400661, -0.03893217816948891, -0.024300921708345413, 0.022725526243448257, -0.02399308606982231, 0.001528993365354836, -0.0390770398080349, 0.031942494213581085, 0.0634503960609436, 0.06142229959368706, 0.0008380603976547718, -0.016433000564575195, 0.01755569502711296, 0.0019782979506999254, -0.06899143755435944, -0.029262511059641838, -0.022707419469952583, -0.048601843416690826, 0.03824407234787941, -0.006586781237274408, -0.02203742414712906, -0.01151668094098568, 0.007935826666653156, 0.030982770025730133, -0.006229148246347904, 0.025894425809383392, 0.017791099846363068, 0.016297191381454468, -0.003836630377918482, 0.019013389945030212, 0.01839771680533886, 0.0027659954503178596, -0.02951602265238762, -0.016414891928434372, -0.024862268939614296, 0.04182945564389229, 0.002246522344648838, -0.04842076450586319, 0.0009506694623269141, 0.002033753553405404, 0.022417690604925156, 0.051245611160993576, 0.01119979191571474, 0.03505706787109375, -0.024355245754122734, -0.011743031442165375, -0.021059591323137283, 0.005142669193446636, 0.005844353698194027, -0.023196334019303322, 0.011082089506089687, -0.05559152737259865, 0.04045324772596359, -0.016396785154938698, 0.019013389945030212, 0.08416593819856644, -0.0482758991420269, -0.011960326693952084, 0.015618140809237957, -0.008248189464211464, -0.08307945728302002, 0.01461314782500267, -0.03081979788839817, -0.05055750533938408, -0.030801691114902496, -0.032793570309877396, 0.046501316130161285, -0.01236775703728199, -0.03645138442516327, -0.027198201045393944, -0.05982879921793938, 0.0267817173153162, 0.03400680422782898, -0.022055530920624733, 0.003103256691247225, 0.014930037781596184, 0.014287203550338745, 0.019176360219717026, -0.020860403776168823, -0.029552238062024117, -0.05928555876016617, 0.06258121132850647, 0.0008963454747572541, -0.027397388592362404, -0.006129554472863674, -0.031833846122026443, 0.030801691114902496, 0.06833954900503159, -0.018280016258358955, 0.007908664643764496, 0.023250658065080643, -0.03426031768321991, -0.04389376565814018, 0.020606892183423042, -0.012711809016764164, -0.015744896605610847, 0.00810332503169775, -0.0228341743350029, 0.05302019417285919, 0.022653095424175262, -0.026799824088811874, -0.030077369883656502, 0.025568481534719467, 0.00857865996658802, -0.03181573748588562, -0.02862873114645481, 0.03766461834311485, 0.054034240543842316, -0.0602271743118763, 0.03337302431464195, 0.031127633526921272, -0.009407100267708302, -0.017320292070508003, 0.024644974619150162, 0.012748024426400661, -0.024916592985391617, -0.009687774814665318, 0.011616275645792484, -0.03205114230513573, -0.0035220040008425713, -0.010891955345869064, 0.017727721482515335, 0.055881254374980927, 0.03091033734381199, -0.07779192179441452, 0.025713345035910606, -0.03914947435259819, -0.18557067215442657, -0.018316231667995453, 0.0008437191136181355, 0.013771126046776772, 0.024572541937232018, -0.05570017546415329, 0.02343173883855343, 0.050883449614048004, -0.025514157488942146, -0.00575834047049284, 0.010864793322980404, 0.01141708716750145, -0.0733373612165451, 0.04356782138347626, -0.058669887483119965, 0.058525022119283676, 0.004124094732105732, -0.006672793999314308, -0.04135864973068237, -0.008329675532877445, -0.015690572559833527, 0.010357770137488842, -0.01999122090637684, -0.03335491567850113, 0.043459173291921616, 0.006301580462604761, -0.038280289620161057, 0.019013389945030212, -0.015835436061024666, 0.02408362552523613, 0.021059591323137283, 0.04885535687208176, -0.009121899493038654, -0.03694029897451401, -0.008632984012365341, -0.020679324865341187, 0.02647387981414795, 0.010846685618162155, 0.04961588978767395, -0.01959284394979477, 0.027542252093553543, -0.04382133483886719, 0.04034459963440895, -0.03431463986635208, 0.03159844130277634, -0.017193535342812538, 0.003687239484861493, 0.046646181493997574, -0.049289949238300323, 0.06301580369472504, 0.061313651502132416, 0.013852612115442753, -0.0383889377117157, -0.011154521256685257, -0.0011906003346666694, -0.03042142279446125, -0.017284076660871506, 0.01032155379652977, -0.08749780803918839, 0.00837947241961956, 0.045306190848350525, 0.047949954867362976, -0.007270357571542263, -0.007505761459469795, 0.04718942195177078, -0.01655070297420025, -0.06384877115488052, -0.02823035605251789, -0.01714826561510563, 0.027198201045393944, 0.014250988140702248, -0.010104258544743061, -0.011924111284315586, -0.012485458515584469, 0.0005907731829211116, 0.016885699704289436, 0.0015776585787534714, -0.058669887483119965, -0.011652491055428982, 0.018189474940299988, 0.06232770159840584, -0.015129225328564644, -0.04802238941192627, 0.04646510258316994, -0.004196526482701302, -0.014033691957592964, -0.02115013264119625, -0.048094820231199265, 0.05273046717047691, -0.10212906450033188, -0.007261303719133139, -0.04910886660218239, -0.03726624324917793, -0.020335271954536438, 0.0038524747360497713, -0.03344545513391495, 0.008442849852144718, -0.039511632174253464, 0.04762401431798935, -0.0005429567536339164, -0.02239958383142948, -0.058814749121665955, 0.043966200202703476, 0.016894754022359848, 0.01711205020546913, -0.036378949880599976, -0.027795763686299324, 0.009035887196660042, -0.027560360729694366, 0.009067575447261333, 0.018832309171557426, 0.026654960587620735, -0.011181683279573917, 0.0051245610229671, -0.0403808169066906, 0.02363092638552189, 0.0331014059484005, -0.00006765739090042189, 0.027397388592362404, 0.02792252041399479, 0.05012291669845581, -0.058271508663892746, -0.042264048010110855, 0.019067712128162384, -0.02308768592774868, 0.008768794126808643, 0.0007514815661124885, -0.0017100732075050473, -0.047841306775808334, 0.01805366575717926, 0.03335491567850113, -0.00932561419904232, -0.05055750533938408, -0.006129554472863674, -0.07304763048887253, 0.03199681639671326, 0.009633450768887997, 0.0047624013386666775, 0.0072160339914262295, -0.03447761386632919, -0.013164508156478405, 0.021204454824328423, 0.08250000327825546, 0.021928776055574417, -0.000051883635023841634, 0.05863367021083832, 0.011109251528978348, 0.05975636467337608, 0.007655152585357428, 0.019013389945030212, 0.05834394320845604, -0.037121377885341644, -0.03656003251671791, -0.033988695591688156, 0.005387126933783293, 0.005473139695823193, 0.04215539991855621, -0.07757462561130524, -0.03130871430039406, -0.0033794036135077477, 0.007569139823317528, -0.032684922218322754, 0.005228681955486536, -0.02115013264119625, -0.05334613844752312, -0.010466418229043484, 0.003230012720450759, 0.05874231830239296, 0.00043006474152207375, -0.0038751098327338696, -0.004373079631477594, -0.011226953938603401, -0.003374876454472542, 0.046102941036224365, -0.02652820385992527, 0.01148951891809702, 0.08423836529254913, 0.016595972701907158, -0.016333406791090965, -0.0548672080039978, -0.015826383605599403, 0.03925812244415283, 0.011236007325351238, 0.05041264370083809, -0.00905399490147829, 0.044364575296640396, -0.011236007325351238, -0.04588564485311508, 0.0048121982254087925, 0.024862268939614296, -0.015618140809237957, -0.010719929821789265, 0.028809811919927597, 0.012023705057799816, 0.022309042513370514, -0.06739793717861176, 0.01780015416443348, -0.0011611748486757278, 0.06265364587306976, 0.011652491055428982, -0.017284076660871506, 0.060118526220321655, -0.04534240439534187, 0.007089277729392052, -0.023467954248189926, 0.004085615277290344, 0.009570072405040264, 0.02069743163883686, -0.0018492784583941102, -0.04479916766285896, 0.026365233585238457, -0.05526558309793472, 0.07188871502876282, 0.02632901631295681, 0.00989601667970419, 0.05381694436073303, 0.1084306389093399, -0.05229587480425835, 0.03244951739907265, -0.02163904719054699, -0.02115013264119625, -0.08981563150882721, -0.01363531593233347, -0.05236830562353134, 0.07304763048887253, 0.02209174633026123, -0.04110513627529144, 0.01789974793791771, 0.005998271517455578, -0.00019183151016477495 ]
717,097
pytorch_optimizer.optimizer.lookahead
state_dict
null
def state_dict(self) -> STATE: return self.optimizer.state_dict()
(self) -> Dict
[ 0.014427692629396915, -0.03826049715280533, 0.02499733306467533, -0.015654446557164192, -0.013369839638471603, -0.005764854606240988, -0.04430537298321724, -0.013449844904243946, -0.006311560049653053, -0.03497137501835823, -0.03954058885574341, 0.02629520371556282, -0.016934538260102272, 0.05323045328259468, -0.0345446802675724, 0.00009688188583822921, -0.018507983535528183, -0.019752515479922295, -0.08164136111736298, -0.028001992031931877, -0.005884862970560789, -0.03470468893647194, 0.02089037373661995, 0.007764996495097876, -0.02089037373661995, -0.020677026361227036, -0.024961775168776512, -0.06727589666843414, 0.014516588300466537, -0.010222949087619781, -0.07516978681087494, -0.03491804003715515, 0.0034691356122493744, 0.0037469330709427595, 0.023290544748306274, -0.0040269531309604645, 0.009182875044643879, 0.017521245405077934, 0.0016456726007163525, -0.0577818863093853, -0.0410340279340744, -0.07993457466363907, -0.058848630636930466, 0.01895245909690857, 0.0345446802675724, -0.01302314829081297, -0.0014701045583933592, -0.054048288613557816, 0.07787220180034637, -0.07573872059583664, 0.03500693291425705, -0.05095473304390907, 0.046047717332839966, 0.053799379616975784, 0.00401584105566144, -0.0564662367105484, 0.024908438324928284, -0.047612275928258896, 0.02177932672202587, -0.0012789798201993108, 0.00648490572348237, -0.019965864717960358, 0.006240443792194128, -0.03372684121131897, 0.009000640362501144, -0.053123775869607925, -0.02951321005821228, 0.02855314128100872, -0.016187818720936775, 0.023806137964129448, 0.022241581231355667, -0.0730363056063652, 0.05003022402524948, -0.020019201561808586, -0.06599580496549606, -0.04138961061835289, -0.06439568847417831, 0.01632115989923477, 0.011885290034115314, -0.043843116611242294, -0.0653202012181282, -0.0009845144813880324, -0.0493190623819828, 0.003238008124753833, -0.020605910569429398, -0.055719517171382904, 0.028446467593312263, -0.01234754454344511, -0.0705827996134758, -0.06336450576782227, -0.0048447889275848866, 0.06759592145681381, -0.0010011823615059257, 0.045052092522382736, 0.018205739557743073, 0.02186822146177292, -0.02885538525879383, 0.006942715961486101, 0.023343881592154503, -0.05749742314219475, -0.029744338244199753, 0.003422465641051531, -0.04007396101951599, 0.022597162052989006, -0.021103722974658012, -0.011831952258944511, 0.005933755077421665, -0.04679443687200546, 0.018454644829034805, -0.07157842069864273, -0.030384382233023643, 0.04021619260311127, -0.007938342168927193, 0.008373929187655449, 0.026241866871714592, -0.007951676845550537, -0.010231838561594486, -0.011298581026494503, -0.04682999849319458, 0.04963908717036247, -0.016783416271209717, 0.04775450751185417, -0.02917540818452835, 0.04362976923584938, -0.019788073375821114, 0.014054332859814167, 0.009396223351359367, 0.02828645519912243, 0.037015967071056366, -0.04405646771192551, 0.02151264064013958, -0.036447037011384964, -0.011760836467146873, 0.061088789254426956, -0.00029002063092775643, 0.010729651898145676, 0.071720652282238, 0.01738790236413479, -0.008551719598472118, 0.05362159013748169, 0.07403193414211273, 0.020303666591644287, -0.027148596942424774, -0.0023023858666419983, 0.06642249971628189, -0.010036269202828407, -0.011920847930014133, 0.01413433812558651, -0.011983074247837067, -0.04003840312361717, 0.05881307274103165, 0.002444618381559849, 0.011111901141703129, -0.016898980364203453, -0.03683817386627197, -0.02185044251382351, -0.020321445539593697, -0.05394161492586136, -0.004224745091050863, -0.028962058946490288, -0.017716815695166588, -0.029708778485655785, -0.04597660154104233, -0.060164276510477066, -0.012800910510122776, 0.01989474892616272, -0.012623120099306107, -0.013716530986130238, -0.0397183783352375, -0.06254667043685913, -0.06311559677124023, -0.06315115839242935, -0.017263449728488922, 0.060164276510477066, -0.021637093275785446, 0.08085907995700836, 0.005987092386931181, 0.06062653288245201, -0.022543825209140778, -0.02090815268456936, 0.062119971960783005, 0.0043158624321222305, -0.1091633215546608, 0.019841410219669342, -0.022899406030774117, -0.020641468465328217, 0.021708210930228233, -0.004082512576133013, 0.054048288613557816, 0.05010133981704712, -0.0028868720401078463, -0.019770294427871704, 0.02057035081088543, 0.0049247946590185165, -0.006969384383410215, 0.008325036615133286, -0.018792446702718735, -0.014027664437890053, 0.046723321080207825, 0.04458983615040779, -0.007596095558255911, -0.0436653271317482, -0.024588415399193764, 0.041602957993745804, -0.05543505400419235, 0.012098638340830803, -0.042527467012405396, -0.043772000819444656, 0.02757529355585575, 0.031575579196214676, -0.04242079332470894, -0.02951321005821228, 0.014498808421194553, 0.0334068201482296, 0.023930590599775314, -0.051808129996061325, 0.046687763184309006, 0.06233332306146622, 0.02695302851498127, 0.0067382571287453175, 0.06880488991737366, -0.01953916810452938, 0.024926217272877693, -0.05539949610829353, 0.00912953820079565, -0.051168084144592285, -0.008520605973899364, -0.002524623880162835, -0.03907833620905876, -0.021672653034329414, 0.01461437251418829, -0.04779006540775299, 0.003884720616042614, -0.018721330910921097, 0.06556911021471024, 0.04665220528841019, -0.04035842418670654, -0.03203783556818962, -0.013174270279705524, -0.010943000204861164, -0.01238310243934393, -0.02247270941734314, 0.028713153675198555, -0.018063506111502647, -0.054012730717659, -0.004849233664572239, 0.09309106320142746, 0.040571775287389755, -0.023486115038394928, 0.009849589318037033, 0.039682820439338684, -0.026188528165221214, -0.036731500178575516, 0.0020557017996907234, 0.0029846567194908857, -0.00819613877683878, 0.02433950826525688, 0.031931158155202866, 0.01734345592558384, -0.016587845981121063, 0.007369413040578365, -0.010791878215968609, -0.07573872059583664, -0.015814457088708878, 0.020961491391062737, 0.05358603224158287, 0.04202965646982193, -0.01705899089574814, -0.06500017642974854, 0.0172723401337862, 0.16370941698551178, 0.008822849951684475, -0.062439996749162674, 0.009396223351359367, 0.00015167745004873723, -0.03982505574822426, 0.007640543393790722, -0.016445614397525787, -0.021601535379886627, 0.013858763501048088, 0.04270526021718979, 0.009849589318037033, -0.04338086396455765, -0.012898694723844528, -0.04106958582997322, 0.01345873437821865, -0.02373502030968666, -0.0020701473113149405, 0.05227038264274597, 0.0056137326173484325, 0.04064289107918739, 0.03957614675164223, 0.028179781511425972, 0.008578388020396233, 0.09522455185651779, -0.022294918075203896, -0.043131954967975616, 0.017556803300976753, 0.017583472654223442, 0.07125840336084366, 0.04818120226264, 0.00023918367514852434, -0.03015325590968132, 0.0307755209505558, -0.01991252787411213, 0.05273263901472092, 0.050208013504743576, 0.034135762602090836, 0.015876684337854385, -0.034153539687395096, -0.015272197313606739, 0.014641040936112404, -0.003842495381832123, 0.04434093087911606, -0.022543825209140778, -0.08683284372091293, -0.04995910823345184, -0.04462539404630661, 0.007733883336186409, 0.08932190388441086, -0.07310742139816284, 0.04846566915512085, -0.012774242088198662, -0.014018774963915348, -0.029708778485655785, -0.049603525549173355, 0.05106141045689583, -0.028446467593312263, 0.02787753753364086, -0.028997616842389107, -0.04583436995744705, -0.057604096829891205, 0.05230594053864479, 0.01989474892616272, -0.059844255447387695, 0.022632719948887825, 0.06030651181936264, 0.08057461678981781, -0.03372684121131897, -0.01697898469865322, 0.05123919993638992, 0.0019279149128124118, -0.026899689808487892, 0.039682820439338684, -0.007680546026676893, -0.06062653288245201, -0.02828645519912243, -0.015192191116511822, 0.05301710218191147, -0.021281512454152107, -0.08925078809261322, 0.039682820439338684, -0.007124951109290123, 0.07168509811162949, 0.0272908303886652, 0.0058448598720133305, 0.008365039713680744, -0.029459873214364052, -0.02245493046939373, -0.001706788083538413, 0.03557586297392845, 0.015583330765366554, -0.05287487059831619, 0.01599224843084812, 0.062119971960783005, 0.010542972013354301, 0.007409415673464537, -0.02089037373661995, 0.025459587574005127, -0.057319629937410355, -0.002429061569273472, -0.06521352380514145, -0.026437435299158096, 0.05813746899366379, 0.01270312536507845, 0.02602851763367653, -0.01801016926765442, -0.01729011908173561, -0.00648490572348237, 0.02919318713247776, 0.029655441641807556, 0.0007039389456622303, 0.013076485134661198, 0.04355865344405174, 0.01447213999927044, 0.02057035081088543, 0.014649930410087109, -0.011129680089652538, 0.06272446364164352, -0.040251750499010086, -0.07022721320390701, -0.0016101144719868898, -0.07381857931613922, 0.027201933786273003, 0.04750560224056244, 0.009636241011321545, 0.036411479115486145, -0.0033802404068410397, -0.03237563744187355, -0.016107812523841858, -0.015298865735530853, -0.0049603525549173355, 0.016125591471791267, -0.01802794821560383, -0.016525618731975555, -0.0829925686120987, 0.013760978356003761, 0.10190946608781815, 0.005027024075388908, -0.05621733143925667, 0.005022579338401556, -0.009405112825334072, -0.028499804437160492, 0.005142587702721357, -0.04622551053762436, -0.03630480542778969, 0.04195854067802429, -0.0022546048276126385, 0.05301710218191147, 0.006369341630488634, 0.07236070185899734, 0.052448175847530365, 0.04370088502764702, 0.006880489178001881, 0.026561887934803963, 0.022686056792736053, -0.04035842418670654, 0.020712584257125854, 0.024019485339522362, 0.02177932672202587, -0.02218824438750744, -0.019059132784605026, 0.03369128331542015, -0.003158002393320203, -0.007818333804607391, -0.019112469628453255, 0.02661522664129734, -0.023148313164711, 0.018703551962971687, 0.08171247690916061, 0.023166092112660408, 0.0027579739689826965, 0.025779610499739647, 0.038971658796072006, 0.01802794821560383, -0.019076911732554436, 0.008302812464535236, -0.00392027897760272, 0.038082707673311234, 0.004264747723937035, 0.03922056779265404, -0.04722113534808159, 0.027148596942424774, -0.0347224697470665, 0.004382533952593803, 0.06830707937479019, -0.04050065949559212, -0.008516160771250725, -0.0777299702167511, -0.018205739557743073, 0.02599295973777771, 0.015876684337854385, -0.01889912225306034, 0.05710628256201744, 0.001571222790516913, -0.01734345592558384, -0.028179781511425972, 0.007653877604752779, 0.01061408780515194, 0.036731500178575516, -0.0003014103276655078, 0.040251750499010086, -0.03043772093951702, -0.07602318376302719, -0.027824200689792633, 0.00881396047770977, -0.010151833295822144, 0.010009600780904293, -0.005293709691613913, -0.038047149777412415, 0.020783700048923492, -0.017752373591065407, -0.0020045870915055275, -0.0029268749058246613, 0.0436653271317482, 0.014169896952807903, 0.016507839784026146, 0.014792162925004959, 0.008858407847583294, 0.009138427674770355, -0.04999466612935066, -0.034864701330661774, 0.06556911021471024, 0.0006828263285569847, 0.00018612435087561607, 0.027664190158247948, 0.011014116927981377, 0.013965437188744545, 0.028055328875780106, 0.011583046056330204, 0.022703837603330612, -0.0033513493835926056, -0.025761831551790237, 0.041176263242959976, -0.008618390187621117, -0.02341499924659729, -0.032251182943582535, -0.0002964099694509059, -0.004122515209019184, 0.04786118119955063, 0.02593962289392948, -0.010302955284714699, 0.03269565850496292, -0.0050048003904521465, 0.0010634089121595025, -0.027539735659956932, -0.02057035081088543, 0.03779824450612068, -0.013876542448997498, -0.004618105944246054, 0.010560750961303711, 0.031059985980391502, 0.031966716051101685, -0.040287308394908905, -0.016463393345475197, 0.033229030668735504, 0.026384098455309868, -0.05881307274103165, 0.029459873214364052, 0.009840699844062328, 0.012880915775895119, -0.04917683079838753, -0.00976958405226469, 0.09828254580497742, -0.03982505574822426, -0.008076129481196404, 0.09622017294168472, -0.03922056779265404, -0.11940404772758484, -0.00769832544028759, 0.044696513563394547, -0.01298759039491415, 0.03596700355410576, 0.00642267893999815, 0.06546243280172348, 0.057924117892980576, -0.03506027162075043, -0.00648490572348237, -0.05259040743112564, -0.019308039918541908, -0.027361946180462837, -0.021263733506202698, -0.03310457617044449, -0.071720652282238, 0.05323045328259468, 0.003944724798202515, 0.06009316071867943, 0.01704121194779873, 0.010347402654588223, 0.025441808626055717, -0.0002630742674227804, -0.029744338244199753, 0.0067382571287453175, -0.025761831551790237, 0.026846352964639664, 0.03666038438677788, -0.0019068022957071662, 0.04330974817276001, -0.006560466717928648, 0.026152970269322395, 0.05550616979598999, -0.02627742476761341, 0.021299293264746666, -0.007116061635315418, -0.0024112826213240623, -0.021690431982278824, 0.005218148697167635, 0.026081854477524757, 0.012178643606603146, -0.03212672844529152, 0.06677807867527008, 0.02503289096057415, -0.0011545264860615134, 0.030988870188593864, -0.014187675900757313, 0.056324005126953125, -0.08654837310314178, 0.056288447231054306, 0.038580521941185, -0.013476514257490635, -0.025175124406814575, -0.019165806472301483, 0.009262881241738796, 0.014783273451030254, -0.020428119227290154, -0.00912953820079565, 0.012303097173571587, 0.0037047078367322683, -0.020641468465328217, 0.02092593163251877, -0.031273335218429565, -0.004044732078909874, 0.04519432410597801, -0.008325036615133286, -0.008662838488817215, -0.004193631466478109, 0.020143654197454453, 0.06087544187903404, -0.01893468014895916, 0.0008083908469416201, -0.010427407920360565, -0.0704050064086914, -0.0013167603174224496, -0.07228958606719971, -0.027753084897994995, -0.053799379616975784, 0.04362976923584938, 0.008751733228564262, -0.009031753055751324, -0.0052803754806518555, -0.010462965816259384, -0.018125733360648155, -0.037691570818424225, 0.005089250858873129, -0.004738114774227142, -0.009876257739961147, 0.03362016752362251, -0.022579383105039597, -0.009689577855169773, -0.03850940614938736, -0.023646125569939613, 0.025886286050081253, 0.02281051129102707, -0.06130213662981987, 0.03111332282423973, 0.01572556234896183, 0.04487430304288864, 0.028730932623147964, -0.015129964798688889, 0.019823631271719933, -0.012898694723844528, 0.035486966371536255, 0.010676315054297447, -0.004429203923791647, -0.020143654197454453, -0.03278455510735512, -0.027041923254728317, 0.02117483876645565, 0.056003984063863754, -0.000005555950792768272, 0.012978700920939445, -0.025904064998030663, -0.025228461250662804, -0.01330761332064867, -0.003911389037966728, -0.008538384921848774, -0.028393130749464035, 0.019965864717960358, 0.04138961061835289, -0.04010951891541481, -0.04914127290248871, 0.027184154838323593, -0.05539949610829353, -0.0014434360200539231, 0.03939835727214813, 0.01729011908173561, -0.06884045153856277, 0.03282011300325394, 0.0417807474732399, -0.010107384994626045, 0.023272765800356865, -0.02025032974779606, 0.023877253755927086, 0.013600966893136501, -0.012125306762754917, 0.01925470307469368, 0.043203070759773254, -0.011174128390848637, 0.038687195628881454, -0.01866799406707287, 0.011929737403988838, 0.04775450751185417, 0.022294918075203896, -0.006756036076694727, 0.04750560224056244, 0.01893468014895916, -0.04302528128027916, 0.00616488279774785, 0.05241261422634125, 0.0037624898832291365, -0.05191480368375778, -0.008276144042611122, 0.019770294427871704, 0.03113110177218914, 0.02377058006823063, -0.028499804437160492, -0.018072396516799927, -0.0577818863093853, 0.024961775168776512, -0.03618035092949867, -0.0064537920989096165, 0.019343597814440727, 0.0033091241493821144, -0.04007396101951599, 0.04355865344405174, 0.025477366521954536, -0.0018567986553534865, -0.03890054300427437, 0.020036980509757996, -0.02567293681204319, 0.02273939549922943, -0.03822493925690651, -0.050208013504743576, 0.05301710218191147, 0.038367174565792084, 0.02377058006823063, 0.00132231623865664, -0.019130248576402664, -0.040251750499010086, 0.011814173310995102, -0.038331612944602966, -0.005849304609000683, -0.016845641657710075, 0.03390463441610336, -0.034811362624168396, 0.034153539687395096, -0.007022721692919731, -0.03954058885574341, 0.021263733506202698, 0.021565977483987808, -0.028055328875780106, -0.0063826763071119785, -0.06510685384273529, -0.04946129396557808, -0.039967287331819534, 0.026455214247107506, 0.04711446166038513, 0.002857981016859412, 0.01348540373146534, 0.06340006738901138, 0.03751377761363983, 0.07157842069864273, -0.009662909433245659, 0.027184154838323593, 0.021263733506202698, 0.005031468812376261, -0.03539807349443436, -0.04192298278212547, 0.023592788726091385, -0.029708778485655785, 0.03712264075875282, 0.0604131855070591, 0.04213633015751839, -0.017432350665330887, 0.019112469628453255, -0.0570351667702198, 0.009098424576222897, -0.03264231979846954, -0.021690431982278824, -0.0320911705493927, -0.03470468893647194, -0.07278739660978317, 0.043451979756355286, 0.012960921972990036, 0.0007850558031350374, -0.006587135139852762, 0.026810795068740845, -0.01666785217821598 ]
717,098
pytorch_optimizer.optimizer.lookahead
step
null
def step(self, closure: CLOSURE = None) -> LOSS: loss: LOSS = self.optimizer.step(closure) for group in self.param_groups: group['counter'] += 1 if group['counter'] >= self.k: group['counter'] = 0 self.update(group) return loss
(self, closure: Optional[Callable[[], float]] = None) -> Optional[float]
[ -0.015723401680588722, 0.0028304853476583958, -0.07915355265140533, 0.08279112726449966, -0.01664188876748085, 0.00030095220427028835, 0.004442384000867605, -0.02437172830104828, -0.021170666441321373, 0.023425959050655365, -0.07009600102901459, -0.044487498700618744, 0.020152145996689796, 0.045651521533727646, -0.004540144000202417, -0.0052153682336211205, 0.013031600043177605, 0.015814341604709625, -0.014031931757926941, -0.002844126196578145, -0.0011935781221836805, -0.01737849786877632, -0.024335352703928947, 0.018406111747026443, -0.05852852389216423, -0.008002657443284988, 0.05110787972807884, 0.011803919449448586, -0.000696253904607147, -0.030373722314834595, -0.01913362555205822, -0.018051447346806526, 0.007661634590476751, -0.00872107781469822, 0.027299974113702774, -0.038958389312028885, -0.04485125467181206, 0.018697116523981094, -0.013495390303432941, -0.05110787972807884, -0.011358316987752914, 0.011949421837925911, -0.037903495132923126, 0.024826424196362495, 0.05187176913022995, 0.06885922700166702, 0.019333692267537117, 0.03299277275800705, 0.05514558404684067, -0.029282450675964355, -0.031210362911224365, -0.026554271578788757, 0.0570371188223362, -0.01759675145149231, 0.060856569558382034, 0.052853912115097046, 0.03793986886739731, -0.07213304191827774, 0.024880988523364067, -0.03719416633248329, 0.04601527750492096, -0.05601859837770462, -0.003382941475138068, 0.026008635759353638, -0.015268705785274506, -0.05270840972661972, -0.02635420486330986, 0.013277135789394379, 0.030082715675234795, 0.012786063365638256, 0.0221891850233078, 0.012886096723377705, 0.05045311525464058, -0.010339796543121338, -0.0628572329878807, -0.011176438070833683, -0.03053741157054901, -0.01412287075072527, 0.07711651176214218, -0.04303247109055519, -0.0022677984088659286, 0.0010099944192916155, -0.017678597941994667, 0.024280788376927376, -0.03613927215337753, -0.01889718323945999, -0.007025059778243303, -0.04848882555961609, -0.03390216454863548, -0.007416098844259977, 0.016960177570581436, 0.04721567779779434, 0.029791709035634995, 0.044814880937337875, 0.043105222284793854, 0.04579702392220497, -0.06296636164188385, -0.01607806608080864, -0.025754006579518318, -0.04412374272942543, 0.05045311525464058, 0.006797711830586195, 0.03466605395078659, 0.028736814856529236, 0.030701102688908577, -0.042341332882642746, 0.028354870155453682, -0.033993106335401535, -0.03382941335439682, 0.019642885774374008, 0.010849056765437126, 0.01246777642518282, -0.03884926438331604, 0.004469665698707104, -0.0554729625582695, -0.02468092180788517, 0.008566481061279774, -0.009903288446366787, 0.012940660119056702, 0.05263565853238106, -0.027663730084896088, -0.028409432619810104, -0.022061871364712715, 0.009530437178909779, -0.004719749093055725, 0.023353207856416702, 0.03779436647891998, 0.0387401357293129, 0.010257950983941555, -0.053690552711486816, 0.0035670935176312923, -0.03715779259800911, 0.012822438962757587, 0.004469665698707104, 0.007952640764415264, -0.018733492121100426, 0.015441490337252617, -0.0035898282658308744, -0.009007535874843597, -0.01973382569849491, -0.004358265083283186, 0.02220737375319004, -0.015177766792476177, 0.03519350290298462, 0.06474877148866653, -0.025026490911841393, 0.014623037539422512, 0.023425959050655365, 0.0032260711304843426, -0.014523004181683064, 0.006602192297577858, 0.02548118866980076, 0.1002514660358429, -0.004697014112025499, 0.013295323587954044, 0.051180630922317505, -0.01150381937623024, -0.030628351494669914, -0.018578896299004555, -0.040631674230098724, -0.009348558261990547, -0.019515570253133774, -0.03492068499326706, 0.004117276053875685, 0.006079291459172964, 0.0124586820602417, -0.004069533199071884, 0.061693210154771805, -0.08206360787153244, -0.008389148861169815, 0.04776131361722946, -0.028773190453648567, 0.08250012248754501, 0.027663730084896088, -0.02473548613488674, 0.11029116809368134, 0.0031783280428498983, 0.007916265167295933, 0.008807470090687275, -0.02306220307946205, 0.01676011085510254, 0.007325159385800362, 0.013340793550014496, -0.03404766693711281, -0.016478197649121284, -0.010530768893659115, 0.012786063365638256, 0.009548624977469444, 0.04819782078266144, -0.01884262077510357, -0.011394692584872246, -0.00983053632080555, 0.05067136883735657, 0.01443206425756216, -0.012158582918345928, 0.014613943174481392, -0.007684369571506977, 0.028918692842125893, 0.08308213204145432, 0.023626025766134262, -0.07009600102901459, -0.001028182334266603, 0.005829208064824343, 0.03190150111913681, -0.00429233442991972, 0.043432604521512985, -0.005238102748990059, 0.07507947087287903, -0.010903620161116123, -0.008093596436083317, -0.04485125467181206, -0.01246777642518282, 0.05580034479498863, 0.05736450105905533, 0.032592639327049255, -0.0687137246131897, -0.021825429052114487, -0.0007275142706930637, 0.05121700465679169, -0.04888895899057388, -0.0661674216389656, 0.004465118981897831, 0.008793829008936882, -0.05209002271294594, 0.039213020354509354, -0.055072832852602005, 0.005970164202153683, -0.0410681813955307, -0.035393569618463516, -0.0009315593051724136, -0.010294327512383461, -0.048707082867622375, 0.005647329613566399, -0.01967926137149334, 0.019079061225056648, -0.022261936217546463, -0.07035063207149506, -0.02026127278804779, -0.012622373178601265, -0.021952742710709572, -0.021443484351038933, -0.07908080518245697, -0.020897848531603813, 0.03381122648715973, -0.06045643612742424, 0.03848550468683243, 0.01246777642518282, 0.016869237646460533, 0.05900140851736069, 0.07275142520666122, -0.00728423660621047, -0.026772525161504745, -0.08999351412057877, -0.010467112064361572, -0.0443783700466156, 0.0024007970932871103, 0.03106486052274704, 0.015968939289450645, 0.05190814286470413, -0.02853674814105034, -0.01218586415052414, 0.03693953901529312, -0.06082019582390785, 0.02771829441189766, -0.038449130952358246, 0.04696104675531387, 0.03495706245303154, -0.034520551562309265, 0.04572427272796631, 0.014195622876286507, 0.048925336450338364, 0.08475541323423386, -0.0024758221115916967, -0.038703758269548416, -0.01456847321242094, 0.01918818987905979, 0.0249173641204834, 0.03168324753642082, 0.0022677984088659286, -0.05303579196333885, 0.12054912000894547, -0.021297980099916458, -0.09472236037254333, -0.023371396586298943, -0.08621044456958771, 0.051471635699272156, 0.001244731480255723, 0.010394359938800335, 0.02271663397550583, -0.03946765139698982, -0.013804583810269833, -0.009821442887187004, 0.09384934604167938, -0.004342351108789444, 0.029609831050038338, -0.034793369472026825, -0.051144253462553024, -0.0011856209021061659, -0.02855493500828743, 0.065003402531147, 0.036757659167051315, -0.06369387358427048, -0.04539689049124718, 0.015095921233296394, 0.003710322780534625, 0.032901834696531296, 0.059801675379276276, -0.018751680850982666, -0.027354536578059196, -0.019297316670417786, 0.016669170930981636, 0.04998023062944412, -0.02577219344675541, 0.02689984068274498, 0.007115999236702919, -0.07380632311105728, -0.004988019820302725, -0.03210156783461571, -0.008025391958653927, 0.0809723362326622, 0.021207042038440704, -0.019297316670417786, -0.025608502328395844, 0.025881320238113403, -0.030664727091789246, 0.02277119643986225, 0.09552262723445892, -0.0160598773509264, -0.02911875955760479, -0.07038700580596924, -0.05325404554605484, -0.024499043822288513, 0.021952742710709572, 0.03442961350083351, -0.051689889281988144, 0.01068536564707756, 0.017542188987135887, -0.006552175618708134, 0.006133854854851961, -0.02991902455687523, 0.017260275781154633, 0.01457756757736206, -0.04677916690707207, -0.002295080106705427, 0.0016846503131091595, 0.006706772372126579, 0.017214806750416756, -0.027572792023420334, 0.062020592391490936, -0.018078729510307312, 0.015505148097872734, 0.03170143440365791, 0.019224565476179123, 0.006152042653411627, 0.0554729625582695, 0.053981561213731766, 0.04412374272942543, -0.0024280790239572525, -0.02329864539206028, -0.0615113340318203, 0.018233327195048332, 0.009057552553713322, 0.00769346347078681, 0.06220247223973274, 0.07653450220823288, 0.027045343071222305, -0.04157743975520134, -0.023425959050655365, -0.010485299862921238, -0.012040361762046814, -0.02078871987760067, 0.0015687026316300035, 0.02331683225929737, 0.050052981823682785, -0.015577899292111397, 0.008134518750011921, -0.0271544698625803, -0.019242752343416214, 0.03461149334907532, 0.04688829556107521, 0.029791709035634995, -0.004847064148634672, -0.00030976193374954164, 0.03690316155552864, -0.023807905614376068, -0.02271663397550583, -0.004747030790895224, -0.05831027030944824, 0.02388065680861473, -0.04736118018627167, 0.07908080518245697, -0.01660551317036152, -0.0008912049815990031, -0.007470662239938974, -0.013504483737051487, -0.013358981348574162, -0.007056888658553362, -0.007984469644725323, -0.05350867658853531, -0.006133854854851961, -0.031464993953704834, -0.02331683225929737, -0.03946765139698982, 0.010030603036284447, 0.009221243672072887, -0.05765550583600998, -0.03501162678003311, 0.05267203599214554, -0.00004760103183798492, 0.010621708817780018, -0.03779436647891998, 0.004724295809864998, -0.0016869237879291177, 0.0007616165094077587, 0.04044979438185692, -0.05801926553249359, 0.014004649594426155, -0.0014447978464886546, 0.03162868320941925, -0.0224801916629076, 0.05194452032446861, 0.033683910965919495, 0.04248683527112007, 0.027390912175178528, -0.0432143472135067, -0.07282418012619019, 0.025444811210036278, -0.050307612866163254, -0.027918361127376556, 0.009939664043486118, -0.10308877378702164, -0.04692467302083969, -0.011203720234334469, 0.023662401363253593, -0.015859810635447502, 0.010194294154644012, -0.019588321447372437, 0.024298977106809616, 0.03193787857890129, 0.013822771608829498, -0.018115105107426643, 0.044778503477573395, -0.010921807959675789, -0.006338468287140131, -0.000833231199067086, -0.0031328583136200905, 0.030119091272354126, -0.018769867718219757, -0.09290357679128647, 0.043105222284793854, 0.03188331425189972, -0.005874678026884794, 0.020897848531603813, -0.009794160723686218, 0.010030603036284447, 0.013968273997306824, -0.09152130037546158, -0.06624017655849457, -0.01096727792173624, -0.006179324351251125, 0.029518892988562584, 0.012413212098181248, -0.011531101539731026, 0.011267377063632011, -0.01385005284100771, 0.00354208517819643, 0.00983963068574667, 0.07478846609592438, 0.024626359343528748, -0.01150381937623024, 0.008093596436083317, -0.00561550073325634, -0.0044924006797373295, -0.007607071194797754, -0.0027600072789937258, -0.03019184246659279, -0.013158914633095264, 0.029573455452919006, 0.015059545636177063, -0.020370399579405785, -0.016378166154026985, 0.012713312171399593, 0.04623353108763695, -0.006020180881023407, -0.000576611899305135, 0.028118427842855453, 0.02526293322443962, -0.0332837775349617, 0.0007792360265739262, 0.05187176913022995, -0.029755333438515663, -0.07380632311105728, 0.05263565853238106, 0.02438991703093052, 0.004678826313465834, -0.01249505765736103, 0.03764886409044266, 0.04550601914525032, 0.06318461894989014, -0.03603014349937439, -0.025972260162234306, 0.045105885714292526, -0.024208037182688713, -0.0702778771519661, -0.010194294154644012, 0.024080723524093628, -0.02695440500974655, -0.0172239001840353, -0.028973257169127464, 0.025972260162234306, 0.05598222464323044, -0.026245078071951866, -0.012649654410779476, 0.02804567478597164, 0.0325017012655735, -0.024480855092406273, 0.019006310030817986, 0.036994099617004395, 0.01660551317036152, -0.017896851524710655, 0.05427256599068642, -0.05445444583892822, 0.02746366336941719, 0.013522671535611153, -0.012567808851599693, 0.025754006579518318, -0.0005595607799477875, -0.005983804818242788, -0.003517076838761568, 0.01054895669221878, -0.041795697063207626, 0.047252051532268524, 0.03721235692501068, 0.0893387570977211, 0.00922579038888216, -0.0471065491437912, -0.009475873783230782, -0.03804899752140045, -0.09726866334676743, 0.01621447503566742, -0.013349886983633041, 0.007302424404770136, 0.0455423928797245, -0.01304069347679615, -0.04168656840920448, 0.08570118248462677, 0.005947429221123457, -0.020370399579405785, -0.06631292402744293, -0.008807470090687275, -0.049507346004247665, 0.059365164488554, -0.024499043822288513, 0.007757121231406927, 0.03130130097270012, 0.02688165195286274, 0.008425524458289146, 0.0031578666530549526, 0.012567808851599693, 0.02020670846104622, -0.017960509285330772, -0.04226858168840408, 0.0554729625582695, -0.05965617299079895, 0.042595960199832916, -0.01056714542210102, -0.0005737700266763568, -0.04517863690853119, -0.009080288000404835, 0.062275223433971405, -0.0044969478622078896, -0.01701474003493786, -0.012931566685438156, -0.030428284779191017, -0.03903114050626755, -0.015359645709395409, 0.0214071087539196, -0.017705878242850304, -0.03268357738852501, -0.027245409786701202, 0.00429233442991972, -0.0023007639683783054, 0.01443206425756216, -0.001461848965846002, -0.028936881572008133, 0.021443484351038933, -0.07893530279397964, 0.016359977424144745, -0.012258615344762802, 0.059801675379276276, -0.03055560030043125, 0.007911717519164085, -0.10949090123176575, -0.04325072467327118, -0.021170666441321373, -0.021861804649233818, -0.03997690975666046, -0.02411709912121296, -0.00701141869649291, 0.0554729625582695, 0.0004410555411595851, -0.009739597328007221, 0.010394359938800335, 0.07100539654493332, -0.01816057600080967, 0.03359297290444374, -0.05434531718492508, 0.05998355150222778, 0.01344992034137249, 0.001403875183314085, -0.0539088100194931, -0.002466728212311864, 0.022134622558951378, 0.009894194081425667, -0.08286387473344803, -0.008452806621789932, 0.013149820268154144, -0.02333502098917961, 0.05576397106051445, -0.03028278239071369, -0.0023166784085333347, 0.012204051949083805, -0.011658416129648685, -0.00701141869649291, 0.03159230947494507, -0.025954071432352066, 0.07529772818088531, -0.04135918617248535, -0.010303420946002007, -0.005083505995571613, -0.06518527865409851, 0.034829746931791306, -0.0063612028025090694, -0.034229546785354614, 0.08664695173501968, -0.013122539035975933, -0.01277696993201971, 0.012231334112584591, -0.029227886348962784, -0.08737446367740631, -0.028463996946811676, 0.04630628600716591, 0.020170332863926888, -0.006906838621944189, -0.002625871915370226, -0.010048790834844112, -0.02300763875246048, 0.035921018570661545, 0.0383400022983551, -0.008007204160094261, 0.01944281905889511, 0.0250083040446043, -0.053617801517248154, 0.009594094939529896, 0.042886968702077866, 0.013540859334170818, 0.013386262580752373, 0.017969602718949318, 0.020133957266807556, -0.07246042042970657, -0.027263598516583443, -0.005033489316701889, 0.015950750559568405, -0.02164354920387268, -0.0443783700466156, 0.009148492477834225, 0.002705443650484085, -0.0947951078414917, -0.05580034479498863, -0.03019184246659279, -0.065003402531147, -0.03779436647891998, -0.03903114050626755, 0.03355659544467926, -0.002919150982052088, -0.0377579927444458, 0.011331034824252129, -0.007857154123485088, -0.042013950645923615, 0.017132962122559547, 0.003526170738041401, 0.023244081065058708, -0.018115105107426643, -0.002113201655447483, 0.038085371255874634, 0.024298977106809616, -0.033738475292921066, 0.0036398449447005987, 0.03268357738852501, 0.03295639529824257, -0.004847064148634672, 0.009685033932328224, 0.03228344768285751, 0.017660409212112427, -0.06038368493318558, -0.03448417782783508, 0.010776305571198463, 0.007270595990121365, 0.0778440311551094, -0.011276471428573132, 0.015741590410470963, -0.013731831684708595, -0.006415766663849354, -0.02937338873744011, 0.006042915396392345, 0.04194119945168495, 0.007402457762509584, -0.017196618020534515, 0.04601527750492096, 0.021225228905677795, -0.004783406388014555, -0.02360783889889717, -0.07646175473928452, 0.022243749350309372, 0.00044332901597954333, 0.030082715675234795, -0.05794651433825493, -0.026827089488506317, -0.03135586529970169, 0.016823768615722656, 0.0006433954695239663, 0.007547960616648197, 0.0024417198728770018, -0.0019051780691370368, -0.04055892303586006, 0.010903620161116123, 0.08722896128892899, 0.019042685627937317, 0.014104682952165604, 0.019752012565732002, -0.006197512149810791, -0.019242752343416214, -0.01845158077776432, -0.04877983406186104, 0.006288451608270407, 0.011740261688828468, 0.008930237963795662, -0.0020643218886107206, -0.0002883059496525675, 0.003035098547115922, 0.047870438545942307, 0.011149156838655472, 0.010849056765437126, -0.050343990325927734, 0.0247172974050045, 0.038085371255874634, -0.006961402483284473, -0.013149820268154144, 0.04132281243801117, -0.09115754067897797, 0.051471635699272156, 0.04361448064446449, 0.03632115200161934, 0.024826424196362495, 0.013840959407389164, -0.024808237329125404, 0.035102564841508865, -0.025644877925515175, 0.008534652180969715, -0.008698342368006706, -0.017960509285330772, -0.03914026916027069, 0.05514558404684067, 0.049543723464012146, -0.012567808851599693, 0.014450252056121826, 0.09574087709188461, 0.02635420486330986 ]
717,111
pytorch_optimizer.loss.lovasz
LovaszHingeLoss
Binary Lovasz hinge loss. :param per_image: bool. compute the loss per image instead of per batch.
class LovaszHingeLoss(nn.Module): r"""Binary Lovasz hinge loss. :param per_image: bool. compute the loss per image instead of per batch. """ def __init__(self, per_image: bool = True): super().__init__() self.per_image = per_image def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor: if not self.per_image: return lovasz_hinge_flat(y_pred, y_true) return sum(lovasz_hinge_flat(y_p, y_t) for y_p, y_t in zip(y_pred, y_true)) / y_pred.size()[0]
(per_image: bool = True)
[ -0.01561320573091507, -0.10208983719348907, 0.036058422178030014, 0.034096550196409225, 0.005408762954175472, -0.03273414447903633, -0.053588081151247025, -0.001546334009617567, 0.01065403688699007, 0.005740282591432333, 0.006416945718228817, -0.06753914803266525, -0.007393338717520237, 0.02121724747121334, -0.028592420741915703, 0.03255248814821243, 0.009069101884961128, 0.008792078122496605, -0.010281645692884922, -0.02733900398015976, 0.002522727008908987, -0.02356059104204178, 0.0022899822797626257, 0.03327910602092743, -0.03340626507997513, -0.005295229144394398, -0.004162158817052841, -0.011480565182864666, 0.016212664544582367, -0.013070042245090008, -0.06049095094203949, -0.03149889409542084, -0.0021503353491425514, -0.017111854627728462, 0.0144506162032485, -0.0292463768273592, -0.006957367993891239, 0.04461434856057167, -0.1174214780330658, -0.009250756353139877, 0.022652316838502884, -0.053842395544052124, 0.0197458453476429, 0.04236183315515518, 0.0025522459764033556, 0.018537843599915504, -0.04617657512426376, -0.03713018074631691, 0.012179935351014137, -0.009509613737463951, -0.04243449494242668, -0.051480889320373535, 0.022470662370324135, -0.008133580908179283, -0.010454216971993446, 0.06317944079637527, 0.06012764200568199, 0.005776613485068083, -0.008142663165926933, -0.03485950082540512, 0.0023615085519850254, -0.057475488632917404, 0.05271613970398903, 0.016793958842754364, 0.022452497854828835, -0.0050499956123530865, -0.07600424438714981, 0.03700302541255951, 0.016948366537690163, 0.02541346661746502, -0.009963749907910824, -0.011834791861474514, 0.028592420741915703, 0.09286178648471832, -0.016357988119125366, 0.006548644974827766, 0.0008986221509985626, -0.0030200062319636345, 0.030608784407377243, 0.008723958395421505, 0.022525159642100334, -0.024468863382935524, -0.0011852956376969814, 0.01720268279314041, 0.0012136792065575719, -0.117203488945961, 0.0384017638862133, -0.04639456421136856, 0.041489891707897186, -0.0017734022112563252, -0.07302511483430862, 0.02730267308652401, 0.0056494553573429585, 0.005781155079603195, 0.07113590836524963, 0.04690319672226906, -0.024922998622059822, -0.018892068415880203, 0.01759324036538601, -0.027974795550107956, 0.01725717820227146, 0.08021863549947739, 0.06837476044893265, 0.03738449886441231, 0.023724079132080078, 0.0003650120343081653, 0.0009565245127305388, 0.0032152847852557898, -0.022924799472093582, -0.03342442959547043, -0.004105391912162304, -0.015994679182767868, -0.04319744184613228, -0.042180176824331284, 0.026557888835668564, -0.04683053493499756, 0.002411463763564825, 0.04127190634608269, -0.028447097167372704, 0.05616757646203041, 0.023724079132080078, -0.018274443224072456, -0.04552261903882027, -0.05380606651306152, 0.027702312916517258, -0.003769331146031618, 0.05057261511683464, -0.04250715672969818, 0.019037391990423203, -0.0395643524825573, -0.0390193909406662, 0.037929460406303406, -0.06488699465990067, 0.016003763303160667, -0.022924799472093582, -0.05031830072402954, 0.038147445768117905, 0.026230910792946815, 0.05326110124588013, 0.013397020287811756, 0.008010963909327984, 0.013760329224169254, 0.04886506497859955, 0.05275246873497963, 0.010744864121079445, -0.0033401723485440016, 0.043996721506118774, 0.029191879555583, 0.11037328094244003, 0.0031698711682111025, 0.0390920527279377, -0.03335176780819893, 0.0289557296782732, 0.03723917528986931, -0.007956467568874359, -0.003328818827867508, -0.020218146964907646, -0.004768430721014738, -0.025758609175682068, 0.013941983692348003, -0.020327139645814896, -0.026557888835668564, -0.05674887076020241, -0.010699450969696045, -0.047520820051431656, -0.06310677528381348, 0.020908433943986893, 0.04646722599864006, 0.03309745341539383, 0.05431469902396202, 0.029809504747390747, -0.09271646291017532, -0.010063660331070423, 0.06310677528381348, 0.03534996882081032, 0.0964948758482933, -0.00032272058888338506, 0.029900332912802696, -0.004530009347945452, 0.019182715564966202, 0.03756615146994591, -0.014750346541404724, -0.011126338504254818, -0.10695817321538925, -0.008914695121347904, 0.0038987600710242987, 0.021871203556656837, 0.01160772331058979, -0.024087388068437576, 0.0387287437915802, -0.018928399309515953, -0.031862203031778336, 0.009491448290646076, -0.006970991846174002, 0.022597821429371834, 0.013079124502837658, -0.006975533440709114, 0.032007526606321335, 0.03364241495728493, 0.008178994059562683, -0.06612224131822586, 0.04494132474064827, 0.0196005217730999, 0.008769371546804905, -0.05983699485659599, 0.011280745267868042, -0.006171712186187506, 0.0782567635178566, -0.04842909425497055, -0.049446359276771545, -0.018347105011343956, 0.012661319226026535, -0.008265280164778233, 0.07578626275062561, 0.07168087363243103, -0.004380144644528627, -0.06975533068180084, 0.029918497428297997, -0.031862203031778336, -0.0064078629948198795, -0.032007526606321335, -0.03275230899453163, -0.10993731021881104, 0.019927499815821648, 0.05129923298954964, -0.00737063167616725, 0.038074783980846405, -0.00882386788725853, 0.04036363214254379, 0.02143523283302784, -0.004159888252615929, 0.04061795026063919, -0.020508794113993645, -0.004868341144174337, 0.03763881325721741, 0.0058084032498300076, -0.041853200644254684, -0.0024682306684553623, -0.03451435640454292, -0.0040781437419354916, -0.01747516356408596, -0.0390557199716568, -0.039927661418914795, -0.020000161603093147, 0.030063821002840996, -0.031880367547273636, 0.012307093478739262, 0.07440568506717682, -0.026176415383815765, 0.04145355895161629, -0.036022089421749115, -0.04072694107890129, -0.02143523283302784, -0.002647614572197199, -0.02704835683107376, -0.05387872830033302, -0.022779475897550583, -0.02742983214557171, 0.01157139241695404, -0.0017325299559161067, -0.02748432755470276, -0.0576208122074604, -0.0386197492480278, 0.014323458075523376, -0.05100858584046364, 0.008424228057265282, -0.020181816071271896, 0.022470662370324135, 0.031934864819049835, 0.0195096954703331, 0.03542263060808182, -0.007652196101844311, -0.04457801580429077, -0.02559512108564377, 0.013433351181447506, 0.04243449494242668, 0.004634460899978876, 0.01065403688699007, 0.01345151662826538, 0.011925619095563889, 0.05282513052225113, -0.10187184810638428, -0.04138089716434479, -0.043924059718847275, 0.005803861655294895, 0.0389103963971138, -0.0006766630685888231, -0.02150789462029934, 0.036022089421749115, -0.02308828756213188, 0.04657621681690216, 0.06710317730903625, 0.012179935351014137, 0.025885768234729767, 0.03475051000714302, -0.008601341396570206, -0.008964650332927704, 0.02314278483390808, 0.0392373763024807, -0.00541784567758441, 0.020617786794900894, -0.024123718962073326, -0.02121724747121334, -0.06866540759801865, -0.06078159809112549, -0.04076327383518219, 0.007066360674798489, 0.04646722599864006, -0.025903932750225067, -0.017139103263616562, 0.023705914616584778, 0.029791340231895447, -0.030481627210974693, 0.010699450969696045, -0.0019879816100001335, -0.059473685920238495, 0.07229849696159363, 0.03229817375540733, -0.007220766972750425, 0.06630389392375946, -0.002629449125379324, 0.04090859740972519, 0.016648635268211365, 0.04497765749692917, 0.011362489312887192, -0.040036655962467194, 0.07157187908887863, 0.005590417422354221, -0.01465951930731535, -0.013533261604607105, 0.0056494553573429585, -0.031898532062768936, 0.022506993263959885, -0.029864002019166946, -0.08632222563028336, 0.026067422702908516, 0.029991159215569496, 0.06423303484916687, -0.0196005217730999, -0.021816706284880638, -0.005258898250758648, 0.013124538585543633, -0.04261614754796028, 0.039927661418914795, 0.01927354373037815, -0.04995499178767204, -0.041562553495168686, -0.006639472208917141, 0.02539530023932457, 0.08021863549947739, -0.027720479294657707, -0.007697609718888998, 0.04697585850954056, 0.03464151546359062, 0.057802464812994, -0.0018960189772769809, -0.04312478005886078, -0.00870579294860363, 0.018710413947701454, -0.043851397931575775, -0.006103591527789831, -0.033969394862651825, -0.06670353561639786, 0.029736842960119247, -0.024759510532021523, 0.028210945427417755, 0.024359870702028275, 0.017184516414999962, 0.010599540546536446, 0.026666881516575813, -0.05278880149126053, -0.029682347550988197, -0.05682153254747391, -0.00881024356931448, 0.013460598886013031, -0.032425329089164734, -0.032352667301893234, 0.01554054394364357, 0.004450535401701927, 0.03244349732995033, 0.044142045080661774, 0.011862039566040039, -0.024014726281166077, -0.027883967384696007, 0.047266505658626556, 0.03113558329641819, 0.03507748618721962, 0.0015883416635915637, 0.03433270379900932, -0.07306144386529922, -0.006857458036392927, -0.03267964720726013, 0.0025567873381078243, -0.022870302200317383, -0.06826576590538025, -0.0061308396980166435, 0.017992880195379257, 0.08915603160858154, -0.03505932167172432, -0.0042847758159041405, 0.030608784407377243, -0.030027490109205246, 0.020872103050351143, 0.021798541769385338, -0.037893131375312805, -0.014069141820073128, 0.0005818621139042079, 0.07306144386529922, 0.0006721217068843544, 0.051735203713178635, -0.018674083054065704, 0.04417837783694267, -0.05209851264953613, 0.0031834952533245087, -0.012370672076940536, -0.004255257081240416, 0.030045656487345695, 0.0145959397777915, -0.06314311176538467, 0.021725879982113838, 0.053442757576704025, 0.011925619095563889, 0.03709385171532631, -0.0034400823060423136, -0.04737549647688866, -0.0029200962744653225, -0.059437356889247894, -0.0288830678910017, -0.055222973227500916, 0.021998360753059387, -0.0773848220705986, -0.04010931774973869, 0.010317976586520672, -0.05002765357494354, 0.008578633889555931, -0.03149889409542084, 0.026630550622940063, -0.022670483216643333, -0.012225348502397537, 0.021871203556656837, 0.023705914616584778, 0.013179034925997257, 0.03169871121644974, 0.04926470294594765, -0.019073722884058952, -0.012307093478739262, 0.010445134714245796, -0.018020126968622208, -0.010917436331510544, -0.01083569135516882, -0.01934620551764965, -0.016494229435920715, 0.03727550432085991, 0.0386924110352993, -0.017920218408107758, -0.057548150420188904, -0.05656721442937851, -0.030027490109205246, 0.016585057601332664, 0.02523181214928627, -0.05380606651306152, 0.035985760390758514, -0.04032730311155319, 0.034023888409137726, 0.02944619581103325, -0.0765128806233406, 0.059619009494781494, -0.024323539808392525, -0.006653096526861191, -0.018928399309515953, -0.0021480645518749952, -0.03456885367631912, 0.026376234367489815, 0.0019391619134694338, -0.0012920177541673183, -0.0032629691995680332, 0.006934660952538252, 0.009146304801106453, 0.03538629785180092, -0.0383291020989418, -0.0029882167000323534, -0.018292609602212906, 0.01969134993851185, -0.019055558368563652, 0.026085587218403816, -0.03553162142634392, 0.006653096526861191, -0.010136322118341923, 0.017965631559491158, -0.025831270962953568, -0.025667782872915268, 0.019110053777694702, 0.020726779475808144, 0.044142045080661774, -0.04650355502963066, -0.032316338270902634, -0.02724817767739296, -0.02170771360397339, 0.030481627210974693, -0.01477759424597025, 0.009196260012686253, 0.02550429292023182, -0.0582747682929039, -0.04494132474064827, 0.018356189131736755, 0.06078159809112549, 0.0293917004019022, 0.005676703527569771, -0.02357875555753708, 0.053515419363975525, 0.014041894115507603, 0.012370672076940536, -0.001371491583995521, 0.057548150420188904, 0.00033095182152464986, -0.0068029616959393024, 0.03100842610001564, 0.09249848127365112, 0.06684885919094086, 0.0056494553573429585, 0.027538824826478958, -0.00980026088654995, 0.006312494166195393, -0.038074783980846405, 0.018964730203151703, 0.04664887860417366, 0.026285408064723015, -0.030354468151926994, 0.0577661357820034, 0.06365174055099487, -0.013269862160086632, -0.029936663806438446, -0.009114515036344528, 0.04857441782951355, -0.013224448077380657, -0.0035717817954719067, -0.0196005217730999, -0.02546796202659607, -0.053442757576704025, -0.032062020152807236, -0.02922821044921875, -0.05075427144765854, -0.013269862160086632, 0.010027329437434673, -0.003099480178207159, 0.022270843386650085, -0.04207118600606918, 0.0786200761795044, -0.08167187124490738, -0.033969394862651825, -0.06009131297469139, -0.026612386107444763, -0.03115374967455864, 0.0014861610252410173, 0.06372440606355667, 0.0780387818813324, -0.02554062381386757, 0.030590619891881943, 0.005440552718937397, 0.06935569643974304, -0.06350641697645187, -0.05100858584046364, 0.05307944864034653, -0.01550421305000782, -0.02893756330013275, 0.0197458453476429, 0.008287986740469933, 0.04875607043504715, -0.03095392882823944, 0.04908305034041405, -0.0191645510494709, 0.04868340864777565, 0.007888346910476685, -0.022997461259365082, -0.02339710108935833, 0.01370583288371563, 0.04341542720794678, -0.049664344638586044, 0.03660338371992111, -0.04624924063682556, -0.012470582500100136, -0.08138122409582138, 0.01058137509971857, 0.03536813333630562, -0.0392010435461998, 0.016557808965444565, -0.04832009971141815, 0.06336109340190887, -0.022379836067557335, 0.07571359723806381, -0.001396469073370099, -0.024160049855709076, 0.022852137684822083, 0.01722084730863571, 0.030172813683748245, -0.009636771865189075, -0.037675146013498306, -0.013424267992377281, 0.08356107771396637, 0.03534996882081032, 0.016866620630025864, 0.015931101515889168, -0.014187217690050602, -0.008337941952049732, 0.03137173503637314, -0.011416985653340816, -0.02515915036201477, -0.018728580325841904, -0.027902133762836456, -0.04454168677330017, -0.01458685752004385, 0.026194579899311066, 0.03627640753984451, -0.014141803607344627, -0.05191686004400253, 0.03487766534090042, 0.02535896934568882, 0.015395219437777996, 0.059219371527433395, 0.024305373430252075, 0.026739543303847313, 0.012479664757847786, -0.0020640494767576456, -0.012461499311029911, 0.0098365917801857, -0.03267964720726013, 0.0383291020989418, -0.03493216261267662, 0.01079027820378542, 0.012552326545119286, -0.02312462031841278, 0.0011977844405919313, 0.02174404449760914, -0.016712214797735214, 0.024922998622059822, 0.012080024927854538, -0.0026362610515207052, 0.017184516414999962, -0.032261840999126434, -0.031825870275497437, -0.05467800796031952, -0.01452327799052, -0.013923818245530128, -0.01253416109830141, -0.02904655598104, -0.00038913803291507065, 0.028701413422822952, 0.0058492752723395824, -0.00635790778324008, -0.028011126443743706, 0.01458685752004385, 0.053588081151247025, 0.012506913393735886, 0.06634023040533066, 0.013060959056019783, 0.0005971891805529594, -0.014250796288251877, 0.03338810056447983, 0.0393463671207428, -0.06434202939271927, -0.010472382418811321, -0.013342523947358131, 0.02134440466761589, 0.043778736144304276, -0.0028565172106027603, 0.03371507674455643, 0.038365431129932404, -0.05987332761287689, -0.006198960356414318, -0.005921937059611082, -0.043742407113313675, 0.028065621852874756, -0.08341575413942337, -0.02121724747121334, 0.04635823145508766, -0.05631290003657341, -0.007252556271851063, -0.015304392203688622, -0.02717551589012146, -0.0015304392436519265, 0.013160869479179382, 0.018964730203151703, -0.0014044163981452584, 0.02733900398015976, 0.021017426624894142, 0.028519758954644203, -0.03366057947278023, 0.013578674755990505, -0.028447097167372704, -0.026503393426537514, -0.06092692166566849, 0.011253496631979942, 0.04475967213511467, -0.01969134993851185, 0.049664344638586044, -0.03355158865451813, -0.028011126443743706, -0.023833071812987328, -0.04421470686793327, -0.059437356889247894, -0.01154414378106594, -0.004750265274196863, -0.047738805413246155, -0.014568692073225975, -0.019019227474927902, 0.058965053409338, 0.007652196101844311, -0.04330643638968468, -0.006121756974607706, 0.0011353406589478254, -0.0293190386146307, 0.005676703527569771, 0.047266505658626556, -0.020872103050351143, 0.004877423867583275, 0.04911937937140465, -0.006439652293920517, -0.005240732803940773, -0.022525159642100334, 0.020363470539450645, 0.03109925240278244, -0.008969191461801529, 0.037784136831760406, 0.04526830464601517, -0.08058194071054459, -0.07578626275062561, 0.016485147178173065, -0.04926470294594765, -0.0024500652216374874, 0.03756615146994591, 0.01071761641651392, -0.004291587974876165, -0.017093690112233162, 0.020962931215763092, 0.04236183315515518, -0.009945584461092949, 0.0383291020989418, 0.01366950199007988, 0.035622451454401016, 0.01584027335047722, 0.05631290003657341, -0.024432532489299774, 0.008932860568165779, -0.0013930629938840866, 0.09133588522672653, 0.01753874309360981, 0.0008753477013669908, 0.034005723893642426, 0.02167138271033764, -0.03244349732995033, 0.04276147112250328, -0.005177153740078211, 0.011898370459675789, -0.026485227048397064, 0.09133588522672653, -0.008319776505231857, 0.0047548068687319756, -0.03133540228009224, -0.059510018676519394, -0.06386972963809967, -0.01452327799052, -0.046103913336992264, 0.02944619581103325, -0.010090908035635948, -0.016866620630025864, 0.0195096954703331, 0.0292463768273592, 0.03549529239535332 ]
717,117
pytorch_optimizer.loss.lovasz
__init__
null
def __init__(self, per_image: bool = True): super().__init__() self.per_image = per_image
(self, per_image: bool = True)
[ 0.01732342690229416, -0.06731095910072327, -0.010819664224982262, 0.035416025668382645, -0.025092048570513725, 0.007140465546399355, -0.013058804906904697, 0.002478437963873148, -0.036954365670681, 0.03640739992260933, 0.043620508164167404, 0.05644001439213753, -0.018442997708916664, 0.054970044642686844, -0.0029976279474794865, -0.027809783816337585, 0.02632272057235241, 0.0440991036593914, 0.01672518439590931, 0.03141633793711662, -0.018374627456068993, 0.0670032873749733, 0.003798847319558263, 0.012691311538219452, 0.015862002968788147, 0.07794260233640671, -0.0014272384578362107, -0.01617821864783764, 0.016323504969477654, -0.005529480520635843, -0.0536368191242218, 0.014537321403622627, 0.045193035155534744, 0.08409596234560013, 0.012263994663953781, 0.002670730696991086, -0.022015366703271866, 0.07924164831638336, -0.1349637657403946, 0.04286843165755272, 0.038492705672979355, -0.024596361443400383, 0.007931001484394073, -0.004696212708950043, -0.010238513350486755, 0.013067350722849369, 0.018579738214612007, -0.04584255814552307, -0.02856186218559742, -0.023416966199874878, 0.007841264829039574, -0.01720377802848816, 0.01041798572987318, 0.047073230147361755, -0.04632115364074707, 0.08970236033201218, 0.02210083045065403, 0.027126077562570572, -0.02663038857281208, 0.02374172769486904, -0.05777324363589287, -0.004320173989981413, 0.030031831935048103, -0.071515753865242, -0.0026386817917227745, -0.043859805911779404, -0.08430107682943344, 0.06635376811027527, 0.016896110028028488, 0.08402759581804276, 0.015007369220256805, 0.0036685154773294926, -0.011477732099592686, 0.03804829716682434, -0.01703285239636898, -0.022374313324689865, -0.05206429213285446, 0.02892080694437027, 0.019639484584331512, -0.00250621372833848, 0.013870706781744957, 0.041877057403326035, -0.008345498703420162, -0.0003490645030979067, 0.023775912821292877, -0.0626959353685379, 0.007127645891159773, -0.02603214606642723, 0.04567163065075874, 0.013563038781285286, -0.073430135846138, 0.04474862664937973, 0.03859526291489601, 0.017964402213692665, 0.02010098658502102, 0.05924321338534355, 0.012229809537529945, -0.02510914020240307, 0.017725104466080666, -0.06006366387009621, -0.051107101142406464, -0.029313938692212105, 0.047620195895433426, -0.056850239634513855, 0.03211713954806328, -0.033364903181791306, -0.01035816129297018, -0.008200211450457573, -0.0006532607367262244, 0.011905048973858356, 0.013545945286750793, 0.011913594789803028, -0.04334702715277672, 0.07828445732593536, -0.01745162159204483, -0.020733416080474854, -0.029792534187436104, -0.03996267542243004, 0.016212403774261475, 0.03044205531477928, -0.024835659191012383, 0.04050964117050171, -0.006815704517066479, -0.008174572139978409, 0.04180868715047836, 0.03944989666342735, 0.02281872183084488, 0.017067037522792816, -0.004533832427114248, -0.015554334968328476, 0.01763964258134365, 0.004538105335086584, -0.06597772985696793, -0.004674846772104502, -0.007490865420550108, -0.06177293136715889, 0.02493821457028389, 0.02362207882106304, -0.019878782331943512, 0.059140659868717194, -0.011802492663264275, 0.042184725403785706, 0.042287278920412064, 0.030288221314549446, 0.0019154479959979653, 0.07090041786432266, 0.013075897470116615, 0.012691311538219452, 0.0062345536425709724, -0.035757876932621, 0.024186136201024055, 0.019280537962913513, 0.0027626038063317537, 0.004365042317658663, 0.01643460802733898, -0.04515885189175606, -0.0020190724171698093, -0.010631644167006016, 0.013879252597689629, 0.019656578078866005, 0.00999066885560751, -0.016161125153303146, -0.0286131389439106, -0.03586043417453766, -0.04926109313964844, -0.03321107104420662, -0.030476240441203117, -0.022323034703731537, 0.019724948331713676, 0.04826971888542175, 0.03235643729567528, -0.1292206346988678, -0.006089265923947096, 0.007653245702385902, 0.018819035962224007, 0.12552861869335175, 0.0014069408643990755, 0.02384428307414055, -0.017289241775870323, 0.029484866186976433, 0.032510269433259964, -0.01751999370753765, -0.013298101723194122, -0.04071475565433502, 0.048338089138269424, 0.022117922082543373, 0.03811666741967201, 0.030595889315009117, 0.025314252823591232, 0.025827033445239067, 0.050628505647182465, 0.05343170464038849, -0.035894621163606644, -0.027980711311101913, 0.041569389402866364, -0.04160357266664505, 0.013272463344037533, -0.07418221235275269, 0.022442683577537537, 0.07363525032997131, -0.02210083045065403, 0.011033322662115097, 0.007055001799017191, -0.014776618219912052, -0.018340440467000008, 0.023382781073451042, -0.04225309565663338, 0.0538761131465435, 0.0061747292056679726, -0.005721773486584425, -0.03485196456313133, -0.04618440940976143, 0.04201379790902138, 0.03797992691397667, 0.020818879827857018, -0.07090041786432266, -0.006337109487503767, 0.02391265332698822, -0.04027034342288971, 0.04461188614368439, 0.08218158781528473, 0.01077693235129118, -0.033125605434179306, -0.014024540781974792, -0.003008310915902257, 0.04775693640112877, 0.023827189579606056, -0.06608028709888458, -0.039825934916734695, 0.027006428688764572, -0.0533975213766098, -0.040133602917194366, -0.014417672529816628, 0.055277712643146515, 0.029194289818406105, 0.008127567358314991, 0.028049081563949585, 0.014836442656815052, -0.09175348281860352, -0.059448327869176865, 0.00732421176508069, -0.01738325133919716, -0.017058489844202995, -0.03399733081459999, -0.00848224014043808, -0.03835596516728401, -0.014033086597919464, 0.07493428885936737, -0.040543828159570694, -0.010469264350831509, 0.02198118157684803, -0.0548333041369915, -0.032458990812301636, -0.0054952953942120075, 0.0009571898845024407, -0.015862002968788147, -0.05917484313249588, -0.035997174680233, 0.018340440467000008, 0.008948015980422497, -0.0004994266200810671, -0.036715067923069, 0.0034228083677589893, 0.05144895613193512, -0.002531852573156357, 0.006243099924176931, -0.018682295456528664, 0.0014689018717035651, -0.07760074734687805, 0.0014817214105278254, 0.06430264562368393, 0.01921216771006584, -0.01470824796706438, -0.0011772580910474062, 0.017186686396598816, -0.008430962450802326, -0.02644236944615841, 0.00872153788805008, -0.02119491808116436, 0.006973811890929937, 0.11650367826223373, -0.04126172140240669, 0.0007996167405508459, 0.0009694751934148371, 0.006268738768994808, -0.03931315615773201, 0.021827347576618195, 0.05825183913111687, -0.022921279072761536, -0.030749723315238953, -0.023570800200104713, 0.07595985382795334, 0.0179985873401165, 0.013930531218647957, 0.01017014216631651, -0.060542259365320206, 0.007631879765540361, 0.009503527544438839, -0.0469706729054451, -0.018374627456068993, 0.011486277915537357, -0.049124352633953094, -0.003991140052676201, 0.029484866186976433, -0.024066487327218056, 0.04146683216094971, 0.011170064099133015, 0.0004462790966499597, 0.02457926794886589, 0.00002842658977897372, 0.050149910151958466, 0.08888191729784012, -0.016460247337818146, 0.07144738733768463, -0.020425748080015182, -0.025314252823591232, 0.073430135846138, -0.03616810217499733, -0.013503214344382286, 0.07356687635183334, -0.030151480808854103, 0.011725575663149357, -0.08936051279306412, -0.024596361443400383, 0.007627606857568026, -0.014272384345531464, 0.06259337812662125, 0.008695898577570915, -0.036509957164525986, 0.06878092885017395, -0.05814928561449051, 0.000671955815050751, 0.01479371078312397, -0.004089422523975372, -0.048953425139188766, -0.0062046414241194725, -0.012050336226820946, -0.021998273208737373, 0.016015836969017982, -0.03129668906331062, 0.003499725367873907, -0.03208295255899429, -0.04632115364074707, 0.037227846682071686, 0.0065635875798761845, -0.03362129256129265, 0.007619060110300779, -0.057089537382125854, 0.06255919486284256, -0.062046412378549576, -0.01593892090022564, 0.0044569154269993305, 0.014477496966719627, 0.037467144429683685, 0.049192722886800766, 0.004251803271472454, -0.06922534108161926, 0.00851642619818449, 0.01708412915468216, -0.025553550571203232, 0.04932946339249611, 0.012631488032639027, -0.03736459091305733, 0.023263132199645042, 0.028049081563949585, 0.01878485083580017, -0.0006553973071277142, -0.003439901163801551, 0.019605299457907677, 0.006379841361194849, -0.00811902154237032, -0.05254288762807846, -0.06273011863231659, -0.03273247554898262, 0.07602822035551071, -0.011981965973973274, -0.07397710531949997, 0.008644620887935162, 0.04044127091765404, 0.023331502452492714, 0.001327887293882668, 0.04591092839837074, 0.017656734213232994, 0.03965500742197037, -0.019297631457448006, -0.011828131973743439, -0.004264622461050749, 0.022305943071842194, 0.05749976262450218, -0.037774812430143356, -0.030630076304078102, 0.017058489844202995, -0.012571663595736027, -0.043620508164167404, -0.01998133771121502, -0.04946620389819145, -0.002015867503359914, 0.05206429213285446, -0.02143421582877636, -0.009973576292395592, 0.025587735697627068, -0.03917641192674637, -0.00628155842423439, 0.033535830676555634, -0.00008259234164142981, 0.014349301345646381, 0.001858828472904861, 0.014212559908628464, -0.009777010418474674, -0.021639328449964523, 0.004153520334511995, -0.040543828159570694, -0.016742276027798653, -0.0007584874983876944, -0.015802178531885147, -0.00781989935785532, 0.020306099206209183, -0.04587674140930176, 0.014921906404197216, 0.0016825603088364005, 0.020699230954051018, 0.08149787783622742, 0.015349223278462887, 0.03204876929521561, 0.011101692914962769, 0.018853221088647842, 0.036920178681612015, -0.0014037360670045018, 0.01763964258134365, 0.026955150067806244, -0.09913752228021622, 0.028647325932979584, -0.028903715312480927, -0.010375254787504673, 0.04444095864892006, -0.027143169194459915, -0.0027561939787119627, -0.018084051087498665, -0.04256076365709305, 0.027758505195379257, 0.04280006140470505, -0.06402916461229324, 0.014144189655780792, 0.02517751231789589, -0.023587893694639206, -0.01677646115422249, -0.04734671115875244, 0.0636531263589859, 0.002969852415844798, -0.06707166135311127, -0.004151383880525827, 0.0030724084936082363, 0.010289791040122509, -0.03430500254034996, 0.04437258839607239, -0.045022107660770416, -0.0543547086417675, -0.030544612556695938, 0.03218550980091095, -0.026544926688075066, -0.0036685154773294926, 0.016280774027109146, -0.07527614384889603, -0.03430500254034996, -0.0008738630567677319, -0.005038066301494837, 0.073430135846138, 0.02724572643637657, -0.02524588257074356, -0.006273012142628431, 0.03423662856221199, 0.011306805536150932, 0.018254978582262993, -0.038800373673439026, -0.013101535849273205, -0.01762254908680916, 0.004469734616577625, 0.02138293720781803, -0.03459557518362999, -0.027946526184678078, -0.03681762516498566, -0.04403073340654373, 0.020989805459976196, -0.00839250348508358, -0.0075934212654829025, -0.03948407992720604, -0.030715538188815117, -0.007845538668334484, 0.03302305191755295, 0.012751135975122452, -0.04546651989221573, 0.0350399874150753, -0.021946996450424194, 0.04276587441563606, -0.025707384571433067, 0.02951905131340027, 0.02088725008070469, -0.018084051087498665, 0.027707228437066078, -0.003732613055035472, -0.015836363658308983, 0.004305217880755663, -0.038185037672519684, -0.03521091118454933, 0.032510269433259964, -0.004008232615888119, -0.04926109313964844, -0.006640504579991102, -0.03218550980091095, 0.021964088082313538, 0.03678343817591667, -0.0018193017458543181, -0.02343405969440937, 0.039586637169122696, 0.0572262778878212, -0.033963147550821304, -0.04861157014966011, 0.0036321936640888453, 0.016400422900915146, -0.027826877310872078, 0.036202289164066315, 0.014503135345876217, 0.011135878041386604, -0.033005956560373306, 0.011802492663264275, 0.02724572643637657, 0.031177040189504623, -0.03030531480908394, 0.04844064265489578, 0.04208216816186905, -0.008037830702960491, -0.05876462161540985, -0.03568950667977333, 0.08676242083311081, -0.0017049944726750255, 0.03630484268069267, -0.00686698267236352, 0.017306335270404816, -0.007102007046341896, -0.028886621817946434, 0.009802649728953838, -0.029501959681510925, 0.09496691077947617, -0.01981041207909584, 0.018972869962453842, 0.006602046079933643, -0.033911868929862976, 0.050936173647642136, 0.05832020938396454, -0.031382154673337936, 0.01570816896855831, -0.005773051176220179, -0.06594354659318924, -0.045193035155534744, 0.056200720369815826, 0.07308828085660934, 0.04710741341114044, -0.03440755605697632, 0.026066331192851067, -0.0029890816658735275, 0.001597096910700202, -0.03358710929751396, 0.010076132602989674, -0.01945146545767784, -0.04741508513689041, -0.0474492684006691, -0.03362129256129265, 0.039347339421510696, -0.022870000451803207, -0.016015836969017982, -0.0012851555366069078, -0.02796361781656742, -0.028784066438674927, 0.01225544884800911, -0.01840881258249283, 0.012699858285486698, 0.03709110617637634, 0.05910647287964821, -0.03292049467563629, -0.05879880487918854, -0.008759996853768826, -0.01666535995900631, 0.01666535995900631, -0.014862081967294216, -0.048167161643505096, -0.02705770544707775, -0.005409832112491131, 0.003356574336066842, 0.001866306527517736, -0.03220260143280029, 0.02004970982670784, -0.014588599093258381, 0.010366708040237427, -0.008067742921411991, -0.04994479939341545, 0.0007542143575847149, 0.009700093418359756, -0.0626959353685379, 0.06091829761862755, -0.0018534871051087976, 0.004232573788613081, 0.03182656317949295, -0.045740000903606415, 0.039518266916275024, 0.005636309739202261, -0.031125763431191444, 0.0023972478229552507, 0.04177450016140938, -0.02343405969440937, -0.008627528324723244, -0.00007017344614723697, 0.03538183867931366, 0.001813960261642933, -0.017007213085889816, -0.010264151729643345, -0.013759604655206203, -0.03931315615773201, 0.04444095864892006, 0.04980805888772011, 0.017964402213692665, -0.06420008838176727, 0.04232146590948105, -0.016408968716859818, 0.022511053830385208, -0.06567005813121796, -0.04909016564488411, 0.00767033826559782, -0.07698541134595871, -0.003409988945350051, -0.031194133684039116, 0.061431076377630234, -0.038971301168203354, 0.04016778990626335, -0.06710584461688995, -0.013212638907134533, -0.01659698784351349, -0.039039671421051025, 0.042902618646621704, 0.013691233471035957, 0.021639328449964523, 0.01256311684846878, -0.0035702327731996775, -0.012144346721470356, 0.002790379337966442, -0.03196330368518829, -0.07110553234815598, -0.04201379790902138, 0.012477653101086617, 0.014015994034707546, -0.04898760840296745, -0.03811666741967201, 0.04727834090590477, 0.025758663192391396, 0.019177982583642006, -0.026835501194000244, -0.018562646582722664, -0.01623804308474064, 0.054559823125600815, 0.01434075552970171, -0.05035502463579178, -0.04556907340884209, 0.014699701219797134, 0.024134859442710876, 0.06857581436634064, 0.042355652898550034, 0.012657126411795616, 0.008503606542944908, -0.08361737430095673, -0.06296941637992859, 0.007824172265827656, -0.020186450332403183, 0.0450562946498394, -0.05185917764902115, -0.015477417968213558, 0.06303779035806656, 0.01763964258134365, -0.01648588664829731, -0.04703904315829277, 0.02927975356578827, 0.023040927946567535, -0.03495452180504799, 0.029929276555776596, -0.02360498532652855, 0.03495452180504799, 0.018921593204140663, 0.031125763431191444, -0.019058333709836006, 0.018801944330334663, -0.006443938706070185, 0.0007360533345490694, -0.04406492039561272, -0.0016099164495244622, 0.032886307686567307, 0.0004962217644788325, 0.008097655139863491, 0.010306883603334427, -0.06997741758823395, -0.02675003744661808, 0.017041398212313652, -0.03249317780137062, 0.01337501872330904, -0.025741569697856903, -0.09366786479949951, 0.03115994855761528, -0.05941414088010788, 0.024117765948176384, -0.006666143424808979, -0.005973890423774719, 0.02796361781656742, -0.037432961165905, 0.005371373612433672, 0.07561799883842468, 0.0030937744304537773, -0.05616653338074684, -0.04618440940976143, 0.08156625181436539, 0.029741255566477776, 0.01840881258249283, -0.031604357063770294, -0.030578797683119774, 0.011101692914962769, 0.01950274407863617, 0.012358005158603191, 0.04994479939341545, -0.005251724738627672, -0.025382623076438904, -0.0036685154773294926, -0.009947936981916428, 0.02384428307414055, -0.031843654811382294, 0.02317766845226288, -0.005183354020118713, -0.04153520241379738, -0.0044569154269993305, -0.025092048570513725, -0.014392033219337463, 0.08334388583898544, -0.009469342418015003, 0.0023310137912631035, 0.006102085113525391, 0.027929432690143585, -0.036475770175457, -0.032390620559453964, 0.017297787591814995, 0.017434529960155487, 0.004264622461050749, 0.007901089265942574, 0.02989508956670761, 0.010742747224867344, 0.008106201887130737, 0.005290183238685131, 0.0002999230637215078, 0.005576485767960548, 0.04775693640112877, 0.03013438731431961, -0.011093147099018097, 0.005435470957309008, 0.012281088158488274, 0.01750290021300316, -0.052508700639009476, -0.05801254138350487, -0.05832020938396454, 0.018220793455839157, -0.004845773801207542, 0.04444095864892006, 0.07855793833732605, 0.03538183867931366, -0.007922455668449402 ]
717,147
pytorch_optimizer.loss.lovasz
forward
null
def forward(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor: if not self.per_image: return lovasz_hinge_flat(y_pred, y_true) return sum(lovasz_hinge_flat(y_p, y_t) for y_p, y_t in zip(y_pred, y_true)) / y_pred.size()[0]
(self, y_pred: torch.Tensor, y_true: torch.Tensor) -> torch.Tensor
[ -0.020911047235131264, -0.08737446367740631, 0.011719871312379837, 0.020677905529737473, 0.025412481278181076, -0.006886657327413559, -0.03491750359535217, -0.006057209335267544, 0.004389347042888403, 0.060150645673274994, 0.033805593848228455, -0.06474175304174423, 0.016597919166088104, -0.012033715844154358, 0.00935258250683546, 0.045516498386859894, 0.013916785828769207, -0.003940997179597616, 0.023565279319882393, -0.022578909993171692, 0.012706240639090538, -0.04185796156525612, -0.019010042771697044, 0.0077788736671209335, -0.021736010909080505, -0.04964131861925125, -0.031545910984277725, -0.034630559384822845, -0.011092180386185646, 0.01716284081339836, -0.04989239573478699, -0.009953371249139309, 0.013020086102187634, -0.021825682371854782, 0.04544476419687271, -0.011361191049218178, -0.012733141891658306, 0.00866212323307991, -0.035455524921417236, -0.021574605256319046, -0.014652079902589321, -0.06746771931648254, 0.011065280064940453, 0.05197273939847946, -0.021467002108693123, 0.034002870321273804, -0.08292683213949203, -0.02073170803487301, 0.056348636746406555, 0.005954089108854532, -0.031510043889284134, -0.06603299826383591, -0.008451398462057114, 0.016786227002739906, 0.009397417306900024, 0.07062410563230515, 0.0458751805126667, -0.013172524981200695, -0.05068149045109749, -0.051362983882427216, 0.024354375898838043, -0.04609038680791855, 0.04433285444974899, 0.01736011542379856, 0.02864060178399086, 0.007590566761791706, -0.04038737341761589, 0.06000717356801033, 0.003205703105777502, -0.004057568032294512, -0.0446915365755558, 0.010670731775462627, 0.0284791961312294, 0.06144189462065697, -0.028550932183861732, 0.00020441961532924324, 0.015952294692397118, -0.021628407761454582, 0.04422524943947792, -0.04239598289132118, -0.00506187230348587, -0.0050215208902955055, -0.02483859471976757, -0.0061648134142160416, -0.015477044507861137, -0.05269009992480278, 0.023152798414230347, -0.012984218075871468, 0.002638540230691433, 0.03333931043744087, -0.03572453185915947, 0.04996413365006447, 0.015557747334241867, 0.02516140602529049, 0.06768292933702469, 0.06391678750514984, -0.04662840813398361, -0.012015782296657562, 0.05767575278878212, -0.0010732379741966724, 0.0466642752289772, 0.1123385950922966, 0.011836442165076733, 0.024677187204360962, 0.05215207859873772, 0.023188665509223938, -0.0029658356215804815, 0.002141992561519146, -0.020677905529737473, -0.03251434862613678, 0.01200681459158659, -0.04142754524946213, -0.0423242449760437, -0.013531205244362354, -0.009522955864667892, -0.0633070319890976, -0.010634863749146461, 0.03373385965824127, -0.018687231466174126, 0.07148493826389313, 0.01899210922420025, -0.05032281205058098, -0.019924677908420563, -0.04802725836634636, -0.013737446628510952, -0.004176381044089794, 0.06728837639093399, -0.018050573766231537, -0.010572094470262527, -0.025842897593975067, -0.03762553632259369, 0.04831420257687569, -0.03473816439509392, 0.023726684972643852, -0.03715925291180611, -0.025179339572787285, 0.04024390131235123, -0.009639526717364788, 0.06452654302120209, -0.010321018286049366, 0.027152080088853836, 0.010428622364997864, 0.041355811059474945, 0.057496413588523865, 0.0018326309509575367, -0.0032662302255630493, 0.06029411777853966, 0.06592539697885513, 0.10380201041698456, 0.02293759025633335, 0.04766857996582985, -0.001692521502263844, 0.038271162658929825, -0.01432030089199543, -0.016517216339707375, -0.004277259577065706, -0.018812768161296844, -0.014203730039298534, -0.010885939933359623, -0.031043758615851402, -0.027779771015048027, -0.051327116787433624, -0.04279053211212158, -0.028263987973332405, -0.016857963055372238, -0.04802725836634636, 0.03181492164731026, 0.08644189685583115, 0.03054160624742508, 0.05652797594666481, 0.05505738779902458, -0.09899569302797318, -0.009061154909431934, 0.05652797594666481, 0.003613701555877924, 0.04275466129183769, 0.008886298164725304, -0.01807747408747673, -0.028228120878338814, 0.0522238165140152, 0.03396700322628021, -0.019601864740252495, -0.02756456285715103, -0.10731707513332367, -0.004770444706082344, -0.007976147346198559, 0.027277618646621704, 0.031312767416238785, 0.002342629013583064, 0.05581061542034149, -0.05003586784005165, -0.05889526382088661, 0.017234576866030693, -0.014383070170879364, 0.020068150013685226, -0.004445390775799751, 0.009011836722493172, 0.03999282792210579, 0.020695839077234268, -0.052080344408750534, -0.09110473096370697, -0.02073170803487301, -0.0027371773030608892, -0.024318508803844452, -0.05236728861927986, 0.005989957135170698, -0.04888809099793434, 0.08651363104581833, -0.02507173642516136, -0.05423242598772049, -0.04124820604920387, 0.0022013988345861435, -0.029537303373217583, 0.02607603929936886, 0.05925394594669342, 0.02804877981543541, -0.03776900842785835, -0.0023157282266765833, -0.05315638333559036, -0.01040172204375267, -0.025340745225548744, -0.045982781797647476, -0.0913916751742363, 0.013513270765542984, 0.025143472477793694, -0.008854913525283337, 0.023439742624759674, 0.005505738779902458, 0.018364418298006058, -0.0046538738533854485, -0.012428264133632183, 0.04002869501709938, -0.00823170691728592, -0.014759683981537819, 0.07241750508546829, 0.018938306719064713, -0.024031564593315125, -0.02302725985646248, -0.03133070468902588, 0.04257532209157944, -0.013324963860213757, -0.04257532209157944, -0.002860473468899727, -0.021180057898163795, 0.0046359398402273655, -0.011388091370463371, 0.000792458769865334, 0.05007173493504524, 0.005568508058786392, 0.06334289908409119, -0.02128766104578972, -0.025538019835948944, -0.03809182345867157, -0.02483859471976757, -0.008352762088179588, -0.06470588594675064, 0.04734576866030693, -0.05003586784005165, 0.03185078874230385, 0.016822094097733498, 0.004631456453353167, -0.023834289982914925, -0.006640064530074596, 0.013208393007516861, -0.10258249938488007, 0.017270443961024284, 0.001892037340439856, 0.0004065974790137261, 0.011522596701979637, 0.044045910239219666, 0.06459827721118927, -0.02326040156185627, -0.030451936647295952, -0.0383787676692009, 0.00848726648837328, 0.04236011579632759, 0.04411764815449715, 0.0057971663773059845, 0.011083213612437248, 0.02017575316131115, 0.03952654078602791, -0.11420372873544693, -0.037553802132606506, -0.04770444706082344, 0.0014089400647208095, 0.0263091828674078, -0.00098917237482965, -0.03057747520506382, 0.05993543937802315, -0.02282998524606228, 0.026883069425821304, 0.06083213910460472, 0.0038221844006329775, 0.010473458096385002, 0.014956958591938019, -0.02437230944633484, -0.03355452045798302, 0.0024838594254106283, 0.033124104142189026, 0.008110652677714825, 0.02638091892004013, -0.0010625896975398064, -0.0144368726760149, -0.03888091817498207, -0.03532998636364937, -0.020785508677363396, 0.05304878205060959, 0.025376614183187485, -0.034630559384822845, -0.03552725911140442, 0.021628407761454582, 0.028012912720441818, -0.052833572030067444, -0.017656026408076286, -0.021646341308951378, -0.04426112025976181, 0.051685795187950134, 0.04045911133289337, 0.020229555666446686, 0.057890962809324265, 0.03280129283666611, 0.015755021944642067, 0.00036232289858162403, 0.029967719689011574, 0.024336442351341248, -0.007303622551262379, 0.04027977213263512, -0.000002832836798916105, -0.021807746961712837, -0.003024121280759573, 0.019727403298020363, -0.03513270989060402, -0.019996413961052895, -0.0003791360359173268, -0.06807747483253479, -0.019691534340381622, 0.01117288414388895, 0.05451937019824982, -0.01752152107656002, 0.00472560990601778, -0.04537302628159523, -0.026416786015033722, -0.03143830597400665, 0.026721663773059845, 0.01792503520846367, -0.011486728675663471, -0.013082855381071568, -0.010410688817501068, 0.061657100915908813, 0.06345050036907196, -0.024748923256993294, 0.01633787713944912, 0.07747489213943481, 0.04809899628162384, 0.024677187204360962, -0.002896341495215893, -0.06599713116884232, 0.012392396107316017, 0.012213055975735188, -0.01733321323990822, -0.012392396107316017, -0.02428263984620571, -0.06983500719070435, 0.04931850731372833, -0.038773313164711, 0.029519367963075638, -0.004999103490263224, -0.006258966866880655, -0.02860473468899727, 0.03454088792204857, -0.04630559682846069, -0.024659253656864166, -0.04616212472319603, 0.007644368801265955, 0.01732424646615982, -0.007312589790672064, -0.014885222539305687, 0.011468795128166676, 0.030254662036895752, 0.056025825440883636, 0.005989957135170698, 0.060903873294591904, -0.057137731462717056, -0.011863342486321926, 0.0263091828674078, 0.03540172055363655, -0.007128766272217035, -0.04616212472319603, 0.020785508677363396, -0.06083213910460472, 0.030434003099799156, -0.05068149045109749, 0.005236729048192501, -0.06958393007516861, -0.0360114760696888, -0.027833571657538414, -0.0017664992483332753, 0.09340028464794159, -0.04088952764868736, 0.017467718571424484, 0.011038378812372684, -0.00686423946171999, 0.00987266842275858, -0.0007055909372866154, -0.056348636746406555, -0.013916785828769207, 0.0017440817318856716, 0.09748923778533936, -0.035814203321933746, 0.06675035506486893, -0.020462697371840477, 0.03472023084759712, -0.04189383238554001, -0.009603658691048622, -0.03586800396442413, 0.0009555461001582444, -0.029160689562559128, 0.031241033226251602, -0.028622668236494064, 0.04318507760763168, 0.05297704413533211, 0.014858321286737919, 0.015988163650035858, -0.017118005082011223, -0.0711979940533638, 0.004257083870470524, -0.08192252367734909, 0.006514526437968016, -0.004138271324336529, -0.0077833570539951324, -0.02808464877307415, -0.0672525092959404, 0.024928264319896698, -0.03235294297337532, -0.00022753766097594053, -0.000781810435000807, 0.02060616947710514, -0.015217001549899578, -0.003010670654475689, 0.0023246952332556248, 0.019637733697891235, -0.0030487803742289543, 0.055164992809295654, 0.06467001140117645, -0.018812768161296844, -0.008191355504095554, -0.023242468014359474, -0.02955523692071438, -0.03341104835271835, -0.007675753440707922, -0.021036585792899132, -0.0158267579972744, 0.012114418670535088, 0.04777618497610092, 0.00686423946171999, -0.015934361144900322, -0.06879483163356781, -0.04644906893372536, 0.001935751410201192, 0.028963414952158928, -0.01985294185578823, 0.03038020059466362, -0.030523672699928284, 0.042539454996585846, 0.04261118918657303, -0.057855091989040375, 0.005156025756150484, -0.017808465287089348, -0.0092001436278224, -0.0284791961312294, -0.006388988345861435, -0.03845050185918808, 0.028819942846894264, 0.017673959955573082, -0.010751434601843357, 0.0286764707416296, 0.0219512190669775, 0.02207675762474537, 0.06040172278881073, -0.017225610092282295, -0.03841463476419449, -0.020426828414201736, -0.01451757550239563, -0.03333931043744087, 0.01870516501367092, -0.02765423245728016, -0.0348098985850811, -0.00842449814081192, 0.041750360280275345, 0.014607245102524757, -0.015889527276158333, -0.002849264768883586, 0.037087518721818924, 0.017234576866030693, -0.07955523580312729, -0.03373385965824127, 0.019888808950781822, -0.00580613361671567, 0.038629841059446335, 0.02638091892004013, -0.008464849554002285, 0.00036232289858162403, -0.054770443588495255, -0.019404591992497444, -0.012984218075871468, 0.06072453409433365, 0.049354374408721924, -0.006640064530074596, -0.04888809099793434, 0.063271164894104, 0.02634504996240139, 0.007617467548698187, 0.0021263002417981625, 0.015154232271015644, 0.008872848004102707, -0.016920732334256172, 0.022560976445674896, 0.0672525092959404, 0.035939741879701614, -0.020624103024601936, -0.012069583870470524, -0.0092001436278224, -0.020677905529737473, -0.01641857996582985, 0.009603658691048622, 0.04225251078605652, 0.022794118151068687, -0.012544834986329079, 0.02053443342447281, 0.0019256635569036007, -0.027779771015048027, -0.0514347217977047, 0.005209827795624733, 0.0312589667737484, -0.06004304066300392, -0.0013338414719328284, -0.029913917183876038, -0.06545910984277725, -0.017781563103199005, -0.016068866476416588, -0.005658178124576807, -0.05304878205060959, -0.03185078874230385, 0.019279053434729576, 0.008316894061863422, 0.01981707289814949, -0.05462697148323059, 0.04006456211209297, -0.05746054649353027, -0.0026183645240962505, -0.07919655740261078, -0.018687231466174126, 0.011379124596714973, 0.04006456211209297, 0.08357245475053787, 0.08558106422424316, 0.025538019835948944, 0.04408177733421326, -0.01022238191217184, 0.06144189462065697, -0.02654232457280159, -0.04763271287083626, 0.043651364743709564, -0.04160688817501068, -0.00416293041780591, 0.009487087838351727, -0.024031564593315125, 0.06506456434726715, 0.014670014381408691, 0.02677546627819538, -0.018131276592612267, 0.05265423282980919, 0.01519010029733181, 0.005268113221973181, 0.021305594593286514, 0.01863342896103859, 0.05032281205058098, -0.07797704637050629, 0.017100071534514427, -0.03224533796310425, -0.013593974523246288, -0.09210903942584991, 0.04006456211209297, 0.042073171585798264, -0.04063845053315163, 0.0010452161077409983, -0.050932567566633224, 0.08758967369794846, -0.01625717431306839, 0.04806312918663025, -0.04723816365003586, -0.013889885507524014, -0.014526542276144028, 0.038665711879730225, 0.011639167554676533, -0.03845050185918808, 0.0006091956747695804, -0.01538737490773201, 0.06481348723173141, 0.032335005700588226, 0.06965566426515579, -0.0032012194860726595, -0.017100071534514427, -0.0045866211876273155, -0.004716642666608095, -0.01733321323990822, -0.030362267047166824, -0.0019166965503245592, -0.03346484899520874, -0.05807030200958252, 0.01590746082365513, 0.017700860276818275, 0.0391678623855114, -0.04142754524946213, -0.027116212993860245, 0.03461262583732605, 0.027510760352015495, 0.037517935037612915, 0.028819942846894264, 0.05075322836637497, 0.05563127622008324, -0.02345767617225647, 0.012706240639090538, 0.017781563103199005, 0.019476328045129776, -0.04964131861925125, 0.0593256801366806, -0.042467717081308365, 0.007908895611763, -0.003806492080911994, 0.000014965435184421949, 0.009666427969932556, -0.0020444763358682394, -0.00866212323307991, 0.01182747446000576, 0.0263091828674078, 0.020319225266575813, 0.03255021572113037, -0.04383070394396782, -0.0723816379904747, -0.05968436226248741, -0.0028044297359883785, -0.0006024704198352993, 0.004530577454715967, -0.02302725985646248, -0.01831061765551567, -0.015423242002725601, 0.012571736238896847, 0.007182568311691284, 0.019332855939865112, 0.014705882407724857, 0.03315997123718262, 0.012544834986329079, 0.06388092041015625, 0.0004917840124107897, 0.015772955492138863, -0.005075322929769754, 0.05584648624062538, 0.0066355811432003975, -0.03920372948050499, -0.039454806596040726, 0.015037661418318748, -0.011737804859876633, 0.034002870321273804, 0.02677546627819538, 0.018301649019122124, 0.03552725911140442, -0.08055954426527023, -0.03536585345864296, -0.022453371435403824, -0.032496411353349686, 0.03357245400547981, -0.06355810910463333, -0.0013237536186352372, 0.05925394594669342, -0.08522237837314606, 0.009155308827757835, 0.023744620382785797, 0.017064204439520836, -0.01918938383460045, 0.007586083374917507, 0.01733321323990822, 0.014634146355092525, 0.04738163575530052, 0.03192252665758133, -0.0074112266302108765, -0.01879483461380005, 0.002203640528023243, -0.026614060625433922, 0.0026654412504285574, -0.03694404661655426, -0.01676829345524311, 0.022525107488036156, -0.026452654972672462, 0.02044476382434368, -0.01899210922420025, -0.012670372612774372, 0.016624821349978447, -0.011011477559804916, -0.02369081787765026, -0.011988881044089794, 0.0030824067071080208, -0.038271162658929825, -0.056348636746406555, -0.03891678526997566, 0.07840745896100998, 0.001592763583175838, -0.028156384825706482, -0.028945481404662132, -0.04071018472313881, 0.0077654230408370495, -0.0028828908689320087, -0.0004688060435000807, -0.01997847855091095, -0.01942252553999424, 0.036101147532463074, -0.024461979046463966, 0.006545911077409983, 0.019763270393013954, 0.011190817691385746, 0.01783536560833454, 0.004106886684894562, -0.00022487557725980878, 0.028335724025964737, -0.09232424944639206, -0.04885222390294075, 0.05150645598769188, -0.05229555070400238, -0.031025825068354607, 0.033016499131917953, 0.0026228479109704494, 0.006241032853722572, 0.018651362508535385, 0.019835006445646286, 0.0017362356884405017, -0.013369799591600895, 0.012831779196858406, -0.02555595338344574, 0.07776183634996414, -0.005667144898325205, 0.0561692975461483, -0.011890243738889694, 0.02543041668832302, 0.01117288414388895, 0.06879483163356781, 0.010778335854411125, -0.005662661511451006, -0.006613163743168116, 0.0025107604451477528, -0.02677546627819538, 0.031241033226251602, 0.032137732952833176, -0.022560976445674896, -0.02745695784687996, 0.09053084999322891, 0.03432568162679672, 0.03624461963772774, -0.03330344334244728, -0.038271162658929825, -0.026040172204375267, -0.03873744606971741, -0.044045910239219666, -0.0035576578229665756, 0.025484217330813408, 0.0058285510167479515, 0.03543759137392044, 0.02227403223514557, 0.047489240765571594 ]
717,181
pytorch_optimizer.optimizer.madgrad
MADGRAD
A Momentumized, Adaptive, Dual Averaged Gradient Method for Stochastic (slightly modified). :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param lr: float. learning rate. :param eps: float. term added to the denominator to improve numerical stability. :param weight_decay: float. weight decay (L2 penalty). MADGRAD optimizer requires less weight decay than other methods, often as little as zero. On sparse problems both weight_decay and momentum should be set to 0. :param weight_decouple: float. Apply AdamW style decoupled weight decay.
class MADGRAD(Optimizer, BaseOptimizer): r"""A Momentumized, Adaptive, Dual Averaged Gradient Method for Stochastic (slightly modified). :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param lr: float. learning rate. :param eps: float. term added to the denominator to improve numerical stability. :param weight_decay: float. weight decay (L2 penalty). MADGRAD optimizer requires less weight decay than other methods, often as little as zero. On sparse problems both weight_decay and momentum should be set to 0. :param weight_decouple: float. Apply AdamW style decoupled weight decay. """ def __init__( self, params: PARAMETERS, lr: float = 1e-3, momentum: float = 0.9, weight_decay: float = 0.0, weight_decouple: bool = False, eps: float = 1e-6, ): self.validate_learning_rate(lr) self.validate_non_negative(weight_decay, 'weight_decay') self.validate_range(momentum, 'momentum', 0.0, 1.0) self.validate_non_negative(eps, 'eps') defaults: DEFAULTS = { 'lr': lr, 'weight_decay': weight_decay, 'weight_decouple': weight_decouple, 'momentum': momentum, 'eps': eps, } super().__init__(params, defaults) def __str__(self) -> str: return 'MADGRAD' @torch.no_grad() def reset(self): self.state['k'] = torch.tensor([0], dtype=torch.long, requires_grad=False) for group in self.param_groups: for p in group['params']: state = self.state[p] state['grad_sum_sq'] = torch.zeros_like(p) state['s'] = torch.zeros_like(p) if group['momentum'] > 0.0: state['x0'] = torch.clone(p).detach() @torch.no_grad() def step(self, closure: CLOSURE = None) -> LOSS: loss: LOSS = None if closure is not None: with torch.enable_grad(): loss = closure() # step counter must be stored in state to ensure correct behavior under optimizer sharding if 'k' not in self.state: self.state['k'] = torch.tensor([0], dtype=torch.long, requires_grad=False) for group in self.param_groups: weight_decay, momentum, eps = group['weight_decay'], group['momentum'], group['eps'] lr = group['lr'] + eps _lambda = lr * math.pow(self.state['k'] + 1, 0.5) for p in group['params']: if p.grad is None: continue grad = p.grad state = self.state[p] if 'grad_sum_sq' not in state: state['grad_sum_sq'] = torch.zeros_like(p) state['s'] = torch.zeros_like(p) if momentum > 0.0: state['x0'] = torch.clone(p).detach() if momentum > 0.0 and grad.is_sparse: raise NoSparseGradientError(str(self), note='momentum > 0.0') grad_sum_sq, s = state['grad_sum_sq'], state['s'] if weight_decay > 0.0 and not group['weight_decouple']: if grad.is_sparse: raise NoSparseGradientError(str(self), note='weight_decay') # original implementation. not AdamW style grad.add_(p, alpha=weight_decay) if grad.is_sparse: grad = grad.coalesce() p_masked = p.sparse_mask(grad) grad_sum_sq_masked = grad_sum_sq.sparse_mask(grad) s_masked = s.sparse_mask(grad) rms_masked_values = grad_sum_sq_masked._values().pow(1 / 3).add_(eps) x0_masked_values = p_masked._values().addcdiv(s_masked._values(), rms_masked_values, value=1) grad_sq = grad * grad grad_sum_sq.add_(grad_sq, alpha=_lambda) grad_sum_sq_masked.add_(grad_sq, alpha=_lambda) rms_masked_values = grad_sum_sq_masked._values().pow_(1 / 3).add_(eps) if eps == 0.0: rms_masked_values[rms_masked_values == 0] = float('inf') s.add_(grad, alpha=_lambda) s_masked._values().add_(grad._values(), alpha=_lambda) # update masked copy of p p_kp1_masked_values = x0_masked_values.addcdiv(s_masked._values(), rms_masked_values, value=-1) # Copy updated masked p to dense p using an add operation p_masked._values().add_(p_kp1_masked_values, alpha=-1) p.data.add_(p_masked, alpha=-1) else: if momentum == 0.0: # Compute x_0 from other known quantities rms = grad_sum_sq.pow(1 / 3).add_(eps) x0 = p.addcdiv(s, rms, value=1) else: x0 = state['x0'] # Accumulate second moments grad_sum_sq.addcmul_(grad, grad, value=_lambda) rms = grad_sum_sq.pow(1 / 3).add_(eps) if eps == 0.0: rms[rms == 0] = float('inf') s.add_(grad, alpha=_lambda) if weight_decay > 0.0 and group['weight_decouple']: p_old = p.clone() if momentum == 0.0: p.copy_(x0.addcdiv(s, rms, value=-1)) else: z = x0.addcdiv(s, rms, value=-1) p.mul_(momentum).add_(z, alpha=1.0 - momentum) if weight_decay > 0.0 and group['weight_decouple']: p.add_(p_old, alpha=-lr * weight_decay) self.state['k'] += 1 return loss
(params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], lr: float = 0.001, momentum: float = 0.9, weight_decay: float = 0.0, weight_decouple: bool = False, eps: float = 1e-06)
[ -0.006408666726201773, -0.036192502826452255, 0.009529408998787403, 0.03929297998547554, 0.021885722875595093, 0.005800730083137751, -0.05094509944319725, -0.03809737041592598, 0.0270734503865242, 0.001529974164441228, -0.05070192366838455, 0.028775673359632492, 0.052363619208335876, 0.07558680325746536, -0.03615197166800499, 0.08543537557125092, 0.004339148756116629, 0.03207879513502121, -0.0077207968570292, -0.012178999371826649, -0.039313241839408875, -0.10553782433271408, 0.014813392423093319, 0.07886966317892075, -0.05207991600036621, -0.04186657816171646, 0.010497041046619415, -0.01874471642076969, -0.055119600147008896, -0.02350688725709915, -0.007021669764071703, -0.058686163276433945, -0.008267940022051334, 0.014276381582021713, 0.03376075625419617, -0.018815642222762108, 0.0135671216994524, 0.0062414840795099735, -0.05815928429365158, -0.0483512356877327, 0.05017504841089249, -0.024520115926861763, 0.005734870210289955, -0.02480381913483143, 0.026972128078341484, 0.03406472131609917, -0.017245139926671982, 0.07988288998603821, 0.0006155359442345798, -0.0016452288255095482, 0.026992391794919968, -0.04397409036755562, 0.005385306663811207, -0.01601913385093212, -0.0239324439316988, 0.03611144423484802, 0.07125018537044525, -0.003627355908975005, 0.03345678746700287, -0.07068277895450592, 0.05678129196166992, -0.04417673870921135, 0.022351808845996857, -0.005729803815484047, -0.032625939697027206, -0.030295515432953835, -0.03823922201991081, -0.043204039335250854, 0.034936100244522095, 0.019210802391171455, 0.027904296293854713, -0.038644514977931976, 0.01866365782916546, 0.00022908450046088547, -0.012381644919514656, -0.03911059722304344, -0.010152543894946575, -0.06950743496417999, -0.04014408960938454, -0.05062086880207062, 0.010314660146832466, 0.008739090524613857, -0.039941444993019104, -0.022007310763001442, 0.008247675374150276, -0.034692924469709396, 0.004090907983481884, 0.019413447007536888, -0.015522652305662632, -0.06010467931628227, 0.03686123341321945, 0.008551644161343575, 0.035179272294044495, 0.04575737193226814, 0.06192849203944206, 0.01450942363590002, -0.0337810181081295, -0.049283407628536224, -0.0025989296846091747, -0.016394028440117836, -0.0006402333965525031, 0.04166393354535103, -0.0007383898482657969, 0.048148591071367264, 0.028917524963617325, -0.033112287521362305, -0.038320280611515045, -0.02488487772643566, 0.02731662429869175, -0.07299294322729111, -0.038441866636276245, 0.0014337175525724888, -0.01877511292695999, -0.025594137609004974, -0.025209110230207443, 0.00520292529836297, 0.0069811404682695866, 0.022027574479579926, -0.011956089176237583, 0.054227959364652634, 0.04960763826966286, 0.03765155002474785, -0.04636530950665474, 0.005846325308084488, 0.00800956692546606, -0.00853644497692585, 0.0483512356877327, 0.010507173836231232, 0.048918645828962326, -0.03509821370244026, -0.049972400069236755, 0.03282858431339264, 0.012888259254395962, 0.009048125706613064, 0.005349843297153711, -0.02174387127161026, -0.026364190503954887, 0.020892759785056114, -0.032565146684646606, 0.017893604934215546, 0.051917798817157745, 0.030437367036938667, -0.021541226655244827, 0.01866365782916546, 0.02425667643547058, 0.0028294390067458153, 0.02745847776532173, 0.03874583542346954, -0.011074581183493137, 0.00739656388759613, 0.0031536719761788845, 0.002374752890318632, 0.028674351051449776, 0.00963073130697012, 0.019160140305757523, -0.003158738138154149, -0.0005154797108843923, 0.02405403181910515, -0.04879705607891083, 0.002636925783008337, -0.028552763164043427, -0.05483589693903923, -0.014144661836326122, -0.0051294662989676, -0.018288763239979744, -0.0009853641968220472, 0.01662706956267357, 0.00471657607704401, -0.03815816342830658, 0.01803545653820038, 0.00989923719316721, -0.0684131532907486, 0.014742466621100903, 0.022655775770545006, -0.017285669222474098, 0.08503008633852005, 0.007827186025679111, 0.004230226390063763, -0.01757950522005558, -0.03874583542346954, 0.053174201399087906, -0.004346747882664204, -0.034632131457328796, -0.058361928910017014, -0.01791387051343918, 0.06160425767302513, -0.012543762102723122, -0.009894170798361301, 0.007882913574576378, 0.04154234379529953, 0.01052743848413229, -0.03692202642560005, 0.029424138367176056, -0.007963971234858036, -0.02543202042579651, 0.016272440552711487, 0.038563456386327744, -0.013668444938957691, 0.05520065873861313, 0.023344771936535835, 0.010821274481713772, -0.014124397188425064, 0.0083540640771389, 0.019960589706897736, -0.00628201337531209, -0.05556542053818703, -0.040002238005399704, 0.03651673346757889, -0.010638893581926823, 0.017386991530656815, -0.05982097610831261, 0.0013691242784261703, 0.04875652864575386, 0.06873738020658493, 0.03929297998547554, -0.041582874953746796, 0.017245139926671982, 0.01988966390490532, 0.05864563211798668, -0.028674351051449776, -0.013465799391269684, -0.04543314129114151, 0.024398528039455414, 0.03272726386785507, 0.0542684867978096, -0.023912178352475166, 0.026424983516335487, -0.010507173836231232, 0.013627915643155575, 0.00026438914937898517, 0.05896986648440361, -0.05941568687558174, 0.01692090556025505, -0.01262481976300478, 0.058240342885255814, -0.019869400188326836, -0.04328509792685509, 0.008136220276355743, -0.005294115748256445, -0.01560370996594429, -0.039819858968257904, -0.05126933380961418, -0.018410351127386093, 0.030113134533166885, 0.001740218955092132, 0.00283450516872108, 0.08174722641706467, 0.021480431780219078, -0.011459607630968094, 0.036739643663167953, -0.026546571403741837, -0.014104132540524006, -0.02123725786805153, 0.0271342433989048, -0.05568700656294823, -0.02800562046468258, 0.041197847574949265, 0.052363619208335876, -0.013627915643155575, -0.0609152615070343, -0.01181423757225275, -0.05491695553064346, -0.04794594645500183, 0.03382154926657677, -0.010309593752026558, 0.026161545887589455, 0.04794594645500183, -0.012989582493901253, -0.014894450083374977, 0.015765827149152756, 0.11356258392333984, 0.054552190005779266, -0.056619174778461456, -0.0026749216485768557, -0.029565991833806038, 0.016059663146734238, -0.009904302656650543, -0.0019251330522820354, 0.017478181049227715, 0.007741061504930258, 0.03848239779472351, -0.02425667643547058, -0.024844348430633545, -0.00025299034314230084, -0.024094559252262115, 0.07125018537044525, -0.028775673359632492, -0.031126361340284348, 0.0482296496629715, 0.021541226655244827, 0.03138980269432068, -0.03159244731068611, 0.09281168133020401, 0.002322825137525797, 0.08721865713596344, 0.026303397491574287, 0.014428365975618362, 0.019129743799567223, -0.028998583555221558, -0.015340270474553108, 0.06229325383901596, 0.008794818073511124, 0.03641541302204132, 0.017032360658049583, -0.030437367036938667, -0.0271342433989048, 0.016728393733501434, 0.013384740799665451, 0.03977932780981064, -0.0040326472371816635, -0.014073736034333706, -0.020467204973101616, -0.00930143240839243, 0.029809165745973587, 0.013627915643155575, -0.08454373478889465, -0.017954399809241295, -0.045838430523872375, 0.05289049819111824, 0.06338753551244736, -0.027357153594493866, 0.0005449266172945499, 0.019687019288539886, -0.014955244027078152, -0.056173358112573624, -0.039819858968257904, 0.01742752082645893, 0.018704187124967575, -0.029728107154369354, -0.01814691163599491, -0.0412789061665535, -0.016373762860894203, 0.027985354885458946, 0.021520961076021194, -0.05102615803480148, -0.034996893256902695, 0.05102615803480148, -0.0003155255108140409, -0.004602587781846523, -0.06930478662252426, 0.07931548357009888, 0.045271024107933044, -0.04729748144745827, 0.04839176684617996, -0.028552763164043427, -0.04008329659700394, 0.04292033612728119, 0.005881788209080696, 0.022068103775382042, -0.0166777316480875, 0.00878975261002779, 0.022209955379366875, -0.011672385968267918, 0.09159580618143082, 0.06383335590362549, 0.02770165167748928, -0.02606022171676159, 0.00045721911010332406, 0.033112287521362305, -0.04668954387307167, 0.0034221773967146873, 0.02081170119345188, -0.025533344596624374, 0.056740764528512955, 0.06796733289957047, 0.0040402463637292385, -0.021723607555031776, -0.015330138616263866, 0.046203192323446274, -0.06581928580999374, 0.015978604555130005, -0.0962161272764206, -0.03240302950143814, 0.030376574024558067, -0.049850814044475555, -0.016687864437699318, -0.04993187263607979, -0.010821274481713772, 0.034125518053770065, 0.019970722496509552, 0.019089214503765106, -0.026587100699543953, 0.003237263299524784, 0.036618057638406754, 0.038826894015073776, -0.0059527140110731125, 0.04150181636214256, -0.054106369614601135, 0.03566562384366989, -0.04231239855289459, 0.026465512812137604, 0.015299742110073566, 0.020619187504053116, 0.0204874686896801, -0.06298224627971649, 0.052485205233097076, 0.061320554465055466, 0.04563578590750694, -0.08559749275445938, -0.012027015909552574, -0.019220933318138123, -0.04964816942811012, -0.02198704518377781, 0.008688429370522499, -0.02745847776532173, -0.08203092962503433, 0.017001964151859283, 0.06577875465154648, -0.00023668371431995183, 0.10699687153100967, -0.01278693601489067, -0.0005629747756756842, -0.023020539432764053, 0.016758790239691734, -0.018430616706609726, -0.048027005046606064, -0.02081170119345188, -0.019180404022336006, 0.03840133920311928, 0.03246382251381874, 0.049850814044475555, -0.021095406264066696, 0.048027005046606064, -0.00582606066018343, -0.008855612017214298, -0.04123837500810623, -0.07242552936077118, 0.005385306663811207, -0.05017504841089249, 0.00401998171582818, -0.011733178980648518, -0.017721356824040413, -0.010861803777515888, -0.009367291815578938, -0.0273774191737175, 0.004947085399180651, -0.0013184628915041685, 0.04421726614236832, 0.015147757716476917, -0.028552763164043427, 0.02751927077770233, -0.00958513654768467, 0.006920346524566412, -0.017630165442824364, 0.006667039822787046, -0.024965936318039894, 0.026100751012563705, -0.0020239227451384068, -0.06954796612262726, 0.0004265056340955198, 0.01892709732055664, 0.00024934904649853706, 0.06026679649949074, 0.014560085721313953, -0.0167081281542778, 0.022797629237174988, 0.014144661836326122, -0.031308744102716446, -0.012634952552616596, -0.01319222804158926, -0.004959750920534134, 0.028248794376850128, -0.04093440994620323, 0.011165771633386612, -0.019960589706897736, 0.04324456676840782, 0.050539810210466385, -0.018531939014792442, -0.019565431401133537, 0.026830274611711502, -0.0013969880528748035, -0.006803825497627258, -0.0013273286167532206, -0.06148267164826393, -0.0545116625726223, -0.009868839755654335, -0.057429760694503784, -0.0015755693893879652, 0.031491123139858246, -0.011692650616168976, 0.05580859258770943, -0.07826172560453415, 0.022898951545357704, 0.0483512356877327, 0.006008441559970379, 0.01115563977509737, 0.037874460220336914, 0.006433997303247452, 0.035746682435274124, 0.024965936318039894, -0.041582874953746796, -0.03645594045519829, 0.09394649416208267, 0.027539534494280815, -0.05576806515455246, -0.02168307825922966, -0.004316350910812616, -0.003852799301967025, 0.10667263716459274, -0.015016037970781326, 0.010699686594307423, 0.009802980348467827, -0.07072331011295319, 0.0009809313341975212, 0.04612213373184204, -0.02417561784386635, -0.07283082604408264, 0.029241757467389107, -0.034996893256902695, 0.0050585404969751835, -0.020264558494091034, 0.0030346177518367767, 0.003452574135735631, 0.03453080728650093, -0.011692650616168976, -0.0305792186409235, -0.007052066270262003, 0.06359018385410309, 0.01988966390490532, -0.07607315480709076, 0.018906833603978157, 0.0609152615070343, -0.0537821389734745, -0.021480431780219078, -0.0043112849816679955, 0.04429832473397255, -0.03611144423484802, -0.034247104078531265, 0.03748943284153938, 0.0014641144080087543, -0.0019327322952449322, 0.007543481886386871, 0.0006019207066856325, 0.05982097610831261, -0.011571062728762627, -0.04510890692472458, 0.021399373188614845, -0.07489781081676483, -0.10967179387807846, -0.034692924469709396, -0.0033968465868383646, 0.013486064039170742, 0.031673505902290344, -0.039515890181064606, 0.0014033206971362233, 0.09313590824604034, -0.0013526593102142215, 0.005760200787335634, -0.0542684867978096, -0.012108073569834232, -0.03532112389802933, 0.007528283633291721, -0.03138980269432068, 0.04547366872429848, 0.07489781081676483, -0.01926146261394024, -0.02812720648944378, 0.015887413173913956, 0.00045246959780342877, 0.021419638767838478, -0.04292033612728119, -0.04944552108645439, 0.028856731951236725, -0.03171403333544731, -0.017468050122261047, 0.01794426701962948, -0.02004164829850197, -0.03558456525206566, -0.05528171733021736, 0.03590879961848259, -0.01716408133506775, -0.03564535826444626, 0.0008321134373545647, 0.004625385627150536, -0.022412601858377457, -0.001461581327021122, 0.03519953787326813, -0.035503506660461426, 0.007133124396204948, -0.02419588342308998, 0.048715997487306595, -0.033862076699733734, 0.009863774292171001, -0.012736274860799313, 0.03238276392221451, 0.06354965269565582, -0.07846437394618988, 0.034307897090911865, -0.000363178871339187, -0.016687864437699318, -0.014853921718895435, 0.01806585304439068, 0.008886008523404598, -0.061198968440294266, -0.018501542508602142, 0.03076159954071045, -0.04628425091505051, 0.02174387127161026, 0.07631632685661316, 0.04851335287094116, -0.04123837500810623, -0.014742466621100903, 0.03515901044011116, -0.002312692813575268, -0.027478741481900215, 0.006185756530612707, 0.002601462649181485, 0.03232197090983391, 0.05552488937973976, -0.056294944137334824, -0.0414004921913147, -0.027417948469519615, -0.015046434476971626, -0.02123725786805153, -0.04040753096342087, -0.03528059646487236, -0.028208265081048012, 0.043893035501241684, 0.07416828721761703, -0.012330983765423298, -0.005699407309293747, 0.006864619441330433, -0.002104981103911996, 0.018136780709028244, -0.010319726541638374, 0.00041510682785883546, 0.013992677442729473, -0.07238500565290451, -0.02350688725709915, -0.0302752498537302, -0.03842160478234291, 0.01146974042057991, 0.020234161987900734, -0.016130588948726654, 0.03536165505647659, 0.01228032261133194, 0.053174201399087906, -0.0005138965207152069, -0.02599942870438099, -0.0135367251932621, 0.0010803543264046311, 0.01751871034502983, -0.008678297512233257, -0.022230220958590508, -0.04717589169740677, 0.007609341759234667, 0.02938360907137394, -0.003298057010397315, 0.0405493825674057, 0.04908075928688049, -0.02306106686592102, 0.022635512053966522, -0.04936446622014046, -0.013871090486645699, 0.037935253232717514, -0.0018048122292384505, 0.006266814656555653, 0.024216147139668465, 0.011510269716382027, -0.0471353642642498, 0.016687864437699318, -0.01689050905406475, 0.01071995124220848, 0.018531939014792442, -0.041947636753320694, -0.015745561569929123, -0.014306778088212013, 0.01659667305648327, 0.034571338444948196, 0.00933182891458273, -0.07903178036212921, -0.024418793618679047, -0.054673779755830765, 0.01419532299041748, 0.00661131227388978, 0.0031030105892568827, 0.04259610176086426, -0.03033604472875595, -0.027154508978128433, -0.016454821452498436, 0.07891019433736801, 0.042393457144498825, 0.01826849952340126, 0.03528059646487236, 0.03228144347667694, -0.01719447784125805, -0.022453131154179573, -0.008303402923047543, 0.01767069473862648, -0.011743311770260334, -0.05001293122768402, -0.026708688586950302, 0.023729797452688217, 0.0018909366335719824, 0.03720572963356972, -0.045392610132694244, -0.044784676283597946, -0.005679142661392689, 0.009706723503768444, -0.07878860086202621, -0.00943315215408802, -0.0069710081443190575, -0.02198704518377781, -0.013090904802083969, 0.022838156670331955, 0.04993187263607979, -0.01133802067488432, 0.012482968159019947, 0.023851385340094566, -0.001999858533963561, 0.008997463621199131, 0.007138190791010857, -0.0009840975981205702, -0.003070080652832985, 0.04831070825457573, -0.03428763151168823, 0.015502387657761574, -0.0343281626701355, -0.020132839679718018, 0.0410965234041214, -0.007330704014748335, 0.012716010212898254, 0.012239793315529823, 0.026222338899970055, -0.04328509792685509, -0.056294944137334824, 0.015178154222667217, -0.02500646561384201, 0.012857862748205662, -0.023344771936535835, 0.023527152836322784, 0.03842160478234291, 0.005689274985343218, 0.0036653520073741674, 0.014620878733694553, 0.014337175525724888, 0.06456288695335388, 0.03740837424993515, -0.024520115926861763, 0.07538415491580963, -0.01964648999273777, 0.06541399657726288, -0.054106369614601135, -0.0100917499512434, -0.013840693049132824, 0.04632478207349777, -0.03333519771695137, -0.03659779205918312, 0.025148317217826843, -0.05049927905201912, 0.07514098286628723, -0.0065201218239963055, -0.013648180291056633, 0.022331543266773224, 0.03771234303712845, -0.0482296496629715, 0.004711509682238102, -0.0670756921172142, -0.06954796612262726, -0.1018901988863945, -0.00725471181795001, -0.05175568163394928, 0.06136108189821243, 0.03404445946216583, 0.0006424498278647661, 0.028350116685032845, 0.0063884020783007145, 0.027113979682326317 ]
717,183
pytorch_optimizer.optimizer.madgrad
__init__
null
def __init__( self, params: PARAMETERS, lr: float = 1e-3, momentum: float = 0.9, weight_decay: float = 0.0, weight_decouple: bool = False, eps: float = 1e-6, ): self.validate_learning_rate(lr) self.validate_non_negative(weight_decay, 'weight_decay') self.validate_range(momentum, 'momentum', 0.0, 1.0) self.validate_non_negative(eps, 'eps') defaults: DEFAULTS = { 'lr': lr, 'weight_decay': weight_decay, 'weight_decouple': weight_decouple, 'momentum': momentum, 'eps': eps, } super().__init__(params, defaults)
(self, params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], lr: float = 0.001, momentum: float = 0.9, weight_decay: float = 0.0, weight_decouple: bool = False, eps: float = 1e-06)
[ 0.015629440546035767, -0.005346913356333971, -0.007246292661875486, -0.005758214741945267, -0.034345947206020355, -0.01393802184611559, -0.06998587399721146, -0.02133219875395298, -0.020444896072149277, 0.04462385177612305, -0.010176234878599644, 0.04599177464842796, 0.04591783508658409, 0.07131683081388474, -0.029262451454997063, 0.04299713298678398, 0.013383458368480206, 0.009422953240573406, -0.03763635456562042, 0.003253437578678131, -0.00702908867970109, -0.03985460847616196, 0.0029299422167241573, 0.11505337804555893, -0.007324855774641037, 0.016960391774773598, -0.028818801045417786, 0.022404354065656662, -0.0498737171292305, -0.0041522919200360775, -0.0003029879298992455, -0.011220661923289299, -0.010398060083389282, 0.08421966433525085, 0.0433298721909523, 0.0029276316054165363, -0.021313712000846863, 0.007384933531284332, -0.06510572135448456, 0.044217173010110855, 0.053090184926986694, -0.02325468324124813, 0.048062145709991455, -0.023735305294394493, -0.011479458771646023, 0.0056473021395504475, 0.03826485946774483, 0.030981598421931267, -0.0002839248045347631, -0.04344078525900841, 0.008817555382847786, -0.004327903501689434, 0.028171811252832413, -0.03478959947824478, -0.03930004686117172, 0.014686682261526585, 0.06310929358005524, 0.03783969581127167, 0.01501942053437233, 0.011534914374351501, -0.004986447282135487, -0.043958377093076706, 0.011553400196135044, -0.014843808487057686, -0.008457088842988014, -0.024530179798603058, -0.08651185780763626, -0.028412122279405594, 0.04369958117604256, 0.03808000683784485, 0.10669796168804169, -0.02325468324124813, -0.014658953994512558, 0.018947577103972435, 0.0041476706974208355, -0.019021518528461456, -0.07054044306278229, -0.05161134898662567, -0.039632782340049744, -0.013706954196095467, 0.03207223862409592, 0.04048311337828636, -0.029059112071990967, -0.025731733068823814, 0.03214618191123009, -0.03514082357287407, -0.05445810779929161, -0.051315583288669586, 0.011710526421666145, 0.030353093519806862, -0.047988202422857285, -0.009575458243489265, -0.004362564068287611, -0.029983384534716606, 0.09775100648403168, 0.028596976771950722, 0.00412918534129858, -0.04691604897379875, 0.022459810599684715, -0.014668196439743042, -0.028892742469906807, 0.010444274172186852, -0.04081585258245468, -0.0028698646929115057, 0.020112158730626106, -0.04277530685067177, -0.05575208738446236, -0.03562144190073013, 0.030353093519806862, -0.06477298587560654, -0.02693328633904457, 0.054753873497247696, -0.04029826074838638, 0.01798633299767971, -0.047396667301654816, 0.046139657497406006, 0.04259045422077179, 0.013864080421626568, 0.01684947870671749, 0.014843808487057686, 0.030020354315638542, 0.027913015335798264, -0.034345947206020355, 0.03641631826758385, 0.03771029785275459, -0.021609479561448097, 0.00744501082226634, 0.01698811911046505, 0.022737091407179832, -0.03131433576345444, 0.025491422042250633, -0.004013651050627232, -0.02645266428589821, -0.025398995727300644, 0.012265089899301529, -0.03406866639852524, -0.0035076122730970383, 0.04610268771648407, -0.03698936477303505, 0.019723964855074883, 0.06055830046534538, 0.030926141887903214, 0.030334606766700745, 0.022127071395516396, -0.024363810196518898, 0.020703693851828575, -0.04118556156754494, 0.012828895822167397, 0.0050788745284080505, 0.04976280406117439, 0.0025579228531569242, 0.025824159383773804, 0.019187886267900467, 0.02133219875395298, 0.02266314998269081, -0.02920699492096901, 0.009196506813168526, -0.012366759590804577, 0.0025093986187130213, 0.018023304641246796, -0.02652660757303238, 0.014409400522708893, 0.020019732415676117, -0.0246780626475811, -0.022884974256157875, 0.005388505756855011, -0.027376936748623848, -0.01698811911046505, -0.003124039387330413, 0.006224972195923328, 0.01297677867114544, -0.10529306530952454, 0.008572623133659363, 0.014686682261526585, 0.011026564985513687, 0.05848793312907219, 0.041037678718566895, 0.008313826285302639, -0.017450256273150444, 0.0014707478694617748, 0.09183567017316818, -0.00396743742749095, -0.03218315169215202, -0.06233290582895279, 0.04000249132514, 0.03011278249323368, -0.05272047594189644, 0.0476924367249012, -0.03804303705692291, 0.03314439579844475, 0.06928343325853348, 0.016239458695054054, 0.0008901894907467067, 0.028486063703894615, -0.015832779929041862, 0.010453516617417336, 0.06543845683336258, -0.009492273442447186, -0.007472739089280367, 0.06218501925468445, 0.07327628135681152, 0.014917749911546707, 0.00996365211904049, -0.009173399768769741, 0.03246043249964714, -0.021036431193351746, -0.032682258635759354, 0.00504190381616354, -0.027746645733714104, -0.030390063300728798, -0.003304272424429655, -0.01409514807164669, 0.059042494744062424, 0.03765484318137169, 0.000901165185496211, -0.036859966814517975, -0.02460412122309208, 0.01585126481950283, 0.013836352154612541, -0.024363810196518898, 0.09006106108427048, -0.021313712000846863, 0.015093361958861351, -0.00042574279359541833, 0.05682424455881119, 0.008586486801505089, 0.022127071395516396, -0.07142774015665054, -0.0746072381734848, 0.06384871155023575, -0.0037363695446401834, -0.07490300387144089, -0.026803888380527496, -0.0046352241188287735, 0.03915216401219368, 0.002816719003021717, -0.03554750233888626, 0.050834961235523224, -0.07050346583127975, -0.015564740635454655, 0.02092551812529564, 0.027839072048664093, -0.0050696320831775665, -0.023975616320967674, 0.020796120166778564, 0.007713050115853548, 0.06314626336097717, 0.010037594474852085, -0.04517841711640358, -0.006414447911083698, -0.043034106492996216, -0.015158060938119888, -0.0008491749176755548, 0.051241640001535416, -0.03061188943684101, 0.027802102267742157, 0.025546878576278687, 0.0008468642481602728, 0.0003168520051985979, 0.0010403837077319622, -0.0194836538285017, 0.01379938144236803, 0.004461923148483038, 0.08421966433525085, 0.02040792629122734, 0.001384097384288907, -0.00523137953132391, -0.013873322866857052, 0.006793399341404438, 0.00396743742749095, 0.11941594630479813, 0.005624195095151663, 0.005430098157376051, 0.01058291457593441, -0.004880156368017197, -0.04843185469508171, -0.007814720273017883, -0.04462385177612305, -0.023901674896478653, 0.042368628084659576, 0.009834254160523415, -0.041629210114479065, 0.013374215923249722, -0.0020253111142665148, -0.022774063050746918, 0.014982448890805244, -0.011784467846155167, 0.010749283246695995, -0.007981088943779469, 0.012902837246656418, -0.0033181365579366684, -0.00225406838580966, 0.08762098848819733, 0.027913015335798264, 0.09886013716459274, -0.016424313187599182, 0.04026128724217415, -0.008161322213709354, 0.05161134898662567, -0.014880779199302197, 0.0558999702334404, -0.03210920840501785, 0.031332820653915405, -0.0034845054615288973, -0.02996489778161049, -0.03721119090914726, 0.025158684700727463, 0.02719208225607872, 0.04000249132514, 0.04469779506325722, 0.025454450398683548, 0.00627118581905961, 0.004110699985176325, 0.0416661836206913, 0.02652660757303238, -0.0675458014011383, 0.006899690721184015, -0.042701367288827896, 0.034771114587783813, 0.0510198138654232, 0.006913554854691029, 0.03246043249964714, 0.001342505100183189, -0.014483342878520489, -0.0871773362159729, -0.06092800945043564, 0.010314875282347202, 0.038856394588947296, -0.026748431846499443, 0.008350797928869724, -0.04122253134846687, 0.004570525139570236, 0.018808934837579727, -0.018808934837579727, -0.05564117431640625, -0.02425289712846279, 0.024973830208182335, 0.05194408819079399, -0.01087868120521307, -0.027986956760287285, 0.09361027181148529, -0.010850953869521618, -0.009806525893509388, 0.037525445222854614, -0.024530179798603058, -0.04584389179944992, 0.006502253469079733, -0.028818801045417786, 0.048653677105903625, -0.01889212056994438, -0.014418642967939377, 0.01501942053437233, -0.01933577097952366, 0.07268474996089935, 0.029558219015598297, -0.025583848357200623, -0.033846840262413025, -0.016951149329543114, 0.03756241500377655, -0.05438416451215744, -0.0356399305164814, 0.012357517145574093, -0.02493685856461525, 0.05867278575897217, 0.022108586505055428, -0.010823225602507591, 0.0194836538285017, -0.01443712878972292, 0.03046400472521782, 0.007569787558168173, 0.004995690193027258, -0.06521663069725037, -0.0271181408315897, -0.02092551812529564, -0.00457976758480072, -0.010675341822206974, -0.02595355734229088, 0.010508973151445389, 0.05260956287384033, -0.007629865314811468, 0.0032950297463685274, -0.002497845096513629, 0.0532010979950428, 0.006063224282115698, -0.0010132332099601626, -0.026877829805016518, 0.004489651415497065, 0.03255286067724228, 0.05619573965668678, 0.0005479200044646859, -0.00943219568580389, 0.012107963673770428, 0.012329788878560066, -0.02316225692629814, -0.060188595205545425, 0.054014455527067184, 0.042035892605781555, 0.03680451214313507, -0.06455115973949432, -0.02294043079018593, -0.017237672582268715, -0.05305321514606476, -0.013522099703550339, 0.04584389179944992, -0.009529244154691696, -0.005291457287967205, 0.0017203012248501182, 0.0482100285589695, 0.0251956544816494, 0.06440327316522598, 0.015694139525294304, -0.026582062244415283, -0.01850392483174801, 0.020888548344373703, -0.030260665342211723, -0.04809911549091339, 0.001981408102437854, -0.037359073758125305, 0.03111099638044834, -0.001609388622455299, 0.03447534516453743, 0.0032626802567392588, 0.0887301117181778, 0.022718606516718864, 0.05893158167600632, 0.042035892605781555, -0.006825748831033707, 0.025251111015677452, -0.006294292397797108, -0.039189133793115616, -0.0717974528670311, 0.00996365211904049, -0.0323125496506691, -0.0438474640250206, 0.022811032831668854, 0.008313826285302639, 0.012431458570063114, 0.013115420006215572, 0.013910293579101562, -0.020629750564694405, 0.02142462506890297, -0.07213018834590912, 0.007310991641134024, -0.03399472311139107, -0.04591783508658409, -0.024807460606098175, 0.00627118581905961, -0.0050788745284080505, -0.049319155514240265, -0.01084171049296856, 0.03440140560269356, -0.0005279903998598456, 0.04033523052930832, -0.03135130554437637, -0.015527769923210144, -0.01966850832104683, -0.01924334280192852, -0.016285672783851624, 0.04787728935480118, -0.04307107627391815, 0.044291116297245026, -0.007740777917206287, -0.01061988528817892, -0.04240560159087181, -0.05948614701628685, 0.022570721805095673, 0.059781912714242935, -0.017025090754032135, -0.00860035140067339, 0.01092489529401064, 0.019594566896557808, 0.007870175875723362, 0.03303348273038864, -0.04491962119936943, -0.05578905716538429, 0.03063037432730198, -0.024141984060406685, -0.018947577103972435, 0.02636023797094822, -0.030926141887903214, 0.008507924154400826, -0.05105678737163544, 0.025029286742210388, 0.0695052519440651, 0.008406253531575203, -0.00974182691425085, -0.057341836392879486, -0.005577981472015381, 0.016341129317879677, 0.03377290070056915, -0.07911768555641174, -0.00408759294077754, 0.037617869675159454, 0.04133344441652298, -0.001771136187016964, -0.022570721805095673, 0.013254060409963131, 0.018947577103972435, 0.06510572135448456, 0.03112948127090931, 0.011969322338700294, -0.01580505073070526, -0.019021518528461456, -0.011017322540283203, 0.030852200463414192, -0.01689569279551506, -0.08555061370134354, 0.02586113102734089, -0.03930004686117172, -0.0027427771128714085, -0.006261942908167839, 0.023494994267821312, -0.02092551812529564, 0.03347713127732277, -0.05612179636955261, -0.03207223862409592, -0.058266106992959976, 0.07860009372234344, 0.0011900002136826515, -0.04381049424409866, 0.0482100285589695, 0.054088398814201355, 0.01551852747797966, -0.048727620393037796, 0.004981826059520245, 0.0373036190867424, 0.0003699976368807256, -0.06821127235889435, 0.07157562673091888, 0.03528870642185211, -0.005785943008959293, -0.03220163658261299, -0.04155527055263519, 0.04828396812081337, -0.03168404474854469, 0.007740777917206287, 0.02526959590613842, -0.024567149579524994, -0.04939309507608414, -0.043145015835762024, 0.0210918877273798, 0.029170025140047073, 0.03808000683784485, -0.030482491478323936, -0.006345127243548632, 0.016285672783851624, -0.022108586505055428, 0.057193953543901443, -0.07704731822013855, -0.0015227381372824311, -0.010351846925914288, -0.0373036190867424, -0.0735720545053482, 0.019280314445495605, 0.02377227693796158, -0.002377689816057682, 0.02602750062942505, -0.016285672783851624, 0.051241640001535416, 0.03789515420794487, -0.04085282236337662, -0.04192497953772545, -0.009307418949902058, 0.016193246468901634, -0.01992730423808098, 0.010712312534451485, -0.015962177887558937, -0.0498737171292305, -0.08407178521156311, 0.026249324902892113, 0.012773439288139343, -0.017099032178521156, 0.018596353009343147, 0.00962167140096426, -0.044143229722976685, 0.013078449293971062, 0.003789515234529972, 0.029096083715558052, -0.018522411584854126, -0.05368172004818916, -0.008457088842988014, -0.016803264617919922, -0.06362688541412354, -0.0817795842885971, 0.03210920840501785, -0.011534914374351501, -0.04854276776313782, 0.004570525139570236, -0.02024155668914318, -0.0008832574239932001, 0.016525983810424805, 0.018596353009343147, -0.008803690783679485, -0.041296474635601044, -0.04721181467175484, -0.0024793597403913736, -0.04299713298678398, -0.01741328462958336, 0.05272047594189644, 0.06651061028242111, -0.07567939162254333, -0.01853165403008461, 0.035436589270830154, -0.00897930283099413, -0.01850392483174801, -0.028319694101810455, -0.010213205590844154, 0.04954098165035248, 0.013660740107297897, -0.0592273510992527, -0.0031794956885278225, -0.0345492884516716, -0.015084119513630867, -0.02501079998910427, 0.0012419904815033078, -0.03721119090914726, -0.04225771501660347, 0.036342374980449677, 0.07682549208402634, -0.012015536427497864, -0.012449944391846657, -0.04625057056546211, 0.0027843695133924484, 0.03412412106990814, -0.07830432802438736, 0.007237049750983715, -0.0061371661722660065, -0.11098658293485641, 0.009164157323539257, -0.027081169188022614, 0.01990881934762001, -0.029835499823093414, -0.0191694013774395, -0.05338595062494278, 0.006423690356314182, 0.021221285685896873, 0.010906409472227097, 0.004457301925867796, 0.04277530685067177, -0.011174448765814304, 0.014871536754071712, 0.059116438031196594, -0.001124145812354982, -0.020703693851828575, -0.039706725627183914, -0.01741328462958336, -0.008466331288218498, 0.0025856508873403072, 0.05745274946093559, 0.03539961948990822, -0.024659577757120132, 0.03508536517620087, -0.029521247372031212, 0.022385867312550545, -0.011488701216876507, 0.006756428629159927, 0.008646564558148384, -0.0012431459035724401, 0.03992855176329613, -0.03612054884433746, -0.021701907739043236, -0.004265515133738518, 0.03349561616778374, 0.030242180451750755, 0.00943219568580389, -0.001735320664010942, -0.05290532857179642, -0.015906721353530884, -0.0219237320125103, -0.02920699492096901, -0.04562206566333771, -0.01753344014286995, -0.025472937151789665, 0.030020354315638542, 0.015028662979602814, 0.02225646935403347, -0.060188595205545425, -0.039115190505981445, -0.000826645758934319, -0.007140001282095909, 0.06965313851833344, 0.022034645080566406, -0.005097360350191593, -0.030316121876239777, 0.017847692593932152, -0.017967848107218742, -0.07963527739048004, 0.04721181467175484, -0.0060447389259934425, -0.02092551812529564, -0.05120467022061348, 0.014548041857779026, 0.011534914374351501, -0.0038657677359879017, 0.03063037432730198, -0.047729406505823135, -0.08895193785429001, -0.060854069888591766, 0.022884974256157875, -0.028412122279405594, -0.01670159585773945, 0.011765982955694199, -0.06673243641853333, 0.05948614701628685, 0.015620197169482708, 0.034678686410188675, -0.0013436604058369994, -0.006973632145673037, 0.014797595329582691, -0.04174012318253517, 0.037932123988866806, 0.04399534687399864, 0.04155527055263519, -0.08799069374799728, -0.008207535371184349, 0.03765484318137169, 0.04591783508658409, -0.02090703323483467, -0.03210920840501785, 0.002136223716661334, -0.01795860566198826, -0.03915216401219368, 0.0034267385490238667, 0.00011632829409791157, -0.0005412768223322928, -0.06281352788209915, -0.04761849343776703, 0.00481083570048213, 0.03508536517620087, -0.030242180451750755, 0.024326838552951813, 0.0164427999407053, -0.027469364926218987, 0.016877206042408943, 0.023957131430506706, -0.01881817728281021, 0.023458024486899376, 0.02619386836886406, 0.04506750404834747, 0.06506875157356262, 0.0014441750245168805, 0.04477173462510109, -0.06052133068442345, 0.0030339229851961136, -0.011701283976435661, 0.04854276776313782, -0.0027889907360076904, -0.03125888109207153, 0.07567939162254333, -0.006590059492737055, -0.014030449092388153, -0.02693328633904457, 0.018494682386517525, 0.018762722611427307, 0.03364350274205208, -0.0455111525952816, 0.0026919422671198845, -0.02944730594754219, -0.08251900225877762, -0.0861421525478363, -0.00009444904571864754, -0.049504008144140244, 0.07309143245220184, 0.02776513062417507, -0.004461923148483038, 0.038449715822935104, 0.05956008657813072, 0.02636023797094822 ]
717,186
pytorch_optimizer.optimizer.madgrad
__str__
null
def __str__(self) -> str: return 'MADGRAD'
(self) -> str
[ 0.025081433355808258, -0.02963707596063614, 0.04132255166769028, 0.02536933682858944, 0.010152815841138363, -0.039696745574474335, -0.0232015959918499, -0.00714676920324564, 0.06814833730459213, -0.02206692099571228, -0.033091913908720016, 0.021440308541059494, 0.03432820364832878, 0.028536271303892136, -0.0004482607764657587, -0.00032256782287731767, 0.0013950595166534185, -0.007180640008300543, 0.0019317022524774075, 0.02752014249563217, -0.011846362613141537, -0.0013357853749766946, -0.027570948004722595, -0.0053939479403197765, -0.017748374491930008, 0.039154812693595886, 0.04318545386195183, -0.03382013738155365, -0.02370966039597988, -0.005262698046863079, -0.059206411242485046, -0.05067093297839165, -0.015301198698580265, 0.013971764594316483, -0.032583847641944885, -0.016164908185601234, 0.016960876062512398, -0.028316108509898186, -0.09294187277555466, -0.04982415959239006, 0.01630885899066925, -0.009898783639073372, 0.010974185541272163, -0.0030166308861225843, -0.0023751999251544476, -0.037664491683244705, -0.025758853182196617, 0.02282901667058468, -0.03029755875468254, -0.007561688311398029, 0.016977811232209206, -0.001096571795642376, -0.044032227247953415, 0.025724982842803, -0.022320952266454697, 0.06692898273468018, 0.03324433043599129, -0.012972571887075901, -0.005283867474645376, 0.0260467566549778, -0.017214907333254814, -0.008908058516681194, 0.06814833730459213, -0.03134755790233612, -0.0224395003169775, 0.05520964041352272, -0.018764503300189972, 0.059748344123363495, 0.03156771883368492, 0.0472838394343853, 0.0026376997120678425, -0.03492094203829765, -0.022100791335105896, 0.020407244563102722, 0.06127253919839859, -0.0343620739877224, -0.0501289963722229, -0.041187066584825516, -0.0071044303476810455, -0.042677391320466995, 0.023387886583805084, -0.0024281232617795467, 0.007498180493712425, -0.03813868388533592, -0.0012786281295120716, -0.1133999228477478, -0.049045126885175705, -0.029061270877718925, -0.011439911089837551, -0.05378706008195877, -0.02282901667058468, -0.02355724200606346, -0.03424352407455444, 0.06374511867761612, -0.03773223236203194, 0.004987496417015791, -0.014234264381229877, -0.03776610270142555, 0.01641893945634365, -0.015301198698580265, 0.029162883758544922, 0.023997563868761063, -0.0171810369938612, 0.01009354181587696, -0.006820761598646641, -0.05856286361813545, -0.0212370827794075, 0.014234264381229877, 0.005965520162135363, -0.0009182201465591788, -0.04091610014438629, 0.0299927219748497, 0.038646746426820755, 0.003166933311149478, -0.013167329132556915, -0.01908627711236477, 0.022642726078629494, -0.0090858805924654, 0.0212370827794075, 0.023472564294934273, 0.009195961058139801, 0.017748374491930008, -0.07248382270336151, 0.010881041176617146, 0.04806286841630936, 0.07424511015415192, -0.0029700584709644318, 0.017231842502951622, 0.030958043411374092, -0.06110318377614021, 0.04362577572464943, 0.007019753102213144, -0.05649673566222191, -0.017197972163558006, 0.047927387058734894, -0.005152617581188679, 0.07790317386388779, -0.015910876914858818, 0.06360962986946106, 0.12559345364570618, 0.002811288461089134, 0.021067727357149124, 0.03292255848646164, 0.03241449221968651, 0.0010399438906461, 0.0315169133245945, -0.02088143676519394, 0.07431285083293915, -0.014894748106598854, 0.0018364402931183577, 0.0018883051816374063, 0.009449993260204792, 0.035361263900995255, -0.02799433469772339, 0.01290482934564352, -0.020830631256103516, 0.016317326575517654, 0.008488905616104603, 0.0051145125180482864, -0.021152405068278313, 0.0059401169419288635, -0.04213545471429825, 0.0062026167288422585, 0.030653204768896103, 0.02259192056953907, -0.007515115663409233, 0.0036114894319325686, 0.028925785794854164, -0.05693705752491951, -0.00570725416764617, -0.02797739952802658, -0.101138636469841, -0.06581124663352966, 0.02213466167449951, 0.0032113888300955296, 0.03149997815489769, -0.016749182716012, 0.10750637948513031, 0.010754024609923363, 0.009814105927944183, 0.010212089866399765, 0.027350787073373795, -0.05991769954562187, -0.009898783639073372, 0.022558048367500305, -0.03488707169890404, -0.011380637064576149, 0.023066112771630287, 0.02447175793349743, -0.03658061847090721, 0.043354809284210205, 0.014725392684340477, -0.01713869720697403, -0.01615644060075283, 0.0073245917446911335, -0.05558221787214279, 0.007375398185104132, -0.045827388763427734, 0.05453221872448921, -0.000626083230599761, -0.008662493899464607, 0.02252417802810669, -0.012481442652642727, 0.06293221563100815, 0.05148383602499962, -0.005190722178667784, 0.003912094049155712, -0.012354427017271519, -0.01338749099522829, -0.014733860269188881, 0.03529352322220802, 0.021982243284583092, 0.017392730340361595, 0.03607255592942238, 0.04565803334116936, -0.046199966222047806, 0.033854007720947266, 0.027774173766374588, -0.017341922968626022, 0.020983049646019936, 0.021677404642105103, -0.04748706519603729, 0.020153211429715157, -0.0036114894319325686, -0.016190310940146446, -0.015250392258167267, 0.033193524926900864, -0.0018353817285969853, -0.03219433128833771, -0.02027175948023796, 0.004352416377514601, -0.09964831918478012, -0.025454014539718628, 0.026317723095417023, 0.010144347324967384, 0.051890287548303604, -0.03417578339576721, 0.018222568556666374, -0.025945143774151802, -0.03891771659255028, -0.029975784942507744, -0.0008531244238838553, -0.008992735296487808, 0.0698418840765953, 0.060425765812397, -0.04061126336455345, 0.01185483019798994, 0.005415117368102074, -0.031313687562942505, -0.006283060181885958, 0.026690304279327393, -0.01818869635462761, -0.0033214695286005735, 0.014640715904533863, 0.003738505532965064, -0.012930233031511307, -0.01226974930614233, 0.031076591461896896, 0.024658046662807465, -0.03529352322220802, -0.028417721390724182, -0.06449028104543686, -0.023929821327328682, 0.045217711478471756, 0.0011166826589033008, 0.047317709773778915, 0.010982654057443142, 0.039391908794641495, 0.005995157174766064, -0.03382013738155365, 0.0833902657032013, 0.04647093638777733, -0.07241608202457428, -0.00490281917154789, 0.0022524178493767977, 0.024522563442587852, 0.022236274555325508, 0.03266852721571922, -0.05246609076857567, -0.02206692099571228, 0.015546763315796852, -0.08853864669799805, -0.022930629551410675, 0.06418544054031372, -0.0439983569085598, 0.0012331140460446477, 0.03373546153306961, -0.04921448230743408, 0.01945885829627514, 0.029721753671765327, 0.0726870447397232, 0.016605230048298836, -0.002815522253513336, 0.014039506204426289, 0.05348221957683563, 0.02335401624441147, 0.09029993414878845, 0.012845555320382118, -0.03449755534529686, 0.047554805874824524, -0.00047683939919807017, -0.04091610014438629, 0.027249174192547798, -0.012650798074901104, -0.07410962879657745, -0.012989507056772709, 0.01503869891166687, -0.031533848494291306, 0.039459649473428726, 0.010212089866399765, -0.052635446190834045, 0.05104351416230202, 0.03404029831290245, 0.04901125654578209, -0.003139413194730878, 0.05178867280483246, 0.01009354181587696, 0.005952818319201469, 0.04460803419351578, 0.04345642030239105, -0.02072901837527752, 0.006376205012202263, -0.03299029916524887, 0.0018978313310071826, 0.005288101267069578, -0.009636283852159977, -0.025403209030628204, 0.019170954823493958, 0.031466107815504074, -0.002447175793349743, -0.07919026911258698, -0.05446447804570198, 0.0444386787712574, -0.024217724800109863, -0.0005874491762369871, -0.01177862100303173, 0.049282222986221313, -0.02968788333237171, -0.021728210151195526, -0.012227410450577736, 0.07810639590024948, -0.024420950561761856, -0.03973061591386795, 0.07038382440805435, 0.03492094203829765, 0.05348221957683563, -0.02250724285840988, -0.02372659556567669, 0.027791108936071396, 0.021795952692627907, -0.038579005748033524, 0.010525396093726158, -0.011795556172728539, 0.03658061847090721, 0.06035802140831947, 0.03844352066516876, -0.03702094033360481, 0.03658061847090721, -0.02162659727036953, 0.01901853457093239, -0.01369232963770628, -0.04304996877908707, -0.008073986507952213, 0.045759644359350204, -0.00024873975780792534, -0.0094669284299016, -0.04393061622977257, 0.005084875505417585, 0.06560801714658737, -0.016368133947253227, -0.011998781934380531, 0.004113202914595604, -0.02379433810710907, 0.014310473576188087, -0.048672545701265335, 0.06801285594701767, 0.02821449562907219, -0.0005228826776146889, 0.0008753522415645421, -0.01788385771214962, -0.020373372361063957, -0.026080626994371414, 0.00753628509119153, 0.032211266458034515, 0.03824029490351677, 0.024065306410193443, 0.017765309661626816, -0.013963297009468079, -0.008738704025745392, -0.0177314393222332, 0.00856088101863861, -0.039154812693595886, 0.003054735716432333, 0.0054278187453746796, -0.0663193091750145, -0.05192415788769722, -0.013514506630599499, -0.00314364698715508, -0.05642899125814438, 0.013997167348861694, -0.022913694381713867, -0.0534144788980484, -0.05927415192127228, 0.010432250797748566, -0.047182224690914154, -0.02282901667058468, -0.011058863252401352, 0.03420965373516083, -0.008984267711639404, -0.005902011878788471, 0.02364191971719265, -0.016452811658382416, -0.03973061591386795, -0.016402004286646843, 0.039391908794641495, 0.010102009400725365, -0.037291910499334335, -0.07255156338214874, -0.014166522771120071, 0.009382251650094986, -0.01526732835918665, 0.021440308541059494, 0.059816088527441025, 0.019103212282061577, -0.011312895454466343, -0.00014884692791383713, -0.0013019144535064697, 0.046640291810035706, 0.008497373200953007, 0.004898585379123688, -0.0586644746363163, 0.04240642115473747, -0.007896163500845432, -0.046572547405958176, -0.012447572313249111, -0.04623384028673172, -0.028925785794854164, -0.005178020801395178, -0.0036601789761334658, -0.02962014079093933, 0.03553061932325363, -0.06255963444709778, 0.010610072873532772, -0.008344953879714012, -0.025335466489195824, -0.05619189515709877, -0.044167712330818176, -0.022354822605848312, -0.006164511665701866, -0.02050885744392872, -0.011905636638402939, 0.05277093127369881, 0.01155846007168293, -0.03231288120150566, 0.0993773490190506, -0.017849987372756004, -0.015081037767231464, -0.07099349796772003, 0.030043527483940125, 0.015402811579406261, -0.03763061761856079, 0.04630158096551895, -0.06841930747032166, 0.04989190027117729, 0.00725684966892004, 0.027096755802631378, 0.03200804069638252, 0.01563144102692604, -0.034463685005903244, -0.014598377048969269, 0.006896970793604851, -0.03158465400338173, 0.004492133855819702, -0.042169325053691864, -0.04084835946559906, 0.04250803589820862, -0.04433706775307655, 0.020610470324754715, 0.023658854886889458, 0.0041597755625844, -0.02355724200606346, -0.09246768057346344, 0.005080641712993383, 0.06428705155849457, -0.017375795170664787, 0.06923221051692963, -0.03607255592942238, -0.00598668958991766, -0.013167329132556915, -0.040441907942295074, 0.006338100414723158, 0.023980628699064255, -0.028400786221027374, 0.009560073725879192, -0.01906934194266796, 0.053922541439533234, 0.016478214412927628, -0.048740290105342865, -0.07349994778633118, 0.0326177179813385, 0.019916115328669548, -0.012405233457684517, -0.04450641945004463, -0.008090921677649021, 0.03739352151751518, -0.029941914603114128, 0.012464507482945919, 0.000025237823138013482, -0.012803216464817524, -0.050603192299604416, -0.03192336484789848, -0.028383851051330566, 0.014970957301557064, 0.06293221563100815, 0.009720960631966591, -0.018798373639583588, -0.02281208150088787, 0.025640305131673813, -0.008256042376160622, 0.016054827719926834, -0.04206771403551102, -0.0057199555449187756, -0.05388867110013962, -0.06140802055597305, -0.04240642115473747, 0.03188949450850487, -0.018239503726363182, 0.002039665821939707, -0.028299173340201378, 0.10276444256305695, 0.008133260533213615, 0.04579351469874382, 0.026520948857069016, 0.07776768505573273, -0.00662176962941885, 0.08291607350111008, -0.03847739100456238, -0.016622165217995644, -0.0212370827794075, 0.0065582613460719585, -0.018832245841622353, -0.049180611968040466, 0.014827005565166473, -0.0383080393075943, 0.03793545812368393, 0.02917981892824173, 0.0023159258998930454, 0.03334594517946243, 0.043964486569166183, -0.024336272850632668, 0.006101003848016262, 0.01764676161110401, -0.09158702939748764, -0.0525338351726532, 0.04677577316761017, 0.09239993244409561, -0.02475965954363346, 0.010931847617030144, 0.049485448747873306, -0.012557652778923512, -0.05476931855082512, -0.05229673907160759, 0.10445798933506012, 0.05781770125031471, -0.033566106110811234, 0.033633846789598465, -0.05307576805353165, 0.013946360908448696, -0.02767256088554859, -0.05961286276578903, 0.0035246950574219227, -0.08420316874980927, 0.03417578339576721, 0.02370966039597988, -0.04599674046039581, 0.07126446813344955, 0.06885962933301926, -0.005631044507026672, -0.023438693955540657, 0.015538295730948448, -0.002536086831241846, 0.05886770039796829, 0.001812095521017909, 0.0006393140647560358, -0.008573582395911217, 0.038104813545942307, -0.01856127753853798, -0.004572577308863401, 0.02355724200606346, -0.06706447154283524, -0.05212738364934921, -0.02752014249563217, 0.003255844581872225, -0.008814913220703602, -0.0026906230486929417, -0.02858707681298256, -0.038274165242910385, -0.009060477837920189, 0.025335466489195824, 0.009636283852159977, 0.025335466489195824, 0.016545956954360008, 0.012896361760795116, 0.03661448881030083, 0.04464190453290939, 0.07079027593135834, 0.013683861121535301, 0.03090723603963852, -0.018645955249667168, 0.002883264096453786, -0.03712255507707596, -0.01174474973231554, -0.022388694807887077, -0.013158861547708511, -0.010533863678574562, -0.04308383911848068, 0.03241449221968651, -0.014801602810621262, -0.017833052203059196, 0.06821607798337936, 0.009102816693484783, 0.03197417035698891, -0.03793545812368393, 0.027181433513760567, 0.032516106963157654, 0.049045126885175705, -0.018679825589060783, -0.023845145478844643, 0.03661448881030083, -0.07126446813344955, 0.00024701975053176284, 0.01425966713577509, 0.007129833567887545, -0.09761606156826019, -0.03141530230641365, 0.024302402511239052, 0.0321773961186409, 0.03803706914186478, -0.013599184341728687, 0.01945885829627514, -0.013184265233576298, 0.04023868218064308, -0.03321046009659767, 0.026842722669243813, -0.04237255081534386, 0.019645147025585175, -0.07302575558423996, -0.030246753245592117, -0.01204958837479353, -0.015140311792492867, -0.0402725525200367, 0.013751603662967682, -0.0028282238636165857, 0.022558048367500305, 0.0354628786444664, -0.029823366552591324, -0.019797567278146744, -0.0008615921251475811, -0.03485320135951042, -0.038409650325775146, -0.030043527483940125, -0.03725804015994072, 0.0007112898165360093, -0.01906934194266796, 0.07133220881223679, 0.0130233783274889, 0.0005477566737681627, -0.006211084313690662, 0.0046022143214941025, -0.05785157158970833, -0.040137067437171936, 0.002821872942149639, 0.026368530467152596, -0.03442981466650963, -0.02552175708115101, 0.027147561311721802, 0.06174673140048981, 0.0040094731375575066, 0.07478704303503036, -0.01009354181587696, 0.026080626994371414, 0.011804023757576942, 0.00814172811806202, -0.006401608232408762, 0.017460471019148827, 0.0663193091750145, -0.08183220028877258, 0.024133047088980675, 0.0013072066940367222, 0.0017030733870342374, -0.06906285881996155, -0.03884997218847275, 0.013760071247816086, -0.011406040750443935, 0.06777575612068176, 0.034683845937252045, -0.03803706914186478, -0.00731188990175724, -0.03112739697098732, -0.03495481610298157, 0.015047166496515274, 0.028316108509898186, -0.03515804186463356, 0.039019327610731125, 0.01908627711236477, -0.006863099988549948, 0.015504424460232258, 0.00504677090793848, -0.04010319709777832, -0.04199996963143349, 0.07160317897796631, 0.04257577657699585, -0.03485320135951042, 0.028858045116066933, 0.05896931514143944, -0.08542252331972122, -0.018645955249667168, 0.017104826867580414, -0.01878143846988678, -0.006765720900148153, -0.01485240925103426, 0.0013770655496045947, 0.021118532866239548, 0.02103385701775551, 0.0009679680806584656, 0.015064102597534657, -0.02447175793349743, -0.01608869805932045, -0.04091610014438629, -0.04142416641116142, -0.019103212282061577, 0.030839495360851288, -0.019916115328669548, 0.03898545727133751, 0.01981450244784355, 0.026368530467152596, 0.026961270719766617, 0.039391908794641495, 0.045827388763427734, 0.049790289252996445, 0.005631044507026672, 0.006465116515755653, -0.007193341851234436, -0.01402257103472948, -0.013599184341728687, 0.053380608558654785, -0.000987020437605679, 0.035429008305072784, -0.047859642654657364, 0.007604027166962624, 0.10174831748008728, 0.040882229804992676, 0.0008054933859966695, 0.03073788248002529, 0.03337981551885605, -0.06540479511022568, 0.023235468193888664, -0.0215588565915823, 0.019323373213410378, -0.05185641720890999, 0.0064862859435379505, -0.054498348385095596, 0.017214907333254814, -0.019712889567017555, -0.027740303426980972, 0.062220923602581024, -0.02072901837527752, -0.020830631256103516 ]
717,207
pytorch_optimizer.optimizer.madgrad
reset
null
@torch.no_grad() def step(self, closure: CLOSURE = None) -> LOSS: loss: LOSS = None if closure is not None: with torch.enable_grad(): loss = closure() # step counter must be stored in state to ensure correct behavior under optimizer sharding if 'k' not in self.state: self.state['k'] = torch.tensor([0], dtype=torch.long, requires_grad=False) for group in self.param_groups: weight_decay, momentum, eps = group['weight_decay'], group['momentum'], group['eps'] lr = group['lr'] + eps _lambda = lr * math.pow(self.state['k'] + 1, 0.5) for p in group['params']: if p.grad is None: continue grad = p.grad state = self.state[p] if 'grad_sum_sq' not in state: state['grad_sum_sq'] = torch.zeros_like(p) state['s'] = torch.zeros_like(p) if momentum > 0.0: state['x0'] = torch.clone(p).detach() if momentum > 0.0 and grad.is_sparse: raise NoSparseGradientError(str(self), note='momentum > 0.0') grad_sum_sq, s = state['grad_sum_sq'], state['s'] if weight_decay > 0.0 and not group['weight_decouple']: if grad.is_sparse: raise NoSparseGradientError(str(self), note='weight_decay') # original implementation. not AdamW style grad.add_(p, alpha=weight_decay) if grad.is_sparse: grad = grad.coalesce() p_masked = p.sparse_mask(grad) grad_sum_sq_masked = grad_sum_sq.sparse_mask(grad) s_masked = s.sparse_mask(grad) rms_masked_values = grad_sum_sq_masked._values().pow(1 / 3).add_(eps) x0_masked_values = p_masked._values().addcdiv(s_masked._values(), rms_masked_values, value=1) grad_sq = grad * grad grad_sum_sq.add_(grad_sq, alpha=_lambda) grad_sum_sq_masked.add_(grad_sq, alpha=_lambda) rms_masked_values = grad_sum_sq_masked._values().pow_(1 / 3).add_(eps) if eps == 0.0: rms_masked_values[rms_masked_values == 0] = float('inf') s.add_(grad, alpha=_lambda) s_masked._values().add_(grad._values(), alpha=_lambda) # update masked copy of p p_kp1_masked_values = x0_masked_values.addcdiv(s_masked._values(), rms_masked_values, value=-1) # Copy updated masked p to dense p using an add operation p_masked._values().add_(p_kp1_masked_values, alpha=-1) p.data.add_(p_masked, alpha=-1) else: if momentum == 0.0: # Compute x_0 from other known quantities rms = grad_sum_sq.pow(1 / 3).add_(eps) x0 = p.addcdiv(s, rms, value=1) else: x0 = state['x0'] # Accumulate second moments grad_sum_sq.addcmul_(grad, grad, value=_lambda) rms = grad_sum_sq.pow(1 / 3).add_(eps) if eps == 0.0: rms[rms == 0] = float('inf') s.add_(grad, alpha=_lambda) if weight_decay > 0.0 and group['weight_decouple']: p_old = p.clone() if momentum == 0.0: p.copy_(x0.addcdiv(s, rms, value=-1)) else: z = x0.addcdiv(s, rms, value=-1) p.mul_(momentum).add_(z, alpha=1.0 - momentum) if weight_decay > 0.0 and group['weight_decouple']: p.add_(p_old, alpha=-lr * weight_decay) self.state['k'] += 1 return loss
(self)
[ -0.012490457855165005, -0.03608354553580284, -0.005379066336899996, 0.06165502592921257, 0.014281840063631535, 0.025984877720475197, -0.030473174527287483, -0.04248133674263954, 0.017037810757756233, -0.001898421673104167, -0.03446933254599571, 0.030650343745946884, 0.04196951538324356, 0.08905725926160812, -0.03045348823070526, 0.06968671828508377, 0.01493146177381277, 0.024606890976428986, 0.007067099213600159, -0.014793663285672665, -0.02387852780520916, -0.0818917378783226, 0.015197216533124447, 0.07952947169542313, -0.060592010617256165, -0.0329141765832901, 0.028760535642504692, -0.020531989634037018, -0.028977075591683388, -0.020157964900135994, -0.0152661157771945, -0.04799327999353409, -0.007697035558521748, 0.0039912378415465355, 0.03149682283401489, -0.015728725120425224, -0.0009153763530775905, 0.018081143498420715, -0.03513864055275917, -0.04204825684428215, 0.015699196606874466, -0.025886449962854385, -0.03216612711548805, -0.0022576823830604553, 0.019488658756017685, 0.033229146152734756, -0.028366824612021446, 0.06775753945112228, 0.02277613803744316, -0.01108294352889061, 0.01965598575770855, -0.03179210424423218, 0.022402113303542137, -0.01940007321536541, 0.012628256343305111, 0.046339698135852814, 0.07086784392595291, -0.03242203965783119, 0.027599088847637177, -0.05551314726471901, 0.06913552433252335, -0.028957389295101166, 0.011466811411082745, 0.021358782425522804, -0.00972464308142662, -0.036969393491744995, -0.03600480407476425, -0.041575804352760315, 0.02986292354762554, 0.025256512686610222, 0.02883927710354328, -0.00852382741868496, 0.010846718214452267, -0.004421858582645655, -0.02311079204082489, -0.04110335186123848, -0.005162525922060013, -0.0614188015460968, 0.007918497547507286, -0.056576166301965714, 0.00042262335773557425, -0.0015822231071069837, -0.05571000277996063, -0.013327092863619328, -0.017205137759447098, -0.013642060570418835, 0.01360268983989954, -0.002038680948317051, -0.022382428869605064, -0.034331534057855606, 0.027520347386598587, 0.032107073813676834, 0.019695356488227844, 0.04842636361718178, 0.06515904515981674, 0.03252046927809715, -0.035099271684885025, -0.03702845051884651, -0.030236948281526566, -0.020079223439097404, 0.01757916249334812, 0.04393806681036949, 0.0070523349568247795, 0.04732397198677063, 0.054017048329114914, -0.03366222605109215, -0.01699844002723694, -0.01645708829164505, 0.029961351305246353, -0.06539527326822281, -0.006693074479699135, 0.0029774338472634554, -0.033622857183218, -0.009695115499198437, -0.04051278531551361, -0.01937054470181465, -0.017598848789930344, 0.00048537092516198754, -0.036378826946020126, 0.060158926993608475, 0.048150766640901566, 0.02498091571033001, -0.051891013979911804, -0.0016129817813634872, -0.006166487000882626, 0.0243116095662117, 0.05807226523756981, 0.02216588705778122, 0.0367528535425663, -0.047363344579935074, -0.01932133175432682, 0.011279799044132233, 0.019724885001778603, 0.013583004474639893, -0.0029971194453537464, -0.014281840063631535, -0.012923539616167545, 0.013336935080587864, -0.015600768849253654, 0.00305863656103611, 0.02950858511030674, 0.013327092863619328, -0.03204801678657532, 0.022815510630607605, 0.05673364922404289, 0.021437523886561394, 0.041063979268074036, 0.0577966682612896, 0.002524666953831911, -0.007076941896229982, 0.022658025845885277, 0.02234305813908577, 0.041575804352760315, 0.008730525150895119, -0.0007751170778647065, 0.007751171011477709, 0.0020509844180196524, 0.013346778228878975, -0.03889857232570648, -0.030118834227323532, -0.013730645179748535, -0.04189077019691467, -0.005113312043249607, -0.007647821679711342, -0.00838110689073801, 0.004515364766120911, 0.007834834046661854, 0.01829768531024456, -0.04039467126131058, 0.015433442778885365, 0.002381947124376893, -0.058544717729091644, 0.036555998027324677, 0.027579404413700104, -0.025866763666272163, 0.108191579580307, 0.009242348372936249, -0.003432661294937134, -0.03693002089858055, -0.03395751118659973, 0.027244750410318375, -0.012205017730593681, -0.027087265625596046, -0.04870196059346199, -0.0025664987042546272, 0.04708774760365486, 0.018209099769592285, -0.021102869883179665, 0.03596543148159981, 0.03992222249507904, -0.002381947124376893, -0.02063041739165783, 0.041142720729112625, 0.00010142652899958193, -0.013356620445847511, 0.02311079204082489, 0.02301236428320408, -0.0034621895756572485, 0.06480471044778824, 0.006343656685203314, -0.006186172366142273, -0.02116192691028118, 0.013917657546699047, 0.026063619181513786, -0.058899056166410446, -0.04015844687819481, -0.029449528083205223, 0.07448998093605042, 0.00690469378605485, 0.02950858511030674, -0.04996183142066002, -0.01676221378147602, 0.03718593344092369, 0.076773501932621, 0.021004442125558853, -0.047363344579935074, -0.004965670872479677, 0.013592846691608429, 0.06279678642749786, -0.015600768849253654, -0.019980795681476593, -0.04704837501049042, 0.04051278531551361, 0.012293603271245956, 0.050513025373220444, -0.03311103209853172, 0.010000240989029408, -0.0393119715154171, -0.0037525510415434837, -0.018002402037382126, 0.045512907207012177, -0.041142720729112625, 0.027756573632359505, -0.018907936289906502, 0.03309134766459465, -0.023406075313687325, -0.054961953312158585, -0.0061369589529931545, -0.009119314141571522, -0.010590805672109127, -0.04811139404773712, -0.055985599756240845, -0.0232092197984457, 0.012480615638196468, -0.018799664452672005, 0.033307887613773346, 0.07090722024440765, 0.01962645724415779, -0.002340115373954177, 0.04858384653925896, -0.022244630381464958, -0.032205499708652496, -0.04476485773921013, 0.014163726940751076, -0.05098547786474228, -0.03948913887143135, 0.07763966172933578, 0.04338687285780907, 0.02218557335436344, -0.039016686379909515, -0.011555396020412445, -0.05295402929186821, -0.049253154546022415, 0.028248710557818413, -0.03736310452222824, -0.0013509183190762997, 0.03584732115268707, -0.037658385932445526, 0.018209099769592285, 0.02208714559674263, 0.0818917378783226, 0.0786239430308342, -0.033229146152734756, -0.007554315496236086, -0.01911463402211666, 0.013583004474639893, -0.007111391518265009, 0.014045613817870617, 0.01855359598994255, -0.017490578815340996, 0.07496243715286255, -0.008469692431390285, -0.05535566434264183, -0.015610611997544765, -0.06271804124116898, 0.0511823333799839, -0.035512667149305344, -0.025433683767914772, 0.05330837145447731, -0.006077902391552925, 0.02848493680357933, -0.017756333574652672, 0.09551411122083664, -0.001298013492487371, 0.10307334363460541, 0.01807130128145218, -0.025197457522153854, 0.006274757441133261, -0.03409530967473984, -0.003536010393872857, 0.08126179873943329, -0.023760413751006126, 0.016033850610256195, 0.0046900734305381775, -0.005684191826730967, -0.003927259705960751, 0.03332757204771042, 0.00477373693138361, 0.0070228069089353085, -0.019478814676404, 0.00148133491165936, -0.007081863470375538, 0.0031570640858262777, 0.019547713920474052, 0.009690193459391594, -0.09764014184474945, -0.02429192326962948, -0.05689113214612007, 0.03549297899007797, 0.062048736959695816, -0.029803866520524025, -0.0021432603243738413, 0.022539911791682243, 0.011338855139911175, -0.04417429119348526, -0.010954988189041615, 0.04326875880360603, 0.004768815357238054, -0.04519793763756752, -0.02950858511030674, -0.05244220793247223, 0.004279138520359993, 0.040552157908678055, 0.03718593344092369, -0.06661577522754669, -0.02131940983235836, 0.05610371381044388, 0.004439083393663168, 0.008710839785635471, -0.06630080938339233, 0.09126204252243042, 0.03309134766459465, -0.047717683017253876, 0.03309134766459465, -0.01970519870519638, -0.022323371842503548, 0.04189077019691467, 0.005147761665284634, 0.04811139404773712, -0.020492618903517723, 0.012165647000074387, 0.012047533877193928, -0.012825111858546734, 0.06708823144435883, 0.05937150865793228, 0.06295426934957504, -0.009286641143262386, -0.006176329683512449, 0.01484287716448307, -0.045591648668050766, 0.048386991024017334, 0.010630177333950996, -0.038583606481552124, 0.08055312186479568, 0.09047462046146393, -0.00196732091717422, -0.02789437212049961, -0.0026747691445052624, 0.04007970541715622, -0.04484359920024872, 0.009882127866148949, -0.07330884784460068, -0.02439035102725029, 0.04700900614261627, -0.043859321624040604, -0.024331294000148773, -0.05791477859020233, -0.01937054470181465, 0.04342624172568321, 0.027008524164557457, 0.03787492588162422, -0.03976473584771156, -0.02252022735774517, 0.04338687285780907, 0.014183412306010723, -0.016545673832297325, 0.02165406383574009, -0.08055312186479568, 0.03964662179350853, -0.05193038284778595, 0.05417453125119209, 0.025177771225571632, 0.027343178167939186, 0.010561278089880943, -0.0351189561188221, 0.04007970541715622, 0.05696987360715866, 0.03881983086466789, -0.06882055103778839, -0.01612243615090847, -0.008007082156836987, -0.026201417669653893, -0.007391910068690777, -0.005044412799179554, -0.011417597532272339, -0.09551411122083664, 0.0026919939555227757, 0.03992222249507904, 0.013356620445847511, 0.08606506139039993, -0.01420309767127037, -0.00397893413901329, -0.023898212239146233, -0.007140920031815767, -0.009483495727181435, -0.0661826953291893, -0.0138979721814394, -0.005659584887325764, 0.03189053013920784, 0.009891970083117485, 0.05941087752580643, 0.00011349928536219522, 0.02771720290184021, 0.009655743837356567, -0.021595008671283722, -0.040119074285030365, -0.04161517322063446, -0.0042471494525671005, -0.013346778228878975, 0.04181202873587608, -0.04547353461384773, -0.046615295112133026, -0.009493338875472546, 0.005423359107226133, -0.02635890245437622, 0.011250270530581474, -0.00035310888779349625, 0.047363344579935074, 0.0228548813611269, 0.012382187880575657, 0.016988597810268402, 0.009257112629711628, -0.010689233429729939, -0.023150162771344185, 0.011023887433111668, -0.006451927125453949, 0.02661481313407421, -0.0138093875721097, -0.08354531973600388, 0.0013004741631448269, 0.024862803518772125, -0.001942714094184339, 0.05996207147836685, 0.01360268983989954, 0.004161025397479534, 0.02628016099333763, -0.049686234444379807, -0.028858961537480354, -0.047127120196819305, -0.0027658145409077406, -0.0033219303004443645, 0.024961231276392937, -0.028858961537480354, 0.0023585704620927572, 0.0005542702274397016, -0.0031103109940886497, 0.03828832134604454, 0.027441605925559998, -0.013868443667888641, 0.013248350471258163, -0.011161685921251774, -0.017205137759447098, -0.005935182329267263, -0.04295378923416138, -0.02259896881878376, -0.025532109662890434, -0.06488344818353653, 0.008459849283099174, 0.020846959203481674, -0.037914298474788666, 0.02234305813908577, -0.05669427663087845, 0.027992799878120422, 0.04598535969853401, -0.0016080603236332536, 0.015453128144145012, 0.04007970541715622, 0.01996111124753952, 0.05157604441046715, 0.05500132218003273, -0.04027656093239784, -0.05456824228167534, 0.07799400389194489, 0.019902054220438004, -0.05039491504430771, -0.018770135939121246, 0.029055817052721977, 0.007229504641145468, 0.11401849240064621, -0.015856681391596794, 0.004909074865281582, 0.04401680827140808, -0.056497421115636826, 0.0007339005242101848, 0.024331294000148773, -0.009409675374627113, -0.05826912075281143, 0.014252311550080776, -0.03992222249507904, 0.039430081844329834, 0.005260953214019537, -0.013287721201777458, -0.0038608212489634752, 0.0072787185199558735, -0.00839587114751339, -0.032776378095149994, 0.0279731135815382, 0.07169464230537415, 0.009375225752592087, -0.0826004147529602, 0.030335376039147377, 0.03702845051884651, -0.028701478615403175, -0.004749129991978407, -0.018563438206911087, 0.060749493539333344, -0.015069260261952877, -0.033563800156116486, 0.0034597290214151144, -0.00829252228140831, -0.03257952257990837, 0.002337654586881399, 0.005585764534771442, 0.07153715193271637, -0.013789702206850052, -0.049410637468099594, -0.018258312717080116, -0.0833878368139267, -0.11795559525489807, -0.04043404385447502, 0.01142744068056345, 0.013661745935678482, 0.05173352733254433, -0.0213981531560421, -0.0006803805590607226, 0.05870220065116882, 0.011378226801753044, -0.0032308849040418863, -0.044646743685007095, -0.01326803583651781, -0.04086712375283241, 0.0036713480949401855, -0.01215580478310585, 0.025728965178132057, 0.07417501509189606, -0.00015317789802793413, -0.01684095710515976, 0.021358782425522804, -0.0015649982960894704, 0.020571360364556313, -0.044804226607084274, -0.050946108996868134, 0.019075261428952217, -0.050788622349500656, -0.01655551604926586, 0.017470892518758774, 0.004215160384774208, -0.04240259528160095, -0.04444988816976547, 0.009591766633093357, -0.01671300083398819, 0.0011522177373990417, -0.014586965553462505, -0.0012438783887773752, -0.023406075313687325, -0.02362261526286602, 0.04858384653925896, -0.03651662543416023, -0.012460930272936821, -0.011171529069542885, 0.03078814223408699, -0.037658385932445526, 0.024154124781489372, -0.011279799044132233, 0.008026768453419209, 0.08165550976991653, -0.09811259806156158, 0.04437114670872688, -0.004148721694946289, 0.004707298241555691, -0.022402113303542137, 0.005831833463162184, -0.04885944351553917, -0.07118281722068787, 0.0016474314033985138, 0.006555275991559029, -0.020945385098457336, 0.009370304644107819, 0.05842660367488861, 0.037658385932445526, -0.05070988088846207, -0.0000573648139834404, 0.030079463496804237, 0.008912616409361362, -0.05441075935959816, -0.001760623068548739, -0.020571360364556313, 0.06122194603085518, 0.041418321430683136, -0.037382788956165314, -0.03224487230181694, -0.04102461040019989, -0.0028888490051031113, -0.023130478337407112, -0.06322986632585526, -0.035788264125585556, -0.022382428869605064, 0.021713120862841606, 0.06082823500037193, -0.024705318734049797, -0.0405915267765522, 0.011230585165321827, -0.029016446322202682, -0.0024446947500109673, 0.004338195081800222, 0.000521050940733403, 0.04622158408164978, -0.07736406475305557, -0.018061459064483643, -0.02259896881878376, -0.05212723836302757, 0.016594886779785156, 0.027225064113736153, -0.027658145874738693, 0.06716696918010712, 0.0019353319657966495, 0.04700900614261627, 0.0341937355697155, -0.039961591362953186, -0.04744208604097366, -0.012037691660225391, 0.032540153712034225, -0.01181130763143301, -0.03230392560362816, -0.031339336186647415, -0.004490757826715708, -0.0013583004474639893, 0.017136238515377045, 0.06425351649522781, 0.01957724243402481, -0.02198871783912182, 0.03505989909172058, -0.041063979268074036, 0.017234666272997856, 0.03265826776623726, 0.0032284241169691086, 0.02131940983235836, 0.020591046661138535, 0.016270076856017113, -0.04996183142066002, 0.00047306748456321657, -0.008174409158527851, -0.001030413550324738, 0.008681311272084713, -0.04803265258669853, -0.027776259928941727, 0.000013524178029911127, -0.02992198057472706, -0.005595607217401266, 0.006791502237319946, -0.08464770764112473, -0.030925940722227097, -0.07634042203426361, 0.01351410523056984, 0.02531556971371174, -0.0277959443628788, 0.02832745388150215, -0.037815872579813004, -0.04090649634599686, -0.005831833463162184, 0.04854447394609451, 0.02602424845099449, -0.0006228619604371488, 0.04460737109184265, 0.030768457800149918, -0.00878958124667406, -0.005689113400876522, -0.006112352013587952, 0.019774097949266434, 0.008922458626329899, -0.04689089208841324, -0.025039972737431526, 0.02352418750524521, 0.036378826946020126, 0.02994166500866413, -0.05578874424099922, -0.038760773837566376, -0.03444964811205864, 0.02472500503063202, -0.061025090515613556, 0.00850906316190958, -0.028504623100161552, -0.006766895297914743, -0.02362261526286602, 0.0036713480949401855, 0.04708774760365486, 0.010610491968691349, -0.009449046105146408, 0.03665442392230034, 0.022894252091646194, -0.001505941734649241, 0.0035237069241702557, -0.03915448486804962, 0.0029552876949310303, 0.009921498596668243, -0.01873076520860195, -0.025276198983192444, -0.020866643637418747, -0.050198059529066086, 0.042008884251117706, -0.009522867389023304, -0.006240307819098234, 0.00810058880597353, 0.017027968540787697, -0.0393119715154171, -0.015167688019573689, 0.047717683017253876, -0.027677832171320915, 0.018750451505184174, 0.012805426493287086, 0.015335015021264553, 0.022658025845885277, 0.0004416937008500099, -0.020157964900135994, 0.004980434663593769, 0.00430620601400733, 0.07082847505807877, 0.039430081844329834, -0.04511919617652893, 0.025571482256054878, 0.008080903440713882, 0.055473774671554565, -0.02252022735774517, -0.03828832134604454, 0.01773664727807045, 0.04610347002744675, -0.02643764391541481, -0.036359142512083054, 0.02763845957815647, -0.07055287808179855, 0.07732469588518143, 0.04271756485104561, 0.0070228069089353085, 0.026417959481477737, 0.0345480740070343, -0.051457930356264114, 0.0073722247034311295, -0.06606458127498627, -0.068387471139431, -0.08015941083431244, -0.03880014643073082, -0.036122918128967285, 0.07098595798015594, 0.04858384653925896, 0.04027656093239784, 0.021102869883179665, 0.04602472856640816, 0.029626697301864624 ]
717,222
pytorch_optimizer.optimizer.msvag
MSVAG
Dissecting Adam: The Sign, Magnitude and Variance of Stochastic Gradients. :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param lr: float. learning rate. :param beta: float. Moving average (momentum) constant (scalar tensor or float value).
class MSVAG(Optimizer, BaseOptimizer): r"""Dissecting Adam: The Sign, Magnitude and Variance of Stochastic Gradients. :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param lr: float. learning rate. :param beta: float. Moving average (momentum) constant (scalar tensor or float value). """ def __init__(self, params: PARAMETERS, lr: float = 1e-2, beta: float = 0.9): self.validate_learning_rate(lr) self.validate_range(beta, 'beta', 0.0, 1.0, range_type='[]') defaults: DEFAULTS = {'lr': lr, 'beta': beta} super().__init__(params, defaults) def __str__(self) -> str: return 'MSVAG' @torch.no_grad() def reset(self): for group in self.param_groups: for p in group['params']: state = self.state[p] state['exp_avg'] = torch.zeros_like(p) state['exp_avg_sq'] = torch.zeros_like(p) state['s'] = torch.zeros_like(p) @staticmethod def get_rho(beta_power: float, beta: float) -> float: r"""Get rho.""" rho: float = (1.0 - beta_power ** 2) * (1.0 - beta) ** 2 # fmt: skip rho /= (1.0 - beta) * (1.0 - beta_power) ** 2 return min(rho, 0.9999) @torch.no_grad() def step(self, closure: CLOSURE = None) -> LOSS: loss: LOSS = None if closure is not None: with torch.enable_grad(): loss = closure() for group in self.param_groups: if 'step' in group: group['step'] += 1 else: group['step'] = 1 beta: float = group['beta'] beta_power: float = beta ** group['step'] for p in group['params']: if p.grad is None: continue grad = p.grad if grad.is_sparse: raise NoSparseGradientError(str(self)) state = self.state[p] if len(state) == 0: state['exp_avg'] = torch.zeros_like(p) state['exp_avg_sq'] = torch.zeros_like(p) state['s'] = torch.zeros_like(p) exp_avg, exp_avg_sq = state['exp_avg'], state['exp_avg_sq'] exp_avg.mul_(beta).add_(grad, alpha=1.0 - beta) exp_avg_sq.mul_(beta).addcmul_(grad, grad, value=1.0 - beta) m = exp_avg.div(beta_power) v = exp_avg_sq.div(beta_power) rho: float = self.get_rho(beta_power, beta) m_p2 = m.pow(2) s = (v - m_p2).div_(1.0 - rho) factor = m_p2.div(m_p2 + rho * s) torch.nan_to_num(factor, nan=0.0, out=factor) factor.clamp_(0.0, 1.0) p.add_(m * factor, alpha=-group['lr']) return loss
(params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], lr: float = 0.01, beta: float = 0.9)
[ -0.008371437899768353, -0.043217867612838745, -0.039191484451293945, 0.008710342459380627, -0.00488123157992959, 0.02071867696940899, -0.04495791345834732, -0.05131109803915024, -0.030875684693455696, 0.021163804456591606, -0.04030430316925049, 0.019312478601932526, 0.022924084216356277, 0.039474744349718094, -0.05349627137184143, 0.039414048194885254, 0.012939057312905788, 0.03583279252052307, 0.03166477754712105, -0.007455891463905573, -0.04137665405869484, -0.06142764165997505, -0.03965684399008751, 0.05382000282406807, -0.04168015345931053, -0.026464873924851418, 0.03376901522278786, -0.0348818376660347, -0.05118970200419426, -0.011087729595601559, -0.005619739182293415, -0.0708562582731247, 0.004312175791710615, 0.026323242112994194, 0.021487534046173096, -0.07279863208532333, 0.028791677206754684, 0.021608933806419373, -0.13240529596805573, -0.026950467377901077, 0.020243199542164803, -0.033020392060279846, 0.04471511393785477, -0.032696664333343506, 0.019019098952412605, -0.03079475276172161, 0.0036925377789884806, 0.04479604586958885, -0.0070714629255235195, -0.021204272285103798, 0.043541595339775085, -0.0558028444647789, 0.02146730199456215, 0.005068387370556593, -0.011259711347520351, 0.07486240565776825, 0.08619293570518494, -0.025028323754668236, 0.04180154949426651, -0.045848168432712555, 0.028245383873581886, -0.0885399729013443, 0.016328098252415657, -0.014760034158825874, -0.021528000012040138, -0.051756229251623154, -0.048640333116054535, -0.028265617787837982, -0.0016654357314109802, 0.03569116070866585, -0.013404417783021927, -0.03433554247021675, 0.05074457451701164, 0.007051229476928711, -0.019322594627738, -0.007263677194714546, -0.05479118973016739, -0.034254610538482666, -0.006459411699324846, -0.04390579089522362, 0.004420928657054901, -0.017137421295046806, -0.02903447486460209, -0.0034396240953356028, -0.020445531234145164, -0.041073158383369446, -0.018280591815710068, -0.03666234761476517, 0.027334894984960556, -0.061629973351955414, 0.028933309018611908, 0.00043374672532081604, 0.023490609601140022, 0.034254610538482666, 0.03987940773367882, 0.040061503648757935, -0.025190189480781555, -0.040486399084329605, -0.022458722814917564, -0.03953544422984123, -0.00291862222366035, 0.040648266673088074, 0.04014243930578232, 0.07045159488916397, 0.013313368894159794, -0.044391386210918427, -0.03101731650531292, -0.02312641404569149, 0.044391386210918427, -0.04463418200612068, -0.02559485100209713, 0.012767075560986996, -0.038442857563495636, -0.013890012167394161, -0.03561022877693176, -0.02397620491683483, 0.00828544795513153, 0.02088054269552231, -0.03156360983848572, -0.003389041405171156, 0.04103269428014755, 0.021285204216837883, -0.03524603322148323, 0.02923680655658245, 0.005564097780734301, -0.022681286558508873, 0.0632890835404396, 0.008012301288545132, -0.02458319626748562, -0.049287792295217514, -0.032919228076934814, 0.021750565618276596, -0.013475233688950539, -0.011988102458417416, 0.04224667698144913, -0.04621236398816109, 0.0005791719886474311, 0.006029458716511726, 0.0031968271359801292, -0.006656684447079897, 0.027597926557064056, 0.015437842346727848, -0.046333760023117065, -0.031462445855140686, 0.0019373177783563733, 0.013586515560746193, 0.05730009078979492, 0.011370993219316006, 0.01172507181763649, -0.01499271485954523, -0.008067942224442959, 0.00904418807476759, 0.011199011467397213, 0.01987900398671627, 0.02442133240401745, -0.008599060587584972, -0.013859662227332592, 0.0028806852642446756, -0.010986564680933952, -0.0077695040963590145, -0.025716248899698257, -0.011381109245121479, -0.04592910036444664, -0.003409274620935321, 0.0035129692405462265, 0.0011292590061202645, 0.0001142062756116502, 0.0236120093613863, -0.06203463301062584, 0.03150290995836258, -0.014577936381101608, -0.042368076741695404, 0.001714753801934421, 0.038078662008047104, -0.009104887954890728, 0.10521203279495239, 0.011603672988712788, 0.022134993225336075, 0.009312276728451252, -0.01939341053366661, 0.0233489777892828, -0.008973372168838978, -0.03708724305033684, -0.06203463301062584, -0.022883618250489235, 0.027516992762684822, -0.0036419550888240337, -0.027274196967482567, -0.023753639310598373, 0.02425946667790413, 0.018007444217801094, -0.040263835340738297, 0.036136288195848465, -0.019170846790075302, 0.00588782737031579, 0.018442455679178238, 0.026707669720053673, -0.006712325382977724, 0.10092262178659439, 0.03465927392244339, 0.010141832754015923, 0.014183391816914082, -0.000027168447559233755, 0.01607518456876278, 0.007718921173363924, 0.007496357429772615, -0.003917630761861801, 0.028690513223409653, -0.026950467377901077, 0.0036874795332551003, -0.08416962623596191, 0.003935334738343954, 0.04426998645067215, 0.06891388446092606, 0.034477174282073975, -0.03793703019618988, 0.036500483751297, 0.049813851714134216, 0.07320329546928406, -0.004946989007294178, 0.025129489600658417, -0.07101812213659286, -0.020324133336544037, 0.02446179836988449, 0.05997085943818092, -0.015093880705535412, 0.04125525802373886, -0.01786581240594387, -0.022519422695040703, 0.0004903361550532281, 0.026161376386880875, -0.04677888751029968, 0.029014240950345993, -0.018280591815710068, 0.02345014363527298, 0.09404337406158447, -0.01733975298702717, -0.009165586903691292, -0.0062773143872618675, -0.02274198643863201, -0.02462366223335266, -0.0445532500743866, -0.034578338265419006, 0.05369860306382179, -0.027436060830950737, -0.003788644913583994, 0.04224667698144913, 0.04876173287630081, -0.015842504799365997, 0.04265134036540985, -0.028306083753705025, -0.01231183111667633, -0.01325266994535923, 0.05252508446574211, -0.06608124822378159, -0.045362573117017746, 0.057381026446819305, 0.0654742568731308, 0.01829070784151554, -0.08012300729751587, -0.031786173582077026, -0.07259630411863327, -0.059687595814466476, 0.07660245150327682, -0.009969851933419704, 0.03484136983752251, 0.07304143160581589, -0.016065068542957306, 0.001712224679067731, 0.03779539838433266, 0.1201845183968544, 0.05337487533688545, -0.08595013618469238, -0.02042529731988907, 0.024117834866046906, 0.036561183631420135, -0.01558959111571312, -0.011765537783503532, 0.004142723977565765, -0.01196786854416132, 0.04111362621188164, -0.05280834808945656, -0.02682906948029995, 0.015184929594397545, -0.0158222708851099, 0.04787147417664528, -0.006515053100883961, -0.04265134036540985, 0.05806894972920418, 0.010885398834943771, 0.03987940773367882, 0.00019711449567694217, 0.07478147745132446, 0.0026657087728381157, 0.08251051604747772, 0.024380866438150406, -0.0183817557990551, 0.06256069242954254, -0.04544350504875183, -0.007850436493754387, 0.07708805054426193, -0.004898935556411743, 0.013100921176373959, -0.0079870093613863, -0.029702166095376015, -0.024340398609638214, 0.026626737788319588, 0.015356910414993763, 0.06357234716415405, -0.03627792000770569, -0.02318711392581463, 0.04062803089618683, -0.025635316967964172, 0.028043054044246674, -0.026424407958984375, -0.05887827277183533, -0.01786581240594387, -0.06369374692440033, 0.040000807493925095, 0.04121479019522667, -0.03322272375226021, 0.03486160188913345, 0.01153285801410675, -0.008032534271478653, -0.020131917670369148, -0.03884752094745636, 0.005756312049925327, 0.0067983162589371204, -0.017562316730618477, -0.015195045620203018, -0.06138717383146286, -0.02510925754904747, 0.036520715802907944, 0.04471511393785477, -0.019079796969890594, -0.03328342363238335, 0.025311587378382683, 0.03552929311990738, 0.008017359301447868, -0.03156360983848572, 0.05442699417471886, 0.03884752094745636, -0.014770151115953922, 0.03805842995643616, 0.009317334741353989, -0.049813851714134216, 0.0359339565038681, -0.00527071813121438, -0.001243702368810773, 0.014223857782781124, -0.012918823398649693, 0.003267643041908741, 0.011876819655299187, 0.07449821382761002, 0.06798315793275833, 0.004635905381292105, -0.00631778035312891, -0.007314259652048349, 0.028771445155143738, -0.0665668472647667, -0.033991578966379166, 0.037046775221824646, -0.056369371712207794, 0.05232275277376175, 0.06943994015455246, -0.03805842995643616, -0.03095661848783493, -0.04629329591989517, 0.02913564071059227, -0.07474101334810257, 0.006292488891631365, -0.0788685604929924, -0.0008036327781155705, 0.010976447723805904, -0.04892359673976898, 0.005832186434417963, -0.01776464655995369, -0.04653609171509743, 0.06462446600198746, 0.012696259655058384, 0.052282288670539856, -0.002558220410719514, 0.01469933521002531, 0.03998057171702385, 0.058028481900691986, -0.020475881174206734, 0.02393573708832264, -0.03595418855547905, 0.057502422481775284, -0.04876173287630081, 0.05013757944107056, 0.011229361407458782, 0.016429264098405838, -0.0017172829248011112, -0.06778082996606827, 0.018138960003852844, 0.03660164773464203, 0.017198121175169945, -0.04329879954457283, -0.010308756493031979, -0.018149076029658318, -0.022499188780784607, -0.009995142929255962, 0.0075570568442344666, -0.0038341693580150604, -0.0933959111571312, 0.013475233688950539, 0.04904499277472496, -0.013363951817154884, 0.07955648750066757, -0.01685415767133236, -0.015346793457865715, -0.031361278146505356, 0.034254610538482666, 0.005988992750644684, -0.02640417404472828, 0.02179103158414364, -0.00220034783706069, -0.0032727012876421213, 0.04309646785259247, 0.041235025972127914, 0.016752993687987328, 0.025635316967964172, 0.022458722814917564, 0.024866459891200066, -0.022195693105459213, -0.082631915807724, -0.013515699654817581, -0.048640333116054535, -0.027780024334788322, 0.00799206830561161, -0.0070967539213597775, -0.024239234626293182, -0.015528891235589981, -0.026060212403535843, -0.01695532351732254, -0.028184685856103897, 0.036035120487213135, 0.03724910691380501, 0.01617635041475296, 0.018958399072289467, -0.014770151115953922, -0.0016679648542776704, 0.01708683930337429, -0.0019803130999207497, -0.036136288195848465, 0.0466979555785656, 0.0012866976903751493, -0.04176108539104462, -0.008877265267074108, 0.018523387610912323, 0.03172547370195389, 0.004286884795874357, 0.003722887486219406, 0.030895918607711792, -0.010703301057219505, 0.0024127953220158815, -0.01920119673013687, -0.016510196030139923, -0.007906077429652214, 0.00361413462087512, 0.05284881591796875, -0.06025412306189537, 0.024765294045209885, -0.027436060830950737, 0.0103289894759655, 0.1024603322148323, -0.007445774972438812, -0.01805802620947361, 0.0011804739478975534, 0.005376941990107298, -0.01906968094408512, 0.015103996731340885, -0.032332468777894974, -0.058352213352918625, -0.0163685642182827, -0.036136288195848465, -0.016226932406425476, -0.012079150415956974, -0.008892440237104893, 0.04754774644970894, -0.04677888751029968, 0.03213013708591461, 0.06138717383146286, 0.016065068542957306, 0.07142278552055359, 0.04014243930578232, 0.019504692405462265, 0.03735027089715004, 0.010713418014347553, -0.04068873077630997, -0.0719083771109581, 0.03601488843560219, 0.04742634668946266, -0.057340558618307114, -0.03898915275931358, 0.03556976094841957, 0.027294429019093513, 0.0708157941699028, -0.02068832702934742, 0.018331173807382584, -0.0019082326907664537, -0.07607639580965042, -0.00252534169703722, 0.027031399309635162, -0.026687437668442726, -0.03494253382086754, 0.03552929311990738, -0.051432497799396515, 0.018796535208821297, -0.014294673688709736, -0.02887261100113392, 0.017623016610741615, 0.034740205854177475, 0.01325266994535923, -0.017653364688158035, -0.0230657160282135, 0.05495305359363556, 0.04904499277472496, -0.03154337778687477, -0.0004745290498249233, -0.000847260351292789, -0.031462445855140686, -0.03840239346027374, 0.002870568772777915, 0.043541595339775085, -0.03117918223142624, 0.0006607366376556456, 0.03174570947885513, -0.008563652634620667, -0.010642602108418941, 0.0039125727489590645, -0.006828665733337402, 0.06927807629108429, -0.011411459185183048, -0.03429507836699486, 0.04329879954457283, -0.05382000282406807, -0.0729604959487915, -0.037856098264455795, 0.00823486503213644, 0.006646567955613136, 0.013556165620684624, -0.0034168618731200695, -0.0156907569617033, 0.042368076741695404, -0.0032221185974776745, 0.02409760281443596, -0.02796212211251259, -0.006712325382977724, -0.027618158608675003, 0.024340398609638214, -0.05377953499555588, 0.015103996731340885, 0.016328098252415657, 0.010642602108418941, -0.05831174552440643, 0.009686588309705257, 0.0033283422235399485, 0.014294673688709736, -0.013647214509546757, -0.03777516633272171, 0.03237293288111687, -0.010076075792312622, -0.029803331941366196, 0.024219000712037086, 0.021811263635754585, -0.00440069567412138, -0.029499836266040802, 0.031199414283037186, -0.0015111584216356277, -0.07785690575838089, -0.016752993687987328, -0.00951460748910904, -0.0348818376660347, 0.03803819790482521, 0.03360715135931969, -0.015619940124452114, -0.0007890902343206108, 0.00005370461076381616, 0.05543864890933037, -0.05155389755964279, 0.00045714122825302184, -0.002061245497316122, 0.011583440005779266, 0.08416962623596191, -0.08352217078208923, 0.05021851509809494, 0.03156360983848572, 0.013030106201767921, -0.025776948779821396, 0.017319519072771072, -0.00050551095046103, -0.08117513358592987, -0.03985917568206787, 0.0281644519418478, -0.02956053428351879, 0.012028568424284458, 0.029924729838967323, 0.010834815911948681, -0.04216574504971504, -0.00466119684278965, 0.06005179136991501, -0.020475881174206734, -0.0005295377341099083, -0.011148429475724697, 0.010662835091352463, 0.03484136983752251, 0.030673354864120483, -0.049449656158685684, -0.03417367860674858, -0.02581741474568844, -0.007132161874324083, 0.009636006318032742, -0.021649399772286415, 0.02104240655899048, -0.028933309018611908, 0.006560577545315027, 0.09396243840456009, 0.008543419651687145, -0.010986564680933952, -0.011795887723565102, -0.009216169826686382, 0.002075155731290579, 0.005035508889704943, -0.027719324454665184, 0.03939381241798401, -0.10618322342634201, -0.027011167258024216, -0.011947635561227798, -0.03427484259009361, -0.005660205148160458, 0.02146730199456215, -0.01354604959487915, 0.02721349708735943, -0.035326965153217316, 0.05183716118335724, 0.022883618250489235, -0.02516995556652546, -0.04738588258624077, -0.02052646316587925, 0.0032398225739598274, -0.024562964215874672, 0.02442133240401745, -0.01896851509809494, 0.00008496314694639295, -0.027395594865083694, 0.042368076741695404, 0.07692618668079376, 0.03215036913752556, 0.02634347416460514, 0.01354604959487915, -0.05183716118335724, 0.012868241406977177, -0.004681429825723171, 0.018260357901453972, 0.03271689638495445, 0.01660124585032463, 0.05106830224394798, -0.01052120327949524, -0.004456336610019207, -0.009727055206894875, -0.025837646797299385, 0.0439867228269577, -0.027516992762684822, -0.017461150884628296, -0.029540302231907845, -0.0075570568442344666, 0.022236159071326256, 0.01763313263654709, -0.06203463301062584, -0.03196827322244644, -0.06644544750452042, 0.007936427369713783, -0.010334047488868237, 0.0012316890060901642, 0.06369374692440033, -0.023268045857548714, -0.04036500304937363, -0.002560749650001526, 0.030976850539445877, 0.06486726552248001, 0.013374067842960358, -0.0012051330413669348, 0.025776948779821396, -0.019413644447922707, -0.02608044445514679, 0.01591332070529461, 0.036621879786252975, -0.02355130948126316, -0.0359339565038681, -0.043703459203243256, 0.026323242112994194, 0.008538361638784409, 0.03245386481285095, -0.038119129836559296, -0.026201842352747917, -0.028730979189276695, 0.0023053069598972797, -0.06057785078883171, -0.0007233327487483621, -0.01344488374888897, -0.052403684705495834, 0.023409677669405937, 0.011886936612427235, 0.037107475101947784, 0.00813875813037157, 0.0004185719299130142, 0.015377143397927284, -0.03332388773560524, 0.00044892154983244836, -0.004997571464627981, -0.005412349943071604, 0.022924084216356277, 0.07555033266544342, -0.003811407135799527, 0.028346549719572067, -0.04985431954264641, -0.015397376380860806, 0.05361767113208771, -0.021366136148571968, -0.01747126691043377, 0.030976850539445877, 0.02195289544761181, -0.03696584329009056, -0.03255503252148628, 0.034052278846502304, -0.002004339825361967, 0.03884752094745636, -0.03144221007823944, 0.028306083753705025, 0.03117918223142624, 0.002019514562562108, -0.02897377498447895, -0.01744091883301735, -0.01118889544159174, 0.03494253382086754, 0.016156116500496864, 0.004888818599283695, 0.0627630278468132, -0.015893086791038513, 0.039414048194885254, -0.018047910183668137, -0.03830122575163841, -0.0072788516990840435, 0.04196341708302498, -0.023955971002578735, -0.003232235088944435, 0.024603430181741714, -0.04904499277472496, 0.06094204634428024, -0.013718030415475368, 0.03793703019618988, 0.045160241425037384, 0.08230818063020706, -0.04125525802373886, 0.018988749012351036, -0.07053253054618835, -0.06373421102762222, -0.1121722161769867, -0.006064866669476032, -0.05649076774716377, 0.05649076774716377, 0.014365489594638348, -0.025291355326771736, 0.02913564071059227, 0.011977985501289368, 0.01588297076523304 ]
717,224
pytorch_optimizer.optimizer.msvag
__init__
null
def __init__(self, params: PARAMETERS, lr: float = 1e-2, beta: float = 0.9): self.validate_learning_rate(lr) self.validate_range(beta, 'beta', 0.0, 1.0, range_type='[]') defaults: DEFAULTS = {'lr': lr, 'beta': beta} super().__init__(params, defaults)
(self, params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], lr: float = 0.01, beta: float = 0.9)
[ 0.020187117159366608, -0.006187425926327705, -0.05102647468447685, -0.003214761149138212, -0.06477010250091553, -0.007910034619271755, -0.0494249165058136, -0.030206184834241867, -0.03678003326058388, 0.024675212800502777, -0.01565246470272541, 0.033129964023828506, -0.010931584984064102, 0.04372633993625641, -0.022012151777744293, 0.0014164968160912395, 0.04011351615190506, 0.038325726985931396, -0.030224807560443878, -0.006024476140737534, -0.033111341297626495, 0.022217001765966415, -0.03216157853603363, 0.08819758892059326, -0.0027235846500843763, 0.0699472427368164, 0.009879396297037601, -0.01054050587117672, -0.033800385892391205, 0.00345452968031168, 0.017142288386821747, -0.008212655782699585, 0.019833283498883247, 0.07382078468799591, 0.016630161553621292, -0.03197535127401352, -0.018836963921785355, 0.006531947758048773, -0.1040642186999321, 0.050914738327264786, 0.03402385860681534, -0.028492886573076248, 0.028101807460188866, -0.0378229096531868, 0.009907330386340618, -0.026928571984171867, 0.023390239104628563, 0.029330912977457047, -0.028939833864569664, -0.038474708795547485, 0.021211370825767517, -0.002816698746755719, 0.04499268904328346, -0.03888440877199173, -0.042124778032302856, 0.06517980247735977, 0.03800913691520691, 0.0432048998773098, 0.04644526541233063, 0.027375519275665283, -0.008072984404861927, -0.05892254412174225, -0.024935930967330933, -0.048158563673496246, 0.003766461741179228, -0.0311000794172287, -0.07490091025829315, -0.033111341297626495, 0.03357691317796707, 0.07672594487667084, 0.0791841521859169, -0.01200239546597004, -0.026518870145082474, 0.017915135249495506, 0.010270475409924984, -0.011695119552314281, -0.07836475223302841, -0.003549971617758274, -0.04391256719827652, 0.00014250808453653008, 0.03989003971219063, 0.026854079216718674, 0.009427793323993683, -0.02664922922849655, 0.011220238171517849, -0.06558950990438461, -0.039815548807382584, -0.060859315097332, 0.04082117974758148, 0.019442204385995865, -0.06484459340572357, -0.028809474781155586, 0.011359908618032932, -0.03426595404744148, 0.031379420310258865, -0.0004038820043206215, 0.026686474680900574, -0.019796038046479225, 0.003130958415567875, -0.037748418748378754, -0.01859486661851406, -0.008422162383794785, -0.04011351615190506, 0.01713297702372074, 0.00895291194319725, -0.03245954215526581, -0.03750632330775261, -0.045551374554634094, 0.023241257295012474, -0.005279564298689365, -0.020149871706962585, 0.04074668884277344, -0.03078349120914936, 0.050542283803224564, -0.07642798125743866, 0.04905245825648308, -0.011816167272627354, 0.009143795818090439, 0.0007559693767689168, -0.005749789997935295, 0.02005675807595253, 0.060077156871557236, -0.04178956523537636, 0.04074668884277344, 0.041938550770282745, 0.015019289217889309, 0.004266949370503426, 0.03374451771378517, 0.0031379421707242727, -0.012570391409099102, 0.044024303555488586, -0.001972852973267436, -0.04205028712749481, -0.017561301589012146, 0.03836297243833542, -0.06167871877551079, 0.011704430915415287, 0.036221347749233246, -0.015177583321928978, 0.01987052895128727, 0.05706026405096054, 0.024414492771029472, 0.03786015510559082, -0.0643976479768753, -0.002017082180827856, 0.038288481533527374, -0.00901809148490429, -0.0030052545480430126, -0.028418395668268204, 0.02041058987379074, 0.010940896347165108, 0.025624975562095642, 0.012589014135301113, -0.006038443651050329, 0.030671754851937294, -0.04648251459002495, 0.033819008618593216, -0.0674145445227623, 0.034526675939559937, -0.008519931696355343, -0.0017400680808350444, 0.030988341197371483, -0.0005618848372250795, -0.05657607316970825, -0.007989182136952877, 0.054006125777959824, -0.040709443390369415, -0.001414168975315988, -0.01097814179956913, 0.006881125271320343, -0.02679821103811264, -0.09050681442022324, -0.005316809751093388, 0.021211370825767517, -0.0005156188271939754, 0.045178916305303574, 0.010531194508075714, 0.013408416882157326, 0.013873986899852753, 0.0317705012857914, 0.06931407004594803, 0.009544186294078827, -0.0248800627887249, -0.03335343673825264, 0.02836252748966217, 0.010493949055671692, -0.0690905973315239, 0.051957614719867706, -0.07024520635604858, 0.02057819627225399, 0.04540238901972771, 0.030392412096261978, 0.02039196714758873, 0.009851462207734585, -0.028288036584854126, 0.021732809022068977, 0.055235229432582855, 0.02005675807595253, 0.027170667424798012, 0.05251630023121834, 0.09214562177658081, 0.033949367702007294, -0.020336098968982697, -0.010438079945743084, 0.0012197934556752443, -0.004034164361655712, -0.023557843640446663, -0.007477054838091135, -0.016397377476096153, -0.03229193761944771, -0.02573671191930771, -0.00848268624395132, 0.009055336937308311, 0.014041592366993427, -0.0027049619238823652, -0.055421456694602966, -0.007700528483837843, -0.0006314293714240193, 0.03538332134485245, 0.023390239104628563, 0.138553649187088, -0.038083627820014954, 0.01261694822460413, -0.05355917662382126, 0.030671754851937294, 0.036742787808179855, 0.05084024742245674, -0.06544052809476852, -0.07475192844867706, 0.06838292628526688, -0.04368909075856209, -0.06380172073841095, 0.0009485989576205611, 0.00441360380500555, -0.005787035450339317, 0.06491908431053162, 0.0000731090476620011, 0.01817585527896881, -0.08998537808656693, -0.01955394260585308, 0.03281337767839432, 0.02905157022178173, -0.011639251373708248, -0.00942313764244318, 0.0008956403471529484, 0.02677958831191063, 0.018064117059111595, 0.049387671053409576, -0.043987058103084564, -0.0415288470685482, -0.04525340721011162, -0.020280230790376663, 0.0035406602546572685, 0.06689310073852539, -0.03562542051076889, 0.038660936057567596, 0.03717111051082611, -0.02348335273563862, 0.047115687280893326, -0.011229549534618855, -0.002374407136812806, -0.013603956438601017, -0.01495410967618227, 0.08417506515979767, 0.010587062686681747, 0.02782246470451355, 0.013454974628984928, 0.007542234845459461, 0.05106372386217117, -0.0017447237623855472, 0.14868444204330444, 0.029777860268950462, -0.018715916201472282, -0.015596596524119377, 0.041417110711336136, -0.03370727226138115, 0.009255532175302505, -0.025997431948781013, 0.004301866982132196, 0.02299915999174118, 0.045216161757707596, -0.023427484557032585, 0.02093202993273735, -0.007663283031433821, 0.009544186294078827, -0.023725450038909912, -0.009572120383381844, -0.014460605569183826, -0.03687314689159393, 0.002839977154508233, -0.0028935177251696587, -0.026369886472821236, 0.053186722099781036, 0.039815548807382584, 0.07687492668628693, -0.0039363945834338665, 0.05743271857500076, 0.0025024390779435635, 0.021527959033846855, -0.003945705946534872, 0.039480339735746384, -0.04614730179309845, 0.04033698886632919, -0.014935486949980259, -0.03504811227321625, -0.06141800060868263, 0.04443400353193283, 0.02298053726553917, 0.02817629836499691, 0.026239527389407158, 0.01228173729032278, 0.05028156563639641, 0.0010370572563260794, -0.0025839137379080057, 0.011425089091062546, -0.05031881108880043, 0.01106194406747818, -0.06953754276037216, 0.027878334745764732, 0.02664922922849655, -0.008943600580096245, 0.004758125636726618, -0.0033008914906531572, -0.04164058342576027, -0.061939436942338943, -0.060784824192523956, 0.021211370825767517, 0.04082117974758148, -0.05460205301642418, -0.007281515281647444, -0.017263337969779968, -0.023632334545254707, 0.04305591806769371, -0.028418395668268204, -0.02538287825882435, -0.020149871706962585, -0.006215360015630722, 0.051957614719867706, 0.015205517411231995, -0.006038443651050329, 0.0474136546254158, -0.03702212870121002, -0.02197490632534027, 0.025960184633731842, 0.027058931067585945, -0.037413209676742554, 0.006355030927807093, -0.03197535127401352, 0.01894870027899742, -0.002735224086791277, -0.026239527389407158, 0.016564982011914253, -0.022403230890631676, 0.04599831998348236, 0.008487341925501823, -0.03661242872476578, 0.0011429744772613049, -0.020689932629466057, 0.023818563669919968, -0.05016982927918434, -0.019609810784459114, 0.02540150098502636, -0.05605463311076164, 0.040858425199985504, 0.05151066929101944, -0.005312154069542885, 0.0062758843414485455, -0.021695563569664955, 0.04514167085289955, 0.0012407441390678287, 0.02664922922849655, -0.05944398418068886, -0.013408416882157326, 0.003605840029194951, 0.0035406602546572685, 0.016080789268016815, -0.02024298533797264, -0.014888930134475231, 0.03635171055793762, -0.01788720116019249, -0.014237131923437119, -0.005777724087238312, 0.059741947799921036, 0.020280230790376663, 0.009804905392229557, -0.0240420363843441, -0.021881792694330215, 0.003382366383448243, 0.03538332134485245, -0.00579169113188982, 0.015857314690947533, 0.01736576296389103, 0.0008007804863154888, -0.01123886089771986, -0.06730280816555023, 0.03162151575088501, 0.051436178386211395, 0.015047223307192326, 0.002326686168089509, -0.024340001866221428, -0.015149649232625961, -0.026388509199023247, -0.020298853516578674, 0.047450900077819824, 0.009590743109583855, -0.001432791817933321, 0.019004568457603455, 0.019926397129893303, -0.002690994879230857, 0.0611945278942585, -0.01878109574317932, -0.04633352905511856, -0.008035738952457905, 0.0011842937674373388, 0.009502284228801727, -0.03111870214343071, 0.06227464973926544, -0.0364820696413517, 0.011508891358971596, -0.01803618296980858, 0.021527959033846855, -0.004935042466968298, 0.07099012285470963, 0.044843707233667374, 0.05758170410990715, 0.05117546021938324, -0.008231278508901596, -0.020876159891486168, -0.01165787409991026, -0.041230883449316025, -0.04257172346115112, -0.002970336936414242, -0.04990910738706589, -0.03843746334314346, 0.009343991056084633, -0.01097814179956913, -0.02681683376431465, 0.011490268632769585, 0.009963198564946651, -0.012309672310948372, 0.038809917867183685, -0.05910877138376236, 0.04905245825648308, 0.03158427029848099, -0.030466903001070023, -0.023371616378426552, 0.009376580826938152, 0.0073979077860713005, -0.026239527389407158, -0.03940584883093834, -0.006322441156953573, -0.009730413556098938, 0.03549506142735481, -0.007542234845459461, 0.006392276845872402, -0.022086642682552338, -0.04048597067594528, -0.01778477616608143, 0.06335476785898209, -0.034638412296772, 0.04905245825648308, 0.019572565332055092, -0.009078615345060825, -0.00854786578565836, -0.05098922923207283, 0.050877492874860764, 0.07192125916481018, -0.009097239002585411, -0.000056632230553077534, 0.012775242328643799, -0.004381014034152031, 0.031044211238622665, 0.02681683376431465, -0.05672505497932434, -0.061604227870702744, 0.016434622928500175, 0.018855586647987366, 0.006196737289428711, -0.00033957514096982777, -0.00856648851186037, 0.000792632985394448, -0.05773068591952324, 0.015196206048130989, 0.10398972779512405, -0.005246974527835846, -0.004250654485076666, -0.0726289227604866, 0.021304484456777573, -0.009311400353908539, 0.04700395092368126, -0.07542234659194946, -0.025960184633731842, 0.024693835526704788, 0.054676543921232224, -0.05415510758757591, -0.039666566997766495, 0.04722742363810539, 0.02573671191930771, 0.05113821476697922, 0.03730147331953049, 0.0027817809022963047, -0.0076074143871665, -0.02525251917541027, -0.011639251373708248, 0.023986168205738068, -0.038474708795547485, -0.09408239275217056, 0.00812885258346796, -0.032087087631225586, -0.003163548419252038, -0.03352104127407074, 0.018650736659765244, 0.0007396743749268353, 0.008184721693396568, -0.036221347749233246, -0.00799383781850338, -0.052143845707178116, 0.0622001588344574, -0.0019519024062901735, -0.01296146959066391, 0.025885693728923798, 0.03625859320163727, 0.05657607316970825, -0.07460294663906097, 0.033092718571424484, 0.03955483064055443, -0.01571764424443245, -0.057320982217788696, 0.031751878559589386, 0.036388956010341644, 0.007407219149172306, -0.032776132225990295, -0.01824103482067585, 0.0216024499386549, -0.034154217690229416, 0.04722742363810539, 0.037096619606018066, -0.04011351615190506, -0.032217446714639664, -0.011648562736809254, 0.024284133687615395, 0.029777860268950462, 0.06558950990438461, -0.02435862459242344, -0.02316676452755928, -0.014227820560336113, -0.05184587836265564, 0.06704208254814148, -0.039852794259786606, 0.004017869476228952, 0.042757950723171234, -0.011816167272627354, -0.05236731842160225, -0.010093558579683304, -0.006010509096086025, -0.0019100010395050049, 0.0016015609726309776, -0.008212655782699585, 0.06760077178478241, 0.02227286994457245, 0.004453177563846111, -0.01684432476758957, -0.0107174227014184, 0.020596818998456, -0.05583116039633751, 0.007700528483837843, -0.03393074497580528, -0.021211370825767517, -0.05568217858672142, 0.0090367142111063, 0.0311000794172287, -0.06402519345283508, -0.018771784380078316, -0.01736576296389103, -0.011136434972286224, 0.04543963447213173, 0.006694897077977657, 0.02577395737171173, -0.07199575006961823, -0.01730058342218399, 0.027170667424798012, 0.00506074633449316, -0.063876211643219, -0.1092785969376564, 0.014423360116779804, 0.02041058987379074, -0.07732187211513519, 0.013250123709440231, -0.01477719284594059, 0.02439587004482746, 0.021304484456777573, 0.07613001018762589, -0.04197579622268677, -0.06324303150177002, -0.06104554235935211, 0.02435862459242344, -0.032068464905023575, -0.05117546021938324, 0.02646300196647644, 0.030392412096261978, -0.04845653101801872, 0.00812885258346796, 0.01202101819217205, 0.026760965585708618, 0.011443711817264557, -0.018790407106280327, -0.0033521042205393314, 0.026332641020417213, 0.016127346083521843, -0.03711524233222008, -0.0011965150479227304, -0.03322307765483856, -0.01803618296980858, -0.025122160091996193, 0.012486588209867477, -0.022533589974045753, -0.041193637996912, 0.0077796755358576775, 0.08693123608827591, -0.012384163215756416, -0.03523433953523636, -0.002121835481375456, 0.022384608164429665, 0.0438753217458725, -0.060449615120887756, -0.014749258756637573, -0.009814216755330563, -0.10197845846414566, -0.005018845200538635, -0.0445457398891449, 0.011173681356012821, -0.011248172260820866, -0.02456347458064556, -0.06957478821277618, -0.0022801293525844812, 0.003356759902089834, 0.014469916932284832, 0.0021346386056393385, 0.0354764387011528, 0.013101140968501568, -0.015401056967675686, 0.022514967247843742, 0.004325145855545998, -0.011182992719113827, -0.0094557274132967, -0.0029051571618765593, -0.06402519345283508, 0.03419146314263344, 0.06633441895246506, 0.006815945263952017, -0.007793642580509186, 0.020187117159366608, -0.02784108929336071, 0.02262670360505581, -0.014646833762526512, 0.010009756311774254, 0.04268345981836319, 0.03661242872476578, 0.06361549347639084, -0.009032058529555798, -0.046408019959926605, -0.0281576756387949, 0.02473108097910881, 0.02610916830599308, 0.004201769828796387, 0.015205517411231995, -0.04577484726905823, -0.0322733148932457, -0.019041813910007477, -0.009786282666027546, -0.0348060168325901, -0.024973176419734955, -0.022533589974045753, 0.022868800908327103, 0.027263781055808067, 0.025029044598340988, -0.06413692981004715, -0.0563153512775898, 0.01842726208269596, 0.003075090004131198, 0.03374451771378517, 0.015680398792028427, -0.0207644235342741, -0.03786015510559082, 0.0008106738096103072, 0.03512260317802429, -0.04234825074672699, 0.06097105145454407, 0.022533589974045753, -0.0013059239136055112, -0.026183659210801125, -0.04063495248556137, 0.01617390289902687, 0.022757062688469887, -0.002430275548249483, 0.010344966314733028, -0.07087838649749756, -0.055942896753549576, 0.0064900461584329605, -0.002474504755809903, -0.022012151777744293, -0.005372678395360708, -0.07821577042341232, 0.10182947665452957, -0.007123221643269062, 0.012803176417946815, 0.00661575049161911, -0.014022969640791416, 0.002916796365752816, -0.06376447528600693, 0.03543919324874878, 0.027561746537685394, 0.028492886573076248, -0.09505078196525574, 0.005191105883568525, 0.03460116684436798, 0.04525340721011162, -0.017328517511487007, -0.05165965110063553, 0.002296424238011241, -0.016620850190520287, -0.01711435429751873, 0.00895291194319725, -0.012765930965542793, 0.0064062438905239105, -0.02350197546184063, -0.051920369267463684, -0.0014991355128586292, 0.023632334545254707, -0.0354764387011528, 0.023259880021214485, 0.023632334545254707, -0.02836252748966217, -0.011611316353082657, 0.0027445354498922825, -0.04357735440135002, 0.0035895449109375477, 0.005149204749614, 0.06275884062051773, 0.035513684153556824, 0.014907552860677242, 0.02988959662616253, -0.04015076160430908, 0.002686339197680354, 0.00874340534210205, 0.07356006652116776, -0.014144018292427063, -0.03074624575674534, 0.05877356231212616, -0.0038875099271535873, -0.01020529493689537, -0.03884716331958771, 0.022794310003519058, 0.057991404086351395, 0.026332641020417213, -0.038325726985931396, 0.026556115597486496, -0.027058931067585945, -0.061306264251470566, -0.03787877783179283, 0.0014898241497576237, -0.029628876596689224, 0.06227464973926544, 0.022868800908327103, 0.008552521467208862, 0.03383763134479523, 0.02867911383509636, -0.00600119773298502 ]
717,227
pytorch_optimizer.optimizer.msvag
__str__
null
def __str__(self) -> str: return 'MSVAG'
(self) -> str
[ 0.035677213221788406, -0.013638286851346493, -0.0032416440080851316, -0.012073795311152935, -0.002176684094592929, -0.058328334242105484, 0.01667374186217785, 0.013408714905381203, 0.056797854602336884, -0.04588042199611664, -0.05499528720974922, -0.006870159413665533, 0.019318072125315666, -0.034928981214761734, -0.027242563664913177, 0.016401655972003937, -0.012481923215091228, -0.06305582076311111, 0.02428363263607025, 0.041935183107852936, 0.010713367722928524, 0.006500293500721455, -0.0352010652422905, -0.025729088112711906, 0.009999142959713936, 0.047614965587854385, -0.028398927301168442, -0.03304138779640198, -0.020678499713540077, -0.019930263981223106, -0.04023464769124985, -0.05591357499361038, -0.050233788788318634, -0.014718126505613327, -0.0269024558365345, -0.008817271329462528, -0.019590158015489578, -0.033228445798158646, -0.06264769285917282, 0.01588299311697483, 0.029572295024991035, -0.0038134485948830843, -0.004591443110257387, -0.015406843274831772, 0.02338235080242157, -0.05424705147743225, 0.004574438091367483, 0.0047444915398955345, 0.02826288342475891, -0.02751464955508709, 0.03470791131258011, 0.029419247061014175, -0.02844994328916073, -0.020287377759814262, -0.038568124175071716, 0.05237646400928497, 0.05431507155299187, 0.013859356753528118, -0.0022935960441827774, 0.038874220103025436, -0.03361956775188446, 0.013825345784425735, 0.03198705613613129, -0.021188659593462944, -0.020831547677516937, 0.024504702538251877, 0.020219355821609497, 0.026868445798754692, 0.018994970247149467, 0.027310585603117943, 0.013561762869358063, -0.032769300043582916, -0.0019237296655774117, 0.05638972669839859, 0.014182457700371742, -0.013043100014328957, -0.08829175680875778, -0.014190960675477982, 0.012549945153295994, -0.05638972669839859, 0.03833004832267761, -0.015406843274831772, 0.000511223217472434, -0.010432779788970947, -0.009931121952831745, -0.06349796056747437, -0.042275287210941315, -0.05836234614253044, -0.03877218812704086, -0.01322165597230196, -0.0004368248046375811, 0.0013412965927273035, -0.034622881561517715, 0.0822378471493721, -0.040132615715265274, -0.030677642673254013, -0.0010091610020026565, -0.034316785633563995, -0.04911143705248833, 0.00909786019474268, 0.028347911313176155, -0.019828232005238533, -0.03419775143265724, 0.027293579652905464, -0.05649175867438316, -0.012456415221095085, -0.024028552696108818, 0.005526737309992313, 0.005246148910373449, 0.00038740303716622293, -0.03144288435578346, 0.018688874319195747, 0.03870416432619095, -0.07257881760597229, -0.0010713367955759168, -0.016282618045806885, 0.03162994235754013, 0.014309998601675034, -0.006126175634562969, -0.03222512826323509, 0.04540427401661873, -0.014981709420681, -0.008562191389501095, 0.01724342070519924, 0.010781388729810715, 0.036323416978120804, -0.029249193146824837, -0.004240707959979773, 0.01053481176495552, -0.01652069389820099, 0.06652490794658661, 0.004519170615822077, -0.04268341511487961, -0.04584641009569168, 0.06220555305480957, -0.045166198164224625, 0.07638800889253616, 0.004038769751787186, 0.02703849971294403, 0.09074052423238754, -0.019131014123558998, 0.01520277839154005, 0.01620609499514103, 0.01337470393627882, -0.010084169916808605, 0.04152705520391464, 0.0002787282282952219, 0.08978822082281113, -0.025610050186514854, -0.009216897189617157, 0.01724342070519924, -0.0017494249623268843, 0.013876361772418022, -0.005624517798423767, 0.028398927301168442, -0.018314756453037262, -0.013366201892495155, -0.014395024627447128, 0.01773657463490963, -0.03802395239472389, 0.0009214771562255919, 0.009956629946827888, -0.029385237023234367, 0.0013869984541088343, 0.01634213700890541, 0.030201492831110954, 0.016444168984889984, 0.04176512733101845, -0.04050673171877861, 0.007677913643419743, -0.025899140164256096, -0.018977966159582138, -0.07706822454929352, 0.04251336306333542, 0.029538284987211227, 0.05489325523376465, -0.004438395146280527, 0.11379977315664291, 0.0562196709215641, 0.013995399698615074, -0.002457272494211793, 0.02474277839064598, -0.05917860195040703, 0.0058923522010445595, 0.006819143425673246, -0.07108234614133835, 0.016418660059571266, -0.008715239353477955, 0.019811227917671204, -0.02416459657251835, 0.0335855558514595, 0.002093783114105463, 0.0033139167353510857, -0.04071079567074776, 0.04207122325897217, -0.041220955550670624, -0.020865559577941895, -0.03839806839823723, -0.020151333883404732, -0.0017781214555725455, 0.024827804416418076, 0.03897625207901001, -0.03229315206408501, 0.015185773372650146, 0.07183057814836502, 0.013425719924271107, 0.05349881574511528, -0.04006459191441536, 0.013774329796433449, -0.0296403169631958, 0.04339764267206192, 0.015585399232804775, -0.002929170848801732, 0.035371117293834686, 0.014607591554522514, -0.042411331087350845, -0.0007732118247076869, 0.00565002579241991, -0.007660908158868551, 0.011257538571953773, 0.055403415113687515, -0.03117079846560955, -0.049315501004457474, -0.014054917730391026, -0.010560319758951664, -0.011640158481895924, 0.026086200028657913, -0.01754951663315296, -0.04628854990005493, -0.021273687481880188, -0.004021764267235994, -0.0730549618601799, -0.0452682301402092, -0.008209330029785633, -0.02401154860854149, 0.07965303957462311, -0.00869823433458805, -0.0032203872688114643, -0.03120480850338936, -0.0483291931450367, 0.0027314836625009775, 0.012439410202205181, 0.003190628020092845, 0.0651644840836525, 0.026851439848542213, -0.07060619443655014, -0.02401154860854149, 0.01851882040500641, -0.003953742794692516, 0.026477321982383728, 0.047274861484766006, -0.060743093490600586, -0.03652748093008995, 0.01892695017158985, -0.011504116468131542, -0.07149047404527664, -0.016384650021791458, 0.04023464769124985, 0.019454116001725197, -0.01588299311697483, -0.07203464210033417, -0.02598416805267334, -0.061525341123342514, 0.057750154286623, -0.0008725867955945432, 0.0461525060236454, 0.025916146114468575, -0.013825345784425735, -0.00024166189541574568, 0.0008167880005203187, 0.06904169917106628, -0.0367315448820591, -0.06897368282079697, 0.008426148444414139, -0.03162994235754013, 0.015491869300603867, -0.027446627616882324, -0.029436253011226654, -0.09910715371370316, -0.04322758689522743, -0.01986224390566349, -0.03717368468642235, 0.014386522583663464, 0.05458715930581093, -0.0304055567830801, -0.011665666475892067, 0.018416788429021835, -0.05713795870542526, 0.0048295180313289165, 0.014922190457582474, 0.04482609033584595, 0.034316785633563995, -0.01667374186217785, 0.01743047870695591, 0.06053902953863144, 0.030609622597694397, 0.08829175680875778, 0.05278459191322327, -0.03911229595541954, 0.0422072671353817, 0.008171068504452705, -0.023110264912247658, 0.007052966859191656, 0.00019928139226976782, -0.0645182803273201, 0.03380662575364113, 0.023722456768155098, -0.023909514769911766, 0.03897625207901001, -0.015143260359764099, -0.08087742328643799, 0.08080939948558807, -0.0008135995012708008, 0.038738176226615906, -0.0072060152888298035, 0.07584384083747864, -0.02278716303408146, 0.019675184041261673, 0.04084683954715729, 0.031408872455358505, -0.029759354889392853, 0.01459058653563261, -0.004574438091367483, -0.019011976197361946, 0.008192325010895729, 0.006916924379765987, -0.07625196874141693, 0.015321816317737103, 0.0310517605394125, 0.007074223831295967, -0.0627497211098671, -0.03986052796244621, 0.06132127717137337, 0.025099890306591988, -0.01146160252392292, 0.00971005205065012, 0.02567807212471962, -0.02219197526574135, -0.04292149096727371, 0.016750264912843704, 0.08285004645586014, 0.026086200028657913, -0.019148018211126328, 0.01955614797770977, 0.03496298938989639, 0.03703764081001282, -0.019182030111551285, -0.009335934184491634, 0.008277351967990398, 0.036017321050167084, -0.03577924519777298, 0.00493155000731349, 0.023433366790413857, 0.030490584671497345, 0.046254537999629974, -0.020746521651744843, 0.02890908718109131, 0.05564149096608162, -0.01529630832374096, 0.04145903140306473, -0.03195304423570633, -0.03594930097460747, 0.015610907226800919, -0.01591700315475464, 0.00382407708093524, -0.03404470160603523, -0.013281174935400486, -0.002572058467194438, 0.01091743167489767, -0.03225914016366005, -0.024844810366630554, 0.023331332951784134, 0.009905613958835602, 0.0072825392708182335, -0.04047272354364395, 0.08169367909431458, 0.036595504730939865, -0.02214095927774906, -0.035983309149742126, -0.027157535776495934, 0.03577924519777298, 0.009880105964839458, 0.004978314973413944, 0.04020063579082489, 0.05166224017739296, 0.0022149463184177876, 0.034010689705610275, 0.000057525896409060806, -0.0036837828811258078, -0.03489496931433678, 0.004804010037332773, -0.020304381847381592, -0.02219197526574135, -0.011189517565071583, -0.03948641195893288, -0.08244191110134125, -0.018399784341454506, -0.047751009464263916, -0.003855962073430419, 0.026069194078445435, 0.0033606814686208963, -0.0048975395038723946, -0.03958844393491745, -0.024640744552016258, -0.030354540795087814, -0.02719154767692089, -0.0028420183807611465, -0.01521978434175253, -0.04955357685685158, -0.03656149283051491, 0.010645345784723759, -0.019828232005238533, -0.06679699569940567, -0.06186544522643089, 0.04268341511487961, -0.013731816783547401, 0.004255587700754404, -0.004731737542897463, -0.010806896723806858, -0.011674169450998306, -0.02797379344701767, 0.06530052423477173, 0.003445708192884922, 0.05329475179314613, 0.02936823107302189, -0.008485667407512665, -0.0010043781949207187, 0.06087913736701012, 0.051628228276968, 0.005297164898365736, 0.02152876742184162, 0.052478495985269547, -0.014573580585420132, -0.015066736377775669, 0.02795678749680519, -0.032344166189432144, -0.02232801914215088, -0.03428277745842934, -0.029980424791574478, 0.055097319185733795, 0.004629705101251602, -0.04809111729264259, 0.017498500645160675, -0.004295975435525179, 0.020678499713540077, -0.059518709778785706, -0.037989940494298935, -0.03683357685804367, 0.02659635990858078, -0.028790049254894257, -0.024385664612054825, 0.08305411040782928, -0.04676470160484314, -0.05016576871275902, 0.04050673171877861, -0.011325559578835964, 0.018841922283172607, -0.026783419772982597, -0.025746092200279236, -0.026528337970376015, -0.06941582262516022, 0.0553353950381279, -0.07652405649423599, 0.02782074548304081, 0.012337378226220608, 0.026324274018406868, 0.022957216948270798, -0.015951013192534447, -0.05353282764554024, 0.001762178959324956, 0.01850181631743908, -0.02215796522796154, -0.0059986356645822525, -0.013247163966298103, -0.02324630692601204, 0.03241218999028206, -0.049927692860364914, -0.02674940787255764, -0.005382191855460405, -0.010262725874781609, -0.0017728072125464678, 0.0036922856234014034, 0.02430063858628273, 0.07461945712566376, -0.007142244838178158, 0.07815656810998917, 0.010721870698034763, 0.01345122791826725, -0.07264683395624161, -0.04741090163588524, 0.03557518124580383, 0.005781817249953747, -0.08672726154327393, 0.018756896257400513, 0.024215612560510635, 0.04642459377646446, 0.022259997203946114, -0.005879598204046488, -0.06951785087585449, 0.033262453973293304, 0.007469597738236189, -0.0032501467503607273, -0.043465662747621536, -0.0333474837243557, 0.01665673591196537, -0.02600117400288582, 0.06591271609067917, 0.006819143425673246, -0.0021501134615391493, -0.049757640808820724, -0.00048412091564387083, -0.06972191482782364, 0.01252443715929985, 0.048669297248125076, -0.00227233930490911, 0.02768470160663128, -0.026953471824526787, -0.020525451749563217, -0.011342565529048443, 0.06785132735967636, -0.015270800329744816, -0.07155849039554596, -0.03945240005850792, -0.0757078006863594, -0.018450800329446793, -0.00622395658865571, -0.04880534112453461, 0.023501386865973473, -0.023195290938019753, 0.07666009664535522, 0.01467561349272728, 0.028977109119296074, 0.0031821252778172493, 0.07101432234048843, 0.018076682463288307, 0.08244191110134125, -0.07904084771871567, -0.0011425466509535909, -0.018382778391242027, 0.024096574634313583, -0.012014276348054409, -0.05972277373075485, -0.014769142493605614, -0.0016346388729289174, 0.015160265378654003, -0.0022191975731402636, 0.008349624462425709, -0.0019704943988472223, 0.06795336306095123, 0.001094719162210822, -0.03669753670692444, 0.001325354096479714, -0.02782074548304081, -0.013255666941404343, 0.017464490607380867, 0.07135442644357681, -0.026545343920588493, 0.014097431674599648, 0.05574352294206619, -0.01114700362086296, -0.02521892637014389, 0.0004182252159807831, 0.08298608660697937, 0.04934951290488243, -0.03327945992350578, 0.05057389661669731, -0.021596789360046387, 0.05611763894557953, 0.034469835460186005, -0.012813528068363667, 0.01896096020936966, -0.12223441898822784, 0.017702564597129822, 0.008570694364607334, -0.07516362518072128, 0.07081025838851929, 0.028228873386979103, 0.05516533926129341, -0.005054838955402374, 0.0354391410946846, -0.0288750771433115, 0.027616681531071663, 0.02401154860854149, 0.0005247743101790547, -0.03557518124580383, 0.05200234800577164, -0.00917438417673111, -0.003709290875121951, 0.05700191855430603, -0.017804596573114395, -0.08067335933446884, -0.029980424791574478, 0.009829089976847172, 0.01315363496541977, 0.01694582588970661, -0.04982566088438034, 0.007728929631412029, -0.0001578308583702892, -0.0073293037712574005, -0.023042242974042892, 0.06325988471508026, 0.05101603642106056, 0.030983738601207733, 0.04734288156032562, 0.04523421823978424, 0.04543828219175339, 0.02290620096027851, 0.037683844566345215, -0.023739462718367577, 0.029538284987211227, -0.03225914016366005, -0.0010176636278629303, 0.004183314740657806, 0.012073795311152935, 0.01819572038948536, 0.010968447662889957, 0.014641602523624897, -0.024827804416418076, -0.01836577244102955, 0.0173964686691761, 0.0059603736735880375, 0.02309325896203518, -0.07223870605230331, 0.025320960208773613, -0.005535239819437265, 0.05336277559399605, 0.0035477401688694954, -0.005233394913375378, 0.02661336585879326, -0.0944816991686821, 0.025150906294584274, -0.013969890773296356, -0.02630726993083954, -0.06482437998056412, -0.03312641382217407, -0.01384235080331564, 0.00007180772809078917, 0.034316785633563995, 0.0007615206413902342, 0.02904512919485569, -0.0038070715963840485, 0.01443753857165575, -0.027242563664913177, 0.03758181259036064, -0.051118068397045135, 0.023161280900239944, -0.0721706822514534, -0.026630371809005737, -0.025252938270568848, -0.007448341231793165, 0.03605133295059204, -0.04666266590356827, -0.026817429810762405, 0.00971005205065012, -0.004329985938966274, 0.012941068038344383, -0.010432779788970947, -0.003120480803772807, -0.01084941066801548, -0.004710480570793152, -0.054213039577007294, -0.024963846430182457, -0.023484382778406143, -0.02261710911989212, 0.07101432234048843, 0.01712438277900219, 0.02290620096027851, -0.030014434829354286, -0.0038410823326557875, -0.005739304237067699, -0.004338488914072514, 0.0029142911080271006, 0.014862671494483948, -0.029402242973446846, -0.05033582076430321, 0.013961388729512691, 0.06530052423477173, 0.06128726527094841, 0.09033239632844925, -0.019930263981223106, 0.046220529824495316, 0.019165024161338806, 0.020882563665509224, -0.06591271609067917, 0.00954850111156702, 0.027395611628890038, -0.11359570920467377, 0.011027966625988483, 0.05179828032851219, -0.03972448781132698, -0.04666266590356827, -0.05536940321326256, -0.033262453973293304, 0.009820587001740932, 0.043771758675575256, 0.030813686549663544, -0.00630048057064414, -0.02305924892425537, -0.01436101458966732, 0.0009034089744091034, 0.02523593232035637, 0.02753165364265442, -0.0012562698684632778, 0.023331332951784134, 0.012260854244232178, -0.03526908531785011, -0.008298608474433422, 0.00638125604018569, 0.006976442877203226, -0.0035201064310967922, 0.04894138500094414, 0.042581383138895035, -0.05747806653380394, 0.00780120212584734, 0.08434651046991348, -0.06608277559280396, -0.042581383138895035, 0.04200320318341255, 0.01116400957107544, 0.01911400817334652, -0.018705880269408226, 0.00684465141966939, -0.012303367257118225, 0.019199034199118614, 0.026698391884565353, 0.06972191482782364, 0.01744748465716839, 0.05397496744990349, -0.030660638585686684, -0.017464490607380867, 0.008103047497570515, 0.02265111915767193, -0.015007217414677143, -0.019658179953694344, 0.030983738601207733, 0.02630726993083954, -0.03198705613613129, 0.041493043303489685, 0.07189860194921494, 0.06723913550376892, 0.010985452681779861, 0.020236361771821976, 0.01926705613732338, -0.03713967278599739, 0.007733180653303862, 0.021902885288000107, 0.012005774304270744, 0.03727571666240692, -0.03557518124580383, -0.005607512779533863, 0.058770474046468735, 0.002501911483705044, 0.01267748512327671, -0.018246736377477646, -0.008230587467551231, -0.016401655972003937, -0.01275400910526514, 0.02890908718109131, 0.0219879113137722, -0.013434222899377346, 0.004918796010315418, -0.043023522943258286, -0.019318072125315666, -0.030983738601207733, 0.0013646789593622088, 0.05394095554947853, 0.018603848293423653, 0.009301924146711826 ]
717,240
pytorch_optimizer.optimizer.msvag
get_rho
Get rho.
@staticmethod def get_rho(beta_power: float, beta: float) -> float: r"""Get rho.""" rho: float = (1.0 - beta_power ** 2) * (1.0 - beta) ** 2 # fmt: skip rho /= (1.0 - beta) * (1.0 - beta_power) ** 2 return min(rho, 0.9999)
(beta_power: float, beta: float) -> float
[ 0.039498135447502136, -0.026695793494582176, -0.014029840007424355, -0.00499182241037488, 0.033424295485019684, -0.01473905984312296, -0.008083296939730644, 0.012102214619517326, -0.036915846168994904, 0.02478635311126709, 0.03402440622448921, -0.003993912599980831, -0.007001280784606934, 0.001677579595707357, -0.0645572692155838, -0.03091474622488022, 0.03051467426121235, 0.04218953847885132, -0.018985291942954063, 0.0225495807826519, -0.028241530060768127, 0.03613388538360596, -0.03420625999569893, 0.05070018395781517, -0.052482329308986664, 0.02551375888288021, 0.09230779856443405, 0.013393359258770943, -0.05266417935490608, -0.011083845980465412, 0.04549923166632652, -0.015320984646677971, 0.058847129344940186, 0.021349361166357994, 0.013284248299896717, -0.0110565684735775, 0.0470995269715786, 0.06488459557294846, -0.1373342126607895, -0.0074149928987026215, -0.0220040250569582, -0.009015285409986973, 0.04186220467090607, -0.04397168010473251, -0.033224258571863174, -0.07710501551628113, 0.008724323473870754, -0.0053373402915894985, -0.05091840773820877, -0.019803622737526894, 0.05313699319958687, 0.014930004253983498, 0.005805607419461012, -0.002364068990573287, -0.04197131469845772, 0.033769816160202026, 0.028859825804829597, 0.0007717321277596056, -0.0012195413000881672, 0.019330808892846107, -0.009510830976068974, -0.04360798001289368, -0.06055653467774391, -0.06313882768154144, -0.0066875871270895, -0.037352290004491806, -0.010274606756865978, -0.008096936158835888, 0.039898209273815155, 0.05582839623093605, -0.022913282737135887, 0.03289692848920822, 0.02787782810628414, -0.040225543081760406, -0.004321245010942221, -0.012274973094463348, -0.007883260026574135, -0.042880572378635406, 0.023804355412721634, -0.03102385811507702, 0.009819978848099709, 0.014375356957316399, 0.03924354165792465, -0.037643250077962875, -0.005191858857870102, -0.05008189007639885, 0.03167852386832237, -0.01954903081059456, 0.016412094235420227, 0.04433538392186165, -0.07499554008245468, -0.01638481579720974, 0.021749433130025864, 0.0026300265453755856, 0.002411804860457778, -0.0004730979271698743, 0.03247866779565811, 0.019021661952137947, 0.0528460331261158, -0.05026374012231827, -0.020549213513731956, 0.030860191211104393, -0.022094951942563057, 0.0687762200832367, -0.019439920783042908, -0.010992920026183128, 0.019403550773859024, -0.002750503132119775, 0.05008189007639885, -0.010829254053533077, -0.049536336213350296, 0.0011070207692682743, -0.02447720617055893, -0.02374980039894581, -0.037861473858356476, -0.012420454062521458, -0.05000915005803108, 0.053318846970796585, 0.0740862786769867, -0.010929272510111332, -0.03173307701945305, 0.048918042331933975, -0.04008005931973457, 0.021640323102474213, 0.05211862549185753, 0.06052016466856003, 0.030587414279580116, -0.0037643250543624163, -0.05448269471526146, 0.053937140852212906, 0.04546286165714264, 0.03444266691803932, 0.004250777885317802, 0.009465368464589119, 0.038370657712221146, 0.009819978848099709, 0.013475192710757256, 0.040916576981544495, 0.07095843553543091, -0.02724134735763073, 0.02336791157722473, -0.013675229623913765, -0.04535375162959099, -0.06804881244897842, -0.021531211212277412, 0.03327881544828415, 0.05419173464179039, 0.006896716542541981, -0.002770961495116353, -0.013247878290712833, 0.04397168010473251, 0.001565059064887464, 0.04764508083462715, 0.02120387926697731, 0.032605964690446854, -0.03398803621530533, 0.03356977924704552, -0.04473545774817467, 0.033933479338884354, -0.028114235028624535, 0.02489546313881874, 0.051973145455121994, -0.003873436013236642, -0.0530642531812191, -0.02827790006995201, 0.01316604483872652, -0.0012604579096660018, -0.014784523285925388, 0.007705955300480127, -0.011593029834330082, -0.016612129285931587, 0.009865441359579563, -0.045317381620407104, 0.00714676221832633, 0.004673582501709461, 0.06375712156295776, 0.002516369568184018, -0.015902910381555557, 0.00258683692663908, 0.0450991615653038, 0.009015285409986973, -0.05499187856912613, -0.03433355316519737, 0.029678156599402428, 0.06022920086979866, 0.0417894646525383, 0.02664123848080635, -0.040698353201150894, -0.02118569426238537, -0.0210038423538208, -0.018521569669246674, 0.015348262153565884, 0.02365887351334095, 0.023513393476605415, 0.01744864694774151, -0.015557391569018364, 0.05211862549185753, -0.00248227221891284, 0.002001502551138401, -0.03142393007874489, 0.02396802231669426, -0.00001307057300437009, -0.0358247347176075, 0.010929272510111332, 0.02222224697470665, -0.02058558352291584, 0.015266429632902145, 0.006487550679594278, -0.03909806162118912, 0.011702140793204308, -0.0700855478644371, 0.017485016956925392, -0.00589198712259531, -0.0038688897620886564, -0.0195672158151865, -0.07659583538770676, 0.05266417935490608, -0.018230607733130455, 0.034970033913850784, 0.03380618616938591, 0.03946176543831825, -0.0692126601934433, 0.08576114475727081, 0.016302982345223427, 0.012865990400314331, -0.002217451110482216, -0.013375174254179, 0.022404098883271217, -0.04640848934650421, -0.04458997771143913, -0.031296633183956146, -0.011320252902805805, 0.011347530409693718, -0.03575199469923973, -0.026568496599793434, 0.05375529080629349, -0.037861473858356476, 0.045208271592855453, -0.000004999139036954148, -0.004630392417311668, -0.04386257007718086, 0.007478640880435705, 0.03020552545785904, 0.08372440934181213, -0.049099892377853394, -0.01587563194334507, 0.02653212659060955, 0.04495367780327797, -0.022258616983890533, -0.033242445439100266, -0.030587414279580116, -0.0386979877948761, 0.04095294699072838, 0.026786718517541885, -0.010465551167726517, 0.019730882719159126, 0.0353701077401638, 0.0417894646525383, 0.019585400819778442, -0.018712515011429787, -0.024859093129634857, -0.05830157548189163, 0.02109476923942566, 0.00027377167134545743, -0.030260082334280014, -0.017875997349619865, -0.029550861567258835, 0.04120754078030586, 0.03286055848002434, 0.04084383696317673, 0.10445547103881836, 0.0422259084880352, -0.029550861567258835, -0.05390077084302902, 0.037643250077962875, -0.05910172313451767, 0.06648489087820053, 0.01429352443665266, 0.06066564470529556, 0.03124208003282547, -0.05626484006643295, -0.03924354165792465, 0.018012385815382004, 0.00992908887565136, -0.029987305402755737, -0.0029278083238750696, 0.026041127741336823, -0.02715042233467102, 0.01947629079222679, -0.0020935649517923594, 0.008874351158738136, -0.028241530060768127, -0.009083479642868042, 0.025950202718377113, 0.08743418008089066, 0.007633214816451073, 0.011411178857088089, -0.047063156962394714, 0.02149484120309353, 0.02991456352174282, 0.0139298215508461, -0.0022549580316990614, 0.0010848576202988625, -0.008583388291299343, -0.05724683776497841, -0.014975466765463352, 0.07284969091415405, -0.028641603887081146, 0.033042408525943756, 0.015621040016412735, -0.049827296286821365, 0.028205160051584244, 0.036934029310941696, 0.04484456777572632, -0.015220966190099716, -0.06724866479635239, 0.016066575422883034, -0.003307423321530223, 0.027695976197719574, 0.04968181625008583, 0.0024049854837358, 0.04258960857987404, 0.06273875385522842, 0.056483060121536255, -0.061938606202602386, -0.062229566276073456, -0.06255690008401871, 0.017384998500347137, 0.011820344254374504, -0.0030210071709007025, -0.06852162629365921, -0.0205673985183239, 0.028441566973924637, 0.039279915392398834, 0.003121025627478957, -0.03746140003204346, 0.048081524670124054, -0.013893450610339642, -0.03002367541193962, -0.059574536979198456, 0.006128394044935703, -0.014429912902414799, 0.035806551575660706, 0.03155122697353363, 0.01777597889304161, -0.017875997349619865, 0.051682181656360626, -0.06481185555458069, -0.006692133378237486, 0.006146579049527645, 0.015393725596368313, 0.0021458470728248358, -0.02396802231669426, 0.00267776264809072, -0.006996734533458948, 0.00921077560633421, -0.015639225021004677, -0.00433943048119545, 0.023731615394353867, 0.021240249276161194, -0.08852528780698776, 0.055355582386255264, -0.047354117035865784, 0.022585950791835785, 0.0039689079858362675, -0.034460850059986115, -0.050336483865976334, 0.04273509234189987, 0.028532491996884346, -0.041934944689273834, -0.026695793494582176, 0.02007639966905117, 0.007383169140666723, -0.04408079385757446, -0.04411716386675835, 0.061211198568344116, 0.007546835113316774, -0.039279915392398834, 0.02682308852672577, -0.0393526554107666, 0.015711965039372444, -0.00942899752408266, -0.05844705551862717, 0.0018707967828959227, -0.0389162115752697, -0.001167259062640369, -0.0579378716647625, -0.01655757427215576, -0.03557014465332031, -0.002411804860457778, 0.00391889875754714, -0.022967837750911713, 0.04899078235030174, 0.014120765030384064, -0.014811800792813301, -0.00982907135039568, 0.04637211933732033, -0.04066198319196701, -0.0050645628944039345, 0.031805820763111115, 0.021549396216869354, -0.00471449876204133, -0.0006592115387320518, 0.03597021847963333, -0.023622503504157066, -0.04168035462498665, 0.02376798540353775, 0.0030641970224678516, -0.006719411350786686, 0.011838529258966446, -0.06623029708862305, -0.046153899282217026, -0.018876180052757263, -0.007192224729806185, 0.004575836937874556, 0.009610849432647228, 0.07139488309621811, -0.04629937931895256, 0.003452904522418976, -0.024331724271178246, -0.006355708464980125, -0.05470091849565506, 0.0307328961789608, 0.060774754732847214, 0.053828030824661255, 0.026241164654493332, 0.05128210783004761, -0.009865441359579563, -0.03433355316519737, 0.032515041530132294, -0.0253137219697237, -0.01500274520367384, -0.03544284775853157, -0.0532824769616127, 0.0033392473123967648, -0.01603020541369915, 0.003734774189069867, 0.021476656198501587, -0.01300237886607647, 0.03664306923747063, 0.06262964010238647, 0.046444859355688095, 0.005087294150143862, -0.007569566834717989, -0.0393526554107666, 0.01064740214496851, 0.07499554008245468, -0.024131687358021736, -0.01393891405314207, -0.033860739320516586, 0.0008547018514946103, -0.004691767506301403, 0.029532676562666893, -0.020421918481588364, 0.011120215989649296, -0.05779239162802696, -0.06092023476958275, -0.03186037391424179, 0.023113319650292397, -0.05222773551940918, 0.05171855166554451, 0.0882343277335167, 0.021876730024814606, -0.0063966247253119946, -0.05430084466934204, -0.00863339751958847, 0.08903446793556213, -0.013811618089675903, -0.0062193195335567, -0.0192398838698864, 0.07426813244819641, 0.005496460013091564, 0.00267776264809072, -0.011865807697176933, -0.02251320891082287, 0.001154188415966928, -0.022822357714176178, 0.04899078235030174, 0.03011460043489933, -0.06372074782848358, -0.08670677244663239, 0.004164398182183504, -0.016612129285931587, 0.038043323904275894, 0.017394091933965683, 0.019512660801410675, -0.03453359007835388, -0.01673942618072033, 0.05466454476118088, -0.015848353505134583, -0.022895097732543945, 0.05841068550944328, 0.0076832240447402, 0.03964361548423767, -0.07368620485067368, -0.021385731175541878, 0.07841434329748154, 0.04008005931973457, 0.041534870862960815, 0.020221881568431854, -0.02825971506536007, 0.0032096782233566046, 0.0021447106264531612, -0.03142393007874489, -0.02213132195174694, -0.04535375162959099, -0.059356313198804855, -0.003925718367099762, -0.04640848934650421, -0.017748702317476273, -0.006119301542639732, -0.014875449240207672, 0.0041303010657429695, -0.007483187131583691, -0.014093487523496151, 0.029441749677062035, -0.00066944066202268, 0.042044054716825485, 0.02571379579603672, -0.01280234195291996, -0.0030801089014858007, 0.014839078299701214, 0.01742136850953102, -0.07354072481393814, 0.004014370962977409, -0.0030528311617672443, -0.03480636700987816, -0.028696158900856972, 0.0009558566962368786, 0.046881303191185, -0.014420820400118828, -0.03851613774895668, -0.03155122697353363, -0.001405938994139433, -0.01429352443665266, -0.029332639649510384, -0.028041493147611618, -0.028205160051584244, -0.014029840007424355, 0.0005191290401853621, -0.007974185980856419, -0.025677425786852837, 0.06946725398302078, -0.02365887351334095, 0.028332456946372986, 0.019730882719159126, -0.0018901185831055045, 0.0935443863272667, -0.01715768501162529, -0.016466649249196053, 0.05866527929902077, -0.013184229843318462, -0.013747969642281532, -0.0173577219247818, -0.025586498901247978, 0.0351518839597702, -0.04640848934650421, -0.012893267907202244, 0.00586470915004611, -0.03131482005119324, 0.027623236179351807, -0.060883864760398865, 0.04484456777572632, -0.0059419963508844376, -0.06513918936252594, 0.009919996373355389, 0.018103312700986862, 0.03551558777689934, -0.019130771979689598, -0.02836882695555687, -0.009233507327735424, 0.014848170801997185, 0.04575382545590401, -0.01874888502061367, -0.009792700409889221, 0.012274973094463348, 0.03186037391424179, -0.060374680906534195, -0.03818880394101143, 0.02805968001484871, 0.040916576981544495, -0.05099114775657654, -0.012684138491749763, -0.06092023476958275, 0.008651582524180412, 0.01905803196132183, -0.039789099246263504, 0.021240249276161194, 0.01934899389743805, -0.0031414837576448917, -0.004096203949302435, 0.03771599009633064, -0.02949630469083786, -0.09616304934024811, -0.05302788317203522, -0.03524281084537506, -0.036715809255838394, -0.0019764979369938374, 0.026495756581425667, 0.030569229274988174, -0.029423564672470093, -0.020658325403928757, 0.01797601580619812, 0.025131870061159134, 0.03771599009633064, -0.008969822898507118, 0.04320790618658066, -0.06230230629444122, -0.006210227031260729, -0.09565386176109314, -0.013084212318062782, -0.054846398532390594, -0.03082382120192051, 0.025331906974315643, -0.0030732895247638226, 0.024459021165966988, -0.001813968294300139, -0.08830706775188446, 0.017839627340435982, 0.03718862310051918, -0.06797607243061066, 0.029223527759313583, 0.02058558352291584, -0.004787239711731672, 0.018448829650878906, 0.012529565021395683, 0.035679254680871964, -0.07070384174585342, 0.007128576748073101, -0.02816879004240036, -0.01033825520426035, 0.017139500007033348, 0.01729407347738743, -0.040407393127679825, -0.04506279155611992, 0.020312806591391563, 0.03615206852555275, 0.004241684917360544, -0.021585768088698387, 0.02876889891922474, 0.006983095780014992, 0.052082255482673645, -0.028314271941781044, 0.016639407724142075, 0.03504277393221855, 0.04258960857987404, -0.033769816160202026, 0.006019283086061478, 0.0470995269715786, -0.029678156599402428, -0.05091840773820877, 0.0022754163946956396, 0.0008609529468230903, 0.043462496250867844, 0.001154188415966928, -0.0012172681745141745, 0.03677036240696907, -0.016066575422883034, 0.0065193744376301765, -0.006473911926150322, -0.005255506839603186, -0.05110025778412819, -0.04535375162959099, 0.014038932509720325, -0.01998547464609146, -0.036406662315130234, -0.04375346004962921, -0.060483794659376144, -0.014848170801997185, -0.08852528780698776, 0.020821990445256233, -0.01515731867402792, -0.002893711207434535, -0.06466637551784515, -0.02365887351334095, 0.060774754732847214, -0.04131665080785751, 0.09012558311223984, -0.0110020125284791, 0.010274606756865978, 0.06415719538927078, 0.008828887715935707, -0.028750713914632797, -0.016684871166944504, 0.02856886386871338, 0.007242233958095312, -0.03618843853473663, 0.05706498399376869, 0.03166033700108528, 0.03135119006037712, -0.020512843504548073, -0.03136937692761421, -0.043171536177396774, 0.04622663930058479, 0.015266429632902145, 0.006001098081469536, -0.04848159849643707, 0.07150398939847946, 0.05153670161962509, -0.0008927769958972931, 0.01156575232744217, 0.00463721202686429, -0.02876889891922474, 0.07754145562648773, 0.022986022755503654, -0.03880710154771805, 0.05030011013150215, -0.019439920783042908, -0.02838701196014881, -0.03166033700108528, 0.010847439058125019, 0.03602477163076401, 0.02202221006155014, -0.04793604463338852, -0.0119931036606431, 0.06790333241224289, -0.060265570878982544, -0.001694628270342946, -0.03884347155690193, 0.03235137462615967, -0.030060045421123505, -0.05164581164717674, 0.08103300631046295, 0.033224258571863174, 0.010511013679206371, 0.01954903081059456, 0.005469182506203651, -0.004846340976655483, -0.012311343103647232, -0.001076901564374566, 0.001580971060320735, -0.02069469541311264, -0.025877460837364197, -0.01172941830009222, 0.045426491647958755, 0.009529015980660915, 0.00811512116342783, -0.01593928039073944, 0.04160761088132858, -0.010129125788807869, 0.040007319301366806, 0.022294988855719566, -0.03486092388629913, -0.04437175393104553, 0.07725049555301666, 0.041534870862960815, 0.01034734770655632, 0.029659971594810486, 0.04899078235030174, -0.0740862786769867, 0.011074753478169441, -0.04197131469845772, 0.0526278093457222, 0.017012203112244606, 0.009510830976068974, -0.04211679473519325, 0.026241164654493332, -0.00806056521832943, -0.03822517395019531, 0.004737230483442545, 0.03727954626083374, 0.01428443193435669, -0.019730882719159126, 0.06492096930742264, -0.047354117035865784, 0.007583205588161945, -0.010783791542053223, 0.001412758487276733 ]
717,264
pytorch_optimizer.optimizer.nero
Nero
Learning by Turning: Neural Architecture Aware Optimisation. :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param lr: float. learning rate. :param beta: float. coefficients used for computing running averages of gradient and the squared hessian trace. :param constraints: bool. :param eps: float. term added to the denominator to improve numerical stability.
class Nero(Optimizer, BaseOptimizer): """Learning by Turning: Neural Architecture Aware Optimisation. :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param lr: float. learning rate. :param beta: float. coefficients used for computing running averages of gradient and the squared hessian trace. :param constraints: bool. :param eps: float. term added to the denominator to improve numerical stability. """ def __init__( self, params: PARAMETERS, lr: float = 0.01, beta: float = 0.999, constraints: bool = True, eps: float = 1e-8 ): self.validate_learning_rate(lr) self.validate_range(beta, 'beta', 0.0, 1.0, range_type='[]') self.validate_non_negative(eps, 'eps') defaults: DEFAULTS = {'lr': lr, 'beta': beta, 'constraints': constraints, 'eps': eps} super().__init__(params, defaults) def __str__(self) -> str: return 'Nero' @torch.no_grad() def reset(self): for group in self.param_groups: for p in group['params']: if group['constraints'] and p.dim() > 1: p.sub_(neuron_mean(p)) p.div_(neuron_norm(p) + group['eps']) state = self.state[p] state['step'] = 0 state['exp_avg_sq'] = torch.zeros_like(neuron_norm(p)) state['scale'] = neuron_norm(p).mean() if state['scale'] == 0.0: state['scale'] = 0.01 @torch.no_grad() def step(self, closure: CLOSURE = None) -> LOSS: loss: LOSS = None if closure is not None: with torch.enable_grad(): loss = closure() for group in self.param_groups: for p in group['params']: if p.grad is None: continue grad = p.grad if grad.is_sparse: raise NoSparseGradientError(str(self)) state = self.state[p] if len(state) == 0: if group['constraints'] and p.dim() > 1: p.sub_(neuron_mean(p)) p.div_(neuron_norm(p) + group['eps']) state['step'] = 0 state['exp_avg_sq'] = torch.zeros_like(neuron_norm(p)) state['scale'] = neuron_norm(p).mean() if state['scale'] == 0.0: state['scale'] = 0.01 state['step'] += 1 grad_norm = neuron_norm(grad) exp_avg_sq = state['exp_avg_sq'] exp_avg_sq.mul_(group['beta']).addcmul_(grad_norm, grad_norm, value=1.0 - group['beta']) bias_correction: float = 1.0 - group['beta'] ** state['step'] grad_normed = grad / ((exp_avg_sq / bias_correction).sqrt_().add_(group['eps'])) torch.nan_to_num(grad_normed, nan=0.0, out=grad_normed) p.sub_(grad_normed, alpha=group['lr'] * state['scale']) if group['constraints'] and p.dim() > 1: p.sub_(neuron_mean(p)) p.div_(neuron_norm(p) + group['eps']) return loss
(params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], lr: float = 0.01, beta: float = 0.999, constraints: bool = True, eps: float = 1e-08)
[ -0.06435207277536392, -0.024327246472239494, -0.009600752964615822, 0.021403972059488297, 0.0013878043973818421, -0.006001722067594528, -0.07131987810134888, -0.037822362035512924, -0.02324603497982025, -0.025388434529304504, -0.0362405888736248, 0.034258369356393814, 0.01664864644408226, 0.0627102330327034, -0.036000318825244904, 0.04865449294447899, -0.004647705238312483, 0.03489908576011658, 0.00874979980289936, -0.004913002718240023, -0.03199583664536476, -0.061989426612854004, 0.00012678261555265635, 0.036641038954257965, -0.04553099349141121, -0.005095707252621651, 0.026249399408698082, -0.02967323362827301, -0.04581131041049957, 0.0004389290988910943, -0.046812430024147034, -0.047012653201818466, 0.010722008533775806, 0.0035614888183772564, 0.055061668157577515, -0.0574643611907959, 0.01283437479287386, 0.06086817383766174, -0.10155373811721802, -0.027570879086852074, -0.02574883960187435, -0.07063911855220795, 0.013595226220786572, -0.005811508744955063, -0.005911620799452066, -0.018901169300079346, 0.01240389235317707, 0.06058785691857338, -0.013184767216444016, -0.03928399831056595, 0.030073681846261024, -0.056743551045656204, 0.04392920061945915, 0.011412782594561577, -0.01034158281981945, 0.03449863940477371, 0.048574402928352356, 0.006747557315975428, 0.05133749917149544, -0.06070799380540848, 0.015287121757864952, -0.06387153267860413, 0.02905253879725933, -0.021263815462589264, 0.010381627827882767, -0.023826686665415764, -0.07324203103780746, -0.02504805289208889, 0.034638796001672745, 0.042127180844545364, 0.029973570257425308, -0.017759891226887703, 0.0517379455268383, 0.004540084861218929, -0.022845586761832237, -0.02316594496369362, -0.05922633409500122, -0.027630947530269623, 0.005961677059531212, -0.027831170707941055, -0.013234823010861874, 0.012564071454107761, -0.010701986029744148, -0.009440573863685131, 0.0025365909095853567, -0.08617651462554932, 0.011422793380916119, -0.03199583664536476, 0.01330490130931139, -0.07684607058763504, -0.011793208308517933, -0.020432885736227036, 0.017549656331539154, 0.01183325331658125, 0.02572881616652012, 0.06691494584083557, -0.0365409255027771, -0.04509050026535988, -0.008008969947695732, -0.07232099771499634, -0.004913002718240023, 0.047333013266325, -0.0007339470321312547, 0.05321960523724556, 0.02474771812558174, -0.046692296862602234, -0.016989028081297874, -0.005476133432239294, 0.001174440374597907, -0.04993592947721481, -0.07111965119838715, 0.006692495662719011, -0.06214960664510727, -0.013755406253039837, -0.015917828306555748, -0.030774466693401337, -0.02045290730893612, -0.004217223264276981, -0.03193576633930206, 0.02905253879725933, 0.031094826757907867, 0.052498798817396164, -0.057384271174669266, -0.0013802959583699703, -0.014426156878471375, 0.012754284776747227, 0.05602274462580681, 0.01977214403450489, 0.02374659664928913, -0.06575364619493484, -0.030013615265488625, -0.01602795161306858, -0.014035720378160477, 0.0259891077876091, 0.018580811098217964, 0.006987826433032751, -0.03205590322613716, 0.023506326600909233, -0.00835435651242733, 0.012043489143252373, 0.031515296548604965, 0.006006727460771799, -0.0008922493434511125, -0.004462497774511576, 0.036200545728206635, 0.0022287461906671524, 0.029192695394158363, 0.022825565189123154, 0.010982300154864788, -0.03972449153661728, 0.005706391297280788, -0.0008584614843130112, 0.019291605800390244, -0.0007840030593797565, 0.007548454217612743, 0.019381707534193993, -0.015166986733675003, -0.010852154344320297, -0.03996476158499718, -0.0016193136107176542, -0.04621175676584244, -0.003166045993566513, -0.01685888133943081, -0.02033277228474617, -0.01533717755228281, -0.003461376763880253, 0.01792007125914097, 0.008594625629484653, -0.015076885931193829, 0.03880345821380615, -0.02574883960187435, -0.07860804349184036, 0.020943457260727882, 0.06279032677412033, -0.04308825731277466, 0.11837257444858551, 0.014596347697079182, 0.006797613110393286, -0.032135993242263794, -0.003313711378723383, 0.026449624449014664, -0.022385071963071823, -0.017639756202697754, -0.0783277302980423, -0.016338298097252846, 0.04765337333083153, 0.02923274040222168, -0.033777832984924316, -0.0233061034232378, 0.009580730460584164, 0.03441854938864708, 0.002677999436855316, 0.010691975243389606, -0.0013602734543383121, -0.0054010492749512196, 0.016818836331367493, 0.03291686624288559, 0.012514015659689903, 0.10107320547103882, 0.015467323362827301, 0.0078988466411829, 0.04204709455370903, 0.04352875053882599, 0.0181202944368124, -0.019051337614655495, -0.00950564630329609, -0.03365769609808922, 0.04949543625116348, 0.014686448499560356, 0.011322681792080402, -0.009315432980656624, 0.013124699704349041, 0.023626461625099182, 0.06731539219617844, 0.03221608325839043, -0.04252763092517853, 0.02212478034198284, 0.06214960664510727, 0.05598270148038864, -0.014316033571958542, -0.01186328660696745, -0.04533077031373978, 0.004800376482307911, -0.011532916687428951, 0.054060548543930054, -0.012233701534569263, 0.03205590322613716, -0.03567996248602867, 0.02118372544646263, -0.021023547276854515, -0.0018145323265343904, -0.06911741197109222, -0.03992471471428871, 0.028872337192296982, 0.06655453890562057, 0.03952426835894585, -0.029252763837575912, -0.013064632192254066, -0.01977214403450489, -0.016718724742531776, -0.05998718738555908, -0.05702386796474457, -0.056303057819604874, -0.005028131417930126, -0.02009250409901142, 0.017459554597735405, 0.06070799380540848, 0.021143680438399315, -0.027190452441573143, 0.02404693327844143, -0.0075734821148216724, -0.051818035542964935, -0.027590902522206306, 0.009120214730501175, -0.059947140514850616, -0.030133750289678574, 0.018250441178679466, 0.024086978286504745, 0.023326124995946884, -0.08377382904291153, -0.011442815884947777, -0.06026750057935715, -0.0783277302980423, 0.046692296862602234, 0.0207432322204113, 0.018140317872166634, 0.025008009746670723, -0.018781034275889397, 0.06363126635551453, 0.013344946317374706, 0.1242191269993782, 0.07928880304098129, -0.08946019411087036, -0.003128503914922476, 0.0007301928126253188, 0.021644242107868195, -0.01696900464594364, 0.02666987106204033, -0.01596788316965103, 0.000715175992809236, 0.0315353199839592, -0.02374659664928913, -0.06531315296888351, -0.03487906605005264, -0.023906774818897247, 0.03243632987141609, -0.01371536124497652, -0.0259290412068367, 0.02006247080862522, 0.019852234050631523, 0.053259652107954025, 0.018991271033883095, 0.06082812696695328, -0.015106920152902603, 0.05802498757839203, 0.002496546134352684, -0.05366009846329689, 0.03590020909905434, -0.005436088424175978, -0.01658857986330986, 0.05810507759451866, -0.0317155197262764, -0.020843343809247017, -0.04997597262263298, -0.004770342726260424, -0.004615169018507004, 0.026589781045913696, 0.01551737915724516, 0.04036520794034004, -0.015917828306555748, 0.014135831966996193, -0.018310507759451866, 0.017399488016963005, 0.006226974073797464, 0.017569677904248238, -0.09554701298475266, 0.0059066154062747955, -0.03760211542248726, 0.011232580058276653, 0.07504405081272125, -0.037882428616285324, 0.06022745370864868, -0.01340501382946968, -0.00018661525973584503, -0.022565273568034172, -0.04529072716832161, 0.031515296548604965, 0.013114687986671925, -0.041005928069353104, -0.02180442027747631, -0.02687009423971176, -0.03487906605005264, 0.007503403816372156, 0.028972448781132698, -0.05029633268713951, 0.0005593764944933355, 0.06915745884180069, 0.04885471612215042, 0.013625260442495346, -0.03167547658085823, 0.046892520040273666, 0.0629505068063736, -0.045010410249233246, 0.043208394199609756, 0.00657236110419035, -0.055382028222084045, 0.009580730460584164, 0.010531795211136341, 0.01489668432623148, 0.03127502650022507, -0.012654172256588936, 0.006817635614424944, 0.006307064089924097, 0.06963799148797989, 0.05914624407887459, 0.030874580144882202, -0.014165866188704967, -0.021764375269412994, 0.04420951381325722, -0.09090180695056915, -0.03535960242152214, 0.01795010454952717, -0.023786641657352448, 0.07816755026578903, 0.07524427026510239, -0.012083533219993114, -0.003939412068575621, -0.021784398704767227, 0.05273906886577606, -0.030514175072312355, -0.010742031037807465, -0.08197180926799774, -0.012804340571165085, 0.0026004123501479626, -0.029773345217108727, -0.005876581650227308, -0.02086336724460125, -0.01661861315369606, 0.047693416476249695, -0.0052258530631661415, 0.05518180504441261, 0.00701285433024168, 0.016838859766721725, 0.04060547798871994, 0.024827806279063225, -0.027971327304840088, 0.04589139670133591, 0.017759891226887703, 0.038763415068387985, -0.08913983404636383, 0.020502964034676552, 0.00864968728274107, 0.02404693327844143, 0.010972289368510246, -0.057944897562265396, 0.03471888601779938, 0.058505527675151825, 0.04765337333083153, -0.06359121948480606, -0.05726413428783417, -0.021904533728957176, -0.03285679966211319, 0.00858962070196867, 0.047132790088653564, -0.012754284776747227, -0.07244113087654114, 0.037141598761081696, 0.07063911855220795, 0.013354957103729248, 0.05934646725654602, -0.018720967695116997, 0.004800376482307911, 0.009130225516855717, 0.029152650386095047, -0.012473970651626587, -0.010166386142373085, 0.03990469500422478, 0.014306022785604, 0.013395002111792564, 0.020402850583195686, 0.04116610437631607, -0.0006138124736025929, 0.05838539078831673, 0.04565113037824631, 0.032636553049087524, -0.030333973467350006, -0.025969086214900017, -0.0467323400080204, -0.043328527361154556, 0.006211957428604364, -0.030253883451223373, -0.035519782453775406, -0.009050136432051659, -0.036821238696575165, -0.0033087057527154684, -0.03355758264660835, -0.007318196352571249, 0.03515937924385071, 0.02679000422358513, 0.015217043459415436, 0.009941133670508862, -0.003481399267911911, 0.006907736882567406, 0.0007802488980814815, -0.007208073046058416, -0.02242511697113514, 0.05954669043421745, -0.008844906464219093, -0.07039884477853775, 0.00952066294848919, 0.004342363215982914, -0.02124379388988018, 0.037081532180309296, -0.008965040557086468, 0.0236665066331625, 0.0012244964018464088, -0.029693257063627243, -0.005381026770919561, -0.004627683199942112, -0.008729777298867702, 0.03890357166528702, 0.03652090206742287, -0.03852314502000809, 0.030394041910767555, -0.03349751606583595, 0.002142399549484253, 0.07564472407102585, 0.0013440052280202508, -0.0008753553847782314, -0.002489037811756134, 0.0078537967056036, -0.02260531857609749, 0.016488466411828995, -0.0315353199839592, -0.02955309860408306, 0.005721407942473888, -0.02580890618264675, 0.0024552498944103718, 0.010481739416718483, -0.022645363584160805, 0.02829168736934662, -0.043128304183483124, 0.04308825731277466, 0.0315953865647316, -0.001367781893350184, 0.02967323362827301, 0.013124699704349041, 0.01237385906279087, 0.02829168736934662, 0.03499919921159744, -0.02879224717617035, -0.03890357166528702, 0.048454269766807556, 0.02454749308526516, -0.048254042863845825, -0.005491150077432394, -0.000371666275896132, 0.0005149517673999071, 0.06595386564731598, -0.032756686210632324, 0.02843184396624565, 0.00993112288415432, -0.06126862019300461, -0.006267019081860781, 0.029753323644399643, -0.00701285433024168, -0.06863687187433243, 0.04384911060333252, -0.049375299364328384, 0.03055422008037567, -0.008799855597317219, -0.005646323785185814, 0.018720967695116997, -0.008514536544680595, 0.00962077546864748, -0.045450903475284576, 0.000024597862648079172, 0.08825884759426117, 0.034318435937166214, -0.052819158881902695, 0.03798254206776619, 0.030213840305805206, -0.010511773638427258, 0.021524107083678246, 0.01093224436044693, 0.07003844529390335, -0.013925597071647644, -0.017259329557418823, 0.06455229967832565, 0.0019409238593652844, 0.021283837035298347, -0.01548734586685896, 0.0024627582170069218, 0.07352234423160553, 0.015317155048251152, -0.039203908294439316, 0.023566395044326782, -0.028712157160043716, -0.05101713910698891, -0.026569757610559464, -0.00934046134352684, -0.008729777298867702, -0.0070929438807070255, -0.010852154344320297, -0.011512894183397293, 0.06070799380540848, 0.001696900581009686, 0.05726413428783417, -0.06170911341905594, -0.021023547276854515, -0.041206151247024536, 0.023946819826960564, -0.01776990294456482, 0.033958032727241516, 0.05189812555909157, 0.025328367948532104, -0.04629184678196907, 0.019932324066758156, 0.006492271553725004, 0.05141758918762207, -0.04384911060333252, -0.06467243283987045, 0.02004244737327099, -0.009350472129881382, -0.018600832670927048, 0.05442095175385475, 0.025648726150393486, -0.03323722630739212, -0.025188211351633072, 0.049815792590379715, 0.0062369853258132935, -0.021343905478715897, -0.013114687986671925, -0.0029783358331769705, -0.050136152654886246, 0.02180442027747631, 0.012764295563101768, -0.009185287170112133, -0.002823161892592907, -0.03073442168533802, 0.030534198507666588, -0.05430081859230995, 0.013395002111792564, -0.03706150874495506, 0.01022645365446806, 0.052378665655851364, -0.0939452201128006, 0.05141758918762207, 0.01714920625090599, 0.022204870358109474, 0.009941133670508862, 0.030153771862387657, -0.031074803322553635, -0.05546211823821068, -0.016748758032917976, 0.004182184115052223, -0.05470126494765282, -0.020142558962106705, 0.06719525903463364, 0.0414864644408226, -0.08569598197937012, -0.01945178583264351, 0.04605157673358917, -0.017309386283159256, 0.005666346289217472, -0.023466281592845917, -0.02486785128712654, 0.01022645365446806, 0.02967323362827301, -0.043248437345027924, -0.010842143557965755, -0.024407336488366127, -0.013114687986671925, -0.025228256359696388, -0.06086817383766174, -0.01744954288005829, -0.0314752534031868, 0.007363246753811836, 0.07220086455345154, -0.019291605800390244, 0.007057904731482267, -0.007873818278312683, -0.0003441354201640934, -0.013605237938463688, -0.029192695394158363, -0.030654333531856537, 0.04018500819802284, -0.08641678839921951, -0.019431764259934425, -0.01792007125914097, -0.03317715972661972, -0.020232660695910454, 0.015016818419098854, -0.02124379388988018, -0.000690773653332144, -0.020703187212347984, 0.05422072857618332, 0.03772224858403206, -0.04436969384551048, -0.06435207277536392, 0.002267539734020829, 0.029072560369968414, 0.0157376267015934, -0.007813751697540283, -0.025768861174583435, -0.023686528205871582, 0.01886112429201603, 0.021904533728957176, 0.030934646725654602, 0.008089059963822365, -0.012614128179848194, 0.08197180926799774, -0.04408938065171242, 0.007498398423194885, 0.017259329557418823, 0.0068877143785357475, 0.03768220543861389, 0.04216722771525383, 0.04873458296060562, -0.04252763092517853, 0.009530674666166306, -0.004487526137381792, 0.017839981243014336, 0.006522304844111204, -0.008659699000418186, 0.013955630362033844, -0.01635832153260708, 0.014856639318168163, -0.008669709786772728, -0.00744834216311574, -0.0687970519065857, -0.027510812506079674, -0.03856319189071655, -0.0007295671384781599, 0.042207270860672, 0.006957792676985264, 0.009630786255002022, -0.04424956068396568, -0.0575844943523407, -0.020342784002423286, 0.012453948147594929, 0.04252763092517853, -0.005325965117663145, 0.0012269992148503661, 0.042767900973558426, -0.004339860752224922, -0.03185568004846573, 0.004349872004240751, 0.007613527122884989, -0.010006207041442394, -0.043008167296648026, -0.0004007613460998982, 0.03277670964598656, 0.019521864131093025, 0.05898606404662132, -0.08633669465780258, -0.05301938205957413, -0.01735944300889969, -0.00993112288415432, -0.07051897794008255, 0.018310507759451866, -0.04016498476266861, -0.042007047683000565, -0.007348230108618736, 0.030954668298363686, 0.049815792590379715, 0.01520703174173832, -0.04581131041049957, 0.03900368511676788, 0.004039524123072624, 0.013014576397836208, 0.032576486468315125, -0.00830930657684803, -0.006041766609996557, 0.011973409913480282, 0.03592022880911827, 0.03846307843923569, -0.016918949782848358, -0.059506647288799286, 0.028331732377409935, -0.000774617597926408, -0.034578729420900345, 0.02124379388988018, 0.022845586761832237, -0.018670910969376564, -0.02735063247382641, 0.01629825495183468, -0.04805381968617439, 0.019401729106903076, -0.01632828824222088, 0.024587538093328476, 0.02648966759443283, 0.0038342943880707026, -0.014245955273509026, -0.014916706830263138, 0.00109372497536242, 0.08641678839921951, 0.015927840024232864, -0.03547973558306694, 0.028311708942055702, 0.0036616011057049036, 0.012193656526505947, 0.011873298324644566, -0.02961316704750061, 0.014105798676609993, 0.036200545728206635, -0.0011206300696358085, -0.013625260442495346, 0.048574402928352356, -0.02192455530166626, 0.07007848471403122, 0.006201946176588535, 0.051057182252407074, 0.015227054245769978, 0.07448342442512512, -0.07055902481079102, 0.026689892634749413, -0.03816274181008339, -0.06643440574407578, -0.09602755308151245, 0.016338298097252846, -0.051697902381420135, 0.055502161383628845, 0.033517539501190186, 0.019111404195427895, 0.00599671620875597, 0.05574243143200874, -0.007903852500021458 ]
717,266
pytorch_optimizer.optimizer.nero
__init__
null
def __init__( self, params: PARAMETERS, lr: float = 0.01, beta: float = 0.999, constraints: bool = True, eps: float = 1e-8 ): self.validate_learning_rate(lr) self.validate_range(beta, 'beta', 0.0, 1.0, range_type='[]') self.validate_non_negative(eps, 'eps') defaults: DEFAULTS = {'lr': lr, 'beta': beta, 'constraints': constraints, 'eps': eps} super().__init__(params, defaults)
(self, params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], lr: float = 0.01, beta: float = 0.999, constraints: bool = True, eps: float = 1e-08)
[ 0.030680397525429726, -0.01578117161989212, -0.036478713154792786, -0.01580931805074215, -0.07265719026327133, -0.018258120864629745, -0.06770329177379608, -0.04327156022191048, -0.014692814089357853, 0.016400407999753952, -0.012957073748111725, 0.03071792796254158, 0.00857549998909235, 0.046911925077438354, -0.0487884022295475, 0.005939049646258354, 0.031599871814250946, 0.038993190973997116, -0.03567182645201683, -0.010808506980538368, -0.028484920039772987, 0.025407498702406883, -0.013820252381265163, 0.09885280579328537, 0.0022963385563343763, 0.059859614819288254, 0.006835067179054022, -0.010498888790607452, -0.02521985024213791, 0.004341698717325926, -0.008997706696391106, 0.0152369923889637, 0.023287078365683556, 0.05614418908953667, 0.025107260793447495, -0.00796564482152462, 0.0008051258628256619, 0.017235441133379936, -0.07599731534719467, 0.04717462882399559, 0.02317449077963829, -0.026889914646744728, 0.03754830360412598, -0.03627229854464531, 0.024563083425164223, -0.02043483406305313, 0.036384887993335724, 0.0464990995824337, -0.020303480327129364, -0.03383287787437439, 0.011315155774354935, -0.0014577880501747131, 0.04991428554058075, -0.046911925077438354, -0.052316177636384964, 0.05276653170585632, 0.04709957167506218, 0.04811286926269531, 0.032200343906879425, 0.011690451763570309, -0.008889809250831604, -0.04544827342033386, -0.02004077471792698, -0.05160311609506607, 0.0017193220555782318, -0.011690451763570309, -0.08744382858276367, -0.047887690365314484, 0.03281958028674126, 0.05802066624164581, 0.07648520171642303, -0.007989100180566311, -0.027396563440561295, 0.01402666512876749, 0.02454431913793087, -0.020528657361865044, -0.07821156084537506, -0.03460223600268364, -0.04702451080083847, -0.018136149272322655, 0.03861789405345917, 0.03368275985121727, -0.0012056364212185144, -0.03178751841187477, 0.013520016334950924, -0.05370476841926575, -0.05115276202559471, -0.05066487938165665, 0.05025205388665199, 0.030380161479115486, -0.052015941590070724, -0.032650697976350784, 0.006126697175204754, -0.02773432992398739, 0.047587454319000244, 0.023718668147921562, 0.029704630374908447, -0.029310569167137146, 0.012150187976658344, -0.04379697144031525, -0.01839885674417019, 0.0027771859895437956, -0.058733727782964706, 0.012666219845414162, 0.006258050445467234, -0.03634735941886902, -0.03554047271609306, -0.03940601646900177, 0.02675856091082096, -0.013125956058502197, -0.014186165295541286, 0.04811286926269531, -0.047437336295843124, 0.029929807409644127, -0.06301209330558777, 0.037473246455192566, 0.0007142340182326734, -0.016616202890872955, 0.0031642091926187277, -0.006694331299513578, 0.013407427817583084, 0.05051475763320923, -0.05025205388665199, 0.03869295492768288, 0.039443545043468475, 0.008894500322639942, 0.009387075901031494, 0.03522147238254547, -0.0046466258354485035, -0.030211279168725014, 0.032500579953193665, -0.01326669193804264, -0.026627207174897194, 0.0007165796123445034, 0.029254276305437088, -0.05809572711586952, 0.013670134358108044, 0.03133716434240341, -0.03439582139253616, 0.009480900131165981, 0.05505583435297012, 0.015443405136466026, 0.01356692798435688, -0.03477111831307411, -0.0037576451431959867, 0.007398010231554508, -0.009757679887115955, -0.051265351474285126, -0.022742900997400284, 0.03402052819728851, -0.00033747265115380287, 0.006145461928099394, -0.012272159568965435, -0.009091530926525593, 0.02163578011095524, -0.0419204942882061, 0.04604874551296234, -0.07453366369009018, 0.02728397399187088, 0.0008174402755685151, -0.026796091347932816, 0.03225664049386978, -0.01516193337738514, -0.04548580199480057, -0.02005953900516033, 0.03711671382188797, -0.05073993653059006, -0.005854608025401831, -0.010911713354289532, -0.0017580243293195963, -0.02020965702831745, -0.097501739859581, -0.013538781553506851, 0.029385628178715706, -0.002744347555562854, 0.03176875412464142, 0.037923600524663925, 0.020697541534900665, -0.00046501445467583835, 0.011840569786727428, 0.08489181846380234, 0.014120489358901978, -0.03255687654018402, -0.023887552320957184, 0.0331573486328125, 0.021373072639107704, -0.0640253946185112, 0.06432563066482544, -0.0579080767929554, 0.006145461928099394, 0.03918083757162094, 0.023868786171078682, 0.0073651717975735664, 0.025970440357923508, -0.030455220490694046, 0.013548163697123528, 0.06436315923929214, 0.02666473761200905, 0.025745263323187828, 0.03139346092939377, 0.08796923607587814, 0.029892276972532272, -0.00017870511510409415, -0.01208451110869646, 0.023868786171078682, -0.010536418296396732, -0.03278205171227455, -0.009889033623039722, -0.017169764265418053, -0.04717462882399559, -0.018661562353372574, -0.0054464745335280895, 0.005338577087968588, 0.005376106593757868, -0.006046947091817856, -0.056519486010074615, 0.010470741428434849, 0.000838550622574985, 0.014608372934162617, 0.016240907832980156, 0.12234629690647125, -0.015978200361132622, 0.020641246810555458, -0.05374230071902275, 0.03477111831307411, 0.03741694986820221, 0.030811751261353493, -0.05832090228796005, -0.05693231150507927, 0.048976048827171326, -0.03270699456334114, -0.05862113833427429, -0.005010193679481745, -0.006797537673264742, 0.005028958432376385, 0.05543112754821777, -0.00872561801224947, 0.01539649348706007, -0.07509660720825195, -0.027096327394247055, 0.03154357895255089, 0.02445049397647381, -0.02377496287226677, -0.002746693091467023, -0.006225212477147579, 0.011465273797512054, 0.0059296670369803905, 0.044172268360853195, -0.036628831177949905, -0.03402052819728851, -0.055130891501903534, -0.029385628178715706, 0.00240892730653286, 0.04608627408742905, -0.03188134357333183, 0.04150766879320145, 0.02476949617266655, -0.01812676712870598, 0.05051475763320923, 0.009823356755077839, 0.015368346124887466, -0.0012607579119503498, -0.010705300606787205, 0.09254784137010574, 0.03413311392068863, 0.021091600880026817, 0.0059484317898750305, -0.0018319105729460716, 0.05580642446875572, -0.002636450110003352, 0.15792429447174072, 0.03323240578174591, -0.005920284893363714, -0.019609184935688972, 0.035484179854393005, -0.029479453340172768, -0.013960988260805607, -0.02043483406305313, 0.008828824386000633, 0.02416902221739292, 0.037848539650440216, -0.03238799050450325, 0.010761595331132412, -0.0024347288999706507, 0.021785898134112358, -0.029554512351751328, -0.02872886136174202, 0.00032017388730309904, -0.04466015100479126, 0.004545765463262796, -0.004803780931979418, -0.016447320580482483, 0.06792846322059631, 0.023681139573454857, 0.08046333491802216, -0.018830446526408195, 0.04709957167506218, -0.011981305666267872, 0.03398299589753151, -0.01784529536962509, 0.05588148161768913, -0.04252096638083458, 0.025970440357923508, -0.011971922591328621, -0.041882965713739395, -0.05603160336613655, 0.03869295492768288, 0.029929807409644127, 0.036384887993335724, 0.040194135159254074, 0.009935945272445679, 0.03484617546200752, 0.012328453361988068, 0.013848399743437767, 0.02887897938489914, -0.042408380657434464, 0.015950053930282593, -0.07284483313560486, 0.022236252203583717, 0.027021268382668495, 0.01489922683686018, 0.014467637054622173, -0.010536418296396732, -0.05359218269586563, -0.07033035904169083, -0.052616413682699203, 0.017338646575808525, 0.026251912117004395, -0.04315897077322006, -0.0061173150315880775, -0.014993051066994667, 0.002289301948621869, 0.04323402792215347, -0.0278281532227993, -0.03668512403964996, -0.028090860694646835, 0.014298754744231701, 0.047887690365314484, 0.0009177144966088235, -0.028616273775696754, 0.07427095621824265, -0.028860215097665787, -0.014927374199032784, 0.013463722541928291, 0.01520884595811367, -0.04139508306980133, -0.01852082833647728, -0.05558124557137489, 0.030230043455958366, 0.00871154386550188, -0.013013367541134357, 0.022311311215162277, -0.018755387514829636, 0.03178751841187477, 0.010311241261661053, -0.034264467656612396, 0.005779549013823271, -0.016325348988175392, 0.0323692262172699, -0.05558124557137489, -0.009926563128829002, 0.024206552654504776, -0.05025205388665199, 0.03402052819728851, 0.04556085914373398, -0.006628654897212982, 0.01017050538212061, -0.02805333025753498, 0.049201223999261856, 0.005474621430039406, 0.02827850729227066, -0.06072279438376427, -0.021222954615950584, -0.013238544575870037, 0.00022869562963023782, 0.007473069243133068, -0.011183802969753742, -0.0014120489358901978, 0.026158088818192482, -0.013032132759690285, -0.008200203999876976, -0.02445049397647381, 0.04995181784033775, 0.010001622140407562, 0.002439419971778989, -0.039593663066625595, -0.014908608980476856, 0.021298013627529144, 0.04563592001795769, 0.006408168934285641, 0.012938308529555798, 0.002962487982586026, 0.01677570305764675, -0.011465273797512054, -0.059559378772974014, 0.026101794093847275, 0.05047722905874252, 0.01749814674258232, -0.014608372934162617, -0.008068851195275784, -0.03238799050450325, -0.023812493309378624, -0.0163816437125206, 0.05479312688112259, 0.017113469541072845, -0.008664632216095924, 0.025970440357923508, 0.02979845367372036, 0.01284448429942131, 0.07881203293800354, 0.007426157593727112, -0.03308228775858879, -0.024506788700819016, 0.0059296670369803905, -0.004466014914214611, -0.030699163675308228, 0.05325441434979439, -0.037998657673597336, 0.02760297618806362, -0.03225664049386978, 0.023287078365683556, -0.002709163585677743, 0.07821156084537506, 0.03649747744202614, 0.046911925077438354, 0.06087291240692139, 0.0010731102665886283, -0.0042807129211723804, -0.028841450810432434, -0.05276653170585632, -0.059184081852436066, 0.006201756186783314, -0.04541074112057686, -0.041732847690582275, 0.0047568692825734615, -0.018633415922522545, -0.013360516168177128, -0.0018072818638756871, 0.0018002450233325362, -0.006835067179054022, 0.049276284873485565, -0.0556187778711319, 0.037623364478349686, 0.006370639428496361, -0.029685866087675095, -0.025801558047533035, 0.015218228101730347, -0.0023749161045998335, -0.03270699456334114, -0.010677154175937176, 0.02058495208621025, 0.004906987305730581, 0.05828337371349335, -0.025651440024375916, -0.002692744368687272, -0.0266835018992424, -0.01777023635804653, -0.03017374873161316, 0.03184381499886513, -0.03891813009977341, 0.05862113833427429, 0.006792846601456404, -0.01784529536962509, -0.020716305822134018, -0.0556187778711319, 0.03993142768740654, 0.07299495488405228, -0.0012173644499853253, 0.0052588265389204025, 0.012853867374360561, 0.0041446685791015625, 0.01528390496969223, 0.025126026943325996, -0.039068251848220825, -0.058696199208498, 0.024337906390428543, 0.008523896336555481, 0.014129871502518654, 0.0025613910984247923, 0.0004949208232574165, 0.01474910881370306, -0.05272900313138962, 0.010545800440013409, 0.09765186160802841, 0.005498077254742384, -0.010902331210672855, -0.045298151671886444, 0.0035230854991823435, -0.023962611332535744, 0.04863828420639038, -0.07029282301664352, -0.03141222521662712, 0.02469443716108799, 0.06015985086560249, -0.025257378816604614, -0.0304739847779274, 0.032650697976350784, 0.02385002188384533, 0.04537321254611015, 0.013857781887054443, -0.00746837817132473, -0.021373072639107704, -0.02568896859884262, -0.02150442637503147, 0.02987351268529892, -0.043947089463472366, -0.08391604572534561, 0.02531367354094982, -0.020772600546479225, -0.007294804323464632, -0.03278205171227455, 0.013960988260805607, -0.001972646452486515, 0.015330816619098186, -0.027865681797266006, -0.0059859612956643105, -0.05073993653059006, 0.061023030430078506, -0.004078991711139679, -0.025032201781868935, 0.02598920650780201, 0.042108140885829926, 0.056444425135850906, -0.06083538383245468, 0.023305844515562057, 0.04135755077004433, -0.013482486829161644, -0.0579456090927124, 0.04946393147110939, 0.041807904839515686, 0.006525448523461819, -0.03726683184504509, -0.013116573914885521, 0.03064286895096302, -0.041657786816358566, 0.04908863827586174, 0.03454593941569328, -0.03458347171545029, -0.04094472527503967, -0.007688864134252071, 0.032050225883722305, 0.04139508306980133, 0.05839596316218376, -0.0048741488717496395, -0.013407427817583084, 0.005333885550498962, -0.04390956088900566, 0.06485104560852051, -0.06226150691509247, -0.005155620630830526, 0.03188134357333183, -0.013829635456204414, -0.06470092386007309, -0.02043483406305313, 0.019703008234500885, -0.0012971146497875452, 0.041582729667425156, 0.000992187182419002, 0.04105731472373009, 0.031674932688474655, -0.00763726094737649, -0.030811751261353493, -0.005146238021552563, 0.013970370404422283, -0.062299035489559174, 0.009588797576725483, -0.02004077471792698, -0.037773482501506805, -0.03435829281806946, 0.023681139573454857, 0.039668723940849304, -0.06282445043325424, -0.003668512450531125, -0.012891396880149841, -0.01672879233956337, 0.029929807409644127, 0.008856970816850662, 0.04634898155927658, -0.0875939428806305, -0.018079854547977448, 0.018511444330215454, -0.005756093189120293, -0.07487142831087112, -0.09570032358169556, 0.013032132759690285, 0.014355048537254333, -0.06672751903533936, 0.00392652815207839, -0.022236252203583717, 0.018689710646867752, 0.010001622140407562, 0.07505907863378525, -0.03595329821109772, -0.047437336295843124, -0.07502155005931854, 0.016362879425287247, -0.028184683993458748, -0.04330908879637718, 0.03366399556398392, 0.04300885275006294, -0.062223974615335464, -0.01330422144383192, 0.027227681130170822, 0.021973544731736183, 0.008092306554317474, -0.013351133093237877, -0.019609184935688972, 0.027921976521611214, 0.010011004284024239, -0.0487884022295475, 0.006900744047015905, -0.03873048350214958, -0.0150493448600173, -0.01929018273949623, 0.004015660844743252, -0.039593663066625595, -0.05242876708507538, 0.020903952419757843, 0.08391604572534561, -0.0023338682949543, -0.021541954949498177, -0.003985167946666479, 0.023812493309378624, 0.029179217293858528, -0.06395033746957779, 0.0008614201797172427, -0.014533313922584057, -0.10725942254066467, -0.012487954460084438, -0.02658967860043049, 0.02026595175266266, -0.015537229366600513, -0.037529539316892624, -0.041732847690582275, -0.024037670344114304, 0.004864766262471676, 0.021204190328717232, 0.012957073748111725, 0.0419204942882061, 0.02300560660660267, -0.016072025522589684, 0.033101052045822144, -0.004693537950515747, -0.0042244186624884605, 0.00865055900067091, 0.015021197497844696, -0.0769355520606041, 0.011211949400603771, 0.07843673974275589, 0.00846291147172451, -0.009213501587510109, 0.04079460725188255, -0.03861789405345917, 0.013079044409096241, 0.00006292794569162652, 0.027415327727794647, 0.028147153556346893, 0.024412965402007103, 0.05573136359453201, -0.004130594898015261, -0.042633555829524994, -0.0442097969353199, 0.03861789405345917, 0.008308101445436478, 0.02842862531542778, 0.011596627533435822, -0.05295417830348015, -0.03306352347135544, -0.035033825784921646, -0.017685795202851295, -0.03116828203201294, -0.03876801207661629, -0.02293054759502411, 0.02994857169687748, 0.026777325198054314, 0.021072836592793465, -0.07806143909692764, -0.056744661182165146, 0.0069429646246135235, -0.003018782241269946, 0.05576889589428902, 0.013097808696329594, -0.014645902439951897, -0.04375944286584854, -0.004078991711139679, -0.0033096361439675093, -0.04030672460794449, 0.04687439277768135, 0.013651370070874691, 0.011390214785933495, -0.028240978717803955, -0.01474910881370306, 0.028147153556346893, 0.03869295492768288, 0.015574758872389793, -0.012703749351203442, -0.06927952915430069, -0.06218644604086876, 0.031187046319246292, 0.002793604973703623, -0.007421466521918774, -0.0020348047837615013, -0.07641014456748962, 0.10380670428276062, -0.011211949400603771, 0.021541954949498177, 0.0025566997937858105, -0.013585693202912807, 0.014852315187454224, -0.06346245110034943, 0.048976048827171326, 0.04304638132452965, 0.04792522266507149, -0.0999036356806755, -0.0007230300107039511, 0.0373418927192688, 0.058358434587717056, -0.03032386675477028, -0.04518556594848633, -0.0012842138530686498, -0.018736623227596283, -0.026270676404237747, 0.007824908941984177, -0.024506788700819016, 0.014617755077779293, -0.020322244614362717, -0.05543112754821777, -0.017629500478506088, 0.046386510133743286, -0.03255687654018402, 0.020247185602784157, 0.030980633571743965, -0.039818841964006424, -0.01832379773259163, -0.019027477130293846, -0.04766251519322395, 0.007125921081751585, 0.0005693934508599341, 0.039443545043468475, 0.05509336292743683, 0.027040032669901848, 0.040044017136096954, -0.021992309018969536, -0.011352685280144215, 0.005310429725795984, 0.059109024703502655, -0.010198651812970638, -0.014908608980476856, 0.07228188961744308, 0.004034425597637892, -0.012328453361988068, -0.019384006038308144, 0.03529652953147888, 0.05145299807190895, 0.03514641150832176, -0.037698421627283096, 0.04282120242714882, -0.018811682239174843, -0.06901682168245316, -0.05779549106955528, -0.008050085976719856, -0.020172126591205597, 0.056744661182165146, 0.037304360419511795, -0.0016548180719837546, 0.03824260085821152, 0.027021268382668495, 0.01513378694653511 ]
717,269
pytorch_optimizer.optimizer.nero
__str__
null
def __str__(self) -> str: return 'Nero'
(self) -> str
[ -0.018540596589446068, -0.00014578034461010247, 0.030673781409859657, -0.01993795670568943, 0.014007693156599998, -0.07995632290840149, 0.015558423474431038, 0.02966836281120777, 0.10135980695486069, -0.06499433517456055, -0.03786507993936539, 0.004473259672522545, -0.01007122453302145, 0.012039459310472012, 0.01867692358791828, -0.004417876247316599, -0.02712925523519516, -0.06087041273713112, 0.017254002392292023, 0.023363197222352028, -0.007072010543197393, 0.043250031769275665, 0.048225998878479004, -0.031116846948862076, -0.02455606497824192, 0.06632353365421295, -0.021914713084697723, -0.017467014491558075, -0.03113388828933239, 0.0027435992378741503, -0.016853539273142815, -0.06615312397480011, 0.0054957191459834576, 0.007459693122655153, -0.012474004179239273, 0.028202837333083153, -0.06870926916599274, 0.04393167048692703, -0.055417295545339584, -0.010105306282639503, -0.019222235307097435, -0.0019522582879289985, -0.045533522963523865, -0.02271563932299614, -0.04192083328962326, -0.04648781940340996, 0.029276419430971146, 0.052724819630384445, -0.014459279365837574, 0.01609521359205246, 0.006850477773696184, 0.014757496304810047, -0.03639955446124077, -0.02084112912416458, -0.0425683930516243, 0.028458451852202415, 0.022289613261818886, 0.005725772585719824, -0.01732216589152813, 0.05708731338381767, -0.04628332704305649, -0.004498821217566729, 0.04454514756798744, -0.049009885638952255, -0.01670869067311287, 0.013700955547392368, 0.027521198615431786, 0.04195491597056389, 0.05729180574417114, 0.03970550373196602, 0.050066426396369934, -0.02654986083507538, -0.006599123124033213, 0.02762344293296337, 0.036092814058065414, -0.02239185944199562, -0.09508872032165527, 0.025765975937247276, 0.02222144976258278, -0.016035571694374084, 0.018728047609329224, -0.003919427748769522, -0.021267155185341835, 0.004660710692405701, -0.026771394535899162, -0.07164032012224197, -0.012201348319649696, -0.04113694652915001, -0.036297306418418884, 0.008541795425117016, -0.06492616981267929, -0.002950221300125122, -0.04764660447835922, 0.015064234845340252, -0.057428132742643356, -0.0010884931543841958, 0.03137246146798134, -0.03953509405255318, 0.046555981040000916, -0.014774537645280361, 0.011289655230939388, 0.05528096854686737, -0.020415104925632477, 0.01088919211179018, -0.04703313112258911, -0.043250031769275665, -0.03704711049795151, 0.04914621263742447, 0.006560781039297581, 0.019989080727100372, -0.058689165860414505, 0.015796996653079987, 0.020159490406513214, 0.003184534842148423, 0.01773967035114765, -0.05749629810452461, -0.015549902804195881, 0.005866360384970903, 0.04979377239942551, -0.029514992609620094, 0.011852008290588856, 0.02917417325079441, -0.059098150581121445, -0.02908896841108799, 0.017910080030560493, 0.08868131041526794, -0.03684261813759804, -0.02721446007490158, 0.056405674666166306, -0.0287992712110281, 0.04123919457197189, 0.005235843826085329, -0.03714935854077339, 0.001578421681188047, 0.08322819322347641, 0.030758986249566078, -0.0023580468259751797, 0.028424371033906937, 0.0509866401553154, 0.10844885557889938, -0.02148868702352047, -0.008132812567055225, 0.050236836075782776, 0.027810893952846527, -0.012882987968623638, 0.011562311090528965, -0.015140919014811516, 0.0555536262691021, -0.023192785680294037, -0.015907764434814453, 0.0380014069378376, 0.06519882380962372, 0.04253431037068367, 0.003497662954032421, -0.014979030005633831, 0.026328328996896744, 0.0006741841207258403, -0.04856681823730469, 0.028833353891968727, -0.017373288050293922, -0.005551102105528116, -0.02198287658393383, 0.028509575873613358, -0.013837283477187157, -0.0007806903449818492, 0.03759242221713066, 0.006582082249224186, -0.007804773282259703, 0.04648781940340996, 0.031815528869628906, -0.05855283886194229, -0.06557372957468033, -0.07743425667285919, 0.02414708212018013, 0.013939529657363892, 0.037728749215602875, 0.007084791082888842, 0.06110898777842522, -0.0026392231229692698, -0.015592505224049091, -0.015055714175105095, -0.03150878846645355, -0.02479464001953602, 0.005764114670455456, 0.07525300979614258, -0.030537452548742294, 0.04699904844164848, 0.017961202189326286, 0.02344840206205845, -0.04563577100634575, 0.007357446942478418, 0.028662944212555885, -0.042193491011857986, 0.03297431394457817, 0.007110352627933025, -0.04001224413514137, 0.022766761481761932, -0.06461942940950394, -0.003276130184531212, -0.020568473264575005, -0.0017136845272034407, 0.07436687499284744, -0.021216031163930893, 0.025186581537127495, 0.027810893952846527, -0.006858997978270054, 0.009960458613932133, 0.016538280993700027, 0.023277990520000458, -0.05071398243308067, 0.0619269534945488, 0.030179591849446297, -0.02104562148451805, 0.023380236700177193, 0.05180460587143898, -0.05013459175825119, 0.006876039318740368, -0.01596740633249283, -0.011690118350088596, 0.02239185944199562, 0.03994407877326012, 0.007510816212743521, 0.003804400796070695, -0.04505637660622597, -0.03271869942545891, -0.0019139160867780447, 0.003542395541444421, -0.03660404682159424, 0.027435991913080215, -0.018557637929916382, -0.027674566954374313, -0.07518484443426132, -0.06840252876281738, 0.04008040577173233, 0.025885263457894325, 0.02288604900240898, -0.03471249341964722, -0.002888447605073452, -0.09058989584445953, -0.026294246315956116, -0.02072184346616268, -0.011869048699736595, -0.025237705558538437, -0.0021897670812904835, 0.06877743452787399, -0.03358779102563858, 0.019256317988038063, 0.026958845555782318, -0.027674566954374313, -0.02034694142639637, 0.0764799565076828, -0.07634363323450089, -0.02242594212293625, -0.025186581537127495, -0.011102204211056232, -0.056030772626399994, -0.03636547178030014, 0.020653679966926575, 0.019102949649095535, -0.006795094348490238, -0.07498035579919815, -0.03241196274757385, -0.04958928003907204, 0.045124538242816925, 0.011843487620353699, 0.009423666633665562, -0.061790626496076584, 0.036297306418418884, 0.049623358994722366, -0.02900376357138157, 0.09297563880681992, 0.017271041870117188, -0.06213144585490227, 0.036263223737478256, -0.028986722230911255, -0.035445258021354675, -0.027606403455138206, 0.04403391480445862, -0.0928393080830574, -0.049657441675662994, -0.0446133092045784, -0.02455606497824192, 0.005691690370440483, -0.023601770401000977, -0.005052653141319752, -0.055996689945459366, 0.038921620696783066, -0.023397278040647507, -0.00030434143263846636, 0.012295073829591274, 0.06294941157102585, 0.03203706070780754, -0.042841047048568726, 0.0050313519313931465, 0.01744997315108776, -0.004486040212213993, 0.018250899389386177, 0.04314778372645378, -0.017944160848855972, -0.029838772490620613, -0.015626586973667145, -0.02443677932024002, -0.0014420937513932586, -0.06690292060375214, -0.044681474566459656, -0.004822600167244673, 0.031355421990156174, 0.005640567280352116, 0.008852793835103512, 0.000050823418860090896, -0.021130826324224472, 0.022971253842115402, 0.04229573532938957, 0.08138776570558548, 0.019716424867510796, 0.09311196208000183, 0.01146006491035223, 0.014723414555191994, 0.02476055733859539, 0.06724374741315842, -0.03493402898311615, 0.02961723878979683, -0.0667325109243393, 0.0053253090009093285, 0.01589072309434414, -0.0065309591591358185, -0.05217950791120529, 0.0441361628472805, 0.01821681670844555, 0.04457922652363777, -0.0023495263885706663, -0.057223640382289886, 0.015566944144666195, -0.003084419062361121, -0.03224155306816101, 0.004963187966495752, 0.04457922652363777, 0.005810977425426245, -0.01564362831413746, -0.017586300149559975, 0.062199611216783524, -0.0013228068128228188, -0.03055449388921261, 0.013862844556570053, 0.025220664218068123, 0.017398850992321968, -0.03461024910211563, -0.008145593106746674, 0.033809322863817215, 0.03200297802686691, -0.03040112555027008, 0.01716027595102787, 0.013044876977801323, -0.010199031792581081, -0.005329569336026907, 0.0028607561253011227, 0.004311370197683573, 0.05885957553982735, -0.01601000875234604, -0.010914753191173077, -0.0461810827255249, -0.03909203037619591, 0.01135781966149807, 0.033485542982816696, -0.03513852134346962, -0.004558464512228966, 0.03224155306816101, 0.02169317938387394, 0.05998428165912628, -0.036297306418418884, -0.01682797633111477, 0.01920519582927227, -0.030264796689152718, -0.021999917924404144, -0.0077366093173623085, 0.05071398243308067, 0.04260247200727463, 0.0076812258921563625, -0.03256532922387123, -0.031031642109155655, 0.04897580295801163, 0.001578421681188047, 0.010676180012524128, 0.03929652273654938, -0.008507713675498962, 0.0026967364829033613, 0.04478371888399124, 0.04331819340586662, -0.017015427350997925, -0.0318666510283947, -0.03789915889501572, -0.03735384717583656, 0.0034614510368555784, 0.0042389458976686, -0.038955703377723694, -0.07716160267591476, -0.014697853475809097, -0.0359564870595932, -0.06748231500387192, 0.01491086557507515, 0.026464655995368958, -0.013666873797774315, -0.007331885863095522, 0.018983662128448486, -0.04577209800481796, 0.061586134135723114, 0.005499979481101036, -0.026260163635015488, -0.01735624670982361, -0.030741944909095764, -0.004206994082778692, -0.01407585758715868, -0.031065722927451134, -0.05920039862394333, 0.06775497645139694, 0.018029367551207542, -0.013206766918301582, -0.017015427350997925, 0.016700169071555138, -0.0361950621008873, -0.06472167372703552, 0.03014550916850567, 0.03530893102288246, 0.0841824859380722, 0.04117102921009064, 0.0298217311501503, 0.05238400027155876, 0.0021429043263196945, 0.08316002786159515, 0.0033080819994211197, -0.030418165028095245, -0.015396533533930779, -0.01920519582927227, -0.0364336334168911, 0.02966836281120777, -0.04866906628012657, -0.0008552446379326284, -0.053542789071798325, -0.04720354080200195, 0.05534913390874863, 0.0023857385385781527, -0.04127327725291252, 0.016171898692846298, 0.036263223737478256, 0.017944160848855972, -0.03898978233337402, -0.0309634767472744, 0.001725400215946138, 0.048021506518125534, -0.012729618698358536, -0.02484576217830181, 0.013411258347332478, -0.002749989740550518, -0.038955703377723694, 0.06346064060926437, -0.03212226554751396, -0.020483268424868584, -0.04106878489255905, 0.0050483932718634605, 0.00203213794156909, -0.055587708950042725, 0.07061786204576492, -0.036672208458185196, 0.016325267031788826, 0.0030077346600592136, 0.014927906915545464, 0.003538135439157486, 0.03496811166405678, -0.03684261813759804, -0.017015427350997925, 0.026856599375605583, -0.02394258975982666, -0.01647011563181877, -0.0398077517747879, -0.016027050092816353, 0.06666435301303864, -0.02803242765367031, -0.032582372426986694, 0.017961202189326286, -0.031559910625219345, -0.042670637369155884, -0.026992926374077797, 0.001103404094465077, 0.037933241575956345, -0.012533647939562798, 0.01568623073399067, 0.000055749329476384446, 0.021999917924404144, -0.011425983160734177, 0.015447656624019146, 0.03297431394457817, 0.039773669093847275, -0.07375340163707733, -0.006147536914795637, 0.0031525830272585154, 0.08234205842018127, -0.028628861531615257, -0.019375605508685112, -0.09433891624212265, -0.011698639020323753, 0.019597137346863747, -0.0021588802337646484, 0.007813293486833572, -0.017671504989266396, 0.024624230340123177, -0.03844447061419487, -0.006002688314765692, 0.026941804215312004, -0.012090581469237804, -0.030418165028095245, 0.00947478972375393, -0.03721752017736435, 0.0709586814045906, 0.0020672851242125034, 0.007267981767654419, -0.011425983160734177, -0.006173098459839821, 0.015737352892756462, -0.00399398198351264, 0.033110640943050385, 0.02598750777542591, -0.04031898081302643, -0.014229225926101208, -0.023482482880353928, -0.01867692358791828, 0.05504239723086357, -0.04832824692130089, 0.024948008358478546, -0.006305166054517031, 0.10524515062570572, 0.009270298294723034, 0.03294023126363754, 0.018745088949799538, 0.0221873689442873, -0.005921743810176849, 0.04931662231683731, -0.07020887732505798, 0.03326401114463806, 0.07886569947004318, 0.04318186640739441, 0.0016583012184128165, -0.06335839629173279, -0.0048396410420536995, -0.011332257650792599, 0.01192869246006012, -0.03425239026546478, 0.027197418734431267, 0.02046622894704342, 0.007877197116613388, 0.012627373449504375, 0.003787359921261668, -0.03960325941443443, -0.015737352892756462, -0.026873640716075897, -0.0017349857371300459, 0.05265665799379349, -0.021727262064814568, 0.00332512310706079, 0.04669231176376343, 0.02079000696539879, -0.025953426957130432, -0.015226123854517937, 0.06973172724246979, 0.03558158501982689, 0.021147867664694786, 0.07300359755754471, -0.025135459378361702, 0.0016178289661183953, 0.01932448148727417, -0.02794722281396389, 0.012269512750208378, -0.0548379048705101, 0.022033998742699623, 0.048157837241888046, -0.06748231500387192, 0.076957106590271, 0.034218307584524155, 0.021096745505928993, -0.04096653684973717, 0.004814079497009516, -0.06588046252727509, 0.03697894513607025, 0.002087521133944392, -0.0630175769329071, -0.02757232077419758, -0.013487943448126316, -0.025748934596776962, 0.0038299623411148787, 0.03933060169219971, -0.03909203037619591, -0.01969938352704048, 0.009491831064224243, -0.023635853081941605, -0.023107580840587616, 0.05361095070838928, -0.07832038402557373, -0.005691690370440483, -0.05831426382064819, 0.009091367945075035, 0.0019895355217158794, 0.0359564870595932, 0.026856599375605583, 0.005632047075778246, 0.03575199469923973, 0.0892266184091568, 0.03464433178305626, 0.012968192808330059, 0.012959672138094902, -0.019886834546923637, 0.01666608825325966, -0.011264094151556492, 0.004963187966495752, -0.019886834546923637, -0.018233858048915863, -0.025544442236423492, -0.00457550585269928, 0.022085122764110565, -0.03425239026546478, -0.047987427562475204, 0.016810936853289604, 0.008554576896131039, 0.05875733122229576, -0.033400338143110275, 0.030537452548742294, -0.055826280266046524, 0.006582082249224186, -0.0008307482348755002, -0.011903131380677223, 0.018131611868739128, -0.08724986761808395, 0.014263307675719261, -0.0009777267696335912, -0.015251685865223408, -0.05071398243308067, -0.07273094356060028, -0.02704405039548874, 0.027844976633787155, 0.033809322863817215, -0.03520668298006058, 0.026157919317483902, -0.01949489116668701, 0.0015304938424378633, -0.03537709265947342, 0.04212532564997673, -0.056814659386873245, 0.02140348218381405, -0.059950198978185654, -0.04570393264293671, -0.022460024803876877, -0.06110898777842522, -0.03220747038722038, 0.024658311158418655, -0.012158745899796486, 0.019631220027804375, -0.011366339400410652, -0.004464739002287388, 0.01993795670568943, 0.01964826136827469, -0.02978764846920967, -0.023516565561294556, 0.025271786376833916, -0.03575199469923973, 0.017415890470147133, -0.03336625546216965, 0.05943896993994713, 0.032292675226926804, -0.011425983160734177, -0.03694486618041992, -0.010020101442933083, -0.05309972167015076, 0.01944376900792122, 0.05153195187449455, 0.018864374607801437, -0.07048153132200241, 0.0026243124157190323, 0.03178144618868828, -0.009381064213812351, 0.021386440843343735, 0.05729180574417114, -0.03140654414892197, 0.00514637865126133, -0.006509657949209213, -0.010974396951496601, -0.07027704268693924, 0.026566902175545692, 0.07361707091331482, -0.03939876705408096, 0.02177838422358036, 0.03639955446124077, -0.05862100422382355, -0.05033908411860466, -0.013735037297010422, -0.0441361628472805, 0.04130735993385315, 0.08029714226722717, 0.020091326907277107, -0.01670869067311287, -0.012584771029651165, -0.03063969872891903, 0.015601025894284248, 0.025953426957130432, 0.019920917227864265, 0.0067397113889455795, -0.026873640716075897, 0.018898457288742065, -0.036467716097831726, -0.004848161246627569, -0.013888406567275524, 0.016981346532702446, -0.010701741091907024, 0.04975968971848488, 0.06734599173069, -0.024743515998125076, -0.01521760318428278, -0.01891549862921238, -0.03578607738018036, 0.03230971470475197, 0.05500831454992294, -0.03173032030463219, 0.020909294486045837, -0.0030077346600592136, -0.027027009055018425, 0.0030673781875520945, 0.013905446976423264, 0.0680617094039917, 0.0532701313495636, -0.03636547178030014, -0.05040724575519562, -0.0749121904373169, -0.02929346077144146, 0.0361950621008873, 0.028015386313199997, -0.020534392446279526, -0.0021961575839668512, 0.029770608991384506, -0.002769160782918334, 0.05998428165912628, 0.015430616214871407, 0.03680853545665741, 0.028015386313199997, 0.018131611868739128, 0.016044091433286667, 0.008716465905308723, -0.012721098959445953, 0.008413988165557384, 0.03622914478182793, 0.042057160288095474, 0.02990693598985672, -0.036263223737478256, 0.05183868855237961, 0.06342656165361404, 0.03520668298006058, 0.008452330715954304, 0.028748149052262306, -0.02365289255976677, -0.013121562078595161, 0.01029275730252266, 0.04127327725291252, 0.010914753191173077, 0.021352360025048256, -0.0009074326953850687, -0.02002316154539585, 0.005691690370440483, 0.01888141594827175, -0.0022856227587908506, 0.032463084906339645, 0.008733507245779037, -0.009108408354222775 ]
717,305
pytorch_optimizer.optimizer.novograd
NovoGrad
Stochastic Gradient Methods with Layer-wise Adaptive Moments for Training of Deep Networks. :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param lr: float. learning rate. :param betas: BETAS. coefficients used for computing running averages of gradient and the squared hessian trace. :param weight_decay: float. weight decay (L2 penalty). :param weight_decouple: bool. the optimizer uses decoupled weight decay as in AdamW. :param fixed_decay: bool. fix weight decay. :param grad_averaging: bool. multiply ck (1 - momentum). :param adam_debias: bool. Only correct the denominator to avoid inflating step sizes early in training. :param eps: float. term added to the denominator to improve numerical stability.
class NovoGrad(Optimizer, BaseOptimizer): r"""Stochastic Gradient Methods with Layer-wise Adaptive Moments for Training of Deep Networks. :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param lr: float. learning rate. :param betas: BETAS. coefficients used for computing running averages of gradient and the squared hessian trace. :param weight_decay: float. weight decay (L2 penalty). :param weight_decouple: bool. the optimizer uses decoupled weight decay as in AdamW. :param fixed_decay: bool. fix weight decay. :param grad_averaging: bool. multiply ck (1 - momentum). :param adam_debias: bool. Only correct the denominator to avoid inflating step sizes early in training. :param eps: float. term added to the denominator to improve numerical stability. """ def __init__( self, params: PARAMETERS, lr: float = 1e-3, betas: BETAS = (0.95, 0.98), weight_decay: float = 0.0, weight_decouple: bool = False, fixed_decay: bool = False, grad_averaging: bool = False, adam_debias: bool = False, eps: float = 1e-8, ): self.validate_learning_rate(lr) self.validate_betas(betas) self.validate_non_negative(weight_decay, 'weight_decay') self.validate_non_negative(eps, 'eps') defaults: DEFAULTS = { 'lr': lr, 'betas': betas, 'weight_decay': weight_decay, 'weight_decouple': weight_decouple, 'fixed_decay': fixed_decay, 'grad_averaging': grad_averaging, 'adam_debias': adam_debias, 'eps': eps, } super().__init__(params, defaults) def __str__(self) -> str: return 'NovoGrad' @torch.no_grad() def reset(self): for group in self.param_groups: group['step'] = 0 for p in group['params']: state = self.state[p] grad = p.grad g_2 = grad.pow(2).sum() # fmt: skip state['moments'] = grad.div(g_2.sqrt() + group['eps']) + group['weight_decay'] * p state['grads_ema'] = g_2 @torch.no_grad() def step(self, closure: CLOSURE = None) -> LOSS: loss: LOSS = None if closure is not None: with torch.enable_grad(): loss = closure() for group in self.param_groups: if 'step' in group: group['step'] += 1 else: group['step'] = 1 beta1, beta2 = group['betas'] bias_correction1: float = 1.0 - beta1 ** group['step'] bias_correction2_sq: float = math.sqrt(1.0 - beta2 ** group['step']) step_size: float = group['lr'] * bias_correction2_sq if not group['adam_debias']: step_size /= bias_correction1 for p in group['params']: if p.grad is None: continue grad = p.grad if grad.is_sparse: raise NoSparseGradientError(str(self)) state = self.state[p] grad_p2 = grad.pow(2).sum() if len(state) == 0: state['moments'] = grad.div(grad_p2.sqrt() + group['eps']) + group['weight_decay'] * p state['grads_ema'] = grad_p2 grads_ema = state['grads_ema'] grads_ema.mul_(beta2).add_(grad_p2, alpha=1.0 - beta2) de_nom = grads_ema.sqrt().add_(group['eps']) grad.div_(de_nom) self.apply_weight_decay( p=p, grad=p.grad, lr=group['lr'], weight_decay=group['weight_decay'], weight_decouple=group['weight_decouple'], fixed_decay=group['fixed_decay'], ) if group['grad_averaging']: grad.mul_(1.0 - beta1) moments = state['moments'] moments.mul_(beta1).add_(grad) p.add_(moments, alpha=-step_size) return loss
(params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], lr: float = 0.001, betas: Union[Tuple[float, float], Tuple[float, float, float]] = (0.95, 0.98), weight_decay: float = 0.0, weight_decouple: bool = False, fixed_decay: bool = False, grad_averaging: bool = False, adam_debias: bool = False, eps: float = 1e-08)
[ -0.01778150349855423, -0.018797297030687332, -0.007459407672286034, 0.0026048929430544376, -0.0198233500123024, -0.026533739641308784, -0.08676306903362274, -0.016868317499756813, 0.01920771785080433, 0.017914891242980957, -0.047116369009017944, -0.0003216035838704556, 0.02901678904891014, 0.050563909113407135, -0.016427114605903625, 0.07695399969816208, -0.003993912599980831, 0.017268477007746696, 0.017514729872345924, -0.010152798146009445, -0.021772852167487144, -0.08881517499685287, -0.0077159209176898, 0.033757153898477554, -0.03985191136598587, -0.034967899322509766, 0.0253435168415308, -0.009557686746120453, -0.06283550709486008, -0.004550546407699585, -0.01565757393836975, -0.07900610566139221, 0.00685403635725379, 0.036896876990795135, 0.05692543834447861, -0.033223606646060944, 0.009449951350688934, 0.044489674270153046, -0.12123846262693405, -0.010409311391413212, 0.010147667489945889, -0.06710388511419296, 0.01167648658156395, -0.006402572616934776, 0.0032192424405366182, -0.013656769879162312, -0.01831505261361599, 0.08430054038763046, -0.0202748142182827, -0.013841459527611732, 0.013584946282207966, -0.06784264743328094, 0.030576389282941818, -0.0037040526513010263, -0.031294625252485275, 0.03810762241482735, 0.06558533012866974, 0.014395528472959995, 0.04678803309798241, -0.02189597859978676, 0.02918095700442791, -0.0705103874206543, 0.037820324301719666, -0.034064970910549164, -0.028134383261203766, -0.01773020252585411, -0.06041401997208595, -0.010409311391413212, 0.03821022808551788, 0.026451654732227325, 0.026143839582800865, -0.012004824355244637, 0.0317666120827198, 0.02341453731060028, -0.02085966430604458, -0.024543195962905884, -0.038353875279426575, -0.032218076288700104, -0.025302475318312645, -0.053642068058252335, -0.005299565382301807, 0.004124734550714493, -0.037963975220918655, -0.031130459159612656, 0.021772852167487144, -0.036753229796886444, -0.005827982909977436, -0.006022932939231396, -0.0018930684309452772, -0.07297291606664658, 0.01773020252585411, 0.002790865022689104, 0.023311931639909744, -0.00794165302067995, 0.031294625252485275, 0.032135989516973495, -0.0238044373691082, -0.058402955532073975, -0.00238044373691082, -0.033675070852041245, -0.0031038112938404083, 0.036506976932287216, -0.012989834882318974, 0.06771951913833618, 0.022470567375421524, -0.06903287023305893, -0.060167767107486725, -0.02001830004155636, 0.021629204973578453, -0.06341009587049484, -0.06271237879991531, 0.008777886629104614, -0.018756255507469177, -0.03408549353480339, 0.007208024617284536, 0.0014249315718188882, 0.01209716871380806, 0.03149983659386635, -0.021321387961506844, 0.021136699244379997, 0.030514826998114586, 0.06197362020611763, -0.06940224766731262, 0.0007291391375474632, -0.006135798990726471, -0.02150607854127884, 0.0467059463262558, 0.030227530747652054, 0.04198610410094261, -0.04613135755062103, -0.019761787727475166, -0.0006098604644648731, -0.0016032083658501506, 0.01565757393836975, 0.030514826998114586, -0.01228185836225748, -0.028893662616610527, 0.03525519371032715, -0.024050690233707428, -0.000128256666357629, 0.03915419429540634, -0.0033885410521179438, -0.03227963671088219, 0.003706617746502161, -0.010763299651443958, 0.015749918296933174, 0.002014912199229002, 0.005355998408049345, -0.0023086199071258307, 0.003106376389041543, 0.007982694543898106, 0.006520568858832121, 0.006284576840698719, 0.009172916412353516, -0.011953521519899368, -0.008644499816000462, -0.035357799381017685, 0.001970022451132536, -0.025753939524292946, 0.03135618939995766, -0.04773200303316116, -0.030063362792134285, 0.020705755800008774, -0.008798407390713692, 0.0035809262190014124, 0.0006297402433119714, 0.023989127948880196, 0.0013608032604679465, -0.017884109169244766, 0.0374714694917202, -0.004127299413084984, -0.07309603691101074, 0.016478417441248894, 0.019710484892129898, -0.020880185067653656, 0.10917207598686218, 0.01847922056913376, -0.012404984794557095, -0.027929171919822693, -0.014333965256810188, 0.0407753586769104, -0.02341453731060028, -0.03365454822778702, -0.07523023337125778, -0.0306379534304142, 0.051179539412260056, -0.01186117623001337, -0.01988491415977478, -0.026841554790735245, 0.007438886910676956, 0.03931836411356926, -0.00543295219540596, 0.013492600992321968, 0.007916001603007317, 0.002055954420939088, 0.004219644237309694, 0.033736634999513626, -0.004827580880373716, 0.06221987307071686, 0.021403472870588303, 0.03383924067020416, 0.016088515520095825, 0.011871437542140484, -0.0025997627526521683, -0.010214361362159252, -0.013451559469103813, -0.039338886737823486, 0.03548092395067215, 0.00939351785928011, 0.0067770821042358875, -0.030535347759723663, 0.020993052050471306, 0.03640437126159668, 0.051713086664676666, 0.039338886737823486, -0.02780604548752308, 0.04338153451681137, 0.03921575844287872, 0.018017496913671494, -0.009732116013765335, -0.02725197747349739, -0.06492865830659866, -0.0061922320164740086, 0.013564425520598888, 0.06989475339651108, -0.028893662616610527, 0.023517142981290817, -0.01489829458296299, 0.02948877215385437, -0.03630176559090614, 0.027990734204649925, -0.052944350987672806, -0.03531675413250923, 0.024317463859915733, 0.08364386856555939, 0.00852650310844183, -0.03738938271999359, -0.007839047349989414, -0.027272498235106468, -0.015134287066757679, -0.02565133385360241, -0.040816400200128555, -0.0334903821349144, 0.03923628106713295, 0.030761079862713814, 0.01565757393836975, 0.06821202486753464, 0.013236087746918201, -0.009988629259169102, 0.04293007031083107, -0.003991347271949053, -0.024153295904397964, -0.021157220005989075, 0.04313528165221214, -0.06829410791397095, -0.016201382502913475, 0.030699515715241432, 0.03880533576011658, 0.0050969198346138, -0.0723162367939949, -0.013718333095312119, -0.06521595269441605, -0.08971810340881348, 0.05273914337158203, 0.03665062412619591, 0.036671146750450134, 0.05212350934743881, -0.029304083436727524, 0.024050690233707428, 0.028996266424655914, 0.1067095473408699, 0.050728075206279755, -0.059305883944034576, 0.001501885592006147, 0.021444514393806458, 0.010311836376786232, -0.011214762926101685, -0.013841459527611732, 0.004201688338071108, 0.026431133970618248, 0.025507686659693718, -0.02780604548752308, -0.048183463513851166, -0.030843162909150124, -0.019618140533566475, 0.049784108996391296, -0.004948142450302839, -0.0203876793384552, 0.03570665791630745, 0.021978061646223068, 0.05516062676906586, 0.016006432473659515, 0.09743402153253555, -0.004881448578089476, 0.04740366339683533, 0.03564509376883507, 0.0051764389500021935, 0.05343685671687126, -0.02663634531199932, -0.02011064626276493, 0.07572273910045624, 0.016704147681593895, -0.00752610107883811, -0.03158192336559296, -0.006156320217996836, -0.022716820240020752, 0.04354570433497429, 0.004494113847613335, 0.07986798882484436, -0.01761733554303646, -0.015000900253653526, -0.04147307574748993, 0.001719921943731606, 0.02573341690003872, 0.012333161197602749, -0.07789796590805054, -0.0188485998660326, -0.05327269062399864, 0.054709162563085556, 0.06349217891693115, -0.03164348378777504, 0.04793721064925194, 0.0003924654156435281, -0.015185588970780373, -0.034208618104457855, -0.03621968254446983, 0.016396332532167435, 0.0365685410797596, -0.03726625815033913, 0.004981488920748234, -0.018438179045915604, -0.052862267941236496, 0.032135989516973495, 0.03761511668562889, -0.06160424277186394, -0.03355194255709648, 0.060167767107486725, 0.03652749955654144, 0.0033013266511261463, -0.024317463859915733, 0.0537651963531971, 0.02526143379509449, -0.04699324443936348, 0.02803177759051323, -0.011840655468404293, -0.04904535040259361, 0.04600823298096657, -0.0025587205309420824, 0.027354581281542778, 0.030576389282941818, -0.008824058808386326, 0.05573521554470062, 0.007413235493004322, 0.09915779531002045, 0.04728053882718086, 0.02372235246002674, -0.009542295709252357, -0.013564425520598888, 0.050030361860990524, -0.0952177494764328, -0.07691296190023422, 0.05528375506401062, -0.02573341690003872, 0.07305499911308289, 0.06316384673118591, 0.008464939892292023, 0.002906296169385314, -0.022285878658294678, 0.039277322590351105, -0.055324796587228775, -0.01672467030584812, -0.07687191665172577, -0.004825016018003225, -0.010116886347532272, -0.02480996958911419, -0.01151231862604618, -0.029160436242818832, -0.029673462733626366, 0.06911495327949524, -0.0015788396121934056, 0.02011064626276493, -0.021362431347370148, 0.015616531483829021, 0.04908639192581177, 0.04194505885243416, -0.0033834108617156744, 0.0533137321472168, 0.008054519072175026, 0.0581977441906929, -0.08311031758785248, 0.021670246496796608, 0.005227741785347462, 0.01797645539045334, 0.03595291078090668, -0.048101380467414856, 0.03435226529836655, 0.050481826066970825, 0.046418651938438416, -0.0705924704670906, -0.0537651963531971, -0.010152798146009445, -0.03952357545495033, 0.0019315454410389066, 0.041821934282779694, -0.042191311717033386, -0.06882765889167786, 0.021382952108979225, 0.043668828904628754, 0.02273734286427498, 0.10162032395601273, -0.016570761799812317, 0.007546622306108475, -0.013010356575250626, 0.03334673494100571, 0.01228185836225748, 0.0022098624613136053, -0.014333965256810188, 0.0006951511604711413, 0.0476088747382164, 0.00817764550447464, 0.03515258803963661, -0.018561305478215218, 0.05643293261528015, 0.012415245175361633, 0.038579605519771576, -0.022983593866229057, -0.051713086664676666, -0.014929075725376606, -0.04785512760281563, -0.007536361925303936, 0.0023163154255598783, -0.010814602486789227, -0.0042709470726549625, -0.024296943098306656, -0.022593693807721138, -0.0032448936253786087, -0.013872240670025349, 0.0012716648634523153, 0.016611803323030472, 0.012363942340016365, 0.004981488920748234, -0.022552652284502983, 0.014344225637614727, -0.005879285745322704, -0.009721855632960796, -0.017873849719762802, 0.045433640480041504, -0.02901678904891014, -0.0542166568338871, -0.007315760478377342, 0.013800417073071003, -0.003611707827076316, 0.034434348344802856, -0.014734125696122646, 0.0013261738931760192, -0.021978061646223068, -0.011009552516043186, -0.012045865878462791, 0.005107180681079626, -0.02240900509059429, 0.009962977841496468, 0.014888034202158451, -0.048347633332014084, 0.020326117053627968, -0.033367253839969635, 0.017596814781427383, 0.07662566006183624, -0.036732710897922516, -0.018222706392407417, 0.00646926648914814, -0.00762357609346509, -0.030535347759723663, 0.021403472870588303, -0.04863492771983147, -0.04974306747317314, 0.018294531852006912, -0.043504662811756134, -0.020705755800008774, 0.028544804081320763, -0.015729397535324097, 0.030925247818231583, -0.051015373319387436, 0.030268574133515358, 0.054093532264232635, 0.003755355253815651, 0.03991347551345825, 0.008993357419967651, -0.0057099866680800915, 0.02242952585220337, 0.03808709979057312, -0.01980282925069332, -0.04892222210764885, 0.05273914337158203, 0.006823254749178886, -0.02872949279844761, -0.00833155307918787, 0.0004014433652628213, 0.001686575124040246, 0.0687866136431694, -0.01980282925069332, 0.009896284900605679, 0.0036373590119183064, -0.046336568892002106, -0.012610195204615593, 0.02419433742761612, -0.04223235696554184, -0.08955393731594086, 0.03170504793524742, -0.05676127225160599, 0.012805145233869553, -0.013071919791400433, -0.0016929879784584045, 0.02148555777966976, 0.024933096021413803, 0.022552652284502983, -0.031992342323064804, -0.012784624472260475, 0.07350645959377289, 0.03338777646422386, -0.057787325233221054, 0.02870897203683853, 0.022675778716802597, -0.031150979921221733, -0.017104309052228928, 0.013451559469103813, 0.059387966990470886, -0.03578874096274376, -0.01067095436155796, 0.07506605982780457, -0.00775183318182826, 0.03271058201789856, -0.009850111790001392, 0.0015377973904833198, 0.07100289314985275, -0.010214361362159252, -0.062630295753479, 0.04567989334464073, -0.05097432807087898, -0.05392936244606972, -0.026287486776709557, 0.0019430884858593345, -0.007305499631911516, -0.023373495787382126, -0.005019966047257185, -0.004050345625728369, 0.06948433071374893, 0.03952357545495033, 0.029386168345808983, -0.054791249334812164, -0.025528207421302795, -0.04198610410094261, 0.018807558342814445, -0.01351312268525362, 0.06410781294107437, 0.032218076288700104, 0.021239304915070534, -0.05561209097504616, 0.012168992310762405, 0.0286474097520113, 0.029509294778108597, -0.046952199190855026, -0.04953785613179207, 0.01467256247997284, -0.02503570169210434, -0.01412875484675169, 0.05458603799343109, 0.012835927307605743, -0.04155515879392624, -0.03937992826104164, 0.0621788315474987, 0.005730507895350456, -0.056556060910224915, -0.003024292178452015, -0.005009705200791359, -0.03307995945215225, 0.035747699439525604, 0.006582132074981928, -0.007597925141453743, -0.00952177494764328, -0.0467059463262558, 0.018910162150859833, -0.05261601507663727, 0.0014839296927675605, -0.03269005939364433, 0.012425505556166172, 0.02870897203683853, -0.0772002562880516, 0.022532131522893906, 0.042355481535196304, 0.015144547447562218, -0.008264859206974506, 0.03911315277218819, 0.0083725955337286, -0.0520414263010025, -0.039975039660930634, 0.0273340605199337, -0.06226091831922531, 0.006156320217996836, 0.06722701340913773, 0.039441488683223724, -0.05815670266747475, -0.004063171334564686, 0.06221987307071686, 0.004704454448074102, -0.0043196845799684525, 0.002852428238838911, -0.015483144670724869, 0.025281954556703568, 0.050112444907426834, -0.06574949622154236, -0.020490285009145737, -0.00871119275689125, -0.018017496913671494, -0.03777928277850151, -0.03771772235631943, -0.010352877900004387, -0.014569957740604877, 0.03203338384628296, 0.05553000792860985, 0.0017968759639188647, 0.010824862867593765, -0.019987519830465317, -0.004873753525316715, 0.0016557935159653425, -0.04007764160633087, -0.036896876990795135, 0.024686843156814575, -0.08471096307039261, -0.024707363918423653, -0.051261626183986664, -0.047116369009017944, 0.001309500541538, 0.009111353196203709, -0.014600738883018494, 0.02641061320900917, -0.001294751069508493, 0.036363329738378525, 0.004481288138777018, -0.045187387615442276, -0.047116369009017944, -0.0051892646588385105, 0.03864116966724396, 0.010281054303050041, 0.018694691359996796, -0.0608244426548481, -0.01965918205678463, 0.024214858189225197, 0.01585252396762371, 0.052862267941236496, 0.023619748651981354, -0.007213154807686806, 0.03433174639940262, -0.06812994182109833, -0.0202748142182827, 0.005220046266913414, 0.009362736716866493, 0.033757153898477554, 0.021157220005989075, 0.030124925076961517, -0.04945576936006546, 0.02918095700442791, -0.0016647715819999576, 0.02526143379509449, 0.0063769216649234295, -0.025322996079921722, -0.0051277014426887035, -0.021403472870588303, 0.019792569801211357, 0.03677375242114067, -0.010588870383799076, -0.054873332381248474, -0.01038878969848156, -0.04176037013530731, 0.024481631815433502, 0.024625280871987343, -0.004463332239538431, 0.041432034224271774, -0.0133284330368042, -0.034126535058021545, -0.006028063129633665, 0.05060495063662529, 0.05081016197800636, 0.009152395650744438, -0.009193438105285168, 0.020603150129318237, -0.029304083436727524, -0.039585139602422714, -0.00030493023223243654, 0.015072723850607872, -0.007367062848061323, -0.06324592977762222, -0.023209325969219208, 0.040118686854839325, 0.008962576277554035, 0.054955415427684784, -0.09094937145709991, -0.04892222210764885, -0.0043196845799684525, -0.023291410878300667, -0.06250716745853424, -0.020685235038399696, -0.026862075552344322, -0.03923628106713295, 0.010814602486789227, 0.030514826998114586, 0.043258409947156906, 0.019710484892129898, -0.022942552343010902, 0.02128034643828869, -0.015893565490841866, 0.006915599573403597, 0.016119297593832016, 0.019064070656895638, -0.005314956419169903, 0.04859388619661331, 0.02158816158771515, 0.023927563801407814, -0.041206300258636475, -0.03186921775341034, 0.020736537873744965, -0.001081845024600625, -0.007633836939930916, 0.008942054584622383, 0.028134383261203766, -0.03264901787042618, -0.0705103874206543, -0.014272402040660381, -0.035357799381017685, 0.026903118938207626, -0.030514826998114586, 0.04678803309798241, 0.01845869980752468, 0.02195754088461399, -0.022101188078522682, -0.015944868326187134, 0.016560500487685204, 0.06258925050497055, 0.023394016548991203, -0.035665612667798996, 0.0731370821595192, -0.030596910044550896, 0.051795173436403275, -0.026554260402917862, -0.0025099830236285925, 0.0037117479369044304, 0.03080212138593197, -0.004232469946146011, -0.02456371672451496, 0.049414727836847305, -0.028750015422701836, 0.07194685935974121, -0.015195850282907486, 0.020541587844491005, 0.013964585959911346, 0.05039973929524422, -0.03572717681527138, 0.007669748738408089, -0.046952199190855026, -0.07260353118181229, -0.10941832512617111, 0.02364026941359043, -0.032895270735025406, 0.05889546126127243, 0.022244837135076523, -0.003406497184187174, 0.010978770442306995, 0.031376712024211884, 0.0063153584487736225 ]
717,307
pytorch_optimizer.optimizer.novograd
__init__
null
def __init__( self, params: PARAMETERS, lr: float = 1e-3, betas: BETAS = (0.95, 0.98), weight_decay: float = 0.0, weight_decouple: bool = False, fixed_decay: bool = False, grad_averaging: bool = False, adam_debias: bool = False, eps: float = 1e-8, ): self.validate_learning_rate(lr) self.validate_betas(betas) self.validate_non_negative(weight_decay, 'weight_decay') self.validate_non_negative(eps, 'eps') defaults: DEFAULTS = { 'lr': lr, 'betas': betas, 'weight_decay': weight_decay, 'weight_decouple': weight_decouple, 'fixed_decay': fixed_decay, 'grad_averaging': grad_averaging, 'adam_debias': adam_debias, 'eps': eps, } super().__init__(params, defaults)
(self, params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], lr: float = 0.001, betas: Union[Tuple[float, float], Tuple[float, float, float]] = (0.95, 0.98), weight_decay: float = 0.0, weight_decouple: bool = False, fixed_decay: bool = False, grad_averaging: bool = False, adam_debias: bool = False, eps: float = 1e-08)
[ 0.01117346528917551, -0.03626828268170357, -0.01657349430024624, -0.007870255969464779, -0.05277475714683533, -0.021446924656629562, -0.09283454716205597, -0.03915978968143463, -0.019953301176428795, 0.02847462333738804, -0.03622998297214508, 0.041783206164836884, 0.01876606047153473, 0.07560041546821594, -0.04902154207229614, 0.03783850371837616, 0.024568218737840652, 0.030178887769579887, -0.0010549924336373806, 0.0036191686522215605, -0.0070324852131307125, -0.024778857827186584, -0.04090235009789467, 0.10486014932394028, 0.01595115102827549, 0.03705339506268501, -0.0030351229943335056, 0.008181427605450153, -0.028455473482608795, 0.015127741731703281, 0.01922563649713993, -0.018718186765909195, -0.00573513749986887, 0.05181730538606644, 0.04155341908335686, -0.011317082680761814, -0.013873480260372162, 0.013011773116886616, -0.07230677455663681, 0.03914063796401024, 0.08073235303163528, -0.03642147406935692, 0.0692429319024086, -0.03963851556181908, -0.02435757964849472, -0.013251136057078838, 0.03546402230858803, 0.037972547113895416, -0.01582668162882328, -0.024568218737840652, 0.018076693639159203, -0.03217038884758949, 0.030963998287916183, -0.01758839376270771, -0.051396023482084274, 0.05032368004322052, 0.04775770753622055, 0.06414928287267685, 0.03940872475504875, 0.01957031898200512, 0.013710713014006615, -0.04147682338953018, 0.028857603669166565, -0.02359161712229252, -0.0012554589193314314, -0.00875111110508442, -0.09206859022378922, -0.021561820060014725, 0.0216384157538414, 0.036153387278318405, 0.10148991644382477, -0.0015438913833349943, -0.024280983954668045, 0.03004484437406063, -0.009569733403623104, -0.004217576235532761, -0.08073235303163528, -0.043851301074028015, -0.06518333405256271, -0.007324507925659418, 0.05744712054729462, 0.032381027936935425, -0.02837887778878212, -0.04798749461770058, 0.023074593394994736, -0.04955771565437317, -0.03979170694947243, -0.05147262290120125, 0.034602317959070206, 0.01514689065515995, -0.054881151765584946, -0.027555469423532486, 0.023763960227370262, -0.019991599023342133, 0.06234927475452423, 0.007511211093515158, 0.016276683658361435, -0.05744712054729462, 0.02294054999947548, -0.006501099094748497, -0.018679888918995857, -0.009493136778473854, -0.03850872069597244, -0.0065872701816260815, 0.0194745734333992, -0.03914063796401024, -0.05085984990000725, -0.038815103471279144, 0.04446407034993172, -0.0670982375741005, -0.027038445696234703, 0.05733222886919975, -0.026502272114157677, 0.031519319862127304, -0.051357727497816086, 0.027900151908397675, 0.03155761957168579, 0.016994774341583252, -0.0030231548007577658, 0.016994774341583252, 0.032036345452070236, 0.038278933614492416, -0.029125690460205078, 0.053617313504219055, 0.050553467124700546, -0.009833032265305519, 0.013710713014006615, 0.004382736515253782, 0.027402276173233986, -0.018718186765909195, 0.03848957270383835, -0.0059553515166044235, -0.03948532044887543, -0.02636822871863842, 0.025180988013744354, -0.01944585144519806, 0.008880367502570152, 0.05526413023471832, -0.03783850371837616, 0.010914953425526619, 0.05373220890760422, 0.01290645357221365, 0.033032093197107315, -0.0148405060172081, -0.012140491977334023, 0.009670265950262547, -0.0105894198641181, -0.03990660235285759, -0.008090469986200333, 0.04293214902281761, 0.03937042877078056, 0.006898441817611456, -0.029010796919465065, 0.03848957270383835, 0.0033367204014211893, -0.049098141491413116, 0.015481999143958092, -0.011920277960598469, -0.0008808558923192322, 0.016056470572948456, -0.02253842167556286, 0.025046944618225098, 0.026138439774513245, -0.02223203517496586, -0.015031997114419937, 0.01418943889439106, -0.03885340318083763, 0.022174589335918427, -0.005194177385419607, -0.01954159513115883, 0.005069708451628685, -0.09574520587921143, -0.04151511937379837, 0.023285232484340668, -0.007870255969464779, 0.04220448434352875, 0.02979590743780136, -0.0011926261940971017, -0.0027957598213106394, -0.01152772270143032, 0.06594929844141006, 0.0028556007891893387, -0.02862781658768654, -0.0649152472615242, 0.02516184002161026, 0.005280348006635904, -0.04381300508975983, 0.05365561321377754, -0.039178937673568726, 0.023668214678764343, 0.0438896007835865, 0.019838405773043633, 0.014151141047477722, 0.018938401713967323, -0.014553271234035492, 0.011929851956665516, 0.03624913468956947, -0.01997244916856289, -0.001191429328173399, 0.0593620240688324, 0.0714259222149849, 0.024127790704369545, 0.021849054843187332, -0.018564995378255844, 0.02902994491159916, -0.005131942685693502, -0.016985198482871056, 0.0030590591486543417, -0.023323532193899155, -0.03718743845820427, -0.00152234872803092, -0.019953301176428795, 0.04247257113456726, 0.029355479404330254, -0.002992037683725357, -0.04787260293960571, 0.0004179876414127648, 0.024491623044013977, 0.013337306678295135, -0.0017198232235386968, 0.0841025859117508, -0.0296810120344162, -0.014601143077015877, -0.013691564090549946, 0.05610669031739235, 0.013825607486069202, 0.04074915871024132, -0.0469917468726635, -0.073570616543293, 0.037015095353126526, -0.020240535959601402, -0.049940697848796844, -0.039025746285915375, -0.005682477727532387, 0.02667461335659027, 0.003432465484365821, -0.036153387278318405, 0.027038445696234703, -0.08195789158344269, -0.04117043688893318, 0.05928542837500572, 0.03335762768983841, -0.0061516291461884975, -0.0170043483376503, 0.01959904283285141, -0.0016408334486186504, 0.031174637377262115, 0.012638366781175137, -0.06683015078306198, -0.031825706362724304, -0.03929383307695389, -0.012092619203031063, 0.00627609807997942, 0.04231937974691391, -0.05909394100308418, 0.02209799364209175, 0.031481023877859116, -0.0007222778513096273, 0.023438425734639168, -0.013059645891189575, -0.0014062576228752732, -0.0018945581978186965, -0.02138947881758213, 0.08103874325752258, 0.014361780136823654, 0.03538742661476135, 0.015616042539477348, -0.009947926737368107, 0.02204054594039917, 0.0004129011940676719, 0.13473264873027802, 0.033740609884262085, -0.010704313404858112, -0.005179815459996462, -0.003633530344814062, -0.01564476639032364, -0.0015558595769107342, -0.03035122901201248, -0.005610669031739235, 0.046570464968681335, 0.036861903965473175, -0.04438747465610504, 0.007209613919258118, 0.007606956176459789, 0.01610434241592884, -0.002850813325494528, -0.011068145744502544, 0.022921402007341385, -0.006989399902522564, 0.016516046598553658, 0.017799032852053642, 0.008875580504536629, 0.07391529530286789, 0.01187240518629551, 0.087779201567173, -0.016085194423794746, 0.051549218595027924, -0.00045897855306975543, 0.04886835068464279, -0.009579307399690151, 0.05005559325218201, -0.04262576252222061, 0.060817353427410126, -0.007161741144955158, -0.05449816957116127, -0.03360656648874283, 0.03195974975824356, 0.022634165361523628, 0.04316193610429764, 0.04676195606589317, 0.03115548938512802, 0.017119241878390312, 0.06315353512763977, 0.021044796332716942, 0.027555469423532486, -0.06652376800775528, 0.017578819766640663, -0.06135352700948715, 0.03312784060835838, 0.03684275224804878, -0.005414391402155161, 0.036306582391262054, -0.00024998473236337304, -0.02717248909175396, -0.06855356693267822, -0.04603429511189461, 0.025123540312051773, 0.023936301469802856, -0.0367853082716465, -0.0016707538161426783, -0.047681111842393875, -0.0000638425990473479, 0.02209799364209175, -0.03054272010922432, -0.04875345900654793, 0.0064436523243784904, 0.005907479207962751, 0.049098141491413116, -0.005371306091547012, -0.03395124897360802, 0.08915793150663376, -0.03381720557808876, -0.013988373801112175, 0.040327880531549454, -0.0009418934350833297, -0.042740657925605774, 0.0002309853007318452, -0.021963950246572495, 0.03421933576464653, 0.0030375164933502674, -0.009531434625387192, 0.010713888332247734, -0.004052415490150452, 0.09222178161144257, 0.028646964579820633, -0.013930927030742168, -0.016247961670160294, -0.0016420301981270313, 0.03395124897360802, -0.045115139335393906, -0.030887402594089508, 0.0010681573767215014, -0.04515343904495239, 0.05576200783252716, 0.021829906851053238, -0.007353231776505709, 0.008310684002935886, -0.044310878962278366, 0.035042744129896164, -0.0011668946826830506, 0.03465976193547249, -0.05947691947221756, -0.02832143008708954, -0.012647941708564758, 0.01764584146440029, -0.015127741731703281, -0.02868526242673397, 0.0017940257675945759, 0.05438327416777611, 0.0033774119801819324, 0.003690977580845356, -0.001925675431266427, 0.06495354324579239, 0.038317229598760605, 0.015166040509939194, -0.02872356027364731, 0.0028532070573419333, 0.015022422187030315, 0.06541312485933304, -0.006874505430459976, 0.004322895780205727, -0.001342826522886753, 0.01557774469256401, -0.021753309294581413, -0.060664162039756775, 0.029317181557416916, 0.03860446438193321, 0.044961947947740555, -0.04362151399254799, -0.039830002933740616, -0.018775634467601776, -0.050553467124700546, -0.013930927030742168, 0.03613423928618431, -0.014811783097684383, -0.0009083825862035155, 0.010101119056344032, 0.028800157830119133, 0.017913928255438805, 0.07154081761837006, -0.0008210150990635157, -0.008937814272940159, -0.031232085078954697, -0.0014110449701547623, -0.02933632954955101, -0.019915001466870308, -0.00657769525423646, -0.008674515411257744, 0.03104059398174286, -0.01550114806741476, 0.030676763504743576, 0.011441552080214024, 0.0689365491271019, 0.007736212573945522, 0.07238337397575378, 0.05863436311483383, -0.031576767563819885, -0.0024055982939898968, -0.011786234565079212, -0.05867265909910202, -0.04706834256649017, -0.009756436571478844, -0.04170661047101021, -0.036153387278318405, 0.02611929178237915, 0.013040496967732906, -0.008167065680027008, -0.0034252845216542482, 0.00402608560398221, -0.0296810120344162, 0.019560744985938072, -0.070468470454216, 0.011317082680761814, -0.026578867807984352, -0.06560461223125458, -0.035847004503011703, 0.026157589629292488, -0.005347369704395533, -0.039983198046684265, -0.014677739702165127, 0.02395544946193695, 0.013528796844184399, 0.048178985714912415, -0.007080357521772385, -0.020757559686899185, -0.03266826272010803, -0.010388354770839214, -0.026808656752109528, 0.0420512929558754, -0.002618631348013878, 0.05212368816137314, -0.030159739777445793, -0.02290225215256214, -0.011364955455064774, -0.048332177102565765, 0.017109667882323265, 0.06763441115617752, -0.012896878644824028, -0.0041098627261817455, 0.012724537402391434, -0.002197352470830083, 0.0028795369435101748, 0.03712999075651169, -0.02807249315083027, -0.055417321622371674, 0.015108592808246613, -0.006951101589947939, -0.023668214678764343, -0.008923453278839588, -0.009651116095483303, 0.0043803430162370205, -0.0426640622317791, 0.013423477299511433, 0.07966000586748123, 0.012973475269973278, -0.00328884762711823, -0.061315227299928665, 0.007367593236267567, 0.017664989456534386, 0.04339172691106796, -0.08057916164398193, -0.02355331927537918, 0.03224698454141617, 0.06223438307642937, -0.036804456263780594, -0.01253304723650217, 0.030676763504743576, 0.019455425441265106, 0.029719311743974686, 0.018450099974870682, 0.007343656849116087, -0.03688105195760727, -0.045459821820259094, -0.02812994085252285, 0.029757609590888023, -0.052353475242853165, -0.08961751312017441, -0.0024534708354622126, -0.02334268018603325, -0.0032337941229343414, -0.03171081095933914, -0.0035904450342059135, -0.029604416340589523, 0.013040496967732906, -0.03100229613482952, -0.033587418496608734, -0.043353427201509476, 0.05817478522658348, 0.003142836270853877, -0.029566118493676186, 0.0485236681997776, 0.049787506461143494, 0.04044277220964432, -0.033989548683166504, 0.004023692104965448, 0.05239177495241165, 0.02747887372970581, -0.03929383307695389, 0.07383870333433151, 0.019800107926130295, -0.0026042694225907326, -0.060817353427410126, -0.03810659050941467, 0.04630238190293312, -0.0014625079929828644, 0.02590865269303322, 0.025487372651696205, -0.028972499072551727, -0.05189390107989311, -0.027306532487273216, 0.018833082169294357, 0.02717248909175396, 0.012963900342583656, -0.04377470538020134, -0.005725563038140535, 0.005883542820811272, -0.03488955274224281, 0.07161740958690643, -0.04779600352048874, -0.02470226213335991, 0.026540569961071014, -0.0210256464779377, -0.0516258142888546, 0.020010747015476227, 0.023783108219504356, -0.007855894044041634, 0.00321943243034184, 0.000039345293771475554, 0.054727956652641296, 0.022078843787312508, -0.022557569667696953, -0.019522447139024734, -0.01622881181538105, 0.0019041327759623528, -0.013959650881588459, -0.0026449612341821194, 0.010388354770839214, -0.03603849560022354, -0.06257906556129456, 0.01517561450600624, -0.0011112428037449718, -0.018306482583284378, 0.010962825268507004, 0.008459088392555714, -0.03611509129405022, 0.020891603082418442, -0.013672415167093277, 0.027612917125225067, -0.05438327416777611, -0.0432768315076828, 0.006271310616284609, -0.027651214972138405, -0.123013436794281, -0.07483445107936859, 0.031921450048685074, -0.0014529334148392081, -0.061315227299928665, 0.0023206244222819805, -0.005558008793741465, 0.017856480553746223, 0.0012578526511788368, 0.0516258142888546, -0.018603293225169182, -0.015261785127222538, -0.052813053131103516, 0.02033628150820732, -0.030925700441002846, -0.020604368299245834, 0.03441082686185837, 0.060204584151506424, -0.07935362309217453, -0.00936866831034422, 0.028206536546349525, 0.006142054684460163, 0.010196863673627377, -0.0021794000640511513, -0.011939426884055138, 0.04710663855075836, 0.02587035298347473, -0.0593620240688324, 0.004579014144837856, -0.022710762917995453, -0.0010137023637071252, -0.01524263620376587, -0.0079612135887146, -0.04312364012002945, -0.043544918298721313, 0.02525758370757103, 0.07839617133140564, -0.006625568028539419, 0.0009323189151473343, -0.038278933614492416, -0.008741537109017372, 0.043698109686374664, -0.06537482142448425, -0.02466396428644657, 0.011518147774040699, -0.12531131505966187, 0.0062042889185249805, -0.030370378866791725, 0.040174685418605804, -0.020202238112688065, -0.00009469799260841683, -0.05243007466197014, 0.0013571882154792547, 0.014610718004405499, 0.026636315509676933, 0.02209799364209175, 0.024817155674099922, -0.024625666439533234, 0.00805217120796442, 0.05434497818350792, -0.016276683658361435, -0.003961457870900631, -0.002934590447694063, -0.04381300508975983, -0.02299799770116806, -0.0046675787307322025, 0.04124703258275986, 0.03783850371837616, -0.025372479110956192, 0.04676195606589317, -0.052506670355796814, -0.0037388501223176718, -0.009406966157257557, 0.0065872701816260815, 0.01690860278904438, 0.029604416340589523, 0.04875345900654793, -0.03119378723204136, -0.026598017662763596, -0.02531503140926361, 0.041898101568222046, 0.017052220180630684, 0.005907479207962751, 0.00817664060741663, -0.04074915871024132, -0.00036113892565481365, -0.019149040803313255, -0.015051146037876606, -0.05878755450248718, -0.006079820450395346, -0.043544918298721313, 0.0009550583781674504, 0.02742142602801323, 0.02349587343633175, -0.05438327416777611, -0.03728318214416504, 0.018957549706101418, -0.021829906851053238, 0.04745132103562355, 0.041093841195106506, 0.004533535335212946, -0.045766208320856094, 0.006525035481899977, -0.009564945474267006, -0.07341742515563965, 0.038068290799856186, -0.00967505294829607, -0.027057593688368797, -0.05744712054729462, -0.0057973721995949745, 0.029815055429935455, 0.007927702739834785, 0.029317181557416916, -0.03879595547914505, -0.059553515166044235, -0.07345572113990784, 0.009880905039608479, -0.02682780660688877, -0.013193689286708832, -0.011259635910391808, -0.06005139276385307, 0.06977910548448563, -0.027746960520744324, 0.02918313816189766, 0.011384104378521442, 0.006659078877419233, 0.01857456937432289, -0.0472981296479702, 0.02778525836765766, 0.04519173502922058, 0.0302937813103199, -0.0723450779914856, -0.007496849168092012, 0.034698061645030975, 0.052659861743450165, -0.022251185029745102, -0.05013218894600868, 0.009651116095483303, -0.03289805352687836, 0.0003551548579707742, 0.02575545944273472, -0.007894191890954971, 0.008645791560411453, -0.08586429804563522, -0.028359729796648026, 0.009708563797175884, 0.04308534041047096, -0.026502272114157677, 0.05334922671318054, 0.024223536252975464, -0.029317181557416916, -0.0037627865094691515, -0.001683918759226799, -0.026732061058282852, 0.053617313504219055, 0.009746861644089222, 0.05871095880866051, 0.07414508610963821, 0.014735186472535133, 0.03226613253355026, -0.049442823976278305, -0.005103219300508499, -0.007113868370652199, 0.04163001477718353, -0.010646866634488106, -0.012743686325848103, 0.06885994970798492, -0.013806458562612534, -0.010283035226166248, -0.013873480260372162, 0.015683064237236977, 0.04251087084412575, 0.0680173933506012, -0.04101724550127983, 0.031270384788513184, -0.035598065704107285, -0.0689365491271019, -0.1038643941283226, -0.006663866341114044, -0.04860026389360428, 0.07345572113990784, 0.010943676345050335, 0.014744761399924755, 0.012274535372853279, 0.03548317402601242, 0.01182453241199255 ]
717,310
pytorch_optimizer.optimizer.novograd
__str__
null
def __str__(self) -> str: return 'NovoGrad'
(self) -> str
[ 0.010985268279910088, -0.02487262897193432, 0.01457020454108715, -0.005176818463951349, 0.003388618119060993, -0.06452885270118713, 0.0006492362008430064, 0.0021189532708376646, 0.0917743667960167, -0.04530676454305649, -0.028064928948879242, -0.01540668960660696, 0.01540668960660696, -0.0035081161186099052, 0.019922003149986267, 0.007404600270092487, 0.02053656242787838, -0.06760165095329285, 0.015739576891064644, 0.00972200557589531, 0.003774852491915226, 0.03782961145043373, 0.0005126672331243753, -0.02123647928237915, -0.021099910140037537, 0.05104266107082367, 0.01917087286710739, -0.026187105104327202, -0.03407396376132965, -0.02241438627243042, -0.00718694319948554, -0.037761326879262924, -0.010592632927000523, 0.01768568530678749, -0.047048017382621765, 0.017165016382932663, -0.04756015166640282, 0.021799825131893158, -0.039741579443216324, 0.0033032626379281282, 0.007596650626510382, 0.0034547687973827124, -0.03782961145043373, -0.015466438606381416, -0.05073538050055504, -0.045579902827739716, -0.033117979764938354, 0.04039027914404869, 0.01150593813508749, -0.0011330959387123585, -0.0026332209818065166, 0.005236567463725805, -0.06650909781455994, -0.004052258096635342, -0.02873070165514946, 0.030574383214116096, 0.03277656063437462, -0.004886609502136707, 0.0032051035668700933, 0.050018396228551865, -0.01714794524013996, -0.01976836286485195, 0.0463993176817894, -0.02637488767504692, -0.014647024683654308, 0.04598961025476456, -0.009295227006077766, 0.053944751620292664, 0.047935716807842255, 0.027911288663744926, 0.026340745389461517, -0.023763004690408707, -0.007596650626510382, 0.02164618670940399, 0.029976895079016685, -0.03670291602611542, -0.07880031317472458, -0.025043340399861336, 0.015014054253697395, -0.05804182216525078, 0.03383496776223183, -0.012410707771778107, -0.024650704115629196, -0.010797486640512943, -0.013213050551712513, -0.08282909542322159, -0.018641667440533638, -0.06633839011192322, -0.03881973773241043, -0.0007372591644525528, -0.030250033363699913, 0.010054891929030418, -0.055139731615781784, 0.02082677185535431, -0.0374881885945797, -0.02478727325797081, 0.007114391308277845, -0.05053052678704262, -0.00503598153591156, 0.01684066466987133, 0.02437756583094597, 0.028286853805184364, -0.06405086070299149, 0.027006518095731735, -0.012419243343174458, -0.07347411662340164, -0.04206325113773346, 0.03277656063437462, 0.027911288663744926, -0.005142676178365946, -0.037658900022506714, 0.0029554383363574743, 0.03605421632528305, -0.000712719454895705, -0.001842614496126771, -0.031342584639787674, -0.005688952282071114, 0.007938073016703129, 0.029601329937577248, -0.024718988686800003, 0.028372209519147873, 0.01090844813734293, -0.0642215684056282, 0.04387278854846954, 0.0473894402384758, 0.09464231133460999, -0.03477388247847557, 0.01905137486755848, 0.04906241223216057, -0.047150444239377975, 0.07313269376754761, -0.007588115055114031, -0.05691513046622276, -0.030267104506492615, 0.07367897033691406, 0.026306603103876114, 0.03940015658736229, 0.01748083159327507, 0.06493856012821198, 0.10823092609643936, -0.0023088695015758276, -0.004455563612282276, 0.0021125515922904015, 0.040731701999902725, -0.0005713491700589657, 0.051588937640190125, -0.060090359300374985, 0.07716148346662521, -0.018436813727021217, 0.02022928185760975, 0.02576032653450966, 0.03680534288287163, 0.0291233379393816, -0.030079321935772896, -0.00664066756144166, 0.009389118291437626, 0.009141586720943451, -0.03246928006410599, 0.02084384299814701, -0.005121337249875069, 0.007980750873684883, -0.028952626511454582, 0.04134626314043999, 0.02388250268995762, 0.011275477707386017, 0.026613883674144745, 0.020365850999951363, 0.00044064840767532587, -0.005274977535009384, 0.017822254449129105, -0.03265706077218056, -0.09525687247514725, -0.07347411662340164, 0.027672292664647102, 0.0017700622556731105, 0.021373048424720764, 0.0066363997757434845, 0.07784432917833328, 0.01007196307182312, -0.024770202115178108, 0.003343806602060795, 0.0070162322372198105, -0.06954776495695114, -0.0004875939921475947, 0.06067077815532684, -0.04947211965918541, -0.007127194665372372, 0.020160997286438942, 0.03800032287836075, -0.03878559544682503, 0.010387779213488102, 0.0015150622930377722, -0.04090241342782974, 0.007029035594314337, 0.02480434440076351, -0.057427261024713516, -0.0009319767123088241, -0.04697973281145096, 0.013998322188854218, -0.004472634755074978, 0.021680328994989395, 0.03888802230358124, -0.01768568530678749, 0.03673705831170082, 0.027194300666451454, 0.0002630020026117563, 0.035200659185647964, -0.009739076718688011, 0.021151123568415642, -0.04380450397729874, 0.05087194964289665, 0.04482877254486084, -0.01976836286485195, 0.04216567799448967, 0.05373990163207054, -0.02686995081603527, 0.050120823085308075, -0.01684066466987133, -0.058519814163446426, 0.023131374269723892, 0.020758487284183502, -0.05616400018334389, 0.004244308453053236, -0.039468441158533096, -0.01130108442157507, -0.01714794524013996, 0.010438992641866207, -0.026409029960632324, -0.020604846999049187, -0.018607525154948235, 0.008475813083350658, -0.08535562455654144, -0.041926681995391846, 0.039639152586460114, -0.0021562965121120214, 0.07839060574769974, -0.04718458652496338, 0.011779075488448143, -0.06555312126874924, -0.012743594124913216, -0.014100749045610428, 0.020263424143195152, -0.02121940813958645, 0.03438124433159828, 0.07477152347564697, -0.031649865210056305, 0.006047445815056562, 0.0182661022990942, -0.03328869119286537, 0.00889405608177185, 0.057427261024713516, -0.04697973281145096, -0.013844681903719902, 0.004852467216551304, -0.010259745642542839, -0.02902091108262539, -0.039639152586460114, 0.018112463876605034, 0.014518991112709045, -0.02360936440527439, -0.07347411662340164, -0.03888802230358124, -0.04134626314043999, 0.045784756541252136, 0.0038025930989533663, 0.017771041020751, -0.012598490342497826, 0.02014392614364624, 0.0335618294775486, -0.02062191814184189, 0.07183529436588287, 0.020860914140939713, -0.05244249477982521, 0.01608099974691868, 0.012257067486643791, -0.03374961391091347, -0.007080249022692442, 0.04138040542602539, -0.060090359300374985, -0.03632735460996628, -0.006743093952536583, -0.046160321682691574, -0.0017487233271822333, 0.030437814071774483, -0.030181748792529106, -0.029891539365053177, 0.04069755971431732, -0.03132551163434982, 0.03079630807042122, 0.019631793722510338, 0.07579579204320908, 0.04906241223216057, 0.004963429644703865, 0.025606686249375343, 0.060773205012083054, 0.052681490778923035, 0.07238157093524933, 0.04209739342331886, -0.028713630512356758, 0.019785434007644653, 0.030471956357359886, -0.028406351804733276, -0.02191932313144207, -0.06015864387154579, -0.050018396228551865, -0.03957086801528931, 0.02755279466509819, -0.038068607449531555, 0.023848360404372215, -0.006188282743096352, -0.04028785228729248, 0.016191961243748665, 0.048242997378110886, 0.10290473699569702, -0.01836852915585041, 0.04284852370619774, -0.013400833122432232, -0.015568865463137627, 0.04117555171251297, 0.04097069799900055, -0.02874777279794216, 0.021099910140037537, -0.03484216332435608, -0.01056702621281147, 0.015278656035661697, -0.013767861761152744, -0.06469956040382385, 0.03943429887294769, 0.008582508191466331, 0.04960868880152702, -0.054764166474342346, -0.061865754425525665, 0.06507512927055359, -0.0138276107609272, -0.01836852915585041, -0.0025137229822576046, 0.05804182216525078, -0.017224764451384544, -0.025453045964241028, -0.02931112051010132, 0.06773822009563446, -0.03168400749564171, -0.04383864626288414, 0.042814381420612335, 0.015884680673480034, 0.019597651436924934, -0.03141086921095848, -0.03453488647937775, 0.04110726714134216, 0.04059513285756111, -0.036190785467624664, 0.005855395924299955, 0.012359494343400002, 0.02943061850965023, 0.01605539210140705, 0.020980412140488625, -0.007912466302514076, 0.027586936950683594, -0.005091462749987841, -0.0320766419172287, -0.05196450278162956, -0.037556473165750504, 0.007289370056241751, 0.049540404230356216, -0.025009198114275932, -0.001251526759006083, -0.006030374672263861, -0.003397153690457344, 0.04380450397729874, -0.024155640974640846, -0.030779236927628517, 0.012854556553065777, -0.028116142377257347, -0.011164515279233456, -0.029294049367308617, 0.057427261024713516, 0.030352460220456123, 0.005616399925202131, 0.0035828023683279753, -0.05749554559588432, 0.009252549149096012, -0.005454224068671465, 0.001121359528042376, 0.07511294633150101, 0.008134391158819199, 0.0027164428029209375, 0.0162858534604311, 0.014681166969239712, 0.02746743895113468, -0.03277656063437462, -0.013247192837297916, -0.038478314876556396, -0.0005564119783230126, -0.0011352298315614462, -0.04895998537540436, -0.08767729252576828, -0.0007143198745325208, -0.008458741940557957, -0.05141822621226311, 0.01235095877200365, 0.013315477408468723, -0.028867270797491074, -0.02022928185760975, 0.00319870188832283, -0.042404673993587494, 0.026409029960632324, 0.005496901925653219, -0.0024582420010119677, -0.00871054083108902, -0.004511044826358557, -0.010549955070018768, -0.010157318785786629, -0.046057894825935364, -0.032844845205545425, 0.05421788990497589, 0.01845388486981392, -0.0692063421010971, -0.03351061791181564, -0.0053774043917655945, -0.007972215302288532, -0.013349619694054127, 0.02984032593667507, 0.04988182708621025, 0.07347411662340164, -0.010310959070920944, 0.04264366999268532, 0.05558358132839203, 0.04909655451774597, 0.0721084326505661, 0.011070623993873596, -0.03398860991001129, 0.044419065117836, -0.009645185433328152, -0.018095392733812332, 0.003866609651595354, -0.06275345385074615, -0.01847095601260662, -0.023250872269272804, -0.049437977373600006, 0.022346101701259613, 0.04199496656656265, -0.05094023421406746, 0.021014554426074028, 0.03156450763344765, 0.01632853038609028, -0.041516974568367004, -0.05886123701930046, -0.028082000091671944, 0.016721166670322418, -0.01570543460547924, -0.03216199949383736, 0.0464334599673748, -0.014433635398745537, -0.010148783214390278, 0.06067077815532684, -0.033442333340644836, -0.02587982453405857, -0.06579211354255676, 0.03813689202070236, -0.006721755489706993, -0.04629689082503319, 0.0374881885945797, -0.051793791353702545, 0.056129857897758484, 0.021612044423818588, -0.02360936440527439, 0.021099910140037537, 0.0072381566278636456, -0.057700399309396744, -0.017301585525274277, 0.024155640974640846, -0.033715471625328064, 0.003420626511797309, -0.04278023913502693, -0.02249974198639393, 0.06896734237670898, -0.050120823085308075, -0.0018852923531085253, 0.0414486899971962, -0.03335697576403618, -0.021560830995440483, -0.03523480147123337, -0.00898794736713171, 0.09075009822845459, -0.024070285260677338, 0.0513499416410923, -0.05053052678704262, 0.0011021544924005866, -0.03663463145494461, -0.004942090716212988, 0.025640828534960747, -0.030147606506943703, -0.06924048066139221, -0.0023152711801230907, -0.03714676573872566, 0.05568600818514824, -0.005172550678253174, -0.03226442635059357, -0.0849459171295166, 0.048447851091623306, 0.031137730926275253, -0.00527924532070756, -0.004067195579409599, -0.008851378224790096, 0.04899412766098976, -0.05401303619146347, -0.020980412140488625, 0.01985371857881546, -0.02427513897418976, -0.039741579443216324, -0.0038089945446699858, -0.025401832535862923, 0.056334711611270905, 0.03998057544231415, 0.04056099057197571, -0.008036231622099876, 0.013452046550810337, 0.03810274973511696, 0.009047696366906166, 0.020690202713012695, -0.027808861806988716, -0.028474636375904083, -0.04168768599629402, -0.027177229523658752, -0.02055363357067108, 0.04373621940612793, -0.048038143664598465, 0.011565687134861946, -0.016294388100504875, 0.09641771018505096, 0.024650704115629196, 0.035815220326185226, 0.005300584249198437, 0.053193625062704086, -0.023165516555309296, 0.05322776734828949, -0.044077642261981964, 0.005808450281620026, 0.06678223609924316, 0.0153127983212471, -0.005168282892554998, -0.02577739767730236, 0.026409029960632324, 0.00868920236825943, 0.035200659185647964, -0.013486187905073166, 0.017617400735616684, 0.02350693754851818, 0.017301585525274277, -0.018436813727021217, -0.010199996642768383, 0.0013998321956023574, -0.035303086042404175, -0.049437977373600006, 0.006094391457736492, 0.09095495194196701, -0.013486187905073166, 0.02685287967324257, 0.06568969041109085, 0.010985268279910088, -0.04288266599178314, -0.03892216458916664, 0.08583361655473709, 0.0325717069208622, 0.001576945069245994, 0.039639152586460114, -0.017105266451835632, 0.021390119567513466, 0.017497902736067772, -0.05312534049153328, 0.008155729621648788, -0.09163779765367508, 0.02606760710477829, 0.05957822501659393, -0.043599650263786316, 0.06131947785615921, 0.0632314458489418, 0.03079630807042122, -0.03892216458916664, 0.004767111502587795, -0.05391060933470726, 0.03782961145043373, 0.018300244584679604, -0.06452885270118713, -0.035815220326185226, -0.005240835249423981, -0.01318744383752346, -0.004033053293824196, 0.04486291483044624, -0.036395639181137085, -0.04185839742422104, 0.020007357001304626, -0.02243145741522312, -0.014032464474439621, 0.032144926488399506, -0.06343629956245422, -0.04732115566730499, -0.028013715520501137, 0.019187944009900093, 0.007562508340924978, 0.01580786146223545, 0.02519698068499565, 0.008620917797088623, 0.030642667785286903, 0.050120823085308075, 0.06002207472920418, 0.021492546424269676, 0.0033160659950226545, -0.028713630512356758, -0.02577739767730236, 0.005966357886791229, 0.017224764451384544, -0.033903252333402634, -0.004169621970504522, -0.003341672709211707, -0.0031325514428317547, 0.021697400137782097, -0.01027681678533554, -0.042609527707099915, 0.05206692963838577, 0.0078057716600596905, 0.04138040542602539, -0.04810642823576927, 0.033237479627132416, -0.0444532074034214, 0.021355977281928062, 0.009867110289633274, -0.02538476139307022, 0.019529366865754128, -0.09238892793655396, -0.005462759640067816, 0.008625186048448086, -0.009611043147742748, -0.06766993552446365, -0.04079998657107353, -0.003781254170462489, 0.025913966819643974, 0.03002810850739479, -0.01090844813734293, 0.007711880374699831, -0.039741579443216324, 0.03180350363254547, -0.03477388247847557, 0.06005621701478958, -0.05391060933470726, 0.02427513897418976, -0.0917743667960167, -0.04165354371070862, -0.009662256576120853, -0.03325454890727997, -0.03050609864294529, 0.015671292319893837, -0.006760165095329285, 0.006751629523932934, -0.015201836824417114, -0.011727862991392612, -0.009790290147066116, -0.010959661565721035, -0.0316157229244709, -0.008270959369838238, -0.0033800825476646423, -0.020673131570219994, 0.043599650263786316, -0.015534723177552223, 0.06268516927957535, 0.04411178454756737, 0.0010146650020033121, -0.019495224580168724, 0.0035678651183843613, -0.05572015047073364, -0.009269620291888714, 0.03543965518474579, 0.020007357001304626, -0.03987814858555794, -0.0009202403016388416, 0.02132183499634266, 0.03537137061357498, 0.033903252333402634, 0.07511294633150101, -0.040219567716121674, 0.013580079190433025, -0.014536062255501747, 0.007938073016703129, -0.044692203402519226, 0.024923842400312424, 0.06094391271471977, -0.09341319650411606, -0.013230121694505215, 0.020980412140488625, -0.022841164842247963, -0.09532515704631805, -0.031171873211860657, -0.031752292066812515, -0.007831377908587456, 0.07340583205223083, -0.016354138031601906, -0.028082000091671944, -0.001667635515332222, -0.037385761737823486, -0.007054642308503389, 0.01615781895816326, 0.015253049321472645, -0.0010146650020033121, 0.025743255391716957, 0.0033928859047591686, -0.0207414161413908, 0.02342158369719982, -0.027877146378159523, -0.007122926879674196, -0.060773205012083054, 0.06463127583265305, 0.04598961025476456, -0.04465806111693382, 0.039058733731508255, 0.03823931887745857, -0.05886123701930046, 0.005624935496598482, 0.014647024683654308, -0.03810274973511696, -0.0010802821489050984, 0.01437388639897108, -0.0006524370401166379, -0.01650777831673622, 0.00017524576105643064, 0.04274609684944153, 0.03340819105505943, -0.009201335720717907, -0.024838486686348915, -0.054354459047317505, -0.010345101356506348, 0.037556473165750504, 0.027313798666000366, -0.014262924902141094, 0.0010477402247488499, 0.014775058254599571, 0.02666509710252285, 0.03241806477308273, 0.037761326879262924, 0.06835278123617172, 0.04660417139530182, 0.008416064083576202, 0.03021589107811451, -0.006469956133514643, -0.01737840473651886, -0.009943930432200432, 0.03967329487204552, 0.028064928948879242, 0.009798825718462467, -0.0340568944811821, 0.030847521498799324, 0.079005166888237, 0.044384922832250595, -0.007664934732019901, 0.013964179903268814, 0.0022619240917265415, -0.025931037962436676, 0.015961501747369766, 0.009389118291437626, 0.010242674499750137, 0.0036404172424227, 0.04394107311964035, -0.014066606760025024, 0.011292548850178719, 0.0030365262646228075, -0.00653824070468545, 0.04984768480062485, -0.02984032593667507, -0.013981251046061516 ]
717,331
pytorch_optimizer.optimizer.novograd
reset
null
@torch.no_grad() def step(self, closure: CLOSURE = None) -> LOSS: loss: LOSS = None if closure is not None: with torch.enable_grad(): loss = closure() for group in self.param_groups: if 'step' in group: group['step'] += 1 else: group['step'] = 1 beta1, beta2 = group['betas'] bias_correction1: float = 1.0 - beta1 ** group['step'] bias_correction2_sq: float = math.sqrt(1.0 - beta2 ** group['step']) step_size: float = group['lr'] * bias_correction2_sq if not group['adam_debias']: step_size /= bias_correction1 for p in group['params']: if p.grad is None: continue grad = p.grad if grad.is_sparse: raise NoSparseGradientError(str(self)) state = self.state[p] grad_p2 = grad.pow(2).sum() if len(state) == 0: state['moments'] = grad.div(grad_p2.sqrt() + group['eps']) + group['weight_decay'] * p state['grads_ema'] = grad_p2 grads_ema = state['grads_ema'] grads_ema.mul_(beta2).add_(grad_p2, alpha=1.0 - beta2) de_nom = grads_ema.sqrt().add_(group['eps']) grad.div_(de_nom) self.apply_weight_decay( p=p, grad=p.grad, lr=group['lr'], weight_decay=group['weight_decay'], weight_decouple=group['weight_decouple'], fixed_decay=group['fixed_decay'], ) if group['grad_averaging']: grad.mul_(1.0 - beta1) moments = state['moments'] moments.mul_(beta1).add_(grad) p.add_(moments, alpha=-step_size) return loss
(self)
[ -0.006492420099675655, -0.008421432226896286, -0.04003899171948433, 0.04119063913822174, -0.020364990457892418, -0.0030686643440276384, -0.04000060260295868, -0.026545505970716476, -0.0185991283506155, 0.020345795899629593, -0.03514448180794716, -0.00021668392582796514, 0.020691290497779846, 0.08806274831295013, -0.02737085334956646, 0.04088353365659714, 0.0067227501422166824, 0.054511379450559616, 0.02174696885049343, -0.004234708845615387, -0.008915681391954422, -0.06529849022626877, -0.01296564657241106, 0.051363538950681686, -0.06430039554834366, -0.010633557103574276, 0.045758847147226334, 0.002711173379793763, -0.02493319660425186, 0.011372532695531845, -0.01896381750702858, -0.06529849022626877, 0.027313271537423134, 0.01996191218495369, 0.04648822546005249, -0.03712148219347, 0.0028983161319047213, 0.018426381051540375, -0.06422361731529236, -0.029328657314181328, -0.01316718477755785, -0.019376492127776146, -0.004680972546339035, 0.013378320261836052, 0.013186379335820675, -0.005527914501726627, -0.0317855067551136, 0.04664177820086479, -0.012543375603854656, 0.0011234574485570192, -0.005993372295051813, -0.04602756351232529, 0.061689987778663635, -0.014654731377959251, 0.023877518251538277, 0.0837632566690445, 0.05616207420825958, -0.06142127141356468, 0.026200011372566223, -0.02593129314482212, 0.06691079586744308, -0.07669981569051743, 0.0368911512196064, -0.005216009449213743, 0.003063865704461932, -0.023800741881132126, -0.06268808245658875, -0.017466673627495766, 0.023244112730026245, 0.043801043182611465, 0.033359427005052567, 0.021209532395005226, 0.003594103967770934, 0.00818630401045084, -0.052284855395555496, -0.01959722489118576, -0.03145920857787132, -0.054242659360170364, 0.024491731077432632, -0.032572466880083084, 0.006377255544066429, 0.006031760945916176, -0.037946827709674835, 0.004457840695977211, -0.0010898676700890064, -0.04103708639740944, -0.007922383956611156, -0.03334023430943489, -0.01720755361020565, -0.028100231662392616, 0.021324697881937027, 0.0010406826622784138, 0.023685578256845474, 0.028656862676143646, 0.0528222918510437, 0.04403137415647507, -0.03760133311152458, -0.03059547021985054, -0.04525979980826378, -0.030883383005857468, 0.02226521074771881, 0.03470302000641823, 0.02096000872552395, 0.052899070084095, 0.04644983634352684, -0.04514463245868683, -0.017668211832642555, -0.04322522133588791, 0.021363085135817528, -0.05700661614537239, -0.018378395587205887, -0.01075831986963749, -0.04188162833452225, -0.011833191849291325, -0.03804279863834381, -0.006703556049615145, 0.007907988503575325, 0.008690150454640388, -0.028292173519730568, 0.03977027162909508, 0.04456881061196327, -0.0063100759871304035, -0.04522141069173813, -0.010355242528021336, 0.0051968153566122055, 0.04610434174537659, 0.04529818892478943, 0.016622131690382957, 0.027178913354873657, -0.05458815395832062, -0.014558760449290276, 0.0017178761772811413, -0.009328356012701988, -0.006871504709124565, 0.03314829245209694, -0.011631653644144535, -0.010739125311374664, 0.02366638369858265, 0.010038538835942745, 0.009736231528222561, -0.004457840695977211, 0.011660444550216198, -0.0023704771883785725, 0.01007692702114582, 0.027121329680085182, 0.023839130997657776, 0.036910343915224075, 0.029846899211406708, 0.0008691349648870528, 0.005978976842015982, 0.021938910707831383, 0.021343892440199852, 0.03564353287220001, 0.03103693574666977, -0.00812392309308052, 0.034472689032554626, -0.026161622256040573, 0.03286037966609001, -0.02262989990413189, -0.021689387038350105, -0.030883383005857468, -0.017773780971765518, -0.03044191747903824, -0.008195901289582253, 0.014923449605703354, 0.0035677121486514807, -0.0014695519348606467, 0.05604691058397293, -0.038503460586071014, 0.011305352672934532, 0.0015451288782060146, -0.029942870140075684, 0.05190097540616989, 0.033282652497291565, -0.02230359986424446, 0.128370463848114, 0.010633557103574276, -0.004328280221670866, -0.01776418276131153, -0.007284178864210844, 0.005849416367709637, -0.01077751349657774, -0.02218843437731266, -0.04545174166560173, 0.005331174470484257, 0.026737447828054428, -0.005532713141292334, 0.0157392006367445, 0.0291559100151062, 0.007173812482506037, -0.000951309921219945, -0.0030782613903284073, 0.04813892021775246, -0.0026559901889413595, -0.015921544283628464, 0.027121329680085182, 0.029904481023550034, 0.011305352672934532, 0.0743197351694107, 0.0014635537518188357, 0.0009675049805082381, -0.012956049293279648, 0.021132756024599075, 0.011823594570159912, -0.02422301471233368, -0.013733412139117718, -0.02040337771177292, 0.06084544584155083, -0.012668137438595295, -0.0055615040473639965, -0.061536435037851334, 0.0027615579310804605, 0.040614817291498184, 0.06368617713451385, 0.041574522852897644, -0.08307226747274399, -0.00878132227808237, 0.012044327333569527, 0.06322552263736725, -0.0075528970919549465, -0.04556690528988838, -0.06629658490419388, 0.029808510094881058, -0.00017094786744564772, 0.050288666039705276, -0.017658615484833717, 0.02685261145234108, -0.05923313647508621, -0.013100005686283112, 0.00010046936222352087, 0.002569616539403796, -0.03205422684550285, 0.005657474976032972, -0.006981871090829372, 0.0526687391102314, 0.007356157060712576, -0.059425078332424164, -0.03723664581775665, -0.01233223918825388, -0.0059357900172472, -0.022092463448643684, -0.047255989164114, -0.025048362091183662, 0.04541335254907608, -0.01233223918825388, 0.0392136424779892, 0.060615118592977524, 0.003937199246138334, -0.015643229708075523, 0.044952694326639175, -0.03312909975647926, -0.03919444978237152, -0.01967400126159191, 0.03345539793372154, -0.03904089704155922, -0.02808103710412979, 0.06007768213748932, 0.019626015797257423, 0.039136867970228195, -0.04092192277312279, 0.03184308856725693, -0.0477166511118412, -0.060730282217264175, 0.05167064443230629, -0.029251880943775177, 0.02059531956911087, 0.03466463088989258, -0.03337862342596054, 0.05263034999370575, 0.03977027162909508, 0.0952797457575798, 0.06725629419088364, -0.04549013078212738, -0.03145920857787132, -0.0031718327663838863, 0.02573935128748417, 0.016161471605300903, 0.017217149958014488, -0.004623390268534422, -0.037620529532432556, 0.06598947942256927, -0.048062145709991455, -0.08737175911664963, -0.007692054379731417, -0.055355921387672424, 0.033282652497291565, -0.018973413854837418, -0.00838784221559763, 0.05781277269124985, 0.00605575367808342, 0.030806606635451317, -0.000686190789565444, 0.095740407705307, 0.012149895541369915, 0.07086478918790817, 0.007341761142015457, -0.01857033744454384, 0.00728897750377655, -0.013176782056689262, 0.0036612835247069597, 0.08253483474254608, -0.017946528270840645, -0.011007843539118767, 0.004013976082205772, -0.020269019529223442, -0.010662348940968513, 0.025988874956965446, 0.0015067405765876174, 0.01604630798101425, -0.017188359051942825, 0.00024412556376773864, -0.0263343695551157, -0.0053263758309185505, 0.01757224090397358, 0.006122932769358158, -0.0948958620429039, -0.007692054379731417, -0.05696823075413704, 0.015105794183909893, 0.07263065129518509, -0.017034806311130524, 0.019347701221704483, 0.014808284118771553, 0.041804853826761246, -0.03700631484389305, -0.017898542806506157, 0.0735519751906395, 0.030134811997413635, -0.028061842545866966, -0.024242207407951355, -0.0631871297955513, -0.004740954376757145, 0.06115255132317543, 0.025163527578115463, -0.057659219950437546, -0.007802420761436224, 0.05094126611948013, 0.004400258418172598, 0.021689387038350105, -0.05773599445819855, 0.07716047018766403, 0.019750777631998062, -0.02573935128748417, 0.017149969935417175, 0.02071048505604267, -0.014750702306628227, 0.016430189833045006, 0.015364915132522583, 0.05416588485240936, 0.021804550662636757, 0.005163225810974836, -0.0118715800344944, -0.024088654667139053, 0.051401928067207336, 0.021286308765411377, 0.023397665470838547, -0.0015103394398465753, -0.013503083027899265, 0.015077002346515656, -0.07869600504636765, -0.0021329496521502733, 0.019769972190260887, -0.04533657431602478, 0.10433938354253769, 0.1052606999874115, 0.00619491096585989, -0.034798987209796906, -0.02541305124759674, 0.04744793102145195, -0.016583742573857307, 0.016391802579164505, -0.03829232230782509, 0.00009657055488787591, 0.031535983085632324, -0.034242358058691025, -0.024722062051296234, -0.039578329771757126, -0.010614363476634026, 0.08007798343896866, 0.0531294010579586, 0.02681422419846058, -0.04948251321911812, -0.02163180336356163, 0.038465071469545364, 0.04936734586954117, -0.026084845885634422, 0.02003869041800499, -0.06353262811899185, 0.03314829245209694, -0.07101834565401077, 0.07170933485031128, 0.007831212133169174, 0.005475130397826433, 0.021958105266094208, -0.060653503984212875, 0.037466976791620255, 0.03295635059475899, 0.024031072854995728, -0.039501555263996124, -0.024242207407951355, -0.026718253269791603, -0.017754586413502693, -0.0073225670494139194, 0.024280596524477005, -0.021650997921824455, -0.06526009738445282, -0.002766356570646167, 0.060576729476451874, 0.01625744253396988, 0.06902215629816055, -0.009822605177760124, 0.009894582442939281, -0.052284855395555496, -0.0030206788796931505, 0.026142427697777748, -0.04142097011208534, -0.01776418276131153, -0.015124987810850143, 0.010067330673336983, -0.0009381139534525573, 0.049098629504442215, 0.004112346097826958, 0.04007738083600998, 0.014050115831196308, -0.02681422419846058, -0.04629628360271454, -0.02545143850147724, -0.01238982193171978, -0.045758847147226334, -0.0005980176501907408, -0.03286037966609001, -0.056507568806409836, -0.027639571577310562, -0.028100231662392616, -0.03059547021985054, 0.022879423573613167, -0.014894658699631691, 0.030902577564120293, 0.045950789004564285, 0.01085428986698389, -0.01127656176686287, 0.011075022630393505, -0.011334143579006195, -0.021382279694080353, -0.006583592388778925, -0.04042287543416023, 0.057352110743522644, -0.045758847147226334, -0.0950494185090065, 0.025125138461589813, -0.006578793749213219, 0.0006256092456169426, 0.059578634798526764, -0.0056862663477659225, 0.01641099527478218, 0.007159417029470205, -0.04967445135116577, -0.036430492997169495, -0.009697843343019485, 0.015748796984553337, 0.018752681091427803, 0.002636795863509178, -0.030288364738225937, 0.015528065152466297, -0.010700737126171589, -0.02259151078760624, 0.05616207420825958, 0.04564368352293968, 0.0026631879154592752, 0.0042011188343167305, -0.009477110579609871, -0.027716347947716713, 0.04218873381614685, -0.02441495470702648, -0.00844542495906353, -0.020576125010848045, -0.05155548080801964, -0.009198795072734356, 0.028464920818805695, -0.0419967956840992, -0.01089267898350954, -0.056277237832546234, 0.02466447837650776, 0.03506770730018616, -0.012936855666339397, 0.026718253269791603, 0.006175716873258352, 0.010969455353915691, 0.03980866074562073, 0.07527944445610046, -0.04614273086190224, -0.06460750102996826, 0.04859958216547966, 0.032726019620895386, -0.034837376326322556, -0.03763972222805023, 0.03493334725499153, 0.019942719489336014, 0.08122963458299637, -0.021535832434892654, 0.0005617287242785096, 0.04955928772687912, -0.0418432392179966, -0.026353564113378525, -0.0043186829425394535, -0.023877518251538277, -0.061651602387428284, -0.0016626929864287376, -0.05731372535228729, 0.021900521591305733, 0.0034477487206459045, -0.018791070207953453, -0.009515498764812946, 0.002024982590228319, -0.017984915524721146, -0.049060240387916565, 0.040461260825395584, 0.06967475265264511, 0.039693497121334076, -0.05520236864686012, 0.03355136886239052, 0.013455097563564777, -0.010662348940968513, -0.010566378012299538, -0.013004034757614136, 0.03573950380086899, -0.0008661358733661473, -0.018435979261994362, 0.007509710267186165, -0.0033253859728574753, -0.009141212329268456, 0.032207779586315155, 0.056430794298648834, 0.08069219440221786, -0.0022049276158213615, -0.05385877564549446, -0.03003884106874466, -0.07174772024154663, -0.13128796219825745, -0.04115225002169609, 0.0022361180745065212, -0.02226521074771881, 0.01141092088073492, -0.01129575539380312, -0.03625774383544922, 0.04671855270862579, 0.017351510003209114, 0.010288062505424023, -0.03767811134457588, -0.0021413471549749374, -0.04959767684340477, 0.03445349261164665, -0.028253784403204918, 0.026104040443897247, 0.02107517421245575, 0.005460734944790602, -0.025509022176265717, 0.01555685605853796, 0.014174877665936947, 0.010700737126171589, -0.04668016731739044, -0.06000090390443802, 0.011458906345069408, -0.01920374482870102, 0.008810113184154034, 0.02863766811788082, 0.03881056606769562, -0.027946678921580315, -0.03984704986214638, 0.03533642366528511, -0.01033604796975851, 0.004417052958160639, -0.0045610093511641026, -0.017553048208355904, -0.01936689391732216, 0.003867620602250099, 0.018023304641246796, -0.04126741737127304, -0.012956049293279648, -0.035547561943531036, 0.027677960693836212, -0.03792763501405716, -0.016286233440041542, -0.0118139972910285, -0.004131540190428495, 0.05474170669913292, -0.11109572649002075, 0.03134404122829437, -0.002790349069982767, 0.03474140539765358, -0.03322507068514824, 0.015316929668188095, -0.07838889956474304, -0.07174772024154663, 0.003970789257436991, 0.00012491190864238888, -0.04606595262885094, 0.003380569163709879, 0.019789164885878563, 0.03245730325579643, -0.04445364326238632, -0.008819710463285446, 0.05478009581565857, 0.039578329771757126, -0.012015536427497864, 0.015230556018650532, -0.029059939086437225, 0.0473327673971653, 0.016084695234894753, -0.027351660653948784, -0.05827343091368675, -0.03270682692527771, 0.013714218512177467, -0.01366623304784298, -0.0682159960269928, -0.03238052502274513, -0.012898466549813747, -0.012792899273335934, 0.056622736155986786, -0.0053503685630857944, -0.04115225002169609, -0.010489601641893387, -0.03134404122829437, -0.0036828769370913506, 0.016948431730270386, -0.024837225675582886, 0.04349393770098686, -0.06833116710186005, -0.02040337771177292, -0.04234229028224945, -0.051209986209869385, 0.03238052502274513, 0.026142427697777748, -0.04840764030814171, 0.06345584988594055, 0.021343892440199852, 0.04034609720110893, 0.03416558355093002, -0.021324697881937027, -0.07036574184894562, -0.016622131690382957, 0.06660369038581848, -0.006377255544066429, -0.024031072854995728, -0.027581989765167236, -0.025566603988409042, -0.01625744253396988, 0.038541845977306366, 0.04138258099555969, 0.0007629673345945776, -0.023167336359620094, 0.051248371601104736, -0.03980866074562073, 0.027581989765167236, 0.036756791174411774, 0.0036468880716711283, 0.05374361202120781, 0.02593129314482212, 0.022802647203207016, -0.06284163892269135, -0.0015283339889720082, -0.023954296484589577, -0.021247921511530876, -0.0025456238072365522, -0.01992352493107319, -0.013982935808598995, -0.0003970789257436991, -0.02792748436331749, -0.02096000872552395, -0.0477934256196022, -0.07984764873981476, -0.02625759318470955, -0.0690605416893959, -0.0019578030332922935, 0.011622056365013123, -0.02366638369858265, 0.019865943118929863, -0.030461112037301064, -0.033762503415346146, 0.02048015594482422, 0.026180816814303398, 0.02740924246609211, -0.0318622849881649, 0.043685879558324814, 0.039424777030944824, 0.003373371437191963, -0.005096046254038811, 0.026986971497535706, -0.008997256867587566, 0.007188207935541868, -0.04341715946793556, -0.021247921511530876, 0.029789317399263382, 0.035470783710479736, 0.027063747867941856, -0.07132545113563538, -0.026315174996852875, -0.02474125660955906, 0.015883157029747963, -0.055432695895433426, 0.017217149958014488, -0.035432394593954086, -0.01509619690477848, -0.007711248472332954, 0.035797085613012314, 0.017581839114427567, 0.03608499839901924, -0.02785070799291134, 0.01553766243159771, 0.041804853826761246, 0.007764032576233149, 0.013637441210448742, -0.02445334382355213, 0.018157662823796272, 0.0012596158776432276, -0.0076824575662612915, -0.04560529440641403, -0.03385847434401512, -0.05458815395832062, 0.04522141069173813, -0.0210367850959301, -0.026468729600310326, 0.0370447039604187, 0.004477034788578749, -0.05063416063785553, -0.01955883577466011, 0.03715986758470535, 0.0033877668902277946, 0.01566242426633835, 0.003937199246138334, 0.017735391855239868, -0.008877293206751347, -0.00960187241435051, 0.012552971951663494, -0.005441540852189064, 0.008973264135420322, 0.05301423370838165, 0.023512830957770348, -0.020844843238592148, 0.01761063002049923, 0.019146161153912544, 0.04307166486978531, 0.014904255047440529, -0.03349378705024719, 0.03151679039001465, 0.039693497121334076, -0.018541546538472176, -0.01477949321269989, 0.04107547551393509, -0.07954054325819016, 0.07581688463687897, 0.04944412410259247, 0.025700964033603668, 0.0339544452726841, 0.06848471611738205, -0.0528222918510437, 0.03051869384944439, -0.07597043365240097, -0.074396513402462, -0.07443490624427795, -0.01288887020200491, -0.02222682163119316, 0.08330260217189789, 0.037025511264801025, 0.025201914831995964, 0.019769972190260887, 0.06664207577705383, 0.02462609112262726 ]
717,346
torch.optim.lr_scheduler
OneCycleLR
Sets the learning rate of each parameter group according to the 1cycle learning rate policy. The 1cycle policy anneals the learning rate from an initial learning rate to some maximum learning rate and then from that maximum learning rate to some minimum learning rate much lower than the initial learning rate. This policy was initially described in the paper `Super-Convergence: Very Fast Training of Neural Networks Using Large Learning Rates`_. The 1cycle learning rate policy changes the learning rate after every batch. `step` should be called after a batch has been used for training. This scheduler is not chainable. Note also that the total number of steps in the cycle can be determined in one of two ways (listed in order of precedence): #. A value for total_steps is explicitly provided. #. A number of epochs (epochs) and a number of steps per epoch (steps_per_epoch) are provided. In this case, the number of total steps is inferred by total_steps = epochs * steps_per_epoch You must either provide a value for total_steps or provide a value for both epochs and steps_per_epoch. The default behaviour of this scheduler follows the fastai implementation of 1cycle, which claims that "unpublished work has shown even better results by using only two phases". To mimic the behaviour of the original paper instead, set ``three_phase=True``. Args: optimizer (Optimizer): Wrapped optimizer. max_lr (float or list): Upper learning rate boundaries in the cycle for each parameter group. total_steps (int): The total number of steps in the cycle. Note that if a value is not provided here, then it must be inferred by providing a value for epochs and steps_per_epoch. Default: None epochs (int): The number of epochs to train for. This is used along with steps_per_epoch in order to infer the total number of steps in the cycle if a value for total_steps is not provided. Default: None steps_per_epoch (int): The number of steps per epoch to train for. This is used along with epochs in order to infer the total number of steps in the cycle if a value for total_steps is not provided. Default: None pct_start (float): The percentage of the cycle (in number of steps) spent increasing the learning rate. Default: 0.3 anneal_strategy (str): {'cos', 'linear'} Specifies the annealing strategy: "cos" for cosine annealing, "linear" for linear annealing. Default: 'cos' cycle_momentum (bool): If ``True``, momentum is cycled inversely to learning rate between 'base_momentum' and 'max_momentum'. Default: True base_momentum (float or list): Lower momentum boundaries in the cycle for each parameter group. Note that momentum is cycled inversely to learning rate; at the peak of a cycle, momentum is 'base_momentum' and learning rate is 'max_lr'. Default: 0.85 max_momentum (float or list): Upper momentum boundaries in the cycle for each parameter group. Functionally, it defines the cycle amplitude (max_momentum - base_momentum). Note that momentum is cycled inversely to learning rate; at the start of a cycle, momentum is 'max_momentum' and learning rate is 'base_lr' Default: 0.95 div_factor (float): Determines the initial learning rate via initial_lr = max_lr/div_factor Default: 25 final_div_factor (float): Determines the minimum learning rate via min_lr = initial_lr/final_div_factor Default: 1e4 three_phase (bool): If ``True``, use a third phase of the schedule to annihilate the learning rate according to 'final_div_factor' instead of modifying the second phase (the first two phases will be symmetrical about the step indicated by 'pct_start'). last_epoch (int): The index of the last batch. This parameter is used when resuming a training job. Since `step()` should be invoked after each batch instead of after each epoch, this number represents the total number of *batches* computed, not the total number of epochs computed. When last_epoch=-1, the schedule is started from the beginning. Default: -1 verbose (bool): If ``True``, prints a message to stdout for each update. Default: ``False``. .. deprecated:: 2.2 ``verbose`` is deprecated. Please use ``get_last_lr()`` to access the learning rate. Example: >>> # xdoctest: +SKIP >>> data_loader = torch.utils.data.DataLoader(...) >>> optimizer = torch.optim.SGD(model.parameters(), lr=0.1, momentum=0.9) >>> scheduler = torch.optim.lr_scheduler.OneCycleLR(optimizer, max_lr=0.01, steps_per_epoch=len(data_loader), epochs=10) >>> for epoch in range(10): >>> for batch in data_loader: >>> train_batch(...) >>> optimizer.step() >>> scheduler.step() .. _Super-Convergence\: Very Fast Training of Neural Networks Using Large Learning Rates: https://arxiv.org/abs/1708.07120
class OneCycleLR(LRScheduler): r"""Sets the learning rate of each parameter group according to the 1cycle learning rate policy. The 1cycle policy anneals the learning rate from an initial learning rate to some maximum learning rate and then from that maximum learning rate to some minimum learning rate much lower than the initial learning rate. This policy was initially described in the paper `Super-Convergence: Very Fast Training of Neural Networks Using Large Learning Rates`_. The 1cycle learning rate policy changes the learning rate after every batch. `step` should be called after a batch has been used for training. This scheduler is not chainable. Note also that the total number of steps in the cycle can be determined in one of two ways (listed in order of precedence): #. A value for total_steps is explicitly provided. #. A number of epochs (epochs) and a number of steps per epoch (steps_per_epoch) are provided. In this case, the number of total steps is inferred by total_steps = epochs * steps_per_epoch You must either provide a value for total_steps or provide a value for both epochs and steps_per_epoch. The default behaviour of this scheduler follows the fastai implementation of 1cycle, which claims that "unpublished work has shown even better results by using only two phases". To mimic the behaviour of the original paper instead, set ``three_phase=True``. Args: optimizer (Optimizer): Wrapped optimizer. max_lr (float or list): Upper learning rate boundaries in the cycle for each parameter group. total_steps (int): The total number of steps in the cycle. Note that if a value is not provided here, then it must be inferred by providing a value for epochs and steps_per_epoch. Default: None epochs (int): The number of epochs to train for. This is used along with steps_per_epoch in order to infer the total number of steps in the cycle if a value for total_steps is not provided. Default: None steps_per_epoch (int): The number of steps per epoch to train for. This is used along with epochs in order to infer the total number of steps in the cycle if a value for total_steps is not provided. Default: None pct_start (float): The percentage of the cycle (in number of steps) spent increasing the learning rate. Default: 0.3 anneal_strategy (str): {'cos', 'linear'} Specifies the annealing strategy: "cos" for cosine annealing, "linear" for linear annealing. Default: 'cos' cycle_momentum (bool): If ``True``, momentum is cycled inversely to learning rate between 'base_momentum' and 'max_momentum'. Default: True base_momentum (float or list): Lower momentum boundaries in the cycle for each parameter group. Note that momentum is cycled inversely to learning rate; at the peak of a cycle, momentum is 'base_momentum' and learning rate is 'max_lr'. Default: 0.85 max_momentum (float or list): Upper momentum boundaries in the cycle for each parameter group. Functionally, it defines the cycle amplitude (max_momentum - base_momentum). Note that momentum is cycled inversely to learning rate; at the start of a cycle, momentum is 'max_momentum' and learning rate is 'base_lr' Default: 0.95 div_factor (float): Determines the initial learning rate via initial_lr = max_lr/div_factor Default: 25 final_div_factor (float): Determines the minimum learning rate via min_lr = initial_lr/final_div_factor Default: 1e4 three_phase (bool): If ``True``, use a third phase of the schedule to annihilate the learning rate according to 'final_div_factor' instead of modifying the second phase (the first two phases will be symmetrical about the step indicated by 'pct_start'). last_epoch (int): The index of the last batch. This parameter is used when resuming a training job. Since `step()` should be invoked after each batch instead of after each epoch, this number represents the total number of *batches* computed, not the total number of epochs computed. When last_epoch=-1, the schedule is started from the beginning. Default: -1 verbose (bool): If ``True``, prints a message to stdout for each update. Default: ``False``. .. deprecated:: 2.2 ``verbose`` is deprecated. Please use ``get_last_lr()`` to access the learning rate. Example: >>> # xdoctest: +SKIP >>> data_loader = torch.utils.data.DataLoader(...) >>> optimizer = torch.optim.SGD(model.parameters(), lr=0.1, momentum=0.9) >>> scheduler = torch.optim.lr_scheduler.OneCycleLR(optimizer, max_lr=0.01, steps_per_epoch=len(data_loader), epochs=10) >>> for epoch in range(10): >>> for batch in data_loader: >>> train_batch(...) >>> optimizer.step() >>> scheduler.step() .. _Super-Convergence\: Very Fast Training of Neural Networks Using Large Learning Rates: https://arxiv.org/abs/1708.07120 """ def __init__(self, optimizer, max_lr, total_steps=None, epochs=None, steps_per_epoch=None, pct_start=0.3, anneal_strategy='cos', cycle_momentum=True, base_momentum=0.85, max_momentum=0.95, div_factor=25., final_div_factor=1e4, three_phase=False, last_epoch=-1, verbose="deprecated"): # Validate optimizer if not isinstance(optimizer, Optimizer): raise TypeError(f'{type(optimizer).__name__} is not an Optimizer') self.optimizer = optimizer # Validate total_steps if total_steps is None and epochs is None and steps_per_epoch is None: raise ValueError("You must define either total_steps OR (epochs AND steps_per_epoch)") elif total_steps is not None: if total_steps <= 0 or not isinstance(total_steps, int): raise ValueError(f"Expected positive integer total_steps, but got {total_steps}") self.total_steps = total_steps else: if epochs <= 0 or not isinstance(epochs, int): raise ValueError(f"Expected positive integer epochs, but got {epochs}") if steps_per_epoch <= 0 or not isinstance(steps_per_epoch, int): raise ValueError(f"Expected positive integer steps_per_epoch, but got {steps_per_epoch}") self.total_steps = epochs * steps_per_epoch if three_phase: self._schedule_phases = [ { 'end_step': float(pct_start * self.total_steps) - 1, 'start_lr': 'initial_lr', 'end_lr': 'max_lr', 'start_momentum': 'max_momentum', 'end_momentum': 'base_momentum', }, { 'end_step': float(2 * pct_start * self.total_steps) - 2, 'start_lr': 'max_lr', 'end_lr': 'initial_lr', 'start_momentum': 'base_momentum', 'end_momentum': 'max_momentum', }, { 'end_step': self.total_steps - 1, 'start_lr': 'initial_lr', 'end_lr': 'min_lr', 'start_momentum': 'max_momentum', 'end_momentum': 'max_momentum', }, ] else: self._schedule_phases = [ {
(optimizer, max_lr, total_steps=None, epochs=None, steps_per_epoch=None, pct_start=0.3, anneal_strategy='cos', cycle_momentum=True, base_momentum=0.85, max_momentum=0.95, div_factor=25.0, final_div_factor=10000.0, three_phase=False, last_epoch=-1, verbose='deprecated')
[ -0.011935117654502392, 0.029411541298031807, -0.051028717309236526, -0.00036377497599460185, -0.038078710436820984, 0.024722743779420853, -0.04311256855726242, -0.03895151615142822, -0.06527778506278992, -0.005815325304865837, 0.003607937367632985, 0.027402056381106377, 0.06511540710926056, 0.057118065655231476, 0.0035242089070379734, 0.0682818666100502, 0.011163800954818726, 0.022895941510796547, -0.02194194309413433, -0.010422930121421814, 0.0034328687470406294, -0.043924480676651, -0.027990693226456642, 0.06621148437261581, -0.015548129566013813, 0.009387741796672344, 0.021718667820096016, 0.005754431709647179, -0.08809253573417664, 0.05163765326142311, 0.00188389141112566, 0.003031986765563488, -0.02273355796933174, -0.025900017470121384, 0.03288246691226959, -0.027808012440800667, -0.02882290445268154, -0.0001290814543608576, -0.13745683431625366, 0.03619101271033287, 0.04948608577251434, -0.02476334013044834, 0.016075873747467995, 0.00978862401098013, -0.044086866080760956, -0.021069137379527092, 0.0008924697758629918, 0.045304734259843826, 0.011721991002559662, -0.06669863313436508, 0.025331679731607437, -0.08703704923391342, 0.02884320169687271, -0.012310627847909927, -0.018237590789794922, 0.03554148226976395, 0.023890534415841103, 0.003881958080455661, 0.0487147681415081, -0.05415458232164383, 0.04027087613940239, -0.0644252821803093, 0.01947575807571411, 0.042503636330366135, 0.020226776599884033, -0.05362683907151222, -0.026346569880843163, -0.02366725727915764, 0.004336121957749128, 0.01783163473010063, -0.009722655639052391, -0.00815972313284874, 0.04359971731901169, -0.019394567236304283, -0.028680820018053055, -0.009524752385914326, -0.06020333245396614, -0.06458766013383865, -0.01830863393843174, 0.008976710960268974, 0.024641552940011024, 0.04810583218932152, -0.008530158549547195, -0.03960104659199715, -0.010554865933954716, -0.03911389783024788, -0.0035039111971855164, -0.027097590267658234, -0.02322070673108101, -0.05086633563041687, 0.002572748577222228, -0.03818019852042198, 0.03089328110218048, 0.028193671256303787, 0.0056935385800898075, 0.022205814719200134, -0.05504768714308739, -0.05033859238028526, -0.03379587084054947, -0.0642222985625267, 0.003171534277498722, -0.005181018263101578, -0.0009489230578765273, 0.04347793012857437, 0.020967647433280945, -0.04077832028269768, -0.05898546427488327, -0.014512941241264343, 0.012554201297461987, -0.03866734728217125, -0.07627920806407928, 0.05200301483273506, -0.06726697832345963, 0.0035292834509164095, -0.014086687006056309, 0.042950186878442764, -0.016035277396440506, 0.02163747511804104, -0.013548795133829117, 0.027990693226456642, 0.040047597140073776, 0.027544140815734863, -0.03702322393655777, 0.0049805776216089725, -0.004823269322514534, -0.03450629487633705, 0.0021934332326054573, 0.02569703944027424, 0.02117062546312809, -0.06763233244419098, 0.03777424246072769, -0.00895641278475523, -0.022287005558609962, -0.016776148229837418, -0.0009273566538468003, -0.022144921123981476, 0.008240914903581142, 0.05496649444103241, -0.06592731922864914, -0.03211114928126335, 0.03584595024585724, 0.058782484382390976, 0.03056851588189602, -0.028640223667025566, 0.049851443618535995, 0.02971600741147995, 0.01750686950981617, 0.04554830864071846, -0.03085268661379814, 0.04230065643787384, 0.03671875596046448, -0.040088195353746414, 0.053058501332998276, 0.03016255982220173, 0.012665839865803719, 0.0064496323466300964, -0.04201648756861687, 0.011123205535113811, -0.02728026919066906, 0.026996100321412086, -0.02886349894106388, -0.02151568979024887, -0.0333087220788002, -0.005262209568172693, 0.0013599538942798972, 0.032760679721832275, -0.024986615404486656, 0.02439797855913639, -0.019435161724686623, 0.033166635781526566, 0.018582653254270554, -0.04814642667770386, -0.011326183564960957, 0.020247075706720352, -0.0019181439420208335, 0.06742935627698898, 0.06267967075109482, -0.011001418344676495, 0.002508049365133047, 0.03582565113902092, 0.004846104420721531, -0.003775394521653652, 0.003947925753891468, -0.10506151616573334, -0.035582076758146286, 0.04230065643787384, -0.011163800954818726, 0.023910831660032272, -0.0026539398822933435, 0.045791883021593094, 0.02153598703444004, -0.00045606662752106786, -0.0003818527329713106, -0.02437768131494522, -0.02977690100669861, -0.015558279119431973, 0.035642970353364944, 0.044168055057525635, 0.08123187720775604, 0.005008487030863762, 0.027381759136915207, 0.06150239333510399, 0.03783513605594635, -0.015081279911100864, -0.020866159349679947, -0.028010990470647812, -0.038525260984897614, 0.037997517734766006, -0.006759174168109894, 0.022063730284571648, -0.04027087613940239, -0.008469264954328537, -0.0020513483323156834, 0.07258500158786774, 0.01706031709909439, -0.040839213877916336, -0.022997429594397545, 0.02123151905834675, 0.03217204287648201, 0.004287914372980595, 0.019668586552143097, -0.037693049758672714, -0.0005965656018815935, -0.035988032817840576, 0.04688796401023865, -0.027341162785887718, 0.05403279513120651, -0.018054910004138947, -0.02809218317270279, 0.018491314724087715, 0.012950008735060692, -0.04587307199835777, -0.024621255695819855, 0.027158482000231743, 0.08086651563644409, 0.032273534685373306, -0.04023027792572975, 0.0301828570663929, -0.04908012971282005, 0.015517682768404484, -0.026245081797242165, -0.0073427362367510796, -0.014553536660969257, -0.03584595024585724, -0.01421862281858921, 0.04814642667770386, 0.06872841715812683, 0.020927052944898605, -0.06779471784830093, -0.011458119377493858, -0.020084692165255547, 0.016410786658525467, -0.028396649286150932, 0.016837041825056076, -0.06657684594392776, -0.03050762228667736, 0.038890622556209564, -0.004285376984626055, 0.054276369512081146, 0.006018303334712982, -0.00835762731730938, -0.0032958583906292915, -0.07429002225399017, 0.05772699788212776, -0.020602287724614143, 0.022144921123981476, -0.03811930492520332, -0.036820244044065475, -0.00978862401098013, 0.018146250396966934, 0.09361354261636734, 0.02037901058793068, -0.0544387511909008, 0.005353549961000681, 0.012127947062253952, -0.002988853957504034, -0.037672754377126694, -0.029066476970911026, -0.0074848211370408535, -0.019364120438694954, 0.058782484382390976, -0.004823269322514534, -0.03554148226976395, -0.056712109595537186, -0.010595462284982204, -0.016420936211943626, -0.03097447380423546, 0.019252482801675797, 0.021698368713259697, 0.020044097676873207, 0.012665839865803719, -0.053911007940769196, 0.039682239294052124, 0.009920559823513031, 0.116996631026268, 0.05488530546426773, -0.017648953944444656, -0.022084027528762817, 0.009961155243217945, -0.005541304592043161, 0.03448599576950073, 0.0006457244162447751, 0.057158660143613815, -0.022185517475008965, -0.05374862626194954, -0.030730899423360825, -0.03554148226976395, 0.005896516609936953, 0.07392466068267822, -0.03610982000827789, 0.03629250079393387, 0.0006755368085578084, 0.028559032827615738, -0.009707432240247726, -0.00022803331376053393, -0.04676617681980133, -0.007099162321537733, -0.003146162023767829, 0.044168055057525635, 0.00690633337944746, -0.0677541196346283, 0.05508828163146973, 0.03209085389971733, -0.008859998546540737, 0.005404294468462467, -0.039337173104286194, 0.06479064375162125, 0.05115050449967384, -0.06138060614466667, -0.018227441236376762, -0.0037170383147895336, -0.03700292482972145, 0.004447759594768286, 0.0272193755954504, -0.022571176290512085, -0.034364208579063416, 0.027848608791828156, 0.021820155903697014, 0.06966211646795273, -0.039337173104286194, 0.12000071257352829, 0.06316681206226349, -0.017293741926550865, 0.028640223667025566, -0.002161717740818858, -0.043315548449754715, 0.06523719429969788, 0.04583247750997543, 0.022469686344265938, -0.01098112016916275, -0.047456301748752594, 0.006135016214102507, -0.03781483694911003, 0.0660897046327591, -0.015740958973765373, -0.015375598333775997, -0.028559032827615738, -0.1007583737373352, 0.042584825307130814, -0.08354582637548447, -0.02115032821893692, 0.015213215723633766, -0.0710829645395279, 0.08549441397190094, 0.03509493172168732, 0.003902255790308118, -0.016086021438241005, -0.004219409078359604, 0.06523719429969788, -0.02356576919555664, -0.02644805982708931, -0.02435738407075405, 0.033186934888362885, 0.01218884065747261, -0.005967558827251196, 0.018460867926478386, 0.016431085765361786, 0.0097581772133708, 0.0301828570663929, -0.0034151081927120686, 0.056387342512607574, -0.01705016940832138, -0.013325518928468227, 0.015771405771374702, 0.05208420380949974, -0.029107073321938515, 0.01877548359334469, -0.03755096718668938, 0.05447934940457344, -0.05939142033457756, 0.04684736952185631, 0.02520989254117012, 0.025514358654618263, -0.04020998254418373, -0.031055664643645287, 0.04839000105857849, 0.043315548449754715, 0.07542669773101807, -0.02192164584994316, -0.04834940657019615, -0.009981452487409115, -0.008469264954328537, 0.016968976706266403, 0.019272780045866966, -0.0012559276074171066, -0.022043433040380478, 0.12422265857458115, 0.03732769191265106, -0.028010990470647812, 0.06028452515602112, -0.008251063525676727, -0.013690879568457603, -0.04114368185400963, 0.009813996031880379, -0.02194194309413433, 0.012127947062253952, -0.038931217044591904, -0.021698368713259697, 0.011468267999589443, 0.02403261885046959, 0.023403385654091835, 0.02689461037516594, 0.04154963791370392, 0.032720085233449936, 0.057970572263002396, -0.010940524749457836, -0.02437768131494522, 0.0010478749172762036, -0.047456301748752594, 0.002005678368732333, 0.017415529116988182, -0.008504786528646946, -0.0465226024389267, -0.032354723662137985, -0.0154567901045084, -0.008190169930458069, -0.008799104951322079, 0.05362683907151222, 0.029411541298031807, -0.039337173104286194, 0.016035277396440506, -0.04102189466357231, -0.004823269322514534, 0.0040849363431334496, -0.010625909082591534, -0.0083525525406003, 0.02242908999323845, -0.02884320169687271, -0.0632885992527008, 0.014766664244234562, -0.05326147750020027, 0.024337084963917732, 0.012777477502822876, 0.018176697194576263, 0.02230730466544628, -0.03420182690024376, 0.02766592800617218, 0.0007212068885564804, -0.03205025568604469, -0.05606257915496826, 0.020115138962864876, 0.021799858659505844, 0.02935064770281315, 0.0373682864010334, -0.02403261885046959, -0.011072460561990738, 0.020510947331786156, 0.04122487083077431, -0.014523089863359928, 0.013954751193523407, -0.04433043673634529, -0.00396061223000288, 0.050216805189847946, -0.03740888088941574, -0.0006190835265442729, -0.007657352369278669, -0.020825562998652458, -0.053099095821380615, 0.0073021408170461655, -0.049810849130153656, 0.034831058233976364, -0.016573170199990273, 0.057118065655231476, 0.027077291160821915, 0.005485485773533583, -0.007789288181811571, -0.05906665697693825, 0.0071397582069039345, -0.025128701701760292, 0.011823480017483234, -0.0608934611082077, -0.027483247220516205, 0.03619101271033287, 0.035196419805288315, -0.049039531499147415, -0.020927052944898605, 0.02890409529209137, -0.005082066636532545, 0.073072150349617, 0.04270661249756813, 0.06060928851366043, 0.013924304395914078, 0.008859998546540737, 0.016796445474028587, 0.043762098997831345, 0.022165218368172646, -0.07404644787311554, -0.03686084225773811, -0.08240915089845657, 0.04887714982032776, 0.012077203020453453, -0.011498714797198772, 0.029127370566129684, 0.0031436248682439327, -0.035135526210069656, -0.03170519322156906, 0.002069108886644244, 0.03872824087738991, 0.05338326469063759, -0.004062101244926453, 0.003080194117501378, 0.0002648231165949255, -0.007200651336461306, -0.02198253944516182, 0.010615759529173374, 0.044533416628837585, -0.020236926153302193, -0.06600850820541382, 0.025088105350732803, -0.0009482887689955533, 0.03182698041200638, -0.022469686344265938, 0.0014525627484545112, 0.06414110958576202, -0.0034810760989785194, 0.01078829076141119, -0.038931217044591904, -0.024722743779420853, -0.017679400742053986, -0.037185605615377426, -0.0033364540431648493, 0.019658438861370087, 0.007434076629579067, -0.004955205135047436, -0.002869604155421257, 0.007885702885687351, 0.026671335101127625, 0.052693139761686325, 0.01076799351722002, 0.030284347012639046, -0.0036180864553898573, -0.0018471016082912683, -0.023078620433807373, 0.005871144589036703, 0.00003314253262942657, -0.0032095927745103836, 0.02407321333885193, 0.052327778190374374, 0.05074454843997955, 0.026326272636651993, -0.04680677130818367, -0.022185517475008965, -0.049445487558841705, -0.0780654177069664, 0.02922886051237583, -0.002482677111402154, 0.029959581792354584, 0.009093423373997211, -0.019191589206457138, 0.04814642667770386, 0.027483247220516205, 0.005723985377699137, -0.02236819826066494, -0.05723985284566879, -0.04587307199835777, -0.007814660668373108, 0.005536230280995369, -0.023890534415841103, -0.03527761250734329, -0.02935064770281315, 0.03446569666266441, -0.03170519322156906, -0.007226023823022842, -0.051069315522909164, 0.009935783222317696, 0.03387705981731415, -0.04181350767612457, 0.025108402594923973, -0.05074454843997955, -0.0019688885658979416, -0.03131953626871109, 0.05330207571387291, -0.024235596880316734, -0.006464855745434761, 0.007185428403317928, 0.047821663320064545, -0.033978551626205444, 0.003399884793907404, 0.045710690319538116, 0.04692855849862099, -0.05362683907151222, 0.028213970363140106, -0.012280181050300598, 0.04274720698595047, 0.010433079674839973, -0.009052827954292297, 0.015994681045413017, -0.03363348916172981, 0.007073790300637484, -0.031197749078273773, -0.015050833113491535, 0.033207233995199203, 0.029107073321938515, -0.061258818954229355, -0.02973630651831627, -0.04522354155778885, -0.008002415299415588, -0.008799104951322079, 0.03943866491317749, -0.0819220021367073, 0.007119460497051477, -0.015619172714650631, -0.03405974060297012, 0.009930708445608616, -0.05451994389295578, -0.003673905273899436, 0.018531909212470055, -0.07583265751600266, 0.02681341953575611, -0.09718596190214157, 0.007388406433165073, -0.006667833775281906, -0.024276193231344223, -0.04037236422300339, 0.0424630381166935, 0.011356630362570286, -0.0004576524079311639, 0.03907330334186554, 0.016857339069247246, -0.06178656220436096, -0.0005410637822933495, 0.05208420380949974, -0.02439797855913639, -0.006774397566914558, -0.022530579939484596, -0.020987946540117264, 0.0031410877127200365, 0.03056851588189602, 0.07696933299303055, 0.06377574801445007, -0.02807188406586647, 0.034831058233976364, -0.01906980201601982, 0.04542652145028114, -0.011356630362570286, 0.00620605843141675, 0.027341162785887718, -0.024337084963917732, 0.03716530650854111, -0.06446587294340134, -0.004399552475661039, 0.015751108527183533, -0.014401302672922611, -0.022510282695293427, -0.01750686950981617, 0.000918476318474859, -0.001148729701526463, 0.005011024419218302, -0.01465502567589283, 0.0035495811607688665, -0.09848502278327942, -0.0610964372754097, 0.02324100397527218, 0.015984533354640007, 0.026996100321412086, 0.011113055981695652, -0.03410033881664276, -0.06544017046689987, 0.017314041033387184, -0.010493973270058632, -0.008905668742954731, 0.02557525224983692, -0.06113703176379204, -0.013629985973238945, 0.0062872497364878654, 0.006251728627830744, -0.0012965232599526644, -0.00446552038192749, 0.04567009583115578, 0.0016669584438204765, -0.03525731340050697, 0.08898564428091049, -0.023707853630185127, 0.008636722341179848, 0.05326147750020027, -0.046603795140981674, -0.035196419805288315, -0.0011696618748828769, -0.010133686475455761, -0.03608952462673187, 0.014370856806635857, -0.02606240101158619, -0.01159005519002676, 0.009017306379973888, -0.0024471560027450323, 0.0610964372754097, -0.010615759529173374, -0.017699697986245155, 0.011691544204950333, -0.023301897570490837, 0.033227529376745224, 0.038058411329984665, 0.01421862281858921, -0.0007034463342279196, -0.009235507808625698, -0.037632156163454056, 0.01136677898466587, -0.0007275499519892037, -0.04769987612962723, 0.017760591581463814, 0.00170247966889292, 0.005333252251148224, 0.017314041033387184, -0.010686801746487617, -0.04230065643787384, 0.016867488622665405, 0.017669251188635826, 0.00857582874596119, 0.024600958451628685, -0.00639888783916831, 0.03464837744832039, 0.057929977774620056, -0.0021249279379844666, 0.0033466031309217215, 0.036840543150901794, -0.009362369775772095, 0.04627902805805206, 0.004752227105200291, -0.013244327157735825, 0.030832387506961823, 0.019648289307951927, 0.005592049565166235, -0.004041803535073996, -0.03489195182919502, -0.026671335101127625, 0.030426431447267532, -0.04016938433051109, -0.01669495739042759, 0.05500709265470505, -0.0618271604180336, 0.007931373082101345, -0.0608934611082077, 0.0034633155446499586, 0.03539939597249031, 0.010707099922001362, -0.05521006882190704, -0.010504121892154217, -0.0017050168244168162, -0.02161717787384987, -0.08236855268478394, -0.008540308102965355, -0.0694185420870781, 0.1096082255244255, 0.04794345051050186, 0.019353970885276794, -0.000310493225697428, 0.018399974331259727, 0.00731228943914175 ]
717,347
torch.optim.lr_scheduler
__init__
null
def __init__(self, optimizer, max_lr, total_steps=None, epochs=None, steps_per_epoch=None, pct_start=0.3, anneal_strategy='cos', cycle_momentum=True, base_momentum=0.85, max_momentum=0.95, div_factor=25., final_div_factor=1e4, three_phase=False, last_epoch=-1, verbose="deprecated"): # Validate optimizer if not isinstance(optimizer, Optimizer): raise TypeError(f'{type(optimizer).__name__} is not an Optimizer') self.optimizer = optimizer # Validate total_steps if total_steps is None and epochs is None and steps_per_epoch is None: raise ValueError("You must define either total_steps OR (epochs AND steps_per_epoch)") elif total_steps is not None: if total_steps <= 0 or not isinstance(total_steps, int): raise ValueError(f"Expected positive integer total_steps, but got {total_steps}") self.total_steps = total_steps else: if epochs <= 0 or not isinstance(epochs, int): raise ValueError(f"Expected positive integer epochs, but got {epochs}") if steps_per_epoch <= 0 or not isinstance(steps_per_epoch, int): raise ValueError(f"Expected positive integer steps_per_epoch, but got {steps_per_epoch}") self.total_steps = epochs * steps_per_epoch if three_phase: self._schedule_phases = [ { 'end_step': float(pct_start * self.total_steps) - 1, 'start_lr': 'initial_lr', 'end_lr': 'max_lr', 'start_momentum': 'max_momentum', 'end_momentum': 'base_momentum', }, { 'end_step': float(2 * pct_start * self.total_steps) - 2, 'start_lr': 'max_lr', 'end_lr': 'initial_lr', 'start_momentum': 'base_momentum', 'end_momentum': 'max_momentum', }, { 'end_step': self.total_steps - 1, 'start_lr': 'initial_lr', 'end_lr': 'min_lr', 'start_momentum': 'max_momentum', 'end_momentum': 'max_momentum', }, ] else: self._schedule_phases = [ { 'end_step': float(pct_start * self.total_steps) - 1, 'start_lr': 'initial_lr', 'end_lr': 'max_lr', 'start_momentum': 'max_momentum', 'end_momentum': 'base_momentum', }, { 'end_step': self.total_steps - 1, 'start_lr': 'max_lr', 'end_lr': 'min_lr', 'start_momentum': 'base_momentum', 'end_momentum': 'max_momentum', }, ] # Validate pct_start if pct_start < 0 or pct_start > 1 or not isinstance(pct_start, float): raise ValueError(f"Expected float between 0 and 1 pct_start, but got {pct_start}") # Validate anneal_strategy if anneal_strategy not in ['cos', 'linear']: raise ValueError(f"anneal_strategy must by one of 'cos' or 'linear', instead got {anneal_strategy}") elif anneal_strategy == 'cos': self.anneal_func = self._annealing_cos elif anneal_strategy == 'linear': self.anneal_func = self._annealing_linear # Initialize learning rate variables max_lrs = self._format_param('max_lr', self.optimizer, max_lr) if last_epoch == -1: for idx, group in enumerate(self.optimizer.param_groups): group['initial_lr'] = max_lrs[idx] / div_factor group['max_lr'] = max_lrs[idx] group['min_lr'] = group['initial_lr'] / final_div_factor # Initialize momentum variables self.cycle_momentum = cycle_momentum if self.cycle_momentum: if 'momentum' not in self.optimizer.defaults and 'betas' not in self.optimizer.defaults: raise ValueError('optimizer must support momentum or beta1 with `cycle_momentum` option enabled') self.use_beta1 = 'betas' in self.optimizer.defaults max_momentums = self._format_param('max_momentum', optimizer, max_momentum) base_momentums = self._format_param('base_momentum', optimizer, base_momentum) if last_epoch == -1: for m_momentum, b_momentum, group in zip(max_momentums, base_momentums, optimizer.param_groups): if self.use_beta1: group['betas'] = (m_momentum, *group['betas'][1:]) else: group['momentum'] = m_momentum group['max_momentum'] = m_momentum group['base_momentum'] = b_momentum super().__init__(optimizer, last_epoch, verbose)
(self, optimizer, max_lr, total_steps=None, epochs=None, steps_per_epoch=None, pct_start=0.3, anneal_strategy='cos', cycle_momentum=True, base_momentum=0.85, max_momentum=0.95, div_factor=25.0, final_div_factor=10000.0, three_phase=False, last_epoch=-1, verbose='deprecated')
[ 0.004362520761787891, 0.00693031819537282, -0.019379038363695145, -0.005249939393252134, -0.02772127278149128, 0.010310960933566093, -0.055601634085178375, -0.02658776193857193, -0.09044214338064194, 0.014099269174039364, -0.0074026137590408325, 0.04486311972141266, 0.048840347677469254, 0.043908584862947464, -0.011573730036616325, 0.08288540691137314, 0.011126292869448662, 0.008799614384770393, -0.019925907254219055, -0.014735626056790352, -0.01609782688319683, -0.03657060116529465, -0.03201667591929436, 0.04096543788909912, -0.008879159577190876, 0.026886053383350372, 0.0005304004880599678, 0.0027244004886597395, -0.05949931591749191, 0.014158927835524082, -0.009659689851105213, 0.004295405000448227, -0.009271910414099693, 0.01423847209662199, 0.014139042235910892, -0.03416438028216362, -0.0018531391397118568, 0.021099189296364784, -0.13355527818202972, 0.04164156690239906, 0.02318723313510418, -0.0402495376765728, 0.01777820475399494, 0.019289551302790642, -0.047607406973838806, -0.03901659697294235, -0.005051078274846077, 0.027144573628902435, 0.018354902043938637, -0.05798796936869621, 0.004946676082909107, -0.09036259353160858, 0.05059032514691353, -0.004576296545565128, -0.03680923581123352, 0.0714309960603714, 0.04096543788909912, 0.024857668206095695, 0.04836307838559151, -0.02998829074203968, 0.0009476986015215516, -0.02245144546031952, -0.004978991113603115, 0.01575976237654686, 0.008685269393026829, -0.0455392487347126, -0.07147076725959778, -0.020761124789714813, 0.011991339735686779, 0.05393119901418686, 0.02463892102241516, -0.00749707268550992, 0.04784604161977768, 0.0032066393177956343, -0.016565149649977684, -0.018494104966521263, -0.08399903029203415, -0.07592526078224182, 0.0036814208142459393, -0.017947236075997353, 0.010002725757658482, 0.036709804087877274, -0.0052996547892689705, -0.056039128452539444, 0.028695693239569664, -0.06403335183858871, -0.017469968646764755, -0.0100623844191432, -0.013443026691675186, -0.04828353598713875, -0.024121882393956184, -0.033945631235837936, 0.022610535845160484, 0.06307882070541382, -0.0060951001942157745, 0.04812444746494293, -0.037346161901950836, -0.04056771472096443, -0.0060951001942157745, -0.058306146413087845, 0.0050461068749427795, 0.02133782207965851, 0.013979952782392502, 0.053732335567474365, 0.025275276973843575, -0.03744559362530708, -0.04514152556657791, -0.051067594438791275, 0.011484242975711823, -0.04454494267702103, -0.06192542240023613, 0.06976056098937988, -0.04935738816857338, 0.024519603699445724, -0.022630421444773674, 0.01536203920841217, -0.026050835847854614, 0.004106486681848764, -0.01198139600455761, 0.03875807672739029, 0.02388324774801731, 0.030246810987591743, -0.013085076585412025, 0.03201667591929436, 0.012945873662829399, -0.03573538362979889, 0.025911632925271988, 0.03406494855880737, 0.03000817820429802, -0.0719878077507019, 0.043431319296360016, -0.015083633363246918, -0.009754149243235588, 0.006144815590232611, -0.011504128575325012, -0.008466522209346294, 0.018156040459871292, 0.04355063661932945, -0.06299927830696106, -0.03255360201001167, 0.05317552387714386, 0.044624485075473785, 0.0147853409871459, -0.04891989007592201, 0.00209301570430398, 0.04530061408877373, 0.02463892102241516, 0.019478468224406242, -0.03114168718457222, -0.0035670753568410873, 0.02738320827484131, -0.051067594438791275, 0.03613310679793358, 0.03766433894634247, 0.017469968646764755, -0.01899125799536705, -0.023664500564336777, 0.0011751463171094656, -0.039374545216560364, 0.052539169788360596, -0.026448559015989304, -0.022212812677025795, 0.002881003776565194, -0.010291074402630329, 0.0005763871595263481, 0.005921096540987492, -0.012975702993571758, -0.012249859049916267, -0.01288621500134468, 0.0254144798964262, 0.010589366778731346, -0.05504482239484787, -0.03879784792661667, 0.019289551302790642, -0.011464356444776058, 0.08837398141622543, 0.06884580105543137, -0.01609782688319683, -0.03446267172694206, 0.03915579989552498, 0.05428914725780487, -0.01554101426154375, -0.011862079612910748, -0.1056351512670517, -0.011454413644969463, 0.052578940987586975, -0.008620639331638813, 0.005881324410438538, -0.0280593354254961, 0.02803944982588291, 0.00881452951580286, -0.002734343521296978, -0.0016343917232006788, 0.0015175606822595, -0.022690080106258392, -0.006552481558173895, 0.03993135690689087, 0.03756490722298622, 0.048561941832304, -0.0013174564810469747, 0.0326928049325943, 0.06415267288684845, 0.01901114545762539, -0.017400367185473442, -0.010738512501120567, -0.018146097660064697, -0.054885733872652054, 0.03490016609430313, -0.0013112419983372092, 0.019587842747569084, -0.04486311972141266, -0.016077939420938492, -0.0041288589127361774, 0.0546073243021965, 0.01798700913786888, -0.039692725986242294, 0.04776649549603462, 0.04066714644432068, 0.04820398986339569, 0.011424584314227104, 0.04720968380570412, -0.042317695915699005, 0.009813807904720306, -0.02998829074203968, 0.054050512611866, -0.031638842076063156, 0.021377595141530037, -0.03311041370034218, -0.0201247688382864, 0.010589366778731346, -0.001598348026163876, -0.08718081563711166, -0.045777883380651474, 0.0036366768181324005, 0.043073367327451706, 0.04625514894723892, -0.01838473230600357, 0.02887466736137867, -0.0880558043718338, -0.0013646859442815185, -0.01727110892534256, -0.011881965212523937, -0.02467869408428669, -0.024857668206095695, -0.014894714578986168, 0.02889455296099186, 0.06987987458705902, 0.021914521232247353, -0.0752093642950058, 0.012846442870795727, -0.011603559367358685, -0.004720471333712339, -0.015332209877669811, 0.023843474686145782, -0.05798796936869621, -0.019190119579434395, 0.020283857360482216, 0.015879077836871147, 0.06717536598443985, -0.006179616320878267, -0.006259161047637463, -0.032851893454790115, -0.052141446620225906, 0.07075487077236176, -0.01846427656710148, 0.01370154693722725, -0.007815251126885414, -0.04617560654878616, -0.01914040558040142, -0.024221312254667282, 0.022212812677025795, 0.040050674229860306, -0.0523403063416481, 0.0005257396842353046, 0.01180242095142603, -0.005607889965176582, -0.04215860739350319, -0.047965358942747116, -0.015053804032504559, 0.0016418490558862686, 0.07063554972410202, -0.020661694929003716, -0.011812363751232624, -0.029809316620230675, -0.03541720658540726, 0.02581220306456089, -0.026488332077860832, -0.02432074211537838, 0.02316734753549099, 0.011006975546479225, -0.01575976237654686, -0.02851671725511551, 0.04374949634075165, 0.03951374813914299, 0.15057781338691711, 0.03289166837930679, 0.017241278663277626, -0.021397480741143227, 0.001963755814358592, -0.019508298486471176, 0.04776649549603462, -0.028238311409950256, 0.06423221528530121, -0.0033706999383866787, -0.04740854352712631, -0.035099029541015625, 0.005786865018308163, 0.0014454734046012163, 0.081254743039608, -0.03368711099028587, 0.05436869338154793, 0.0029158045072108507, 0.04772672429680824, -0.009918210096657276, 0.01893160119652748, -0.049953971058130264, -0.01083794329315424, -0.011454413644969463, 0.037385933101177216, 0.041959743946790695, -0.04907898232340813, 0.048840347677469254, 0.01499414537101984, -0.02545425295829773, 0.014695853926241398, -0.04291427880525589, 0.05055055394768715, 0.042317695915699005, -0.051147136837244034, -0.012796727940440178, -0.03676946461200714, -0.03983192890882492, 0.0044843233190476894, 0.02967011369764805, -0.021834975108504295, -0.029689999297261238, 0.025195732712745667, 0.03277235105633736, 0.05464709922671318, -0.03639162704348564, 0.11001009494066238, 0.04319268465042114, -0.019090689718723297, 0.05476641654968262, -0.0029978349339216948, -0.05277780070900917, 0.048561941832304, -0.01600833795964718, 0.02054237760603428, -0.017599228769540787, -0.06470948457717896, 0.02581220306456089, -0.036252424120903015, 0.05727206915616989, 0.013612058945000172, 0.007855023257434368, -0.018563706427812576, -0.07262416183948517, 0.025195732712745667, -0.07186849415302277, -0.01554101426154375, 0.028715578839182854, -0.05500504747033119, 0.07552754133939743, 0.01976681873202324, -0.024459945037961006, -0.02386336214840412, -0.01426830142736435, 0.09760115295648575, -0.035099029541015625, -0.017032474279403687, -0.031002484261989594, 0.017052359879016876, -0.0020743724890053272, -0.013612058945000172, 0.026289470493793488, 0.008063827641308308, 0.009833693504333496, 0.01901114545762539, -0.002271990990266204, 0.05210167169570923, 0.01078822836279869, 0.0027567155193537474, 0.021099189296364784, 0.026110494509339333, -0.03692855313420296, 0.037027981132268906, -0.02732354961335659, 0.05894250422716141, -0.03802229091525078, 0.03032635524868965, 0.016714295372366905, 0.03219565376639366, -0.03390586003661156, -0.013134792447090149, 0.03999101743102074, 0.0387381911277771, 0.06371517479419708, -0.04716991260647774, -0.022212812677025795, -0.007452329155057669, -0.0150239747017622, 0.017340710386633873, 0.029351934790611267, 0.017191562801599503, -0.0561186708509922, 0.1126350685954094, 0.03901659697294235, -0.005931039806455374, 0.07226621359586716, -0.01796712353825569, -0.024877553805708885, -0.030863281339406967, 0.022670194506645203, -0.05074941739439964, -0.0002619376755319536, -0.04681196063756943, -0.038956936448812485, 0.03484050929546356, 0.0002661324106156826, 0.003452730132266879, 0.04335177317261696, 0.041243843734264374, 0.015600672923028469, 0.05798796936869621, 0.018126212060451508, -0.043829042464494705, -0.0016406060894951224, -0.05731184035539627, -0.028198538348078728, -0.0008961189305409789, 0.014158927835524082, -0.03342859074473381, -0.02360484190285206, -0.005175366532057524, -0.0032116107176989317, -0.010678854770958424, 0.03002806380391121, 0.0239031333476305, -0.02620992623269558, 0.035198457539081573, -0.02851671725511551, 0.012637638486921787, 0.010917487554252148, -0.03603367507457733, -0.009585116989910603, 0.009401170536875725, 0.0008780971402302384, -0.07437414675951004, 0.005901210475713015, -0.014417448081076145, 0.033269502222537994, 0.02316734753549099, 0.005940982606261969, 0.028278084471821785, -0.012309517711400986, 0.016077939420938492, 0.01702253147959709, -0.03110191412270069, -0.04096543788909912, 0.004394835792481899, 0.023425865918397903, 0.010718626901507378, 0.03947397693991661, -0.020423060283064842, 0.011822307482361794, 0.03802229091525078, 0.03645128384232521, -0.041164297610521317, 0.01499414537101984, -0.02879512310028076, -0.017947236075997353, 0.034323468804359436, -0.030505331233143806, -0.02461903542280197, -0.015461470000445843, 0.000933405477553606, -0.045380160212516785, 0.011156121268868446, -0.02123839221894741, 0.05389142408967018, -0.01921994984149933, 0.02352529764175415, 0.016585037112236023, 0.006527623627334833, 0.032851893454790115, -0.03531777486205101, -0.01999550871551037, -0.012100713327527046, 0.015143292024731636, -0.0791865885257721, -0.005369256250560284, 0.04184042662382126, 0.039692725986242294, -0.016903214156627655, -0.010499878786504269, 0.03293143957853317, -0.0016406060894951224, 0.08837398141622543, 0.014327960088849068, 0.03179793059825897, 0.021377595141530037, -0.0227696243673563, -0.004315291065722704, 0.04681196063756943, -0.006681741215288639, -0.08383994549512863, -0.02201395109295845, -0.095612533390522, 0.044584713876247406, 0.018623365089297295, -0.0062094456516206264, 0.009078020229935646, 0.015163177624344826, -0.05039146542549133, -0.013542457483708858, -0.024996871128678322, 0.02624969743192196, 0.03225531056523323, 0.00844663567841053, -0.002013471210375428, 0.03241439908742905, -0.00627904711291194, -0.050630100071430206, 0.006080185528844595, 0.06116975098848343, -0.012856386601924896, -0.04891989007592201, 0.0530959814786911, -0.012031111866235733, 0.012518322095274925, -0.06347654014825821, -0.006597225088626146, 0.08932851999998093, 0.0004393592826090753, 0.02766161412000656, -0.007994226180016994, -0.03138032183051109, -0.05098804831504822, -0.03336893394589424, 0.002535482170060277, 0.03832058236002922, 0.002940662205219269, -0.010440221056342125, 0.018961429595947266, 0.017549514770507812, 0.03657060116529465, 0.05436869338154793, 0.02467869408428669, 0.018533878028392792, 0.01844438910484314, 0.0048820460215210915, -0.03708764165639877, 0.03277235105633736, 0.007308154366910458, -0.012995589524507523, 0.00974917784333229, 0.02927239052951336, 0.05667548254132271, 0.027144573628902435, -0.036312080919742584, -0.0031494665890932083, -0.03484050929546356, -0.04720968380570412, -0.024897441267967224, 0.012538207694888115, 0.005866409745067358, 0.02159634232521057, -0.026886053383350372, 0.05281757563352585, 0.005110736470669508, -0.010649025440216064, -0.033229731023311615, -0.06761285662651062, -0.04052794352173805, 0.0022260041441768408, -0.019756874069571495, 0.02583208866417408, -0.03342859074473381, -0.02358495630323887, 0.03754502162337303, -0.046931277960538864, -0.004233261104673147, -0.06574355810880661, -0.009793921373784542, 0.03493993729352951, -0.05496527627110481, 0.022173039615154266, -0.004245689604431391, 0.0031917246524244547, -0.04832330718636513, 0.054885733872652054, -0.010499878786504269, -0.012518322095274925, -0.02622981183230877, 0.037405818700790405, -0.053334612399339676, -0.004519124049693346, 0.0376046821475029, 0.01609782688319683, -0.061328839510679245, 0.008173201233148575, -0.01331376750022173, 0.04299382492899895, 0.011325153522193432, -0.00013997974747326225, 0.006641969084739685, 0.013254108838737011, -0.00985358003526926, -0.036650147289037704, -0.04319268465042114, 0.012011225335299969, 0.03521834313869476, -0.047249455004930496, -0.01731088012456894, -0.04720968380570412, -0.007964396849274635, 0.03195701912045479, 0.0500732883810997, -0.03635185584425926, 0.002483281074091792, 0.016634751111268997, -0.02352529764175415, 0.015958623960614204, -0.06928329169750214, -0.013970009982585907, 0.029511023312807083, -0.10269200056791306, 0.016614865511655807, -0.07894795387983322, -0.00192274060100317, -0.01949835568666458, -0.02811899408698082, -0.0583856925368309, 0.030644534155726433, 0.019090689718723297, 0.02959056943655014, 0.024022450670599937, 0.012150428257882595, -0.041999515146017075, 0.012210086919367313, 0.02889455296099186, -0.004367492161691189, -0.00598075520247221, -0.021377595141530037, -0.024002565070986748, -0.007710848934948444, 0.05420960485935211, 0.08988533169031143, 0.05496527627110481, -0.014894714578986168, 0.050351694226264954, -0.030226925387978554, 0.009898323565721512, -0.017131906002759933, -0.02925250492990017, 0.016982758417725563, 0.004909389652311802, 0.05281757563352585, -0.04223814979195595, -0.022312242537736893, 0.026846282184123993, 0.006448079366236925, -0.00800416897982359, -0.028238311409950256, -0.017529627308249474, -0.033269502222537994, -0.0011111377971246839, -0.006124929524958134, 0.022153154015541077, -0.0627208724617958, -0.07437414675951004, -0.0002532374928705394, 0.01916029118001461, 0.008864244446158409, 0.03002806380391121, -0.01588902249932289, -0.06856739521026611, 0.03989158570766449, -0.013950123451650143, 0.018663138151168823, 0.03796263039112091, -0.040846120566129684, -0.017738431692123413, -0.0018369817407801747, -0.005155480466783047, -0.029113302007317543, -0.0032886695116758347, 0.05325507000088692, -0.016256915405392647, -0.03875807672739029, 0.08495356887578964, -0.007646218873560429, 0.0025827118661254644, 0.04907898232340813, -0.021516798064112663, -0.0810558870434761, -0.02583208866417408, -0.012309517711400986, -0.01932932250201702, 0.019965678453445435, -0.0330706425011158, -0.04895966500043869, 0.02360484190285206, -0.009739234112203121, 0.041999515146017075, 0.011494185775518417, 0.005269825924187899, -0.005235025193542242, -0.04601651430130005, 0.04828353598713875, 0.03957340866327286, 0.03313029929995537, -0.04104498401284218, 0.00998781155794859, 0.012289631180465221, 0.02386336214840412, 0.014745568856596947, -0.039374545216560364, -0.0033607566729187965, -0.0023826074320822954, -0.009162536822259426, 0.038956936448812485, 0.010708683170378208, -0.0042705475352704525, -0.03191724792122841, -0.008933845907449722, -0.01731088012456894, 0.06256178021430969, -0.015033917501568794, 0.010758399032056332, 0.08033998310565948, -0.021496912464499474, -0.013065190985798836, -0.002463395008817315, -0.017320822924375534, 0.03802229091525078, 0.031340546905994415, -0.011096463538706303, 0.05456755310297012, 0.005727206822484732, 0.02694571204483509, -0.023644614964723587, -0.018623365089297295, -0.003415443701669574, 0.05651639401912689, -0.0280593354254961, -0.030664419755339622, 0.04637446627020836, -0.017261164262890816, 0.012607809156179428, -0.0432722307741642, 0.02245144546031952, 0.06359586119651794, -0.0030251783318817616, -0.06987987458705902, 0.020661694929003716, 0.003059979062527418, 0.0051455372013151646, -0.07739683985710144, -0.03531777486205101, -0.06371517479419708, 0.0859876498579979, 0.03368711099028587, 0.006149786990135908, 0.020701466128230095, 0.026070723310112953, 0.006328762508928776 ]
717,348
torch.optim.lr_scheduler
_annealing_cos
Cosine anneal from `start` to `end` as pct goes from 0.0 to 1.0.
@staticmethod def _annealing_cos(start, end, pct): "Cosine anneal from `start` to `end` as pct goes from 0.0 to 1.0." cos_out = math.cos(math.pi * pct) + 1 return end + (start - end) / 2.0 * cos_out
(start, end, pct)
[ -0.056078411638736725, -0.03851332888007164, 0.026894399896264076, -0.0006557005108334124, 0.020213516429066658, 0.007355806417763233, -0.011251564137637615, -0.02487817406654358, 0.0027274577878415585, 0.020213516429066658, 0.03253299742937088, 0.004350690171122551, 0.11946991086006165, 0.018333984538912773, -0.04931209608912468, 0.010790224187076092, 0.04391271248459816, 0.039299312978982925, -0.026706445962190628, -0.010089671239256859, -0.01675346866250038, 0.033353157341480255, -0.005877810530364513, -0.06301559507846832, -0.053447067737579346, 0.06212708726525307, 0.011285738088190556, 0.016087088733911514, -0.05132832005620003, -0.04599728435277939, 0.030943937599658966, 0.003571111476048827, 0.020008476451039314, 0.012447630055248737, 0.09712056070566177, 0.011883771046996117, 0.04285333678126335, 0.03449796140193939, -0.08666352927684784, 0.04381019249558449, -0.026501405984163284, -0.009619788266718388, -0.01340448297560215, 0.032327957451343536, -0.04780846834182739, 0.0077103544026613235, -0.014617635868489742, 0.06175118312239647, 0.017889730632305145, -0.023511242121458054, -0.04750090837478638, -0.041418060660362244, 0.03943600505590439, -0.008099076338112354, 0.0036309147253632545, 0.08468147367238998, 0.024673134088516235, 0.008368190377950668, 0.01517295278608799, 0.047910988330841064, 0.06581780314445496, -0.02458770014345646, 0.06540773063898087, -0.049482960253953934, 0.003180254250764847, 0.033797409385442734, -0.019820522516965866, 0.005694128572940826, -0.01713791862130165, 0.008927779272198677, 0.03388284146785736, 0.02214430831372738, 0.017342958599328995, 0.017120830714702606, 0.011977747082710266, 0.006176827009767294, -0.029782045632600784, -0.009645418263971806, 0.06058929115533829, -0.023357462137937546, -0.004737276118248701, -0.03150779753923416, 0.014156295917928219, -0.04586058855056763, 0.027236133813858032, -0.0029303617775440216, -0.044664524495601654, -0.053242027759552, 0.020999502390623093, 0.06551025062799454, -0.03738560900092125, 0.006680883467197418, 0.0008644781191833317, 0.02308407425880432, 0.01806059665977955, 0.07094380259513855, 0.03294307738542557, -0.05088406801223755, 0.018658630549907684, 0.0015559537569060922, 0.028791019693017006, 0.0547114796936512, 0.04015364497900009, 0.018880756571888924, 0.0394018329679966, -0.05320785194635391, -0.0136778699234128, 0.002328057074919343, 0.026791879907250404, 0.032840557396411896, -0.06687717884778976, -0.040324512869119644, 0.009696678258478642, -0.04890201613306999, -0.019495876505970955, -0.03272094950079918, 0.0026911485474556684, 0.005809463560581207, 0.002580085303634405, 0.0005964311421848834, 0.04117884486913681, -0.028466371819376945, -0.022998642176389694, 0.02240060828626156, 0.05867558345198631, -0.016112718731164932, 0.027765819802880287, -0.0037676081992685795, -0.006625351496040821, 0.006603993475437164, 0.05840219557285309, 0.025185734033584595, 0.03776151314377785, 0.008248584344983101, 0.008927779272198677, 0.03031173162162304, -0.012037551030516624, 0.016539884731173515, 0.01006404124200344, -0.027184873819351196, 0.011131958104670048, -0.01453220285475254, 0.03844498097896576, -0.013575349934399128, 0.050132256001234055, 0.07190065830945969, -0.014489485882222652, -0.022998642176389694, -0.012114441022276878, -0.012883340008556843, 0.055463291704654694, -0.006001688539981842, 0.06393827497959137, 0.007753070909529924, 0.0008911759941838682, -0.043570976704359055, 0.0022426238283514977, -0.04117884486913681, -0.03622371330857277, 0.032840557396411896, -0.005745388567447662, 0.018333984538912773, -0.003240057500079274, 0.04483539238572121, 0.005625782068818808, 0.004502334166318178, -0.025049040094017982, -0.017718864604830742, 0.00045546621549874544, -0.04944878816604614, -0.022058876231312752, -0.05621510371565819, -0.016292128711938858, 0.014199012890458107, 0.039743565022945404, -0.034087881445884705, -0.002479701302945614, 0.022058876231312752, -0.02417762205004692, -0.015463425777852535, 0.032259609550237656, -0.014891022816300392, -0.005758203566074371, -0.08577502518892288, 0.02458770014345646, 0.07750508189201355, 0.034190401434898376, 0.036599621176719666, 0.03694135323166847, -0.034737177193164825, -0.02469022013247013, 0.01838524453341961, 0.004412629641592503, 0.06687717884778976, 0.04381019249558449, -0.07723169773817062, -0.00972230825573206, 0.044220272451639175, -0.07668492197990417, -0.025544553995132446, -0.022041788324713707, 0.08017060160636902, -0.008427994325757027, -0.029423225671052933, 0.03490804135799408, 0.03316520154476166, -0.01797516457736492, 0.07600145787000656, -0.026569753885269165, -0.023801714181900024, -0.024263054132461548, -0.017248980700969696, -0.02035021036863327, 0.025698333978652954, -0.04428861662745476, -0.0035006289836019278, 0.08358792960643768, -0.0004413163405843079, 0.01787264458835125, 0.03540355712175369, -0.006813304964452982, -0.028210071846842766, 0.048047684133052826, -0.02009391039609909, 0.08256272971630096, -0.005365210585296154, -0.015198582783341408, 0.010738964192569256, -0.0012323751579970121, -0.07661657780408859, -0.01870989054441452, 0.0006140517652966082, -0.008590317331254482, -0.007078147958964109, -0.003329762490466237, 0.0036266432143747807, -0.009448922239243984, 0.03424166142940521, -0.11482234299182892, 0.05583919957280159, -0.03540355712175369, 0.016249412670731544, -0.03261842951178551, 0.027219045907258987, 0.004446802660822868, 0.026535579934716225, 0.03564276918768883, 0.014156295917928219, -0.02082863636314869, 0.02838093973696232, -0.056522663682699203, -0.04733004420995712, -0.015796614810824394, -0.04227239266037941, 0.0051259975880384445, -0.013891452923417091, -0.05696691945195198, 0.025544553995132446, 0.04599728435277939, 0.053344547748565674, -0.03687300905585289, -0.026757705956697464, -0.006616808474063873, 0.027236133813858032, -0.03677048906683922, 0.04285333678126335, -0.059085663408041, 0.024707308039069176, -0.02539077401161194, -0.00658263498917222, -0.002479701302945614, -0.008667207323014736, 0.04025616496801376, -0.056112583726644516, 0.031747009605169296, 0.023682108148932457, 0.00897049531340599, 0.027953771874308586, 0.0018079819856211543, 0.025117387995123863, 0.05020060017704964, -0.01633484475314617, -0.05102076008915901, 0.013464286923408508, -0.02202470228075981, 0.001044421922415495, 0.031747009605169296, 0.026398885995149612, 0.046954136341810226, -0.020452730357646942, -0.0404953807592392, -0.00475009111687541, 0.019888870418071747, -0.01633484475314617, 0.07641153782606125, 0.038684193044900894, 0.018504850566387177, -0.07333593815565109, -0.02385297417640686, -0.0064245834946632385, 0.04565554857254028, -0.022263916209340096, -0.04821854829788208, -0.05037146806716919, -0.016223782673478127, -0.0071336799301207066, 0.0010956819169223309, 0.010414318181574345, 0.006903009954839945, -0.03067055158317089, -0.05464313179254532, -0.029149837791919708, 0.01738567464053631, 0.019427530467510223, 0.0005174053367227316, -0.01929083652794361, -0.007120864931493998, -0.01019219122827053, 0.07948713004589081, 0.010568098165094852, -0.013729129917919636, 0.037180569022893906, 0.02475856803357601, 0.04381019249558449, -0.00044291821541264653, -0.01700122468173504, 0.01168727409094572, 0.07654822617769241, -0.030619291588664055, 0.0092097083106637, -0.06595449894666672, -0.01526692882180214, -0.029782045632600784, -0.031166063621640205, -0.09636875241994858, 0.018778236582875252, 0.056146759539842606, -0.002949584275484085, 0.025852113962173462, -0.02738991193473339, -0.007432696409523487, -0.011935031041502953, -0.005924798548221588, 0.05679605156183243, -0.022486042231321335, -0.028654325753450394, 0.004856882616877556, -0.047466736286878586, 0.04862862825393677, -0.001150145661085844, -0.008556144312024117, 0.06161448732018471, 0.022998642176389694, 0.0020674855913966894, 0.048013508319854736, 0.07900870591402054, -0.004228947684168816, -0.06810741871595383, -0.023203682154417038, -0.049585480242967606, 0.022127222269773483, -0.011063611134886742, 0.003026474267244339, -0.0012462581507861614, -0.06612536311149597, 0.02976495772600174, -0.015933308750391006, 0.044083576649427414, 0.02147792838513851, 0.025151560083031654, -0.05539494380354881, -0.018914930522441864, -0.025219907984137535, -0.021033676341176033, 0.021238716319203377, 0.015292558819055557, 0.025031954050064087, -0.012601410038769245, -0.020589422434568405, 0.015002085827291012, -0.031200237572193146, 0.004241762682795525, -0.07702665776014328, 0.06400661915540695, 0.008222954347729683, -0.01389999594539404, 0.02918401174247265, -0.009090102277696133, 0.0030563760083168745, 0.02195635624229908, 0.01684744469821453, -0.05354958772659302, 0.061443623155355453, -0.04346845671534538, -0.04808185622096062, -0.008410907350480556, 0.05108910799026489, -0.009619788266718388, -0.031234411522746086, 0.024023842066526413, 0.040392860770225525, 0.002744544530287385, 0.014797045849263668, 0.0044638896360993385, -0.023699194192886353, 0.005608695559203625, 0.040358684957027435, -0.07531798630952835, 0.011456604115664959, 0.036018673330545425, -0.05081572011113167, -0.009201165288686752, 0.0008756912429817021, 0.031678665429353714, -0.009645418263971806, -0.011123414151370525, -0.12029007077217102, -0.10361349582672119, -0.030140865594148636, -0.025117387995123863, 0.024741480126976967, -0.09151613712310791, 0.02250312827527523, 0.027219045907258987, 0.08092240989208221, -0.04722752422094345, 0.05320785194635391, -0.040427032858133316, 0.005574522074311972, 0.005933342035859823, -0.029782045632600784, -0.007855591364204884, -0.028756845742464066, -0.06595449894666672, 0.017701778560876846, 0.012763733975589275, 0.006732143461704254, -0.002909003524109721, 0.014327162876725197, -0.027509519830346107, 0.006578363478183746, 0.07504460215568542, 0.004814166110008955, 0.013455742970108986, -0.04439113661646843, -0.0169670507311821, 0.004959402605891228, -0.03519851714372635, -0.00423535518348217, -0.06212708726525307, 0.021033676341176033, 0.0001537799253128469, 0.04381019249558449, 0.010798768140375614, 0.006663796491920948, 0.0160443726927042, -0.027817079797387123, -0.0011640285374596715, -0.006322063505649567, 0.009730852209031582, 0.014395509846508503, 0.06175118312239647, -0.049653828144073486, -0.005685585550963879, 0.010807311162352562, -0.026142586022615433, 0.036565449088811874, 0.06482677906751633, -0.009269512258470058, -0.02848345972597599, 0.031063543632626534, -0.02469022013247013, 0.027014005929231644, 0.001804778235964477, 0.04862862825393677, -0.017026854678988457, -0.06732143461704254, 0.028346765786409378, 0.036087021231651306, -0.03759064897894859, -0.026894399896264076, -0.017120830714702606, 0.02822715975344181, 0.013173813000321388, -0.012131527066230774, 0.014566375873982906, -0.03307976946234703, -0.041452232748270035, -0.010328885167837143, -0.031422365456819534, 0.015335275791585445, 0.003064919263124466, 0.024963608011603355, 0.017317328602075577, 0.0050063906237483025, 0.016129804775118828, 0.06759481877088547, 0.002949584275484085, 0.009448922239243984, -0.004826981108635664, 0.0031225867569446564, 0.026757705956697464, -0.027987945824861526, -0.03847915306687355, 0.026415973901748657, 0.02498069405555725, -0.05454061180353165, -0.049653828144073486, -0.056078411638736725, 0.049482960253953934, 0.08468147367238998, 0.030943937599658966, 0.024058014154434204, 0.03482260927557945, 0.022639822214841843, -0.001196066034026444, -0.020008476451039314, 0.025254080072045326, 0.022930294275283813, -0.03895758092403412, -0.02028186246752739, 0.010260538198053837, -0.021238716319203377, 0.008146064355969429, -0.021255802363157272, 0.034190401434898376, -0.005779562052339315, -0.02195635624229908, -0.04271664470434189, -0.0027936685364693403, -0.039880260825157166, -0.015805158764123917, -0.007227656431496143, 0.04832106828689575, -0.025476207956671715, 0.019598396494984627, -0.02410927414894104, -0.017599258571863174, 0.06263969093561172, 0.036087021231651306, -0.00442117266356945, 0.01944461651146412, 0.003648001467809081, 0.010884201154112816, 0.08850888907909393, 0.015224212780594826, 0.003449368989095092, -0.029013145714998245, 0.028056291863322258, 0.01999139040708542, 0.021751316264271736, -0.033609457314014435, -0.053447067737579346, -0.014822675846517086, 0.08392966538667679, 0.04722752422094345, 0.019102884456515312, -0.05313950777053833, -0.026142586022615433, 0.059974171221256256, -0.033062681555747986, -0.03410496935248375, 0.04589476436376572, -0.09185787290334702, -0.051294147968292236, -0.018402330577373505, 0.04322924464941025, 0.010029868222773075, 0.026176759973168373, -0.06510017067193985, -0.012404914014041424, 0.047910988330841064, 0.02118745632469654, -0.016514254733920097, -0.06079433113336563, 0.012926056981086731, -0.011738534085452557, -0.07429278641939163, -0.013455742970108986, -0.048423588275909424, -0.0364629290997982, -0.0703970342874527, -0.049107056111097336, -0.04111050069332123, 0.022639822214841843, 0.014463855884969234, -0.056078411638736725, 0.006381866987794638, 0.0014235321432352066, 0.04514295235276222, -0.06428001075983047, -0.07832524180412292, -0.013865822926163673, 0.010363058187067509, -0.03133692964911461, -0.03480552136898041, -0.010029868222773075, 0.018043510615825653, 0.022195568308234215, -0.008248584344983101, -0.016471538692712784, 0.05081572011113167, 0.0037206197157502174, 0.021580448374152184, 0.027697471901774406, 0.08324620127677917, -0.017530910670757294, -0.05642014369368553, -0.051704227924346924, -0.05696691945195198, -0.034087881445884705, 0.0842714011669159, -0.006834663450717926, 0.001296450151130557, 0.005429285578429699, 0.01675346866250038, -0.0238871481269598, -0.04490373656153679, -0.025151560083031654, 0.09404496848583221, -0.04951713606715202, -0.011576211079955101, 0.0004810962127521634, -0.011823967099189758, -0.00678340345621109, -0.04733004420995712, 0.028910625725984573, -0.08119580149650574, 0.00042930227937176824, -0.026928573846817017, -0.023955494165420532, 0.010559555143117905, -0.05587337166070938, -0.03307976946234703, -0.011037981137633324, 0.05146501585841179, -0.02619384601712227, 0.02446809411048889, -0.01636047475039959, -0.008850889280438423, -0.06393827497959137, 0.04295585677027702, -0.05512155964970589, -0.006650981493294239, 0.016984138637781143, -0.03400244936347008, -0.05785542353987694, -0.005215702578425407, 0.021102022379636765, -0.029782045632600784, 0.011610384099185467, 0.08345124125480652, 0.04715917631983757, 0.05184092000126839, 0.011883771046996117, -0.03289181739091873, -0.021170368418097496, -0.007979469373822212, 0.028432199731469154, -0.04979052022099495, -0.013378852978348732, 0.027748731896281242, -0.016531340777873993, 0.016471538692712784, 0.02812463976442814, -0.003432282479479909, 0.010602271184325218, -0.052866119891405106, -0.0689275786280632, -0.01687307469546795, 0.02140958234667778, 0.043024204671382904, -0.005459187086671591, -0.006915824953466654, 0.01633484475314617, 0.023220768198370934, -0.006138382013887167, 0.0030307460110634565, -0.0038316829595714808, 0.02976495772600174, 0.004856882616877556, -0.05785542353987694, 0.009124275296926498, -0.016112718731164932, -0.005074737593531609, -0.003509172471240163, 0.049551308155059814, -0.0459631085395813, -0.01356680691242218, -0.019940130412578583, -0.013823105953633785, 0.02986747771501541, -0.016018742695450783, 0.03680466115474701, 0.04726169630885124, 0.007018344942480326, -0.07422444224357605, 0.016531340777873993, 0.002936769276857376, -0.005254147574305534, 0.058812275528907776, -0.0004971149610355496, 0.01642882265150547, 0.017112288624048233, -0.0638357549905777, 0.001137330662459135, 0.028398025780916214, 0.0020568063482642174, -0.027014005929231644, 0.020811550319194794, 0.01183251105248928, 0.03183244541287422, -0.034190401434898376, 0.0012665485264733434, -0.019871782511472702, 0.03564276918768883, 0.010884201154112816, 0.008427994325757027, -0.031559057533741, -0.016565514728426933, 0.0049551306292414665, -0.011747077107429504, 0.0674922987818718, 0.0020941835828125477, -0.07613814622163773, -0.06106771528720856, 0.009397662244737148, 0.023032814264297485, -0.033284809440374374, -0.03044842556118965, -0.02005973644554615, 0.01684744469821453, -0.020076822489500046, 0.018983276560902596, -0.04391271248459816, 0.01327633298933506, -0.02523699402809143, 0.02067485637962818, -0.021717142313718796, -0.02028186246752739, 0.008026457391679287, 0.017992250621318817, -0.011866684071719646, -0.044698696583509445, 0.006181098520755768, 0.0028064835350960493, -0.020726116374135017, -0.003727027215063572, 0.07012364268302917, -0.038752540946006775, -0.0080221863463521, 0.08044398576021194, 0.01607000268995762, 0.025698333978652954, 0.055053211748600006, -0.042511604726314545, 0.016787640750408173, 0.037180569022893906, 0.0016808999935165048, -0.030482597649097443, -0.059905823320150375, 0.032994337379932404, 0.022093048319220543, 0.053412891924381256, 0.003067055018618703, 0.04381019249558449, 0.009713765233755112, 0.06123858317732811 ]
717,349
torch.optim.lr_scheduler
_annealing_linear
Linearly anneal from `start` to `end` as pct goes from 0.0 to 1.0.
@staticmethod def _annealing_linear(start, end, pct): "Linearly anneal from `start` to `end` as pct goes from 0.0 to 1.0." return (end - start) * pct + start
(start, end, pct)
[ -0.04657493159174919, -0.027571000158786774, 0.021791629493236542, -0.005707128904759884, -0.01230666134506464, -0.0067227683030068874, -0.004226165357977152, -0.05075647681951523, -0.03702197223901749, 0.018052035942673683, -0.013454035855829716, 0.016522202640771866, 0.09396577626466751, 0.04025162011384964, -0.061431314796209335, -0.00005577518095378764, -0.00232237228192389, 0.04399121180176735, -0.04106753319501877, -0.011541743762791157, -0.009824930690228939, 0.020533766597509384, 0.012374653480947018, 0.007670415565371513, -0.05184435844421387, 0.05085846781730652, -0.007096727844327688, -0.012791108340024948, -0.056025903671979904, -0.007262459956109524, 0.016267230734229088, -0.039945654571056366, 0.017346613109111786, -0.000051293245633132756, 0.06449098140001297, -0.008907031267881393, 0.01929290033876896, 0.039197735488414764, -0.1194630041718483, 0.0033698834013193846, -0.02551422454416752, -0.011609736829996109, -0.006943744607269764, 0.016811171546578407, -0.025412235409021378, -0.02002382092177868, -0.0056901308707892895, 0.044875118881464005, 0.027061056345701218, -0.047798797488212585, -0.029797757044434547, -0.009442472830414772, 0.05167437717318535, -0.004801977425813675, -0.004398271441459656, 0.12395051121711731, 0.030987627804279327, 0.027927961200475693, 0.04106753319501877, -0.010181891731917858, 0.04429718106985092, -0.0641850158572197, 0.035322155803442, -0.041849445551633835, -0.006123583763837814, 0.014074468985199928, -0.07853145897388458, -0.014499422162771225, -0.016267230734229088, 0.02743501402437687, 0.026772087439894676, 0.015017866156995296, -0.00574112543836236, 0.01166923064738512, -0.00633606081828475, 0.021366674453020096, -0.0161142461001873, -0.01207718625664711, 0.05259227752685547, -0.00505694979801774, 0.019972827285528183, -0.015757285058498383, 0.031242601573467255, -0.05381614342331886, 0.000667708576656878, -0.06112534925341606, -0.06908048689365387, -0.03668200969696045, 0.052558280527591705, 0.00914500467479229, -0.0426313616335392, 0.032908421009778976, 0.022029602900147438, 0.04966859519481659, 0.01857897825539112, 0.07050833106040955, 0.016666686162352562, -0.047254856675863266, -0.002732452703639865, -0.021723635494709015, 0.01038587000221014, 0.04538506269454956, -0.021179694682359695, 0.029797757044434547, -0.014193455688655376, -0.06166929006576538, -0.006174578331410885, 0.023899398744106293, -0.009034517221152782, 0.03212650492787361, -0.03899375721812248, -0.03438725695014, -0.06673473864793777, -0.020108811557292938, -0.07016836851835251, 0.04603099077939987, -0.030783651396632195, -0.0012079310836270452, 0.01710863783955574, 0.029967740178108215, 0.028301920741796494, -0.019530875608325005, -0.05826966091990471, 0.011907204054296017, 0.016811171546578407, -0.02524225413799286, 0.03183753415942192, 0.010326376184821129, 0.004950711503624916, -0.026296138763427734, 0.014915877021849155, 0.028148937970399857, -0.026228146627545357, 0.05323820561170578, -0.006930995732545853, 0.021298682317137718, -0.037565913051366806, 0.048886679112911224, 0.05113043636083603, 0.0017699324525892735, 0.020635753870010376, -0.002496603410691023, 0.046234969049692154, -0.001913354266434908, 0.0713922306895256, 0.02762199379503727, -0.0006183077348396182, 0.009994912892580032, -0.0122981620952487, 0.033809322863817215, 0.022029602900147438, -0.026228146627545357, 0.02371242083609104, 0.03083464503288269, 0.04235938936471939, 0.003250896232202649, -0.00492096459493041, -0.038007862865924835, -0.01126127503812313, -0.019462881609797478, -0.03926572948694229, -0.02378041297197342, 0.020839732140302658, 0.022709529846906662, 0.005668883211910725, 0.0267040953040123, -0.03469322621822357, -0.013751504011452198, -0.013105574063956738, -0.03668200969696045, -0.029695769771933556, -0.06289315968751907, -0.024715309962630272, 0.00041140837129205465, 0.04317530244588852, -0.011915703304111958, 0.02690807171165943, 0.0380418598651886, -0.011380261741578579, 0.04456914961338043, 0.05198034271597862, -0.0156467966735363, -0.006085338070988655, -0.09648150205612183, -0.0007728846394456923, 0.053646162152290344, 0.004585251212120056, 0.033163391053676605, -0.018629973754286766, 0.0031085368245840073, 0.0027983204927295446, -0.0005168500356376171, 0.02396739274263382, 0.008426832966506481, 0.0178480576723814, -0.02085673063993454, -0.0012387401657178998, 0.05123242735862732, -0.022828515619039536, -0.015578804537653923, 0.0020652753300964832, 0.05633186921477318, -0.03299340978264809, 0.019547872245311737, 0.027095051482319832, 0.03647803142666817, -0.027231037616729736, 0.07016836851835251, -0.03131059184670448, -0.02204660139977932, -0.058949586004018784, -0.020363783463835716, 0.011966697871685028, 0.022471554577350616, -0.0236104317009449, -0.020278792828321457, 0.014890380203723907, -0.004085930529981852, 0.019258905202150345, 0.021366674453020096, -0.000385379942599684, -0.07703562080860138, 0.028131939470767975, -0.017176631838083267, 0.07791952043771744, 0.004056183621287346, 0.00441526947543025, 0.018324006348848343, 0.004432267975062132, -0.023661425337195396, 0.002825942588970065, 0.002207634737715125, 0.020346786826848984, -0.028658881783485413, 0.014031973667442799, 0.03511817753314972, -0.0437532402575016, 0.03459123522043228, -0.07961934059858322, 0.05925555154681206, -0.04443316534161568, 0.04106753319501877, -0.0594935268163681, 0.015485315583646297, 0.02095871977508068, 0.031684551388025284, 0.02350844256579876, 0.008796542882919312, -0.004128425847738981, 0.04429718106985092, -0.07390795648097992, -0.03763390704989433, -0.043787237256765366, -0.012374653480947018, 0.017542092129588127, 0.02194461226463318, -0.04164546728134155, 0.014473925344645977, 0.03861979767680168, 0.030239710584282875, -0.007474936544895172, -0.0190209299325943, -0.052184320986270905, 0.021706638857722282, -0.04453515261411667, 0.04732285067439079, -0.06826457381248474, 0.015961263328790665, 0.0036248555406928062, 0.020516768097877502, 0.011312269605696201, 0.017491096630692482, 0.04997456073760986, -0.04116952046751976, 0.024290356785058975, 0.051912352442741394, 0.04810476675629616, 0.0338263213634491, 0.013471034355461597, -0.0007861644844524562, 0.04565703123807907, -0.008320595137774944, -0.04626896604895592, 0.015442819334566593, -0.0038543306291103363, -0.025395236909389496, 0.026823081076145172, 0.030324701219797134, 0.008847537450492382, -0.024936286732554436, 0.003242397215217352, -0.004699988756328821, 0.047152869403362274, 0.011082794517278671, 0.074587881565094, 0.030868642032146454, 0.04977058619260788, -0.05225231498479843, -0.015136852860450745, -0.006416801828891039, 0.03341836482286453, -0.07023635506629944, -0.02104371041059494, -0.03265344724059105, -0.006761014461517334, -0.012553134001791477, -0.02578619495034218, 0.018154025077819824, 0.028658881783485413, -0.027282031252980232, -0.051368411630392075, -0.0044747632928192616, 0.005639136303216219, 0.0018719213549047709, 0.01139726024121046, -0.020567761734128, -0.005911106709390879, 0.029134830459952354, 0.03501619026064873, 0.024120375514030457, -0.014822387136518955, 0.06200925260782242, -0.006752515211701393, 0.0197688490152359, -0.01162673532962799, -0.01654770039021969, 0.06673473864793777, 0.07941535860300064, -0.04545305296778679, 0.0021088330540806055, -0.030409691855311394, -0.02910083346068859, -0.003359259571880102, -0.019156916067004204, -0.07995930314064026, 0.03295941278338432, 0.047696810215711594, -0.008473577909171581, 0.03698797523975372, -0.054020121693611145, 0.006846005097031593, 0.009867426007986069, -0.013267056085169315, 0.04191743955016136, 0.059595514088869095, -0.02369542233645916, 0.002454108092933893, -0.011244276538491249, 0.03171854838728905, 0.022828515619039536, -0.0464729443192482, 0.07173219323158264, -0.011694727465510368, 0.007215715013444424, 0.015986761078238487, 0.05857562646269798, 0.01820501871407032, -0.06289315968751907, 0.001031575258821249, -0.04671091586351395, -0.039027754217386246, 0.004653243813663721, -0.025548219680786133, 0.01189870573580265, -0.010275381617248058, 0.028284922242164612, -0.003312514629215002, 0.038279835134744644, 0.012102683074772358, 0.028981845825910568, -0.05079047381877899, -0.053204212337732315, -0.06217923387885094, 0.001343916286714375, -0.0068800016306340694, 0.0006108710076659918, 0.009272491559386253, -0.012221669778227806, 0.0126721216365695, 0.02597317472100258, -0.023270467296242714, 0.002570970216766, -0.04246138036251068, 0.05184435844421387, 0.030154719948768616, -0.015714790672063828, 0.058133672922849655, -0.020244797691702843, 0.0022947504185140133, 0.009077012538909912, 0.08635060489177704, -0.05935754254460335, 0.045691028237342834, -0.013556024990975857, -0.05626387894153595, -0.01949687860906124, 0.04732285067439079, 0.02104371041059494, -0.03027370572090149, 0.02031278982758522, 0.007092478219419718, 0.015663795173168182, -0.05167437717318535, -0.002534849103540182, -0.019547872245311737, 0.025599215179681778, 0.06772062927484512, 0.005996097810566425, 0.0046022492460906506, 0.02918582409620285, -0.04983857646584511, 0.03238147497177124, -0.03035869635641575, -0.01930989883840084, 0.015442819334566593, -0.0104708606377244, -0.04164546728134155, -0.06741466373205185, -0.026398127898573875, -0.026602106168866158, 0.05221831798553467, -0.08852636814117432, 0.05660384148359299, 0.012927093543112278, 0.054496072232723236, -0.08594264835119247, 0.026517115533351898, -0.07438390702009201, 0.0014968996401876211, 0.00855431891977787, -0.03091963566839695, -0.056229881942272186, -0.0209417212754488, -0.0763556957244873, 0.030426690354943275, -0.022930504754185677, 0.0058176168240606785, 0.0013162943068891764, 0.0356961153447628, -0.05864362046122551, 0.015136852860450745, 0.029763761907815933, 0.04154348000884056, 0.00024209084222093225, -0.06075138971209526, -0.04565703123807907, -0.002430735621601343, -0.05296623706817627, -0.046982888132333755, -0.06496693193912506, 0.007848896086215973, -0.014898878522217274, 0.0634370967745781, 0.03634204715490341, -0.030307702720165253, -0.0023924896959215403, -0.05735176056623459, -0.028590889647603035, 0.033894311636686325, 0.03110661543905735, 0.021978609263896942, 0.06217923387885094, -0.028301920741796494, 0.031327590346336365, -0.0005426128627732396, -0.0380418598651886, 0.03047768399119377, 0.030698660761117935, -0.026211148127913475, -0.037463922053575516, 0.0027133298572152853, -0.030783651396632195, 0.02991674467921257, -0.048444729298353195, 0.046846903860569, 0.024188367649912834, -0.027554001659154892, 0.015629800036549568, 0.06020744889974594, -0.04205342382192612, -0.014125462621450424, -0.03528815880417824, 0.03268744423985481, 0.04837673529982567, -0.026874076575040817, -0.006833256687968969, -0.07193617522716522, 0.014116964302957058, -0.04864870756864548, -0.015230342745780945, -0.025735199451446533, -0.031140612438321114, 0.03522016853094101, 0.05854162946343422, -0.056399863213300705, -0.01079382561147213, 0.06744866073131561, 0.00601734546944499, 0.052558280527591705, -0.029134830459952354, 0.024188367649912834, -0.0033975052647292614, -0.016207735985517502, -0.02736702188849449, 0.029967740178108215, 0.06534089148044586, -0.046064987778663635, -0.028199931606650352, -0.05990148335695267, 0.06809458881616592, 0.09784135222434998, 0.032075509428977966, 0.0035122428089380264, 0.05058649554848671, 0.02269253134727478, 0.00482322508469224, -0.009263992309570312, 0.03246646746993065, 0.058507632464170456, -0.06285916268825531, -0.0019314148230478168, 0.01691316068172455, 0.03715795651078224, -0.02077174000442028, 0.019088923931121826, 0.012833603657782078, -0.0021821376867592335, -0.014065969735383987, -0.04732285067439079, 0.03360534459352493, 0.01922490820288658, 0.02690807171165943, 0.04426318407058716, 0.006913997698575258, -0.018782956525683403, 0.02213159203529358, -0.025599215179681778, -0.037837881594896317, -0.008405585773289204, 0.027571000158786774, 0.013097074814140797, -0.004653243813663721, -0.005430908873677254, -0.010266883298754692, 0.062451206147670746, 0.03780388832092285, -0.048342738300561905, 0.012187673710286617, 0.010275381617248058, 0.0072497110813856125, 0.02580319158732891, 0.0019431010587140918, -0.07642368227243423, 0.006540038622915745, 0.06670074164867401, 0.012595629319548607, -0.034353263676166534, -0.01015639491379261, -0.0015638298355042934, 0.07676364481449127, -0.05140240862965584, -0.03661401569843292, 0.053646162152290344, -0.05945952981710434, -0.060615405440330505, -0.0023627430200576782, 0.015587303787469864, 0.04467114061117172, 0.0172871183604002, -0.04521508142352104, -0.020091813057661057, 0.03212650492787361, 0.00031659056548960507, -0.02570120431482792, -0.061431314796209335, 0.026466120034456253, 0.021162698045372963, -0.08655457943677902, -0.03824583813548088, -0.029219821095466614, -0.010870316997170448, -0.04813876375555992, -0.028284922242164612, -0.05653584748506546, 0.015901770442724228, 0.038109853863716125, -0.06619080156087875, 0.02369542233645916, -0.0032296485733240843, 0.055108003318309784, -0.05898358300328255, -0.047152869403362274, -0.025038275867700577, -0.006293565034866333, -0.03797386959195137, 0.008273850195109844, -0.02296450175344944, 0.027927961200475693, 0.03477821499109268, -0.0017104388680309057, -0.019887836650013924, 0.05140240862965584, -0.04589500650763512, 0.02816593460738659, 0.02626214176416397, 0.06200925260782242, 0.012723115272819996, -0.05918756127357483, -0.03195652365684509, -0.05300023406744003, -0.026296138763427734, 0.06122733652591705, -0.005273676011711359, -0.031599562615156174, -0.006314812693744898, 0.0015319583471864462, -0.026007169857621193, -0.02745201252400875, 0.00017701979959383607, 0.05473404377698898, -0.04191743955016136, 0.019547872245311737, 0.04062557965517044, 0.006994738709181547, 0.028335917741060257, -0.037361934781074524, 0.044229187071323395, -0.10083302855491638, 0.024936286732554436, -0.04031961411237717, -0.03624005615711212, 0.04793478548526764, -0.0795513466000557, -0.04558904096484184, 0.023474445566534996, 0.026143155992031097, 0.02580319158732891, 0.006981990300118923, -0.00961245410144329, 0.005430908873677254, -0.07825948297977448, 0.01217067614197731, -0.041407495737075806, -0.018256014212965965, 0.025939177721738815, 0.002611340954899788, -0.04558904096484184, 0.007725659292191267, 0.019598867744207382, -0.015578804537653923, 0.005167437717318535, 0.04429718106985092, 0.018544983118772507, 0.04154348000884056, -0.006119334138929844, 0.028063947334885597, -0.015595803037285805, 0.004175170790404081, 0.03214350342750549, -0.04351526498794556, -0.03221149370074272, 0.024443339556455612, 0.0005213651456870139, 0.0016690059565007687, 0.043311286717653275, 0.056229881942272186, -0.010317876935005188, -0.0713922306895256, -0.040557585656642914, -0.02133267931640148, -0.005137690808624029, 0.031055621802806854, -0.011448254808783531, 0.026228146627545357, 0.0247833039611578, 0.01171172596514225, -0.034795213490724564, -0.032721441239118576, -0.011601237580180168, 0.0232364721596241, 0.022114593535661697, -0.05680781975388527, -0.036919981241226196, -0.052728261798620224, 0.02974676340818405, 0.01812002807855606, 0.045691028237342834, -0.011354764923453331, 0.034540243446826935, 0.004294157959520817, -0.016768675297498703, 0.0014937124215066433, -0.04280134290456772, 0.04014963284134865, 0.04348126798868179, -0.009136506356298923, -0.06285916268825531, -0.03522016853094101, 0.01912291906774044, -0.0457250252366066, 0.07091628760099411, 0.0018496112897992134, -0.03029070422053337, 0.024358348920941353, -0.058235663920640945, 0.014091466553509235, 0.008907031267881393, 0.01080232486128807, -0.003518617246299982, -0.0014512171037495136, 0.004513008985668421, 0.035900093615055084, -0.014907377772033215, -0.013751504011452198, -0.007755406200885773, -0.009535962715744972, 0.0193948894739151, -0.01673467829823494, -0.060071464627981186, 0.00660803122445941, -0.011218779720366001, -0.0010459173936396837, 0.02643212489783764, -0.04014963284134865, -0.08206707239151001, -0.026517115533351898, 0.0005444720154628158, -0.0028875607531517744, -0.06884250789880753, -0.004933713003993034, -0.007385696284472942, 0.027689987793564796, -0.00473823444917798, -0.006382805295288563, -0.010734331794083118, 0.0056901308707892895, -0.042597364634275436, 0.033809322863817215, 0.03083464503288269, -0.006038593128323555, -0.004315405618399382, 0.004047684371471405, 0.0017146883765235543, -0.052286311984062195, -0.013675011694431305, 0.0218766201287508, -0.017406105995178223, 0.02955978363752365, 0.05330619961023331, -0.05470004677772522, 0.03302740678191185, 0.07587974518537521, 0.026602106168866158, 0.02415437251329422, 0.06398104131221771, -0.06653076410293579, 0.06846854835748672, -0.0027494507376104593, -0.015774283558130264, -0.031157609075307846, -0.027282031252980232, 0.02066975086927414, 0.05497201904654503, 0.04674491286277771, -0.03668200969696045, 0.05232030898332596, 0.01837499998509884, 0.08281499147415161 ]
717,353
torch.optim.lr_scheduler
get_lr
null
def get_lr(self): if not self._get_lr_called_within_step: warnings.warn("To get the last learning rate computed by the scheduler, " "please use `get_last_lr()`.", UserWarning) lrs = [] step_num = self.last_epoch if step_num > self.total_steps: raise ValueError("Tried to step {} times. The specified number of total steps is {}" .format(step_num, self.total_steps)) for group in self.optimizer.param_groups: start_step = 0 for i, phase in enumerate(self._schedule_phases): end_step = phase['end_step'] if step_num <= end_step or i == len(self._schedule_phases) - 1: pct = (step_num - start_step) / (end_step - start_step) computed_lr = self.anneal_func(group[phase['start_lr']], group[phase['end_lr']], pct) if self.cycle_momentum: computed_momentum = self.anneal_func(group[phase['start_momentum']], group[phase['end_momentum']], pct) break start_step = phase['end_step'] lrs.append(computed_lr) if self.cycle_momentum: if self.use_beta1: group['betas'] = (computed_momentum, *group['betas'][1:]) else: group['momentum'] = computed_momentum return lrs
(self)
[ -0.009665613994002342, 0.019556228071451187, -0.03354370966553688, 0.015543731860816479, 0.008029677905142307, 0.034649960696697235, -0.023418722674250603, -0.04428745061159134, -0.03789370507001877, 0.062287427484989166, -0.024337472394108772, -0.0212249755859375, 0.031124964356422424, 0.07271241396665573, 0.0026085907593369484, 0.05527493730187416, -0.035568710416555405, 0.022218724712729454, -0.04323745146393776, -0.04064995422959328, -0.002803121693432331, 0.0013300766004249454, -0.01611560583114624, 0.021712474524974823, -0.0225374735891819, 0.03251246362924576, 0.032437462359666824, -0.0064781177788972855, -0.04301245138049126, 0.06907492130994797, -0.021787475794553757, -0.02017497643828392, -0.009018739685416222, -0.05831243470311165, -0.012796860188245773, -0.0007025382365100086, -0.04124995321035385, -0.027281219139695168, -0.05977493152022362, -0.002283981768414378, 0.04057495296001434, -0.006764054764062166, 0.018712477758526802, 0.01705310493707657, -0.06779992580413818, -0.04218745231628418, -0.010040613822638988, -0.0175593551248312, 0.006937492173165083, -0.04874994233250618, 0.028668716549873352, 0.0037406207993626595, -0.0005252923583611846, -0.03459370881319046, 0.018056228756904602, -0.0018890603678300977, 0.012824985198676586, -0.04128745198249817, 0.04098745435476303, -0.03472496196627617, 0.05658743530511856, -0.07882490754127502, -0.023924972862005234, 0.03448120877146721, 0.06168742850422859, -0.0772499144077301, -0.041737452149391174, -0.01769997924566269, 0.0015585919609293342, 0.041062451899051666, -0.009881238453090191, -0.0070874919183552265, 0.016734356060624123, -0.01875935308635235, -0.02776871807873249, 0.005320306401699781, -0.009595301933586597, -0.05084994062781334, -0.0019429664826020598, -0.01662185601890087, 0.017203105613589287, 0.07837490737438202, 0.014249983243644238, -0.012253111228346825, -0.02109372615814209, -0.0754874125123024, -0.01159686129540205, -0.008217178285121918, -0.025443721562623978, -0.04874994233250618, 0.022856224328279495, -0.031256213784217834, 0.017784355208277702, 0.01822497881948948, -0.024824971333146095, 0.018824977800250053, -0.08392490446567535, -0.0011109362822026014, 0.01073436252772808, -0.05906243249773979, 0.0055031185038387775, 0.028499966487288475, -0.00012700181105174124, 0.06821241974830627, 0.024543721228837967, -0.0014835920883342624, -0.019724978134036064, -0.03941245377063751, 0.013378109782934189, 0.02111247554421425, -0.03448120877146721, 0.08999989926815033, -0.06378743052482605, 0.042112451046705246, -0.033093713223934174, 0.02004372701048851, -0.018028104677796364, 0.03247496113181114, -0.012299985624849796, 0.048937443643808365, -0.000023455782866221853, 0.03472496196627617, -0.003986714407801628, 0.022181224077939987, -0.04151245206594467, 0.0003735347418114543, -0.010312488302588463, -0.012356235645711422, 0.004499994684010744, -0.05354993790388107, 0.02709371969103813, 0.012740610167384148, -0.0009843738516792655, -0.011043737642467022, -0.01679060608148575, -0.013021860271692276, 0.029174966737627983, 0.04679994657635689, -0.032137464731931686, -0.015412482433021069, 0.012290610931813717, 0.06794992089271545, 0.053774937987327576, -0.015815606340765953, 0.049724943935871124, 0.02881871722638607, 0.0348937101662159, 0.11857486516237259, -0.00891092699021101, -0.01766248047351837, 0.028256217017769814, -0.053399939090013504, 0.0654374212026596, 0.029849965125322342, 0.03378746286034584, 0.01480310782790184, -0.030749965459108353, 0.017887478694319725, -0.03907495364546776, -0.0584249347448349, -0.0581999346613884, -0.018553104251623154, -0.05726243555545807, -0.08114990592002869, 0.01875935308635235, 0.016424981877207756, 0.008999989368021488, 0.021056225523352623, -0.04038745537400246, 0.012609360739588737, 0.00015117169823497534, -0.04166245087981224, -0.002575778402388096, 0.03337496146559715, -0.016987480223178864, 0.06487492471933365, 0.015787482261657715, 0.040537454187870026, -0.004443745128810406, 0.06288743019104004, 0.03472496196627617, -0.012290610931813717, 0.0145499836653471, -0.10454987734556198, -0.029643716290593147, 0.019556228071451187, -0.042374949902296066, 0.0013101547956466675, -0.054674938321113586, 0.056287433952093124, 0.01434373389929533, 0.028987467288970947, -0.003037496469914913, -0.031387463212013245, -0.07016242295503616, 0.017362480983138084, -0.02608121931552887, 0.07807490974664688, -0.003801558166742325, 0.0020917945075780153, 0.03641245886683464, 0.024187471717596054, -0.01342498417943716, 0.0036234334111213684, -0.05006244406104088, -0.03785620629787445, -0.0820499062538147, 0.002123435027897358, -0.01349998451769352, 0.02958746626973152, -0.026624970138072968, 0.02686871960759163, 0.0015843731816858053, 0.0348937101662159, -0.00017270488024223596, -0.036243706941604614, -0.026287470012903214, 0.018309354782104492, 0.029174966737627983, -0.024168722331523895, 0.024318723008036613, -0.09704989194869995, 0.03926245495676994, -0.024318723008036613, -0.001924216514453292, -0.04034995287656784, 0.02501247078180313, -0.034012459218502045, -0.05249993875622749, 0.03433120995759964, 0.014315608888864517, -0.10649988055229187, -0.00520311901345849, -0.022462474182248116, 0.02763746865093708, 0.03318746015429497, -0.018028104677796364, 0.06502492725849152, -0.006717179901897907, 0.027806218713521957, -0.03238121420145035, 0.01845935359597206, -0.005807805806398392, -0.011746861971914768, -0.008306240662932396, 0.030974963679909706, 0.05302494019269943, 0.007692178711295128, -0.0581999346613884, -0.0018164041684940457, 0.015346857719123363, 0.0033257773611694574, 0.004307807423174381, 0.009365614503622055, -0.027449969202280045, -0.032437462359666824, 0.009581238962709904, 0.03483745828270912, 0.04469994828104973, -0.0077671785838902, 0.07282491773366928, -0.0004435541923157871, -0.07271241396665573, -0.02159997448325157, -0.06656242161989212, 0.05763743445277214, -0.024693721905350685, -0.009473426267504692, 0.023999972268939018, 0.03446245938539505, 0.05624993517994881, 0.010903112590312958, -0.06401242315769196, -0.027037469670176506, 0.0025992158334702253, 0.011737486347556114, 0.0002431637840345502, 0.021056225523352623, 0.009154677391052246, -0.010912487283349037, 0.04338745027780533, 0.01757810451090336, -0.02409372292459011, -0.047099944204092026, -0.018778104335069656, 0.02124372497200966, -0.03629995882511139, 0.016031231731176376, 0.0021878881379961967, 0.046049948781728745, 0.0452999472618103, -0.04451245069503784, 0.01585310697555542, 0.014390608295798302, 0.1395748406648636, 0.014859357848763466, 0.020531225949525833, -0.015299982391297817, 0.0299812164157629, 0.050362441688776016, 0.029531216248869896, -0.005287494044750929, 0.07338741421699524, 0.015487481839954853, -0.0623624287545681, -0.04833744466304779, -0.01571248285472393, -0.012824985198676586, 0.03526870906352997, -0.030093714594841003, 0.021918725222349167, 0.031087463721632957, 0.06944992393255234, -0.0632249265909195, 0.01834685355424881, -0.05891243368387222, -0.012037485837936401, 0.005517181009054184, 0.021262476220726967, 0.00658124266192317, -0.03290621191263199, 0.05099994316697121, 0.04938744381070137, -0.01649998128414154, -0.0032718712463974953, -0.003621089505031705, 0.028068717569112778, 0.018581228330731392, -0.04109995439648628, -0.004783588461577892, 0.011315612122416496, -0.08804989606142044, -0.007542178966104984, 0.028106218203902245, 0.03933745622634888, -0.006665617227554321, 0.03421870991587639, 0.03736870735883713, 0.028237467631697655, -0.051037441939115524, 0.055237434804439545, 0.013406234793365002, -0.026643719524145126, 0.023418722674250603, 0.022481223568320274, -0.012431235983967781, 0.05898743122816086, 0.055237434804439545, 0.0040476517751812935, -0.022181224077939987, -0.04046245291829109, 0.012609360739588737, -0.059699930250644684, 0.03926245495676994, -0.02135622501373291, 0.0019265603041276336, -0.040799953043460846, -0.02199372462928295, 0.044099949300289154, -0.024862471967935562, -0.01573123224079609, 0.018271854147315025, -0.04282495006918907, 0.06858742237091064, 0.022574974223971367, 0.007964053191244602, -0.018159354105591774, -0.02842496708035469, 0.07027491927146912, -0.031631212681531906, -0.031143713742494583, -0.004478901159018278, 0.015937481075525284, 0.015103107318282127, -0.02868746779859066, -0.010068738833069801, 0.04057495296001434, -0.034649960696697235, 0.028143716976046562, -0.007504678796976805, 0.037031207233667374, 0.013846859335899353, 0.050512440502643585, 0.009567176923155785, 0.04019995406270027, -0.013931234367191792, 0.018834352493286133, -0.05122493952512741, 0.023906223475933075, -0.06018742918968201, 0.03065621480345726, -0.008526552468538284, -0.024974972009658813, -0.016303107142448425, -0.06982491910457611, -0.0037242143880575895, 0.030074965208768845, 0.03446245938539505, -0.025368720293045044, -0.038849953562021255, -0.0023261692840605974, 0.03708745911717415, -0.03736870735883713, 0.007504678796976805, -0.020793726667761803, -0.022481223568320274, 0.07151241600513458, 0.03251246362924576, -0.0466124452650547, 0.0071859294548630714, -0.019481226801872253, 0.019190603867173195, -0.0002469723694957793, -0.01689373143017292, 0.0290999673306942, 0.009862489067018032, -0.01179373636841774, 0.013724984601140022, 0.05662493407726288, 0.020099977031350136, -0.010031238198280334, 0.008090615272521973, 0.005812493152916431, 0.01623748056590557, 0.05148744210600853, 0.016809355467557907, -0.019856227561831474, 0.00402890145778656, -0.07904990762472153, -0.016031231731176376, 0.03862495720386505, -0.016434356570243835, -0.01744685508310795, -0.03708745911717415, -0.01479373313486576, -0.03247496113181114, -0.014493733644485474, 0.06239992752671242, -0.01913435384631157, -0.05332493782043457, 0.04166245087981224, -0.013687483966350555, 0.027674967423081398, 0.055874936282634735, -0.009028114378452301, -0.037293706089258194, 0.01106248702853918, -0.027431217953562737, -0.09494989365339279, 0.017990604043006897, -0.02529372088611126, -0.02345622330904007, 0.07124991714954376, 0.046424947679042816, -0.0070874919183552265, 0.02398122288286686, -0.01609685644507408, -0.036224957555532455, -0.023887472227215767, -0.03626246005296707, 0.037031207233667374, 0.02161872573196888, 0.046687446534633636, 0.0310687143355608, -0.028987467288970947, -0.03926245495676994, 0.010031238198280334, 0.009342176839709282, -0.053137440234422684, 0.0012656234903261065, -0.010303113609552383, 0.00891092699021101, 0.019743727520108223, -0.07098741829395294, -0.029399966821074486, 0.007889053784310818, 0.004335932433605194, -0.03052496537566185, 0.014981232583522797, -0.06656242161989212, -0.02934371680021286, -0.0411374531686306, 0.01794372871518135, 0.036487456411123276, 0.008109365589916706, -0.004298432730138302, -0.08954989910125732, 0.04286245256662369, -0.01979997754096985, -0.006187492981553078, -0.06974992156028748, 0.0011361314682289958, 0.006796867121011019, 0.029531216248869896, -0.06618742644786835, -0.02949371561408043, 0.07604991644620895, 0.015506232157349586, 0.08144990354776382, 0.059549931436777115, 0.03748120740056038, -0.018393728882074356, 0.013968734070658684, 0.03365620970726013, 0.03487496078014374, -0.003182808868587017, -0.010696862824261189, -0.02553747035562992, -0.041999951004981995, 0.04822494462132454, 0.012618735432624817, 0.0034382774028927088, -0.014193734154105186, 0.02752496860921383, -0.08369990438222885, -0.031387463212013245, 0.01499060820788145, 0.03427496179938316, 0.0345749594271183, 0.04856244474649429, 0.008751552551984787, 0.019574977457523346, -0.010265612974762917, -0.0516374409198761, 0.004828119650483131, 0.049049943685531616, -0.05891243368387222, -0.007537491153925657, -0.011606236919760704, 0.0073687415570020676, 0.04586244747042656, -0.014765608124434948, 0.018440604209899902, 0.016706230118870735, -0.02229372411966324, 0.05227493867278099, -0.01743748039007187, -0.05017494410276413, -0.0717749148607254, -0.019481226801872253, -0.019856227561831474, 0.00406405795365572, 0.023212473839521408, 0.032568711787462234, -0.01532810740172863, -0.009993738494813442, 0.00826405268162489, 0.061912428587675095, 0.012534360401332378, -0.013640609569847584, 0.05223743990063667, 0.01806560344994068, -0.021712474524974823, -0.027356218546628952, -0.02304372377693653, -0.03929995372891426, 0.009740613400936127, 0.051037441939115524, 0.023924972862005234, -0.011831236071884632, -0.015440607443451881, -0.03538120910525322, 0.005676555912941694, -0.028124967589974403, -0.01342498417943716, -0.009721864014863968, 0.011653111316263676, 0.02923121675848961, -0.051037441939115524, 0.0413624532520771, -0.005549993831664324, -0.02621247060596943, -0.02098122611641884, -0.10184988379478455, 0.022443724796175957, -0.00740155391395092, 0.01008748821914196, -0.004736713133752346, -0.06832492351531982, -0.005910930689424276, 0.04102495312690735, -0.031368713825941086, 0.01782185398042202, -0.068062424659729, -0.010218738578259945, 0.021974975243210793, -0.08129990845918655, 0.025649970397353172, -0.02973746508359909, 0.028106218203902245, -0.004169526509940624, 0.08287490159273148, -0.017474979162216187, -0.0005463861161842942, 0.0019335915567353368, 0.0377437062561512, -0.038699954748153687, 0.004743744619190693, -0.018037479370832443, 0.06254992634057999, 0.02071872539818287, 0.022631224244832993, 0.008817177265882492, 0.05437493696808815, -0.0019066383829340339, -0.020624976605176926, 0.004996869247406721, -0.02028747648000717, 0.0038976517971605062, -0.013996859081089497, -0.006515617482364178, -0.0035132772754877806, 0.04046245291829109, -0.04139995202422142, 0.039524953812360764, -0.03892495483160019, 0.007509366609156132, 0.02159997448325157, 0.05189993977546692, -0.04034995287656784, 0.04608744755387306, 0.006895304657518864, -0.0037945269141346216, -0.018524978309869766, -0.014212483540177345, -0.01296561025083065, 0.012468735687434673, -0.039224956184625626, 0.052762437611818314, -0.0608249306678772, -0.005114056635648012, -0.019331227988004684, 0.005418743938207626, -0.08114990592002869, 0.036862459033727646, 0.050362441688776016, 0.014221858233213425, -0.010846862569451332, 0.004544525872915983, -0.061387430876493454, 0.0025804657489061356, 0.0654374212026596, -0.022031225264072418, -0.02422497235238552, -0.0340312123298645, -0.003128902753815055, -0.030881214886903763, 0.02660621888935566, 0.07349991798400879, 0.05347494035959244, -0.030506214126944542, 0.008081240579485893, 0.005943743046373129, 0.010153112933039665, -0.021262476220726967, -0.01414685882627964, 0.027824968099594116, 0.03971245512366295, 0.024206222966313362, -0.08152490854263306, -0.03941245377063751, -0.00201445072889328, 0.002206637989729643, -0.03054371476173401, -0.051412440836429596, 0.016434356570243835, -0.03397496044635773, 0.05306243896484375, 0.01978122815489769, -0.030037466436624527, -0.039112456142902374, -0.04177495092153549, 0.008826551958918571, 0.06326242536306381, 0.008924989961087704, 0.0387374572455883, -0.06907492130994797, -0.08287490159273148, 0.05006244406104088, -0.0029414028394967318, -0.02711246907711029, 0.04582494869828224, -0.08677490055561066, -0.006628117524087429, -0.011887486092746258, -0.005264056380838156, 0.03052496537566185, 0.02921246737241745, 0.06618742644786835, 0.02306247316300869, -0.040687453001737595, 0.06449992954730988, 0.011962486431002617, 0.03223121166229248, 0.056774936616420746, 0.020118726417422295, -0.017784355208277702, 0.0073031168431043625, 0.00005357659756555222, -0.0026437470223754644, -0.004321869928389788, 0.00942655187100172, -0.01531873270869255, 0.005582806188613176, -0.0022148413117974997, 0.04162495210766792, 0.05283743888139725, 0.022593723610043526, -0.0479249432682991, 0.013846859335899353, 0.054562438279390335, -0.01940622739493847, 0.0063796802423894405, -0.018646853044629097, -0.01782185398042202, -0.05699993297457695, 0.02279997430741787, -0.020343726500868797, -0.057712431997060776, 0.024974972009658813, -0.005789055954664946, 0.006506242323666811, 0.031631212681531906, -0.015356232412159443, -0.0008630849188193679, 0.032568711787462234, 0.02161872573196888, 0.019612478092312813, -0.011156236752867699, -0.0010207019513472915, 0.005428118631243706, 0.0516374409198761, 0.028668716549873352, -0.017353104427456856, 0.04451245069503784, 0.012928110547363758, 0.03119996376335621, 0.025331221520900726, 0.01612498238682747, 0.027862468734383583, 0.032681211829185486, 0.041474953293800354, -0.002557028317824006, -0.012787485495209694, 0.009187489748001099, 0.02596871927380562, -0.05227493867278099, -0.05231244117021561, 0.055987436324357986, -0.062437430024147034, 0.0319499634206295, -0.06723742187023163, 0.022331224754452705, 0.013659358955919743, -0.05407493934035301, -0.04912494495511055, 0.02030622586607933, -0.03367496281862259, 0.021281225606799126, -0.0165187306702137, 0.016678106039762497, -0.0411374531686306, 0.04574994742870331, 0.04766244441270828, -0.026249969378113747, -0.026174969971179962, -0.027149969711899757, -0.02818121761083603 ]
717,358
pytorch_optimizer.optimizer.padam
PAdam
Closing the Generalization Gap of Adaptive Gradient Methods in Training Deep Neural Networks. :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param lr: float. learning rate. :param betas: BETAS. coefficients used for computing running averages of gradient and the squared hessian trace. :param partial: float. partially adaptive parameter. :param weight_decay: float. weight decay (L2 penalty). :param weight_decouple: bool. the optimizer uses decoupled weight decay as in AdamW. :param fixed_decay: bool. fix weight decay. :param eps: float. term added to the denominator to improve numerical stability.
class PAdam(Optimizer, BaseOptimizer): """Closing the Generalization Gap of Adaptive Gradient Methods in Training Deep Neural Networks. :param params: PARAMETERS. iterable of parameters to optimize or dicts defining parameter groups. :param lr: float. learning rate. :param betas: BETAS. coefficients used for computing running averages of gradient and the squared hessian trace. :param partial: float. partially adaptive parameter. :param weight_decay: float. weight decay (L2 penalty). :param weight_decouple: bool. the optimizer uses decoupled weight decay as in AdamW. :param fixed_decay: bool. fix weight decay. :param eps: float. term added to the denominator to improve numerical stability. """ def __init__( self, params: PARAMETERS, lr: float = 1e-1, betas: BETAS = (0.9, 0.999), partial: float = 0.25, weight_decay: float = 0.0, weight_decouple: bool = False, fixed_decay: bool = False, eps: float = 1e-8, ): self.validate_learning_rate(lr) self.validate_betas(betas) self.validate_range(partial, 'partial', 0.0, 1.0, range_type='(]') self.validate_non_negative(weight_decay, 'weight_decay') self.validate_non_negative(eps, 'eps') defaults: DEFAULTS = { 'lr': lr, 'betas': betas, 'partial': partial, 'weight_decay': weight_decay, 'weight_decouple': weight_decouple, 'fixed_decay': fixed_decay, 'eps': eps, } super().__init__(params, defaults) def __str__(self) -> str: return 'PAdam' @torch.no_grad() def reset(self): for group in self.param_groups: group['step'] = 0 for p in group['params']: state = self.state[p] state['exp_avg'] = torch.zeros_like(p) state['exp_avg_sq'] = torch.zeros_like(p) @torch.no_grad() def step(self, closure: CLOSURE = None) -> LOSS: loss: LOSS = None if closure is not None: with torch.enable_grad(): loss = closure() for group in self.param_groups: if 'step' in group: group['step'] += 1 else: group['step'] = 1 beta1, beta2 = group['betas'] bias_correction1: float = 1.0 - beta1 ** group['step'] bias_correction2_sq: float = math.sqrt(1.0 - beta2 ** group['step']) for p in group['params']: if p.grad is None: continue grad = p.grad if grad.is_sparse: raise NoSparseGradientError(str(self)) state = self.state[p] if len(state) == 0: state['exp_avg'] = torch.zeros_like(p) state['exp_avg_sq'] = torch.zeros_like(p) self.apply_weight_decay( p, grad, lr=group['lr'], weight_decay=group['weight_decay'], weight_decouple=group['weight_decouple'], fixed_decay=group['fixed_decay'], ) exp_avg, exp_avg_sq = state['exp_avg'], state['exp_avg_sq'] exp_avg.mul_(beta1).add_(grad, alpha=1.0 - beta1) exp_avg_sq.mul_(beta2).addcmul_(grad, grad, value=1.0 - beta2) de_nom = exp_avg_sq.sqrt().add_(group['eps']) step_size: float = group['lr'] * bias_correction2_sq / bias_correction1 p.addcdiv_(exp_avg, de_nom ** (group['partial'] * 2), value=-step_size) return loss
(params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], lr: float = 0.1, betas: Union[Tuple[float, float], Tuple[float, float, float]] = (0.9, 0.999), partial: float = 0.25, weight_decay: float = 0.0, weight_decouple: bool = False, fixed_decay: bool = False, eps: float = 1e-08)
[ -0.007945599965751171, -0.05142321065068245, -0.015137311071157455, 0.027318580076098442, -0.01922418735921383, -0.0160201545804739, -0.051819995045661926, -0.07471443712711334, -0.005574815906584263, 0.008342384360730648, -0.042138464748859406, -0.010524696670472622, 0.01788504049181938, 0.0802297294139862, -0.0470585860311985, 0.05328809469938278, 0.021684248000383377, 0.05951760336756706, -0.004657252691686153, -0.011774566024541855, -0.022537333890795708, -0.07614285498857498, -0.01888692006468773, 0.04539209231734276, -0.036623165011405945, -0.009909681044518948, 0.025354498997330666, -0.02299363538622856, -0.045788876712322235, -0.010038635693490505, -0.008198549970984459, -0.07384151220321655, -0.012220948003232479, 0.013460898771882057, 0.04174168035387993, -0.033667124807834625, 0.008049756288528442, 0.014968677423894405, -0.08753056079149246, -0.043884314596652985, 0.03269500285387039, -0.05681947246193886, 0.02130730263888836, -0.03634541854262352, 0.01756761223077774, 0.012052315287292004, -0.003355304943397641, 0.05352616682648659, -0.022418297827243805, -0.019769765436649323, 0.024679966270923615, -0.061382491141557693, 0.05074867978692055, 0.016476457938551903, -0.01228046603500843, 0.058089181780815125, 0.06860396265983582, -0.013292265124619007, 0.04658244550228119, -0.07300826162099838, 0.032456934452056885, -0.08959383517503738, 0.036781881004571915, -0.031901437789201736, -0.006824685260653496, -0.024799002334475517, -0.08364207297563553, -0.03509554639458656, 0.014343743212521076, 0.015891199931502342, 0.036980271339416504, -0.04067036509513855, 0.01315339095890522, 0.017706487327814102, -0.026088550686836243, -0.015305943787097931, -0.032814040780067444, -0.053764235228300095, -0.008729248307645321, -0.03545265272259712, 0.0016367341158911586, 0.0006026157643646002, -0.017617210745811462, -0.017706487327814102, 0.03577008098363876, -0.06285059452056885, -0.016188789159059525, -0.024799002334475517, 0.03483763709664345, -0.05483555421233177, 0.049082186073064804, -0.010901641100645065, 0.05205806717276573, 0.049796395003795624, 0.06919913738965988, 0.022557172924280167, -0.029362019151449203, -0.045590486377477646, -0.00821342971175909, -0.009989038109779358, -0.012250707484781742, 0.03378615900874138, 0.017627131193876266, 0.03985695540904999, 0.03509554639458656, -0.03237757831811905, -0.02126762457191944, -0.020047513768076897, 0.04364624246954918, -0.06245380640029907, -0.05225645750761032, -0.012637571431696415, -0.03753576800227165, -0.01586144231259823, 0.0018611651612445712, 0.012726848013699055, 0.016922838985919952, 0.026445655152201653, -0.006869323551654816, 0.04297171160578728, 0.05316906049847603, 0.05344681069254875, -0.045788876712322235, -0.00446382025256753, 0.023985594511032104, -0.012746687047183514, 0.036781881004571915, 0.006279107183218002, -0.002343505620956421, -0.05003446713089943, -0.024283183738589287, 0.02906442992389202, -0.03047301433980465, -0.007950560189783573, 0.034004390239715576, -0.020831162109971046, -0.0038934433832764626, 0.03362744674086571, -0.041106827557086945, 0.005778167396783829, 0.0405513271689415, 0.015087712556123734, 0.008912761695683002, 0.006452700588852167, 0.03327034041285515, -0.008382062427699566, 0.032099828124046326, 0.006452700588852167, -0.011913440190255642, 0.005386343225836754, 0.005892242770642042, -0.0123796621337533, 0.00014863902470096946, -0.0021066751796752214, 0.04158296808600426, -0.00566905178129673, -0.029996873810887337, 0.02059309184551239, -0.044915951788425446, -0.029738962650299072, -0.040392614901065826, -0.0389840304851532, -0.02993735484778881, 0.015196828171610832, -0.005178031511604786, 0.005465700291097164, 0.013490657322108746, 0.040253739804029465, -0.02628694288432598, 0.014095752499997616, 0.01671452820301056, -0.08348336070775986, 0.0123796621337533, 0.018648849800229073, -0.03840869292616844, 0.1102266013622284, 0.012429259717464447, 0.020305423066020012, 0.009314505383372307, -0.03618670254945755, 0.050629641860723495, 0.004887883551418781, -0.03519474342465401, -0.06209670007228851, -0.009775767102837563, 0.02630678191781044, 0.00493996124714613, 0.005351624451577663, -0.025850480422377586, 0.03872612118721008, -0.008139032870531082, -0.005877363495528698, 0.0436859205365181, -0.009522817097604275, -0.015077793039381504, -0.0037719281390309334, 0.02251749485731125, 0.008074555546045303, 0.09689465910196304, 0.0591605007648468, 0.004763888195157051, 0.011367863044142723, 0.038329336792230606, 0.015454738400876522, 0.0016342542367056012, -0.0012932679383084178, -0.03100867196917534, 0.023132508620619774, -0.028151826933026314, -0.011734887957572937, -0.05717657878994942, -0.003146993461996317, 0.06269187480211258, 0.03309178724884987, 0.039698243141174316, -0.03083011880517006, 0.03977759927511215, 0.03174272179603577, 0.05777175724506378, -0.005827765446156263, -0.00983528420329094, -0.053248416632413864, -0.001650373567827046, 0.005297066643834114, 0.08840348571538925, -0.022953957319259644, 0.03515506535768509, 0.0072264294140040874, -0.008550696074962616, 0.005807926412671804, 0.020513733848929405, -0.054795876145362854, 0.005664092022925615, -0.005302026867866516, 0.06539000570774078, 0.009344263933598995, -0.040055349469184875, -0.02612822875380516, -0.029719123616814613, -0.027477294206619263, -0.00960217323154211, -0.01600031554698944, -0.02977864257991314, 0.028151826933026314, -0.019333302974700928, 0.011090113781392574, 0.06285059452056885, 0.010494938120245934, 0.003717370331287384, 0.01626814529299736, -0.03565104678273201, -0.020493894815444946, -0.029143787920475006, 0.03733737766742706, -0.07181791216135025, -0.01619870774447918, 0.03356792777776718, 0.04400334879755974, 0.0029709204100072384, -0.03672236204147339, -0.011675369925796986, -0.03432181850075722, -0.05503394454717636, 0.04828861728310585, 0.0027477294206619263, 0.059835031628608704, 0.06467580050230026, -0.034341659396886826, 0.018876999616622925, 0.02014670893549919, 0.09046676009893417, 0.0712624117732048, -0.05570847913622856, -0.01649629697203636, -0.005550016649067402, 0.046661801636219025, -0.00895243976265192, 0.00877388659864664, -0.015305943787097931, -0.017081553116440773, 0.061223775148391724, -0.055351372808218, -0.034698761999607086, 0.008441580459475517, -0.044400133192539215, 0.054795876145362854, -0.02025582455098629, 0.029163626953959465, 0.053764235228300095, 0.04067036509513855, 0.0394403338432312, 0.0023707845248281956, 0.10078314691781998, 0.006794926710426807, 0.06281091272830963, 0.03707946836948395, 0.022358780726790428, 0.020831162109971046, -0.03273468464612961, -0.021922318264842033, 0.05499426648020744, -0.008263027295470238, 0.022081032395362854, 0.0034966592211276293, -0.02771536447107792, -0.009433540515601635, -0.006537016946822405, 0.027120187878608704, 0.04166232421994209, -0.012310224585235119, -0.0068544442765414715, -0.010524696670472622, -0.01980944350361824, 0.03412342816591263, -0.005644252989441156, -0.09808501601219177, -0.002342265797778964, -0.04344785213470459, 0.04118618369102478, 0.04483659565448761, -0.05122482031583786, 0.04566984251141548, 0.008749088272452354, -0.02200167439877987, -0.043209780007600784, -0.041979752480983734, 0.06142216920852661, 0.02388639934360981, -0.017200587317347527, -0.016843482851982117, -0.05082803592085838, -0.011149631813168526, 0.016734367236495018, 0.008808605372905731, -0.0405513271689415, -0.0025046991650015116, 0.026346459984779358, 0.015990396961569786, 0.0020880759693682194, -0.045074667781591415, 0.05777175724506378, 0.04360656440258026, -0.03525426238775253, 0.033329859375953674, -0.005485539324581623, -0.05836693197488785, 0.015831682831048965, 0.04082907736301422, 0.009180590510368347, 0.015345622785389423, 0.010931400582194328, -0.01696251705288887, 0.019095230847597122, 0.1001482903957367, 0.06804846227169037, 0.007127233315259218, -0.02301347441971302, -0.0032536291982978582, 0.03858724609017372, -0.04860604554414749, -0.0061352732591331005, -0.01729978434741497, -0.03773416206240654, 0.05658140406012535, 0.06896106153726578, 0.0075488160364329815, -0.015702728182077408, -0.049082186073064804, 0.015434899367392063, -0.04090843349695206, 0.0060509564355015755, -0.09832308441400528, -0.01758745312690735, -0.005991438869386911, -0.03715882450342178, -0.002710531000047922, -0.024521254003047943, 0.006060875952243805, 0.053208738565444946, 0.04289235547184944, 0.05174063891172409, -0.026584530249238014, 0.027140028774738312, 0.030215105041861534, 0.05090739205479622, -0.0374167338013649, 0.03553200885653496, -0.01729978434741497, 0.05435941368341446, -0.06415998190641403, 0.022358780726790428, 0.011467058211565018, -0.012250707484781742, 0.00662133377045393, -0.0806661918759346, 0.03664300590753555, 0.021406497806310654, 0.04848700761795044, -0.07023077458143234, -0.021188266575336456, -0.016615331172943115, -0.037119146436452866, 0.010921480134129524, 0.009840244427323341, -0.014105672016739845, -0.06443772464990616, 0.018648849800229073, 0.08102329820394516, 0.0016441738698631525, 0.10205285251140594, -0.006313825957477093, 0.02126762457191944, -0.0006326845614239573, 0.03438133746385574, -0.004744049161672592, -0.026346459984779358, -0.022616690024733543, 0.00024845500593073666, 0.007662891875952482, 0.017309702932834625, 0.059120822697877884, 0.0029362018685787916, 0.034361496567726135, 0.01568288914859295, 0.02039469964802265, -0.046979229897260666, -0.08483242988586426, -0.01246893871575594, -0.048883792012929916, -0.020890679210424423, -0.011724968440830708, -0.02390623837709427, -0.03598831221461296, -0.022021513432264328, -0.01557377353310585, 0.01219118945300579, 0.003352825064212084, 0.052018385380506516, 0.03824998065829277, -0.012855802662670612, 0.03327034041285515, -0.023648329079151154, 0.007732328958809376, 0.008709409274160862, 0.0006956119905225933, -0.04725698009133339, 0.04650308936834335, -0.011566254310309887, -0.0551133006811142, -0.0038413654547184706, 0.042495571076869965, -0.0062989466823637486, 0.06376319378614426, 0.003982719965279102, -0.007697610184550285, 0.009666651487350464, 0.015117472037672997, -0.030334139242768288, -0.003199071390554309, 0.021664408966898918, 0.026763083413243294, 0.031960953027009964, -0.022041352465748787, 0.023152347654104233, -0.03440117463469505, 0.03239741548895836, 0.07368279248476028, 0.009716249071061611, -0.002141393721103668, 0.03410358726978302, 0.00194796163123101, -0.022596850991249084, 0.0008648652001284063, -0.04693955183029175, -0.048883792012929916, -0.012597893364727497, -0.015018275938928127, 0.010425500571727753, 0.02525530382990837, 0.005217710044234991, 0.04205910861492157, -0.05967631936073303, 0.032615646719932556, 0.04860604554414749, 0.010083273984491825, 0.022894438356161118, 0.0020012794993817806, 0.02184296026825905, 0.00037601488293148577, 0.02874700352549553, -0.048050545156002045, -0.05543072894215584, 0.06669939309358597, 0.03777384012937546, -0.06713585555553436, -0.041106827557086945, 0.019501935690641403, -0.00898715853691101, 0.0786425992846489, -0.04848700761795044, 0.023588810116052628, -0.0037744080182164907, -0.07217501848936081, -0.028766842558979988, 0.062414128333330154, -0.04376528039574623, -0.0571369007229805, 0.025711605325341225, -0.0396585650742054, 0.04217814281582832, -0.0358494371175766, -0.01072308886796236, -0.001065117190591991, 0.03323066234588623, 0.0021575132850557566, -0.01920434646308422, 0.01298475731164217, 0.050470929592847824, 0.05142321065068245, -0.04943929240107536, 0.0443604551255703, 0.04237653315067291, -0.036444611847400665, -0.039896633476018906, 0.002161232987418771, 0.05344681069254875, 0.00009059385774889961, -0.0160201545804739, 0.03461940586566925, 0.0038860037457197905, 0.0035313779953867197, -0.0033329857978969812, 0.03231805935502052, 0.07868227362632751, 0.002145113656297326, -0.013173229992389679, 0.01124882698059082, -0.050986748188734055, -0.10078314691781998, -0.02581080235540867, 0.008431660942733288, 0.0114273801445961, -0.010941320098936558, -0.04662212356925011, -0.005926961544901133, 0.06320769339799881, -0.02126762457191944, 0.029342180117964745, -0.04432077705860138, -0.016506215557456017, -0.011903520673513412, 0.00971128884702921, -0.033290181308984756, 0.045273058116436005, 0.055629123002290726, 0.01828182488679886, -0.030532531440258026, 0.026425816118717194, 0.016506215557456017, 0.018787724897265434, -0.047018907964229584, -0.06086667254567146, 0.0006565536023117602, -0.04082907736301422, -0.001970280660316348, 0.014125511981546879, -0.003191631520166993, 0.015960637480020523, -0.0636441558599472, 0.021426338702440262, -0.00096840102924034, -0.055668801069259644, -0.0027948475908488035, -0.0259893536567688, -0.05015350133180618, 0.0029932395555078983, 0.006358464248478413, -0.01817270927131176, 0.0021723925601691008, -0.009522817097604275, 0.045947592705488205, -0.03311162814497948, -0.031207064166665077, -0.029381858184933662, 0.00601127790287137, 0.05118514224886894, -0.05785111337900162, 0.01736922189593315, 0.016674848273396492, -0.012935159727931023, -0.05666076019406319, 0.0179247185587883, 0.001256689429283142, -0.05293098837137222, -0.022557172924280167, 0.05178031697869301, -0.04515402391552925, 0.02182312123477459, 0.03951968997716904, 0.03009606897830963, -0.042852677404880524, 0.0004727309860754758, 0.0425749272108078, -0.009483138099312782, 0.021406497806310654, 0.007429780904203653, -0.01783544197678566, 0.013460898771882057, 0.039559368044137955, -0.0463840551674366, -0.036246221512556076, -0.016228467226028442, -0.009101233445107937, -0.028985073789954185, -0.0712624117732048, -0.016228467226028442, -0.04658244550228119, 0.022596850991249084, 0.08372142910957336, 0.002332346048206091, -0.01559361256659031, -0.004315026570111513, -0.0005117894033901393, 0.015127391554415226, -0.01143729966133833, -0.029500892385840416, 0.01895635761320591, -0.09808501601219177, -0.016059834510087967, -0.0031048350501805544, 0.0065072583965957165, 0.009111152961850166, 0.019938398152589798, -0.030036551877856255, 0.013708888553082943, 0.0045084585435688496, 0.049042508006095886, 0.012498697265982628, -0.031960953027009964, -0.049796395003795624, -0.024818841367959976, 0.012786365114152431, -0.03118722513318062, -0.0070974742993712425, -0.006755248177796602, -0.022715885192155838, -0.020513733848929405, 0.003814086550846696, 0.04241621494293213, 0.013014516793191433, -0.005986479111015797, 0.025195786729454994, -0.04809022322297096, -0.012062234804034233, 0.01568288914859295, -0.0034966592211276293, 0.019591212272644043, 0.05745432898402214, 0.007186750881373882, -0.03983711823821068, -0.0038165664300322533, -0.016545893624424934, 0.00978072639554739, 0.005014358088374138, -0.03737705573439598, 0.008620132692158222, -0.012806205078959465, 0.013312104158103466, 0.018033834174275398, 0.0068296450190246105, -0.08213429152965546, -0.023668168112635612, -0.06868331879377365, 0.015107552520930767, 0.017627131193876266, -0.0010886761592701077, 0.01633758284151554, -0.05316906049847603, -0.0519787073135376, -0.01723034679889679, 0.04693955183029175, 0.034163106232881546, 0.006323745474219322, 0.001024198834784329, 0.033151306211948395, -0.011784485541284084, -0.00989480223506689, 0.0182619858533144, 0.006844524759799242, -0.02218022756278515, -0.05832725390791893, -0.021327141672372818, 0.03632557764649391, 0.010346143506467342, 0.04777279868721962, -0.07142112404108047, -0.021525533869862556, -0.037615127861499786, -0.011794405058026314, -0.07189726829528809, -0.015385300852358341, -0.025195786729454994, -0.03618670254945755, 0.0019529213896021247, 0.022596850991249084, 0.08340400457382202, 0.004994519054889679, 0.009741048328578472, 0.005173071753233671, -0.0031197145581245422, 0.004297667182981968, 0.016049914062023163, -0.00574840884655714, -0.0038636846002191305, 0.06665971875190735, 0.006368383765220642, 0.03753576800227165, -0.04015454277396202, -0.04313042387366295, 0.05884307250380516, -0.030076229944825172, 0.03309178724884987, -0.002267868723720312, -0.007216509431600571, -0.04586823284626007, -0.0629696249961853, -0.011367863044142723, -0.0457095205783844, 0.024461735039949417, -0.014075913466513157, 0.01801399514079094, 0.028806520625948906, -0.006308866199105978, -0.009364102967083454, -0.014522295445203781, 0.014552054926753044, 0.058089181780815125, 0.013728727586567402, 0.008163831196725368, 0.05138353258371353, 0.0036008150782436132, 0.051661282777786255, -0.029560411348938942, -0.009036756120622158, -0.002693171612918377, 0.026941636577248573, -0.01922418735921383, -0.019849121570587158, 0.02630678191781044, -0.05852564424276352, 0.05110578238964081, 0.015057954005897045, 0.025513213127851486, 0.04134489595890045, 0.06824685633182526, -0.06983398646116257, 0.029183465987443924, -0.056859150528907776, -0.07649996131658554, -0.11490865796804428, -0.016317743808031082, -0.037634965032339096, 0.0757460743188858, 0.015653129667043686, 0.015296024270355701, 0.014909160323441029, 0.015147230587899685, 0.02370784617960453 ]
717,360
pytorch_optimizer.optimizer.padam
__init__
null
def __init__( self, params: PARAMETERS, lr: float = 1e-1, betas: BETAS = (0.9, 0.999), partial: float = 0.25, weight_decay: float = 0.0, weight_decouple: bool = False, fixed_decay: bool = False, eps: float = 1e-8, ): self.validate_learning_rate(lr) self.validate_betas(betas) self.validate_range(partial, 'partial', 0.0, 1.0, range_type='(]') self.validate_non_negative(weight_decay, 'weight_decay') self.validate_non_negative(eps, 'eps') defaults: DEFAULTS = { 'lr': lr, 'betas': betas, 'partial': partial, 'weight_decay': weight_decay, 'weight_decouple': weight_decouple, 'fixed_decay': fixed_decay, 'eps': eps, } super().__init__(params, defaults)
(self, params: Union[Iterable[Dict], Iterable[torch.Tensor], NoneType], lr: float = 0.1, betas: Union[Tuple[float, float], Tuple[float, float, float]] = (0.9, 0.999), partial: float = 0.25, weight_decay: float = 0.0, weight_decouple: bool = False, fixed_decay: bool = False, eps: float = 1e-08)
[ 0.01471931766718626, -0.03536750748753548, -0.019862663000822067, -0.025885051116347313, -0.055398497730493546, -0.021358909085392952, -0.07735590636730194, -0.047618020325899124, -0.024220477789640427, 0.021901296451687813, -0.0372939258813858, 0.0516204796731472, 0.0012016723630949855, 0.06022389233112335, -0.051583074033260345, 0.04993720352649689, 0.0328051894903183, 0.017702458426356316, -0.01381221879273653, 0.005110614467412233, 0.0017802986549213529, 0.006765836384147406, -0.043989624828100204, 0.1286771297454834, 0.018525393679738045, 0.024426212534308434, -0.010567235760390759, -0.002393993316218257, -0.019170649349689484, 0.0004833575221709907, 0.03162689507007599, -0.008809146471321583, -0.013924436643719673, 0.04391481354832649, 0.04301706701517105, -0.028690513223409653, 0.004979692865163088, 0.015233651734888554, -0.06826621294021606, 0.04301706701517105, 0.07167017459869385, -0.0407726988196373, 0.051844917237758636, -0.035199180245399475, -0.013307236135005951, -0.006910785101354122, 0.04541105777025223, 0.051508259028196335, -0.0027400001417845488, -0.0291580893099308, 0.021695563569664955, -0.023958634585142136, 0.028466075658798218, -0.026876313611865044, -0.05678252503275871, 0.05079754441976547, 0.034207917749881744, 0.07028614729642868, 0.0478050522506237, 0.026689283549785614, 0.0014062372501939535, -0.03145856782793999, 0.024164369329810143, -0.03258075192570686, -0.000001136978767135588, -0.005321023985743523, -0.07787959277629852, -0.022050922736525536, 0.0177585668861866, 0.03252464160323143, 0.09605897963047028, -0.0001712500088615343, -0.023341434076428413, 0.0328051894903183, 0.0022934642620384693, -0.0038949146401137114, -0.07417638599872589, -0.048066895455121994, -0.057568054646253586, -0.0016248293686658144, 0.04810430109500885, 0.02753092162311077, -0.026782799512147903, -0.05352819338440895, 0.016729898750782013, -0.04395221918821335, -0.04339112713932991, -0.061383482068777084, 0.03834129869937897, 0.034282732754945755, -0.07541078329086304, -0.018618907779455185, 0.012035426683723927, -0.020236723124980927, 0.08543563634157181, 0.0030228840187191963, 0.026296518743038177, -0.05248082056641579, 0.022481093183159828, -0.021321501582860947, -0.025604505091905594, -0.014569693244993687, -0.05506184324622154, -0.0003588651889003813, 0.024575836956501007, -0.031832627952098846, -0.04563549533486366, -0.03533010184764862, 0.033478498458862305, -0.06157051399350166, -0.020592082291841507, 0.042717818170785904, -0.035835087299346924, 0.03785501793026924, -0.055398497730493546, 0.04410184547305107, 0.029232902452349663, 0.021358909085392952, 0.013849624432623386, 0.012914471328258514, 0.044812560081481934, 0.027025939896702766, -0.040548261255025864, 0.05745583772659302, 0.05296710133552551, -0.0040398635901510715, 0.004028174094855785, 0.009716246277093887, 0.022967372089624405, -0.013765460811555386, 0.026876313611865044, 0.0011800469364970922, -0.045336246490478516, -0.02455713413655758, 0.012830307707190514, -0.01323242299258709, 0.0035091638565063477, 0.04406443610787392, -0.032468531280756, 0.021508533507585526, 0.053415972739458084, 0.017356451600790024, 0.04219413176178932, -0.0211905799806118, -0.006466587074100971, 0.019095836207270622, -0.012381433509290218, -0.03359071910381317, -0.008664198219776154, 0.04765542596578598, 0.016084641218185425, 0.011754880659282207, -0.02971918135881424, 0.031047100201249123, 0.008650170639157295, -0.05154566466808319, 0.02844737283885479, -0.018871400505304337, -0.0009176194434985518, 0.013353993184864521, -0.019713038578629494, 0.03288000077009201, 0.019544709473848343, -0.02154593914747238, -0.008622116409242153, 0.026128191500902176, -0.05120901018381119, -0.0015067661879584193, -0.004395221825689077, -0.022237952798604965, -0.0017802986549213529, -0.08334089070558548, -0.03415181115269661, 0.03375904634594917, -0.00022472909768112004, 0.029064573347568512, 0.03209447115659714, -0.011810990050435066, -0.011633310467004776, -0.032206691801548004, 0.06830362230539322, -0.008318191394209862, -0.02055467665195465, -0.06759290397167206, 0.026483550667762756, 0.022312764078378677, -0.04324150085449219, 0.054762594401836395, -0.046159181743860245, 0.016636382788419724, 0.04320409521460533, 0.01516819093376398, 0.018796587362885475, 0.03405829519033432, -0.02257460728287697, 0.006270204670727253, 0.050760138779878616, -0.02092873677611351, 0.0041263652965426445, 0.04069788381457329, 0.056558091193437576, 0.006349693052470684, 0.022256655618548393, -0.024594539776444435, 0.017870785668492317, 0.000454133958555758, -0.008145187981426716, 0.0009006698383018374, -0.013082798570394516, -0.04844095557928085, -0.006691024173051119, -0.01463515404611826, 0.04668286815285683, 0.026128191500902176, -0.013391399756073952, -0.057942118495702744, -0.011436928063631058, 0.011483686044812202, 0.009276723489165306, -0.008897986263036728, 0.10107140243053436, -0.02627781592309475, -0.006125255953520536, -0.01876853220164776, 0.04503699764609337, 0.029569556936621666, 0.026165597140789032, -0.0436529703438282, -0.08633337914943695, 0.0411093533039093, -0.018179386854171753, -0.04672027379274368, -0.025623207911849022, -0.010417611338198185, 0.00805634818971157, 0.010801023803651333, -0.0471317432820797, 0.031009692698717117, -0.07810402661561966, -0.027156859636306763, 0.05996204912662506, 0.024781569838523865, -0.00586808891966939, -0.0275496244430542, 0.028952354565262794, 0.00731757702305913, 0.025043413043022156, 0.016729898750782013, -0.058839865028858185, -0.046346213668584824, -0.03867795318365097, 0.0013127218699082732, 0.004472372122108936, 0.04574771225452423, -0.048515770584344864, 0.021134471520781517, 0.03304832801222801, -0.0052088056690990925, 0.025623207911849022, 0.003796723671257496, -0.007467201445251703, -0.00783658679574728, -0.0018247184343636036, 0.08266758173704147, 0.013372696936130524, 0.021976109594106674, -0.016056587919592857, 0.003209914779290557, 0.02863440290093422, 0.013512969948351383, 0.10526088625192642, 0.017590239644050598, 0.002515563275665045, -0.004444317426532507, -0.0037897098809480667, -0.024519726634025574, 0.004147406201809645, -0.024126963689923286, 0.005414539482444525, 0.039538294076919556, 0.031308941543102264, -0.04133379086852074, 0.02309829369187355, 0.0011701108887791634, 0.02201351523399353, -0.00008219123265007511, -0.01395249180495739, 0.026333926245570183, 0.0029831400606781244, 0.007331604138016701, 0.011034812778234482, -0.007780477870255709, 0.08528600633144379, 0.017814675346016884, 0.08910143375396729, -0.01747802086174488, 0.05311672389507294, -0.01785208284854889, 0.06733106076717377, -0.013793515972793102, 0.03536750748753548, -0.06415154039859772, 0.04563549533486366, -0.00783658679574728, -0.051246415823698044, -0.04039863497018814, 0.028933651745319366, 0.017636997625231743, 0.03497474640607834, 0.03340368717908859, 0.033104438334703445, 0.022668123245239258, 0.050610512495040894, 0.009094368666410446, 0.04836614429950714, -0.04971276596188545, 0.006850000005215406, -0.05996204912662506, 0.0385657362639904, 0.043166689574718475, -0.005564163904637098, 0.031009692698717117, 0.008149863220751286, -0.006134607829153538, -0.06198197975754738, -0.04956313967704773, 0.03052341379225254, 0.018057815730571747, -0.04911426827311516, 0.000964377133641392, -0.04305447265505791, -0.010352150537073612, 0.026333926245570183, -0.028391262516379356, -0.06172013655304909, 0.0012718088692054152, 0.011717475019395351, 0.04294225201010704, -0.003761655418202281, -0.03514307364821434, 0.10847781598567963, -0.02609078586101532, 0.003913617692887783, 0.036751534789800644, -0.014102116227149963, -0.04791726917028427, 0.006826621480286121, -0.013840273022651672, 0.04773024097084999, -0.0006855844985693693, -0.013325938954949379, -0.0011104949517175555, 0.010613993741571903, 0.08364013582468033, 0.027063345536589622, -0.03155208379030228, -0.007925426587462425, -0.0023823038209229708, 0.03052341379225254, -0.051957134157419205, -0.02917679212987423, -0.00503112655133009, -0.0554359070956707, 0.04862798750400543, 0.029943618923425674, -0.0018866723403334618, 0.0071258703246712685, -0.0256419125944376, 0.025567099452018738, 0.009276723489165306, 0.02418307214975357, -0.06149569898843765, -0.031009692698717117, -0.00996873714029789, 0.016458703204989433, -0.01876853220164776, -0.03562935069203377, 0.011885802261531353, 0.038079455494880676, -0.017627645283937454, 0.003429675940424204, -0.014560341835021973, 0.04791726917028427, 0.03454457223415375, 0.007766450755298138, -0.026745393872261047, 0.0019310922361910343, 0.01091324258595705, 0.06576000154018402, 0.010660750791430473, -0.000018209924746770412, -0.011034812778234482, 0.015691878274083138, -0.014438771642744541, -0.057119183242321014, 0.036639317870140076, 0.050610512495040894, 0.026838907971978188, -0.026315221562981606, -0.03544232249259949, -0.007345631718635559, -0.059213925153017044, -0.01574798673391342, 0.05465037748217583, -0.0010625682771205902, -0.005643651820719242, 0.026689283549785614, 0.03893979638814926, 0.017468668520450592, 0.05872764438390732, -0.012063481844961643, 0.0006475938716903329, -0.0211905799806118, -0.005419215187430382, -0.036283958703279495, -0.023696791380643845, -0.008065699599683285, -0.024164369329810143, 0.01802976056933403, -0.023079590871930122, 0.0423811599612236, 0.008575358428061008, 0.08453788608312607, 0.014728669077157974, 0.07365269958972931, 0.0579795241355896, -0.013353993184864521, -0.016963686794042587, 0.007224061526358128, -0.0478050522506237, -0.058578021824359894, -0.01468191109597683, -0.05517406389117241, -0.037630580365657806, 0.022424982860684395, 0.007322252728044987, -0.006878054700791836, -0.0035629351623356342, 0.009772354736924171, -0.027867577970027924, 0.011044164188206196, -0.049413517117500305, 0.00992198009043932, -0.027306485921144485, -0.06807918101549149, -0.030093243345618248, 0.015963071957230568, -0.022892560809850693, -0.041820067912340164, -0.019264163449406624, 0.022593310102820396, 0.001276484690606594, 0.04582252725958824, -0.0036985324695706367, -0.01876853220164776, -0.03254334628582001, -0.02057337947189808, -0.025791537016630173, 0.04103453829884529, -0.02474416419863701, 0.06026129797101021, -0.013559726998209953, -0.013223071582615376, -0.008322866633534431, -0.05696955695748329, 0.012353379279375076, 0.06546074897050858, -0.01101610902696848, -0.0040351878851652145, 0.020367644727230072, 0.002357756020501256, 0.009314130060374737, 0.03435754403471947, -0.027568327262997627, -0.037275221198797226, 0.029045870527625084, -0.00227593001909554, -0.024388805031776428, -0.01173617783933878, -0.02175167202949524, 0.0016505460953339934, -0.04776764661073685, 0.0017288652015849948, 0.07597187906503677, 0.013026690110564232, -0.014111467637121677, -0.07226867228746414, 0.007574744056910276, 0.004717850126326084, 0.04312928393483162, -0.08446307480335236, -0.0017347099492326379, 0.032113175839185715, 0.07028614729642868, -0.03779890760779381, -0.008229351602494717, 0.027774062007665634, 0.02399604208767414, 0.045448463410139084, 0.02345365285873413, 0.01593501679599285, -0.03968792036175728, -0.02382771298289299, -0.023977337405085564, 0.021695563569664955, -0.05360300466418266, -0.08768000453710556, 0.005451945587992668, -0.026109488680958748, -0.008940068073570728, -0.01454163808375597, -0.005391160491853952, -0.016234265640378, 0.018628260120749474, -0.030280273407697678, -0.025080818682909012, -0.03016805462539196, 0.058129146695137024, -0.0016470393165946007, -0.02988750860095024, 0.04982498288154602, 0.056707713752985, 0.049600545316934586, -0.037181708961725235, 0.016234265640378, 0.04529884085059166, 0.02328532375395298, -0.0656103789806366, 0.06864027678966522, 0.018553446978330612, 0.013896382413804531, -0.05371522158384323, -0.028484778478741646, 0.03867795318365097, -0.0032029009889811277, 0.03757447004318237, 0.02220054715871811, -0.037088192999362946, -0.03218798711895943, -0.0283538568764925, 0.014410717412829399, 0.033123139292001724, 0.01802976056933403, -0.0339086689054966, -0.010099658742547035, 0.009650785475969315, -0.03190743923187256, 0.06426375359296799, -0.05951317399740219, -0.02128409594297409, 0.026782799512147903, -0.030766554176807404, -0.04975017160177231, 0.018366416916251183, 0.002306322567164898, -0.01073556300252676, 0.00026140466798096895, 0.0044747102074325085, 0.056221432983875275, 0.028409967198967934, -0.018805939704179764, -0.01127795223146677, 0.004872150253504515, 0.011717475019395351, -0.0144948810338974, 0.00464303744956851, 0.019619522616267204, -0.03267426788806915, -0.06310416758060455, 0.016729898750782013, 0.007083788514137268, 0.010763618163764477, 0.0032122526317834854, 0.002157866954803467, -0.032206691801548004, -0.0015687202103435993, -0.00855665560811758, 0.006274880841374397, -0.06635849922895432, -0.041184164583683014, 0.0011110793566331267, -0.036265257745981216, -0.10750525444746017, -0.09007399529218674, 0.032842595130205154, 0.007588771637529135, -0.051844917237758636, 0.017440615221858025, -0.015785392373800278, 0.018974266946315765, 0.0035512458998709917, 0.04739358276128769, -0.016804710030555725, -0.017431262880563736, -0.05188232287764549, 0.02710075117647648, -0.041820067912340164, -0.015233651734888554, 0.033740341663360596, 0.05880245938897133, -0.07802921533584595, -0.003960375674068928, 0.020872628316283226, 0.0283538568764925, 0.015383277088403702, -0.0032216040417551994, -0.011754880659282207, 0.04975017160177231, 0.02208832837641239, -0.06302935630083084, 0.024351399391889572, -0.015140136703848839, -0.0005152111989445984, -0.008869932033121586, -0.016187509521842003, -0.04645843058824539, -0.05281747505068779, 0.013288532383739948, 0.06935098767280579, -0.007729044649749994, -0.009309453889727592, -0.031047100201249123, -0.009650785475969315, 0.047243960201740265, -0.06893952190876007, -0.018525393679738045, 0.00429936870932579, -0.12201884388923645, 0.004486399237066507, -0.03149597346782684, 0.044513311237096786, -0.012680682353675365, -0.011390171013772488, -0.04948832839727402, -0.010585938580334187, 0.02646484598517418, 0.031234130263328552, 0.00996873714029789, 0.02582894265651703, -0.009089693427085876, 0.0021111092064529657, 0.041446007788181305, -0.004016484599560499, -0.0018013396766036749, 0.000602005107793957, -0.030280273407697678, -0.03920163959264755, -0.014083413407206535, 0.03521788492798805, 0.041184164583683014, -0.02700723521411419, 0.054949626326560974, -0.0449247807264328, 0.0011549147311598063, -0.01168006844818592, -0.007785153575241566, 0.03512436896562576, 0.016739249229431152, 0.061757542192935944, -0.016093993559479713, -0.03867795318365097, -0.03160819038748741, 0.05719399452209473, 0.0064806146547198296, 0.006172013934701681, 0.00829481240361929, -0.027250375598669052, -0.011923208832740784, -0.03886498510837555, -0.014840887859463692, -0.04537365213036537, -0.01409276481717825, -0.043353721499443054, 0.008393003605306149, 0.022237952798604965, 0.023434950038790703, -0.07410157471895218, -0.031121911481022835, 0.013980546034872532, -0.017777269706130028, 0.06411413103342056, 0.027306485921144485, -0.009819112718105316, -0.05528628081083298, 0.015055973082780838, -0.0059569282457232475, -0.06841583549976349, 0.0478050522506237, -0.021040955558419228, -0.030841365456581116, -0.036751534789800644, -0.019638225436210632, 0.012661979533731937, 0.015364573337137699, 0.019974881783127785, -0.039014607667922974, -0.0662836879491806, -0.07432600855827332, 0.024220477789640427, -0.019713038578629494, 0.00016292129294015467, 0.0001696427061688155, -0.053041912615299225, 0.06703180819749832, -0.015186894685029984, 0.03233760967850685, 0.016795359551906586, -0.007013652008026838, 0.01648675836622715, -0.04903945326805115, 0.04559808969497681, 0.059737611562013626, 0.03577897697687149, -0.07514894008636475, -0.016056587919592857, 0.0372939258813858, 0.04032382369041443, -0.02192000113427639, -0.042717818170785904, 0.004673430230468512, -0.033459797501564026, -0.011633310467004776, 0.02156464196741581, -0.01694498397409916, 0.02498730458319187, -0.07668259739875793, -0.02998102456331253, 0.029214197769761086, 0.02203221805393696, -0.0256419125944376, 0.05008682608604431, 0.025922458618879318, -0.03454457223415375, -0.015383277088403702, 0.01593501679599285, -0.03132764622569084, 0.04638361930847168, 0.017917543649673462, 0.047430992126464844, 0.06362785398960114, 0.008715631440281868, 0.03115931712090969, -0.0355171337723732, -0.0027680546045303345, -0.01838511973619461, 0.0589146763086319, -0.012914471328258514, -0.016720546409487724, 0.0713709220290184, -0.020947441458702087, -0.022761639207601547, -0.00797685980796814, 0.016159454360604286, 0.034469760954380035, 0.062281228601932526, -0.056109216064214706, 0.027250375598669052, -0.02319180965423584, -0.08184464275836945, -0.09972477704286575, -0.012708737514913082, -0.04503699764609337, 0.08176983147859573, 0.027699248865246773, 0.012671330943703651, 0.033123139292001724, 0.03469419851899147, 0.014261092059314251 ]
717,363
pytorch_optimizer.optimizer.padam
__str__
null
def __str__(self) -> str: return 'PAdam'
(self) -> str
[ 0.012038499116897583, -0.027268558740615845, 0.021253693848848343, -0.014028840698301792, 0.002051717834547162, -0.07407227903604507, 0.03622948005795479, -0.005699216388165951, 0.09490510821342468, -0.06439238041639328, -0.05769360810518265, -0.011468577198684216, -0.013581670820713043, 0.04152536764740944, 0.01038134191185236, 0.003936843480914831, 0.01765880361199379, -0.051801495254039764, -0.005313423462212086, 0.028811730444431305, 0.014791659079492092, 0.03295023739337921, 0.05597507208585739, -0.015291436575353146, -0.03379197046160698, 0.06162168085575104, -0.012503203935921192, -0.02376134879887104, -0.016711857169866562, 0.013853480108082294, 0.01616823859512806, -0.06435730308294296, -0.0036233863793313503, 0.012143715284764767, -0.02914491668343544, 0.03819351643323898, -0.05373045802116394, 0.027145806699991226, -0.044892288744449615, -0.017772788181900978, 0.010574238374829292, 0.017430834472179413, -0.012327843345701694, -0.030091863125562668, -0.024059461429715157, -0.029635924845933914, 0.03594890236854553, 0.0475577674806118, 0.007452821359038353, 0.011933282017707825, -0.00024934072280302644, 0.02770696021616459, -0.038579311221838, -0.013292326591908932, -0.034230370074510574, 0.02372627705335617, 0.06284920871257782, -0.00016577048518229276, -0.006790835410356522, 0.03323081508278847, -0.032704733312129974, -0.03379197046160698, 0.0674787238240242, -0.05530870333313942, -0.030565336346626282, -0.0017294930294156075, 0.0059841773472726345, 0.028110289946198463, 0.022568896412849426, 0.04240217059850693, 0.045769091695547104, -0.05937706679105759, -0.020271673798561096, 0.050363536924123764, 0.03370428830385208, -0.0026632877998054028, -0.09237991273403168, -0.00031784092425368726, 0.023322947323322296, -0.025094088166952133, 0.03007432632148266, -0.016518959775567055, -0.04752269759774208, -0.000274685793556273, -0.02991650253534317, -0.08957414329051971, -0.03815844655036926, -0.06695263832807541, -0.022726722061634064, 0.016448816284537315, -0.0054931677877902985, 0.02151673473417759, -0.008338391780853271, 0.06491845846176147, -0.02826811373233795, -0.027882320806384087, 0.01827256567776203, -0.03689584881067276, 0.013599207624793053, 0.057868968695402145, -0.00014974143414292485, 0.030389975756406784, -0.02679508551955223, 0.020183993503451347, -0.03622948005795479, -0.01378333568572998, -0.02840840257704258, 0.021762238815426826, 0.008737336844205856, 0.007185396738350391, -0.05530870333313942, 0.021990207955241203, 0.002164606237784028, 0.0004107271961402148, 0.02607610635459423, -0.055729568004608154, 0.0029263284523040056, -0.003097304841503501, 0.03994712233543396, -0.029670998454093933, 0.019289655610919, 0.02462061494588852, -0.0443311370909214, -0.030547799542546272, 0.03444080427289009, 0.06846074014902115, -0.04703168943524361, -0.04969716817140579, 0.03579108044505119, -0.041735801845788956, 0.03808830305933952, 0.014765354804694653, -0.0595875009894371, -0.02758420817553997, 0.0857863575220108, -0.006264754105359316, 0.03745700418949127, 0.032389085739851, 0.04524300992488861, 0.13341426849365234, 0.0015946845524013042, 0.007869302295148373, 0.051064979285001755, 0.04748762398958206, 0.007198548875749111, -0.014484778046607971, -0.0015431724023073912, 0.06491845846176147, -0.009890332818031311, 0.014993323013186455, 0.04443635046482086, 0.02237600088119507, 0.04078885540366173, 0.005032846704125404, 0.008987225592136383, 0.027040589600801468, -0.010837279260158539, -0.049521807581186295, 0.013599207624793053, -0.045593731105327606, -0.0069837323389947414, -0.06467295438051224, 0.0015574204735457897, 0.014870570972561836, 0.0010105149121955037, 0.033476319164037704, 0.007338837254792452, 0.02616378664970398, 0.018851254135370255, 0.006817139685153961, -0.011933282017707825, -0.06158661097288132, -0.08171799778938293, 0.038789745420217514, 0.014905642718076706, 0.04359462112188339, 0.013599207624793053, 0.07947338372468948, 0.028899410739541054, -0.030284758657217026, 0.00804904755204916, -0.011021408252418041, -0.03354646638035774, 0.013537830673158169, 0.07947338372468948, -0.04201637580990791, 0.016334831714630127, 0.05288872867822647, 0.029337812215089798, 0.0005008734297007322, -0.021341374143958092, 0.011424737051129341, -0.028233041986823082, 0.028653906658291817, -0.014870570972561836, -0.047242119908332825, -0.0008252903935499489, -0.06365586072206497, 0.004329212475568056, 0.017237937077879906, -0.011792994104325771, 0.048680078238248825, -0.032669663429260254, 0.02372627705335617, 0.0599382221698761, 0.016378670930862427, 0.011468577198684216, -0.00439278082922101, 0.012161251157522202, -0.05008295923471451, 0.027812175452709198, 0.01077590323984623, -0.006650547031313181, 0.012547044083476067, 0.041770871728658676, -0.058710698038339615, 0.02384902909398079, -0.029688533395528793, -0.0021437820978462696, 0.028688978403806686, 0.05821968987584114, -0.013686887919902802, 0.001403980073519051, -0.031740251928567886, -0.02448032610118389, 0.007347605191171169, 0.00848744809627533, -0.023428164422512054, -0.013327398337423801, -0.0023344866931438446, 0.017939379438757896, -0.07386184483766556, -0.03366921842098236, 0.019745593890547752, 0.0009299587109126151, 0.013739495538175106, -0.05274844169616699, -0.03386211395263672, -0.0954662561416626, -0.04061349481344223, -0.01145980879664421, 0.00996047630906105, 0.007895606569945812, 0.025041479617357254, 0.036510057747364044, -0.041841015219688416, -0.01041641365736723, 0.0013316438999027014, -0.00013837039296049625, -0.021183548495173454, 0.042612604796886444, -0.03654513135552406, -0.017334386706352234, 0.0010932631557807326, -0.004438812844455242, -0.05292380228638649, -0.031056346371769905, 0.029337812215089798, 0.006970580201596022, 0.01846546120941639, -0.07652732729911804, -0.01231030747294426, -0.030916057527065277, 0.04296332225203514, 0.0169573612511158, 0.02286701090633869, -0.03138953074812889, 0.02139398269355297, 0.042682748287916183, -0.01827256567776203, 0.10423428565263748, 0.012468132190406322, -0.054852765053510666, 0.020341819152235985, -0.03226633369922638, -0.027075661346316338, -0.022779330611228943, 0.04317375645041466, -0.09392308443784714, -0.05586985871195793, -0.012038499116897583, -0.042577531188726425, 0.011047711595892906, 0.017500977963209152, 0.00747474143281579, -0.04135000705718994, 0.03998219594359398, -0.002067062072455883, 0.01689598523080349, 0.02156934142112732, 0.052608150988817215, 0.0034348738845437765, -0.022691650316119194, -0.0007704902091063559, 0.019412407651543617, 0.009294106625020504, 0.04401548579335213, 0.025006407871842384, -0.03067055344581604, -0.028215505182743073, -0.014195432886481285, -0.024743366986513138, 0.006080625578761101, -0.023498307913541794, -0.0324767641723156, 0.0009535227436572313, -0.028969556093215942, -0.004103435669094324, -0.0034019937738776207, -0.005159982945770025, -0.026637261733412743, 0.024059461429715157, 0.003943419549614191, 0.10234039276838303, 0.020517179742455482, 0.06484831869602203, -0.011074015870690346, -0.0011814914178103209, 0.03829873353242874, 0.045593731105327606, -0.04682125523686409, -0.0066417790949344635, -0.03559818118810654, -0.0031433370895683765, -0.004044251516461372, -0.008215639740228653, -0.04706675931811333, 0.07112622261047363, 0.013143270276486874, 0.04780327528715134, -0.043314043432474136, -0.04142015054821968, 0.03538775071501732, -0.011424737051129341, -0.04015755653381348, -0.0032047133427113295, 0.029355349019169807, -0.010451486334204674, -0.027408847585320473, -0.030372438952326775, 0.10058678686618805, -0.024006852880120277, -0.043208830058574677, 0.028566226363182068, 0.015975341200828552, 0.03787786886096001, -0.038614384829998016, 0.0060236332938075066, 0.021130941808223724, -0.00878556165844202, 0.0020988460164517164, -0.014984555542469025, 0.010995103977620602, 0.011328288353979588, 0.01500209141522646, 0.007176628801971674, -0.012932837009429932, 0.08262986689805984, -0.034949347376823425, 0.017080113291740417, -0.004611981101334095, -0.08171799778938293, 0.015510636381804943, 0.01755358651280403, -0.03303791955113411, 0.0018062131712213159, -0.0005863616825081408, -0.003947803284972906, 0.053309593349695206, -0.048680078238248825, -0.015887662768363953, 0.00024057269911281765, -0.03903524950146675, -0.03547542914748192, -0.029618389904499054, 0.07940323650836945, 0.03896510601043701, 0.03924567997455597, -0.06355065107345581, -0.013792104087769985, 0.043489404022693634, -0.010232285596430302, 0.038719598203897476, 0.051766421645879745, 0.00009494127152720466, 0.0039039633702486753, 0.031231706961989403, 0.011985890567302704, 0.0034348738845437765, -0.012029730714857578, -0.02148166112601757, -0.02770696021616459, -0.0073344530537724495, -0.005817584693431854, -0.03903524950146675, -0.06077995151281357, -0.0324767641723156, -0.03214358165860176, -0.07316040247678757, 0.02925013191998005, 0.03921061009168625, -0.035826150327920914, -0.011608865112066269, -0.004739117808640003, -0.0475577674806118, 0.04447142407298088, 0.013678119517862797, -0.004063979722559452, -0.02923259697854519, 0.030425047501921654, 0.01613316684961319, -0.0015705724945291877, -0.04440128058195114, -0.06916218250989914, 0.09518568217754364, 0.0006044457550160587, -0.034072548151016235, -0.0013086277758702636, 0.03161749988794327, -0.02067500352859497, -0.04152536764740944, 0.04896065220236778, 0.02772449515759945, 0.06590047478675842, 0.003928075544536114, 0.024287430569529533, 0.011994658969342709, 0.04762791469693184, 0.0784212201833725, -0.004184539895504713, -0.028952019289135933, 0.006773299537599087, -0.015685997903347015, -0.016554031521081924, 0.037842798978090286, -0.020271673798561096, 0.012836389243602753, -0.028829267248511314, -0.03551050275564194, 0.019026614725589752, 0.03998219594359398, -0.05201192572712898, 0.0033340416848659515, 0.027794640511274338, 0.035633254796266556, -0.04394534230232239, -0.06597062200307846, 0.0020045898854732513, 0.05166120454668999, 0.00516436668112874, 0.004638285376131535, 0.03738686069846153, 0.010583006776869297, -0.04994267225265503, 0.024340039119124413, -0.023480771109461784, 0.017378225922584534, -0.05699216574430466, 0.008114807307720184, 0.01685214415192604, -0.05457219108939171, 0.06772422790527344, -0.02293715439736843, 0.03223126009106636, 0.02462061494588852, 0.02381395734846592, -0.0060236332938075066, 0.045593731105327606, -0.03998219594359398, 0.0058395047672092915, 0.03398486599326134, -0.018097205087542534, -0.03070562519133091, -0.02996911108493805, -0.019570233300328255, 0.04464678466320038, -0.05281858518719673, -0.015440492890775204, 0.003316505579277873, -0.008184951730072498, -0.04124478995800018, -0.02305990643799305, 0.013502758927643299, 0.0739319920539856, -0.0070626442320644855, 0.0064751869067549706, 0.0032770493999123573, 0.03375689685344696, -0.02609364315867424, -0.00023838068591430783, 0.033318497240543365, 0.00516436668112874, -0.04892558231949806, -0.023621059954166412, -0.045698948204517365, 0.0353526771068573, -0.014598761685192585, -0.026426827535033226, -0.07603631913661957, 0.011722849681973457, 0.004410316701978445, -0.004028907511383295, 0.010583006776869297, -0.028688978403806686, 0.05892112851142883, -0.027023054659366608, 0.01997356116771698, 0.012871460989117622, -0.015589549206197262, -0.02239353582262993, 0.0010373670374974608, -0.03710628300905228, 0.00842607207596302, 0.00016494847659487277, 0.015905197709798813, 0.01077590323984623, 0.005843888968229294, 0.013353702612221241, -0.014695210382342339, 0.02833825722336769, 0.005041614640504122, -0.030512727797031403, -0.056395940482616425, -0.03084591217339039, -0.028776658698916435, 0.030442584306001663, -0.038894958794116974, 0.027005517855286598, -0.03426544368267059, 0.08782054483890533, 0.0034151459112763405, 0.04355955123901367, 0.013292326591908932, 0.05443190038204193, -0.0071678608655929565, 0.08115684241056442, -0.11489620059728622, 0.008408536203205585, 0.020376890897750854, 0.044962432235479355, 0.028022609651088715, -0.030968666076660156, 0.005120526999235153, -0.035756006836891174, 0.0177201796323061, -0.04219173640012741, -0.028618834912776947, 0.01601041480898857, 0.015186219476163387, 0.004585677292197943, 0.01689598523080349, -0.05846519395709038, -0.03619441017508507, -0.03763236477971077, 0.006177073810249567, 0.04590938240289688, -0.007457205560058355, 0.01687844842672348, 0.042577531188726425, 0.03591383248567581, -0.03745700418949127, -0.0032244413159787655, 0.07547516375780106, 0.023568451404571533, 0.03763236477971077, 0.03710628300905228, -0.04440128058195114, 0.031108953058719635, -0.010907423682510853, -0.05846519395709038, 0.013704423792660236, -0.07109115272760391, 0.03924567997455597, 0.064778171479702, -0.07687804847955704, 0.051100052893161774, 0.03459862619638443, 0.043384190648794174, -0.032669663429260254, 0.0459444522857666, -0.050363536924123764, 0.05776375159621239, -0.015072235837578773, -0.03808830305933952, -0.05050382763147354, -0.0033581536263227463, -0.023621059954166412, -0.023287875577807426, 0.017176561057567596, -0.04503257945179939, -0.05758839100599289, -0.0003452409873716533, -0.026444364339113235, -0.019657913595438004, 0.06344543397426605, -0.0662161260843277, -0.00925026647746563, -0.02069254033267498, 0.026444364339113235, -0.0022018703166395426, 0.028127824887633324, 0.03745700418949127, 0.022639041766524315, 0.04159551113843918, 0.08894284814596176, 0.04927630349993706, -0.0007310340879485011, 0.02772449515759945, -0.025111624971032143, 0.02376134879887104, -0.0432438999414444, 0.0015815325314179063, -0.014703978784382343, -0.009460699744522572, -0.020429499447345734, -0.022463681176304817, 0.020271673798561096, -0.028618834912776947, -0.02672494202852249, 0.004184539895504713, 0.007014420349150896, 0.06982855498790741, -0.02004370652139187, 0.05429161339998245, -0.04292825236916542, -0.01601041480898857, 0.009083674289286137, -0.029337812215089798, 0.042542457580566406, -0.08894284814596176, -0.0035773543640971184, -0.004804878029972315, -0.020289210602641106, -0.07224852591753006, -0.027251021936535835, -0.0018949895165860653, 0.020306747406721115, 0.013572903349995613, -0.03079330548644066, 0.021779775619506836, -0.04219173640012741, -0.005449327640235424, -0.05730781331658363, 0.020411962643265724, -0.051906708627939224, 0.0352649986743927, -0.08732952922582626, -0.055028125643730164, 0.0016768848290666938, -0.05979793146252632, -0.03358153626322746, -0.0005099154659546912, -0.006729459390044212, 0.026339147239923477, -0.006733843591064215, -0.007448437623679638, -0.010118301026523113, 0.011977122165262699, -0.044892288744449615, -0.033318497240543365, 0.003077576868236065, -0.06733843684196472, 0.0008828305290080607, -0.04517286643385887, 0.07407227903604507, 0.030565336346626282, -0.03665034472942352, -0.010960031300783157, -0.014256808906793594, -0.029706070199608803, -0.012608420103788376, 0.041034359484910965, -0.0053265755996108055, -0.06888160854578018, -0.012362916022539139, -0.006049937568604946, 0.024357574060559273, -0.0010647671297192574, 0.03928075358271599, -0.050188176333904266, 0.03386211395263672, -0.032389085739851, 0.0037329867482185364, -0.06414687633514404, 0.031144026666879654, 0.07603631913661957, -0.05271336808800697, 0.002753159962594509, 0.032546911388635635, -0.06919725239276886, -0.052573081105947495, -0.05117019638419151, -0.014905642718076706, 0.03991205245256424, 0.07989424467086792, 0.03843902423977852, 0.005681680515408516, -0.02909230813384056, -0.01985080912709236, -0.0034896740689873695, -0.006049937568604946, 0.05145077407360077, -0.004774189554154873, -0.013721959665417671, -0.0072248526848852634, -0.00437962869182229, -0.004274412523955107, 0.027040589600801468, 0.023375555872917175, -0.03973669186234474, 0.04853978753089905, 0.058710698038339615, -0.024340039119124413, -0.024918727576732635, 0.06042923033237457, -0.07687804847955704, -0.00497585441917181, 0.030512727797031403, 0.007360757328569889, 0.03317820653319359, -0.0010357230203226209, 0.004129739943891764, -0.015247596427798271, -0.014931946992874146, 0.04240217059850693, 0.03626455366611481, -0.03893003240227699, -0.04836442694067955, -0.04966209456324577, -0.006519026588648558, 0.010907423682510853, 0.05064411461353302, -0.029618389904499054, 0.024918727576732635, 0.033353567123413086, -0.00023796968162059784, 0.03893003240227699, 0.007799158338457346, 0.07372155785560608, 0.040297843515872955, 0.009574683383107185, 0.03686077892780304, 0.005944720935076475, -0.013853480108082294, 0.014195432886481285, 0.03693092241883278, 0.048083849251270294, 0.0236912053078413, -0.032581981271505356, 0.02544480934739113, 0.05344988405704498, 0.04384012520313263, -0.005883344914764166, 0.03217865154147148, 0.001828133244998753, -0.036334697157144547, -0.004112204071134329, 0.028899410739541054, 0.0034940580371767282, -0.015422956086695194, -0.024936264380812645, -0.015019627287983894, 0.01851806975901127, -0.0006373258656822145, -0.0020911740139126778, 0.052046999335289, 0.002459431067109108, 0.027338702231645584 ]
717,384
pytorch_optimizer.optimizer.padam
reset
null
@torch.no_grad() def step(self, closure: CLOSURE = None) -> LOSS: loss: LOSS = None if closure is not None: with torch.enable_grad(): loss = closure() for group in self.param_groups: if 'step' in group: group['step'] += 1 else: group['step'] = 1 beta1, beta2 = group['betas'] bias_correction1: float = 1.0 - beta1 ** group['step'] bias_correction2_sq: float = math.sqrt(1.0 - beta2 ** group['step']) for p in group['params']: if p.grad is None: continue grad = p.grad if grad.is_sparse: raise NoSparseGradientError(str(self)) state = self.state[p] if len(state) == 0: state['exp_avg'] = torch.zeros_like(p) state['exp_avg_sq'] = torch.zeros_like(p) self.apply_weight_decay( p, grad, lr=group['lr'], weight_decay=group['weight_decay'], weight_decouple=group['weight_decouple'], fixed_decay=group['fixed_decay'], ) exp_avg, exp_avg_sq = state['exp_avg'], state['exp_avg_sq'] exp_avg.mul_(beta1).add_(grad, alpha=1.0 - beta1) exp_avg_sq.mul_(beta2).addcmul_(grad, grad, value=1.0 - beta2) de_nom = exp_avg_sq.sqrt().add_(group['eps']) step_size: float = group['lr'] * bias_correction2_sq / bias_correction1 p.addcdiv_(exp_avg, de_nom ** (group['partial'] * 2), value=-step_size) return loss
(self)
[ -0.014680149033665657, -0.015638582408428192, -0.03518680855631828, 0.05830306187272072, -0.01772625744342804, -0.003923879470676184, -0.027936885133385658, -0.034731317311525345, -0.014129762537777424, 0.01452831830829382, -0.03182755038142204, 0.003456525271758437, 0.012763284146785736, 0.08745459467172623, -0.030062517151236534, 0.036781035363674164, 0.012013619765639305, 0.04399299994111061, 0.022243225947022438, -0.005266634281724691, -0.018694179132580757, -0.05541827529668808, -0.01865622028708458, 0.05564602091908455, -0.06479383260011673, -0.005266634281724691, 0.05314081162214279, -0.003456525271758437, -0.015429814346134663, 0.0026973707135766745, -0.019567206501960754, -0.06046665459871292, 0.01599918119609356, 0.007330585271120071, 0.04611863195896149, -0.05333060026168823, 0.004604746121913195, 0.012307791970670223, -0.06194700300693512, -0.0350729376077652, -0.022869527339935303, -0.016217436641454697, -0.011747915297746658, 0.007496650330722332, 0.0112639544531703, 0.0055228485725820065, -0.037540189921855927, 0.041677579283714294, -0.005470656789839268, -0.006191853433847427, -0.007596289273351431, -0.04444849491119385, 0.05944179370999336, -0.014993300661444664, 0.0286011453717947, 0.08001487702131271, 0.055532149970531464, -0.0696144625544548, 0.025412695482373238, -0.029872728511691093, 0.06077031418681145, -0.07652276754379272, 0.031201248988509178, 0.0006102890474721789, 0.012687369249761105, -0.02159794420003891, -0.06346531212329865, -0.024387836456298828, 0.023723576217889786, 0.0447901152074337, 0.018134301528334618, 0.01772625744342804, 0.006419599987566471, -0.006732751149684191, -0.04926912486553192, -0.01646416261792183, -0.03924828767776489, -0.05500074103474617, 0.02841135673224926, -0.03611677512526512, 0.005779063329100609, -0.0062677692621946335, -0.02966396138072014, 0.011605573818087578, -0.004033008124679327, -0.0384511724114418, -0.012336259707808495, -0.044486451894044876, -0.012355239130556583, -0.007771844044327736, 0.016767824068665504, -0.0006363849388435483, 0.015458283014595509, 0.02767118066549301, 0.0574679933488369, 0.046725958585739136, -0.042284902185201645, -0.036078814417123795, -0.04243673384189606, -0.03476927429437637, 0.030499029904603958, 0.031656742095947266, 0.023856429383158684, 0.038508109748363495, 0.04399299994111061, -0.04885159060359001, -0.005242910701781511, -0.038375258445739746, 0.02611491270363331, -0.053444474935531616, -0.011766893789172173, -0.022888507694005966, -0.04524560645222664, -0.010153691284358501, -0.03909645602107048, -0.005053122062236071, -0.003613100852817297, 0.008478806354105473, -0.02281259186565876, 0.04220898821949959, 0.04194328561425209, -0.01539185643196106, -0.04581497237086296, 0.007757609710097313, 0.0105902049690485, 0.04661208391189575, 0.0511290542781353, 0.024368857964873314, 0.02006065659224987, -0.05526644363999367, -0.0037862828467041254, -0.009133577346801758, -0.01116906013339758, -0.017346680164337158, 0.032377939671278, -0.004742342978715897, -0.002927489345893264, 0.019121203571558, 0.014148741029202938, 0.0073400745168328285, -0.0043105739168822765, 0.010846419259905815, -0.007705417927354574, 0.009764624759554863, 0.033004239201545715, 0.03643941506743431, 0.03913441300392151, 0.04467624053359032, -0.0005506835295818746, 0.0015752455219626427, 0.018134301528334618, 0.028259525075554848, 0.031125333160161972, 0.025678399950265884, -0.0035870049614459276, 0.03233997896313667, -0.016644461080431938, 0.028392376378178596, -0.017802171409130096, -0.026133893057703972, -0.021199388429522514, -0.016264883801341057, -0.027405476197600365, -0.0025146992411464453, 0.023116253316402435, 0.010058796964585781, -0.00743022421374917, 0.05147067457437515, -0.04987644776701927, 0.00972666684538126, -0.0023854055907577276, -0.028069736436009407, 0.05708841606974602, 0.030385157093405724, -0.02006065659224987, 0.13133372366428375, 0.005257144570350647, 0.011282932944595814, -0.022319141775369644, -0.013617333024740219, 0.0029488406144082546, -0.0078003122471272945, -0.019889846444129944, -0.0372365266084671, 0.010723057202994823, 0.03055596724152565, 0.007325840648263693, 0.00834595412015915, 0.03772997856140137, -0.00040419044671580195, -0.0017935024807229638, -0.0031410015653818846, 0.0474851131439209, -0.00886312872171402, -0.008459827862679958, 0.02230016328394413, 0.03254874795675278, 0.020269423723220825, 0.09223726391792297, 0.007937909103929996, -0.014338529668748379, -0.02015555091202259, 0.030195368453860283, 0.00480402447283268, -0.028297482058405876, -0.012725327163934708, -0.018248176202178, 0.06517340987920761, -0.009992370381951332, -0.0034043332561850548, -0.05708841606974602, 0.01077999360859394, 0.03569923713803291, 0.0620608776807785, 0.04460032656788826, -0.07557382434606552, -0.008673340082168579, 0.010058796964585781, 0.06198496371507645, 0.0018789073219522834, -0.042246945202350616, -0.07542199641466141, 0.026646321639418602, -0.008901085704565048, 0.05200207978487015, -0.020516149699687958, 0.030536988750100136, -0.05705045908689499, -0.01973801665008068, -0.009366068057715893, -0.0035395578015595675, -0.035016000270843506, 0.00944672804325819, -0.011690978892147541, 0.03503497689962387, 0.01945333369076252, -0.05826510488986969, -0.0328524112701416, 0.0005340770003385842, -0.0017365658422932029, -0.03065086156129837, -0.0435754656791687, -0.02844931371510029, 0.049382999539375305, -0.01529696211218834, 0.041677579283714294, 0.0613776370882988, 0.0146706597879529, -0.01159608457237482, 0.05025602504611015, -0.02233812026679516, -0.029569067060947418, -0.028354419395327568, 0.03357360512018204, -0.0372365266084671, -0.01366478018462658, 0.06190904602408409, 0.02687406726181507, 0.05052173137664795, -0.04444849491119385, 0.02476741373538971, -0.04668799787759781, -0.051053136587142944, 0.044941943138837814, -0.04091842472553253, 0.02034533955156803, 0.03611677512526512, -0.03366849943995476, 0.06156742572784424, 0.049762576818466187, 0.07625706493854523, 0.0793316438794136, -0.04630842059850693, -0.03074575588107109, -0.001679629203863442, 0.030062517151236534, 0.011795362457633018, 0.01926354505121708, -0.0041492534801363945, -0.04725736379623413, 0.07682643085718155, -0.0496487021446228, -0.08487346768379211, -0.010960293002426624, -0.05659496411681175, 0.02822156809270382, -0.013977931812405586, -0.006244045682251453, 0.05849285051226616, 0.0025597738567739725, 0.031751636415719986, 0.0027804032433778048, 0.09572938084602356, 0.01516411080956459, 0.07766149938106537, 0.006381642073392868, -0.026513470336794853, 0.0078003122471272945, -0.02611491270363331, 0.023761535063385963, 0.06969037652015686, -0.02099062129855156, -0.021806711331009865, 0.0008955650264397264, -0.01577143371105194, -0.015097684226930141, 0.015799902379512787, 0.0008356629987247288, 0.007036413066089153, -0.018362049013376236, 0.0010865398216992617, -0.016207948327064514, -0.009195258840918541, 0.01819123886525631, -0.006913050543516874, -0.09140219539403915, -0.0068086665123701096, -0.05826510488986969, 0.017707277089357376, 0.06953854858875275, -0.017432084307074547, 0.016388246789574623, 0.019140182062983513, 0.04740919545292854, -0.0328524112701416, -0.01977597363293171, 0.06889326870441437, 0.029986601322889328, -0.03032822161912918, -0.023438893258571625, -0.06915897130966187, -0.0031196502968668938, 0.059555668383836746, 0.025109034031629562, -0.04251265153288841, -0.015221047215163708, 0.04418278858065605, -0.004858588799834251, 0.02402723953127861, -0.05659496411681175, 0.06627418845891953, 0.022831570357084274, -0.020212488248944283, 0.009627027437090874, 0.017327699810266495, -0.022262204438447952, 0.015562666580080986, 0.01968107931315899, 0.04422074928879738, 0.021541008725762367, -0.003416195046156645, -0.02920846827328205, -0.01632182113826275, 0.046763915568590164, 0.018817542120814323, 0.03452254831790924, -0.003352141473442316, -0.02416009083390236, 0.02140815556049347, -0.09033938497304916, 0.017935024574398994, 0.01749850995838642, -0.04315793141722679, 0.1022581085562706, 0.11159570515155792, 0.01327571365982294, -0.04175349697470665, -0.02770913764834404, 0.034541528671979904, -0.013911505229771137, 0.0121749397367239, -0.034693360328674316, 0.0006761219701729715, 0.028866847977042198, -0.042095113545656204, -0.024198047816753387, -0.04008335620164871, -0.01014420110732317, 0.07272699475288391, 0.04293018579483032, 0.03484518826007843, -0.054127711802721024, -0.035433534532785416, 0.03106839582324028, 0.03810955584049225, -0.025222906842827797, 0.005731616169214249, -0.05291306599974632, 0.03232100233435631, -0.06187108904123306, 0.06551503390073776, 0.011102634482085705, 0.0038811771664768457, 0.00874451082199812, -0.055873770266771317, 0.03139103576540947, 0.0396658219397068, 0.020402276888489723, -0.03717958927154541, -0.019624143838882446, -0.03353564813733101, -0.004184838850051165, 0.002533677965402603, 0.018997840583324432, -0.01425312552601099, -0.07037361711263657, -0.01040041632950306, 0.05481095239520073, 0.019605163484811783, 0.058378979563713074, -0.013797632418572903, 0.005019908770918846, -0.043309763073921204, 0.0035395578015595675, 0.016502119600772858, -0.037995681166648865, -0.021142451092600822, -0.021180409938097, -0.007031668443232775, 0.0047304811887443066, 0.05052173137664795, 0.011159570887684822, 0.03755916655063629, 0.023780513554811478, -0.03478825464844704, -0.05215391144156456, -0.02374255657196045, -0.024425795301795006, -0.04069067910313606, -0.002099536592140794, -0.04008335620164871, -0.04524560645222664, -0.03144797310233116, -0.0185138788074255, -0.03315607085824013, 0.016065606847405434, -0.014556786976754665, 0.04008335620164871, 0.049610745161771774, 0.02271769754588604, -0.01656854711472988, 0.01698608137667179, -0.01852336898446083, -0.01903579756617546, -0.011064676567912102, -0.033611562103033066, 0.05750595033168793, -0.04630842059850693, -0.1022581085562706, 0.026760194450616837, -0.002858690917491913, 0.004687778651714325, 0.049003422260284424, 0.0012300674570724368, 0.030859628692269325, 0.00601629912853241, -0.06559094786643982, -0.03881177306175232, -0.006120682694017887, 0.01390201598405838, 0.01632182113826275, 0.01609407551586628, -0.026570405811071396, 0.014272104017436504, -0.016682419925928116, -0.018020428717136383, 0.06604643911123276, 0.05758186802268028, 0.0006879837601445615, 0.003397216321900487, -0.005712637212127447, -0.030290262773633003, 0.033421773463487625, -0.01795400306582451, -0.010315011255443096, -0.0187511146068573, -0.04752307012677193, -0.010827440768480301, 0.03661022335290909, -0.04311997443437576, -0.013892526738345623, -0.04907933622598648, 0.022755654528737068, 0.03437071666121483, -0.010960293002426624, 0.03494008257985115, 0.007278393488377333, 0.008336464874446392, 0.04323384538292885, 0.06726108491420746, -0.04315793141722679, -0.05420362949371338, 0.04182941094040871, 0.0389825813472271, -0.046574126929044724, -0.04646025225520134, 0.031428996473550797, 0.019197119399905205, 0.08153318613767624, -0.020971642807126045, 0.013930484652519226, 0.050407856702804565, -0.050635602325201035, -0.020041678100824356, -0.0020734407007694244, -0.028012799099087715, -0.057961441576480865, 0.00021588454546872526, -0.05583580955862999, 0.016056116670370102, 0.004248892422765493, -0.018219707533717155, -0.0017994333757087588, 0.0021434251684695482, -0.016540078446269035, -0.051242925226688385, 0.052040036767721176, 0.06953854858875275, 0.05014215409755707, -0.04930708184838295, 0.032776493579149246, -0.0004973054747097194, -0.011728936806321144, -0.004346159286797047, -0.008217846974730492, 0.03205529600381851, -0.0006956938887014985, -0.019719038158655167, 0.0025716356467455626, -0.005072100553661585, -0.019662100821733475, 0.027823010459542274, 0.052837152034044266, 0.0728408694267273, -0.008208357729017735, -0.0447901152074337, -0.02207241579890251, -0.06764066219329834, -0.1222238689661026, -0.04179145395755768, 0.000049115216825157404, -0.01647365279495716, 0.017251785844564438, -0.002963074715808034, -0.036363497376441956, 0.0450558178126812, 0.01623641699552536, 0.015714498236775398, -0.04444849491119385, -0.003091182094067335, -0.045739054679870605, 0.03135307878255844, -0.02505209669470787, 0.020630022510886192, 0.020516149699687958, 0.01949129067361355, -0.026608364656567574, 0.020933683961629868, 0.011444253847002983, 0.01131140161305666, -0.04281631112098694, -0.055721938610076904, 0.01693863421678543, -0.03228304535150528, 0.010893866419792175, 0.026931004598736763, 0.04338567703962326, -0.020459212362766266, -0.04160166531801224, 0.02655142731964588, -0.019662100821733475, 0.013958952389657497, -0.0035253234673291445, -0.00783826969563961, -0.029569067060947418, 0.0011772825382649899, 0.027177730575203896, -0.041222088038921356, -0.011643531732261181, -0.03467437997460365, 0.0343327596783638, -0.03717958927154541, -0.003008149564266205, -0.012184428982436657, -0.004315318539738655, 0.053862009197473526, -0.11379725486040115, 0.03456050530076027, -0.005707892589271069, 0.032719556242227554, -0.03232100233435631, 0.019434355199337006, -0.09732360392808914, -0.07819291204214096, 0.006775453686714172, -0.0038337300065904856, -0.04786469042301178, 0.007805056869983673, 0.013826101087033749, 0.028866847977042198, -0.0526094026863575, -0.007890461944043636, 0.0562533475458622, 0.030821671709418297, -0.014471381902694702, 0.012810731306672096, -0.030385157093405724, 0.042360819876194, 0.010865398682653904, -0.02351480908691883, -0.05249553173780441, -0.02626674436032772, 0.009413515217602253, -0.0044481707736849785, -0.07731988281011581, -0.021047556772828102, -0.024046218022704124, -0.013142861425876617, 0.05420362949371338, 0.00579804228618741, -0.04467624053359032, -0.003679526736959815, -0.036135751754045486, -0.0058217658661305904, 0.024330900982022285, -0.02178773283958435, 0.049990322440862656, -0.065287284553051, -0.01987086795270443, -0.031125333160161972, -0.05071152001619339, 0.04380321130156517, 0.03334585949778557, -0.04668799787759781, 0.06486974656581879, 0.014509339816868305, 0.0396658219397068, 0.03590800613164902, -0.023628681898117065, -0.059973202645778656, -0.017090464010834694, 0.05830306187272072, -0.006263024173676968, -0.016065606847405434, -0.016160501167178154, -0.01931099221110344, -0.024995161220431328, 0.03936215862631798, 0.04296814277768135, -0.002792265033349395, -0.016312330961227417, 0.05872059613466263, -0.03141001611948013, 0.03232100233435631, 0.029891707003116608, -0.0024091291707009077, 0.04315793141722679, 0.02271769754588604, 0.026760194450616837, -0.04832018166780472, -0.010742035694420338, -0.023799492046236992, -0.019529249519109726, -0.002030738163739443, -0.028164630755782127, -0.0020283658523112535, 0.007937909103929996, -0.03345973417162895, -0.024046218022704124, -0.04334772005677223, -0.0835069939494133, -0.03494008257985115, -0.06976629793643951, -0.00538999680429697, 0.011055187322199345, -0.030992481857538223, 0.026020018383860588, -0.03004353865981102, -0.04460032656788826, 0.021522028371691704, 0.023268084973096848, 0.031334102153778076, -0.02873399667441845, 0.04175349697470665, 0.04570109769701958, 0.0027116048149764538, -0.005665190052241087, 0.03194142505526543, -0.009812071919441223, 0.005612998269498348, -0.044524408876895905, -0.015553177334368229, 0.01894090324640274, 0.03046107292175293, 0.014822490513324738, -0.07329636067152023, -0.025963082909584045, -0.030631883069872856, 0.01856132596731186, -0.055911727249622345, 0.02034533955156803, -0.031220227479934692, -0.013636312447488308, 0.0008670967654325068, 0.04611863195896149, 0.027538327500224113, 0.04152574762701988, -0.03512987121939659, 0.021730797365307808, 0.034029100090265274, 0.013408565893769264, 0.017090464010834694, -0.036135751754045486, 0.024008259177207947, -0.006860858295112848, -0.0023379584308713675, -0.03630656376481056, -0.0340670570731163, -0.0630098208785057, 0.046953704208135605, -0.01871315762400627, -0.033194027841091156, 0.031239205971360207, -0.0005272565176710486, -0.043271806091070175, -0.015192578546702862, 0.04771285876631737, -0.0020805576350539923, 0.016122542321681976, 0.011007740162312984, 0.016682419925928116, -0.0029820536728948355, -0.01073254644870758, 0.004452915396541357, -0.007771844044327736, 0.0019892218988388777, 0.04547335207462311, 0.017147401347756386, -0.02019350789487362, 0.005717381834983826, 0.021484071388840675, 0.03013843297958374, 0.028012799099087715, -0.038242407143116, 0.02467251941561699, 0.03989356756210327, -0.016340799629688263, -0.014072826132178307, 0.03826138377189636, -0.08274783939123154, 0.06999403983354568, 0.06077031418681145, 0.03596494346857071, 0.03970377892255783, 0.07143643498420715, -0.05465912073850632, 0.02271769754588604, -0.0723094642162323, -0.06912101060152054, -0.06460404396057129, -0.01471810694783926, -0.019813930615782738, 0.08601219952106476, 0.03801466152071953, 0.02879093401134014, 0.02463456243276596, 0.0667676329612732, 0.027917904779314995 ]
717,399
pytorch_optimizer.optimizer.pcgrad
PCGrad
Gradient Surgery for Multi-Task Learning. :param optimizer: OPTIMIZER: optimizer instance. :param reduction: str. reduction method.
class PCGrad(BaseOptimizer): r"""Gradient Surgery for Multi-Task Learning. :param optimizer: OPTIMIZER: optimizer instance. :param reduction: str. reduction method. """ def __init__(self, optimizer: OPTIMIZER, reduction: str = 'mean'): self.validate_options(reduction, 'reduction', ['mean', 'sum']) self.optimizer = optimizer self.reduction = reduction @torch.no_grad() def reset(self): self.zero_grad() def zero_grad(self): return self.optimizer.zero_grad(set_to_none=True) def step(self): return self.optimizer.step() def set_grad(self, grads: List[torch.Tensor]): idx: int = 0 for group in self.optimizer.param_groups: for p in group['params']: p.grad = grads[idx] idx += 1 def retrieve_grad(self) -> Tuple[List[torch.Tensor], List[int], List[torch.Tensor]]: r"""Get the gradient of the parameters of the network with specific objective.""" grad, shape, has_grad = [], [], [] for group in self.optimizer.param_groups: for p in group['params']: if p.grad is None: shape.append(p.shape) grad.append(torch.zeros_like(p, device=p.device)) has_grad.append(torch.zeros_like(p, device=p.device)) continue shape.append(p.grad.shape) grad.append(p.grad.clone()) has_grad.append(torch.ones_like(p, device=p.device)) return grad, shape, has_grad def pack_grad(self, objectives: Iterable) -> Tuple[List[torch.Tensor], List[List[int]], List[torch.Tensor]]: r"""Pack the gradient of the parameters of the network for each objective. :param objectives: Iterable[nn.Module]. a list of objectives. :return: torch.Tensor. packed gradients. """ grads, shapes, has_grads = [], [], [] for objective in objectives: self.optimizer.zero_grad(set_to_none=True) objective.backward(retain_graph=True) grad, shape, has_grad = self.retrieve_grad() grads.append(flatten_grad(grad)) has_grads.append(flatten_grad(has_grad)) shapes.append(shape) return grads, shapes, has_grads def project_conflicting(self, grads: List[torch.Tensor], has_grads: List[torch.Tensor]) -> torch.Tensor: r"""Project conflicting. :param grads: a list of the gradient of the parameters. :param has_grads: a list of mask represent whether the parameter has gradient. :return: torch.Tensor. merged gradients. """ shared: torch.Tensor = torch.stack(has_grads).prod(0).bool() pc_grad: List[torch.Tensor] = deepcopy(grads) for i, g_i in enumerate(pc_grad): random.shuffle(grads) for g_j in grads: g_i_g_j: torch.Tensor = torch.dot(g_i, g_j) if g_i_g_j < 0: pc_grad[i] -= g_i_g_j * g_j / (g_j.norm() ** 2) merged_grad: torch.Tensor = torch.zeros_like(grads[0]) shared_pc_gradients: torch.Tensor = torch.stack([g[shared] for g in pc_grad]) if self.reduction == 'mean': merged_grad[shared] = shared_pc_gradients.mean(dim=0) else: merged_grad[shared] = shared_pc_gradients.sum(dim=0) merged_grad[~shared] = torch.stack([g[~shared] for g in pc_grad]).sum(dim=0) return merged_grad def pc_backward(self, objectives: Iterable[nn.Module]): r"""Calculate the gradient of the parameters. :param objectives: Iterable[nn.Module]. a list of objectives. """ grads, shapes, has_grads = self.pack_grad(objectives) pc_grad = self.project_conflicting(grads, has_grads) pc_grad = un_flatten_grad(pc_grad, shapes[0]) self.set_grad(pc_grad)
(optimizer: Type[torch.optim.optimizer.Optimizer], reduction: str = 'mean')
[ -0.04520793259143829, -0.06497655808925629, -0.04820079356431961, 0.058360762894153595, -0.039104074239730835, 0.004622195847332478, -0.05170558765530586, -0.05202062800526619, 0.023411251604557037, -0.05280822142958641, -0.010081211104989052, -0.012266786769032478, 0.0028894878923892975, 0.0367216020822525, -0.020674359053373337, 0.02120598591864109, -0.016441037878394127, 0.04438095912337303, 0.04890962690114975, -0.0242382250726223, -0.03699725866317749, -0.08096472918987274, 0.01952250301837921, 0.050642333924770355, -0.047176919877529144, -0.04355398565530777, 0.030735880136489868, -0.028373098000884056, -0.01212895754724741, 0.006945600267499685, -0.03189758211374283, -0.05005164071917534, -0.004947078879922628, 0.00540486816316843, 0.022466138005256653, -0.017248323187232018, 0.020162422209978104, 0.05162682756781578, -0.07998023927211761, 0.00007706736505497247, -0.001293378067202866, -0.07021406292915344, -0.009844932705163956, -0.0382574088871479, 0.029810456559062004, 0.01211911253631115, -0.03429974615573883, 0.06793003529310226, -0.022111719474196434, -0.011134618893265724, 0.0431995652616024, -0.06615795195102692, -0.017996538430452347, 0.00598571915179491, -0.03351215273141861, 0.050642333924770355, 0.05505286529660225, 0.0032882075756788254, 0.0038419850170612335, -0.03361060097813606, 0.03888748586177826, -0.07442769408226013, 0.023037143051624298, 0.002151117892935872, -0.0007777496939525008, -0.013192210346460342, -0.05556480213999748, -0.02232830785214901, 0.028648754581809044, 0.01861676760017872, -0.00017736262816470116, -0.024376053363084793, 0.01867583766579628, -0.015407320111989975, 0.024887990206480026, -0.05521038547158241, 0.031070608645677567, -0.054462168365716934, -0.011459502391517162, -0.05584045872092247, -0.014560655690729618, -0.011833610013127327, -0.030164875090122223, -0.019975369796156883, 0.03120843693614006, -0.03701694682240486, -0.013507247902452946, -0.02541961707174778, -0.001170931733213365, -0.11018449068069458, 0.018026072531938553, -0.005562387406826019, 0.03085402026772499, 0.01965048722922802, 0.0438690222799778, 0.0021068155765533447, -0.043750882148742676, -0.0208318792283535, -0.050287917256355286, -0.048712730407714844, -0.01346786879003048, 0.031720373779535294, -0.03418160602450371, 0.014570500701665878, 0.08143728971481323, -0.06206245720386505, -0.026404110714793205, -0.01805560663342476, 0.02311590313911438, -0.059542156755924225, -0.030696501955389977, -0.008821059949696064, 0.014826469123363495, -0.006852073594927788, 0.019975369796156883, -0.0003593400469981134, -0.049933500587940216, 0.0005870041204616427, -0.006970212794840336, 0.02382473833858967, 0.04477475583553314, 0.05095737427473068, -0.04965784400701523, 0.014570500701665878, -0.0061481609009206295, 0.0231355931609869, 0.03778485208749771, 0.05458030849695206, 0.03455571457743645, -0.03044053353369236, -0.03170068562030792, 0.016697006300091743, -0.027861161157488823, 0.003689388744533062, 0.039084386080503464, -0.02311590313911438, -0.04631056636571884, -0.00792517140507698, -0.010593147948384285, 0.0099483048543334, 0.003458032850176096, -0.014501586556434631, 0.01523011177778244, 0.028983483090996742, 0.01931575872004032, 0.04658622294664383, 0.017464911565184593, 0.011439812369644642, -0.012040353380143642, -0.025222718715667725, 0.0014398214407265186, 0.021324124187231064, -0.006517345551401377, -0.028727514669299126, -0.0023221736773848534, 0.025714965537190437, -0.04402654245495796, 0.0383952371776104, -0.04591676965355873, -0.04111244156956673, -0.04820079356431961, -0.060684166848659515, -0.025714965537190437, -0.0008817368070594966, 0.01622444950044155, -0.029830146580934525, 0.07907450199127197, -0.013782906346023083, -0.03148409724235535, 0.053359538316726685, -0.029495419934391975, -0.0938812792301178, 0.02811712957918644, 0.032133862376213074, -0.03280331566929817, 0.09482639282941818, 0.009180400520563126, -0.012316010892391205, -0.027605192735791206, -0.0030568516813218594, 0.047216299921274185, -0.01747475564479828, -0.007506761699914932, -0.06202307716012001, -0.002277871361002326, 0.05556480213999748, -0.006453353445976973, -0.031109988689422607, 0.029377279803156853, 0.03386656939983368, 0.007880869321525097, -0.002697511576116085, 0.007683970034122467, 0.005798665806651115, 0.023627839982509613, 0.000265967013547197, 0.02660100907087326, 0.010918030515313148, 0.07068661600351334, 0.028235267847776413, -0.0019025333458557725, -0.010159971192479134, 0.03457540646195412, 0.043396465480327606, -0.036741290241479874, -0.02813681960105896, -0.029554490000009537, 0.07584536075592041, 0.0012509218649938703, 0.02890472300350666, -0.02118629589676857, 0.015476235188543797, 0.04394778236746788, 0.05698247253894806, 0.03880872577428818, -0.011912369169294834, 0.01080973632633686, 0.0327836275100708, 0.01080973632633686, 0.007496916688978672, -0.008550324477255344, -0.05162682756781578, 0.01216833759099245, -0.005267039407044649, 0.017848864197731018, -0.02581341378390789, -0.0040142713114619255, -0.017376307398080826, 0.03170068562030792, -0.0303814634680748, 0.053792715072631836, -0.07293126732110977, 0.007112964056432247, 0.022800864651799202, 0.07486087083816528, 0.010898340493440628, -0.047925133258104324, -0.0065075005404651165, 0.018459249287843704, -0.00510952016338706, -0.028825964778661728, -0.021324124187231064, -0.029534799978137016, 0.032212622463703156, 0.035303931683301926, 0.02047746069729328, 0.0675756186246872, 0.0073000178672373295, 0.02354907989501953, 0.028294337913393974, -0.03922221437096596, -0.007560908794403076, -0.051390551030635834, 0.02742798440158367, -0.05485596880316734, -0.028058059513568878, 0.02729015424847603, 0.01139058731496334, 0.0014533582143485546, -0.04469599574804306, 0.005050450563430786, -0.04552296921610832, -0.03307897597551346, 0.0407974012196064, -0.01861676760017872, 0.013162675313651562, 0.06430710107088089, -0.007811954244971275, -0.028018679469823837, 0.0219345111399889, 0.10538016259670258, 0.04197879508137703, -0.05083923414349556, 0.0044769831001758575, 0.004651730880141258, 0.02658131904900074, -0.03575679659843445, 0.07749931514263153, 0.017602739855647087, -0.03420129790902138, 0.07801125198602676, -0.024494193494319916, -0.039832599461078644, -0.03861182928085327, -0.02037901058793068, 0.031129678711295128, -0.010829426348209381, -0.019916299730539322, 0.013064226135611534, 0.028274647891521454, 0.043357085436582565, -0.022978072986006737, 0.06355889141559601, 0.007536296267062426, 0.0699777826666832, 0.060644786804914474, 0.03081464022397995, 0.029436349868774414, -0.005842967890202999, -0.04193941503763199, 0.054147131741046906, 0.012443995103240013, -0.005148900207132101, -0.023273421451449394, -0.000894043012522161, -0.03896624594926834, 0.04115182161331177, -0.016844680532813072, 0.03087371028959751, -0.007270483300089836, -0.021816371008753777, -0.03813927248120308, 0.03555990010499954, 0.03723353520035744, -0.017789794132113457, -0.06040851026773453, -0.02278117462992668, -0.04382964223623276, 0.029121311381459236, 0.03745012357831001, -0.04579862952232361, 0.033748429268598557, 0.020182112231850624, 0.05662805587053299, 0.003992120269685984, 0.009288694709539413, 0.022584276273846626, 0.04965784400701523, -0.03268517926335335, 0.019286224618554115, -0.05540728196501732, -0.003805066691711545, 0.023765668272972107, 0.019079480320215225, -0.0012355390936136246, 0.008220518939197063, 0.06611856818199158, -0.015348250977694988, 0.024041326716542244, -0.030302703380584717, 0.06966274976730347, 0.008771835826337337, -0.027447672560811043, 0.05666743591427803, -0.003539253491908312, -0.02317497320473194, 0.03361060097813606, 0.050681713968515396, 0.027526432648301125, 0.0010897109750658274, 0.002382473787292838, 0.01796700246632099, -0.033315252512693405, 0.0811222493648529, 0.06411020457744598, 0.015633754432201385, -0.04359336197376251, -0.0012761494144797325, 0.07387638092041016, -0.03626873344182968, -0.009062261320650578, 0.000639920646790415, -0.008279589004814625, 0.08529649674892426, 0.051823727786540985, -0.0042579337023198605, -0.035599276423454285, -0.0005768515402451158, -0.0037361520808190107, -0.0622987374663353, 0.027172015979886055, -0.06371640413999557, 0.021402884274721146, 0.002200342481955886, -0.04638932645320892, -0.012227406725287437, -0.032507967203855515, -0.011410277336835861, 0.03743043541908264, 0.002148656640201807, -0.014412982389330864, -0.016795456409454346, 0.012197871692478657, 0.04808265343308449, 0.029062243178486824, -0.010701442137360573, 0.02616783231496811, -0.057927586138248444, 0.04879148676991463, -0.015840496867895126, 0.03731229528784752, 0.013910890556871891, 0.019364982843399048, 0.005719906184822321, -0.07647544145584106, 0.008894897066056728, 0.039497870951890945, 0.05584045872092247, -0.04698001965880394, -0.0561554990708828, -0.0026335197035223246, -0.08600533753633499, -0.006113703362643719, 0.03615059331059456, -0.006694554351270199, -0.04859459027647972, 0.05083923414349556, 0.06359826773405075, 0.025990623980760574, 0.07541218400001526, -0.024533573538064957, -0.010918030515313148, 0.021304436028003693, 0.04701939970254898, -0.005084908101707697, 0.0002338171616429463, -0.021875441074371338, 0.01732708141207695, 0.044892895966768265, 0.07899574190378189, 0.06052665039896965, 0.004762486554682255, 0.04623180627822876, -0.006409051362425089, -0.049500323832035065, -0.04115182161331177, -0.042569492012262344, 0.020162422209978104, -0.07143483310937881, 0.024001946672797203, 0.00019643717678263783, -0.01848878338932991, -0.008968734182417393, -0.019266534596681595, -0.019118860363960266, -0.014934763312339783, 0.021639162674546242, 0.06418896466493607, 0.034496646374464035, -0.008220518939197063, 0.03884810581803322, -0.021658852696418762, -0.008825982920825481, -0.02429729513823986, -0.012512910179793835, -0.041073061525821686, -0.008604471571743488, -0.027132635936141014, -0.07942891865968704, 0.015348250977694988, 0.02658131904900074, 0.022800864651799202, 0.0471375398337841, 0.022170789539813995, 0.02156040258705616, 0.0203987006098032, -0.0030248556286096573, -0.036820050328969955, -0.008269743993878365, 0.02506520040333271, -0.000515013060066849, 0.03150378540158272, -0.00905733834952116, 0.020319942384958267, -0.04272700846195221, 0.0068422285839915276, 0.0719073936343193, -0.02729015424847603, -0.0539502315223217, 0.020221492275595665, -0.014708329923450947, -0.03473292291164398, -0.025636205449700356, -0.06312570720911026, -0.0747821107506752, -0.0014792012516409159, -0.03463447466492653, 0.03707601875066757, 0.008875207044184208, -0.039419110864400864, -0.010159971192479134, -0.062259357422590256, 0.008983501233160496, 0.05859704315662384, 0.005301496479660273, 0.010543922893702984, 0.013635232113301754, 0.034122537821531296, -0.0030888477340340614, 0.016381967812776566, -0.02043808065354824, -0.07230118662118912, 0.03272455930709839, -0.0034678776282817125, -0.05906959995627403, 0.004907699301838875, -0.016844680532813072, -0.01892196200788021, 0.05351705476641655, -0.00127984129358083, 0.014166858978569508, 0.0005685448995791376, -0.03999011963605881, 0.011036169715225697, 0.07427017390727997, -0.05859704315662384, -0.035599276423454285, 0.044932276010513306, -0.042923908680677414, 0.01622444950044155, -0.04241197183728218, -0.004285007249563932, 0.010465163737535477, 0.025616515427827835, 0.009643112309277058, -0.0423332117497921, 0.011518571525812149, 0.03197634220123291, 0.03363029286265373, -0.06670926511287689, 0.018272195011377335, 0.06155052036046982, -0.042963288724422455, 0.01894165202975273, 0.01522026676684618, 0.056391775608062744, 0.005508239846676588, -0.022151099517941475, 0.008437107317149639, -0.029751388356089592, -0.016293363645672798, 0.04501103237271309, 0.00022474136494565755, 0.037922680377960205, 0.014875694178044796, -0.025301478803157806, 0.0242382250726223, -0.06919018924236298, -0.07127731293439865, -0.05312325805425644, 0.0034949511755257845, 0.045680489391088486, 0.025104578584432602, -0.012906706891953945, 0.005331031046807766, 0.02778240106999874, 0.0034998736809939146, 0.00436376640573144, -0.03120843693614006, -0.0004599429666996002, -0.04390840232372284, 0.03357122093439102, -0.03778485208749771, 0.03366967290639877, 0.043672122061252594, 0.032153550535440445, -0.028215577825903893, 0.0243366751819849, 0.011745004914700985, 0.036327801644802094, -0.017208943143486977, -0.07623916119337082, 0.0014595113461837173, -0.014531121589243412, -0.03384688124060631, 0.022978072986006737, -0.004494212102144957, -0.014166858978569508, -0.05123303085565567, -0.004681265447288752, -0.022052649408578873, -0.04579862952232361, -0.021875441074371338, -0.020654669031500816, 0.009987684898078442, -0.007157266139984131, 0.020201802253723145, -0.019099170342087746, -0.013763216324150562, -0.039104074239730835, 0.018350955098867416, -0.005724828690290451, 0.012670428492128849, -0.013546627946197987, 0.01643119379878044, 0.058793939650058746, -0.051390551030635834, 0.027605192735791206, 0.05580108240246773, -0.03164161369204521, -0.016569022089242935, 0.025577135384082794, 0.020674359053373337, -0.055997978895902634, -0.025340856984257698, 0.06548849493265152, -0.08718672394752502, 0.010691597126424313, 0.04827955365180969, -0.0022175712510943413, -0.04902776703238487, -0.032606419175863266, 0.03845430910587311, -0.01620475947856903, -0.03508734330534935, -0.004075802396982908, -0.03416191786527634, 0.005537774879485369, 0.04690125957131386, -0.05477720871567726, -0.016027551144361496, -0.020123044028878212, 0.01659855805337429, -0.021363504230976105, -0.044105298817157745, -0.06127486377954483, -0.058045726269483566, 0.062180597335100174, 0.05851828306913376, 0.01948312297463417, -0.029908906668424606, 0.017976848408579826, 0.004917543847113848, 0.005670681595802307, -0.0018791515612974763, 0.030145185068249702, 0.01633274368941784, -0.07875946164131165, -0.012571979314088821, 0.021343814209103584, -0.026305660605430603, -0.03849368914961815, 0.03855275735259056, 0.01560421846807003, 0.00907702837139368, -0.054934725165367126, 0.04906714707612991, 0.005710061173886061, -0.04587738960981369, -0.06962336599826813, -0.017021888867020607, 0.013015001080930233, -0.015141506679356098, -0.00962834432721138, -0.043278325349092484, -0.04997288063168526, -0.008648773655295372, -0.015564839355647564, 0.05903021991252899, 0.004774792585521936, -0.04520793259143829, 0.06344074755907059, -0.007250793278217316, -0.029948286712169647, -0.009451135993003845, 0.015338405966758728, 0.025596825405955315, 0.017770104110240936, 0.022485828027129173, -0.00935760885477066, 0.02778240106999874, 0.002345555229112506, 0.03366967290639877, -0.01465910580009222, -0.05209938436746597, 0.013526937924325466, 0.0017437838250771165, 0.01614568941295147, 0.054186511784791946, 0.0017967002931982279, -0.05347767472267151, -0.0034063467755913734, -0.04709815979003906, 0.033374324440956116, 0.03282300755381584, -0.012375080958008766, 0.05544666200876236, -0.03731229528784752, -0.026660079136490822, -0.024179155007004738, 0.0688357725739479, 0.0358552448451519, -0.012355390936136246, 0.05040605738759041, 0.014668949879705906, 0.013536782935261726, 0.023805048316717148, -0.020123044028878212, 0.030932780355215073, 0.00425301119685173, -0.020260872319340706, -0.019709555432200432, 0.06970212608575821, 0.006635484751313925, 0.04276638850569725, -0.040679264813661575, -0.028058059513568878, -0.031070608645677567, -0.015820806846022606, -0.05521038547158241, -0.024789541959762573, -0.030184565111994743, -0.0578882060945034, 0.025714965537190437, 0.008663540706038475, 0.0664336085319519, 0.009288694709539413, -0.00893427710980177, 0.010307644493877888, -0.025577135384082794, 0.012621204368770123, 0.010858961381018162, 0.02888503298163414, -0.006172772962599993, 0.03455571457743645, -0.03313804417848587, 0.013221745379269123, -0.020497150719165802, -0.008693075738847256, -0.0005879271193407476, 0.011016479693353176, 0.05458030849695206, 0.023391561582684517, 0.024769851937890053, 0.0009537278674542904, -0.04280576854944229, 0.05654929578304291, -0.05284760147333145, -0.04890962690114975, -0.00045502049033530056, 0.02120598591864109, 0.04508979246020317, 0.04481413587927818, -0.023706598207354546, 0.00284518557600677, -0.01788824424147606, 0.08852563798427582, 0.01153826154768467, -0.06765437871217728, 0.061471760272979736, -0.025104578584432602, 0.007629822939634323, -0.0358552448451519, 0.006561648100614548, -0.0019345293985679746, 0.029987666755914688, -0.011745004914700985, -0.03303959593176842, 0.0064385863952338696, -0.043002668768167496, 0.10892433673143387, 0.03467385470867157, -0.0030420843977481127, 0.0034678776282817125, 0.06233811751008034, -0.04670436307787895, 0.02226923778653145, -0.06418896466493607, -0.07379762083292007, -0.09655910730361938, -0.01777995005249977, -0.02738860435783863, 0.01944374293088913, 0.021855751052498817, 0.022249549627304077, 0.024356365203857422, -0.008889975026249886, -0.002586756134405732 ]
717,400
pytorch_optimizer.optimizer.pcgrad
__init__
null
def __init__(self, optimizer: OPTIMIZER, reduction: str = 'mean'): self.validate_options(reduction, 'reduction', ['mean', 'sum']) self.optimizer = optimizer self.reduction = reduction
(self, optimizer: Type[torch.optim.optimizer.Optimizer], reduction: str = 'mean')
[ -0.011339518241584301, 0.030424414202570915, 0.035510122776031494, 0.013711652718484402, -0.009052745997905731, -0.015176265500485897, -0.027315480634570122, -0.07148748636245728, -0.028483577072620392, -0.01357687171548605, -0.005624832585453987, 0.06322096288204193, 0.03013688139617443, 0.017773032188415527, -0.016955366358160973, 0.042087405920028687, -0.007718420121818781, 0.018078535795211792, -0.013172531500458717, 0.05337301269173622, -0.013936285860836506, -0.013037750497460365, -0.02249933034181595, 0.04589719697833061, -0.0004905442474409938, 0.07684276252985, 0.012220083735883236, -0.04568154737353325, 0.010279246605932713, -0.027674894779920578, -0.02661462314426899, -0.006217865739017725, -0.04036221653223038, 0.03985903784632683, 0.0156974159181118, -0.026273179799318314, 0.035096798092126846, 0.060022175312042236, -0.06440702825784683, 0.010252290405333042, -0.011977478861808777, -0.005126145202666521, -0.008913472294807434, -0.004288260824978352, -0.008765214122831821, 0.02311033383011818, 0.017153043299913406, -0.01162705011665821, -0.00900781899690628, -0.04003874212503433, -0.03182612732052803, 0.0064200363121926785, 0.008706809021532536, 0.0294360239058733, -0.013145575299859047, 0.06861217319965363, 0.058728281408548355, 0.010036641731858253, 0.01727883890271187, 0.014385554008185863, -0.046580083668231964, -0.010144466534256935, 0.010117510333657265, -0.002956181997433305, -0.010512866079807281, -0.008275512605905533, -0.12205706536769867, 0.05164782330393791, 0.03125106543302536, 0.04215928912162781, 0.03881673514842987, -0.00001618943497305736, 0.0023923509288579226, -0.007057996466755867, 0.018959099426865578, 0.002547348150983453, -0.06419137865304947, -0.047119203954935074, 0.021079644560813904, -0.023972928524017334, 0.008891008794307709, 0.021169496700167656, -0.016560010612010956, -0.004382607061415911, 0.028070250526070595, -0.1008516326546669, -0.055924851447343826, -0.06886376440525055, 0.020073283463716507, -0.0497429259121418, -0.0624302476644516, 0.008244063705205917, 0.0031291500199586153, 0.034485794603824615, -0.0208100825548172, 0.043057821691036224, -0.03421623259782791, -0.06990606337785721, -0.020037341862916946, -0.005422662012279034, 0.00950650591403246, -0.002360902028158307, 0.05603267624974251, -0.009156077168881893, 0.04970698431134224, -0.02598564699292183, 0.017575355246663094, -0.03403652459383011, -0.005952797830104828, 0.01792578399181366, 0.03719937056303024, 0.04054192453622818, -0.048880334943532944, 0.028825020417571068, -0.04187175631523132, 0.06189112737774849, -0.024062782526016235, -0.0614238902926445, -0.007808273658156395, 0.04844903573393822, -0.0029629210475832224, 0.02839372307062149, -0.02320018783211708, 0.07004982978105545, 0.05912363901734352, -0.033856820315122604, 0.014286715537309647, 0.03570780158042908, 0.03409043699502945, 0.0017150797648355365, 0.04176393151283264, -0.05419966205954552, -0.043129704892635345, -0.009946788661181927, -0.012615438550710678, 0.009704183787107468, 0.03590548038482666, 0.03590548038482666, -0.01363976951688528, 0.017799988389015198, 0.03475535288453102, 0.007228718604892492, -0.01274123415350914, -0.01451134867966175, 0.023415835574269295, 0.03421623259782791, -0.05488255247473717, -0.0058449734933674335, 0.009731139987707138, -0.002846111310645938, -0.023361923173069954, -0.005144116003066301, 0.028555460274219513, -0.015203221701085567, 0.060992591083049774, -0.00376037135720253, -0.015850167721509933, -0.026309121400117874, -0.01568843051791191, -0.012651380151510239, -0.0026282165199518204, 0.0032279889564961195, -0.0011636035051196814, -0.025752028450369835, 0.001133277895860374, -0.013019779697060585, 0.014592217281460762, -0.012642394751310349, -0.057003095746040344, 0.025248847901821136, 0.00008823900134302676, -0.16791832447052002, -0.03773849457502365, 0.036193013191223145, -0.02023502066731453, 0.1113465279340744, 0.023505689576268196, 0.06523367762565613, -0.032616838812828064, 0.00015078549040481448, 0.029292259365320206, 0.005867436993867159, -0.04359694570302963, -0.03870891034603119, 0.002801184542477131, -0.024781610816717148, 0.01152821071445942, -0.022750919684767723, 0.043668828904628754, 0.006123519502580166, 0.034359999001026154, -0.017197970300912857, -0.033856820315122604, -0.032616838812828064, 0.025859853252768517, -0.04906003922224045, 0.012822101823985577, -0.014277730137109756, 0.05380430817604065, 0.03184409812092781, -0.027081862092018127, 0.05398401618003845, 0.047766149044036865, 0.034917090088129044, 0.007098430767655373, 0.0255543515086174, -0.020450668409466743, 0.07454250752925873, 0.0023676410783082247, -0.007049011532217264, 0.027549099177122116, -0.012992823496460915, 0.02776474878191948, 0.06358037143945694, 0.015113367699086666, -0.00024934360408224165, 0.04471112787723541, 0.02668650634586811, 0.046580083668231964, 0.04647225886583328, 0.08029313385486603, -0.012902970425784588, -0.003149367170408368, -0.02663259394466877, 0.043057821691036224, -0.02079211175441742, 0.011806757189333439, -0.0624302476644516, -0.0044881850481033325, -0.006208880804479122, -0.014331641606986523, -0.08633129298686981, -0.013280355371534824, 0.010351129807531834, 0.014349612407386303, -0.007601610850542784, -0.016326390206813812, 0.016649862751364708, -0.0324910469353199, -0.07691464573144913, -0.00033217735472135246, -0.006986113730818033, -0.037415020167827606, -0.007040026132017374, -0.02727953903377056, 0.017638253048062325, -0.00837435107678175, 0.06365225464105606, -0.00736349867656827, 0.009982730261981487, -0.005265418440103531, -0.019893577322363853, -0.04223116859793663, -0.006451485212892294, -0.017117101699113846, 0.0626099556684494, -0.0024125678464770317, -0.0066851042211055756, 0.010827353224158287, -0.03412637859582901, 0.008850575424730778, -0.04330941289663315, -0.047766149044036865, 0.06016594171524048, -0.02435031346976757, -0.010611704550683498, 0.027333451434969902, -0.0497429259121418, -0.01973184011876583, -0.03175424784421921, 0.06473050266504288, 0.043129704892635345, 0.016640877351164818, 0.008558550849556923, -0.03709154576063156, 0.014987573027610779, -0.022768890485167503, 0.02442219667136669, -0.01619161106646061, 0.007233211304992437, 0.09488535672426224, -0.013037750497460365, -0.003762617474421859, -0.015850167721509933, -0.05632020905613899, 0.008226092904806137, 0.0046589067205786705, -0.021528910845518112, -0.033820878714323044, 0.008985355496406555, 0.022948598489165306, 0.038529202342033386, 0.03770255297422409, 0.04233899340033531, 0.1076086163520813, 0.014834822155535221, 0.029256317764520645, 0.01451134867966175, -0.01039605587720871, -0.004852091893553734, -0.005521500948816538, -0.05362460017204285, -0.03608518838882446, -0.02656071074306965, -0.012813116423785686, -0.006496411748230457, 0.03511476889252663, -0.010899236425757408, 0.03400058671832085, 0.04683167114853859, 0.025158995762467384, 0.02483552321791649, -0.017620282247662544, 0.035546064376831055, 0.0036166056524962187, -0.007493786513805389, 0.02438625507056713, -0.03013688139617443, 0.013325282372534275, 0.04108104482293129, -0.010890251025557518, 0.013271369971334934, -0.024601902812719345, -0.07342832535505295, -0.04129669442772865, -0.029885292053222656, 0.006366124376654625, -0.008940428495407104, 0.00047032718430273235, -0.000227301410632208, -0.06724639981985092, -0.03827761486172676, 0.021618764847517014, -0.015382928773760796, -0.02485349215567112, 0.0002218259614892304, 0.05024610832333565, 0.012291966006159782, -0.018869247287511826, 0.009874905459582806, 0.04812556505203247, 0.009048253297805786, -0.006060622166842222, 0.06688698381185532, -0.007646537385880947, -0.04686761274933815, -0.023415835574269295, -0.06311313807964325, 0.05570920184254646, -0.06128012388944626, -0.023631485179066658, 0.0009681720403023064, -0.02138514630496502, 0.022858744487166405, 0.09682618826627731, 0.021654706448316574, -0.03019079379737377, 0.00007230402843561023, -0.0035469690337777138, -0.05455907806754112, 0.007403932977467775, -0.002291265642270446, 0.006545831449329853, 0.036696191877126694, 0.036839958280324936, -0.0010069214040413499, 0.002989877015352249, -0.05114464461803436, 0.01668580435216427, -0.03542027249932289, -0.00042989308713003993, -0.08201832324266434, -0.0049149892292916775, -0.011770815588533878, -0.012256024405360222, 0.028124162927269936, 0.002926979446783662, -0.005678744520992041, -0.0017072175396606326, 0.016973337158560753, 0.0006548077799379826, 0.04273435100913048, 0.015562635846436024, 0.02492537535727024, -0.03060412034392357, 0.006617714185267687, -0.06494615226984024, 0.02603955939412117, 0.052402593195438385, 0.027423305436968803, -0.011249665170907974, -0.008607970550656319, -0.002173332730308175, -0.0139183159917593, -0.023361923173069954, 0.052905771881341934, -0.019911548122763634, 0.02082805335521698, -0.09481347352266312, 0.002274418016895652, -0.01570640131831169, -0.06350849568843842, 0.010611704550683498, 0.05596079304814339, 0.008783184923231602, -0.03709154576063156, 0.023685397580266, 0.032149601727724075, 0.05610455945134163, 0.03245510533452034, 0.02559029310941696, -0.04629255086183548, 0.011240679770708084, 0.05596079304814339, -0.0543074868619442, -0.034917090088129044, 0.012525585480034351, -0.029885292053222656, 0.029400082305073738, -0.020684288814663887, 0.03946368023753166, 0.04047004133462906, 0.02019907906651497, 0.008055371232330799, 0.03993092104792595, -0.025823911651968956, 0.01730579510331154, -0.030963534489274025, -0.0012118997983634472, -0.044279832392930984, -0.07152342796325684, 0.09625113010406494, -0.030334560200572014, -0.022175857797265053, 0.0173866618424654, -0.02258918434381485, -0.044890835881233215, 0.019336484372615814, 0.03576171398162842, -0.028519518673419952, 0.03745096176862717, -0.048269327729940414, 0.02028893306851387, -0.025051170960068703, -0.06455079466104507, -0.016901453956961632, -0.012220083735883236, 0.04683167114853859, -0.06293343007564545, -0.05100087821483612, 0.08381539583206177, 0.00810928363353014, -0.027585040777921677, 0.02548246830701828, 0.03522259369492531, -0.01621856726706028, -0.005629325285553932, -0.0039939903654158115, 0.004560067784041166, -0.029274288564920425, -0.024709727615118027, -0.00692321639508009, -0.019785752519965172, -0.028645312413573265, -0.03637271746993065, 0.10142669081687927, 0.044351715594530106, 0.05606861785054207, 0.024745669215917587, 0.008199136704206467, -0.04906003922224045, -0.0037693565245717764, -0.05854857712984085, -0.02314627543091774, -0.008122761733829975, 0.018096506595611572, -0.0156075619161129, -0.02143905870616436, 0.009641285985708237, 0.015913063660264015, 0.03570780158042908, -0.007188284303992987, 0.020091254264116287, 0.0208100825548172, 0.0031538596376776695, 0.0048071653582155704, -0.03320987522602081, -0.05031799152493477, 0.017773032188415527, 0.015751328319311142, -0.03540230169892311, 0.0531214214861393, 0.034521736204624176, 0.03123309463262558, 0.020720230415463448, 0.0566796213388443, 0.0002600137086119503, 0.01845592074096203, 0.03308407962322235, 0.0380619652569294, 0.017548399046063423, 0.022391505539417267, -0.06983418017625809, -0.009704183787107468, 0.039607446640729904, -0.038421381264925, -0.08489363640546799, 0.0028573430608958006, -0.05790163204073906, 0.010755470022559166, 0.0014286715304479003, 0.02893284521996975, -0.011995449662208557, 0.06336472928524017, 0.010629675351083279, -0.016604937613010406, -0.04672384634613991, 0.04011062532663345, -0.012372834607958794, 0.008554058149456978, -0.003075237851589918, 0.04108104482293129, -0.03344349190592766, -0.02208600379526615, 0.009767081588506699, -0.009740125387907028, -0.007767839822918177, -0.03860108554363251, 0.06843246519565582, -0.02266106568276882, -0.012831087224185467, -0.04456736147403717, -0.03993092104792595, 0.07842418551445007, -0.000568604504223913, 0.08913472294807434, 0.017620282247662544, -0.012876014225184917, 0.00260126031935215, -0.02654273994266987, -0.0017218186985701323, 0.05366054177284241, 0.05445125326514244, -0.02032487466931343, -0.01798868179321289, 0.034917090088129044, -0.013478033244609833, 0.05107276141643524, -0.0074353814125061035, -0.011051987297832966, -0.010485909879207611, 0.003564939834177494, -0.06491021066904068, 0.02494334615767002, 0.04108104482293129, -0.006806406658142805, 0.03838543966412544, -0.001141701708547771, 0.04460330307483673, 0.04589719697833061, -0.012121244333684444, -0.03191598132252693, -0.024691756814718246, 0.028196046128869057, 0.006105549167841673, -0.012345878407359123, -0.0028348795603960752, 0.009874905459582806, -0.015454811044037342, -0.01913880743086338, -0.005301359575241804, -0.06437108665704727, -0.02316424623131752, 0.021277321502566338, -0.09222568571567535, 0.01791679859161377, 0.01363976951688528, 0.05401995778083801, -0.028735166415572166, -0.053588658571243286, 0.006141490302979946, 0.01474496815353632, -0.05376836657524109, -0.025194937363266945, -0.04284217581152916, 0.002274418016895652, -0.03770255297422409, -0.031143242493271828, -0.018527802079916, -0.026201296597719193, 0.029076609760522842, -0.03369508311152458, -0.026884183287620544, 0.005274403840303421, -0.05538573116064072, 0.003996236715465784, -0.05506225675344467, -0.04003874212503433, 0.04341723769903183, -0.0007401686743833125, -0.08115573227405548, 0.009749110788106918, -0.02654273994266987, 0.003436898346990347, 0.020558493211865425, 0.03633677586913109, -0.06739016622304916, 0.0566796213388443, -0.013451077044010162, -0.016586966812610626, -0.040182508528232574, 0.0036480543203651905, 0.012040376663208008, -0.009326798841357231, 0.0061639538034796715, -0.02379322052001953, -0.0249613169580698, 0.023020479828119278, 0.020720230415463448, -0.011168796569108963, -0.024709727615118027, 0.04844903573393822, 0.025913765653967857, 0.018105491995811462, -0.04571748897433281, 0.02190629579126835, 0.0063391681760549545, -0.12277589738368988, -0.01477192435413599, -0.058728281408548355, -0.04093727841973305, -0.035635918378829956, 0.03770255297422409, -0.06429920345544815, 0.002774228574708104, -0.018743451684713364, 0.024170605465769768, 0.07130777835845947, 0.02023502066731453, -0.06530556082725525, -0.007057996466755867, 0.05042581632733345, 0.039140209555625916, -0.01804259419441223, -0.008612463250756264, -0.03860108554363251, -0.047838032245635986, 0.041907697916030884, 0.03060412034392357, 0.004802672658115625, -0.01573335751891136, 0.050928995013237, -0.012004435062408447, 0.035042885690927505, 0.0192106906324625, -0.0030729915015399456, -0.009695198386907578, -0.02134920470416546, 0.06570091843605042, -0.010090554133057594, -0.03168236464262009, 0.031592510640621185, 0.04507054388523102, 0.0475504994392395, 0.03709154576063156, -0.004775716457515955, -0.032742634415626526, -0.061028532683849335, -0.009677227586507797, 0.02553638070821762, -0.029759496450424194, 0.02311033383011818, 0.04445954039692879, 0.03642662987112999, 0.017710136249661446, 0.0208999365568161, 0.04266246780753136, -0.06066912040114403, 0.02600361779332161, -0.015931034460663795, -0.019965460523962975, -0.007125386968255043, 0.03457564860582352, -0.059411171823740005, -0.019893577322363853, 0.014915689826011658, -0.09661053866147995, 0.01786288619041443, 0.026309121400117874, -0.014124978333711624, -0.02381119132041931, 0.002038552425801754, 0.026255208998918533, -0.007098430767655373, 0.02609347179532051, -0.027926484122872353, -0.07188284397125244, -0.06404761224985123, 0.04553778097033501, 0.008176673203706741, 0.05272606387734413, 0.000001390799639011675, -0.0438125915825367, 0.0064874268136918545, -0.037307195365428925, 0.03993092104792595, -0.04629255086183548, -0.017063189297914505, 0.04902409762144089, -0.062250543385744095, 0.04808962345123291, 0.03281451761722565, -0.018123462796211243, -0.0011939291143789887, 0.04995857551693916, 0.044243890792131424, 0.032113660126924515, 0.030280647799372673, -0.05721874162554741, -0.04212334752082825, 0.013756578788161278, -0.0029337184969335794, 0.006878289394080639, 0.018779393285512924, 0.03834949806332588, -0.020989790558815002, 0.025230877101421356, -0.04852091893553734, 0.039140209555625916, -0.024476109072566032, 0.02492537535727024, 0.036804016679525375, -0.0014342874055728316, -0.05394807457923889, -0.007682478986680508, -0.024530019611120224, 0.024494078010320663, 0.02142108790576458, 0.02019907906651497, 0.06264589726924896, 0.00535976467654109, -0.0014578739646822214, 0.0008715794538147748, 0.004155727103352547, -0.0147629389539361, 0.012956882826983929, 0.0047802091576159, 0.0048296283930540085, 0.018959099426865578, 0.019264601171016693, -0.02086399495601654, -0.020109225064516068, 0.06066912040114403, 0.08546870201826096, 0.0002840214583557099, -0.0663478672504425, 0.025931736454367638, -0.023631485179066658, 0.011375459842383862, -0.09150686115026474, -0.04672384634613991, -0.06864811480045319, 0.014017154462635517, -0.04151234030723572, 0.04985075071454048, 0.022714978083968163, 0.0681808739900589, -0.007026548031717539 ]
717,407
pytorch_optimizer.optimizer.pcgrad
pack_grad
Pack the gradient of the parameters of the network for each objective. :param objectives: Iterable[nn.Module]. a list of objectives. :return: torch.Tensor. packed gradients.
def pack_grad(self, objectives: Iterable) -> Tuple[List[torch.Tensor], List[List[int]], List[torch.Tensor]]: r"""Pack the gradient of the parameters of the network for each objective. :param objectives: Iterable[nn.Module]. a list of objectives. :return: torch.Tensor. packed gradients. """ grads, shapes, has_grads = [], [], [] for objective in objectives: self.optimizer.zero_grad(set_to_none=True) objective.backward(retain_graph=True) grad, shape, has_grad = self.retrieve_grad() grads.append(flatten_grad(grad)) has_grads.append(flatten_grad(has_grad)) shapes.append(shape) return grads, shapes, has_grads
(self, objectives: Iterable) -> Tuple[List[torch.Tensor], List[List[int]], List[torch.Tensor]]
[ -0.059902336448431015, -0.008478823117911816, -0.05641696974635124, -0.04270530864596367, -0.011509368196129799, -0.014410647563636303, -0.0045769368298351765, -0.02650410123169422, 0.005721170920878649, -0.011624270118772984, -0.04875682294368744, -0.006889342796057463, -0.02150585688650608, 0.0019928347319364548, -0.012284957803785801, -0.00469423271715641, -0.02767227403819561, 0.026063643395900726, 0.007789410185068846, 0.0008737352909520268, -0.0369410514831543, -0.05005904659628868, 0.04822061210870743, 0.047914206981658936, -0.011691296473145485, -0.024359261617064476, 0.053429510444402695, 0.002130477922037244, -0.011241262778639793, 0.0164788868278265, -0.03678784519433975, -0.051667679101228714, 0.00862245075404644, -0.00002597642014734447, -0.00782771036028862, 0.03192365542054176, 0.035523921251297, 0.049446236342191696, -0.014630877412855625, 0.02644665166735649, 0.01630653440952301, -0.03330248221755028, 0.006592512596398592, -0.006065877620130777, 0.053621016442775726, 0.022482525557279587, -0.035753726959228516, 0.0251444261521101, -0.010360346175730228, -0.016775717958807945, 0.019992979243397713, -0.0869426503777504, 0.03429830074310303, -0.03414509817957878, 0.007463853806257248, 0.05105486884713173, 0.055191345512866974, 0.06541763991117477, 0.012476461008191109, -0.027270115911960602, 0.05411892384290695, -0.03309182822704315, -0.008555424399673939, -0.038224123418331146, -0.013788261450827122, 0.008909706026315689, -0.08931729197502136, -0.03797516971826553, -0.006429734174162149, 0.014985159039497375, 0.019389742985367775, 0.01917908899486065, -0.023401742801070213, -0.020778143778443336, -0.02215697057545185, -0.05136127397418022, 0.06874980032444, -0.027978679165244102, -0.03736235946416855, -0.06323450058698654, -0.053621016442775726, -0.04178609326481819, -0.0528549998998642, -0.008062303066253662, 0.035332418978214264, -0.04576936736702919, -0.05082506313920021, 0.002100555459037423, 0.0036002681590616703, -0.0508633628487587, -0.007406402844935656, -0.019782325252890587, 0.006702627055346966, -0.028036130592226982, 0.02414860762655735, -0.0033130126539617777, -0.022999586537480354, -0.03784111514687538, 0.01565542072057724, 0.0006888146162964404, -0.03395359218120575, -0.03219176083803177, -0.06369410455226898, 0.004308831412345171, 0.04266700893640518, -0.033110976219177246, -0.0033034374937415123, -0.0789760947227478, 0.020356835797429085, -0.06032364442944527, 0.024569915607571602, -0.00980019848793745, 0.0695924162864685, -0.026293447241187096, 0.02772972546517849, -0.03971785306930542, -0.004028757568448782, 0.021199451759457588, -0.02755737118422985, -0.004177172668278217, 0.04140308499336243, 0.012706265784800053, -0.0271360632032156, 0.036864448338747025, 0.007990488782525063, 0.02466566674411297, 0.03355143591761589, 0.009110785089433193, -0.011384890414774418, -0.06384731084108353, -0.04446714371442795, 0.035389870405197144, -0.09253454953432083, 0.03307267650961876, 0.00831125769764185, -0.05917461961507797, -0.030238423496484756, -0.04875682294368744, 0.012371134012937546, -0.020127031952142715, -0.0034207336138933897, 0.005634994246065617, 0.007444703485816717, 0.04653538018465042, -0.015923526138067245, 0.06017043814063072, 0.02732756733894348, 0.011614695191383362, -0.014487249776721, -0.018681179732084274, 0.013520156033337116, 0.024991223588585854, -0.045922569930553436, -0.04079027101397514, -0.02849574014544487, -0.022693179547786713, -0.07663974910974503, 0.031119339168071747, 0.0005293280119076371, -0.03048737719655037, -0.05388912186026573, 0.006764865480363369, -0.059251222759485245, 0.01600012741982937, -0.006985094863921404, -0.011538093909621239, 0.055727556347846985, -0.010063515976071358, -0.011921101249754429, 0.031042737886309624, -0.014353197067975998, -0.07349909096956253, -0.025872139260172844, 0.024186907336115837, -0.0018575851572677493, 0.037209153175354004, -0.012304107658565044, 0.01177747268229723, -0.03561967611312866, 0.003358494956046343, 0.0237272996455431, -0.01619163155555725, 0.012457311153411865, -0.05423382669687271, 0.02543168142437935, 0.006046726834028959, -0.011145510710775852, -0.012773292139172554, 0.0026140245608985424, 0.0037151703145354986, 0.007186173461377621, 0.02380390092730522, 0.011968976818025112, 0.043969232589006424, 0.014793654903769493, 0.004713383037596941, 0.026638153940439224, -0.027040312066674232, 0.021946316584944725, 0.04140308499336243, -0.016344834119081497, -0.04193929582834244, 0.016699116677045822, -0.010772079229354858, 0.01962912268936634, -0.011174236424267292, -0.030104370787739754, 0.026331748813390732, -0.013874437659978867, 0.012150905095040798, 0.023631548509001732, 0.03824327513575554, -0.012524337507784367, 0.014583000913262367, 0.0038994925562292337, 0.004883342422544956, 0.031540647149086, 0.014851106330752373, 0.023478344082832336, -0.04576936736702919, -0.019705723971128464, -0.07196706533432007, -0.020050430670380592, -0.007339376490563154, 0.0051610227674245834, -0.007253199815750122, 0.02866809256374836, -0.01704382337629795, 0.014439373277127743, -0.025987042114138603, 0.04259040579199791, -0.07185216248035431, -0.04059876874089241, 0.017991766333580017, 0.08770865947008133, 0.03020012192428112, -0.053735919296741486, 0.007530880160629749, 0.04423733800649643, 0.024838021025061607, 0.005414764862507582, -0.020586639642715454, -0.028399987146258354, 0.004780409391969442, 0.08150394260883331, 0.0264274999499321, 0.058715011924505234, -0.026887109503149986, -0.04519485682249069, 0.011480642482638359, -0.021122850477695465, 0.025163576006889343, -0.0244358628988266, -0.0049551562406122684, -0.07989531010389328, -0.04305001720786095, 0.046497080475091934, -0.04082857444882393, -0.008000063709914684, -0.07326928526163101, 0.04354792460799217, -0.05791069567203522, -0.009115573018789291, 0.035160064697265625, -0.016545914113521576, 0.04707159101963043, 0.06292809545993805, -0.027633974328637123, -0.009101210162043571, 0.024359261617064476, 0.11674061417579651, 0.010503973811864853, 0.00394258089363575, 0.028055282309651375, 0.02795952931046486, 0.052548594772815704, 0.020988797768950462, 0.04845041781663895, 0.015846924856305122, -0.01852797530591488, 0.05205068737268448, -0.029338356107473373, -0.022712329402565956, -0.04423733800649643, -0.010791229084134102, 0.03816667199134827, -0.011700871400535107, -0.0017091698246076703, -0.004186748061329126, -0.01692892052233219, 0.06783058494329453, 0.04377773031592369, 0.046267274767160416, -0.010599725879728794, 0.060017235577106476, 0.05580415576696396, 0.05591905862092972, 0.010312470607459545, 0.05189748480916023, 0.0047588651068508625, 0.05346781387925148, -0.012974371202290058, 0.0200312789529562, -0.02403370477259159, 0.0008013229817152023, -0.07460981607437134, 0.053965721279382706, -0.014793654903769493, -0.02744247019290924, -0.02966391108930111, 0.020893046632409096, -0.01926526427268982, 0.03355143591761589, 0.012170055881142616, -0.00539082707837224, -0.07989531010389328, -0.02062494121491909, -0.05787239596247673, 0.009120360016822815, 0.024301810190081596, 0.002174763008952141, 0.03042992576956749, 0.01186364982277155, 0.053965721279382706, -0.004794772248715162, 0.05082506313920021, 0.005060483235865831, 0.03173214942216873, 0.03858797997236252, -0.01081037987023592, -0.04079027101397514, -0.005204110872000456, 0.01912163756787777, 0.011585969477891922, 0.039219941943883896, 0.019466344267129898, 0.08349557965993881, 0.029874565079808235, -0.027480769902467728, -0.014563851058483124, 0.04117327928543091, -0.0023303597699850798, -0.005510516930371523, 0.06694966554641724, -0.001052671461366117, -0.009977338835597038, 0.007832498289644718, -0.0011538093676790595, 0.03630908951163292, 0.012198780663311481, -0.03628993779420853, 0.007109572179615498, -0.0704733356833458, 0.04982924461364746, 0.02209951914846897, 0.02208036743104458, -0.05622546374797821, 0.009168236516416073, 0.061127956956624985, 0.008852255530655384, -0.028093582019209862, -0.005304650403559208, -0.013376528397202492, 0.05971083045005798, 0.02062494121491909, -0.018623728305101395, 0.03196195513010025, -0.01701509766280651, 0.010695477947592735, -0.02732756733894348, 0.048910025507211685, -0.00035218714037910104, -0.004098177421838045, 0.022118669003248215, -0.07338418811559677, -0.011097635142505169, -0.0008904918795451522, -0.012055153027176857, 0.042322300374507904, -0.010446523316204548, -0.02468481846153736, -0.033455684781074524, 0.06315789371728897, 0.010082665830850601, 0.05775749310851097, 0.011059334501624107, 0.028361687436699867, -0.01471705362200737, -0.031119339168071747, 0.00028964923694729805, 0.038511380553245544, -0.014161692932248116, 0.023823050782084465, 0.02232932299375534, -0.020758993923664093, -0.01325205061584711, 0.0641920194029808, 0.05136127397418022, -0.08173374831676483, -0.01670869067311287, 0.007866011932492256, -0.05718298256397247, -0.01880565658211708, 0.025010373443365097, -0.02966391108930111, -0.025929590687155724, 0.020299384370446205, 0.06323450058698654, 0.06438352167606354, 0.06867320090532303, 0.008100603707134724, 0.02039513550698757, 0.021467557176947594, 0.0251444261521101, 0.034106794744729996, 0.006946794223040342, -0.034700457006692886, 0.03766876459121704, 0.017886439338326454, 0.034700457006692886, 0.08617663383483887, -0.018087517470121384, 0.010561425238847733, -0.014257445000112057, -0.09115573018789291, -0.015052185393869877, -0.06300469487905502, 0.0028031342662870884, -0.01659378968179226, 0.015550094656646252, -0.006946794223040342, -0.026350898668169975, 0.03491111099720001, -0.061013054102659225, -0.008823529817163944, -0.025948742404580116, 0.03284287080168724, 0.0610896572470665, 0.023363443091511726, -0.018030066043138504, 0.016210781410336494, -0.02525932900607586, -0.009441128931939602, -0.0238613523542881, -0.02855319157242775, -0.011269988492131233, 0.018460949882864952, -0.04622897505760193, -0.03184705227613449, 0.054540231823921204, 0.030506527051329613, -0.019724873825907707, 0.0829593688249588, -0.008043152280151844, -0.0034398839343339205, -0.008383071050047874, 0.019140787422657013, -0.018231146037578583, -0.015732023864984512, 0.005400402471423149, 0.039564650505781174, -0.0661836564540863, 0.02273148111999035, 0.047263097018003464, -0.062008876353502274, -0.011155086569488049, 0.04155628755688667, -0.019839776679873466, -0.0406370684504509, 0.03414509817957878, -0.008766078390181065, -0.026887109503149986, -0.00826816912740469, -0.07943570613861084, -0.011231687851250172, 0.012170055881142616, 0.005979700945317745, 0.04412243515253067, 0.03824327513575554, -0.06951581686735153, -0.03561967611312866, -0.05718298256397247, 0.012304107658565044, 0.048565320670604706, -0.02079729363322258, 0.038626283407211304, -0.01974402368068695, 0.02273148111999035, 0.025240177288651466, 0.02943410724401474, -0.01783856377005577, -0.04465864598751068, 0.0021029491908848286, -0.027040312066674232, 0.005989275872707367, 0.005424340255558491, -0.038741182535886765, -0.013816987164318562, 0.017197025939822197, 0.04182439297437668, 0.014257445000112057, -0.02238677442073822, -0.017513006925582886, 0.0033154066186398268, 0.010638026520609856, -0.06285148859024048, 0.046152375638484955, 0.027480769902467728, -0.01439149770885706, -0.007894736714661121, -0.030870385468006134, 0.012591363862156868, -0.07771217077970505, 0.06863489747047424, -0.011681721545755863, -0.005577543284744024, 0.025833839550614357, 0.05764259025454521, 0.042628709226846695, -0.014018065296113491, 0.027710575610399246, 0.056187164038419724, -0.03165555000305176, 0.020586639642715454, -0.020988797768950462, 0.01218920573592186, 0.009177811443805695, -0.03150234743952751, -0.010963582433760166, -0.00857936218380928, 0.04324151948094368, 0.04576936736702919, 0.020356835797429085, -0.007961763069033623, -0.01826944574713707, -0.015138361603021622, 0.04105837643146515, -0.07763557136058807, -0.05205068737268448, -0.039871055632829666, 0.04013916105031967, 0.018087517470121384, -0.020893046632409096, -0.01571287214756012, -0.015846924856305122, -0.008699052035808563, 0.0017917557852342725, -0.019523795694112778, -0.01997382752597332, -0.027882928028702736, -0.062238678336143494, -0.01991637796163559, -0.08265296369791031, 0.07242666929960251, 0.012802017852663994, -0.00865117646753788, -0.030238423496484756, -0.007435128558427095, -0.05469343438744545, 0.042973414063453674, -0.01254348736256361, -0.08801506459712982, 0.0025637547951191664, 0.053199708461761475, -0.04301171377301216, 0.02466566674411297, 0.022884683683514595, 0.0007690067286603153, -0.05224218964576721, 0.0012106619542464614, -0.05986403301358223, -0.01616290584206581, -0.014544700272381306, -0.053314611315727234, 0.06943921744823456, -0.03378124162554741, -0.03201940655708313, -0.06744758039712906, 0.024301810190081596, -0.021122850477695465, 0.010982733219861984, -0.020414287224411964, -0.04607577249407768, -0.024416713044047356, 0.030180972069501877, 0.028629792854189873, -0.04668858274817467, 0.0389135368168354, 0.05350611358880997, -0.026944560930132866, -0.00023459194926545024, 0.023688998073339462, 0.015281989239156246, -0.03747725859284401, -0.02820848487317562, 0.010695477947592735, -0.0542721264064312, 0.008507548831403255, 0.01151894312351942, -0.030257573351264, -0.04071367159485817, 0.012591363862156868, 0.00537646422162652, 0.048910025507211685, -0.052740100771188736, -0.0025446044746786356, 0.029031949117779732, 0.0005134691018611193, 0.026810508221387863, -0.07675465196371078, 0.005453065969049931, -0.01712999865412712, 0.037515562027692795, -0.03736235946416855, -0.09230475127696991, -0.033110976219177246, -0.037860266864299774, 0.09981168806552887, 0.02167821116745472, 0.0781334787607193, -0.026063643395900726, -0.009302288293838501, 0.018451374024152756, -0.0015523763140663505, 0.024014554917812347, 0.015980977565050125, -0.010580575093626976, -0.04599917307496071, 0.021869713440537453, 0.040981777012348175, -0.02972136251628399, -0.00161222112365067, 0.06020874157547951, 0.019370591267943382, -0.010791229084134102, -0.01690019480884075, -0.00009837003017310053, 0.009761897847056389, -0.034987714141607285, -0.07725256681442261, -0.006075452547520399, 0.046152375638484955, -0.004813922569155693, -0.016210781410336494, -0.009551243856549263, 0.012208356522023678, -0.002292059129104018, -0.06047684699296951, 0.0023255720734596252, -0.02497207373380661, -0.0016421435866504908, 0.06664326041936874, -0.04952283948659897, 0.019495069980621338, 0.004225048702210188, 0.06017043814063072, 0.019782325252890587, 0.031004438176751137, -0.0027480770368129015, -0.009517730213701725, 0.0482972152531147, 0.00467268843203783, 0.08441480249166489, -0.012361559085547924, -0.016229933127760887, 0.04657368361949921, -0.028131883591413498, 0.013874437659978867, 0.046267274767160416, -0.02321024052798748, -0.04079027101397514, 0.023765599355101585, -0.006271743681281805, 0.050020746886730194, 0.031176790595054626, 0.01938016712665558, -0.006472822744399309, 0.01685231924057007, 0.014123392291367054, -0.021697361022233963, 0.07476301491260529, 0.006166416686028242, -0.009891162626445293, 0.04569276422262192, -0.047148194164037704, -0.04653538018465042, 0.013127573765814304, 0.010676327161490917, -0.0025230601895600557, 0.018077941611409187, -0.020241932943463326, -0.03192365542054176, 0.09513900429010391, -0.03761131316423416, 0.021697361022233963, -0.03517921641469002, -0.010283744893968105, -0.016325684264302254, 0.04542465880513191, -0.06514953076839447, -0.00031987091642804444, 0.013357377611100674, -0.03967955335974693, 0.07866968959569931, 0.03464300557971001, 0.026293447241187096, 0.05764259025454521, 0.012553063221275806, -0.013816987164318562, -0.003226836211979389, -0.00032914686016738415, 0.03301522508263588, -0.009551243856549263, -0.03548562154173851, 0.012725415639579296, -0.042628709226846695, 0.05289330333471298, 0.00023623768356628716, -0.02361239679157734, 0.00029129497124813497, 0.000173849388374947, 0.055497750639915466, 0.053621016442775726, -0.025987042114138603, 0.013089273124933243, -0.021467557176947594, 0.028514890000224113, 0.022922983393073082, -0.07077974081039429, -0.027633974328637123, 0.029472408816218376, 0.021582458168268204, 0.041326481848955154, 0.02338259294629097, -0.002126887207850814, -0.006300469394773245, 0.07185216248035431, 0.044275637716054916, -0.04753119871020317, 0.051437873393297195, 0.014736204408109188, 0.016804443672299385, -0.011088060215115547, 0.023114487528800964, 0.021659059450030327, -0.014171268790960312, -0.0015918739372864366, -0.04324151948094368, -0.024397561326622963, -0.038453929126262665, 0.09866266697645187, 0.05457853525876999, 0.0025805113837122917, -0.02732756733894348, 0.06170246750116348, -0.05810220167040825, 0.01912163756787777, -0.0707414373755455, -0.064766526222229, -0.11681721359491348, -0.036155883222818375, -0.03883693739771843, 0.016976796090602875, 0.026331748813390732, -0.023880502209067345, 0.02820848487317562, -0.01571287214756012, 0.008861830458045006 ]
717,408
pytorch_optimizer.optimizer.pcgrad
pc_backward
Calculate the gradient of the parameters. :param objectives: Iterable[nn.Module]. a list of objectives.
def pc_backward(self, objectives: Iterable[nn.Module]): r"""Calculate the gradient of the parameters. :param objectives: Iterable[nn.Module]. a list of objectives. """ grads, shapes, has_grads = self.pack_grad(objectives) pc_grad = self.project_conflicting(grads, has_grads) pc_grad = un_flatten_grad(pc_grad, shapes[0]) self.set_grad(pc_grad)
(self, objectives: Iterable[torch.nn.modules.module.Module])
[ -0.04605209827423096, -0.010249616578221321, -0.07893628627061844, 0.02551727555692196, -0.06922050565481186, -0.017349611967802048, -0.023008255288004875, -0.01522317249327898, 0.03343581780791283, -0.02784835174679756, -0.03971726447343826, -0.041069645434617996, -0.018417280167341232, 0.03334684297442436, -0.003441006410866976, 0.049575403332710266, -0.01962730474770069, 0.04519796371459961, 0.017643220722675323, -0.04786713421344757, -0.023132815957069397, -0.06605308502912521, 0.026424793526530266, 0.05277840793132782, -0.031976670026779175, -0.04153230041265488, -0.00039259056211449206, 0.01004498079419136, -0.03546438738703728, 0.011530819348990917, -0.014947357587516308, -0.04327616095542908, -0.027688201516866684, -0.002448964398354292, 0.031869903206825256, 0.017723295837640762, 0.029218526557087898, 0.04751124605536461, -0.038863129913806915, 0.0040816073305904865, -0.006926498841494322, -0.04010874405503273, 0.020232316106557846, 0.03391626849770546, 0.043027035892009735, 0.019431564956903458, -0.047653600573539734, 0.00822104699909687, 0.030339578166604042, -0.017589837312698364, -0.0060456725768744946, -0.09082299470901489, 0.054024022072553635, -0.023453116416931152, 0.021388957276940346, 0.04473530501127243, 0.02783055603504181, 0.04334733635187149, -0.02048143930733204, -0.03578468784689903, 0.048472147434949875, -0.08626760542392731, -0.008452375419437885, -0.04185260087251663, 0.04929069057106972, 0.024378428235650063, -0.006708516739308834, -0.0030873410869389772, 0.021655874326825142, 0.010694478638470173, -0.029556620866060257, -0.004348524380475283, -0.006454945541918278, -0.019111264497041702, 0.0014268943341448903, -0.09566309303045273, 0.05491374433040619, 0.018105877563357353, -0.04907715693116188, -0.03815134987235069, -0.045411497354507446, 0.0027514705434441566, -0.058935295790433884, -0.019342591986060143, 0.017812268808484077, -0.02859571948647499, -0.04694182053208351, -0.02829321287572384, -0.004032672382891178, -0.0002545443712733686, -0.013630567118525505, -0.04655034467577934, 0.012509514577686787, 0.007491473574191332, 0.08142751455307007, -0.004097177647054195, -0.04961099103093147, -0.016023922711610794, 0.013523800298571587, -0.008874993771314621, 0.0066061983816325665, 0.024058127775788307, -0.042386434972286224, -0.003598932409659028, 0.06783253699541092, -0.039219021797180176, -0.03605160489678383, -0.06701398640871048, 0.022421037778258324, -0.07544856518507004, -0.03582027554512024, 0.028791459277272224, 0.04701299965381622, -0.05046512559056282, 0.0030250605195760727, -0.006099055986851454, -0.021371163427829742, 0.004210617393255234, 0.0140309426933527, 0.029022786766290665, 0.006512777414172888, -0.026887450367212296, -0.0636330395936966, -0.008439029566943645, 0.021833818405866623, 0.008029756136238575, 0.016246354207396507, 0.03073105588555336, -0.016379812732338905, -0.04865008965134621, -0.061141811311244965, -0.003803568659350276, -0.09466660022735596, 0.002259898232296109, 0.04733330011367798, -0.03206564113497734, -0.013176808133721352, -0.019840838387608528, 0.020463645458221436, 0.011299490928649902, 0.04007315635681152, 0.01616627909243107, 0.03989521041512489, 0.062423013150691986, 0.0016737927217036486, 0.07658741623163223, 0.02551727555692196, -0.003965943120419979, -0.03514408692717552, 0.022367652505636215, -0.030001481994986534, 0.04373881593346596, -0.02466314099729061, -0.05655083805322647, -0.019146854057908058, 0.006312589626759291, -0.06687163561582565, 0.009715782478451729, -0.02888043038547039, -0.034289952367544174, -0.05886412039399147, -0.0025334882084280252, -0.052458107471466064, 0.001364613650366664, 0.0324215292930603, -0.020356878638267517, 0.060679156333208084, 0.0016849142266437411, 0.0009386584861204028, 0.03836488351225853, -0.019342591986060143, -0.08128515630960464, 0.016095101833343506, 0.0032697345595806837, -0.00033030990744009614, 0.03389847278594971, 0.006228065583854914, -0.011779941618442535, -0.0050669764168560505, 0.035446591675281525, 0.07043052464723587, 0.0012133606942370534, -0.016842469573020935, -0.0735267624258995, 0.0515327975153923, 0.0020897386129945517, -0.035393208265304565, 0.040251098573207855, 0.01472492702305317, 0.015943847596645355, 0.02523256279528141, -0.0008741535129956901, 0.07594681531190872, 0.025428302586078644, 0.034005239605903625, -0.02482329122722149, 0.05704908445477486, 0.01991201564669609, 0.045518264174461365, 0.030695466324687004, 0.013666155748069286, -0.017411893233656883, -0.006196925416588783, -0.02864910289645195, -0.031852107495069504, -0.001806139131076634, -0.04316939413547516, 0.03402303531765938, -0.01154861319810152, -0.02227868139743805, 0.01698482595384121, 0.02320399321615696, 0.026175670325756073, -0.04142553359270096, 0.003876970848068595, -0.00909742433577776, 0.019573921337723732, 0.00021867739269509912, 0.01996539905667305, -0.0025379369035363197, -0.03235035389661789, -0.021833818405866623, -0.02646038308739662, -0.03478819504380226, 0.004773367661982775, 0.0023132816422730684, -0.015837080776691437, 0.0321190245449543, 0.029467647895216942, -0.007647174876183271, 0.03553556278347969, 0.019645098596811295, -0.05758291855454445, 0.0013468192191794515, 0.15089713037014008, 0.013648360967636108, -0.0676901787519455, 0.035962630063295364, -0.022598981857299805, 0.03340022638440132, 0.018595224246382713, 0.024858878925442696, -0.014573673717677593, 0.023880183696746826, 0.04405911639332771, 0.022065147757530212, 0.08292225003242493, -0.02628243714570999, -0.026175670325756073, 0.011237210594117641, -0.01232267264276743, -0.041817013174295425, -0.05010923743247986, 0.03327566757798195, -0.04768918827176094, -0.03142504021525383, 0.043774403631687164, -0.05231575295329094, 0.017056003212928772, 0.0006211383733898401, 0.03854282945394516, -0.009591220878064632, -0.011495229788124561, 0.020232316106557846, -0.013087835162878036, 0.046158865094184875, 0.03352478891611099, -0.02646038308739662, 0.00516484584659338, 0.04007315635681152, 0.06865108013153076, -0.041923779994249344, -0.02117542363703251, 0.00704661151394248, -0.0010242944117635489, 0.06516335904598236, -0.002644703723490238, 0.009902624413371086, -0.003774652723222971, -0.006374870426952839, 0.04292026907205582, -0.07893628627061844, -0.05573229119181633, -0.015561266802251339, -0.023773416876792908, 0.02233206480741501, -0.0046532549895346165, -0.02042805589735508, 0.029876921325922012, 0.007108892314136028, 0.08690820634365082, 0.013799614273011684, 0.07487914711236954, 0.04231525957584381, 0.05897088721394539, 0.04352528229355812, 0.07374029606580734, -0.04562503099441528, 0.04889921471476555, -0.0006255869520828128, 0.06687163561582565, -0.013817409053444862, 0.011157134547829628, -0.002813751110807061, -0.013692847453057766, -0.0763738825917244, 0.07181849330663681, -0.0014335672603920102, -0.014466906897723675, -0.03347140550613403, 0.0032341456972062588, -0.02551727555692196, -0.03943255543708801, 0.05455785617232323, -0.01232267264276743, -0.07324205338954926, -0.012936582788825035, -0.058365873992443085, 0.01290099322795868, 0.018951114267110825, -0.0014079877873882651, -0.010009391233325005, 0.017981315031647682, 0.06494982540607452, -0.02646038308739662, 0.030659878626465797, 0.013648360967636108, 0.06295684725046158, 0.058259107172489166, -0.0013012208510190248, -0.004777816124260426, 0.003883643774315715, 0.0022532253060489893, 0.012082447297871113, 0.030766645446419716, -0.02464534528553486, 0.026549354195594788, 0.036016013473272324, 0.010222924873232841, 0.0040816073305904865, 0.02829321287572384, -0.001513642375357449, -0.021371163427829742, 0.015641342848539352, -0.0017516434891149402, 0.023755623027682304, 0.0008113167714327574, 0.02500123530626297, 0.03911225497722626, 0.0014424645341932774, -0.016691217198967934, 0.05288517475128174, -0.06459394097328186, 0.08235282450914383, -0.023364143446087837, 0.03772428259253502, -0.03754634037613869, -0.001031523454003036, 0.04267114773392677, -0.048187434673309326, -0.012135830707848072, -0.0225811880081892, -0.0411052331328392, 0.04484207555651665, -0.004853442776948214, 0.018381690606474876, 0.007882951758801937, -0.017127180472016335, -0.0031496218871325254, -0.02916514314711094, 0.02281251549720764, -0.012545104138553143, 0.035215262323617935, 0.006904255598783493, -0.07623152434825897, 0.01739409752190113, -0.0030628738459199667, 0.02500123530626297, 0.07722801715135574, 0.04925510287284851, -0.018506253138184547, -0.06245860084891319, -0.006130196154117584, -0.01796352118253708, 0.057440560311079025, 0.039325788617134094, 0.03478819504380226, -0.038791950792074203, 0.029022786766290665, -0.016744600608944893, 0.034289952367544174, -0.02720775082707405, -0.016842469573020935, -0.02019672840833664, -0.007331323344260454, 0.010009391233325005, 0.05160397291183472, 0.05822351947426796, -0.018257129937410355, -0.04171024635434151, -0.01469823531806469, 0.004844545386731625, -0.019413771107792854, 0.036549847573041916, -0.03571350872516632, -0.004277346655726433, 0.016103997826576233, 0.11139340698719025, 0.024752112105488777, 0.07651623338460922, 0.00704661151394248, 0.011771044693887234, -0.03153180703520775, 0.011059265583753586, 0.037937816232442856, -0.022830309346318245, -0.04356086999177933, -0.0054895952343940735, 0.03514408692717552, 0.024912262335419655, 0.07509268075227737, -0.017634322866797447, 0.03425436094403267, -0.02569521963596344, -0.05907765403389931, -0.004074934404343367, -0.04057139903306961, -0.004106074571609497, -0.025944342836737633, 0.021282190456986427, -0.031282685697078705, -0.05085660517215729, 0.021388957276940346, -0.05665760487318039, -0.001835055067203939, 0.024093717336654663, 0.053241066634655, 0.028097473084926605, 0.06153329089283943, 0.0032341456972062588, 0.0040171025320887566, -0.020285699516534805, -0.03523305803537369, -0.022616775706410408, -0.033240076154470444, -0.014084326103329659, 0.0016593346372246742, -0.08726409822702408, -0.03172754496335983, 0.0381869412958622, -0.025606248527765274, -0.0003111252444796264, 0.04914833605289459, -0.031514011323451996, 0.00030334017355926335, 0.007282388396561146, -0.0607503317296505, -0.029485443606972694, 0.014831693843007088, 0.017661014571785927, -0.0012767534935846925, -0.022136325016617775, 0.025890959426760674, 0.0014335672603920102, -0.038293708115816116, 0.03078443929553032, 0.029147347435355186, -0.027278928086161613, -0.029200730845332146, 0.03535762056708336, -0.016967030242085457, -0.030748849734663963, 0.008407888934016228, -0.07530621439218521, -0.023132815957069397, 0.006503880023956299, -0.01590825989842415, 0.020107755437493324, 0.04982452467083931, -0.06462952494621277, -0.0451623760163784, -0.055234044790267944, -0.014271168038249016, 0.047475654631853104, 0.0004949087742716074, 0.005169294774532318, -0.031514011323451996, 0.0167801883071661, 0.003367604222148657, 0.0017483070259913802, -0.01880875788629055, -0.08028866350650787, 0.010525431483983994, -0.000584993336815387, -0.021833818405866623, -0.038756363093853, -0.011005882173776627, -0.04064257815480232, 0.05427314341068268, -0.0012356038205325603, 0.014297859743237495, -0.008661460131406784, -0.04288468137383461, -0.03510849550366402, -0.011566407978534698, -0.007482576183974743, 0.02685186080634594, 0.023292966187000275, -0.022937076166272163, 0.014315654523670673, 0.009004003368318081, -0.004631011746823788, -0.009110770188272, 0.04651475325226784, -0.03302654251456261, -0.01476051565259695, 0.021104246377944946, 0.05039395019412041, 0.04651475325226784, -0.008665909059345722, 0.02576639875769615, 0.021193217486143112, -0.0350373201072216, 0.01660224422812462, 0.03662102669477463, 0.028311006724834442, -0.002620236249640584, -0.03854282945394516, -0.009439968504011631, -0.01333695836365223, 0.028204239904880524, 0.02003657817840576, 0.035962630063295364, 0.036087192595005035, -0.022652365267276764, -0.027332311496138573, 0.03694132715463638, -0.10100143402814865, -0.06726311147212982, -0.03370273485779762, 0.02037467248737812, 0.025143591687083244, 0.01875537447631359, 0.026264643296599388, -0.02505461871623993, -0.05594582483172417, -0.04640798643231392, -0.03535762056708336, -0.031620778143405914, 0.020819533616304398, -0.058187928050756454, -0.014111017808318138, -0.06968315690755844, 0.044699717313051224, 0.013781819492578506, 0.059575896710157394, -0.008883890695869923, 0.04936186969280243, -0.008421234786510468, 0.02993030473589897, -0.05551875755190849, -0.08947061002254486, 0.032368145883083344, 0.008745984174311161, -0.025890959426760674, 0.05220898613333702, 0.018417280167341232, 0.000258297921391204, -0.03183431178331375, -0.005872176494449377, -0.004751124419271946, -0.007914092391729355, -0.009982699528336525, -0.04594533145427704, 0.04544708505272865, 0.0007607137667946517, 0.027243338525295258, -0.07438089698553085, 0.0405002236366272, 0.0002680292527657002, -0.02533932961523533, -0.03073105588555336, -0.041745834052562714, -0.017002619802951813, 0.008559142239391804, 0.0370480939745903, -0.023079432547092438, 0.04142553359270096, 0.04142553359270096, -0.05341900885105133, -0.03929019719362259, 0.000834672013297677, 0.017429687082767487, -0.0572982057929039, -0.03708368167281151, 0.0353042371571064, -0.03772428259253502, 0.036033809185028076, 0.02592654898762703, 0.0193781815469265, -0.011112648993730545, 0.0017327368259429932, 0.048187434673309326, 0.022901488468050957, -0.04993129149079323, 0.004933517891913652, -0.02389797754585743, 0.010454253293573856, 0.031852107495069504, -0.04064257815480232, -0.004871237091720104, -0.021442340686917305, 0.007820671424269676, 0.005983391776680946, -0.05537640303373337, -0.04647916555404663, 0.005316099151968956, 0.0700746402144432, 0.018613019958138466, 0.0920330211520195, -0.013701744377613068, -0.03736839443445206, 0.025570658966898918, 0.03857841715216637, 0.006299243774265051, 0.03882754221558571, -0.0064015621319413185, -0.05377490073442459, 0.009786960668861866, 0.06744105368852615, -0.034983936697244644, -0.0026180120185017586, 0.00031223741825670004, 0.047368887811899185, -0.017999110743403435, 0.017411893233656883, 0.04797390103340149, -0.014742721803486347, -0.012856507673859596, -0.07366912066936493, -0.04195936769247055, 0.04793831333518028, 0.002054149517789483, 0.00574316643178463, -0.040251098573207855, 0.03715486079454422, -0.01476051565259695, -0.02870248630642891, 0.02558845281600952, -0.012918788008391857, 0.0014947358286008239, 0.02186940796673298, -0.020588206127285957, -0.021086450666189194, -0.032207995653152466, 0.018719786778092384, 0.0332934595644474, 0.05925559625029564, 0.013052246533334255, -0.017091592773795128, 0.03455686941742897, -0.0066061983816325665, 0.07573328167200089, -0.027634818106889725, -0.01588156819343567, 0.012251495383679867, 0.04953981563448906, 0.0011188274947926402, 0.003883643774315715, -0.019413771107792854, -0.01162868831306696, -0.036033809185028076, -0.04067816585302353, 0.029129553586244583, 0.010516533628106117, -0.037012506276369095, -0.02078394591808319, -0.00038675175164826214, 0.020677179098129272, 0.002184271579608321, 0.062245067209005356, 0.026175670325756073, -0.022065147757530212, 0.029378676787018776, 0.014511393383145332, 0.007664969656616449, 0.0243072509765625, 0.05434432253241539, 0.007589343003928661, 0.0070288171991705894, -0.06345508992671967, -0.006824180483818054, 0.07285057753324509, -0.013906381092965603, 0.045411497354507446, -0.02864910289645195, -0.025890959426760674, -0.057262618094682693, 0.04526914283633232, -0.018488457426428795, -0.011877811513841152, 0.03501952439546585, -0.03364935144782066, 0.04872126877307892, 0.0008502422133460641, 0.045696210116147995, 0.07285057753324509, -0.013203499838709831, -0.03215461224317551, -0.028435569256544113, 0.008065344765782356, 0.00510701397433877, -0.0020118877291679382, -0.030286194756627083, 0.03370273485779762, -0.017714397981762886, -0.005712026264518499, -0.021033067256212234, -0.03489496186375618, -0.00016112340381368995, 0.017838960513472557, 0.04729771241545677, 0.05021600425243378, -0.01747417263686657, 0.003058425150811672, -0.0769433006644249, -0.009052938781678677, 0.022776925936341286, -0.05224457383155823, 0.003965943120419979, -0.006712965201586485, -0.03224358707666397, 0.029894715175032616, 0.03213682025671005, -0.01162868831306696, -0.030517522245645523, 0.07053729146718979, 0.019395975396037102, -0.02350649982690811, 0.023470910266041756, -0.014956255443394184, 0.03964608907699585, -0.03864959627389908, 0.04092729091644287, 0.012278187088668346, 0.02882704697549343, -0.044948842376470566, -0.04334733635187149, 0.009893727488815784, -0.0624941922724247, 0.11004102230072021, 0.040998466312885284, -0.0017738866154104471, -0.015045227482914925, 0.05238693207502365, -0.02281251549720764, 0.018879937008023262, -0.03137165680527687, -0.0914635956287384, -0.08747763186693192, -0.026638327166438103, -0.02217191457748413, 0.044521771371364594, 0.015552369877696037, 0.006494983099400997, 0.02355988323688507, -0.026958627626299858, 0.0029227423947304487 ]
717,409
pytorch_optimizer.optimizer.pcgrad
project_conflicting
Project conflicting. :param grads: a list of the gradient of the parameters. :param has_grads: a list of mask represent whether the parameter has gradient. :return: torch.Tensor. merged gradients.
def project_conflicting(self, grads: List[torch.Tensor], has_grads: List[torch.Tensor]) -> torch.Tensor: r"""Project conflicting. :param grads: a list of the gradient of the parameters. :param has_grads: a list of mask represent whether the parameter has gradient. :return: torch.Tensor. merged gradients. """ shared: torch.Tensor = torch.stack(has_grads).prod(0).bool() pc_grad: List[torch.Tensor] = deepcopy(grads) for i, g_i in enumerate(pc_grad): random.shuffle(grads) for g_j in grads: g_i_g_j: torch.Tensor = torch.dot(g_i, g_j) if g_i_g_j < 0: pc_grad[i] -= g_i_g_j * g_j / (g_j.norm() ** 2) merged_grad: torch.Tensor = torch.zeros_like(grads[0]) shared_pc_gradients: torch.Tensor = torch.stack([g[shared] for g in pc_grad]) if self.reduction == 'mean': merged_grad[shared] = shared_pc_gradients.mean(dim=0) else: merged_grad[shared] = shared_pc_gradients.sum(dim=0) merged_grad[~shared] = torch.stack([g[~shared] for g in pc_grad]).sum(dim=0) return merged_grad
(self, grads: List[torch.Tensor], has_grads: List[torch.Tensor]) -> torch.Tensor
[ -0.04057938605546951, -0.081230029463768, -0.05743105709552765, 0.07374831289052963, -0.0605662502348423, 0.001437335042282939, -0.03306204825639725, -0.043002039194107056, 0.050590630620718, -0.02873334102332592, -0.012095436453819275, -0.004446720704436302, -0.03566283360123634, -0.008229884319007397, -0.03413086384534836, -0.01331566832959652, -0.036874156445264816, 0.061029404401779175, 0.05746668204665184, -0.06338080018758774, 0.008782106451690197, -0.05956868827342987, -0.015506741590797901, 0.05956868827342987, -0.009779668413102627, -0.029196495190262794, 0.0335964560508728, -0.003230942180380225, -0.0356450192630291, 0.03250982612371445, 0.029552767053246498, -0.0830826461315155, 0.0013538338243961334, -0.015987709164619446, 0.0030416727531701326, -0.005571204237639904, 0.00901813618838787, 0.07246574014425278, -0.06630223244428635, -0.03409523516893387, 0.007726650219410658, -0.0594618059694767, 0.016254913061857224, -0.052942026406526566, 0.028002982959151268, -0.00196172297000885, -0.021037865430116653, 0.08094501495361328, -0.04969995096325874, 0.0635233074426651, 0.048916153609752655, -0.06836860626935959, -0.01462496817111969, 0.01115131564438343, -0.04207573086023331, 0.034362439066171646, 0.033738963305950165, 0.042930781841278076, -0.00882664043456316, -0.0192030631005764, 0.012531870044767857, -0.05173070356249809, -0.0029481512028723955, -0.014295415952801704, 0.011988555081188679, 0.006827063392847776, -0.04599472135305405, -0.0583573617041111, 0.022552020847797394, 0.022249190136790276, -0.023905854672193527, 0.032438572496175766, 0.02515280805528164, -0.03965308144688606, 0.01898930035531521, -0.04845299944281578, 0.04143444076180458, -0.034772153943777084, 0.008457007817924023, -0.06138567626476288, 0.017332635819911957, -0.03252764046192169, -0.03352520242333412, -0.004506841767579317, 0.04977120831608772, -0.02370990626513958, -0.036874156445264816, -0.012710005976259708, 0.02164352685213089, -0.14749662578105927, 0.020895356312394142, -0.00615014648064971, 0.048702389001846313, -0.01377882156521082, 0.042004477232694626, 0.00550440326333046, -0.04054376110434532, -0.009913270361721516, -0.01056346669793129, -0.02404836378991604, 0.008354580029845238, 0.007005199324339628, -0.05522216856479645, -0.02249857969582081, 0.11657221615314484, -0.03610817342996597, -0.007624221965670586, -0.036767277866601944, 0.01364521961659193, -0.03072846494615078, 0.03069283813238144, -0.0443202443420887, 0.020360948517918587, -0.0116322822868824, 0.023549582809209824, -0.036357562988996506, -0.03589440882205963, 0.015577996149659157, 0.01785813644528389, 0.02670259028673172, 0.008590609766542912, 0.03283046931028366, -0.02518843486905098, 0.03733731061220169, 0.02411961741745472, -0.005090237129479647, 0.042859528213739395, 0.06430710852146149, 0.04232512041926384, -0.01623709872364998, 0.015577996149659157, 0.004907647613435984, -0.03740856796503067, -0.030977856367826462, 0.0319397896528244, -0.022730156779289246, -0.036945413798093796, 0.01778688281774521, 0.02005811780691147, 0.01923869177699089, 0.009681693278253078, -0.030960042029619217, 0.0017468464793637395, 0.020485643297433853, 0.00927198026329279, 0.04218261316418648, 0.016522116959095, -0.019113995134830475, -0.010367517359554768, -0.004742871969938278, 0.014803104102611542, 0.021590087562799454, -0.016842762008309364, 0.014224162325263023, -0.05272826552391052, 0.01214887760579586, 0.00888008065521717, 0.01957714930176735, -0.039759960025548935, -0.04930805414915085, 0.015480021014809608, -0.038726773113012314, 0.005629098508507013, 0.029374631121754646, 0.02175040915608406, -0.0690455213189125, 0.03610817342996597, 0.016112403944134712, 0.01982654072344303, 0.024440262466669083, -0.029089612886309624, -0.019879980012774467, 0.01589864119887352, -0.03069283813238144, -0.03826361894607544, 0.03993809595704079, -0.031850721687078476, -0.03815673664212227, -0.013226600363850594, 0.007610861677676439, 0.05030561611056328, -0.0038499648217111826, 0.02419087290763855, -0.04660038650035858, -0.009717320092022419, 0.06149255856871605, 0.0010276222601532936, -0.040793150663375854, 0.017849229276180267, -0.0004489584534894675, 0.008955788798630238, 0.0007526247063651681, 0.02736169472336769, 0.037871718406677246, 0.0062303077429533005, -0.01604115031659603, -0.0018359144451096654, -0.013805542141199112, 0.030033733695745468, 0.04403522610664368, -0.02581191062927246, -0.044747769832611084, -0.01676260121166706, 0.039759960025548935, -0.012068715877830982, -0.004308665171265602, -0.02536657080054283, -0.006265935022383928, 0.015079215168952942, 0.007031919900327921, 0.01565815694630146, 0.015524554997682571, 0.04125630483031273, 0.00901813618838787, 0.013618499040603638, 0.020913170650601387, 0.030550329014658928, 0.027522016316652298, -0.017671093344688416, 0.001595430774614215, -0.020289693027734756, -0.07923490554094315, 0.05450962483882904, 0.01930994540452957, 0.015577996149659157, 0.003589441068470478, 0.0008082922431640327, 0.02563377469778061, 0.02980215847492218, -0.04122067615389824, 0.04107816889882088, -0.013440363109111786, -0.015720505267381668, -0.01130273099988699, 0.06623097509145737, -0.02559814788401127, -0.026951981708407402, -0.0065153250470757484, 0.06370144337415695, 0.025134993717074394, -0.008310046046972275, -0.005437602289021015, -0.03069283813238144, 0.061955712735652924, 0.0395105704665184, -0.015123749151825905, -0.0025785190518945456, -0.01930994540452957, 0.03250982612371445, 0.04268139228224754, -0.02216012217104435, 0.02921430952847004, -0.026417573913931847, 0.03651788458228111, 0.00827441830188036, -0.00025300882407464087, -0.021875103935599327, -0.02818111889064312, 0.018846791237592697, -0.03252764046192169, 0.022480767220258713, 0.005972010549157858, -0.03039000742137432, -0.006898317951709032, -0.05144568532705307, 0.016433048993349075, 0.047989845275878906, 0.030924415215849876, -0.015996616333723068, 0.005793874152004719, -0.005032342858612537, 0.04517529532313347, 0.0009407809120602906, -0.023549582809209824, 0.04930805414915085, 0.0413631871342659, 0.020984424278140068, 0.07047061622142792, 0.05564969405531883, -0.0026052393950521946, 0.07503089308738708, -0.002916977507993579, -0.007695476524531841, 0.023318005725741386, -0.020307507365942, 0.02766452543437481, -0.023870227858424187, 0.02005811780691147, -0.02370990626513958, -0.02164352685213089, 0.021073492243885994, 0.002117592142894864, 0.08393769711256027, -0.0014651687815785408, 0.0011690177489072084, 0.0417194589972496, 0.04029437154531479, 0.014776383526623249, 0.02208886668086052, -0.019149623811244965, 0.06420022249221802, 0.02488560415804386, 0.018472706899046898, -0.00476513896137476, -0.007294670213013887, -0.05237199366092682, 0.05066188797354698, -0.03582315519452095, 0.049913715571165085, 0.01579175889492035, -0.027415134012699127, -0.04414210841059685, 0.05344080924987793, 0.012131063267588615, -0.009503557346761227, -0.0487380176782608, -0.03571627289056778, -0.04414210841059685, 0.016112403944134712, -0.007490620017051697, -0.011463053524494171, 0.0016221512341871858, 0.0027366147842258215, 0.0727507546544075, -0.017466237768530846, -0.0034558388870209455, 0.01011812686920166, 0.03210011124610901, -0.026132555678486824, 0.062026966363191605, -0.08322515338659286, -0.01132054440677166, 0.01331566832959652, 0.04143444076180458, -0.0051703983917832375, -0.018116435036063194, 0.06726416200399399, -0.03801422938704491, 0.048702389001846313, -0.01751077175140381, 0.029089612886309624, -0.010714882053434849, -0.040009353309869766, 0.04399959743022919, 0.018401451408863068, 0.017706722021102905, -0.037942975759506226, 0.057003527879714966, 0.004778498783707619, -0.01865084283053875, 0.0065153250470757484, 0.007771184202283621, -0.01906055584549904, 0.04250325635075569, 0.06950867921113968, 0.036874156445264816, -0.010866297408938408, 0.03566283360123634, 0.0720025822520256, 0.026951981708407402, 0.00767320953309536, -0.011035527102649212, 0.0332401841878891, 0.07374831289052963, 0.03169040009379387, 0.037729211151599884, -0.052977655082941055, -0.010652534663677216, -0.0624188631772995, -0.07959117740392685, 0.0171723123639822, -0.031262874603271484, 0.04122067615389824, -0.010358610190451145, -0.033810216933488846, 0.007018559612333775, -0.036179427057504654, -0.029303377494215965, 0.03543125465512276, -0.04243200272321701, -0.04731293022632599, 0.013680847361683846, -0.011276010423898697, 0.044925905764102936, 0.01436667051166296, 0.020984424278140068, 0.018152061849832535, -0.08785668760538101, 0.051018159836530685, 0.011748070828616619, 0.03865551948547363, -0.027468575164675713, 0.053903963416814804, 0.01438448391854763, -0.09327202290296555, -0.037800464779138565, 0.008848907425999641, 0.051089413464069366, 0.027165744453668594, -0.031405381858348846, 0.014322136528789997, -0.0716463103890419, -0.006933944765478373, 0.007241229526698589, -0.042859528213739395, -0.053975217044353485, 0.02082410268485546, 0.032705776393413544, 0.01244280207902193, 0.04018748924136162, -0.05272826552391052, -0.011721350252628326, 0.018953673541545868, 0.010127033106982708, 0.004146115854382515, 0.04521092399954796, -0.027539830654859543, 0.0012202317593619227, 0.007655395660549402, 0.03452276065945625, 0.058963026851415634, -0.027236998081207275, 0.02470746636390686, 0.020948797464370728, -0.04734855517745018, -0.046030350029468536, -0.05144568532705307, 0.023870227858424187, -0.06505528092384338, -0.01623709872364998, 0.02784266136586666, -0.05422460660338402, 0.05066188797354698, -0.028715528547763824, 0.04207573086023331, -0.02082410268485546, 0.016735879704356194, 0.04759794846177101, 0.004228503908962011, -0.015809573233127594, 0.0716463103890419, -0.018811164423823357, -0.022356072440743446, -0.009441209957003593, -0.04531780630350113, -0.07061312347650528, -0.02470746636390686, -0.03021186962723732, -0.06783419847488403, -0.00162994465790689, 0.016851669177412987, 0.0034625190310180187, 0.024208687245845795, 0.016228191554546356, 0.06883176416158676, -0.0149545194581151, -0.03245638310909271, -0.05226511135697365, -0.03227824717760086, 0.03498591482639313, -0.0005046259611845016, 0.0026341865304857492, 0.0049432748928666115, 0.05472338944673538, -0.042930781841278076, -0.0023959295358508825, 0.03637537732720375, -0.0602099783718586, -0.06273950636386871, 0.02433338202536106, 0.01417962834239006, -0.07104064524173737, -0.02230263128876686, -0.0516950748860836, -0.03357864171266556, -0.027236998081207275, -0.018258942291140556, 0.06441398710012436, -0.008439194411039352, 0.013137532398104668, -0.04139881208539009, -0.007450539618730545, -0.0531914196908474, 0.033738963305950165, 0.009797481819987297, 0.028056424111127853, -0.01026954222470522, 0.026827285066246986, 0.03922555223107338, 0.01796501874923706, 0.009913270361721516, -0.08429396897554398, -0.0036072544753551483, 0.006132332608103752, -0.044854652136564255, 0.012977209873497486, 0.010786136612296104, -0.049878086894750595, 0.02522406168282032, -0.006533138919621706, 0.004143889527767897, -0.05461650714278221, -0.04143444076180458, 0.03120943158864975, 0.06530466675758362, -0.10951802879571915, -0.0078023578971624374, 0.030675023794174194, 0.0059185693971812725, 0.017288101837038994, -0.05030561611056328, -0.010786136612296104, 0.022694529965519905, 0.042645763605833054, 0.046992283314466476, -0.04065064340829849, -0.005673632491379976, -0.03247419744729996, 0.006680101156234741, -0.03306204825639725, -0.00982420239597559, 0.0417194589972496, -0.024208687245845795, 0.012175597250461578, -0.002663133665919304, 0.03215355426073074, 0.04645787551999092, -0.016326166689395905, -0.034807778894901276, -0.06017434969544411, -0.05675413832068443, 0.011587748304009438, -0.023834601044654846, 0.02917868085205555, 0.0036139346193522215, -0.010946459136903286, 0.01362740620970726, -0.05636223778128624, -0.06929491460323334, -0.0443202443420887, 0.043963972479104996, 0.03929680958390236, 0.0360012911260128, -0.011641189455986023, -0.002216680208221078, 0.043928343802690506, -0.006368362810462713, -0.017323728650808334, 0.004609269555658102, -0.010990993119776249, -0.04332268238067627, 0.022961733862757683, -0.03475433960556984, 0.021216001361608505, 0.04328705370426178, 0.002567385556176305, -0.06776294857263565, 0.017145592719316483, -0.004916554316878319, 0.0313875675201416, 0.0343446247279644, -0.07738228887319565, 0.05960431694984436, -0.004778498783707619, -0.07731103897094727, -0.028858035802841187, 0.007895879447460175, -0.029552767053246498, -0.011970740742981434, 0.029980294406414032, -0.011124595068395138, -0.02777140773832798, -0.06466338038444519, -0.016611184924840927, 0.028002982959151268, 0.008648504503071308, 0.04720604792237282, -0.016459768638014793, -0.007018559612333775, -0.020360948517918587, -0.024939043447375298, -0.0010276222601532936, 0.008252151310443878, -0.007851345464587212, 0.022534208372235298, 0.04410647973418236, -0.06690789014101028, 0.025722842663526535, 0.09740477800369263, -0.03607254475355148, -0.0008884534472599626, 0.0535476915538311, 0.06541155278682709, -0.03865551948547363, -0.03548469766974449, 0.07752480357885361, -0.04143444076180458, 0.009797481819987297, 0.011053340509533882, -0.04147006943821907, 0.0016844988567754626, -0.024208687245845795, 0.027789220213890076, -0.015435487031936646, 0.020182812586426735, -0.002565158763900399, -0.03247419744729996, 0.013244413770735264, 0.020966609939932823, -0.0587136335670948, -0.015925360843539238, 0.012754539959132671, -0.02470746636390686, -0.025615960359573364, -0.021554458886384964, -0.04015186056494713, -0.04018748924136162, 0.07381957024335861, 0.011552121490240097, 0.002758881775662303, -0.014749662950634956, -0.0015620302874594927, -0.02185729146003723, 0.013502711430191994, 0.0002813992614392191, 0.024493703618645668, 0.026346318423748016, -0.040900032967329025, 0.013271134346723557, 0.07994744926691055, -0.026275064796209335, -0.003696322673931718, 0.06159943714737892, -0.0116322822868824, -0.015123749151825905, -0.024547144770622253, 0.0638795793056488, -0.018900232389569283, -0.013716474175453186, -0.04011623561382294, 0.00015698237984906882, -0.028501763939857483, -0.036321938037872314, 0.020966609939932823, -0.026417573913931847, -0.03250982612371445, -0.01979091204702854, 0.00002719009899010416, 0.020913170650601387, -0.005455415695905685, -0.038869280368089676, 0.06120754033327103, -0.0018425945891067386, -0.05019873380661011, 0.012006368488073349, -0.003188634989783168, 0.04011623561382294, 0.041006915271282196, 0.030977856367826462, 0.008287779055535793, 0.05817922577261925, 0.012977209873497486, 0.03161914646625519, -0.02153664641082287, -0.02707667648792267, 0.026310691609978676, 0.021394137293100357, -0.004689430817961693, 0.08130128681659698, 0.02684509940445423, -0.0417194589972496, -0.026934167370200157, -0.0657321959733963, 0.019488081336021423, 0.033881474286317825, -0.060067467391490936, 0.028305815532803535, 0.032741401344537735, -0.024689653888344765, -0.0524432472884655, 0.053868334740400314, -0.010536746121942997, -0.016709160059690475, 0.004388826433569193, -0.010670348070561886, 0.02068159356713295, 0.033774591982364655, -0.01902492716908455, 0.03933243453502655, 0.04047250747680664, -0.006118972785770893, -0.046742893755435944, 0.07702601701021194, 0.02305080182850361, 0.022427326068282127, 0.009236353449523449, -0.0052683730609714985, -0.02126944251358509, -0.03156570345163345, -0.015604715794324875, 0.012959396466612816, -0.02315768413245678, -0.05247887596487999, 0.03559157997369766, -0.028430510312318802, 0.048844899982213974, 0.04040125012397766, 0.010688161477446556, -0.014322136528789997, -0.042859528213739395, -0.031405381858348846, 0.01447355281561613, 0.05183758586645126, 0.035253118723630905, 0.00019219207752030343, -0.06263262778520584, 0.036696020513772964, -0.028537392616271973, 0.01979091204702854, -0.0025161714293062687, -0.011142408475279808, 0.06997182965278625, 0.010100312530994415, -0.0022478539030998945, 0.0063728163950145245, -0.03258107975125313, 0.07285763323307037, -0.07930616289377213, -0.050911277532577515, 0.0025807456113398075, 0.05671851336956024, 0.0583573617041111, 0.041933219879865646, 0.001524176448583603, -0.015319698490202427, 0.010385330766439438, 0.08707289397716522, 0.01675369404256344, -0.055079661309719086, 0.03350738808512688, -0.02814549207687378, -0.03651788458228111, -0.015034681186079979, -0.019434640184044838, -0.07431834936141968, 0.019897794350981712, -0.016664626076817513, -0.019327759742736816, -0.04845299944281578, 0.003449158975854516, 0.0827263742685318, 0.04517529532313347, 0.01771562732756138, 0.011142408475279808, 0.055934712290763855, -0.013467083685100079, 0.009744040668010712, -0.027949543669819832, -0.021732594817876816, -0.07930616289377213, -0.02873334102332592, 0.011837138794362545, 0.014161814004182816, 0.02422649972140789, 0.007285763509571552, 0.0167982280254364, -0.0494861900806427, 0.029018359258770943 ]
717,410
pytorch_optimizer.optimizer.pcgrad
reset
null
def pc_backward(self, objectives: Iterable[nn.Module]): r"""Calculate the gradient of the parameters. :param objectives: Iterable[nn.Module]. a list of objectives. """ grads, shapes, has_grads = self.pack_grad(objectives) pc_grad = self.project_conflicting(grads, has_grads) pc_grad = un_flatten_grad(pc_grad, shapes[0]) self.set_grad(pc_grad)
(self)
[ -0.04605209827423096, -0.010249616578221321, -0.07893628627061844, 0.02551727555692196, -0.06922050565481186, -0.017349611967802048, -0.023008255288004875, -0.01522317249327898, 0.03343581780791283, -0.02784835174679756, -0.03971726447343826, -0.041069645434617996, -0.018417280167341232, 0.03334684297442436, -0.003441006410866976, 0.049575403332710266, -0.01962730474770069, 0.04519796371459961, 0.017643220722675323, -0.04786713421344757, -0.023132815957069397, -0.06605308502912521, 0.026424793526530266, 0.05277840793132782, -0.031976670026779175, -0.04153230041265488, -0.00039259056211449206, 0.01004498079419136, -0.03546438738703728, 0.011530819348990917, -0.014947357587516308, -0.04327616095542908, -0.027688201516866684, -0.002448964398354292, 0.031869903206825256, 0.017723295837640762, 0.029218526557087898, 0.04751124605536461, -0.038863129913806915, 0.0040816073305904865, -0.006926498841494322, -0.04010874405503273, 0.020232316106557846, 0.03391626849770546, 0.043027035892009735, 0.019431564956903458, -0.047653600573539734, 0.00822104699909687, 0.030339578166604042, -0.017589837312698364, -0.0060456725768744946, -0.09082299470901489, 0.054024022072553635, -0.023453116416931152, 0.021388957276940346, 0.04473530501127243, 0.02783055603504181, 0.04334733635187149, -0.02048143930733204, -0.03578468784689903, 0.048472147434949875, -0.08626760542392731, -0.008452375419437885, -0.04185260087251663, 0.04929069057106972, 0.024378428235650063, -0.006708516739308834, -0.0030873410869389772, 0.021655874326825142, 0.010694478638470173, -0.029556620866060257, -0.004348524380475283, -0.006454945541918278, -0.019111264497041702, 0.0014268943341448903, -0.09566309303045273, 0.05491374433040619, 0.018105877563357353, -0.04907715693116188, -0.03815134987235069, -0.045411497354507446, 0.0027514705434441566, -0.058935295790433884, -0.019342591986060143, 0.017812268808484077, -0.02859571948647499, -0.04694182053208351, -0.02829321287572384, -0.004032672382891178, -0.0002545443712733686, -0.013630567118525505, -0.04655034467577934, 0.012509514577686787, 0.007491473574191332, 0.08142751455307007, -0.004097177647054195, -0.04961099103093147, -0.016023922711610794, 0.013523800298571587, -0.008874993771314621, 0.0066061983816325665, 0.024058127775788307, -0.042386434972286224, -0.003598932409659028, 0.06783253699541092, -0.039219021797180176, -0.03605160489678383, -0.06701398640871048, 0.022421037778258324, -0.07544856518507004, -0.03582027554512024, 0.028791459277272224, 0.04701299965381622, -0.05046512559056282, 0.0030250605195760727, -0.006099055986851454, -0.021371163427829742, 0.004210617393255234, 0.0140309426933527, 0.029022786766290665, 0.006512777414172888, -0.026887450367212296, -0.0636330395936966, -0.008439029566943645, 0.021833818405866623, 0.008029756136238575, 0.016246354207396507, 0.03073105588555336, -0.016379812732338905, -0.04865008965134621, -0.061141811311244965, -0.003803568659350276, -0.09466660022735596, 0.002259898232296109, 0.04733330011367798, -0.03206564113497734, -0.013176808133721352, -0.019840838387608528, 0.020463645458221436, 0.011299490928649902, 0.04007315635681152, 0.01616627909243107, 0.03989521041512489, 0.062423013150691986, 0.0016737927217036486, 0.07658741623163223, 0.02551727555692196, -0.003965943120419979, -0.03514408692717552, 0.022367652505636215, -0.030001481994986534, 0.04373881593346596, -0.02466314099729061, -0.05655083805322647, -0.019146854057908058, 0.006312589626759291, -0.06687163561582565, 0.009715782478451729, -0.02888043038547039, -0.034289952367544174, -0.05886412039399147, -0.0025334882084280252, -0.052458107471466064, 0.001364613650366664, 0.0324215292930603, -0.020356878638267517, 0.060679156333208084, 0.0016849142266437411, 0.0009386584861204028, 0.03836488351225853, -0.019342591986060143, -0.08128515630960464, 0.016095101833343506, 0.0032697345595806837, -0.00033030990744009614, 0.03389847278594971, 0.006228065583854914, -0.011779941618442535, -0.0050669764168560505, 0.035446591675281525, 0.07043052464723587, 0.0012133606942370534, -0.016842469573020935, -0.0735267624258995, 0.0515327975153923, 0.0020897386129945517, -0.035393208265304565, 0.040251098573207855, 0.01472492702305317, 0.015943847596645355, 0.02523256279528141, -0.0008741535129956901, 0.07594681531190872, 0.025428302586078644, 0.034005239605903625, -0.02482329122722149, 0.05704908445477486, 0.01991201564669609, 0.045518264174461365, 0.030695466324687004, 0.013666155748069286, -0.017411893233656883, -0.006196925416588783, -0.02864910289645195, -0.031852107495069504, -0.001806139131076634, -0.04316939413547516, 0.03402303531765938, -0.01154861319810152, -0.02227868139743805, 0.01698482595384121, 0.02320399321615696, 0.026175670325756073, -0.04142553359270096, 0.003876970848068595, -0.00909742433577776, 0.019573921337723732, 0.00021867739269509912, 0.01996539905667305, -0.0025379369035363197, -0.03235035389661789, -0.021833818405866623, -0.02646038308739662, -0.03478819504380226, 0.004773367661982775, 0.0023132816422730684, -0.015837080776691437, 0.0321190245449543, 0.029467647895216942, -0.007647174876183271, 0.03553556278347969, 0.019645098596811295, -0.05758291855454445, 0.0013468192191794515, 0.15089713037014008, 0.013648360967636108, -0.0676901787519455, 0.035962630063295364, -0.022598981857299805, 0.03340022638440132, 0.018595224246382713, 0.024858878925442696, -0.014573673717677593, 0.023880183696746826, 0.04405911639332771, 0.022065147757530212, 0.08292225003242493, -0.02628243714570999, -0.026175670325756073, 0.011237210594117641, -0.01232267264276743, -0.041817013174295425, -0.05010923743247986, 0.03327566757798195, -0.04768918827176094, -0.03142504021525383, 0.043774403631687164, -0.05231575295329094, 0.017056003212928772, 0.0006211383733898401, 0.03854282945394516, -0.009591220878064632, -0.011495229788124561, 0.020232316106557846, -0.013087835162878036, 0.046158865094184875, 0.03352478891611099, -0.02646038308739662, 0.00516484584659338, 0.04007315635681152, 0.06865108013153076, -0.041923779994249344, -0.02117542363703251, 0.00704661151394248, -0.0010242944117635489, 0.06516335904598236, -0.002644703723490238, 0.009902624413371086, -0.003774652723222971, -0.006374870426952839, 0.04292026907205582, -0.07893628627061844, -0.05573229119181633, -0.015561266802251339, -0.023773416876792908, 0.02233206480741501, -0.0046532549895346165, -0.02042805589735508, 0.029876921325922012, 0.007108892314136028, 0.08690820634365082, 0.013799614273011684, 0.07487914711236954, 0.04231525957584381, 0.05897088721394539, 0.04352528229355812, 0.07374029606580734, -0.04562503099441528, 0.04889921471476555, -0.0006255869520828128, 0.06687163561582565, -0.013817409053444862, 0.011157134547829628, -0.002813751110807061, -0.013692847453057766, -0.0763738825917244, 0.07181849330663681, -0.0014335672603920102, -0.014466906897723675, -0.03347140550613403, 0.0032341456972062588, -0.02551727555692196, -0.03943255543708801, 0.05455785617232323, -0.01232267264276743, -0.07324205338954926, -0.012936582788825035, -0.058365873992443085, 0.01290099322795868, 0.018951114267110825, -0.0014079877873882651, -0.010009391233325005, 0.017981315031647682, 0.06494982540607452, -0.02646038308739662, 0.030659878626465797, 0.013648360967636108, 0.06295684725046158, 0.058259107172489166, -0.0013012208510190248, -0.004777816124260426, 0.003883643774315715, 0.0022532253060489893, 0.012082447297871113, 0.030766645446419716, -0.02464534528553486, 0.026549354195594788, 0.036016013473272324, 0.010222924873232841, 0.0040816073305904865, 0.02829321287572384, -0.001513642375357449, -0.021371163427829742, 0.015641342848539352, -0.0017516434891149402, 0.023755623027682304, 0.0008113167714327574, 0.02500123530626297, 0.03911225497722626, 0.0014424645341932774, -0.016691217198967934, 0.05288517475128174, -0.06459394097328186, 0.08235282450914383, -0.023364143446087837, 0.03772428259253502, -0.03754634037613869, -0.001031523454003036, 0.04267114773392677, -0.048187434673309326, -0.012135830707848072, -0.0225811880081892, -0.0411052331328392, 0.04484207555651665, -0.004853442776948214, 0.018381690606474876, 0.007882951758801937, -0.017127180472016335, -0.0031496218871325254, -0.02916514314711094, 0.02281251549720764, -0.012545104138553143, 0.035215262323617935, 0.006904255598783493, -0.07623152434825897, 0.01739409752190113, -0.0030628738459199667, 0.02500123530626297, 0.07722801715135574, 0.04925510287284851, -0.018506253138184547, -0.06245860084891319, -0.006130196154117584, -0.01796352118253708, 0.057440560311079025, 0.039325788617134094, 0.03478819504380226, -0.038791950792074203, 0.029022786766290665, -0.016744600608944893, 0.034289952367544174, -0.02720775082707405, -0.016842469573020935, -0.02019672840833664, -0.007331323344260454, 0.010009391233325005, 0.05160397291183472, 0.05822351947426796, -0.018257129937410355, -0.04171024635434151, -0.01469823531806469, 0.004844545386731625, -0.019413771107792854, 0.036549847573041916, -0.03571350872516632, -0.004277346655726433, 0.016103997826576233, 0.11139340698719025, 0.024752112105488777, 0.07651623338460922, 0.00704661151394248, 0.011771044693887234, -0.03153180703520775, 0.011059265583753586, 0.037937816232442856, -0.022830309346318245, -0.04356086999177933, -0.0054895952343940735, 0.03514408692717552, 0.024912262335419655, 0.07509268075227737, -0.017634322866797447, 0.03425436094403267, -0.02569521963596344, -0.05907765403389931, -0.004074934404343367, -0.04057139903306961, -0.004106074571609497, -0.025944342836737633, 0.021282190456986427, -0.031282685697078705, -0.05085660517215729, 0.021388957276940346, -0.05665760487318039, -0.001835055067203939, 0.024093717336654663, 0.053241066634655, 0.028097473084926605, 0.06153329089283943, 0.0032341456972062588, 0.0040171025320887566, -0.020285699516534805, -0.03523305803537369, -0.022616775706410408, -0.033240076154470444, -0.014084326103329659, 0.0016593346372246742, -0.08726409822702408, -0.03172754496335983, 0.0381869412958622, -0.025606248527765274, -0.0003111252444796264, 0.04914833605289459, -0.031514011323451996, 0.00030334017355926335, 0.007282388396561146, -0.0607503317296505, -0.029485443606972694, 0.014831693843007088, 0.017661014571785927, -0.0012767534935846925, -0.022136325016617775, 0.025890959426760674, 0.0014335672603920102, -0.038293708115816116, 0.03078443929553032, 0.029147347435355186, -0.027278928086161613, -0.029200730845332146, 0.03535762056708336, -0.016967030242085457, -0.030748849734663963, 0.008407888934016228, -0.07530621439218521, -0.023132815957069397, 0.006503880023956299, -0.01590825989842415, 0.020107755437493324, 0.04982452467083931, -0.06462952494621277, -0.0451623760163784, -0.055234044790267944, -0.014271168038249016, 0.047475654631853104, 0.0004949087742716074, 0.005169294774532318, -0.031514011323451996, 0.0167801883071661, 0.003367604222148657, 0.0017483070259913802, -0.01880875788629055, -0.08028866350650787, 0.010525431483983994, -0.000584993336815387, -0.021833818405866623, -0.038756363093853, -0.011005882173776627, -0.04064257815480232, 0.05427314341068268, -0.0012356038205325603, 0.014297859743237495, -0.008661460131406784, -0.04288468137383461, -0.03510849550366402, -0.011566407978534698, -0.007482576183974743, 0.02685186080634594, 0.023292966187000275, -0.022937076166272163, 0.014315654523670673, 0.009004003368318081, -0.004631011746823788, -0.009110770188272, 0.04651475325226784, -0.03302654251456261, -0.01476051565259695, 0.021104246377944946, 0.05039395019412041, 0.04651475325226784, -0.008665909059345722, 0.02576639875769615, 0.021193217486143112, -0.0350373201072216, 0.01660224422812462, 0.03662102669477463, 0.028311006724834442, -0.002620236249640584, -0.03854282945394516, -0.009439968504011631, -0.01333695836365223, 0.028204239904880524, 0.02003657817840576, 0.035962630063295364, 0.036087192595005035, -0.022652365267276764, -0.027332311496138573, 0.03694132715463638, -0.10100143402814865, -0.06726311147212982, -0.03370273485779762, 0.02037467248737812, 0.025143591687083244, 0.01875537447631359, 0.026264643296599388, -0.02505461871623993, -0.05594582483172417, -0.04640798643231392, -0.03535762056708336, -0.031620778143405914, 0.020819533616304398, -0.058187928050756454, -0.014111017808318138, -0.06968315690755844, 0.044699717313051224, 0.013781819492578506, 0.059575896710157394, -0.008883890695869923, 0.04936186969280243, -0.008421234786510468, 0.02993030473589897, -0.05551875755190849, -0.08947061002254486, 0.032368145883083344, 0.008745984174311161, -0.025890959426760674, 0.05220898613333702, 0.018417280167341232, 0.000258297921391204, -0.03183431178331375, -0.005872176494449377, -0.004751124419271946, -0.007914092391729355, -0.009982699528336525, -0.04594533145427704, 0.04544708505272865, 0.0007607137667946517, 0.027243338525295258, -0.07438089698553085, 0.0405002236366272, 0.0002680292527657002, -0.02533932961523533, -0.03073105588555336, -0.041745834052562714, -0.017002619802951813, 0.008559142239391804, 0.0370480939745903, -0.023079432547092438, 0.04142553359270096, 0.04142553359270096, -0.05341900885105133, -0.03929019719362259, 0.000834672013297677, 0.017429687082767487, -0.0572982057929039, -0.03708368167281151, 0.0353042371571064, -0.03772428259253502, 0.036033809185028076, 0.02592654898762703, 0.0193781815469265, -0.011112648993730545, 0.0017327368259429932, 0.048187434673309326, 0.022901488468050957, -0.04993129149079323, 0.004933517891913652, -0.02389797754585743, 0.010454253293573856, 0.031852107495069504, -0.04064257815480232, -0.004871237091720104, -0.021442340686917305, 0.007820671424269676, 0.005983391776680946, -0.05537640303373337, -0.04647916555404663, 0.005316099151968956, 0.0700746402144432, 0.018613019958138466, 0.0920330211520195, -0.013701744377613068, -0.03736839443445206, 0.025570658966898918, 0.03857841715216637, 0.006299243774265051, 0.03882754221558571, -0.0064015621319413185, -0.05377490073442459, 0.009786960668861866, 0.06744105368852615, -0.034983936697244644, -0.0026180120185017586, 0.00031223741825670004, 0.047368887811899185, -0.017999110743403435, 0.017411893233656883, 0.04797390103340149, -0.014742721803486347, -0.012856507673859596, -0.07366912066936493, -0.04195936769247055, 0.04793831333518028, 0.002054149517789483, 0.00574316643178463, -0.040251098573207855, 0.03715486079454422, -0.01476051565259695, -0.02870248630642891, 0.02558845281600952, -0.012918788008391857, 0.0014947358286008239, 0.02186940796673298, -0.020588206127285957, -0.021086450666189194, -0.032207995653152466, 0.018719786778092384, 0.0332934595644474, 0.05925559625029564, 0.013052246533334255, -0.017091592773795128, 0.03455686941742897, -0.0066061983816325665, 0.07573328167200089, -0.027634818106889725, -0.01588156819343567, 0.012251495383679867, 0.04953981563448906, 0.0011188274947926402, 0.003883643774315715, -0.019413771107792854, -0.01162868831306696, -0.036033809185028076, -0.04067816585302353, 0.029129553586244583, 0.010516533628106117, -0.037012506276369095, -0.02078394591808319, -0.00038675175164826214, 0.020677179098129272, 0.002184271579608321, 0.062245067209005356, 0.026175670325756073, -0.022065147757530212, 0.029378676787018776, 0.014511393383145332, 0.007664969656616449, 0.0243072509765625, 0.05434432253241539, 0.007589343003928661, 0.0070288171991705894, -0.06345508992671967, -0.006824180483818054, 0.07285057753324509, -0.013906381092965603, 0.045411497354507446, -0.02864910289645195, -0.025890959426760674, -0.057262618094682693, 0.04526914283633232, -0.018488457426428795, -0.011877811513841152, 0.03501952439546585, -0.03364935144782066, 0.04872126877307892, 0.0008502422133460641, 0.045696210116147995, 0.07285057753324509, -0.013203499838709831, -0.03215461224317551, -0.028435569256544113, 0.008065344765782356, 0.00510701397433877, -0.0020118877291679382, -0.030286194756627083, 0.03370273485779762, -0.017714397981762886, -0.005712026264518499, -0.021033067256212234, -0.03489496186375618, -0.00016112340381368995, 0.017838960513472557, 0.04729771241545677, 0.05021600425243378, -0.01747417263686657, 0.003058425150811672, -0.0769433006644249, -0.009052938781678677, 0.022776925936341286, -0.05224457383155823, 0.003965943120419979, -0.006712965201586485, -0.03224358707666397, 0.029894715175032616, 0.03213682025671005, -0.01162868831306696, -0.030517522245645523, 0.07053729146718979, 0.019395975396037102, -0.02350649982690811, 0.023470910266041756, -0.014956255443394184, 0.03964608907699585, -0.03864959627389908, 0.04092729091644287, 0.012278187088668346, 0.02882704697549343, -0.044948842376470566, -0.04334733635187149, 0.009893727488815784, -0.0624941922724247, 0.11004102230072021, 0.040998466312885284, -0.0017738866154104471, -0.015045227482914925, 0.05238693207502365, -0.02281251549720764, 0.018879937008023262, -0.03137165680527687, -0.0914635956287384, -0.08747763186693192, -0.026638327166438103, -0.02217191457748413, 0.044521771371364594, 0.015552369877696037, 0.006494983099400997, 0.02355988323688507, -0.026958627626299858, 0.0029227423947304487 ]