- Natural Language Processing with TensorFlow
- Thushan Ganegedara
- 364字
- 2021-06-25 21:28:22
Summary
In this chapter, you took your first steps to solving NLP tasks by understanding the primary underlying platform (TensorFlow) on which we will be implementing our algorithms. First, we discussed the underlying details of TensorFlow architecture. Next, we discussed the essential ingredients of a meaningful TensorFlow client. Then we discussed a general coding practice widely used in TensorFlow known as scoping. Later, we brought all these elements together to implement a neural network to classify an MNIST dataset.
Specifically, we discussed the TensorFlow architecture lining up the explanation with an example TensorFlow client. In the TensorFlow client, we defined the TensorFlow graph. Then, when we created a session, it looked at the graph, created a GraphDef
object representing the graph, and sent it to the distributed master. The distributed master looked at the graph, decided which components to use for the relevant computation, and pided it into several subgraphs to make the computations faster. Finally, workers executed subgraphs and returned the result through the session.
Next, we discussed various elements that composes a typical TensorFlow client: inputs, variables, outputs, and operations. Inputs are the data we feed to the algorithm for training and testing purposes. We discussed three different ways of feeding inputs: using placeholders, preloading data and storing data as TensorFlow tensors, and using an input pipeline. Then we discussed TensorFlow variables, how they differ from other tensors, and how to create and initialize them. Following this, we discussed how variables can be used to create intermediate and terminal outputs. Finally, we discussed several available TensorFlow operations, such as mathematical operations, matrix operations, neural-network related operations, and control-flow operations, that will be used later in the book.
Then we discussed how scoping can be used to avoid certain pitfalls when implementing a TensorFlow client. Scoping allows variables to be used with ease, while maintaining the encapsulation of the code.
Finally, we implemented a neural network using all the previously learned concepts. We used a three-layer neural network to classify an MNIST digit dataset.
In the next chapter, we will see how to use the fully connected neural network we implemented in this chapter, for learning the semantic numerical word representation of words.
- C++ Primer習題集(第5版)
- Data Visualization with D3 4.x Cookbook(Second Edition)
- Java程序設計(慕課版)
- GitLab Cookbook
- 摩登創(chuàng)客:與智能手機和平板電腦共舞
- Rust實戰(zhàn)
- JavaScript+jQuery網(wǎng)頁特效設計任務驅(qū)動教程(第2版)
- Python爬蟲開發(fā):從入門到實戰(zhàn)(微課版)
- Practical Data Science Cookbook(Second Edition)
- Mastering Python Scripting for System Administrators
- 區(qū)塊鏈底層設計Java實戰(zhàn)
- 基于ARM Cortex-M4F內(nèi)核的MSP432 MCU開發(fā)實踐
- App Inventor創(chuàng)意趣味編程進階
- R數(shù)據(jù)科學實戰(zhàn):工具詳解與案例分析
- 創(chuàng)意UI:Photoshop玩轉(zhuǎn)APP設計