时间卷积网络(tcn)
tcn Python代码,仅供参考,如有侵权请联系,立即删除。
tcn函数源码
from typing import List, Tuple
import keras.backend as K import keras.layers from keras import optimizers from keras.engine.topology import Layer from keras.layers import Activation, Lambda from keras.layers import Conv1D, SpatialDropout1D from keras.layers import Convolution1D, Dense, BatchNormalization from keras.models import Input, Model
def residual_block(x, dilation_rate, nb_filters, kernel_size, padding, activation=‘relu’, dropout_rate=0, use_batch_norm=False): # type: (Layer, int, int, int, str, str, float, bool) -> Tuple[Layer, Layer]
prev_x = x
for k in range(2):
x = Conv1D(filters=nb_filters,
kernel_size=kernel_size,
dilation_rate=dilation_rate,
|