Example #1
0
def classify_with_random_network_test():
    # given
    pysbp.init()
    pysbp.add_layer([0.5, 0.5, 0.5])

    # when
    answer = pysbp.classify([1, 0])

    # then
    assert all(a >= 0.0 and a <= 1.0 for a in answer),\
        "Some values in {} aren't from range [0,1]".format(answer)
Example #2
0
 def check_examples(input, output):
     answer = pysbp.classify(input)
     assert abs(answer[0] - output[0]) < EPS, \
         "Network answer for {} should be {}, not {}".format(
             input, output, answer)