Fix Tutorial 201B for convergence issue.

This commit is contained in:
KeDengMS 2018-02-14 10:01:31 -08:00
Родитель aa7447e764
Коммит 206db8c601
3 изменённых файлов: 20 добавлений и 2 удалений

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

@ -18,3 +18,6 @@ C.debugging.stop_profiler()
## CPU inference performance improvements using MKL
- Accelerates some common tensor ops in Intel CPU inference for float32, especially for fully connected networks
- Can be turned on/off by cntk.cntk_py.enable_cpueval_optimization()/cntk.cntk_py.disable_cpueval_optimization()
## Bug fixes
- Fixed convergence issue in Tutorial 201B

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

@ -17,3 +17,18 @@ def test_cntk_201B_cifar_10_imagehandson_noErrors(nb):
errors = [output for cell in nb.cells if 'outputs' in cell
for output in cell['outputs'] if output.output_type == "error"]
assert errors == []
metrics = []
for cell in nb.cells:
try:
if cell.cell_type == 'code':
m = re.search('Final Results: .* errs = (?P<metric>\d+\.\d+)%', cell.outputs[0]['text'])
if m:
metrics.append(float(m.group('metric')))
break
except IndexError:
pass
except KeyError:
pass
# TODO tighten tolerances
assert np.allclose([43.3], metrics, atol=0.5)

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

@ -521,8 +521,8 @@
"\n",
" # Set training parameters\n",
" lr_per_minibatch = C.learning_parameter_schedule([0.01]*10 + [0.003]*10 + [0.001], \n",
" epoch_size)\n",
" momentums = C.momentum_schedule(0.9, minibatch_size)\n",
" epoch_size = epoch_size)\n",
" momentums = C.momentum_schedule(0.9, minibatch_size = minibatch_size)\n",
" l2_reg_weight = 0.001\n",
" \n",
" # trainer object\n",