How do I write a sequential model in PyTorch, just like what we can do with Keras? I tried:
import torch
import torch.nn as nn
net = nn.Sequential()
net.add(nn.Linear(3, 4))
net.add(nn.Sigmoid())
net.add(nn.Linear(4, 1))
net.add(nn.Sigmoid())
net.float()
But I get the error:
AttributeError: 'Sequential' object has no attribute 'add'
As described by the correct answer, this is what it would look as a sequence of arguments: