Permalink
Browse files

Fix python_modular warnings by adding API documentation

  • Loading branch information...
yorkerlin committed Dec 16, 2015
1 parent 6973b1b commit 1881d79ee110a12a87b9f61895a56ca99d2a1e5f
@@ -112,8 +112,10 @@ class AdaDeltaUpdater: public DescendUpdaterWithCorrection
/** learning_rate at iteration */
float64_t m_build_in_learning_rate;
/** epsilon */
float64_t m_epsilon;
/** decay term */
float64_t m_decay_factor;
SGVector<float64_t> m_gradient_accuracy;
@@ -48,7 +48,7 @@ void AdaGradUpdater::set_learning_rate(float64_t learning_rate)
void AdaGradUpdater::set_epsilon(float64_t epsilon)
{
REQUIRE(epsilon>0,"Epsilon (%f) must be non-negative\n",
REQUIRE(epsilon>0,"Epsilon (%f) must be positive\n",
epsilon);
m_epsilon=epsilon;
}
@@ -53,6 +53,10 @@ namespace shogun
*/
virtual void set_learning_rate(float64_t learning_rate);
/** Set epsilon
*
* @param epsilon epsilon must be positive
*/
virtual void set_epsilon(float64_t epsilon);
/** Update a context object to store mutable variables
@@ -106,6 +110,7 @@ namespace shogun
/** learning_rate at iteration */
float64_t m_build_in_learning_rate;
/** epsilon */
float64_t m_epsilon;
SGVector<float64_t> m_gradient_accuracy;
@@ -45,10 +45,10 @@ namespace shogun
class ConstLearningRate: public LearningRate
{
public:
/* Constructor */
/** Constructor */
ConstLearningRate():LearningRate() { init(); }
/* Destructor */
/** Destructor */
virtual ~ConstLearningRate() {}
/** Set the const learning rate
@@ -96,11 +96,11 @@ class ConstLearningRate: public LearningRate
protected:
/* const_learning_rate */
/** const_learning_rate */
float64_t m_const_learning_rate;
private:
/* Init */
/** Init */
void init()
{
m_const_learning_rate=0.0;
@@ -59,6 +59,10 @@ class ElasticNetPenalty: public SparsePenalty
delete m_l2_penalty;
}
/** set l1_ratio
*
* @param ratio ratio must be in (0.0,1.0)
* */
virtual void set_l1_ratio(float64_t ratio)
{
REQUIRE(ratio>0.0 && ratio<1.0, "");
@@ -128,17 +132,26 @@ class ElasticNetPenalty: public SparsePenalty
check_ratio();
return m_l1_penalty->get_sparse_variable(variable, penalty_weight*m_l1_ratio);
}
protected:
/** check l1_ratio */
virtual void check_ratio()
{
REQUIRE(m_l1_ratio>0, "l1_ratio must set\n");
}
/** l1_ratio for L1 penalty and (1.0-l1_ratio) for L2 penalty */
float64_t m_l1_ratio;
/** L1Penalty */
L1Penalty* m_l1_penalty;
/** L2Penalty */
L2Penalty* m_l2_penalty;
private:
/** init */
void init()
{
m_l1_ratio=0;

0 comments on commit 1881d79

Please sign in to comment.