Beispiel #1
0
def test_ReduceMin(tmpdir, dtype):
    with C.default_options(dtype=dtype):
        data = np.array(
            [[[5, 1], [20, 2]], [[30, 1], [40, 2]], [[55, 1], [60, 2]]],
            dtype=dtype)
        model = C.reduce_min(data, 0)
        verify_no_input(model, tmpdir, 'ReduceMin_0')
Beispiel #2
0
def test_op_reduce_min(input_data, axis_data, expected_result, expected_gradient, device_id, precision):

    a = I([input_data])


    # slice using the operator
    result = C.reduce_min(a, axis = axis_data)

    unittest_helper(result, None, [[expected_result]], device_id=device_id, 
                precision=precision, clean_up=True, backward_pass=False)
    unittest_helper(result, None, [[expected_gradient]], device_id = device_id,
                precision=precision, clean_up=True, backward_pass=True, input_node=a)
Beispiel #3
0
def test_op_reduce_min(input_data, axis_data, expected_result, expected_gradient, device_id, precision):

    a = I([input_data])


    # slice using the operator
    result = C.reduce_min(a, axis = axis_data)

    unittest_helper(result, None, [[expected_result]], device_id=device_id, 
                precision=precision, clean_up=True, backward_pass=False)
    unittest_helper(result, None, [[expected_gradient]], device_id = device_id,
                precision=precision, clean_up=True, backward_pass=True, input_node=a)
Beispiel #4
0
def test_ReduceMin(tmpdir):
    data = np.array(
        [[[5, 1], [20, 2]], [[30, 1], [40, 2]], [[55, 1], [60, 2]]],
        dtype=np.float32)
    model = C.reduce_min(data, 0)
    verify_no_input(model, tmpdir, 'ReduceMin_0')
Beispiel #5
0
def test_ReduceMin(tmpdir, dtype):
    with C.default_options(dtype = dtype):
        data = np.array([[[5,1], [20,2]],[[30,1], [40,2]],[[55,1], [60,2]]], dtype=dtype)
        model = C.reduce_min(data, 0)
        verify_no_input(model, tmpdir, 'ReduceMin_0')
def test_reduce_min():
    data = np.array(
        [[[5, 1], [20, 2]], [[30, 1], [40, 2]], [[55, 1], [60, 2]]],
        dtype=np.float32)

    assert_cntk_ngraph_flat_equal(C.reduce_min([1, 0], 0))
    assert_cntk_ngraph_flat_equal(C.reduce_min([[1., 1.], [3., 5.]], 0))
    assert_cntk_ngraph_flat_equal(C.reduce_min([[1., 1.], [3., 5.]], 1))
    assert_cntk_ngraph_flat_equal(C.reduce_min([[1., 1.], [3., 5.]], -1))
    assert_cntk_ngraph_flat_equal(C.reduce_min(data, 0))
    assert_cntk_ngraph_flat_equal(C.reduce_min(data, 1))
    assert_cntk_ngraph_flat_equal(C.reduce_min(data, 2))
    assert_cntk_ngraph_flat_equal(C.reduce_min(data, -1))
    assert_cntk_ngraph_flat_equal(C.reduce_min(data, (0, 1)))
    assert_cntk_ngraph_flat_equal(C.reduce_min(data, (0, 2)))
    assert_cntk_ngraph_flat_equal(C.reduce_min(data, (1, 2)))
    assert_cntk_ngraph_flat_equal(C.reduce_min(data, (-1, -2)))
Beispiel #7
0
def test_ReduceMin(tmpdir):
    data = np.array([[[5,1], [20,2]],[[30,1], [40,2]],[[55,1], [60,2]]], dtype=np.float32)
    model = C.reduce_min(data, 0)
    verify_no_input(model, tmpdir, 'ReduceMin_0')