Exemplo n.º 1
0
 /// <summary>Computations that depend on the observed value of FeatureIndexes and FeatureValues and InstanceCount and InstanceFeatureCounts and WeightConstraints and WeightPriors</summary>
 private void Changed_FeatureIndexes_FeatureValues_InstanceCount_InstanceFeatureCounts_WeightConstraints_WeightPri6()
 {
     if (this.Changed_FeatureIndexes_FeatureValues_InstanceCount_InstanceFeatureCounts_WeightConstraints_WeightPri6_isDone)
     {
         return;
     }
     for (int InstanceRange = 0; InstanceRange < this.InstanceCount; InstanceRange++)
     {
         for (int InstanceFeatureRanges = 0; InstanceFeatureRanges < this.InstanceFeatureCounts[InstanceRange]; InstanceFeatureRanges++)
         {
             this.FeatureScores_F[InstanceRange][InstanceFeatureRanges] = GaussianProductOpBase.ProductAverageConditional(this.FeatureValues[InstanceRange][InstanceFeatureRanges], this.Weights_FeatureIndexes_F[InstanceRange][InstanceFeatureRanges]);
         }
         this.Score_F[InstanceRange]           = FastSumOp.SumAverageConditional(this.FeatureScores_F[InstanceRange]);
         this.NoisyScore_F[InstanceRange]      = GaussianFromMeanAndVarianceOp.SampleAverageConditional(this.Score_F[InstanceRange], 1.0);
         this.Labels_F[InstanceRange]          = IsPositiveOp.IsPositiveAverageConditional(this.NoisyScore_F[InstanceRange]);
         this.Labels_marginal_F[InstanceRange] = DerivedVariableOp.MarginalAverageConditional <Bernoulli>(this.Labels_use_B_reduced, this.Labels_F[InstanceRange], this.Labels_marginal_F[InstanceRange]);
     }
     this.Changed_FeatureIndexes_FeatureValues_InstanceCount_InstanceFeatureCounts_WeightConstraints_WeightPri6_isDone = true;
 }
 /// <summary>Computations that depend on the observed value of InstanceCount and FeatureCount and FeatureValues and numberOfIterationsDecreased and WeightPriors and WeightConstraints</summary>
 private void Changed_InstanceCount_FeatureCount_FeatureValues_numberOfIterationsDecreased_WeightPriors_WeightCons10()
 {
     if (this.Changed_InstanceCount_FeatureCount_FeatureValues_numberOfIterationsDecreased_WeightPriors_WeightCons10_iterationsDone == 1)
     {
         return;
     }
     for (int InstanceRange = 0; InstanceRange < this.instanceCount; InstanceRange++)
     {
         for (int FeatureRange = 0; FeatureRange < this.featureCount; FeatureRange++)
         {
             // Message to 'FeatureScores' from Product factor
             this.FeatureScores_F[InstanceRange][FeatureRange] = GaussianProductOp.ProductAverageConditional(this.featureValues[InstanceRange][FeatureRange], this.Weights_depth1_rep_F[FeatureRange][InstanceRange]);
         }
         // Message to 'Score' from Sum factor
         this.Score_F[InstanceRange] = FastSumOp.SumAverageConditional(this.FeatureScores_F[InstanceRange]);
         // Message to 'NoisyScore' from GaussianFromMeanAndVariance factor
         this.NoisyScore_F[InstanceRange] = GaussianFromMeanAndVarianceOp.SampleAverageConditional(this.Score_F[InstanceRange], 1.0);
         // Message to 'Labels' from IsPositive factor
         this.Labels_F[InstanceRange] = IsPositiveOp.IsPositiveAverageConditional(this.NoisyScore_F[InstanceRange]);
         // Message to 'Labels_marginal' from DerivedVariable factor
         this.Labels_marginal_F[InstanceRange] = DerivedVariableOp.MarginalAverageConditional <Bernoulli>(this.Labels_use_B[InstanceRange], this.Labels_F[InstanceRange], this.Labels_marginal_F[InstanceRange]);
     }
     this.Changed_InstanceCount_FeatureCount_FeatureValues_numberOfIterationsDecreased_WeightPriors_WeightCons10_iterationsDone = 1;
 }