内容 如此处所述,通过层归一化扩展标准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
# 代码功能: LS_TM循环网络,实现古诗生成---------------------------------------------- # Example # input: 仲月当南吕, # output: 仲月当南吕,殿荷陂染日。半阳对余重,古吟飘山终。 # 第1步: 古诗数据集处理: 去标题、消除生僻字、取序列 # 第2步: LS_TM 网络训练 # 第3步: 古诗生成,文本预测
1