neobundy / Deep-Dive-Into-AI-With-MLX-PyTorch

"Deep Dive into AI with MLX and PyTorch" is an educational initiative designed to help anyone interested in AI, specifically in machine learning and deep learning, using Apple's MLX and Meta's PyTorch frameworks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doubled text in code snippet

ncarandini opened this issue · comments

On chapter 1 | object-oriented Approach the code snippet has duplicated code:
The code

# Define the model as a class
class NeuralNet(nn.Module):
    def __init__(self):
        super(NeuralNet, self).__init__()
        self.layer1 = nn.Linear(10, 20)
        self.layer2 = nn.Linear(20, 2)

    def forward(self, x):
        x = F.relu(self.layer1(x))
        x = self.layer2(x)
        return x

# Instantiate the model
model = NeuralNet()

# Generate some random data
input_data = torch.randn(1, 10)

# Forward pass
output = model(input_data)
print(output)

is repeated two times.

fixed. thanks 👍