tensorflow
LAUSpectrum
这个作者很懒,什么都没留下…
展开
-
TensorFlow初尝试:CNN for Text Classification
1. Graph and Session in TensorFlow import tensorflow as tf # create a graph, and define a constant in it with tf.Graph().as_default() as g: c = tf.constant(1.0) # define a tensor in the default gra...原创 2019-03-20 20:54:51 · 457 阅读 · 0 评论 -
tensorflow模块化编写神经网络
1. define a model class LSTM(Object): def __init__(self, config): # input attributes as a dictionary # 给成员变量赋值 self.attribute = config["attribute"] pass # set placeholde...原创 2019-03-21 22:59:30 · 538 阅读 · 0 评论 -
TensorFlow: Built Graph
1. loss function tf.nn.sparse_softmax_cross_entropy_with_logits( labels=None, logits=None ) tf.nn.softmax_cross_entropy_with_logits( labels=None, logits=None ) 这两个函数只有输入的labels有区别,前...原创 2019-03-23 14:25:35 · 346 阅读 · 0 评论 -
Construct a Seq2Seq Model with Attention Mechanism
Construct a Seq2Seq Model with Attention Mechanism 1. 创建一个seq2seq类 class Seq2seq(object): def __init__(self, config): self.attribute = config["attribute"] pass 对于seq2seq模型,此处的主要参数有: size of vo...原创 2019-03-23 22:59:56 · 519 阅读 · 0 评论