ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Keras API 新旧对照表

2022-01-27 18:35:29  阅读:68  来源: 互联网

标签:kernel consume regularizer less dropout recurrent 对照表 API Keras


UserWarning: Update your `LSTM` call to the Keras 2 API: `LSTM(128, name="LSTMSpectral", kernel_regularizer=<keras.reg..., recurrent_regularizer=<keras.reg..., implementation=2)`
LSTM(128,name='LSTMSpectral',consume_less='gpu',W_regularizer=l2(0.0001),U_regularizer=l2(0.0001))(LSTMInput)

开始有些不明所以然,查了下面的表,OK。 

legacy_recurrent_support = generate_legacy_interface(
    allowed_positional_args=['units'],
    conversions=[('output_dim', 'units'),
                 ('init', 'kernel_initializer'),
                 ('inner_init', 'recurrent_initializer'),
                 ('inner_activation', 'recurrent_activation'),
                 ('W_regularizer', 'kernel_regularizer'),
                 ('b_regularizer', 'bias_regularizer'),
                 ('U_regularizer', 'recurrent_regularizer'),
                 ('dropout_W', 'dropout'),
                 ('dropout_U', 'recurrent_dropout'),
                 ('consume_less', 'implementation')],
    value_conversions={'consume_less': {'cpu': 0,
                                        'mem': 1,
                                        'gpu': 2}},
    preprocessor=recurrent_args_preprocessor)

标签:kernel,consume,regularizer,less,dropout,recurrent,对照表,API,Keras
来源: https://blog.csdn.net/mikewzp/article/details/122721816

专注分享技术,共同学习,共同进步。侵权联系[admin#icode9.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有