张量流中cudnnlstm的默认激活功能是什么 [英] What is the default activation function of cudnnlstm in tensorflow

查看:236
本文介绍了张量流中cudnnlstm的默认激活功能是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TensorFlow中 cudnnlstm 的默认激活功能是什么?如何设置激活功能,例如 relu ?也许只是线性模型?我看了文档,但没有找到。

What's the default activation function of cudnnlstm in TensorFlow? How can I set an activation function such as relu? Maybe it's just linear model? I read the document, but I did not find it.

例如,代码如下:

lstmcell=tf.contrib.cudnn_rnn.CudnnLSTM(1,encoder_size,direction="bidirectional")

hq,_ =lstmcell(query)

然后我阅读了TensorFlow的文档通过此链接

And I read the document of TensorFlow From this link.

该函数位于下面

__init__(

    num_layers,
    num_units,
    input_mode=CUDNN_INPUT_LINEAR_MODE,
    direction=CUDNN_RNN_UNIDIRECTION,
    dropout=0.0,
    seed=None,
    dtype=tf.float32,
    kernel_initializer=None,
    bias_initializer=None,
    name=None
)

并且没有关键字来设置参数,例如激活= tanh 就像 tf.nn.rnn_cell.LSTMell

And no keyword to set a parameter such as "activation = "tanh" just like tf.nn.rnn_cell.LSTMell.

所以在TensorFlow中是 cudnnlstm 的默认激活功能,以及如何将其更改为 leaky_relu

So what's the default activation function of cudnnlstm in TensorFlow, and how to change it to leaky_relu.

推荐答案

要回答稍后编辑的OP的第二个问题,有当前无法为CudnnLSTM和CudnnGRU设置自定义激活功能

To answer OP's 2nd question which was edited in later, there is currently no way to set a custom activation function for CudnnLSTM and CudnnGRU.

这篇关于张量流中cudnnlstm的默认激活功能是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆