예제 #1
0
파일: test_reber.py 프로젝트: Neocher/neupy
    def test_reber_classification_data(self):
        invalid_data_ratio = 0.5
        n_words = 100

        words, labels = make_reber_classification(n_words, invalid_size=invalid_data_ratio)

        self.assertEqual(n_words, len(labels))
        self.assertEqual(math.ceil(n_words * invalid_data_ratio), sum(labels))

        for word, label in zip(words, labels):
            self.assertEqual(bool(label), is_valid_by_reber(word))
예제 #2
0
    def test_reber_classification_data(self):
        invalid_data_ratio = 0.5
        n_words = 100

        words, labels = make_reber_classification(
            n_words, invalid_size=invalid_data_ratio)

        self.assertEqual(n_words, len(labels))
        self.assertEqual(math.ceil(n_words * invalid_data_ratio), sum(labels))

        for word, label in zip(words, labels):
            self.assertEqual(bool(label), is_valid_by_reber(word))
예제 #3
0
파일: test_reber.py 프로젝트: Neocher/neupy
    def test_reber_wrod_generation(self):
        words = make_reber(50)
        self.assertEqual(50, len(words))

        for word in words:
            self.assertTrue(is_valid_by_reber(word))
예제 #4
0
    def test_reber_word_generation(self):
        words = make_reber(50)
        self.assertEqual(50, len(words))

        for word in words:
            self.assertTrue(is_valid_by_reber(word))