Skip to content

Commit

Permalink
fixed some python_modular warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
yorkerlin committed Mar 18, 2016
1 parent 88ad808 commit d5798cc
Show file tree
Hide file tree
Showing 14 changed files with 70 additions and 70 deletions.
2 changes: 1 addition & 1 deletion src/shogun/machine/gp/InferenceMethod.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class CInferenceMethod : public CDifferentiableFunction
*
* where \f$\mu\f$ is the mean,
* \f$K\f$ is the prior covariance matrix,
* and \f$meanf$\f is the mean prior fomr MeanFunction
* and \f$meanf\f$ is the mean prior fomr MeanFunction
*
*/
virtual SGVector<float64_t> get_alpha()=0;
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/machine/gp/KLCovarianceInferenceMethod.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class CKLCovarianceInferenceMethod: public CKLInferenceMethod
* get_derivative_wrt_kernel(const TParameter* param)
* will call this function
*
* @param the gradient wrt hyperparameter related to cov
* @param dK the gradient wrt hyperparameter related to cov
*/

virtual float64_t get_derivative_related_cov(SGMatrix<float64_t> dK);
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/machine/gp/KLDualInferenceMethod.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class CKLDualInferenceMethod: public CKLInferenceMethod
* get_derivative_wrt_kernel(const TParameter* param)
* will call this function
*
* @param the gradient related to cov
* @param dK the gradient related to cov
*
* @return the gradient wrt hyperparameter related to cov
*/
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/machine/gp/KLInferenceMethod.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ class CKLInferenceMethod: public CInferenceMethod
* get_derivative_wrt_kernel(const TParameter* param)
* will call this function
*
* @param the gradient wrt hyperparameter related to cov
* @param dK the gradient wrt hyperparameter related to cov
*/
virtual float64_t get_derivative_related_cov(SGMatrix<float64_t> dK)=0;

Expand Down
2 changes: 1 addition & 1 deletion src/shogun/machine/gp/KLLowerTriangularInferenceMethod.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class CKLLowerTriangularInferenceMethod: public CKLInferenceMethod
* get_derivative_wrt_kernel(const TParameter* param)
* will call this function
*
* @param the gradient wrt hyperparameter related to cov
* @param dK the gradient wrt hyperparameter related to cov
*/

virtual float64_t get_derivative_related_cov(SGMatrix<float64_t> dK);
Expand Down
24 changes: 12 additions & 12 deletions src/shogun/machine/gp/LaplacianInferenceBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class CLaplacianInferenceBase: public CInferenceMethod
*
* where \f$\mu\f$ is the mean,
* \f$K\f$ is the prior covariance matrix,
* and \f$meanf$\f is the mean prior fomr MeanFunction
* and \f$meanf\f$ is the mean prior fomr MeanFunction
*
*/
virtual SGVector<float64_t> get_alpha();
Expand All @@ -98,23 +98,23 @@ class CLaplacianInferenceBase: public CInferenceMethod
*
* @return Cholesky decomposition of matrix:
*
*
* for binary and regression case
* \f[
* L = Cholesky(W^{\frac{1}{2}}*K*W^{\frac{1}{2}}+I)
* \f]
*
* where \f$K\f$ is the prior covariance matrix, \f$sW\f$ is the vector
* returned by get_diagonal_vector(), and \f$I\f$ is the identity matrix.
*
* for multiclass case
* \f[
* M = Cholesky(\sum_\text{c}{E_\text{c})
* \f]
* returned by get_diagonal_vector(), and \f$I\f$ is the identity matrix.
*
* for multiclass case
* \f[
* M = Cholesky(\sum_\text{c}{E_\text{c})
* \f]
*
* where \f$E_\text{c}\f$ is the matrix defined in the algorithm 3.3 of the GPML textbook for class c
* Note the E matrix is used to store these \f$E_\text{c}\f$ matrices, where E=[E_1, E_2, ..., E_C],
* where C is the number of classes and C should be greater than 1.
*
* where \f$E_\text{c}\f$ is the matrix defined in the algorithm 3.3 of the GPML textbook for class c
* Note the E matrix is used to store these \f$E_\text{c}\f$ matrices, where E=[E_1, E_2, ..., E_C],
* where C is the number of classes and C should be greater than 1.
*/
virtual SGMatrix<float64_t> get_cholesky();

Expand Down
4 changes: 2 additions & 2 deletions src/shogun/machine/gp/LogitDVGLikelihood.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace shogun
*
* The mathematically definition (equation 19 in the paper) is as below
* \f[
* Fenchel_i(\alpha_i,\lambda_i) = max_{h_i,\rho_i}{\alpha_i h_i+\lambda_i \rho_i /2 - E_{q(f_i|h_i,\rho_i)}(-log(p(y_i|f_i)))}
* \text{Fenchel}_i(\alpha_i,\lambda_i) = \max_{h_i,\rho_i}{\alpha_i h_i+\lambda_i \rho_i /2 - E_{q(f_i|h_i,\rho_i)}(-log(p(y_i|f_i)))}
* \f]
* where \f$\alpha_i\f$,\f$\lambda_i\f$ are Lagrange multipliers with respective to constraints
* \f$h_i=\mu_i\f$ and \f$\rho_i=\sigma_i^2\f$ respectively,
Expand All @@ -63,7 +63,7 @@ namespace shogun
* In this setting, \f$\alpha\f$ and \f$\lambda\f$ are called dual parameters for \f$\mu\f$ and \f$\sigma^2\f$ respectively.
*
* Note that \f$p(y_i)\f$ is Logistic distribution and a local variational bound defined as below is used to approximate
* -E_{q(f_i|h_i,\rho_i)}(-log(p(y_i|f_i)))
* \f$-\text{E}_{q(f_i|h_i,\rho_i)}(-\log(p(y_i|f_i)))\f$
*
* The local variational bound used here is
* \f[
Expand Down
4 changes: 2 additions & 2 deletions src/shogun/machine/gp/MultiLaplacianInferenceMethod.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class CMultiLaplacianInferenceMethod: public CLaplacianInferenceBase
virtual float64_t get_negative_log_marginal_likelihood();

/** get diagonal vector
* where the vector, \f$\pi$\f, defined in the algorithm 3.3 of the GPML textbook
* where the vector, \f$\pi\f$, defined in the algorithm 3.3 of the GPML textbook
*
* @return the vector used for inference
*/
Expand Down Expand Up @@ -221,7 +221,7 @@ class CMultiLaplacianInferenceMethod: public CLaplacianInferenceBase

/** the helper method used to compute gradient of GP wrt hyperparameter
*
* @param raw gradient wrt hyperparameter
* @param dK raw gradient wrt hyperparameter
*
* @return the gradient of GP wrt hyperparameter
*
Expand Down
4 changes: 2 additions & 2 deletions src/shogun/machine/gp/SingleFITCLaplacianInferenceMethod.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ friend class CFITCPsiLine;
virtual SGMatrix<float64_t> get_chol_inv(SGMatrix<float64_t> mtx);

/** efficiently compute the matrix-vector product
* \f$\Sigma \times al$\f, where \f$\Sigma$\f is
* \f$\Sigma \times al\f$, where \f$\Sigma\f$ is
* the FITC equivalent covariance n-by-n matrix (prior) of f_n
*
* @param al input vector
Expand All @@ -299,7 +299,7 @@ friend class CFITCPsiLine;
virtual SGVector<float64_t> compute_mvmK(SGVector<float64_t> al);

/** efficiently compute the matrix-vector product
* \f$ \inv{\inv{W}+\Sigma} \times x$\f, where \f$\Sigma$\f is
* \f$ \inv{\inv{W}+\Sigma} \times x\f$, where \f$\Sigma\f$ is
* the FITC equivalent covariance n-by-n matrix (prior) of f_n
*
* @param x input vector
Expand Down
40 changes: 20 additions & 20 deletions src/shogun/machine/gp/SingleFITCLaplacianInferenceMethodWithLBFGS.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class CSingleFITCLaplacianInferenceMethodWithLBFGS: public CSingleFITCLaplacianI
/* default constructor */
CSingleFITCLaplacianInferenceMethodWithLBFGS();

/* constructor
/** constructor
*
* @param kernel covariance function
* @param features features to use in inference
Expand All @@ -86,7 +86,7 @@ class CSingleFITCLaplacianInferenceMethodWithLBFGS: public CSingleFITCLaplacianI
virtual const char* get_name() const
{return "SingleFITCLaplacianInferenceMethodWithLBFGS";}

/* set L-BFGS parameters
/** set L-BFGS parameters
* For details please see shogun/optimization/lbfgs/lbfgs.h
* @param m The number of corrections to approximate the inverse hessian matrix.
* Default value is 100.
Expand Down Expand Up @@ -150,60 +150,60 @@ class CSingleFITCLaplacianInferenceMethodWithLBFGS: public CSingleFITCLaplacianI
virtual void update_alpha();

private:
/* a parameter used to compute function value and gradient for LBFGS update*/
/** a parameter used to compute function value and gradient for LBFGS update*/
SGVector<float64_t> * m_mean_f;

/* should we enable the original Newton method
/** should we enable the original Newton method
* if the L-BFGS method fails
* */
bool m_enable_newton_if_fail;

/* The number of corrections to approximate the inverse hessian matrix.*/
/** The number of corrections to approximate the inverse hessian matrix.*/
int m_m;

/* The maximum number of trials to do line search for each L-BFGS update.*/
/** The maximum number of trials to do line search for each L-BFGS update.*/
int m_max_linesearch;

/* The line search algorithm.*/
/** The line search algorithm.*/
int m_linesearch;

/* The maximum number of iterations for L-BFGS update.*/
/** The maximum number of iterations for L-BFGS update.*/
int m_max_iterations;

/* Delta for convergence test based on the change of function value.*/
/** Delta for convergence test based on the change of function value.*/
float64_t m_delta;

/* Distance for delta-based convergence test.*/
/** Distance for delta-based convergence test.*/
int m_past;

/* Epsilon for convergence test based on the change of gradient.*/
/** Epsilon for convergence test based on the change of gradient.*/
float64_t m_epsilon;

/* The minimum step of the line search.*/
/** The minimum step of the line search.*/
float64_t m_min_step;

/* The maximum step of the line search.*/
/** The maximum step of the line search.*/
float64_t m_max_step;

/* A parameter used in Armijo condition.*/
/** A parameter used in Armijo condition.*/
float64_t m_ftol;

/* A parameter used in curvature condition.*/
/** A parameter used in curvature condition.*/
float64_t m_wolfe;

/* A parameter used in Morethuente linesearch to control the accuracy.*/
/** A parameter used in Morethuente linesearch to control the accuracy.*/
float64_t m_gtol;

/* The machine precision for floating-point values.*/
/** The machine precision for floating-point values.*/
float64_t m_xtol;

/* Coeefficient for the L1 norm of variables.*/
/** Coeefficient for the L1 norm of variables.*/
float64_t m_orthantwise_c;

/* Start index for computing L1 norm of the variables.*/
/** Start index for computing L1 norm of the variables.*/
int m_orthantwise_start;

/* End index for computing L1 norm of the variables.*/
/** End index for computing L1 norm of the variables.*/
int m_orthantwise_end;

void init();
Expand Down
40 changes: 20 additions & 20 deletions src/shogun/machine/gp/SingleLaplacianInferenceMethodWithLBFGS.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class CSingleLaplacianInferenceMethodWithLBFGS: public CSingleLaplacianInference
virtual const char* get_name() const
{return "SingleLaplacianInferenceMethodWithLBFGS";}

/* set L-BFGS parameters
/** set L-BFGS parameters
* For details please see shogun/optimization/lbfgs/lbfgs.h
* @param m The number of corrections to approximate the inverse hessian matrix.
* Default value is 100.
Expand Down Expand Up @@ -144,7 +144,7 @@ class CSingleLaplacianInferenceMethodWithLBFGS: public CSingleLaplacianInference
int orthantwise_start = 0,
int orthantwise_end = 1);

/* wheter we use Newton method as rollbak if LBFGS optimizer fails
/** wheter we use Newton method as rollbak if LBFGS optimizer fails
*
* @param enable_newton_if_fail if LBFGS optimizer fails, should we use Newton method.
*/
Expand All @@ -154,60 +154,60 @@ class CSingleLaplacianInferenceMethodWithLBFGS: public CSingleLaplacianInference
virtual void update_alpha();

private:
/* a parameter used to compute function value and gradient for LBFGS update*/
/** a parameter used to compute function value and gradient for LBFGS update*/
SGVector<float64_t> * m_mean_f;

/* should we enable the original Newton method
/** should we enable the original Newton method
* if the L-BFGS method fails
* */
bool m_enable_newton_if_fail;

/* The number of corrections to approximate the inverse hessian matrix.*/
/** The number of corrections to approximate the inverse hessian matrix.*/
int m_m;

/* The maximum number of trials to do line search for each L-BFGS update.*/
/** The maximum number of trials to do line search for each L-BFGS update.*/
int m_max_linesearch;

/* The line search algorithm.*/
/** The line search algorithm.*/
int m_linesearch;

/* The maximum number of iterations for L-BFGS update.*/
/** The maximum number of iterations for L-BFGS update.*/
int m_max_iterations;

/* Delta for convergence test based on the change of function value.*/
/** Delta for convergence test based on the change of function value.*/
float64_t m_delta;

/* Distance for delta-based convergence test.*/
/** Distance for delta-based convergence test.*/
int m_past;

/* Epsilon for convergence test based on the change of gradient.*/
/** Epsilon for convergence test based on the change of gradient.*/
float64_t m_epsilon;

/* The minimum step of the line search.*/
/** The minimum step of the line search.*/
float64_t m_min_step;

/* The maximum step of the line search.*/
/** The maximum step of the line search.*/
float64_t m_max_step;

/* A parameter used in Armijo condition.*/
/** A parameter used in Armijo condition.*/
float64_t m_ftol;

/* A parameter used in curvature condition.*/
/** A parameter used in curvature condition.*/
float64_t m_wolfe;

/* A parameter used in Morethuente linesearch to control the accuracy.*/
/** A parameter used in Morethuente linesearch to control the accuracy.*/
float64_t m_gtol;

/* The machine precision for floating-point values.*/
/** The machine precision for floating-point values.*/
float64_t m_xtol;

/* Coeefficient for the L1 norm of variables.*/
/** Coeefficient for the L1 norm of variables.*/
float64_t m_orthantwise_c;

/* Start index for computing L1 norm of the variables.*/
/** Start index for computing L1 norm of the variables.*/
int m_orthantwise_start;

/* End index for computing L1 norm of the variables.*/
/** End index for computing L1 norm of the variables.*/
int m_orthantwise_end;

void init();
Expand Down
8 changes: 4 additions & 4 deletions src/shogun/machine/gp/SoftMaxLikelihood.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ enum EMCSamplerType

/** @brief Class that models Soft-Max likelihood.
*
* softmax_i(f)=\frac{\exp{f_i}}{\sum\exp{f_i}}
* \f$ \text{softmax}_i(f)=\frac{\exp{f_i}}{\sum\exp{f_i}} \f$
*
* Code adapted from
* https://gist.github.com/yorkerlin/8a36e8f9b298aa0246a4
Expand Down Expand Up @@ -285,13 +285,13 @@ class CSoftMaxLikelihood : public CLikelihoodModel
SGVector<float64_t> predictive_helper(SGVector<float64_t> mu,
SGVector<float64_t> s2, const CLabels *lab, EMCSamplerType option) const;

/**the Monte method sampler
/** the Monte method sampler
*
* @param num_samples number of samples to be generated
* @param mu posterior mean of a Gaussian distribution
* @param mean posterior mean of a Gaussian distribution
* \f$\mathcal{N}(\mu,\sigma^2)\f$, which is an approximation to the
* posterior marginal \f$p(f_*|X,y,x_*)\f$
* @param s2 posterior variance of a Gaussian distribution
* @param Sigma posterior variance of a Gaussian distribution
* \f$\mathcal{N}(\mu,\sigma^2)\f$, which is an approximation to the
* posterior marginal \f$p(f_*|X,y,x_*)\f$
* @param y labels based on 0 and 1 encoding \f$y_*\f$
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/machine/gp/SparseInferenceBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ class CSparseInferenceBase: public CInferenceMethod
* where
* \f$\lambda \ge 0\f$ is the inducing noise.
*
* In practice, we use the corrected matrix, \Sigma_{M'} in the following approximation.
* In practice, we use the corrected matrix, \f$\Sigma_{M'}\f$ in the following approximation.
*\f[
*\Sigma_{Sparse}=\textbf{diag}(\Sigma_{N}-\Phi)+\Phi
*\f]
Expand Down
4 changes: 2 additions & 2 deletions src/shogun/mathematics/Integration.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ class CIntegration : public CSGObject
* Gauss-Hermite formula respectively.
*
* @param f integrable function of one variable
* @param x the provided array of nodes
* @param w the provided array of weights
* @param xgh the provided array of nodes
* @param wgh the provided array of weights
*
* @return approximate value of the
* integral \f$\int_{-\infty}^{\infty}e^{-x^2}f(x)dx\f$
Expand Down

0 comments on commit d5798cc

Please sign in to comment.