深度学习Keras框架笔记之TimeDistributedDense类使用方法笔记

例:

keras.layers.core.TimeDistributedDense(output_dim,init='glorot_uniform', activation='linear', weights=None
W_regularizer=None, b_regularizer=None, activity_regularizer=None, W_constraint=None, b_constraint=None,
input_dim=None, input_length=None)   

这是一个基于时间维度的全连接层。主要就是用来构建RNN(递归神经网络)的,但是在构建RNN时需要设置return_sequences=True。

inputshape: 3维 tensor(nb_samples, timesteps,input_dim)

参数:

  • output_dim: int >= 0,输出结果的维度
  • init : 初始化权值的函数名称或Theano function。可以使用Keras内置的,也可以传递自己编写的Theano function。如果不给weights传递参数时,则该参数必须指明。
  • activation : 激活函数名称或者Theano function。可以使用Keras内置的,也可以是传递自己编写的Theano function。如果不明确指定,那么将没有激活函数会被应用。
  • weights :用于初始化权值的numpy arrays组成的list。这个List至少有1个元素,其shape为(input_dim, output_dim)。(如果指定init了,那么weights可以赋值None)
  • W_regularizer:权值的规则化项,必须传入一个WeightRegularizer的实例(比如L1或L2规则化项)。
  • b_regularizer:偏置值的规则化项,必须传入一个WeightRegularizer的实例(比如L1或L2规则化项)。
  • activity_regularizer:网络输出的规则化项,必须传入一个ActivityRegularizer的实例。
  • W_constraint:权值约束,必须传入一个constraints的实例。
  • b_constraint:偏置约束,必须传入一个constraints的实例。
  • input_dim:输入数据的维度。这个参数会在模型的第一层中用到。
  • input_length:Length of input sequences, whenit is constant. This argument is required if you are going to connect Flattenthen Dense layers upstream (without it, the shape of the dense outputs cannotbe computed).
  • 例如:
  • # input shape: (nb_samples, timesteps,10)
    model.add(LSTM(5, return_sequences=True, input_dim=10)) # output shape: (nb_samples, timesteps, 5)
    model.add(TimeDistributedDense(15)) # output shape:(nb_samples, timesteps, 15)

      

深度学习Keras框架笔记之TimeDistributedDense类的更多相关文章

  1. 深度学习Keras框架笔记之AutoEncoder类

    深度学习Keras框架笔记之AutoEncoder类使用笔记 keras.layers.core.AutoEncoder(encoder, decoder,output_reconstruction= ...

  2. 深度学习Keras框架笔记之Dense类(标准的一维全连接层)

    深度学习Keras框架笔记之Dense类(标准的一维全连接层) 例: keras.layers.core.Dense(output_dim,init='glorot_uniform', activat ...

  3. 深度学习Keras框架笔记之Activation类使用

    使用 keras.layers.core.Activation(activation) Apply an activation function tothe input.(貌似是把激活函数应用到输入数 ...

  4. 深度学习Keras框架笔记之激活函数详解

    激活函数也是神经网络中一个很重的部分.每一层的网络输出都要经过激活函数.比较常用的有linear,sigmoid,tanh,softmax等.Keras内置提供了很全的激活函数,包括像LeakyReL ...

  5. 深度学习Keras框架笔记之核心层基类

    Keras的Layers,就是构成网络的每一层.Keras实现了很多层,包括核心层.卷基层.RNN网络层等诸多常用的网络结构.下面开介绍核心层中包含了哪些内容.因为这个核心层我现在还没有全部用到,所以 ...

  6. 从Theano到Lasagne:基于Python的深度学习的框架和库

    从Theano到Lasagne:基于Python的深度学习的框架和库 摘要:最近,深度神经网络以“Deep Dreams”形式在网站中如雨后春笋般出现,或是像谷歌研究原创论文中描述的那样:Incept ...

  7. 人工智能范畴及深度学习主流框架,IBM Watson认知计算领域IntelligentBehavior介绍

    人工智能范畴及深度学习主流框架,IBM Watson认知计算领域IntelligentBehavior介绍 工业机器人,家用机器人这些只是人工智能的一个细分应用而已.图像识别,语音识别,推荐算法,NL ...

  8. 人工智能深度学习Caffe框架介绍,优秀的深度学习架构

    人工智能深度学习Caffe框架介绍,优秀的深度学习架构 在深度学习领域,Caffe框架是人们无法绕过的一座山.这不仅是因为它无论在结构.性能上,还是在代码质量上,都称得上一款十分出色的开源框架.更重要 ...

  9. 人工智能范畴及深度学习主流框架,谷歌 TensorFlow,IBM Watson认知计算领域IntelligentBehavior介绍

    人工智能范畴及深度学习主流框架,谷歌 TensorFlow,IBM Watson认知计算领域IntelligentBehavior介绍 ================================ ...

随机推荐

  1. InvokeMember 使用(转http://blog.csdn.net/gooer/article/details/2927113)

    函数原型:       public   object   InvokeMember(string,   BindingFlags,   Binder,   object,   object[]); ...

  2. MATLAB自定义函数

    MATLAB自定义函数形式 function [a,b,c] = funname(x1,x2,x3) 输入变量 对于输入变量,MATLAB可以识别输入变量的个数,通过nargin来记录当前输入变量个数 ...

  3. logback--日志在windows上可以打印,在linux上不能打印的问题

    解决问题方法: 本人遇到的问题,属于jar包冲突问题.本人加入的jar包如下: slf4j-api-1.7.5.jar slf4j-log4j12-1.7.5.jar logback-core-1.0 ...

  4. cookielib模块 for python3

    python2 可以直接安装cookielib模块 而py3却不能安装 故需要安装http模块 举例子: from http import cookiejar cookie = cookiejar.C ...

  5. powerful number求积性函数前缀和

    算法原理 本文参考了 zzq's blog . \(\text{powerful number}\) 的定义是每个质因子次数都 \(\ge 2\) 的数,有个结论是 \(\ge n\) 的 \(\te ...

  6. 3.matplotlib绘制条形图

    plt.bar() # coding=utf-8 from matplotlib import pyplot as plt from matplotlib import font_manager my ...

  7. Jquery+CSS实现遮罩效果

    JavaScript: (function ($) { $.fn.ShowMask = function (options) { var defaults = { top: 150, left: 20 ...

  8. linux 安装Python3.6

    1.安装依赖 yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel ...

  9. Tensorflow在python3.7版本的运行

    安装tensorflow pip install tensorflow==1.13.1 -i https://pypi.tuna.tsinghua.edu.cn/simple 可以在命令行 或者在py ...

  10. mysql-表关系介绍(应用较多)

    目录 表之间的关系(重点) foreign key (外键) 级联操作 (cascade) 两种级联操作 外键的使用 多对一(一对多) 多对多 一对一关系 表之间的关系(重点) foreign key ...