Skip to main content
Module

x/mnist/mod.ts>printDigit

Famous MNIST dataset ported to Deno land
Latest
function printDigit
import { printDigit } from "https://deno.land/x/mnist@v1.1.0/mod.ts";

Returns a string that can be printed to console and looks like a digit, e.g.:

const image = loadMnist().train[0].image;
console.log(printImage(downscaleImage(image))); // ->
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░ ░ ░ ░ ░ ▒ ▒ ▒ ░ ░ ░ ░ ░
░ ░ ░ ░ ▒ █ █ █ █ █ ░ ░ ░ ░
░ ░ ░ ░ █ █ ░ ░ ░ █ ▓ ░ ░ ░
░ ░ ░ ▓ █ ░ ░ ▓ █ █ ▒ ░ ░ ░
░ ░ ░ ▒ █ █ █ ▓ █ ▓ ░ ░ ░ ░
░ ░ ░ ░ ▒ ▒ ░ ░ █ ▒ ░ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ▓ █ ░ ░ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ █ ▓ ░ ░ ░ ░ ░
░ ░ ░ ░ ░ ░ ▒ █ ░ ░ ░ ░ ░ ░
░ ░ ░ ░ ░ ░ █ ▓ ░ ░ ░ ░ ░ ░
░ ░ ░ ░ ░ ░ ▒ ▒ ░ ░ ░ ░ ░ ░

Parameters

image: number[]