Exemple #1
0
 def test_should_include_unknown_class_count_if_enabled(self):
     with tf.Session() as session:
         assert session.run(
             calculate_sample_frequencies(
                 [[COLOR_1, COLOR_2, COLOR_3]], [COLOR_1],
                 use_unknown_class=True)) == [1.0, 2.0]
Exemple #2
0
 def test_should_return_total_count_for_multiple_all_matching_color(self):
     with tf.Session() as session:
         assert session.run(
             calculate_sample_frequencies([[COLOR_1, COLOR_1, COLOR_1]],
                                          [COLOR_1])) == [3.0]
Exemple #3
0
 def test_should_return_total_count_for_multiple_mixed_color(self):
     with tf.Session() as session:
         assert session.run(
             calculate_sample_frequencies(
                 [[COLOR_1, COLOR_1, COLOR_2]],
                 [COLOR_1, COLOR_2])) == [2.0, 1.0]
Exemple #4
0
 def test_should_return_one_for_single_matching_color(self):
     with tf.Session() as session:
         assert session.run(
             calculate_sample_frequencies([[COLOR_1]], [COLOR_1])) == [1.0]