mnist-mlp

์ฑ… ใ€Ž๋ฐ‘๋ฐ”๋‹ฅ๋ถ€ํ„ฐ ๋งŒ๋“œ๋Š” ์ถ”๋ก  ์—”์ง„: Rust๋กœ ๋ฐฐ์šฐ๋Š” AI ์ธํผ๋Ÿฐ์Šค ์—”์ง€๋‹ˆ์–ด๋งใ€ (Building an Inference Engine from Scratch) 7์žฅ์—์„œ ์“ฐ๋Š” ์†๊ธ€์”จ ์ˆซ์ž ๋ถ„๋ฅ˜ ๋ชจ๋ธ์ž…๋‹ˆ๋‹ค.

A tiny MNIST classifier used in chapter 7 of the book. It exists so that readers can run the book's inference engine, badak, without training the model themselves.

๋ชจ๋ธ / Model

๊ตฌ์กฐ / Architecture ๋‹ค์ธต ํผ์…‰ํŠธ๋ก  784 โ†’ 128 โ†’ 10, ReLU
ํŒŒ๋ผ๋ฏธํ„ฐ / Parameters 101,770
์ž…๋ ฅ / Input 28 ร— 28 ํ”ฝ์…€์„ (x / 255 โˆ’ 0.1307) / 0.3081๋กœ ์ •๊ทœํ™”ํ•ด 784๊ฐœ๋กœ ํŽธ ๊ฒƒ
์ถœ๋ ฅ / Output ์ˆซ์ž 0~9์— ๋Œ€ํ•œ ์ ์ˆ˜ 10๊ฐœ
์‹œํ—˜ ์ •ํ™•๋„ / Test accuracy 97.64% (10,000์žฅ ์ค‘ 9,764์žฅ)

ํŒŒ์ผ / Files

ํŒŒ์ผ ๋‚ด์šฉ
model.safetensors ๊ฐ€์ค‘์น˜ fc1.weight, fc1.bias, fc2.weight, fc2.bias. ์ „์ฒ˜๋ฆฌ์— ์“ฐ๋Š” ํ‰๊ท ๊ณผ ํ‘œ์ค€ํŽธ์ฐจ๋Š” ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ์— ์žˆ์Šต๋‹ˆ๋‹ค.
reference.safetensors PyTorch๊ฐ€ ๊ณ„์‚ฐํ•œ ์ •๋‹ต. ์•ž์˜ 16์žฅ์— ๋Œ€ํ•œ ์ธต๋ณ„ ์ถœ๋ ฅ(input, fc1, relu, logits)๊ณผ ์‹œํ—˜ ๋ฐ์ดํ„ฐ ์ „์ฒด์˜ ์ ์ˆ˜(all_logits), ์˜ˆ์ธก(predictions).

๋งŒ๋“  ๋ฐฉ๋ฒ• / How it was made

์ €์žฅ์†Œ์˜ reference/ch07_train_mnist.py๋กœ ํ•™์Šตํ–ˆ์Šต๋‹ˆ๋‹ค. PyTorch 2.15.0, ๋‚œ์ˆ˜ ์”จ์•— 0, Adam(ํ•™์Šต๋ฅ  0.001), ๋ฐฐ์น˜ 64, 5 ์—ํญ, CPU.

sh scripts/download_mnist.sh
python reference/ch07_train_mnist.py

๊ฐ™์€ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•ด๋„ ๊ธฐ๊ณ„์™€ PyTorch ๋ฒ„์ „์— ๋”ฐ๋ผ ๊ฐ€์ค‘์น˜๊ฐ€ ์กฐ๊ธˆ ๋‹ค๋ฅผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ฑ…์˜ ์ˆซ์ž๋ฅผ ๊ทธ๋Œ€๋กœ ์žฌํ˜„ํ•˜๋ ค๋ฉด ์ด ์ €์žฅ์†Œ์˜ ํŒŒ์ผ์„ ์“ฐ์‹ญ์‹œ์˜ค.

ํ•œ๊ณ„ / Limitations

ํ•™์Šต ์žฌ๋ฃŒ๋ฅผ ๋ณด์—ฌ ์ฃผ๊ธฐ ์œ„ํ•œ ์ž‘์€ ๋ชจ๋ธ์ž…๋‹ˆ๋‹ค. MNIST์™€ ๊ฐ™์€ ๋ฐฉ์‹์œผ๋กœ ๊ฐ€์šด๋ฐ ์ •๋ ฌ๋œ ํฐ ์ˆซ์ž, ๊ฒ€์€ ๋ฐฐ๊ฒฝ์˜ 28 ร— 28 ๊ทธ๋ฆผ์—์„œ๋งŒ ์ž˜ ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค.

Downloads last month

-

Downloads are not tracked for this model. How to track
Safetensors
Model size
102k params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Dataset used to train building-an-inference-engine-from-scratch/mnist-mlp