For example a simple y = AX linear layer, I would like the weights X to sum to 1 at most and > 0 for each individual weight, any idea what’s the ideal way to do this?
y = 0.1 x_1 + 0.5 x_2 + 0.4 x_3
class simple_fnn(nn.Module):
    def __init__(self, num_hidden_units=1):
        super(simple_fnn, self).__init__()
        self.num_hidden_units = num_hidden_units

        self.fc_single = nn.Linear(6, self.num_hidden_units, bias=False)

    def forward(self, x):
        x = self.fc_single(x)

        return x