内容
如此处所述,通过层归一化扩展标准keras LSTM和GRU层。
用法示例
这些图层可以像普通图层一样容易使用:
from LayerNormalizationRNN import LSTM , GRU
inputs = Input ( shape = ( maxlen ,))
x = Embedding ( max_features , 128 )( inputs )
x = LSTM ( 64 , layer_to_normalize = ( "input" , "output" , "recurrent" ), normalize_seperately = True )( x )
# x = GRU(64, layer_to_normalize=("input_gate", "input_recurrent", "recurrent_gate", "recurrent_rec
2022-06-10 16:30:10
63KB
Python
1