Skip to content

Commit

Permalink
replaced put with init in kernel
Browse files Browse the repository at this point in the history
example implementation


renamed const to readonly


t

t
  • Loading branch information
gf712 committed Mar 3, 2019
1 parent ca6c1e9 commit fa82eb3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -294,4 +294,3 @@ $RECYCLE.BIN/
# -*- mode: gitignore; -*-
# -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8
cmake-*/
3 changes: 2 additions & 1 deletion examples/meta/src/gaussian_process/regression.sg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ Labels labels_test = labels(f_labels_test)
#![create_features]

#![create_appropriate_kernel_and_mean_function]
Kernel k = kernel("GaussianKernel", lhs=features_train, rhs=features_train, log_width=0.0)
Kernel k = kernel("GaussianKernel", log_width=0.0)
k.init(features_train, features_train)
MeanFunction mean = gp_mean("ZeroMean")
#![create_appropriate_kernel_and_mean_function]

Expand Down
3 changes: 2 additions & 1 deletion examples/meta/src/gaussian_process/sparse_regression.sg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ RegressionLabels labels_test(f_labels_test)
#![create_features]

#![create_kernel_and_mean_function]
Kernel k = kernel("GaussianKernel", lhs=features_train, rhs=features_train, log_width=0.0)
Kernel k = kernel("GaussianKernel", log_width=0.0)
k.init(features_train, features_train)
ZeroMean mean_function()
#![create_kernel_and_mean_function]

Expand Down
5 changes: 3 additions & 2 deletions src/shogun/kernel/Kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -924,9 +924,10 @@ void CKernel::register_params()
&lhs, "lhs", "Feature vectors to occur on left hand side.",
ParameterProperties::READONLY);
SG_ADD(
&rhs, "rhs", "Feature vectors to occur on right hand side.");
&rhs, "rhs", "Feature vectors to occur on right hand side.",
ParameterProperties::READONLY);
SG_ADD(&lhs_equals_rhs, "lhs_equals_rhs",
"If features on lhs are the same as on rhs.");
"If features on lhs are the same as on rhs.");
SG_ADD(&num_lhs, "num_lhs", "Number of feature vectors on left hand side.");
SG_ADD(
&num_rhs, "num_rhs", "Number of feature vectors on right hand side.");
Expand Down

0 comments on commit fa82eb3

Please sign in to comment.