Example #1
0
class TestMomentumSGD(TestCase):
    def setUp(self):
        self.optimizer = MomentumSGD(0.1)
        self.model = LinearModel(self.optimizer)

    def test_linear_model_cpu(self):
        self.assertGreater(self.model.accuracy(False), 0.8)

    @attr.gpu
    def test_linear_model_gpu(self):
        self.assertGreater(self.model.accuracy(True), 0.8)
Example #2
0
class TestAdaDelta(TestCase):
    def setUp(self):
        self.optimizer = AdaDelta(eps=1e-5)
        self.model = LinearModel(self.optimizer)

    def test_linear_model_cpu(self):
        self.assertGreater(self.model.accuracy(False), 0.7)

    @attr.gpu
    def test_linear_model_gpu(self):
        self.assertGreater(self.model.accuracy(True), 0.7)
Example #3
0
class TestRMSprop(TestCase):
    def setUp(self):
        self.optimizer = RMSprop(0.1)
        self.model = LinearModel(self.optimizer)

    def test_linear_model_cpu(self):
        self.assertGreater(self.model.accuracy(False), 0.7)

    @attr.gpu
    def test_linear_model_gpu(self):
        self.assertGreater(self.model.accuracy(True), 0.7)
Example #4
0
class TestRMSprop(TestCase):
    def setUp(self):
        self.optimizer = RMSprop(0.1)
        self.model = LinearModel(self.optimizer)

    def test_linear_model_cpu(self):
        self.assertGreater(self.model.accuracy(False), 0.7)

    @attr.gpu
    def test_linear_model_gpu(self):
        self.assertGreater(self.model.accuracy(True), 0.7)
Example #5
0
class TestAdaDelta(TestCase):
    def setUp(self):
        self.optimizer = AdaDelta(eps=1e-5)
        self.model = LinearModel(self.optimizer)

    def test_linear_model_cpu(self):
        self.assertGreater(self.model.accuracy(False), 0.75)

    @attr.gpu
    def test_linear_model_gpu(self):
        self.assertGreater(self.model.accuracy(True), 0.75)