def test_cntk_fastrcnn_eval_evalCorrect(nb): if os.getenv("OS") == "Windows_NT" and sys.version_info[0] == 2: pytest.skip( 'tests with Python 2.7 on Windows are not stable in the CI environment. ' ) # Make sure that the number of detections is more than 0 detectionCells = [ cell for cell in nb.cells if cell.cell_type == 'code' and len(cell.outputs) > 0 and 'text' in cell.outputs[0] and re.search( r'Number of detections: (\d+)', get_output_stream_from_cell(cell)) ] assert len(detectionCells) == 1 number_of_detections = int( re.search(r'Number of detections: (\d+)', get_output_stream_from_cell(detectionCells[0])).group(1)) assert (number_of_detections > 0) #Make sure that the last cells was ran successfully testCells = [ cell for cell in nb.cells if cell.cell_type == 'code' and len(cell.outputs) > 0 and 'text' in cell.outputs[0] and re.search('Evaluation result:', get_output_stream_from_cell(cell)) ] assert len(testCells) == 1
def test_cntk_how_to_train_eval_correct(nb): testCells = [cell for cell in nb.cells if cell.cell_type == 'code'] assert len(testCells) == 5 for c in testCells[1:]: text = get_output_stream_from_cell(c) print(text) assert re.search(expectedOutput, text)
def test_cntk_106B_lstm_timeseries_with_iot_data_evalCorrect(nb, device_id): testCell = [cell for cell in nb.cells if cell.cell_type == 'code' and re.search('# Print the test error', cell.source)] assert len(testCell) == 1 text = get_output_stream_from_cell(testCell[0]) m = re.match(r"mse for test: (?P<actualEvalError>\d+\.\d+)\r?$", text) assert np.isclose(float(m.group('actualEvalError')), expectedEvalErrorByDeviceId[device_id], atol=0.00002)
def test_csv_correct(nb): testCells = [cell for cell in nb.cells if cell.cell_type == 'code'] assert len(testCells) == 6 text = get_output_stream_from_cell(testCells[5]) print(text) assert re.search(expectedOutput, text)
def test_cntk_how_to_train_eval_correct(nb): testCells = [cell for cell in nb.cells if cell.cell_type == 'code'] assert len(testCells) == 5 for c in testCells[1:]: text = get_output_stream_from_cell(c) print(text) assert re.search(expectedOutput, text)
def test_cntk_106B_lstm_timeseries_with_iot_data_evalCorrect(nb, device_id): if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2: pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ') testCell = [cell for cell in nb.cells if cell.cell_type == 'code' and re.search('# Print the test error', cell.source)] assert len(testCell) == 1 text = get_output_stream_from_cell(testCell[0]) m = re.match(r"mse for test: (?P<actualEvalError>\d+\.\d+)\r?$", text) assert np.isclose(float(m.group('actualEvalError')), expectedEvalErrorByDeviceId[device_id], atol=0.00002)
def test_cntk_how_to_train_eval_correct(nb): if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2: pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ') testCells = [cell for cell in nb.cells if cell.cell_type == 'code'] assert len(testCells) == 5 for c in testCells[1:]: text = get_output_stream_from_cell(c) print(text) assert re.search(expectedOutput, text)
def test_cntk_203_reinforcement_learning_basics_tasks_are_solved(nb): if os.getenv("OS") == "Windows_NT" and sys.version_info[0] == 2: pytest.skip( 'tests with Python 2.7 on Windows are not stable in the CI environment. ' ) testCells = [ cell for cell in nb.cells if re.search('Task solved in[ :]', get_output_stream_from_cell(cell)) ] assert len(testCells) == 2
def test_csv_correct(nb): if os.getenv("OS") == "Windows_NT" and sys.version_info[0] == 2: pytest.skip( 'tests with Python 2.7 on Windows are not stable in the CI environment. ' ) testCells = [cell for cell in nb.cells if cell.cell_type == 'code'] assert len(testCells) == 6 text = get_output_stream_from_cell(testCells[5]) print(text) assert re.search(expectedOutput, text)
def test_cntk_fastrcnn_eval_evalCorrect(nb): # Make sure that the number of detections is more than 0 detectionCells = [cell for cell in nb.cells if cell.cell_type == 'code' and len(cell.outputs) > 0 and 'text' in cell.outputs[0] and re.search('Number of detections: (\d+)', get_output_stream_from_cell(cell))] assert len(detectionCells) == 1 number_of_detections = int(re.search('Number of detections: (\d+)', get_output_stream_from_cell(detectionCells[0])).group(1)) assert(number_of_detections > 0) #Make sure that the last cells was ran successfully testCells = [cell for cell in nb.cells if cell.cell_type == 'code' and len(cell.outputs) > 0 and 'text' in cell.outputs[0] and re.search('Evaluation result:', get_output_stream_from_cell(cell))] assert len(testCells) == 1
def test_cntk_fastrcnn_eval_evalCorrect(nb): # Make sure that the number of detections is more than 0 detectionCells = [cell for cell in nb.cells if cell.cell_type == 'code' and len(cell.outputs) > 0 and 'text' in cell.outputs[0] and re.search('Number of detections: (\d+)', get_output_stream_from_cell(cell))] assert len(detectionCells) == 1 number_of_detections = int(re.search('Number of detections: (\d+)', get_output_stream_from_cell(detectionCells[0])).group(1)) assert(number_of_detections > 0) #Make sure that the last cells was ran successfully testCells = [cell for cell in nb.cells if cell.cell_type == 'code' and len(cell.outputs) > 0 and 'text' in cell.outputs[0] and re.search('Evaluation result:', get_output_stream_from_cell(cell))] assert len(testCells) == 1
def test_cntk_106B_lstm_timeseries_with_iot_data_evalCorrect(nb, device_id): testCell = [ cell for cell in nb.cells if cell.cell_type == 'code' and re.search('# Print the test error', cell.source) ] assert len(testCell) == 1 text = get_output_stream_from_cell(testCell[0]) m = re.match(r"mse for test: (?P<actualEvalError>\d+\.\d+)\r?$", text) assert np.isclose(float(m.group('actualEvalError')), expectedEvalErrorByDeviceId[device_id], atol=0.00002)
def test_cntk_fastrcnn_eval_evalCorrect(nb): if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2: pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ') # Make sure that the number of detections is more than 0 detectionCells = [cell for cell in nb.cells if cell.cell_type == 'code' and len(cell.outputs) > 0 and 'text' in cell.outputs[0] and re.search(r'Number of detections: (\d+)', get_output_stream_from_cell(cell))] assert len(detectionCells) == 1 number_of_detections = int(re.search(r'Number of detections: (\d+)', get_output_stream_from_cell(detectionCells[0])).group(1)) assert(number_of_detections > 0) #Make sure that the last cells was ran successfully testCells = [cell for cell in nb.cells if cell.cell_type == 'code' and len(cell.outputs) > 0 and 'text' in cell.outputs[0] and re.search('Evaluation result:', get_output_stream_from_cell(cell))] assert len(testCells) == 1
def test_cntk_203_reinforcement_learning_basics_tasks_are_solved(nb): if os.getenv("OS")=="Windows_NT" and sys.version_info[0] == 2: pytest.skip('tests with Python 2.7 on Windows are not stable in the CI environment. ') testCells = [cell for cell in nb.cells if re.search('Task solved in[ :]', get_output_stream_from_cell(cell))] assert len(testCells) == 2
def test_cntk_203_reinforcement_learning_basics_tasks_are_solved(nb): testCells = [cell for cell in nb.cells if re.search('Task solved in[ :]', get_output_stream_from_cell(cell))] assert len(testCells) == 2
def test_cntk_203_reinforcement_learning_basics_tasks_are_solved(nb): testCells = [ cell for cell in nb.cells if re.search('Task solved in[ :]', get_output_stream_from_cell(cell)) ] assert len(testCells) == 2