[Python] Is Relu includes linear computation in TensorFlow?

Discussão em 'Python' iniciado por Stack, Maio 31, 2025.

  1. Stack

    Stack Membro Participativo

    In Tensorflow:

    "model = Sequential([
    Flatten(input_shape=(28, 28)),
    Dense(128, activation='relu'),
    Dense(64, activation='relu'),
    Dense(10, activation='softmax')


    ])

    In pytorch:

    "self.l1 = nn.Linear(784, 128)
    self.relu = nn.ReLU()
    self.l2 = nn.Linear(128, 64)
    self.relu2 = nn.ReLU()
    self.output = nn.Linear(64, 10)"


    Why are we applying the nn.Linear in Pytorch but not in Tensorflow?

    Continue reading...

Compartilhe esta Página