def test_relu(): test_set = create_test_set(num_examples, max_value) run_test(test_set, relu_activation.get_approx_func(), relu_activation.get_real_func(), "Relu")
def test_range_relu(min_degree, max_degree, step): test_set = settings.create_test_set(settings.num_examples, max_value) approx_funcs = [] for degree in range(min_degree, max_degree, step): approx_funcs.append( (relu_activation.get_approx_func(degree), "Poly Degree: %s" % (degree)) ) run_multi_test(test_set, approx_funcs, relu_activation.get_real_func(), "Relu-Chebyshev")
def test_relu_polyfit(): # Least squares polynomial fit test_set = settings.create_test_set(settings.num_examples, max_value) run_test(test_set, relu_activation.get_approx_func_polyfit(), relu_activation.get_real_func(), "Relu-polyfit")
def test_relu(max_degree): test_set = settings.create_test_set(settings.num_examples, max_value) run_test(test_set, relu_activation.get_approx_func(max_degree), relu_activation.get_real_func(), "Relu-Chabyshev")
def test_relu_taylor(): test_set = settings.create_test_set(settings.num_examples, max_value_taylor) run_test(test_set, sigmoid_activation.get_approx_func_taylor_integ(), relu_activation.get_real_func(), "Relu-taylor-Sigmoid-Integral")