理解一个神经网络等价张量N

2024-05-14 07:18:50 发布

您现在位置:Python中文网/ 问答频道 /正文

在googlex的教程Colab笔记本(https://github.com/google/TensorNetwork)中,它有:

    # Now we create the network.
    a = tn.Node(a_var)
    b = tn.Node(b_var)
    x_node = tn.Node(input_vec)
    a[1] ^ x_node[0]
    b[1] ^ x_node[1]
    a[2] ^ b[2]

    # The TN should now look like this
    #   |     |
    #   a --- b
    #    \   /
    #      x

替换以下内容中的一行(不是两行):

Dense(64, activation=tf.nn.swish)

声称:

These two models are effectively the same

1.为什么有相同的?
2.为什么下面是错的?

我的理解是:

x_node[0] ^ a[0] ^ b[0]

(用ab替换Dense(64, activation=tf.nn.swish)的两行


Tags: thehttpsnodevartf笔记本教程nn

热门问题