import torch from torch import nn torch.manual_seed(23) model = nn.Sequential( nn.Linear(4, 6), nn.ReLU(), nn.Linear(6, 2), ) inputs = torch.tensor( [ [0.5, -1.0, 0.3, 2.0], [1.0, 0.2, -0.4, 0.7], [-0.3, 1.2, 0.8, -1.1], [1.5, -0.7, 0.1, 0.4], ], dtype=torch.float32, ) targets = torch.tensor([0, 1, 1, 0])