From regression to multi-class classification
The models you have seen for binary classification, multi-class classification and regression have all been similar, barring a few tweaks to the model.
Start building a model for regression, and then tweak the model to perform a multi-class classification.
Latihan ini adalah bagian dari kursus
Introduction to Deep Learning with PyTorch
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
import torch
import torch.nn as nn
input_tensor = torch.Tensor([[3, 4, 6, 7, 10, 12, 2, 3, 6, 8, 9]])
# Implement a neural network with exactly four linear layers
model = nn.____(
____
)
output = model(input_tensor)
print(output)