public IGMNData(IGMN owner, Vector mean) { this.owner = owner; this.gauss = new Gaussian(mean, getStarterCovariance()); this.inputGauss = new Gaussian(mean.Part(0, mean.Elements.Length - 1), getInputStarterCovariance()); Age = 1; Accumlator = 1; }
public void RefineWithData(Vector x, double w) { Vector eps = x - gauss.Mean; Vector eps2 = x.Part(0, x.Elements.Length - 1) - inputGauss.Mean; /**/double oldQvalue = gauss.Mean.Elements[gauss.Mean.Elements.Length - 1]; gauss.Mean.Add(eps, w); /**/gauss.Mean.Elements[gauss.Mean.Elements.Length - 1] = Math.Max(oldQvalue, x.Elements[x.Elements.Length - 1]);//max Q value inputGauss.Mean.Add(eps2, w); gauss.Covariance.MultiplyScalar(1 - w); inputGauss.Covariance.MultiplyScalar(1 - w); gauss.Covariance.AddDiad(eps, -w * w + w);//-w * w + w inputGauss.Covariance.AddDiad(eps2, -w * w + w); }