Skip to content

Commit

Permalink
Merge pull request #3413 from sorig/fix_example_literal_types
Browse files Browse the repository at this point in the history
Fix literal types of meta examples
  • Loading branch information
vigsterkr committed Aug 11, 2016
2 parents c45f8b0 + a7e7fec commit 39e32b6
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion examples/meta/src/binary_classifier/kernel_svm.sg
Expand Up @@ -11,7 +11,7 @@ BinaryLabels labels_test(f_labels_test)
#![create_features]

#![set_parameters]
real C = 1
real C = 1.0
real epsilon = 0.001
GaussianKernel gauss_kernel(features_train, features_train, 15)
#![set_parameters]
Expand Down
2 changes: 1 addition & 1 deletion examples/meta/src/binary_classifier/linear_svm.sg
Expand Up @@ -11,7 +11,7 @@ BinaryLabels labels_test(f_labels_test)
#![create_features]

#![set_parameters]
real C = 1
real C = 1.0
real epsilon = 0.001
#![set_parameters]

Expand Down
Expand Up @@ -12,7 +12,7 @@ MulticlassLabels labels_test(f_labels_test)
#![create_features]

#![create_appropriate_kernel_and_mean_function]
GaussianKernel kernel(2)
GaussianKernel kernel(2.0)
ConstMean mean_function()
#![create_appropriate_kernel_and_mean_function]

Expand Down
Expand Up @@ -11,7 +11,7 @@ RegressionLabels labels_test(f_labels_test)
#![create_features]

#![create_appropriate_kernel_and_mean_function]
real width = 1
real width = 1.0
GaussianKernel kernel(features_train, features_train, width)
ZeroMean mean_function()
#![create_appropriate_kernel_and_mean_function]
Expand Down
4 changes: 2 additions & 2 deletions examples/meta/src/meta_api/matrix_types.sg
Expand Up @@ -24,8 +24,8 @@ long_int_matrix[1,0]=1
long_int_matrix[0,0]=long_int_matrix[1,0]

ShortRealMatrix short_real_matrix(2,1)
short_real_matrix[0,0]=0
short_real_matrix[1,0]=1
short_real_matrix[0,0]=0.0f
short_real_matrix[1,0]=1.0f
short_real_matrix[0,0]=short_real_matrix[1,0]

RealMatrix real_matrix(2,1)
Expand Down
4 changes: 2 additions & 2 deletions examples/meta/src/meta_api/vector_types.sg
Expand Up @@ -24,8 +24,8 @@ long_int_vector[1]=1
long_int_vector[0]=long_int_vector[1]

ShortRealVector short_real_vector(2)
short_real_vector[0]=0
short_real_vector[1]=1
short_real_vector[0]=0.0f
short_real_vector[1]=1.0f
short_real_vector[0]=short_real_vector[1]

RealVector real_vector(2)
Expand Down
2 changes: 1 addition & 1 deletion examples/meta/src/multiclass_classifier/svm.sg
Expand Up @@ -11,7 +11,7 @@ MulticlassLabels labels_test(f_labels_test)
#![create_features]

#![set_parameters]
real C = 1
real C = 1.0
real epsilon = 0.0001
GaussianKernel gauss_kernel(features_train, features_train, 15)
#![set_parameters]
Expand Down
Expand Up @@ -30,7 +30,7 @@ network.initialize_neural_network()
#![set_parameters]
network.set_l2_coefficient(0.1)
network.set_max_num_epochs(40)
network.set_epsilon(0)
network.set_epsilon(0.0)
network.set_gd_learning_rate(0.1)
network.set_gd_momentum(0.9)
#![set_parameters]
Expand Down
2 changes: 1 addition & 1 deletion examples/meta/src/regression/kernel_ridge_regression.sg
Expand Up @@ -11,7 +11,7 @@ RegressionLabels labels_test(f_labels_test)
#![create_features]

#![create_appropriate_kernel]
real width = 1
real width = 1.0
GaussianKernel kernel(features_train, features_train, width)
#![create_appropriate_kernel]

Expand Down
6 changes: 3 additions & 3 deletions examples/meta/src/regression/multiple_kernel_learning.sg
Expand Up @@ -12,8 +12,8 @@ RegressionLabels labels_test(f_labels_test)

#![create_kernel]
PolyKernel poly_kernel(10,2)
GaussianKernel gauss_kernel_1(2)
GaussianKernel gauss_kernel_2(3)
GaussianKernel gauss_kernel_1(2.0)
GaussianKernel gauss_kernel_2(3.0)
#![create_kernel]

#![create_combined_train]
Expand Down Expand Up @@ -48,4 +48,4 @@ real mse = error.evaluate(labels_predict, labels_test)
#![evaluate_error]

# additional integration testing variables
RealVector output = labels_predict.get_labels()
RealVector output = labels_predict.get_labels()
4 changes: 2 additions & 2 deletions examples/meta/src/regression/support_vector_regression.sg
Expand Up @@ -11,12 +11,12 @@ RegressionLabels labels_test(f_labels_test)
#![create_features]

#![create_appropriate_kernel]
real width = 1
real width = 1.0
GaussianKernel kernel(width)
#![create_appropriate_kernel]

#![create_instance]
real svm_c = 1
real svm_c = 1.0
real svr_param = 0.1
LibSVR svr(svm_c, svr_param, kernel, labels_train, enum LIBSVR_SOLVER_TYPE.LIBSVR_EPSILON_SVR)
#![create_instance]
Expand Down

0 comments on commit 39e32b6

Please sign in to comment.