PyTorch Notes
PyTorch Notes
PyTorch is an open-source deep learning framework known for its dynamic computation graphs
and easy debugging.
Key Features:
import torch
import torch.nn as nn
class SimpleNN(nn.Module):
def __init__(self):
super(SimpleNN, self).__init__()
self.fc2 = nn.Linear(64, 1)
x = torch.relu(self.fc1(x))
return torch.sigmoid(self.fc2(x))
# Model initialization
model = SimpleNN()
criterion = nn.BCELoss()
print(model)