Introduction to TensorFlow

Lecture note 1: Introduction to TensorFlow

Why TensorFlow

TensorFlow was originally created by researchers at Google as a single infrastructure for machine learning in both production and research. Later, an implementation of it was open sourced under the Apache 2.0 License in November 2015. On the Tensorflow website, we see:

"TensorFlow? is an open source software library for

numerical computation using data flow graphs."

Note that only the implementation of TensorFlow that we see on GitHub is open-source. Google maintains its own internal version. It‘s said that Google did it because of the complicated relationships TensorFlow has with its other internal tools, not because Google is "hoarding good stuff". For the rest of this course, when we say TensorFlow, we are referring to the open source implementation.

The next key phrase we see is that TensorFlow is a "software library for Machine Intelligence". In the past year, it seems like every week, a company or another released their own deep learning library. For a non-exhaustive list of current deep learning libraries, please visit this link.

Given the plethora of these libraries, why did we choose Tensorflow to teach in this class? For a framework to be useful in production, it needs to be efficient, scalable, and maintainable. For research, the framework needs to have flexible operations that can be combined in novel ways. Alternative frameworks are either flexible enough for research but less scalable, such as Chainer and PyTorch, or scalable but less flexible, such as Caffe and MXNet. TensorFlow is both flexible and scalable, allowing users to streamline from research into production.

This unique position allowed TensorFlow to grow quickly. It‘s currently being used by big companies such as Google, OpenAI, NVIDIA, Intel, SAP, eBay, Airbus, Uber, Airbnb, Snap, Dropbox and startups alike. By the number of stars and related repositories on GitHub as of Jan 11, 2018, TensorFlow is by far the most popular machine learning library with more than 85.4k stars and 25.3k related repositories, twice as much as the total stars and related repositories of Caffe, PyTorch, Torch, and Theano combined. It‘s said that the rise of TensorFlow is the reason why the support for Theano was discontinued in September 2017.

Demand for TensorFlow learning materials also surpasses that of any other framework.

In summary, we chose TensorFlow because:

  • Python API
  • Portability: deploy computation to one or more CPUs or GPUs in a desktop, server, or mobile device with a single API
  • Flexibility: from Raspberry Pi, Android, Windows, iOS, Linux to server farms
  • Visualization (TensorBoard is da bomb)
  • Save and restore models, graphs
  • Auto-differentiation autodiff (no more taking derivatives by hand. Yay)
  • Large community (~300k commits, ~85k repositories)
  • Awesome projects already using TensorFlow

Some cool projects using Tensorflow

1. WaveNet: A Generative Model for Raw Audio (DeepMind, 2016)

2. Dermatologist-level classification of skin cancer with deep neural networks (Esteva, Kuprel, et al., Nature 2017)

3. Magenta (Google)

Use machine learning to create compelling art and music. Their projects are really fun! For example, please check out Draw Together with a Neural Network.

Below are some more examples of real world projects using TensorFlow, according to Google Research Blog, 2016:

  • Australian marine biologists are using TensorFlow to find sea cows in tens of thousands of hi-res photos to better understand their populations, which are under threat of extinction.
  • An enterprising Japanese cucumber farmer trained a model with TensorFlow to sort cucumbers by size, shape, and other characteristics.
  • Radiologists have adapted TensorFlow to identify signs of Parkinson‘s disease in medical scans.
  • Data scientists in the Bay Area have rigged up TensorFlow and the Raspberry Pi to keep track of the Caltrain.

I hope that after this class, you‘d be able to use TensorFlow to work on super cool projects like that!

High level APIs on top of TensorFlow

There are many high level APIs built on top of TensorFlow. Some of the most popular APIs included Keras, TFLearn, and Sonnet. These high-level APIs allow for faster experimentation -- you can call a complex neural network models in a few lines of code. The APIs have attracted a sizeable number of users. You should definitely check them out, and we might briefly go over these high-level APIs in class if time permits.

However, the primary purpose of TensorFlow is not to provide out-of-the-box machine learning solutions. Instead, TensorFlow provides an extensive suite of functions and classes that allow users to define models from scratch. This is more complicated, but offers much more flexibility. You can build almost any architecture you can think of in TensorFlow.

Resources

We won‘t be using any textbook for this class. The library is changing so fast that it‘s hard for any book to keep up. We will be using mainly lecture notes and lecture slides. There are several resources that you might want to refer to become fluent in TensorFlow.

The official documentations

TensorFlowofficial sample models

StackOverflow should be your first port of call should you run into any problem with TensorFlow

There are also several introductory books on TensorFlow.

  • Aurélien Géron‘s Hands-On Machine Learning with Scikit-Learn and TensorFlow (O‘Reilly, March 2017)
  • Fran?ois Chollet‘s Deep Learning with Python (Manning Publications, November 2017)
  • Nishant Shukla‘s Machine Learning with TensorFlow (Manning Publications, January 2018)
  • Lieder et al.‘s Learning TensorFlow A Guide to Building Deep Learning Systems (O‘Reilly, August 2017)

TensorFlow Basics

The first thing we need to understand about TensorFlow is its computation graph approach. Any TensorFlow program consists of two phases:

Phase 1: assemble a graph

Phase 2: use a session to execute operations in the graph.

Note that this might change in the future with TensorFlow‘s eager mode, currently experimental.

It‘s best to explain this with graphs. Please refer to the slides of the first lecture (fromslide24)to learn about TensorFlow‘s computation graph approach, tensors, subgraphs, and sessions.

原文地址:https://www.cnblogs.com/kexinxin/p/10162816.html

时间: 2024-10-07 21:31:54

Introduction to TensorFlow的相关文章

(zhuan) Building Convolutional Neural Networks with Tensorflow

Ahmet Taspinar Home About Contact Building Convolutional Neural Networks with Tensorflow Posted on augustus 15, 2017 adminPosted in convolutional neural networks, deep learning, tensorflow 1. Introduction In the past I have mostly written about 'clas

TensorFlow tutorial

代码示例来自https://github.com/aymericdamien/TensorFlow-Examples tensorflow先定义运算图,在run的时候才会进行真正的运算. run之前需要先建立一个session 常量用constant 如a = tf.constant(2) 变量用placeholder 需要指定类型 如a = tf.placeholder(tf.int16) 矩阵相乘 matrix1 = tf.constant([[3., 3.]]) #1*2矩阵 matrix

基础服务系列-Jupyter Install TensorFlow

TensorFlow is a deep learning framework that provides an easy interface to a variety of functionalities, required to perform state of the art deep learning tasks such as image recognition, text classification and so on. New Terminal pip3 --version In

【深度学习Deep Learning】资料大全

转载:http://www.cnblogs.com/charlotte77/p/5485438.html 最近在学深度学习相关的东西,在网上搜集到了一些不错的资料,现在汇总一下: Free Online Books Deep Learning66 by Yoshua Bengio, Ian Goodfellow and Aaron Courville Neural Networks and Deep Learning42 by Michael Nielsen Deep Learning27 by

[转]awesome-tensorflow-chinese

模型项目 Domain Transfer Network - Implementation of Unsupervised Cross-Domain Image Generation Show, Attend and Tell - Attention Based Image Caption Generator Neural Style Implementation of Neural Style Pretty Tensor - Pretty Tensor provides a high leve

(转)Image Segmentation with Tensorflow using CNNs and Conditional Random Fields

Daniil's blog Machine Learning and Computer Vision artisan. About/ Blog/ Image Segmentation with Tensorflow using CNNs and Conditional Random Fields Tensorflow and TF-Slim | Dec 18, 2016 A post showing how to perform Image Segmentation with a recentl

基于python语言的tensorflow的‘端到端’的字符型验证码识别源码整理(github源码分享)

基于python语言的tensorflow的‘端到端’的字符型验证码识别 1   Abstract 验证码(CAPTCHA)的诞生本身是为了自动区分 自然人 和 机器人 的一套公开方法, 但是近几年的人工智能技术的发展,传统的字符验证已经形同虚设. 所以,大家一方面研究和学习此代码时,另外一方面也要警惕自己的互联网系统的web安全问题. Keywords: 人工智能,Python,字符验证码,CAPTCHA,识别,tensorflow,CNN,深度学习 2   Introduction 全自动区

ubuntu14安装tensorflow并测试

1.ubuntu版本的选择:看了很多博文,建议使用ubuntu14,稳定兼容性好. 2.tensorflow的安装: http://wiki.jikexueyuan.com/project/tensorflow-zh/get_started/introduction.html 这里详细介绍了如何进行安装,本人是选择的第一个方法,成功安装完成. 后面打算尝试下docker进行安装tensorflow和caffe. 3.测试tensorflow安装是否成功: http://blog.csdn.net

TensorFlow学习路径【转】

作者:黄璞链接:https://www.zhihu.com/question/41667903/answer/109611087来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处. 前言:其实TensorFlow本身仅仅是一个分布式的高性能计算框架,想要用TF做深度学习,仅仅学习这个框架本身是没有太大意义的.因此应该将TF看作技术路线中的一个核心点,去掌握整个开发所需要的必要技术,知识.尤其是深度学习的基本原理,这对日后搭建模型,模型调参以至提出新的模型都是极其有用的.