# How to impose a constrained function on multiple output of a model with NeuralNet? [closed]

I work with R software, and I train a model with NeuralNet to predict several outputs.

My training data : it's a matrix with these column a,b,c,d,e,f,g,h.

(f,g,h) are my variables i want to predict.

Here is the formula of model : f+g+h ~ a+b+c+d+e

f,g and h are part of a composition having a sum of 1 or 100 in training data. But when my model predicts my multioutputs it is not a sum of 1.

My question is : how to impose on the model that my Multioutputs are a sum of 1 or 100 ? Is there a constraint function with neuralNet ?

Thank you very much for your help. :)

• You might do better on one of the R mailing lists. – mdewey May 11 '20 at 16:20
• The softmax function is constrained to sum to 1. Hence, $100 \times \text{softmax}(x)$ is constrained to sum to 100. But asking how to get software to do this is not an on-topic question here. – Sycorax May 13 '20 at 16:56
• Thank's. I'm new to machine learning, so, sorry if my question is not appropriate. I thought I understood that the Softmax functions is only for classification problem... My data is only numeric variables in my model. – Ziax May 13 '20 at 20:31