{"action":"created","comment":{"url":"https://api.github.com/repos/resibots/limbo/pulls/comments/78700175","id":78700175,"diff_hunk":"@@ -0,0 +1,115 @@\n+//| Copyright Inria May 2015\n+//| This project has received funding from the European Research Council (ERC) under\n+//| the European Union's Horizon 2020 research and innovation programme (grant\n+//| agreement No 637972) - see http://www.resibots.eu\n+//|\n+//| Contributor(s):\n+//|   - Jean-Baptiste Mouret (jean-baptiste.mouret@inria.fr)\n+//|   - Antoine Cully (antoinecully@gmail.com)\n+//|   - Kontantinos Chatzilygeroudis (konstantinos.chatzilygeroudis@inria.fr)\n+//|   - Federico Allocati (fede.allocati@gmail.com)\n+//|   - Vaios Papaspyros (b.papaspyros@gmail.com)\n+//|\n+//| This software is a computer library whose purpose is to optimize continuous,\n+//| black-box functions. It mainly implements Gaussian processes and Bayesian\n+//| optimization.\n+//| Main repository: http://github.com/resibots/limbo\n+//| Documentation: http://www.resibots.eu/limbo\n+//|\n+//| This software is governed by the CeCILL-C license under French law and\n+//| abiding by the rules of distribution of free software.  You can  use,\n+//| modify and/ or redistribute the software under the terms of the CeCILL-C\n+//| license as circulated by CEA, CNRS and INRIA at the following URL\n+//| \"http://www.cecill.info\".\n+//|\n+//| As a counterpart to the access to the source code and  rights to copy,\n+//| modify and redistribute granted by the license, users are provided only\n+//| with a limited warranty  and the software's author,  the holder of the\n+//| economic rights,  and the successive licensors  have only  limited\n+//| liability.\n+//|\n+//| In this respect, the user's attention is drawn to the risks associated\n+//| with loading,  using,  modifying and/or developing or reproducing the\n+//| software by the user in light of its specific status of free software,\n+//| that may mean  that it is complicated to manipulate,  and  that  also\n+//| therefore means  that it is reserved for developers  and  experienced\n+//| professionals having in-depth computer knowledge. Users are therefore\n+//| encouraged to load and test the software's suitability as regards their\n+//| requirements in conditions enabling the security of their systems and/or\n+//| data to be ensured and,  more generally, to use and operate it in the\n+//| same conditions as regards security.\n+//|\n+//| The fact that you are presently reading this means that you have had\n+//| knowledge of the CeCILL-C license and that you accept its terms.\n+//|\n+#ifndef LIMBO_ACQUI_EI_HPP\n+#define LIMBO_ACQUI_EI_HPP\n+\n+#include <cmath>\n+\n+#include <Eigen/Core>\n+\n+#include <limbo/tools/macros.hpp>\n+\n+namespace limbo {\n+    namespace defaults {\n+        struct acqui_ei {\n+            /// @ingroup acqui_defaults\n+            BO_PARAM(double, jitter, 0.0);\n+        };\n+    }\n+    namespace acqui {\n+        /** @ingroup acqui\n+        \\rst\n+        Classic EI (Expected Improvement). See :cite:`brochu2010tutorial`, p. 14\n+\n+          .. math::\n+            EI(x) = (\\mu(x) - f(x^+) - \\xi)\\Phi(Z) + \\sigma(x)\\phi(Z),\\\\\\text{with } Z = \\frac{\\mu(x)-f(x^+) - \\xi}{\\sigma(x)}.\n+\n+        Parameters:\n+          - ``double jitter`` - :math:`\\xi`\n+        \\endrst\n+        */\n+        template <typename Params, typename Model>\n+        class EI {\n+        public:\n+            EI(const Model& model, int iteration = 0) : _model(model) {}\n+\n+            size_t dim_in() const { return _model.dim_in(); }\n+\n+            size_t dim_out() const { return _model.dim_out(); }\n+\n+            template <typename AggregatorFunction>\n+            double operator()(const Eigen::VectorXd& v, const AggregatorFunction& afun) const\n+            {\n+                Eigen::VectorXd mu;\n+                double sigma_sq;\n+                std::tie(mu, sigma_sq) = _model.query(v);\n+                double sigma = std::sqrt(sigma_sq);\n+\n+                // If \\sigma(x) = 0 or we do not have any observation yet we return 0\n+                if (sigma < 1e-10 || _model.observations().size() < 1)\n+                    return 0.0;\n+\n+                // Compute EI(x)\n+                // First find the best so far observation","path":"src/limbo/acqui/ei.hpp","position":95,"original_position":95,"commit_id":"d4447703d56992cf2be38a7439f700ea176b1aca","original_commit_id":"d4447703d56992cf2be38a7439f700ea176b1aca","user":{"login":"costashatz","id":1283922,"avatar_url":"https://avatars.githubusercontent.com/u/1283922?v=3","gravatar_id":"","url":"https://api.github.com/users/costashatz","html_url":"https://github.com/costashatz","followers_url":"https://api.github.com/users/costashatz/followers","following_url":"https://api.github.com/users/costashatz/following{/other_user}","gists_url":"https://api.github.com/users/costashatz/gists{/gist_id}","starred_url":"https://api.github.com/users/costashatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/costashatz/subscriptions","organizations_url":"https://api.github.com/users/costashatz/orgs","repos_url":"https://api.github.com/users/costashatz/repos","events_url":"https://api.github.com/users/costashatz/events{/privacy}","received_events_url":"https://api.github.com/users/costashatz/received_events","type":"User","site_admin":false},"body":"> Instead of computing every time we call the acquisition function the best observation so far, maybe we can store the information in the GP. What do you think? I cannot really think of any multi-threading issue, but having more pair of eyes looking at this it is probably a good idea.\r\n\r\nIgnore it. In the noisy case, we need to take the max estimated mean of the samples. I am doing it now.","created_at":"2016-09-14T07:46:57Z","updated_at":"2016-09-14T07:46:57Z","html_url":"https://github.com/resibots/limbo/pull/158#discussion_r78700175","pull_request_url":"https://api.github.com/repos/resibots/limbo/pulls/158","_links":{"self":{"href":"https://api.github.com/repos/resibots/limbo/pulls/comments/78700175"},"html":{"href":"https://github.com/resibots/limbo/pull/158#discussion_r78700175"},"pull_request":{"href":"https://api.github.com/repos/resibots/limbo/pulls/158"}}},"pull_request":{"url":"https://api.github.com/repos/resibots/limbo/pulls/158","id":85136400,"html_url":"https://github.com/resibots/limbo/pull/158","diff_url":"https://github.com/resibots/limbo/pull/158.diff","patch_url":"https://github.com/resibots/limbo/pull/158.patch","issue_url":"https://api.github.com/repos/resibots/limbo/issues/158","number":158,"state":"open","locked":false,"title":"Expected Improvement","user":{"login":"costashatz","id":1283922,"avatar_url":"https://avatars.githubusercontent.com/u/1283922?v=3","gravatar_id":"","url":"https://api.github.com/users/costashatz","html_url":"https://github.com/costashatz","followers_url":"https://api.github.com/users/costashatz/followers","following_url":"https://api.github.com/users/costashatz/following{/other_user}","gists_url":"https://api.github.com/users/costashatz/gists{/gist_id}","starred_url":"https://api.github.com/users/costashatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/costashatz/subscriptions","organizations_url":"https://api.github.com/users/costashatz/orgs","repos_url":"https://api.github.com/users/costashatz/repos","events_url":"https://api.github.com/users/costashatz/events{/privacy}","received_events_url":"https://api.github.com/users/costashatz/received_events","type":"User","site_admin":false},"body":"I think we should have EI in our library and it would be good for the paper too. I need to work a little more on it.","created_at":"2016-09-13T22:22:35Z","updated_at":"2016-09-14T07:46:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f40574a9025afa4a5022ebfc8865d462be88c004","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/resibots/limbo/pulls/158/commits","review_comments_url":"https://api.github.com/repos/resibots/limbo/pulls/158/comments","review_comment_url":"https://api.github.com/repos/resibots/limbo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/resibots/limbo/issues/158/comments","statuses_url":"https://api.github.com/repos/resibots/limbo/statuses/d4447703d56992cf2be38a7439f700ea176b1aca","head":{"label":"resibots:acqui_ei","ref":"acqui_ei","sha":"d4447703d56992cf2be38a7439f700ea176b1aca","user":{"login":"resibots","id":13557617,"avatar_url":"https://avatars.githubusercontent.com/u/13557617?v=3","gravatar_id":"","url":"https://api.github.com/users/resibots","html_url":"https://github.com/resibots","followers_url":"https://api.github.com/users/resibots/followers","following_url":"https://api.github.com/users/resibots/following{/other_user}","gists_url":"https://api.github.com/users/resibots/gists{/gist_id}","starred_url":"https://api.github.com/users/resibots/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resibots/subscriptions","organizations_url":"https://api.github.com/users/resibots/orgs","repos_url":"https://api.github.com/users/resibots/repos","events_url":"https://api.github.com/users/resibots/events{/privacy}","received_events_url":"https://api.github.com/users/resibots/received_events","type":"Organization","site_admin":false},"repo":{"id":22070431,"name":"limbo","full_name":"resibots/limbo","owner":{"login":"resibots","id":13557617,"avatar_url":"https://avatars.githubusercontent.com/u/13557617?v=3","gravatar_id":"","url":"https://api.github.com/users/resibots","html_url":"https://github.com/resibots","followers_url":"https://api.github.com/users/resibots/followers","following_url":"https://api.github.com/users/resibots/following{/other_user}","gists_url":"https://api.github.com/users/resibots/gists{/gist_id}","starred_url":"https://api.github.com/users/resibots/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resibots/subscriptions","organizations_url":"https://api.github.com/users/resibots/orgs","repos_url":"https://api.github.com/users/resibots/repos","events_url":"https://api.github.com/users/resibots/events{/privacy}","received_events_url":"https://api.github.com/users/resibots/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/resibots/limbo","description":"A lightweight framework for GP-based Bayesian optimisation of black-box functions (C++-11)","fork":false,"url":"https://api.github.com/repos/resibots/limbo","forks_url":"https://api.github.com/repos/resibots/limbo/forks","keys_url":"https://api.github.com/repos/resibots/limbo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/resibots/limbo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/resibots/limbo/teams","hooks_url":"https://api.github.com/repos/resibots/limbo/hooks","issue_events_url":"https://api.github.com/repos/resibots/limbo/issues/events{/number}","events_url":"https://api.github.com/repos/resibots/limbo/events","assignees_url":"https://api.github.com/repos/resibots/limbo/assignees{/user}","branches_url":"https://api.github.com/repos/resibots/limbo/branches{/branch}","tags_url":"https://api.github.com/repos/resibots/limbo/tags","blobs_url":"https://api.github.com/repos/resibots/limbo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/resibots/limbo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/resibots/limbo/git/refs{/sha}","trees_url":"https://api.github.com/repos/resibots/limbo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/resibots/limbo/statuses/{sha}","languages_url":"https://api.github.com/repos/resibots/limbo/languages","stargazers_url":"https://api.github.com/repos/resibots/limbo/stargazers","contributors_url":"https://api.github.com/repos/resibots/limbo/contributors","subscribers_url":"https://api.github.com/repos/resibots/limbo/subscribers","subscription_url":"https://api.github.com/repos/resibots/limbo/subscription","commits_url":"https://api.github.com/repos/resibots/limbo/commits{/sha}","git_commits_url":"https://api.github.com/repos/resibots/limbo/git/commits{/sha}","comments_url":"https://api.github.com/repos/resibots/limbo/comments{/number}","issue_comment_url":"https://api.github.com/repos/resibots/limbo/issues/comments{/number}","contents_url":"https://api.github.com/repos/resibots/limbo/contents/{+path}","compare_url":"https://api.github.com/repos/resibots/limbo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/resibots/limbo/merges","archive_url":"https://api.github.com/repos/resibots/limbo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/resibots/limbo/downloads","issues_url":"https://api.github.com/repos/resibots/limbo/issues{/number}","pulls_url":"https://api.github.com/repos/resibots/limbo/pulls{/number}","milestones_url":"https://api.github.com/repos/resibots/limbo/milestones{/number}","notifications_url":"https://api.github.com/repos/resibots/limbo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/resibots/limbo/labels{/name}","releases_url":"https://api.github.com/repos/resibots/limbo/releases{/id}","deployments_url":"https://api.github.com/repos/resibots/limbo/deployments","created_at":"2014-07-21T15:52:35Z","updated_at":"2016-09-08T02:53:32Z","pushed_at":"2016-09-13T22:44:33Z","git_url":"git://github.com/resibots/limbo.git","ssh_url":"git@github.com:resibots/limbo.git","clone_url":"https://github.com/resibots/limbo.git","svn_url":"https://github.com/resibots/limbo","homepage":"http://www.resibots.eu/limbo","size":19531,"stargazers_count":7,"watchers_count":7,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":4,"mirror_url":null,"open_issues_count":9,"forks":4,"open_issues":9,"watchers":7,"default_branch":"master"}},"base":{"label":"resibots:master","ref":"master","sha":"42d9ccac68017edcdff289179474db7c9d62c4c3","user":{"login":"resibots","id":13557617,"avatar_url":"https://avatars.githubusercontent.com/u/13557617?v=3","gravatar_id":"","url":"https://api.github.com/users/resibots","html_url":"https://github.com/resibots","followers_url":"https://api.github.com/users/resibots/followers","following_url":"https://api.github.com/users/resibots/following{/other_user}","gists_url":"https://api.github.com/users/resibots/gists{/gist_id}","starred_url":"https://api.github.com/users/resibots/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resibots/subscriptions","organizations_url":"https://api.github.com/users/resibots/orgs","repos_url":"https://api.github.com/users/resibots/repos","events_url":"https://api.github.com/users/resibots/events{/privacy}","received_events_url":"https://api.github.com/users/resibots/received_events","type":"Organization","site_admin":false},"repo":{"id":22070431,"name":"limbo","full_name":"resibots/limbo","owner":{"login":"resibots","id":13557617,"avatar_url":"https://avatars.githubusercontent.com/u/13557617?v=3","gravatar_id":"","url":"https://api.github.com/users/resibots","html_url":"https://github.com/resibots","followers_url":"https://api.github.com/users/resibots/followers","following_url":"https://api.github.com/users/resibots/following{/other_user}","gists_url":"https://api.github.com/users/resibots/gists{/gist_id}","starred_url":"https://api.github.com/users/resibots/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resibots/subscriptions","organizations_url":"https://api.github.com/users/resibots/orgs","repos_url":"https://api.github.com/users/resibots/repos","events_url":"https://api.github.com/users/resibots/events{/privacy}","received_events_url":"https://api.github.com/users/resibots/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/resibots/limbo","description":"A lightweight framework for GP-based Bayesian optimisation of black-box functions (C++-11)","fork":false,"url":"https://api.github.com/repos/resibots/limbo","forks_url":"https://api.github.com/repos/resibots/limbo/forks","keys_url":"https://api.github.com/repos/resibots/limbo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/resibots/limbo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/resibots/limbo/teams","hooks_url":"https://api.github.com/repos/resibots/limbo/hooks","issue_events_url":"https://api.github.com/repos/resibots/limbo/issues/events{/number}","events_url":"https://api.github.com/repos/resibots/limbo/events","assignees_url":"https://api.github.com/repos/resibots/limbo/assignees{/user}","branches_url":"https://api.github.com/repos/resibots/limbo/branches{/branch}","tags_url":"https://api.github.com/repos/resibots/limbo/tags","blobs_url":"https://api.github.com/repos/resibots/limbo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/resibots/limbo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/resibots/limbo/git/refs{/sha}","trees_url":"https://api.github.com/repos/resibots/limbo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/resibots/limbo/statuses/{sha}","languages_url":"https://api.github.com/repos/resibots/limbo/languages","stargazers_url":"https://api.github.com/repos/resibots/limbo/stargazers","contributors_url":"https://api.github.com/repos/resibots/limbo/contributors","subscribers_url":"https://api.github.com/repos/resibots/limbo/subscribers","subscription_url":"https://api.github.com/repos/resibots/limbo/subscription","commits_url":"https://api.github.com/repos/resibots/limbo/commits{/sha}","git_commits_url":"https://api.github.com/repos/resibots/limbo/git/commits{/sha}","comments_url":"https://api.github.com/repos/resibots/limbo/comments{/number}","issue_comment_url":"https://api.github.com/repos/resibots/limbo/issues/comments{/number}","contents_url":"https://api.github.com/repos/resibots/limbo/contents/{+path}","compare_url":"https://api.github.com/repos/resibots/limbo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/resibots/limbo/merges","archive_url":"https://api.github.com/repos/resibots/limbo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/resibots/limbo/downloads","issues_url":"https://api.github.com/repos/resibots/limbo/issues{/number}","pulls_url":"https://api.github.com/repos/resibots/limbo/pulls{/number}","milestones_url":"https://api.github.com/repos/resibots/limbo/milestones{/number}","notifications_url":"https://api.github.com/repos/resibots/limbo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/resibots/limbo/labels{/name}","releases_url":"https://api.github.com/repos/resibots/limbo/releases{/id}","deployments_url":"https://api.github.com/repos/resibots/limbo/deployments","created_at":"2014-07-21T15:52:35Z","updated_at":"2016-09-08T02:53:32Z","pushed_at":"2016-09-13T22:44:33Z","git_url":"git://github.com/resibots/limbo.git","ssh_url":"git@github.com:resibots/limbo.git","clone_url":"https://github.com/resibots/limbo.git","svn_url":"https://github.com/resibots/limbo","homepage":"http://www.resibots.eu/limbo","size":19531,"stargazers_count":7,"watchers_count":7,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":4,"mirror_url":null,"open_issues_count":9,"forks":4,"open_issues":9,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/resibots/limbo/pulls/158"},"html":{"href":"https://github.com/resibots/limbo/pull/158"},"issue":{"href":"https://api.github.com/repos/resibots/limbo/issues/158"},"comments":{"href":"https://api.github.com/repos/resibots/limbo/issues/158/comments"},"review_comments":{"href":"https://api.github.com/repos/resibots/limbo/pulls/158/comments"},"review_comment":{"href":"https://api.github.com/repos/resibots/limbo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/resibots/limbo/pulls/158/commits"},"statuses":{"href":"https://api.github.com/repos/resibots/limbo/statuses/d4447703d56992cf2be38a7439f700ea176b1aca"}}}}
{"actor":{"display_login":"costashatz"}}