tensorflow
文章平均质量分 70
Apollo2Mars
坚持做自己喜欢的事!一直做下去!
展开
-
Tensorflow tensor transform API
embedding_lookup(params, ids)其实就是按照ids顺序返回params中的第ids行。 比如说,ids=[1,3,2],就是返回params中第1,3,2行。返回结果为由params的1,3,2行组成的tensor.===============================================================================转载 2017-09-11 19:38:46 · 564 阅读 · 0 评论 -
Tensorflow API - Variables 变量
TensorFlow用张量这种数据结构来表示所有的数据。 用一阶张量来表示向量,如:v = [1.2, 2.3, 3.5] 如二阶张量表示矩阵,如:m = [[1, 2, 3], [4, 5, 6], [7, 8, 9]],可以看成是方括号嵌套的层数。1、编辑器anaconda自带不错的编辑器,名叫spyder,用起来和matlab差不多,还可以在右上角查看变量的值。 启动方式:终端输入spyde原创 2017-09-10 10:36:35 · 277 阅读 · 0 评论 -
Tensorflow VocabularyProcessor API
Function Interface:tf.contrib.learn.preprocessing.VocabularyProcessor (max_document_length, min_frequency=0, vocabulary=None, tokenizer_fn=None)参数:max_document_length: 文档的最大长度。如果文本的长度大于最大长度,那么它会被剪切,反之则原创 2017-09-18 23:28:20 · 4755 阅读 · 0 评论 -
Tensorflow truncated_normal API
tf.truncated_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None)Outputs random values from a truncated normal distribution. 从一个正态分布片段中输出随机数值The generated values follow a normal原创 2017-09-10 11:17:39 · 619 阅读 · 0 评论 -
Tensorflow NN.conv2d API
tf.nn.conv2d是TensorFlow里面实现卷积的函数,参考文档对它的介绍并不是很详细,实际上这是搭建卷积神经网络比较核心的一个方法,非常重要tf.nn.conv2d(input, filter, strides, padding, use_cudnn_on_gpu=None, name=None)除去name参数用以指定该操作的name,与方法有关的一共五个参数: 第一个参数input转载 2017-09-10 10:59:50 · 253 阅读 · 0 评论 -
Train TF models in Python and Invoke models in Java
Plan A #Train in Python import tensorflow as tf # good idea # https://stackoverflow.com/documentation/tensorflow/10718/save-tensorflow-model-in-python-and-load-with-java#t=201709030336395954421 tf.re原创 2017-09-10 10:00:56 · 2130 阅读 · 0 评论 -
Tensorflow 模型持久化 Model Persistence
Methods of tf model persistence 如果我们的神经网络比较复杂,训练数据比较多,那么我们的模型训练就会耗时很长,如果在训练过程中出现某些不可预计的错误,导致我们的训练意外终止,那么我们将会前功尽弃。为了避免这个问题,我们就可以通过模型持久化(保存为CKPT格式)来暂存我们训练过程中的临时数据。 如果我们训练的模型需要提供给用户做离线的预测,那么我们只需要前向传播的过程原创 2017-09-10 11:04:15 · 1527 阅读 · 1 评论