I tried writing an autoencoder that does what I’m looking for. Does it match up with the picture I posted? Also, is there any way to parallelize the for loops?
class Model(nn.Module):
    def __init__(self, layer_size):
        super(Model, self).__init__()
        self.layer_size = layer_size
        self.relu = nn.ReLU()

        self.contract = nn.Linear(3, 1)
        self.fc1 = nn.Linear(layer_size, 100)
        self.fc2 = nn.Linear(100, layer_size)
        self.expand = nn.Linear(1, 3)

    def forward(self, x):
        # x.shape (batch_size, layer_size, 3)
        outs = []
        for i in range(self.layer_size):
            outs.append(self.relu(self.contract(x[:, i, :])))
        x = torch.cat(outs, dim=1)

        x = self.relu(self.fc1(x))
        x = self.relu(self.fc2(x))

        outs = []
        for i in range(self.layer_size):
            outs.append(self.relu(self.expand(x[:, [i]])))
        x = torch.stack(outs, dim=1)

        return x