Skip to content
Snippets Groups Projects
Commit 17bae2fd authored by Thomas Purcell's avatar Thomas Purcell
Browse files

Merge branch 'param_abs_test_fail' into 'master'

The paramAbsNode test should pass

See merge request tpurcell/cpp_sisso!55
parents 36bbb5e9 105e81d7
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,7 @@ protected:
void SetUp() override
{
nlopt_wrapper::MAX_PARAM_DEPTH = 2;
nlopt::srand(13);
_task_sizes_train = {900};
_task_sizes_test = {100};
......@@ -38,26 +38,22 @@ protected:
std::vector<double> value_1(_task_sizes_train[0], 0.0);
std::vector<double> test_value_1(_task_sizes_test[0], 0.0);
std::default_random_engine generator(0);
nlopt::srand(42);
std::uniform_real_distribution<double> distribution_feats(-50.0, 50.0);
std::uniform_real_distribution<double> distribution_params(-2.00, 2.00);
for (int ii = 0; ii < _task_sizes_train[0]; ++ii)
{
value_1[ii] = std::exp(distribution_feats(generator));
value_1[ii] = std::exp(ii / 900.0 * 100.0 - 50.0);
}
for (int ii = 0; ii < _task_sizes_test[0]; ++ii)
{
test_value_1[ii] = std::exp(distribution_feats(generator));
test_value_1[ii] = std::exp(ii / 103.0 * 100.0 - 50.0);
}
_feat_1 = std::make_shared<FeatureNode>(0, "A", value_1, test_value_1, Unit("m^3"));
node_ptr feat_2 = std::make_shared<LogNode>(_feat_1, 1);
_phi = {_feat_1, feat_2};
_a = distribution_params(generator);
_a = -3.5;
_alpha = 1.0;
_prop = std::vector<double>(_task_sizes_train[0], 0.0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment