Commit 61cf799a authored by Marcel Rieger's avatar Marcel Rieger

Update test accuracies.

parent bae9e1fc
Pipeline #94517 failed with stages
in 32 seconds
...@@ -179,7 +179,7 @@ class TestCase(unittest.TestCase): ...@@ -179,7 +179,7 @@ class TestCase(unittest.TestCase):
boosted = lbn.boosted_particles.numpy()[1, 0] boosted = lbn.boosted_particles.numpy()[1, 0]
components = [217.82007, -93.470245, 56.69007, -117.862404] components = [217.82007, -93.470245, 56.69007, -117.862404]
for i, v in enumerate(components): for i, v in enumerate(components):
self.assertAlmostEqual(boosted[i], v, 5) self.assertAlmostEqual(boosted[i], v, 4)
def test_boosting_product(self): def test_boosting_product(self):
lbn = LBN(10, 4, boost_mode=LBN.PRODUCT, particle_weights=self.custom_particle_weights, lbn = LBN(10, 4, boost_mode=LBN.PRODUCT, particle_weights=self.custom_particle_weights,
...@@ -191,7 +191,7 @@ class TestCase(unittest.TestCase): ...@@ -191,7 +191,7 @@ class TestCase(unittest.TestCase):
boosted = lbn.boosted_particles.numpy()[1, 0] boosted = lbn.boosted_particles.numpy()[1, 0]
components = [217.82007, -93.470245, 56.69007, -117.862404] components = [217.82007, -93.470245, 56.69007, -117.862404]
for i, v in enumerate(components): for i, v in enumerate(components):
self.assertAlmostEqual(boosted[i], v, 5) self.assertAlmostEqual(boosted[i], v, 4)
def test_boosting_combinations(self): def test_boosting_combinations(self):
lbn = LBN(10, boost_mode=LBN.COMBINATIONS, particle_weights=self.custom_particle_weights, lbn = LBN(10, boost_mode=LBN.COMBINATIONS, particle_weights=self.custom_particle_weights,
...@@ -214,13 +214,13 @@ class TestCase(unittest.TestCase): ...@@ -214,13 +214,13 @@ class TestCase(unittest.TestCase):
boosted = lbn.boosted_particles.numpy()[1, 0] boosted = lbn.boosted_particles.numpy()[1, 0]
components = [288.7326, 172.70781, 102.427, 146.44083] components = [288.7326, 172.70781, 102.427, 146.44083]
for i, v in enumerate(components): for i, v in enumerate(components):
self.assertAlmostEqual(boosted[i], v, 4) self.assertAlmostEqual(boosted[i], v, 3)
# boosted particle 45 is p2 boosted into p1 # boosted particle 45 is p2 boosted into p1
boosted = lbn.boosted_particles.numpy()[1, 45] boosted = lbn.boosted_particles.numpy()[1, 45]
components = [69.299545, -19.58605, -18.497059, -53.21913] components = [69.299545, -19.58605, -18.497059, -53.21913]
for i, v in enumerate(components): for i, v in enumerate(components):
self.assertAlmostEqual(boosted[i], v, 4) self.assertAlmostEqual(boosted[i], v, 3)
def test_custom_feature_factory(self): def test_custom_feature_factory(self):
class MyFeatureFactory(FeatureFactory): class MyFeatureFactory(FeatureFactory):
...@@ -291,7 +291,7 @@ class TestCase(unittest.TestCase): ...@@ -291,7 +291,7 @@ class TestCase(unittest.TestCase):
lbn(self.vectors_t, features=all_features) lbn(self.vectors_t, features=all_features)
# make all tests on the first boosted particle at batch pos 1 # make all tests on the first boosted particle at batch pos 1
self.assertAlmostEqual(lbn.feature_factory.E().numpy()[1, 0], 217.82007, 5) self.assertAlmostEqual(lbn.feature_factory.E().numpy()[1, 0], 217.82007, 4)
self.assertAlmostEqual(lbn.feature_factory.px().numpy()[1, 0], -93.470245, 5) self.assertAlmostEqual(lbn.feature_factory.px().numpy()[1, 0], -93.470245, 5)
self.assertAlmostEqual(lbn.feature_factory.py().numpy()[1, 0], 56.69007, 5) self.assertAlmostEqual(lbn.feature_factory.py().numpy()[1, 0], 56.69007, 5)
self.assertAlmostEqual(lbn.feature_factory.pz().numpy()[1, 0], -117.862404, 5) self.assertAlmostEqual(lbn.feature_factory.pz().numpy()[1, 0], -117.862404, 5)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment