Your first neural network
It's time for you to implement a small neural network containing two linear layers in sequence.
Bu egzersiz
Introduction to Deep Learning with PyTorch
kursunun bir parçasıdırEgzersiz talimatları
- Add a container for stacking layers in sequence.
Uygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
import torch
import torch.nn as nn
input_tensor = torch.Tensor([[2, 3, 6, 7, 9, 3, 2, 1]])
# Create a container for stacking linear layers
model = nn.____(nn.Linear(8, 4),
nn.Linear(4, 1)
)
output = model(input_tensor)
print(output)