Skip to content

Commit

Permalink
Fix numeric tests for layernorm
Browse files Browse the repository at this point in the history
  • Loading branch information
iProzd committed Apr 22, 2024
1 parent 42a32d2 commit 93cdd6a
Show file tree
Hide file tree
Showing 4 changed files with 352 additions and 352 deletions.
112 changes: 56 additions & 56 deletions source/tests/tf/test_data_large_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,37 +201,37 @@ def test_data_mixed_type(self):
np.savetxt("f.out", f.reshape([1, -1]), delimiter=",")
np.savetxt("v.out", v.reshape([1, -1]), delimiter=",")

refe = [6.121172052273665543e01]
refe = [6.12116933882038480874e01]
reff = [
1.154685702881510720e-02,
1.756040710324277901e-02,
7.130177886472930130e-04,
2.368263097437618356e-02,
1.684273251820418010e-02,
-2.240810960870319706e-03,
-7.940856869069763679e-03,
9.685611956408284387e-03,
1.905551469314455948e-05,
8.701750245920510801e-03,
-2.715303056974926327e-02,
-8.833855542191653386e-04,
-4.384116594545389017e-02,
5.810410831752661764e-03,
2.624317854200653062e-03,
7.850784565411857499e-03,
-2.274613183985864026e-02,
-2.321946424516053086e-04,
1.15647422509625782266e-02,
1.75814420518816301453e-02,
7.13827966845788537686e-04,
2.37054385620869625950e-02,
1.68638656843611636771e-02,
-2.24281688803243482028e-03,
-7.95826529019691246425e-03,
9.69601584607941019422e-03,
1.91505445834121360688e-05,
8.71431743822387999687e-03,
-2.71847766570148252629e-02,
-8.84489238783629392812e-04,
-4.38853499152154838403e-02,
5.81882595276563344133e-03,
2.62678184040523532775e-03,
7.85911695413897895546e-03,
-2.27753728780730156644e-02,
-2.32454225018371036246e-04,
]
refv = [
-1.048816094719852016e-01,
1.669430893268222804e-02,
3.444164500535986783e-03,
1.669430893268222110e-02,
-5.415326614376372166e-02,
-1.079201716688232750e-03,
3.444164500535985916e-03,
-1.079201716688232750e-03,
-2.093268197504977288e-04,
-1.05000199239240657456e-01,
1.67161895068729630942e-02,
3.44771431604021672684e-03,
1.67161895068729769720e-02,
-5.42193765251950815509e-02,
-1.08055824874348557069e-03,
3.44771431604021585948e-03,
-1.08055824874348492017e-03,
-2.09534775642289020732e-04,
]

refe = np.reshape(refe, [-1])
Expand Down Expand Up @@ -400,37 +400,37 @@ def test_stripped_data_mixed_type(self):
np.savetxt("f11.out", f.reshape([1, -1]), delimiter=",")
np.savetxt("v11.out", v.reshape([1, -1]), delimiter=",")

refe = [6.124119974943835132e01]
refe = [6.12411774224343261608e01]
reff = [
8.617444257623986525e-03,
1.622774527785437321e-02,
7.219537519817814273e-04,
2.465257480331137924e-02,
1.507377800325802181e-02,
-2.267846199393293988e-03,
-6.217685260668888089e-03,
9.187965356558825195e-03,
-2.082402632037372596e-05,
6.179226045047841662e-03,
-2.505229190184387472e-02,
-7.834051085801594424e-04,
-4.104669576212031240e-02,
4.721690416727373704e-03,
2.565744238275521286e-03,
7.815135916805987862e-03,
-2.015888715255471572e-02,
-2.156226559634751916e-04,
8.63770820796567855016e-03,
1.62522026393666710331e-02,
7.22919459978568399415e-04,
2.46800946249053909654e-02,
1.50982535714741239463e-02,
-2.27024703144847314271e-03,
-6.23780053459390554371e-03,
9.20020798171328375858e-03,
-2.07267961671176406842e-05,
6.19326848220238136006e-03,
-2.50892401262326376898e-02,
-7.84679030459893762407e-04,
-4.10982573216296109830e-02,
4.73129070889465389027e-03,
2.56865811814534347399e-03,
7.82498654115005611021e-03,
-2.01927147752160932037e-02,
-2.15924720048428232235e-04,
]
refv = [
-8.500718686149140446e-02,
1.389198522732191729e-02,
3.059204598073241802e-03,
1.389198522732190168e-02,
-4.908897840490741155e-02,
-9.530658829897690944e-04,
3.059204598073239634e-03,
-9.530658829897688776e-04,
-1.999114402095244765e-04,
-8.51412082980419621103e-02,
1.39169542815959588339e-02,
3.06329019931955021105e-03,
1.39169542815959536297e-02,
-4.91657098529515168561e-02,
-9.54629874035841556948e-04,
3.06329019931954891001e-03,
-9.54629874035841773788e-04,
-2.00155580095981406675e-04,
]

refe = np.reshape(refe, [-1])
Expand Down
120 changes: 60 additions & 60 deletions source/tests/tf/test_descrpt_hybrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,66 +185,66 @@ def test_descriptor_hybrid(self):
]
# below is copied from test_descript_se_atten.py
ref_dout2 = [
1.3503570575883254e-04,
-9.3606804794552518e-05,
-9.3606804794552518e-05,
6.4931435609575354e-05,
-3.4432462227712845e-04,
2.3883309310633266e-04,
-2.1612770334269806e-04,
1.4980041766865035e-04,
5.1902342465554648e-04,
-3.5995814159000579e-04,
1.0061650355705337e-04,
-7.5148260042556979e-05,
-7.5148260042556979e-05,
5.6249549384058458e-05,
-2.7820514647114664e-04,
2.0819618461713165e-04,
-1.5698895407951743e-04,
1.1721016363267746e-04,
4.0972585703616773e-04,
-3.0650763759131061e-04,
7.5599650998659526e-05,
-5.8808888720672558e-05,
-5.8808888720672558e-05,
4.5766209906762655e-05,
-2.1712714013251668e-04,
1.6899894453623564e-04,
-1.2167120597162636e-04,
9.4648599144861605e-05,
3.2200758382615601e-04,
-2.5060486486718734e-04,
1.1293831101452813e-04,
-7.9512063028041913e-05,
-7.9512063028041913e-05,
5.5979262682797850e-05,
-2.9058515610909440e-04,
2.0457554106366365e-04,
-1.8732839505532627e-04,
1.3188376232775540e-04,
4.4448730317793450e-04,
-3.1292650304617497e-04,
1.3015885894252541e-04,
-8.8816609587789126e-05,
-8.8816609587789126e-05,
6.0613949400496957e-05,
-3.2308121544925519e-04,
2.2046786823295058e-04,
-2.1781481424814687e-04,
1.4862599684199924e-04,
4.9955378034266583e-04,
-3.4089120488765758e-04,
1.0160496779809329e-04,
-7.4538471222199861e-05,
-7.4538471222199861e-05,
5.4703671679263269e-05,
-2.7394267959121653e-04,
2.0103409637607701e-04,
-1.6657135958432620e-04,
1.2219321453198225e-04,
4.1344754259964935e-04,
-3.0339251136512270e-04,
1.35077997858830281628e-04,
-9.36317565146126714985e-05,
-9.36317565146126714985e-05,
6.49457155161046269156e-05,
-3.44426119482271894060e-04,
2.38892351975707574810e-04,
-2.16192628113445024177e-04,
1.49838432021978586618e-04,
5.19172506251499308108e-04,
-3.60044742999178198160e-04,
1.00648981900694042455e-04,
-7.51687985725674168679e-05,
-7.51687985725674168679e-05,
5.62621404496089786633e-05,
-2.78288905170686305408e-04,
2.08248552733448707985e-04,
-1.57037506111419247626e-04,
1.17240613774749092711e-04,
4.09846227953978995209e-04,
-3.06582508385239355716e-04,
7.56236313388503977959e-05,
-5.88249954799233110928e-05,
-5.88249954799233110928e-05,
4.57767614608878164778e-05,
-2.17191782618980676941e-04,
1.69041932410352632298e-04,
-1.21708419050609283887e-04,
9.46734475047640323129e-05,
3.22101565810662901230e-04,
-2.50667145896081176772e-04,
1.12972766463605449241e-04,
-7.95331652304217509748e-05,
-7.95331652304217509748e-05,
5.59918979793375151091e-05,
-2.90669309441163412500e-04,
2.04626666596480422588e-04,
-1.87383581443938113499e-04,
1.31917380775058677711e-04,
4.44613289651917854839e-04,
-3.13002780120454830552e-04,
1.30198051172878586420e-04,
-8.88399346622230731045e-05,
-8.88399346622230731045e-05,
6.06275354032895547767e-05,
-3.23173886613725041324e-04,
2.20522620462074609186e-04,
-2.17878181114203837987e-04,
1.48663514408247710887e-04,
4.99693951217273298233e-04,
-3.40973735611388808521e-04,
1.01636483586918407768e-04,
-7.45585238544824841465e-05,
-7.45585238544824841465e-05,
5.47161372646580776566e-05,
-2.74022957033491422908e-04,
2.01084733576426032218e-04,
-1.66621218118959135701e-04,
1.22224760787930633501e-04,
4.13566215420014648540e-04,
-3.03467107774532218571e-04,
]

places = 10
Expand Down
Loading

0 comments on commit 93cdd6a

Please sign in to comment.