对于 pytorch RNN 模型,我们可以通过它的输出结果来推断输入吗?

乘风 pytorch 215

原文标题For pytorch RNN model, can we inference the input by its output results?

全部,

我想知道,torch.nn.rnn(~)。如果我知道最终的输出,是否有可能,我可以推断出它的输入值?例如:

myrnn = nn.RNN(4, 2, 1, batch_first=True)
expected_out, hidden = myrnn(input)
expected_out:  tensor([[[-0.7773, -0.2031]],

    [[-0.4129, -0.1802]],

    [[ 0.0599, -0.0151]],

    [[-0.9273,  0.2683]],

    [[ 0.6161,  0.5412]]])

谢谢你!

原文链接:https://stackoverflow.com//questions/71538973/for-pytorch-rnn-model-can-we-inference-the-input-by-its-output-results

回复

我来回复
  • Paul_0的头像
    Paul_0 评论

    你问的是理论上不可能的

    神经网络通常表示无法逆向的函数,因为无论底层架构如何,它们都不能保证是单射的。

    这意味着 rnn 和任何其他神经网络都不是可逆的。

    2年前 0条评论