Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vector & matrix parameter descriptions in tags #4139

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/shogun/classifier/mkl/MKL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,10 @@ void CMKL::register_params()
SG_ADD(&mkl_block_norm, "mkl_block_norm", "mkl sparse trade-off parameter", MS_NOT_AVAILABLE);

m_parameters->add_vector(&beta_local, &beta_local_size, "beta_local", "subkernel weights on L1 term of elastic net mkl");
watch_param("beta_local", &beta_local, &beta_local_size);
watch_param(
"beta_local", &beta_local, &beta_local_size,
AnyParameterProperties(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't we have this without the AnyParameterProperties? but just string?
@lisitsyn

"subkernel weights on L1 term of elastic net mkl"));

SG_ADD(&mkl_iterations, "mkl_iterations", "number of mkl steps", MS_NOT_AVAILABLE);
SG_ADD(&mkl_epsilon, "mkl_epsilon", "mkl epsilon", MS_NOT_AVAILABLE);
Expand Down
4 changes: 3 additions & 1 deletion src/shogun/distance/CustomDistance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ void CCustomDistance::init()
upper_diagonal=false;

m_parameters->add_matrix(&dmatrix, &num_rows, &num_cols, "dmatrix", "Distance Matrix");
watch_param("dmatrix", &dmatrix, &num_rows, &num_cols);
watch_param(
"dmatrix", &dmatrix, &num_rows, &num_cols,
AnyParameterProperties("Distance Matrix"));

m_parameters->add(&upper_diagonal, "upper_diagonal", "Upper diagonal");
}
Expand Down
6 changes: 4 additions & 2 deletions src/shogun/distributions/LinearHMM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,13 @@ void CLinearHMM::init()
m_parameters->add_matrix(&transition_probs, &num_symbols, &sequence_length,
"transition_probs", "Transition probabilities.");
watch_param(
"transition_probs", &transition_probs, &num_symbols, &sequence_length);
"transition_probs", &transition_probs, &num_symbols, &sequence_length,
AnyParameterProperties("Transition probabilities."));

m_parameters->add_matrix(&log_transition_probs, &num_symbols, &sequence_length,
"log_transition_probs", "Transition probabilities (logspace).");
watch_param(
"log_transition_probs", &log_transition_probs, &num_symbols,
&sequence_length);
&sequence_length,
AnyParameterProperties("Transition probabilities (logspace)."));
}
13 changes: 10 additions & 3 deletions src/shogun/features/PolyFeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,21 +392,28 @@ void CPolyFeatures::register_parameters()
"multi_index",
"Flattened matrix of all multi indices that sum do the"
" degree of the polynomial kernel.");
watch_param("multi_index", &m_multi_index, &multi_index_length);
watch_param(
"multi_index", &m_multi_index, &multi_index_length,
AnyParameterProperties(
"Flattened matrix of all multi indices that sum do the"
"degree of the polynomial kernel."));

multinomial_coefficients_length=m_output_dimensions;
m_parameters->add_vector(&m_multinomial_coefficients,
&multinomial_coefficients_length, "multinomial_coefficients",
"Multinomial coefficients for all multi-indices.");
watch_param(
"multinomial_coefficients", &m_multinomial_coefficients,
&multinomial_coefficients_length);
&multinomial_coefficients_length,
AnyParameterProperties(
"Multinomial coefficients for all multi-indices."));

normalization_values_length=get_num_vectors();
m_parameters->add_vector(&m_normalization_values,
&normalization_values_length, "normalization_values",
"Norm of each training example.");
watch_param(
"normalization_values", &m_normalization_values,
&normalization_values_length);
&normalization_values_length,
AnyParameterProperties("Norm of each training example."));
}
3 changes: 2 additions & 1 deletion src/shogun/features/SparseFeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,8 @@ template<class ST> void CSparseFeatures<ST>::init()
"Array of sparse vectors.");
watch_param(
"sparse_feature_matrix", &sparse_feature_matrix.sparse_matrix,
&sparse_feature_matrix.num_vectors);
&sparse_feature_matrix.num_vectors,
AnyParameterProperties("Array of sparse vectors."));

m_parameters->add(&sparse_feature_matrix.num_features, "sparse_feature_matrix.num_features",
"Total number of features.");
Expand Down
3 changes: 2 additions & 1 deletion src/shogun/features/SparsePolyFeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ void CSparsePolyFeatures::init()
"m_normalization_values", "Norm of each training example");
watch_param(
"m_normalization_values", &m_normalization_values,
&m_normalization_values_len);
&m_normalization_values_len,
AnyParameterProperties("Norm of each training example"));

m_parameters->add(&mask, "mask", "Mask.");
m_parameters->add(&m_hash_bits, "m_hash_bits", "Number of bits in hash");
Expand Down
8 changes: 6 additions & 2 deletions src/shogun/kernel/CombinedKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,11 +757,15 @@ void CCombinedKernel::init()

m_parameters->add_vector(&sv_idx, &sv_count, "sv_idx",
"Support vector index.");
watch_param("sv_idx", &sv_idx, &sv_count);
watch_param(
"sv_idx", &sv_idx, &sv_count,
AnyParameterProperties("Support vector index."));

m_parameters->add_vector(&sv_weight, &sv_count, "sv_weight",
"Support vector weights.");
watch_param("sv_weight", &sv_weight, &sv_count);
watch_param(
"sv_weight", &sv_weight, &sv_count,
AnyParameterProperties("Support vector weights."));

SG_ADD(&append_subkernel_weights, "append_subkernel_weights",
"If subkernel weights are appended.", MS_AVAILABLE);
Expand Down
8 changes: 6 additions & 2 deletions src/shogun/kernel/normalizer/DiceKernelNormalizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,15 @@ class CDiceKernelNormalizer : public CKernelNormalizer
{
m_parameters->add_vector(&diag_lhs, &num_diag_lhs, "diag_lhs",
"K(x,x) for left hand side examples.");
watch_param("diag_lhs", &diag_lhs, &num_diag_lhs);
watch_param(
"diag_lhs", &diag_lhs, &num_diag_lhs,
AnyParameterProperties("K(x,x) for left hand side examples."));

m_parameters->add_vector(&diag_rhs, &num_diag_rhs, "diag_rhs",
"K(x,x) for right hand side examples.");
watch_param("diag_rhs", &diag_rhs, &num_diag_rhs);
watch_param(
"diag_rhs", &diag_rhs, &num_diag_rhs,
AnyParameterProperties("K(x,x) for right hand side examples."));

SG_ADD(&use_optimized_diagonal_computation,
"use_optimized_diagonal_computation",
Expand Down
10 changes: 8 additions & 2 deletions src/shogun/kernel/normalizer/SqrtDiagKernelNormalizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,17 @@ class CSqrtDiagKernelNormalizer : public CKernelNormalizer
{
m_parameters->add_vector(&sqrtdiag_lhs, &num_sqrtdiag_lhs, "sqrtdiag_lhs",
"sqrt(K(x,x)) for left hand side examples.");
watch_param("sqrtdiag_lhs", &sqrtdiag_lhs, &num_sqrtdiag_lhs);
watch_param(
"sqrtdiag_lhs", &sqrtdiag_lhs, &num_sqrtdiag_lhs,
AnyParameterProperties(
"sqrt(K(x,x)) for left hand side examples."));

m_parameters->add_vector(&sqrtdiag_rhs, &num_sqrtdiag_rhs, "sqrtdiag_rhs",
"sqrt(K(x,x)) for right hand side examples.");
watch_param("sqrtdiag_rhs", &sqrtdiag_rhs, &num_sqrtdiag_rhs);
watch_param(
"sqrtdiag_rhs", &sqrtdiag_rhs, &num_sqrtdiag_rhs,
AnyParameterProperties(
"sqrt(K(x,x)) for right hand side examples."));

SG_ADD(&use_optimized_diagonal_computation,
"use_optimized_diagonal_computation",
Expand Down
8 changes: 6 additions & 2 deletions src/shogun/kernel/normalizer/ZeroMeanCenterKernelNormalizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ class CZeroMeanCenterKernelNormalizer : public CKernelNormalizer
{
m_parameters->add_vector(&ktrain_row_means, &num_ktrain,
"num_ktrain", "Train row means.");
watch_param("num_ktrain", &ktrain_row_means, &num_ktrain);
watch_param(
"num_ktrain", &ktrain_row_means, &num_ktrain,
AnyParameterProperties("Train row means."));

m_parameters->add_vector(&ktest_row_means, &num_ktest,
"num_ktest","Test row means.");
watch_param("num_ktest", &ktest_row_means, &num_ktest);
watch_param(
"num_ktest", &ktest_row_means, &num_ktest,
AnyParameterProperties("Test row means."));
}

/** default destructor */
Expand Down
8 changes: 6 additions & 2 deletions src/shogun/kernel/string/SNPStringKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,14 @@ void CSNPStringKernel::register_params()
"the mark of whether it's an inhomogeneous poly kernel", MS_NOT_AVAILABLE);

m_parameters->add_vector(&m_str_min, &m_str_len, "m_str_min", "allele A");
watch_param("m_str_min", &m_str_min, &m_str_len);
watch_param(
"m_str_min", &m_str_min, &m_str_len,
AnyParameterProperties("allele A"));

m_parameters->add_vector(&m_str_maj, &m_str_len, "m_str_maj", "allele B");
watch_param("m_str_maj", &m_str_maj, &m_str_len);
watch_param(
"m_str_maj", &m_str_maj, &m_str_len,
AnyParameterProperties("allele B"));
}

void CSNPStringKernel::init()
Expand Down
4 changes: 3 additions & 1 deletion src/shogun/kernel/string/SpectrumRBFKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,9 @@ void CSpectrumRBFKernel::register_param()
MS_NOT_AVAILABLE);

m_parameters->add_vector(&sequences, &nof_sequences, "sequences", "the sequences as a part of profile");
watch_param("sequences", &sequences, &nof_sequences);
watch_param(
"sequences", &sequences, &nof_sequences,
AnyParameterProperties("the sequences as a part of profile"));

SG_ADD(&max_sequence_length,
"max_sequence_length", "max length of the sequence", MS_NOT_AVAILABLE);
Expand Down
5 changes: 4 additions & 1 deletion src/shogun/kernel/string/WeightedCommWordStringKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,5 +312,8 @@ void CWeightedCommWordStringKernel::init()

m_parameters->add_vector(&weights, &degree, "weights",
"weights for each of the subkernels of degree 1...d");
watch_param("weights", &weights, &degree);
watch_param(
"weights", &weights, &degree,
AnyParameterProperties(
"weights for each of the subkernels of degree 1...d"));
}
17 changes: 12 additions & 5 deletions src/shogun/kernel/string/WeightedDegreePositionStringKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1934,31 +1934,38 @@ void CWeightedDegreePositionStringKernel::init()

m_parameters->add_matrix(&weights, &weights_degree, &weights_length,
"weights", "WD Kernel weights.");
watch_param("weights", &weights, &weights_degree, &weights_length);
watch_param(
"weights", &weights, &weights_degree, &weights_length,
AnyParameterProperties("WD Kernel weights."));

m_parameters->add_vector(&position_weights, &position_weights_len,
"position_weights",
"Weights per position.");
watch_param("position_weights", &position_weights, &position_weights_len);
watch_param(
"position_weights", &position_weights, &position_weights_len,
AnyParameterProperties("Weights per position."));

m_parameters->add_vector(&position_weights_lhs, &position_weights_lhs_len,
"position_weights_lhs",
"Weights per position left hand side.");
watch_param(
"position_weights_lhs", &position_weights_lhs,
&position_weights_lhs_len);
&position_weights_lhs_len,
AnyParameterProperties("Weights per position left hand side."));

m_parameters->add_vector(&position_weights_rhs, &position_weights_rhs_len,
"position_weights_rhs",
"Weights per position right hand side.");
watch_param(
"position_weights_rhs", &position_weights_rhs,
&position_weights_rhs_len);
&position_weights_rhs_len,
AnyParameterProperties("Weights per position right hand side."));

m_parameters->add_vector(&shift, &shift_len,
"shift",
"Shift Vector.");
watch_param("shift", &shift, &shift_len);
watch_param(
"shift", &shift, &shift_len, AnyParameterProperties("Shift Vector."));

SG_ADD(&max_shift, "max_shift", "Maximal shift.", MS_AVAILABLE);
SG_ADD(&mkl_stepsize, "mkl_stepsize", "MKL step size.", MS_AVAILABLE);
Expand Down
8 changes: 6 additions & 2 deletions src/shogun/kernel/string/WeightedDegreeStringKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1010,12 +1010,16 @@ void CWeightedDegreeStringKernel::init()

m_parameters->add_matrix(&weights, &weights_degree, &weights_length,
"weights", "WD Kernel weights.");
watch_param("weights", &weights, &weights_degree, &weights_length);
watch_param(
"weights", &weights, &weights_degree, &weights_length,
AnyParameterProperties("WD Kernel weights."));

m_parameters->add_vector(&position_weights, &position_weights_len,
"position_weights",
"Weights per position.");
watch_param("position_weights", &position_weights, &position_weights_len);
watch_param(
"position_weights", &position_weights, &position_weights_len,
AnyParameterProperties("Weights per position."));

SG_ADD(&mkl_stepsize, "mkl_stepsize", "MKL step size.", MS_AVAILABLE);
SG_ADD(&degree, "degree", "Order of WD kernel.", MS_AVAILABLE);
Expand Down
4 changes: 3 additions & 1 deletion src/shogun/lib/DynamicArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,9 @@ template <class T> class CDynamicArray :public CSGObject
m_parameters->add_vector(&m_array.array,
&m_array.current_num_elements, "array",
"Memory for dynamic array.");
watch_param("array", &m_array.array, &m_array.current_num_elements);
watch_param(
"array", &m_array.array, &m_array.current_num_elements,
AnyParameterProperties("Memory for dynamic array."));

SG_ADD(&m_array.resize_granularity,
"resize_granularity",
Expand Down
5 changes: 3 additions & 2 deletions src/shogun/mathematics/linalg/linop/SparseMatrixOperator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ void CSparseMatrixOperator<T>::init()
&m_operator.num_vectors, "sparse_matrix",
"The sparse matrix of the linear operator.");
this->watch_param(
"sparse_matrix", &m_operator.sparse_matrix,
&m_operator.num_vectors);
"sparse_matrix", &m_operator.sparse_matrix, &m_operator.num_vectors,
AnyParameterProperties(
"The sparse matrix of the linear operator."));

this->m_parameters->add(&m_operator.num_features,
"m_operator.num_features", "Number of features.");
Expand Down
3 changes: 2 additions & 1 deletion src/shogun/multiclass/GMNPSVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ CGMNPSVM::init()
"m_basealphas",
"Is the basic untransformed alpha.");
watch_param(
"m_basealphas", &m_basealphas, &m_basealphas_y, &m_basealphas_x);
"m_basealphas", &m_basealphas, &m_basealphas_y, &m_basealphas_x,
AnyParameterProperties("Is the basic untransformed alpha."));

m_basealphas = NULL, m_basealphas_y = 0, m_basealphas_x = 0;
}
Expand Down
8 changes: 6 additions & 2 deletions src/shogun/multiclass/ScatterSVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@ void CScatterSVM::register_params()
SG_ADD((machine_int_t*) &scatter_type, "scatter_type", "Type of scatter SVM", MS_NOT_AVAILABLE);

m_parameters->add_vector(&norm_wc, &norm_wc_len, "norm_wc", "Norm of w_c");
watch_param("norm_wc", &norm_wc, &norm_wc_len);
watch_param(
"norm_wc", &norm_wc, &norm_wc_len,
AnyParameterProperties("Norm of w_c"));

m_parameters->add_vector(&norm_wcw, &norm_wcw_len, "norm_wcw", "Norm of w_cw");
watch_param("norm_wcw", &norm_wcw, &norm_wcw_len);
watch_param(
"norm_wcw", &norm_wcw, &norm_wcw_len,
AnyParameterProperties("Norm of w_cw"));

SG_ADD(&rho, "rho", "Scatter SVM rho", MS_NOT_AVAILABLE);
SG_ADD(&m_num_classes, "m_num_classes", "Number of classes", MS_NOT_AVAILABLE);
Expand Down