demo.js
/**
 * renders an mnist digit on the dom
 * @param mnistDigit: a 1D 28 * 28 array representing an mnist number
 */
renders an mnist digit on the dom
@param mnistDigit: a 1D 28 * 28 array representing an mnist number
renders an mnist digit on the dom @param mnistDigit : a 1D 28 * 28 array representing an mnist number
function renderMnistDigit(mnistDigit) {
	var mnistGrid = $('.mnist-grid');
	mnistGrid.empty();
	for (var i = 0; i < 28; i++) {
		var row = $('<div>', {
			'class': 'mnist-row',
		});
		for (var j = 0; j < 28; j++) {
			var cell = $('<div>', {
				class: 'mnist-cell',
				css: {
					'opacity': mnistDigit[28 * i + j],
				}
			});
			row.append(cell);
		}
		mnistGrid.append(row);
	}
}
function renderMnistDigit ( mnistDigit ) { var mnistGrid = $ ( '.mnist-grid' ) ; mnistGrid . empty ( ) ; for ( var i = 0 ; i < 28 ; i ++ ) { var row = $ ( '<div>' , { 'class' : 'mnist-row' , } ) ; for ( var j = 0 ; j < 28 ; j ++ ) { var cell = $ ( '<div>' , { class : 'mnist-cell' , css : { 'opacity' : mnistDigit [ 28 * i + j ] , } } ) ; row . append ( cell ) ; } mnistGrid . append ( row ) ; } }
renders an mnist digit on the dom
 @param mnistDigit: a 1D 28 * 28 array representing an mnist number
renders an mnist digit on the dom @param mnistDigit : a 1D 28 * 28 array representing an mnist number