locked
estimation of sigmoid RRS feed

  • Question

  • Hello everyone

    I have a regression problem. The sigmoid of weighted sum of input features generates the output.

    Since I could not apply EP with sigmoid, I tried to simulated it with a linear approximation (if weighted sum is in range [0,1] then the output is equal to weighted sum. If weightedSum > 1, then the output is 1 and if <0 the output is 0).

    That is because my output feature values is between 0 and 1.

    This is a feature selection problem in which I like to learn the weight vector for my input vector. The value of each input feature and output is observed. 

    Does it make sense to write it like this? 

    Variable<double> linearEffect =
                        Variable.Sum(weightSumArray).Named("sum_weightSumArray");
    
                    Variable<double> sigmoidEffect = Variable.New<double>();
    
                    Variable<bool> sigmoidCondition = (Variable.IsBetween(linearEffect,0,1)).Named("isNodePerturbed?");
                    using (Variable.If(sigmoidCondition))
                    {
                        outputData[experimentRange].SetTo(Variable<double>.GaussianFromMeanAndPrecision(linearEffect, timeDependentNoise).Named("timeSeries_noPert"));
                    }
                    using (Variable.IfNot(sigmoidCondition))
                    {
                        Variable<bool> isGreaterThanOne = (linearEffect > 1).Named("isGreaterThanOne");
                        using (Variable.If(isGreaterThanOne)) {
                            outputData[experimentRange].SetTo(Variable<double>.GaussianFromMeanAndPrecision(1, timeDependentNoise));
                        }
                        using (Variable.IfNot(isGreaterThanOne)) {
                            outputData[experimentRange].SetTo(Variable<double>.GaussianFromMeanAndPrecision(0, timeDependentNoise));
                        }
                    }

    Sunday, February 7, 2016 11:31 AM

Answers

  • Looks correct to me, although sigmoidEffect is unused.
    • Marked as answer by RazinR Sunday, February 7, 2016 1:25 PM
    Sunday, February 7, 2016 12:59 PM
    Owner

All replies

  • Looks correct to me, although sigmoidEffect is unused.
    • Marked as answer by RazinR Sunday, February 7, 2016 1:25 PM
    Sunday, February 7, 2016 12:59 PM
    Owner
  • Thank you.

    Yes. I meant to use it in case sigmoidCondition is true.

    Sunday, February 7, 2016 1:25 PM