MNIST For ML Beginners

This tutorial is intended for readers who are new to both machine learning and TensorFlow. If you already know what MNIST is, and what softmax (multinomial logistic) regression is, you might prefer this faster paced tutorial. Be sure to install TensorFlow before starting either tutorial.
When one learns how to program, there's a tradition that the first thing you do is print "Hello World." Just like programming has Hello World, machine learning has MNIST.
MNIST is a simple computer vision dataset. It consists of images of handwritten digits like these:

Paste_Image.png

It also includes labels for each image, telling us which digit it is. For example, the labels for the above images are 5, 0, 4, and 1.

In this tutorial, we're going to train a model to look at images and predict what digits they are. Our goal isn't to train a really elaborate model that achieves state-of-the-art performance -- although we'll give you code to do that later! -- but rather to dip a toe into using TensorFlow. As such, we're going to start with a very simple model, called a Softmax Regression.

The actual code for this tutorial is very short, and all the interesting stuff happens in just three lines. However, it is very important to understand the ideas behind it: both how TensorFlow works and the core machine learning concepts. Because of this, we are going to very carefully work through the code.

About this tutorial


This tutorial is an explanation, line by line, of what is happening in the mnist_softmax.py code.
You can use this tutorial in a few different ways, including:
Copy and paste each code snippet, line by line, into a Python environment as you read through the explanations of each line.

Run the entire mnist_softmax.py
Python file either before or after reading through the explanations, and use this tutorial to understand the lines of code that aren't clear to you.

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末乡洼,一起剝皮案震驚了整個濱河市拇舀,隨后出現(xiàn)的幾起案子逻族,更是在濱河造成了極大的恐慌,老刑警劉巖骄崩,帶你破解...
    沈念sama閱讀 206,214評論 6 481
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件聘鳞,死亡現(xiàn)場離奇詭異,居然都是意外死亡要拂,警方通過查閱死者的電腦和手機抠璃,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,307評論 2 382
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來脱惰,“玉大人搏嗡,你說我怎么就攤上這事±唬” “怎么了彻况?”我有些...
    開封第一講書人閱讀 152,543評論 0 341
  • 文/不壞的土叔 我叫張陵,是天一觀的道長舅踪。 經(jīng)常有香客問我,道長良蛮,這世上最難降的妖魔是什么抽碌? 我笑而不...
    開封第一講書人閱讀 55,221評論 1 279
  • 正文 為了忘掉前任,我火速辦了婚禮决瞳,結(jié)果婚禮上货徙,老公的妹妹穿的比我還像新娘。我一直安慰自己皮胡,他們只是感情好痴颊,可當(dāng)我...
    茶點故事閱讀 64,224評論 5 371
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著屡贺,像睡著了一般蠢棱。 火紅的嫁衣襯著肌膚如雪锌杀。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 49,007評論 1 284
  • 那天泻仙,我揣著相機與錄音糕再,去河邊找鬼。 笑死玉转,一個胖子當(dāng)著我的面吹牛突想,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播究抓,決...
    沈念sama閱讀 38,313評論 3 399
  • 文/蒼蘭香墨 我猛地睜開眼猾担,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了刺下?” 一聲冷哼從身側(cè)響起绑嘹,我...
    開封第一講書人閱讀 36,956評論 0 259
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎怠李,沒想到半個月后圾叼,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 43,441評論 1 300
  • 正文 獨居荒郊野嶺守林人離奇死亡捺癞,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 35,925評論 2 323
  • 正文 我和宋清朗相戀三年夷蚊,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片髓介。...
    茶點故事閱讀 38,018評論 1 333
  • 序言:一個原本活蹦亂跳的男人離奇死亡惕鼓,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出唐础,到底是詐尸還是另有隱情箱歧,我是刑警寧澤,帶...
    沈念sama閱讀 33,685評論 4 322
  • 正文 年R本政府宣布一膨,位于F島的核電站呀邢,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏豹绪。R本人自食惡果不足惜价淌,卻給世界環(huán)境...
    茶點故事閱讀 39,234評論 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望瞒津。 院中可真熱鬧蝉衣,春花似錦、人聲如沸巷蚪。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,240評論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽屁柏。三九已至啦膜,卻和暖如春有送,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背功戚。 一陣腳步聲響...
    開封第一講書人閱讀 31,464評論 1 261
  • 我被黑心中介騙來泰國打工显拜, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留寝贡,地道東北人。 一個月前我還...
    沈念sama閱讀 45,467評論 2 352
  • 正文 我出身青樓,卻偏偏與公主長得像邦投,于是被迫代替她去往敵國和親萍程。 傳聞我的和親對象是個殘疾皇子膨更,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 42,762評論 2 345

推薦閱讀更多精彩內(nèi)容