python -keras

Numpy

1. np. shape

 np.reshape

np.prod()

astype()

dtype()

From keras.layers import Input

Input():用来实例化一个keras张量

keras张量是来自底层后端(Theano或Tensorflow)的张量对象,我们增加了某些属性,使我们通过知道模型的输入和输出来构建keras模型。

Input(shape=None,batch_shape=None,name=None,dtype=K.floatx(),sparse=False,tensor=None)

shape: 形状元组(整型),不包括batch size。for instance, shape=(32,) 表示了预期的输入将是一批32维的向量。

batch_shape: 形状元组(整型),包括了batch size。for instance, batch_shape=(10,32)表示了预期的输入将是10个32维向量的批次。

name: 对于该层是可选的名字字符串。在一个模型中是独一无二的(同一个名字不能复用2次)。如果name没有被特指将会自动生成。

dtype: 预期的输入数据类型

sparse: 特定的布尔值,占位符是否为sparse

tensor: 可选的存在的向量包装到Input层,如果设置了,该层将不会创建一个占位张量。

#返回

一个张量

example:

--------------------- 本文来自 i朱友谦 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/zfh19941994/article/details/79259815?utm_source=copy

Dense ( units, activation=None, use_bias=True, kernel_initializer='glorot_uniform', bias_initializer='zeros', kernel_regularizer=None, bias_regularizer=None, activity_regularizer=None, kernel_constraint=None, bias_constraint=None  ) --------------------- 本文来自 王不二不二不二 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/u012969412/article/details/70882296?utm_source=copy

猜你喜欢

转载自www.cnblogs.com/lyyao/p/9708220.html
今日推荐