Commit b60cb726 authored by fbbradheintz's avatar fbbradheintz Committed by Francisco Massa
Browse files

Correctness test implemented with old test architecture (#1511)

* correctness test implemented with old test architecture

* reverted an unneeded change, ran flake8

* moving to relative tolerance of 1 part in 10k for classification correctness checks

* going down to 1 part in 1000 for correctness checks bc architecture differences

* one percent relative tolerance
parent 937c83ac
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -72,11 +72,13 @@ class ModelTester(TestCase): ...@@ -72,11 +72,13 @@ class ModelTester(TestCase):
def _test_classification_model(self, name, input_shape): def _test_classification_model(self, name, input_shape):
# passing num_class equal to a number other than 1000 helps in making the test # passing num_class equal to a number other than 1000 helps in making the test
# more enforcing in nature # more enforcing in nature
set_rng_seed(0)
model = models.__dict__[name](num_classes=50) model = models.__dict__[name](num_classes=50)
self.check_script(model, name) self.check_script(model, name)
model.eval() model.eval()
x = torch.rand(input_shape) x = torch.rand(input_shape)
out = model(x) out = model(x)
self.assertExpected(out, rtol=1e-2, atol=0.)
self.assertEqual(out.shape[-1], 50) self.assertEqual(out.shape[-1], 50)
def _test_segmentation_model(self, name): def _test_segmentation_model(self, name):
......
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