相关基类
https://www.tensorflow.org/api_docs/python/tf/keras/
tf.keras下的类之间的关系
tf.Module
tf.keras.layers.Layer
tf.keras.Input
tf.keras.Model
tf.keras.Model和tf.keras.Sequential都是创建Model的方法
Model的核心方法: compile, fit, evaluate, predict等
compile参数,
关注下metrics
实时监控学习率 (【Keras】自定义学习率更新策略和实时监控学习率变化_heiheiya的博客-CSDN博客)
要实现实时监控学习率变化,定义这样一个函数:
def get_lr_metric(optimizer):
def lr(y_true, y_pred):
return optimizer.lr
return lr
然后在model.compile的时候加入到metrics规则。
opt = SGD(lr=lr, decay=0)
lr_metric = get_lr_metric(opt)
model.compile(optimizer=opt,
loss='categorical_crossentropy',
metrics=['accuracy', lr_metric])
这样在训练的时候,就可以实时的观察到当前的学习率了。
fit 参数
callbacks 关注下ReduceLROnPlateau
Keras的回调函数ReduceLROnPlateau 训练过程优化学习率_小龙蜀黍的博客-CSDN博客_reducelronplateau
cnn history
主要的算子是Conv2D
CNN的使用历史
Lenet
alexnet
构建网络的方法
Temporal Convolutional Networks
Temporal Convolutional Networks and Forecasting | Unit8 Blog
因果卷积,从名字上很高级,其实就是说结果之和当前和历史数据有关,和未来信息无关(之前,当前,未来,说的都是时间相关的输入case),相关说的就是链接
如上图,layer从下往上编号 (1, 2, 3, 4), (1, 2, 3)层的形状是一样的且kernel size = 3, 因为padding 了2个0,这样就决定了链接关系,也就形成了 因果卷积
看2, 3层间的链接, kernel size还是3 但dilation rate是2, 中间有个element 没有链接,这个现象称为 扩张,这对应扩张卷积或空洞卷积
Temporal Convolution for Real-time Keyword Spotting on Mobile Devices
TCN 在Keyword spotting上的应用