This commit is contained in:
jeanfad 2016-05-25 10:40:37 +02:00
Родитель 3b2f8ed56d
Коммит 21d90a7331
2 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -49,7 +49,7 @@ def test_op_reshape(input_shape, output_shape, expected_output_shape, device_id,
# Backward pass test
# ==================
# Reshaping is just moving the input values to different indexes of the result tensor.
# If we would compute the gradients on the unmodified tensor, reshape would get 1 for all inputs.
# If we compute the gradients on the unmodified tensor, reshape would get 1 for all inputs.
# For testing the gradients we want to have different gradients for each input index otherwise we can't
# test if they get wrongly permuted during test. To this end we multiply the reshaping result with itself.
# The expected gradient is identical to the input tensor.
@ -224,7 +224,7 @@ def test_op_transpose_dimensions(input_shape, axis1, axis2, expected_output_shap
# Backward pass test
# ==================
# Reshaping is just moving the input values to different indexes of the result tensor.
# If we would compute the gradients on the unmodified tensor, reshape would get 1 for all inputs.
# If we compute the gradients on the unmodified tensor, reshape would get 1 for all inputs.
# For testing the gradients we want to have different gradients for each input index otherwise we can't
# test if they get wrongly permuted during test. To this end we multiply the reshaping result with itself.
# The expected gradient is identical to the input tensor.

Просмотреть файл

@ -38,19 +38,19 @@ def test_eval_plus_two_inputs():
result = cntk.eval(cntk.plus(cntk.input_numpy([_LEFT]), cntk.input_numpy([_RIGHT])))
TOLERANCE_ABSOLUTE = 1E-06
assert np.allclose(result, _EXPECTED, atol=TOLERANCE_ABSOLUTE)
def test_eval_plus_one_constant():
result = cntk.eval(cntk.plus(cntk.constant(_LEFT), _RIGHT))
TOLERANCE_ABSOLUTE = 1E-06
assert np.allclose(result, _EXPECTED, atol=TOLERANCE_ABSOLUTE)
assert np.allclose(result, _EXPECTED, atol=TOLERANCE_ABSOLUTE)
def test_eval_plus_one_constant_last():
result = cntk.eval(cntk.plus(_LEFT, cntk.constant(_RIGHT)))
TOLERANCE_ABSOLUTE = 1E-06
assert np.allclose(result, _EXPECTED, atol=TOLERANCE_ABSOLUTE)
assert np.allclose(result, _EXPECTED, atol=TOLERANCE_ABSOLUTE)
# this is dis-activated for now because we cannot have a netowrk without inputs
# this is dis-activated for now because we cannot have a netowrk without inputs
def _test_eval_plus_two_constants():
result = cntk.eval(cntk.plus(cntk.constant(_LEFT), cntk.constant(_RIGHT)))
TOLERANCE_ABSOLUTE = 1E-06
assert np.allclose(result, _EXPECTED, atol=TOLERANCE_ABSOLUTE)
assert np.allclose(result, _EXPECTED, atol=TOLERANCE_ABSOLUTE)