Esempio n. 1
0
    def test_nested_epoch_metrics(self):
        actual = rename_doubles([], [['a', 'a']])
        expected = [], [['a1', 'a2']]
        self.assertEqual(expected, actual)

        actual = rename_doubles([], [['a', 'b'], 'b'])
        expected = [], [['a', 'b1'], 'b2']
        self.assertEqual(expected, actual)
Esempio n. 2
0
    def test_epoch_metrics(self):
        actual = rename_doubles([], ['a', 'a'])
        expected = [], ['a1', 'a2']
        self.assertEqual(expected, actual)

        actual = rename_doubles([], ['a', 'b', 'a', 'a', 'c', 'd'])
        expected = [], ['a1', 'b', 'a2', 'a3', 'c', 'd']
        self.assertEqual(expected, actual)
Esempio n. 3
0
    def test_nested_batch_epoch_metrics(self):
        actual = rename_doubles([['a']], [['a']])
        expected = [['a1']], [['a2']]
        self.assertEqual(expected, actual)

        actual = rename_doubles([['a', 'b']], [['c', 'a']])
        expected = [['a1', 'b']], [['c', 'a2']]
        self.assertEqual(expected, actual)

        actual = rename_doubles(['a', 'b', ['b', 'a'], 'c', 'a', 'd'], ['e', ['c', 'a'], 'f', 'a'])
        expected = ['a1', 'b1', ['b2', 'a2'], 'c1', 'a3', 'd'], ['e', ['c2', 'a4'], 'f', 'a5']
        self.assertEqual(expected, actual)
Esempio n. 4
0
    def test_batch_epoch_metrics(self):
        actual = rename_doubles(['a', 'b', 'c'], ['d', 'a', 'e', 'a'])
        expected = ['a1', 'b', 'c'], ['d', 'a2', 'e', 'a3']
        self.assertEqual(expected, actual)

        actual = rename_doubles(['a', 'b', 'c', 'b'], ['d', 'a', 'e', 'a', 'e'])
        expected = ['a1', 'b1', 'c', 'b2'], ['d', 'a2', 'e1', 'a3', 'e2']
        self.assertEqual(expected, actual)

        actual = rename_doubles(['a', 'b', 'c'], ['d', 'a', 'e', 'a', 'e'])
        expected = ['a1', 'b', 'c'], ['d', 'a2', 'e1', 'a3', 'e2']
        self.assertEqual(expected, actual)