diff --git a/src/shogun/classifier/mkl/MKL.cpp b/src/shogun/classifier/mkl/MKL.cpp index acf9df1020c..c8055f032e2 100644 --- a/src/shogun/classifier/mkl/MKL.cpp +++ b/src/shogun/classifier/mkl/MKL.cpp @@ -276,7 +276,10 @@ void CMKL::register_params() SG_ADD(&mkl_norm, "mkl_norm", "norm used in mkl", MS_NOT_AVAILABLE); SG_ADD(&ent_lambda, "ent_lambda", "elastic net sparsity trade-off parameter", MS_NOT_AVAILABLE); 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); + SG_ADD(&mkl_iterations, "mkl_iterations", "number of mkl steps", MS_NOT_AVAILABLE); SG_ADD(&mkl_epsilon, "mkl_epsilon", "mkl epsilon", MS_NOT_AVAILABLE); SG_ADD(&interleaved_optimization, "interleaved_optimization", "whether to use mkl wrapper or interleaved opt.", MS_NOT_AVAILABLE); diff --git a/src/shogun/features/PolyFeatures.cpp b/src/shogun/features/PolyFeatures.cpp index c025264e9ef..fd4f6f109fe 100644 --- a/src/shogun/features/PolyFeatures.cpp +++ b/src/shogun/features/PolyFeatures.cpp @@ -392,14 +392,21 @@ 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); 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); 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); } diff --git a/src/shogun/features/SparseFeatures.cpp b/src/shogun/features/SparseFeatures.cpp index 70b1e6ec075..7aa9f7d5eae 100644 --- a/src/shogun/features/SparseFeatures.cpp +++ b/src/shogun/features/SparseFeatures.cpp @@ -612,6 +612,10 @@ template void CSparseFeatures::init() m_parameters->add_vector(&sparse_feature_matrix.sparse_matrix, &sparse_feature_matrix.num_vectors, "sparse_feature_matrix", "Array of sparse vectors."); + watch_param( + "sparse_feature_matrix", &sparse_feature_matrix.sparse_matrix, + &sparse_feature_matrix.num_vectors); + m_parameters->add(&sparse_feature_matrix.num_features, "sparse_feature_matrix.num_features", "Total number of features."); } diff --git a/src/shogun/features/SparsePolyFeatures.cpp b/src/shogun/features/SparsePolyFeatures.cpp index ed7c1bc642c..6d10a7e7fe0 100644 --- a/src/shogun/features/SparsePolyFeatures.cpp +++ b/src/shogun/features/SparsePolyFeatures.cpp @@ -257,9 +257,14 @@ void CSparsePolyFeatures::init() "Dimensions of the input space."); m_parameters->add(&m_output_dimensions, "output_dimensions", "Dimensions of the feature space of the polynomial kernel."); + m_normalization_values_len = get_num_vectors(); m_parameters->add_vector(&m_normalization_values, &m_normalization_values_len, "m_normalization_values", "Norm of each training example"); + watch_param( + "m_normalization_values", &m_normalization_values, + &m_normalization_values_len); + m_parameters->add(&mask, "mask", "Mask."); m_parameters->add(&m_hash_bits, "m_hash_bits", "Number of bits in hash"); } diff --git a/src/shogun/kernel/CombinedKernel.cpp b/src/shogun/kernel/CombinedKernel.cpp index a3d643e38d2..4d65511a9da 100644 --- a/src/shogun/kernel/CombinedKernel.cpp +++ b/src/shogun/kernel/CombinedKernel.cpp @@ -663,10 +663,15 @@ void CCombinedKernel::init() SG_ADD((CSGObject**) &kernel_array, "kernel_array", "Array of kernels.", MS_AVAILABLE); + m_parameters->add_vector(&sv_idx, &sv_count, "sv_idx", "Support vector index."); + watch_param("sv_idx", &sv_idx, &sv_count); + m_parameters->add_vector(&sv_weight, &sv_count, "sv_weight", "Support vector weights."); + watch_param("sv_weight", &sv_weight, &sv_count); + SG_ADD(&append_subkernel_weights, "append_subkernel_weights", "If subkernel weights are appended.", MS_AVAILABLE); SG_ADD(&initialized, "initialized", "Whether kernel is ready to be used.", diff --git a/src/shogun/kernel/normalizer/DiceKernelNormalizer.h b/src/shogun/kernel/normalizer/DiceKernelNormalizer.h index 647fe6d63fc..5ed9430153a 100644 --- a/src/shogun/kernel/normalizer/DiceKernelNormalizer.h +++ b/src/shogun/kernel/normalizer/DiceKernelNormalizer.h @@ -34,8 +34,12 @@ 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); + 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); + SG_ADD(&use_optimized_diagonal_computation, "use_optimized_diagonal_computation", "flat if optimized diagonal computation is used", MS_NOT_AVAILABLE); diff --git a/src/shogun/kernel/normalizer/SqrtDiagKernelNormalizer.h b/src/shogun/kernel/normalizer/SqrtDiagKernelNormalizer.h index f1e66335d45..0c15b266b4a 100644 --- a/src/shogun/kernel/normalizer/SqrtDiagKernelNormalizer.h +++ b/src/shogun/kernel/normalizer/SqrtDiagKernelNormalizer.h @@ -38,8 +38,12 @@ 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); + 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); + SG_ADD(&use_optimized_diagonal_computation, "use_optimized_diagonal_computation", "flat if optimized diagonal computation is used", MS_NOT_AVAILABLE); diff --git a/src/shogun/kernel/normalizer/ZeroMeanCenterKernelNormalizer.h b/src/shogun/kernel/normalizer/ZeroMeanCenterKernelNormalizer.h index 7c648dac884..a58981ed9bf 100644 --- a/src/shogun/kernel/normalizer/ZeroMeanCenterKernelNormalizer.h +++ b/src/shogun/kernel/normalizer/ZeroMeanCenterKernelNormalizer.h @@ -47,8 +47,11 @@ 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); + m_parameters->add_vector(&ktest_row_means, &num_ktest, "num_ktest","Test row means."); + watch_param("num_ktest", &ktest_row_means, &num_ktest); } /** default destructor */ diff --git a/src/shogun/kernel/string/HistogramWordStringKernel.cpp b/src/shogun/kernel/string/HistogramWordStringKernel.cpp index 4ff7553449e..4224b015c33 100644 --- a/src/shogun/kernel/string/HistogramWordStringKernel.cpp +++ b/src/shogun/kernel/string/HistogramWordStringKernel.cpp @@ -410,14 +410,30 @@ void CHistogramWordStringKernel::init() SG_ADD(&initialized, "initialized", "If kernel is initalized.", MS_NOT_AVAILABLE); + m_parameters->add_vector(&plo_lhs, &num_lhs, "plo_lhs"); + watch_param("plo_lhs", &plo_lhs, &num_lhs); + m_parameters->add_vector(&plo_rhs, &num_rhs, "plo_rhs"); + watch_param("plo_rhs", &plo_rhs, &num_rhs); + m_parameters->add_vector(&ld_mean_lhs, &num_lhs, "ld_mean_lhs"); + watch_param("ld_mean_lhs", &ld_mean_lhs, &num_lhs); + m_parameters->add_vector(&ld_mean_rhs, &num_rhs, "ld_mean_rhs"); + watch_param("ld_mean_rhs", &ld_mean_rhs, &num_rhs); + m_parameters->add_vector(&sqrtdiag_lhs, &num_lhs, "sqrtdiag_lhs"); + watch_param("sqrtdiag_lhs", &sqrtdiag_lhs, &num_lhs); + m_parameters->add_vector(&sqrtdiag_rhs, &num_rhs, "sqrtdiag_rhs"); + watch_param("sqrtdiag_rhs", &sqrtdiag_rhs, &num_rhs); + m_parameters->add_vector(&mean, &num_params2, "mean"); + watch_param("mean", &mean, &num_params2); + m_parameters->add_vector(&variance, &num_params2, "variance"); + watch_param("variance", &variance, &num_params2); SG_ADD((CSGObject**) &estimate, "estimate", "Plugin Estimate.", MS_NOT_AVAILABLE); diff --git a/src/shogun/kernel/string/SNPStringKernel.cpp b/src/shogun/kernel/string/SNPStringKernel.cpp index 1708912582e..fe85783de3a 100644 --- a/src/shogun/kernel/string/SNPStringKernel.cpp +++ b/src/shogun/kernel/string/SNPStringKernel.cpp @@ -181,8 +181,12 @@ void CSNPStringKernel::register_params() SG_ADD(&m_win_len, "m_win_len", "the window length", MS_AVAILABLE); SG_ADD(&m_inhomogene, "m_inhomogene", "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); + 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); } void CSNPStringKernel::init() diff --git a/src/shogun/kernel/string/SpectrumRBFKernel.cpp b/src/shogun/kernel/string/SpectrumRBFKernel.cpp index e57bf6dbc92..105a73ca03a 100644 --- a/src/shogun/kernel/string/SpectrumRBFKernel.cpp +++ b/src/shogun/kernel/string/SpectrumRBFKernel.cpp @@ -383,7 +383,10 @@ void CSpectrumRBFKernel::register_param() SG_ADD(&width, "width", "width of Gaussian", MS_AVAILABLE); SG_ADD(&nof_sequences, "nof_sequences", "length of the sequence", MS_NOT_AVAILABLE); + m_parameters->add_vector(&sequences, &nof_sequences, "sequences", "the sequences as a part of profile"); + watch_param("sequences", &sequences, &nof_sequences); + SG_ADD(&max_sequence_length, "max_sequence_length", "max length of the sequence", MS_NOT_AVAILABLE); } diff --git a/src/shogun/kernel/string/WeightedCommWordStringKernel.cpp b/src/shogun/kernel/string/WeightedCommWordStringKernel.cpp index 9d3ed1bb6bb..8b9408ea4e3 100644 --- a/src/shogun/kernel/string/WeightedCommWordStringKernel.cpp +++ b/src/shogun/kernel/string/WeightedCommWordStringKernel.cpp @@ -312,4 +312,5 @@ void CWeightedCommWordStringKernel::init() m_parameters->add_vector(&weights, °ree, "weights", "weights for each of the subkernels of degree 1...d"); + watch_param("weights", &weights, °ree); } diff --git a/src/shogun/kernel/string/WeightedDegreePositionStringKernel.cpp b/src/shogun/kernel/string/WeightedDegreePositionStringKernel.cpp index f6b80154bf1..0b18ffabf00 100644 --- a/src/shogun/kernel/string/WeightedDegreePositionStringKernel.cpp +++ b/src/shogun/kernel/string/WeightedDegreePositionStringKernel.cpp @@ -1939,15 +1939,27 @@ void CWeightedDegreePositionStringKernel::init() m_parameters->add_vector(&position_weights, &position_weights_len, "position_weights", "Weights per position."); + watch_param("position_weights", &position_weights, &position_weights_len); + 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); + 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); + m_parameters->add_vector(&shift, &shift_len, "shift", "Shift Vector."); + watch_param("shift", &shift, &shift_len); + SG_ADD(&max_shift, "max_shift", "Maximal shift.", MS_AVAILABLE); SG_ADD(&mkl_stepsize, "mkl_stepsize", "MKL step size.", MS_AVAILABLE); SG_ADD(°ree, "degree", "Order of WD kernel.", MS_AVAILABLE); diff --git a/src/shogun/kernel/string/WeightedDegreeStringKernel.cpp b/src/shogun/kernel/string/WeightedDegreeStringKernel.cpp index eac9a28a4b1..40db0de78f8 100644 --- a/src/shogun/kernel/string/WeightedDegreeStringKernel.cpp +++ b/src/shogun/kernel/string/WeightedDegreeStringKernel.cpp @@ -1015,6 +1015,8 @@ void CWeightedDegreeStringKernel::init() m_parameters->add_vector(&position_weights, &position_weights_len, "position_weights", "Weights per position."); + watch_param("position_weights", &position_weights, &position_weights_len); + SG_ADD(&mkl_stepsize, "mkl_stepsize", "MKL step size.", MS_AVAILABLE); SG_ADD(°ree, "degree", "Order of WD kernel.", MS_AVAILABLE); SG_ADD(&max_mismatch, "max_mismatch", diff --git a/src/shogun/labels/MultilabelLabels.cpp b/src/shogun/labels/MultilabelLabels.cpp index 06115d04783..5eab46dee93 100644 --- a/src/shogun/labels/MultilabelLabels.cpp +++ b/src/shogun/labels/MultilabelLabels.cpp @@ -76,13 +76,15 @@ CMultilabelLabels::init(int32_t num_labels, int32_t num_classes) // Can only be enabled after this issue has been solved: // https://github.com/shogun-toolbox/shogun/issues/1972 -/* this->m_parameters->add(&m_num_labels, "m_num_labels", - "Number of labels."); - this->m_parameters->add(&m_num_classes, "m_num_classes", - "Number of classes."); - this->m_parameters->add_vector(&m_labels, &m_num_labels, "labels_array", - "The label vectors for all (num_labels) outputs."); -*/ + /* this->m_parameters->add(&m_num_labels, "m_num_labels", + "Number of labels."); + this->m_parameters->add(&m_num_classes, "m_num_classes", + "Number of classes."); + + this->m_parameters->add_vector(&m_labels, &m_num_labels, "labels_array", + "The label vectors for all (num_labels) + outputs."); + */ m_num_labels = num_labels; m_num_classes = num_classes; diff --git a/src/shogun/lib/DynamicArray.h b/src/shogun/lib/DynamicArray.h index d57c92ba9a5..29fdc01bd1e 100644 --- a/src/shogun/lib/DynamicArray.h +++ b/src/shogun/lib/DynamicArray.h @@ -623,6 +623,8 @@ template 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); + SG_ADD(&m_array.resize_granularity, "resize_granularity", "shrink/grow step size.", MS_NOT_AVAILABLE); diff --git a/src/shogun/mathematics/linalg/linop/SparseMatrixOperator.cpp b/src/shogun/mathematics/linalg/linop/SparseMatrixOperator.cpp index ce8d86d35ae..396c03e0cc3 100644 --- a/src/shogun/mathematics/linalg/linop/SparseMatrixOperator.cpp +++ b/src/shogun/mathematics/linalg/linop/SparseMatrixOperator.cpp @@ -67,6 +67,10 @@ void CSparseMatrixOperator::init() this->m_parameters->add_vector(&m_operator.sparse_matrix, &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); + this->m_parameters->add(&m_operator.num_features, "m_operator.num_features", "Number of features."); } diff --git a/src/shogun/modelselection/ModelSelectionParameters.cpp b/src/shogun/modelselection/ModelSelectionParameters.cpp index b30a517ed51..cc1cf96fa09 100644 --- a/src/shogun/modelselection/ModelSelectionParameters.cpp +++ b/src/shogun/modelselection/ModelSelectionParameters.cpp @@ -229,6 +229,8 @@ CParameterCombination* CModelSelectionParameters::get_single_combination( (param_vect)[j] = ((float64_t*)m_values)[i]; } p->add_vector(¶m_vect, m_vector_length, m_node_name); + watch_param(m_node_name, ¶m_vect, m_vector_length); + break; } case MSPT_INT32_SGVECTOR: @@ -255,6 +257,8 @@ CParameterCombination* CModelSelectionParameters::get_single_combination( (param_vect)[j] = ((int32_t*)m_values)[i]; } p->add_vector(¶m_vect, m_vector_length, m_node_name); + watch_param(m_node_name, ¶m_vect, m_vector_length); + break; } case MSPT_FLOAT64: diff --git a/src/shogun/multiclass/ScatterSVM.cpp b/src/shogun/multiclass/ScatterSVM.cpp index d94a8a55201..b859daaebf3 100644 --- a/src/shogun/multiclass/ScatterSVM.cpp +++ b/src/shogun/multiclass/ScatterSVM.cpp @@ -45,8 +45,13 @@ CScatterSVM::~CScatterSVM() 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); + m_parameters->add_vector(&norm_wcw, &norm_wcw_len, "norm_wcw", "Norm of w_cw"); + watch_param("norm_wcw", &norm_wcw, &norm_wcw_len); + SG_ADD(&rho, "rho", "Scatter SVM rho", MS_NOT_AVAILABLE); SG_ADD(&m_num_classes, "m_num_classes", "Number of classes", MS_NOT_AVAILABLE); } diff --git a/src/shogun/preprocessor/RandomFourierGaussPreproc.cpp b/src/shogun/preprocessor/RandomFourierGaussPreproc.cpp index e782b3ba85e..20ee4156146 100644 --- a/src/shogun/preprocessor/RandomFourierGaussPreproc.cpp +++ b/src/shogun/preprocessor/RandomFourierGaussPreproc.cpp @@ -88,6 +88,10 @@ CRandomFourierGaussPreproc::CRandomFourierGaussPreproc() : SG_ADD(&cur_kernelwidth, "cur_kernelwidth", "Kernel width.", MS_AVAILABLE); m_parameters->add_vector(&randomcoeff_additive,&cur_dim_feature_space,"randomcoeff_additive"); + watch_param( + "randomcoeff_additive", &randomcoeff_additive, + &cur_dim_feature_space); + m_parameters->add_matrix(&randomcoeff_multiplicative,&cur_dim_feature_space,&cur_dim_input_space,"randomcoeff_multiplicative"); watch_param( "randomcoeff_multiplicative", &randomcoeff_multiplicative, @@ -120,6 +124,9 @@ CRandomFourierGaussPreproc::CRandomFourierGaussPreproc( SG_ADD(&cur_kernelwidth, "cur_kernelwidth", "Kernel width.", MS_AVAILABLE); m_parameters->add_vector(&randomcoeff_additive,&cur_dim_feature_space,"randomcoeff_additive"); + watch_param( + "randomcoeff_additive", &randomcoeff_additive, + &cur_dim_feature_space); m_parameters->add_matrix(&randomcoeff_multiplicative,&cur_dim_feature_space,&cur_dim_input_space,"randomcoeff_multiplicative"); watch_param( diff --git a/src/shogun/transfer/multitask/MultitaskKernelPlifNormalizer.h b/src/shogun/transfer/multitask/MultitaskKernelPlifNormalizer.h index 22f880eb485..a222f1b6446 100644 --- a/src/shogun/transfer/multitask/MultitaskKernelPlifNormalizer.h +++ b/src/shogun/transfer/multitask/MultitaskKernelPlifNormalizer.h @@ -328,6 +328,7 @@ class CMultitaskKernelPlifNormalizer: public CMultitaskKernelMklNormalizer { SG_ADD(&num_tasks, "num_tasks", "the number of tasks", MS_NOT_AVAILABLE); SG_ADD(&num_betas, "num_betas", "the number of weights", MS_NOT_AVAILABLE); + m_parameters->add_vector((SGString**)&distance_matrix, &num_tasksqr, "distance_matrix", "distance between tasks"); m_parameters->add_vector((SGString**)&similarity_matrix, &num_tasksqr, "similarity_matrix", "similarity between tasks"); m_parameters->add_vector((SGString**)&betas, &num_betas, "num_betas", "weights");