Skip to content
Snippets Groups Projects
Commit b5190bfe authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Fixing tests for UBUNTU 12.04

parent 89be68e1
Branches
Tags v0.0.2
No related merge requests found
...@@ -8,6 +8,7 @@ import bob.learn.boosting.utils ...@@ -8,6 +8,7 @@ import bob.learn.boosting.utils
class TestBoosting(unittest.TestCase): class TestBoosting(unittest.TestCase):
"""Class to test the LUT trainer """ """Class to test the LUT trainer """
"""
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
# create a single copy of the MNIST database to avoid downloading the packages several times # create a single copy of the MNIST database to avoid downloading the packages several times
...@@ -17,12 +18,16 @@ class TestBoosting(unittest.TestCase): ...@@ -17,12 +18,16 @@ class TestBoosting(unittest.TestCase):
def tearDownClass(cls): def tearDownClass(cls):
# Clean up the mess that we created # Clean up the mess that we created
del cls.database del cls.database
"""
def _data(self, digits = [3, 0], count = 20): def _data(self, digits = [3, 0], count = 20):
self.database = bob.learn.boosting.utils.MNIST()
# get the data # get the data
inputs, targets = [], [] inputs, targets = [], []
for digit in digits: for digit in digits:
input, target = TestBoosting.database.data(labels = digit) input, target = self.database.data(labels = digit)
inputs.append(input[:count]) inputs.append(input[:count])
targets.append(target[:count]) targets.append(target[:count])
return numpy.vstack(inputs), numpy.hstack(targets) return numpy.vstack(inputs), numpy.hstack(targets)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment