• Keras学习笔记。


    1. keras.layers.Dense

    (Fully Connected Neural NetWork),所实现的运算是output = activation(dot(input, kernel)+bias)

    keras.layers.Dense(units,               // 该层的neuron的个数
               activation=None,          // 该层的激活函数。如果不指定该参数,将不会使用任何激活函数(即使用线性激活函数:a(x)=x)
               use_bias=True,            // 是否添加偏置项
               kernel_initializer='glorot_uniform',    // 权重初始化方法
               bias_initializer='zeros',         // 偏置值初始化方法
               kernel_regularizer=None,         // 权重正则化方化
               bias_regularizer=None,          // 偏置值正则化方法
               activity_regularizer=None,      // Output的正则化方法
               kernel_constraint=None,         // 权重变化限制函数
               bias_constraint=None)         // 偏置值变化限制函数

    除了input layer须指定input_dim之外,所有hidden layer和ouput layer的input_dim默认都是上一层的output_dim。

    在keras中,数据是以张量的形式表示的,张量的形状称之为shape,表示从最外层向量逐步到达最底层向量的降维解包过程。比如,一个一阶的张量[1,2,3]的shape是(3,);一个二阶的张量[[1,2,3],[4,5,6]]的shape是(2,3);一个三阶的张量[[[1],[2],[3]],[[4],[5],[6]]]的shape是(2,3,1)。

    input_shape就是指输入张量的shape。例如,input_dim=784,说明输入是一个784维的向量,这相当于一个一阶的张量,它的shape就是(784,)。因此,input_shape=(784,)。

    input_dim = input_shape(input_dim,)

    input_dim, input_length = input_shape(input_length, input_dim)

    REFERENCE:

    https://blog.csdn.net/weixin_42499236/article/details/84624195

    https://blog.csdn.net/gjq246/article/details/72638343/

    https://blog.csdn.net/x_ym/article/details/77728732

    https://www.cnblogs.com/yqtm/p/6924939.html

  • 相关阅读:
    添加egit插件
    Git使用教程
    mysql set names 命令和 mysql字符编码问题
    git常用命令
    前端WEB编辑器-------webstrom
    maven 常见错误解决方法
    java -jar 执行 eclipse export 的 jar 包报错处理
    数据库(DBUtils)
    数据库(JDBC、DBUtils)
    rabbitmq Exchange四种模式
  • 原文地址:https://www.cnblogs.com/boceng/p/10502562.html
Copyright © 2020-2023  润新知