zoukankan      html  css  js  c++  java
  • 深度学习Keras框架笔记之Dense类(标准的一维全连接层)

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

      例:    

    keras.layers.core.Dense(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)  
    

      

    inputshape: 2维 tensor(nb_samples, input_dim)

           outputshape: 2维 tensor(nb_samples, output_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:输入数据的维度。这个参数会在模型的第一层中用到。 
  • 相关阅读:
    51nod 1380 夹克老爷的逢三抽一 堆 脑洞题
    洛谷P2168 荷马史诗 堆 哈夫曼树
    HDU 4343 Interval query 倍增思想, DP
    洛谷P1969 积木大赛 贪心 差分
    codves1052 地鼠游戏 贪心
    hdu6031 Innumerable Ancestors
    Codeforces 278C Learning Languages(并查集) 求连通块
    [LeetCode]80. Remove Duplicates from Sorted Array II删除数组中的重复值
    [LeetCode]86. Partition List分离链表
    [LeetCode]42. Trapping Rain Water雨水填坑
  • 原文地址:https://www.cnblogs.com/68xi/p/8590722.html
Copyright © 2011-2022 走看看