예제 #1
0
파일: SparseGP.cs 프로젝트: zouwuhe/infer
        /// <summary>
        /// Creates a sparse GP point mass - i.e. all the mass is at a given function
        /// </summary>
        /// <param name="sgpf"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public static SparseGP PointMass(SparseGPFixed sgpf, IFunction value)
        {
            SparseGP sgp = new SparseGP(sgpf, false);

            sgp.Point = value;
            return(sgp);
        }
예제 #2
0
파일: SparseGP.cs 프로젝트: zouwuhe/infer
 public SparseGP(SparseGPFixed spgf, bool includePrior, VectorGaussian InducingDist, IFunction pointFunc)
 {
     fixedParameters   = spgf;
     IncludePrior      = includePrior;
     this.InducingDist = VectorGaussian.Copy(InducingDist);
     this.pointFunc    = pointFunc;
 }
예제 #3
0
파일: SparseGP.cs 프로젝트: zouwuhe/infer
        /// <summary>
        /// Sets one sparse GP to another. Everything is copied
        /// except the FixedParameters and the lsit of rank 1 potentials
        /// which are referenced.
        /// </summary>
        /// <param name="that">The sparse GP to copy</param>
        public void SetTo(SparseGP that)
        {
            fixedParameters = that.FixedParameters;
            InducingDist.SetTo(that.InducingDist);
            IncludePrior = that.IncludePrior;
            pointFunc    = that.pointFunc;

            if (that.alpha != null)
            {
                alpha = Vector.Copy(that.alpha);
            }
            else
            {
                alpha = null;
            }

            if (that.beta != null)
            {
                beta = new PositiveDefiniteMatrix(that.beta as Matrix);
            }
            else
            {
                beta = null;
            }

            if (that.meanB != null)
            {
                meanB = Vector.Copy(that.meanB);
            }
            else
            {
                meanB = null;
            }

            if (that.varBB != null)
            {
                varBB = new PositiveDefiniteMatrix(that.varBB as Matrix);
            }
            else
            {
                varBB = null;
            }
        }
예제 #4
0
 /// <summary>
 /// Checks if this object is equal to <paramref name="other"/>.
 /// </summary>
 public bool Equals(SparseGPFixed other)
 {
     return(StructuralComparisons.StructuralEqualityComparer.Equals(basis, other.basis) && Equals(prior, other.prior));
 }
예제 #5
0
파일: SparseGP.cs 프로젝트: zouwuhe/infer
 /// <summary>
 /// Creates a uniform sparse GP
 /// </summary>
 /// <param name="sgpf"></param>
 /// <returns></returns>
 public static SparseGP Uniform(SparseGPFixed sgpf)
 {
     return(new SparseGP(sgpf, false));
 }
예제 #6
0
파일: SparseGP.cs 프로젝트: zouwuhe/infer
 /// <summary>
 ///
 /// </summary>
 /// <param name="spgf">Fixed parameters</param>
 /// <param name="includePrior">Whether this instance includes the prior</param>
 public SparseGP(SparseGPFixed spgf, bool includePrior)
 {
     fixedParameters = spgf;
     InducingDist    = new VectorGaussian(spgf.NumberBasisPoints);
     IncludePrior    = includePrior;
 }
예제 #7
0
파일: SparseGP.cs 프로젝트: zouwuhe/infer
 /// <summary>
 /// Constructs sparse GP, given basis etc
 /// </summary>
 /// <param name="spgf">The fixed parameters</param>
 public SparseGP(SparseGPFixed spgf) : this(spgf, true)
 {
 }