Commit f174fea9 authored by Dmitry Bagaev's avatar Dmitry Bagaev
Browse files

update

parent efec2e55
......@@ -171,7 +171,7 @@ int main(int argc, char **argv) {
if (rank == 0) std::cout << "Solving with " << solverName << std::endl;
TTSP::OptimizationParameter tau("tau", std::make_pair(-3, -1.0), 0.05, -2, TTSP::OptimizationParameterType::PARAMETER_TYPE_EXPONENT);
TTSP::OptimizationParameter tau("tau", std::make_pair(-3, -0.1), 0.05, -2, TTSP::OptimizationParameterType::PARAMETER_TYPE_EXPONENT);
//TTSP::OptimizationParameter q("q", {0, 1, 2, 3, 4}, 2);
//TTSP::OptimizationParameter eps("eps", {1e-7, 1e-6, 1e-5, 1e-4, 1e-3}, 1e-5);
TTSP::OptimizationParameterEntries entries;
......
......@@ -79,7 +79,19 @@ namespace TTSP {
});
samples.push_back(sample);
observations.push_back(limbo::tools::make_vector(-1000.0 * result.GetMetricsAfter()));
observations.push_back(limbo::tools::make_vector(-1.0 * result.GetMetricsAfter()));
});
double min_observation = (*std::min_element(observations.cbegin(), observations.cend(), [](const Eigen::VectorXd &l, const Eigen::VectorXd &r) {
return l(0) < r(0);
}))(0);
double max_observation = (*std::max_element(observations.cbegin(), observations.cend(), [](const Eigen::VectorXd &l, const Eigen::VectorXd &r) {
return l(0) < r(0);
}))(0);
std::transform(observations.cbegin(), observations.cend(), observations.begin(), [min_observation, max_observation](const Eigen::VectorXd &ob) {
return limbo::tools::make_vector((ob(0) - min_observation) / (max_observation - min_observation));
});
......@@ -105,15 +117,13 @@ namespace TTSP {
double min_bound = parameter.GetMinimalValue();
double max_bound = parameter.GetMaximumValue();
starting_point(i) = (entry.first.GetDefaultValue() - min_bound) / (max_bound - min_bound);
starting_point(i) = (entry.second - min_bound) / (max_bound - min_bound);
i += 1;
});
Eigen::VectorXd new_sample = acquiopt(acqui_optimization, starting_point, true);
std::cout << "Sample: " << new_sample << std::endl;
for (int k = 0; k < parameters.Size(); ++k) {
auto parameter = parameters.GetParameter(static_cast<size_t>(k));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment