TensorFlow

Getting Started With TensorFlow
TensorFlow provides multiple APIs.
TensorFlow Core
tf.contrib.learn

Tensors
A tensor consists of a set of primitive values shaped into an array of any number of dimensions.
Tensor's rank

TensorFlow Core programs consist of two discrete sections:
1,Building the computational graph
2,Running the computational graph

The Computational Graph
it is a series of TensorFlow operations arranged into a graph of nodes.

Graph Node
Each node takes zero or more tensors as inputs and produces a tensor as an output.

Session
A session encapsulates the control and state of the Tensorflow runtime.

TensorBoard
display a picture of the computational graph.

Placeholders
A placeholder is a promise to provide a value later.

Variables
add trainable parameters to a graph.

To initialize all the variables in a TensorFlow program, you must explicitly call a special operation as follows:
    init = tf.global_variables_initializer()
    sess.run(init)

Loss function
measures how far apart the current model is from the provided data.

tf.train API
Tensorflow provides optimizers that slowly change each variable in order to minimize the loss function.

In general, computing symbolic derivatives manually is tedious and error-prone. Consequently, TensorFlow can automativally produce derivatives given only a description of the model using the function tf.gradients.

optimizer=tf.train.GradientDescentOptimizer(0.01)
train=optimizer.minimize(loss);

gradient descent
It modifies each variable according to the magnitude of the derivative of loss with respect to that variable.

tf.contrib.learn
including:
running training loops
running evaluation loops
managing data sets
managing feeding
estimators:
linear regression
logistic regression
linear classification
logistic classification
neural network classifiers and regressors

A custom model
LinearRegressor is actually a sub-class of tf.contrib.learn.Estimator.

tf.contrib.learn Quickstart

Building Input Functions with tf.contrib.learn
Custom Input Pipelines with input_fn
It's possible to pass your feature and target data directly into your fit, evaluate, or predict operations.

TensorBoard: Visualizing Learning
TensorBoard operates by reading TensorFlow events files, which contain summary data that you can generate when running TensorFlow.

tf.summary.scalar & tf.summary.histogram

The summary nodes are peripheral to your graph

Use tf.summary.mergy_all to combine them into a single op that generates all the summary data.

tf.summary.FileWriter

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 如果你要做一件事,请不要炫耀,也不要宣扬,只管安安静静的去做。因为那是你自己的事,别人不知道你的情况,也不可能帮你...
    hessle阅读 3,690评论 0 0
  • 父母可能婚姻不幸福,工作不理想,即使有一大堆缺点也不要紧,孩子并不需要完美的父母。只要父母能管住自己,不试图去教育...
    小萍_阅读 906评论 0 0
  • 这个Keynote是我去年制作的,也是我要编写的《交易之路》电子书的大纲。由于涉及的知识点很多,所以每块领域只是一...
    improve365阅读 3,068评论 0 5
  • 跟老顾聊天 吐槽经常出差只记得各个不同地方的医院车站饭店酒店 他说:那你就记下来,给我看啊 真是个不错的想法´・ᴗ...
    September2_bBy阅读 1,355评论 0 0
  • 还记得那夜的风吗 有些冷 但吹的心又热情啊 还记得初见的我吗 个子小小马尾扎的很高 一蹦一跳藏不住的欣喜 你会记得...
    四季和远方火锅和理想阅读 3,446评论 1 4

友情链接更多精彩内容