当前位置: 首页>>代码示例>>C++>>正文


C++ TestData::M方法代码示例

本文整理汇总了C++中TestData::M方法的典型用法代码示例。如果您正苦于以下问题:C++ TestData::M方法的具体用法?C++ TestData::M怎么用?C++ TestData::M使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TestData的用法示例。


在下文中一共展示了TestData::M方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Matrix

	// copy constructor for batch processing
	TestData(const TestData &other, const int startRow, const int n)
	{
		assert(other.M() > 0);
		assert(startRow <= other.M());
		assert(n > 0);
		if(other.M() > 0 && startRow <= other.M() && n > 0)
		{
			//m_pXs.reset(new Matrix(n, other.D()));
			//m_pXs->noalias() = other.m_pXs->middleRows(startRow, n);
			m_pXs.reset(new Matrix(other.m_pXs->middleRows(startRow, n)));
		}
	}
开发者ID:kanster,项目名称:OpenGP,代码行数:13,代码来源:TestData.hpp

示例2: Kss

	/**
	 * @brief	Self [co]variance matrix between the test data, Kss(Z, Z)
	 * @param	[in] logHyp 				The log hyperparameters
	 *												- logHyp(0) = \f$\log(l)\f$
	 *												- logHyp(1) = \f$\log(\sigma_f)\f$
	 * @param	[in] testData 				The test data
	 * @param	[in] fVarianceVector		Flag for the return value
	 * 											- fVarianceVector = true : return \f$\mathbf{k}_{**} \in \mathbb{R}^{M \times 1}, \mathbf{k}_{**}^i = k(\mathbf{Z}_i, \mathbf{Z}_i)\f$ (default)
	 *												- fVarianceVector = false: return \f$\mathbf{K}_{**} = \mathbf{K}(\mathbf{Z}, \mathbf{Z}) \in \mathbb{R}^{M \times M}\f$,\n
    *																					which can be used for Bayesian Committee Machines.
	 * @return	A matrix pointer\n
	 *				- Mx1 (fVarianceVector == true)
	 * 			- MxM (fVarianceVector == false)\n
	 * 			M: The number of test data
	 */
	static MatrixPtr Kss(const Hyp						&logHyp, 
								const TestData<Scalar>		&testData, 
								const bool						fVarianceVector = true)
	{
		// The number of test data
		const int M = testData.M();

		// Some constant values
		const Scalar sigma_f2 = exp(static_cast<Scalar>(2.0) * logHyp(1)); // sigma_f^2

		// Output
		MatrixPtr pKss;

		// K: self-variance vector (Mx1)
		if(fVarianceVector)
		{
			// k(z, z) = sigma_f^2
			pKss.reset(new Matrix(M, 1));
			pKss->fill(sigma_f2);
		}

		// K: self-covariance matrix (MxM)
		else					
		{
			// K(r)
			MatrixPtr pAbsDistXsXs = PairwiseOp<Scalar>::sqDist(testData.pXs()); // MxM
			pAbsDistXsXs->noalias() = pAbsDistXsXs->cwiseSqrt();	
			pKss = K(logHyp, pAbsDistXsXs);
		}

		return pKss;
	}
开发者ID:kanster,项目名称:OpenGP,代码行数:47,代码来源:CovMaterniso.hpp

示例3: pDeltaXXs

	/**
	 * @brief	Gets the cross differences between the training and test inputs.
	 * @param	[in] pXs		The M test inputs
	 * @param	[in] coord	Corresponding coordinate
	 * @return	An matrix pointer
	 *				\f[
	 *				\mathbf{D} \in \mathbb{R}^{N \times M}, \quad
	 *				\mathbf{D}_{ij} = \mathbf{x}_i^c - \mathbf{z}_j^c
	 *				\f]
	 * @todo		Include this matrix as a member variable like m_pDeltaXXList
	 */
	MatrixPtr pDeltaXXs(const TestData<Scalar> &testData, const int coord) const
	{
		assert(m_pX && testData.M() > 0);
		assert(D() == testData.D());
		return PairwiseOp<Scalar>::delta(m_pX, testData.pXs(), coord); // NxM
	}
开发者ID:kanster,项目名称:OpenGP,代码行数:17,代码来源:TrainingData.hpp

示例4: pSqDistXXs

	/**
	 * @brief	Gets the cross squared distances between the training and test inputs
	 * @param	[in] pXs		The M test inputs
	 * @return	An matrix pointer
	 *				\f[
	 *				\mathbf{R^2} \in \mathbb{R}^{N \times M}, \quad
	 *				\mathbf{R^2}_{ij} = (\mathbf{x}_i - \mathbf{z}_j)^\text{T}(\mathbf{x}_i - \mathbf{z}_j)
	 *				\f]
	 * @todo		Include this matrix as a member variable like m_pSqDistXX
	 */
	MatrixPtr pSqDistXXs(const TestData<Scalar> &testData) const
	{
		assert(m_pX && testData.M() > 0);
		assert(D() == testData.D());
		return PairwiseOp<Scalar>::sqDist(m_pX, testData.pXs()); // NxM
	}
开发者ID:kanster,项目名称:OpenGP,代码行数:16,代码来源:TrainingData.hpp


注:本文中的TestData::M方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。