{"action":"created","comment":{"url":"https://api.github.com/repos/fetchai/ledger/pulls/comments/350915891","pull_request_review_id":323200834,"id":350915891,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM1MDkxNTg5MQ==","diff_hunk":"@@ -259,11 +298,33 @@ void Model<TensorType>::Predict(TensorType &input, TensorType &output)\n }\n \n template <typename TensorType>\n-typename Model<TensorType>::DataType Model<TensorType>::Evaluate(\n-    std::vector<MetricType> const &metrics)\n+typename Model<TensorType>::DataVectorType Model<TensorType>::Evaluate(\n+    dataloaders::DataLoaderMode dl_mode, SizeType batch_size)\n {\n-  FETCH_UNUSED(metrics);\n-  return loss_;\n+  if (!compiled_)\n+  {\n+    throw ml::exceptions::InvalidMode(\"must compile model before evaluating\");\n+  }\n+\n+  dataloader_ptr_->SetMode(dl_mode);\n+  bool is_done_set;\n+  if (batch_size == 0)\n+  {\n+    batch_size = dataloader_ptr_->Size();\n+  }\n+  auto evaluate_pair = dataloader_ptr_->PrepareBatch(batch_size, is_done_set);\n+\n+  this->graph_ptr_->SetInput(label_, evaluate_pair.first);\n+  this->graph_ptr_->SetInput(input_, evaluate_pair.second.at(0));\n+\n+  DataVectorType ret;\n+  ret.emplace_back(*(this->graph_ptr_->Evaluate(error_).cbegin()));\n+\n+  for (auto const &met : metrics_)\n+  {\n+    ret.emplace_back(*(this->graph_ptr_->Evaluate(met).cbegin()));","path":"libs/ml/include/ml/model/model.hpp","position":166,"original_position":166,"commit_id":"4e0615f063c045a1b5d2e1847fc53686cde1a8db","original_commit_id":"4e0615f063c045a1b5d2e1847fc53686cde1a8db","user":{"login":"baykaner","id":40827646,"node_id":"MDQ6VXNlcjQwODI3NjQ2","avatar_url":"https://avatars0.githubusercontent.com/u/40827646?v=4","gravatar_id":"","url":"https://api.github.com/users/baykaner","html_url":"https://github.com/baykaner","followers_url":"https://api.github.com/users/baykaner/followers","following_url":"https://api.github.com/users/baykaner/following{/other_user}","gists_url":"https://api.github.com/users/baykaner/gists{/gist_id}","starred_url":"https://api.github.com/users/baykaner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baykaner/subscriptions","organizations_url":"https://api.github.com/users/baykaner/orgs","repos_url":"https://api.github.com/users/baykaner/repos","events_url":"https://api.github.com/users/baykaner/events{/privacy}","received_events_url":"https://api.github.com/users/baykaner/received_events","type":"User","site_admin":false},"body":"have you confirmed (via debugging or benchmarking) that the caching is doing it's job as we are hoping here - i.e. that these evaluate calls are very cheap. if not, please step through in debugging at least and just check it works how we expect.","created_at":"2019-11-26T18:40:06Z","updated_at":"2019-11-26T18:47:35Z","html_url":"https://github.com/fetchai/ledger/pull/2024#discussion_r350915891","pull_request_url":"https://api.github.com/repos/fetchai/ledger/pulls/2024","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/fetchai/ledger/pulls/comments/350915891"},"html":{"href":"https://github.com/fetchai/ledger/pull/2024#discussion_r350915891"},"pull_request":{"href":"https://api.github.com/repos/fetchai/ledger/pulls/2024"}}},"pull_request":{"url":"https://api.github.com/repos/fetchai/ledger/pulls/2024","id":345828978,"node_id":"MDExOlB1bGxSZXF1ZXN0MzQ1ODI4OTc4","html_url":"https://github.com/fetchai/ledger/pull/2024","diff_url":"https://github.com/fetchai/ledger/pull/2024.diff","patch_url":"https://github.com/fetchai/ledger/pull/2024.patch","issue_url":"https://api.github.com/repos/fetchai/ledger/issues/2024","number":2024,"state":"open","locked":false,"title":"Add metrics for model","user":{"login":"EVSmithFetchAI","id":51610983,"node_id":"MDQ6VXNlcjUxNjEwOTgz","avatar_url":"https://avatars2.githubusercontent.com/u/51610983?v=4","gravatar_id":"","url":"https://api.github.com/users/EVSmithFetchAI","html_url":"https://github.com/EVSmithFetchAI","followers_url":"https://api.github.com/users/EVSmithFetchAI/followers","following_url":"https://api.github.com/users/EVSmithFetchAI/following{/other_user}","gists_url":"https://api.github.com/users/EVSmithFetchAI/gists{/gist_id}","starred_url":"https://api.github.com/users/EVSmithFetchAI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EVSmithFetchAI/subscriptions","organizations_url":"https://api.github.com/users/EVSmithFetchAI/orgs","repos_url":"https://api.github.com/users/EVSmithFetchAI/repos","events_url":"https://api.github.com/users/EVSmithFetchAI/events{/privacy}","received_events_url":"https://api.github.com/users/EVSmithFetchAI/received_events","type":"User","site_admin":false},"body":"Model can now have metrics specified at compile time, and the result of these is reported when Evaluate is called.","created_at":"2019-11-26T16:36:31Z","updated_at":"2019-11-26T18:47:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"734bc19cb243c762dcf47c513e2dee7e502d17c7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/fetchai/ledger/pulls/2024/commits","review_comments_url":"https://api.github.com/repos/fetchai/ledger/pulls/2024/comments","review_comment_url":"https://api.github.com/repos/fetchai/ledger/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fetchai/ledger/issues/2024/comments","statuses_url":"https://api.github.com/repos/fetchai/ledger/statuses/4e0615f063c045a1b5d2e1847fc53686cde1a8db","head":{"label":"EVSmithFetchAI:metrics_for_model","ref":"metrics_for_model","sha":"4e0615f063c045a1b5d2e1847fc53686cde1a8db","user":{"login":"EVSmithFetchAI","id":51610983,"node_id":"MDQ6VXNlcjUxNjEwOTgz","avatar_url":"https://avatars2.githubusercontent.com/u/51610983?v=4","gravatar_id":"","url":"https://api.github.com/users/EVSmithFetchAI","html_url":"https://github.com/EVSmithFetchAI","followers_url":"https://api.github.com/users/EVSmithFetchAI/followers","following_url":"https://api.github.com/users/EVSmithFetchAI/following{/other_user}","gists_url":"https://api.github.com/users/EVSmithFetchAI/gists{/gist_id}","starred_url":"https://api.github.com/users/EVSmithFetchAI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EVSmithFetchAI/subscriptions","organizations_url":"https://api.github.com/users/EVSmithFetchAI/orgs","repos_url":"https://api.github.com/users/EVSmithFetchAI/repos","events_url":"https://api.github.com/users/EVSmithFetchAI/events{/privacy}","received_events_url":"https://api.github.com/users/EVSmithFetchAI/received_events","type":"User","site_admin":false},"repo":{"id":191190384,"node_id":"MDEwOlJlcG9zaXRvcnkxOTExOTAzODQ=","name":"ledger","full_name":"EVSmithFetchAI/ledger","private":false,"owner":{"login":"EVSmithFetchAI","id":51610983,"node_id":"MDQ6VXNlcjUxNjEwOTgz","avatar_url":"https://avatars2.githubusercontent.com/u/51610983?v=4","gravatar_id":"","url":"https://api.github.com/users/EVSmithFetchAI","html_url":"https://github.com/EVSmithFetchAI","followers_url":"https://api.github.com/users/EVSmithFetchAI/followers","following_url":"https://api.github.com/users/EVSmithFetchAI/following{/other_user}","gists_url":"https://api.github.com/users/EVSmithFetchAI/gists{/gist_id}","starred_url":"https://api.github.com/users/EVSmithFetchAI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EVSmithFetchAI/subscriptions","organizations_url":"https://api.github.com/users/EVSmithFetchAI/orgs","repos_url":"https://api.github.com/users/EVSmithFetchAI/repos","events_url":"https://api.github.com/users/EVSmithFetchAI/events{/privacy}","received_events_url":"https://api.github.com/users/EVSmithFetchAI/received_events","type":"User","site_admin":false},"html_url":"https://github.com/EVSmithFetchAI/ledger","description":"Official Fetch.AI Ledger C++ implementation","fork":true,"url":"https://api.github.com/repos/EVSmithFetchAI/ledger","forks_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/forks","keys_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/teams","hooks_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/hooks","issue_events_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/issues/events{/number}","events_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/events","assignees_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/assignees{/user}","branches_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/branches{/branch}","tags_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/tags","blobs_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/git/refs{/sha}","trees_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/statuses/{sha}","languages_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/languages","stargazers_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/stargazers","contributors_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/contributors","subscribers_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/subscribers","subscription_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/subscription","commits_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/commits{/sha}","git_commits_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/git/commits{/sha}","comments_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/comments{/number}","issue_comment_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/issues/comments{/number}","contents_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/contents/{+path}","compare_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/merges","archive_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/downloads","issues_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/issues{/number}","pulls_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/pulls{/number}","milestones_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/milestones{/number}","notifications_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/labels{/name}","releases_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/releases{/id}","deployments_url":"https://api.github.com/repos/EVSmithFetchAI/ledger/deployments","created_at":"2019-06-10T15:04:27Z","updated_at":"2019-11-01T13:34:35Z","pushed_at":"2019-11-26T18:20:09Z","git_url":"git://github.com/EVSmithFetchAI/ledger.git","ssh_url":"git@github.com:EVSmithFetchAI/ledger.git","clone_url":"https://github.com/EVSmithFetchAI/ledger.git","svn_url":"https://github.com/EVSmithFetchAI/ledger","homepage":"https://fetch.ai","size":32892,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"fetchai:master","ref":"master","sha":"21104751d80785ecacaa374521a236e8c01c972c","user":{"login":"fetchai","id":40889903,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwODg5OTAz","avatar_url":"https://avatars3.githubusercontent.com/u/40889903?v=4","gravatar_id":"","url":"https://api.github.com/users/fetchai","html_url":"https://github.com/fetchai","followers_url":"https://api.github.com/users/fetchai/followers","following_url":"https://api.github.com/users/fetchai/following{/other_user}","gists_url":"https://api.github.com/users/fetchai/gists{/gist_id}","starred_url":"https://api.github.com/users/fetchai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fetchai/subscriptions","organizations_url":"https://api.github.com/users/fetchai/orgs","repos_url":"https://api.github.com/users/fetchai/repos","events_url":"https://api.github.com/users/fetchai/events{/privacy}","received_events_url":"https://api.github.com/users/fetchai/received_events","type":"Organization","site_admin":false},"repo":{"id":117567381,"node_id":"MDEwOlJlcG9zaXRvcnkxMTc1NjczODE=","name":"ledger","full_name":"fetchai/ledger","private":false,"owner":{"login":"fetchai","id":40889903,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQwODg5OTAz","avatar_url":"https://avatars3.githubusercontent.com/u/40889903?v=4","gravatar_id":"","url":"https://api.github.com/users/fetchai","html_url":"https://github.com/fetchai","followers_url":"https://api.github.com/users/fetchai/followers","following_url":"https://api.github.com/users/fetchai/following{/other_user}","gists_url":"https://api.github.com/users/fetchai/gists{/gist_id}","starred_url":"https://api.github.com/users/fetchai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fetchai/subscriptions","organizations_url":"https://api.github.com/users/fetchai/orgs","repos_url":"https://api.github.com/users/fetchai/repos","events_url":"https://api.github.com/users/fetchai/events{/privacy}","received_events_url":"https://api.github.com/users/fetchai/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/fetchai/ledger","description":"Official Fetch.AI Ledger C++ implementation","fork":false,"url":"https://api.github.com/repos/fetchai/ledger","forks_url":"https://api.github.com/repos/fetchai/ledger/forks","keys_url":"https://api.github.com/repos/fetchai/ledger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fetchai/ledger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fetchai/ledger/teams","hooks_url":"https://api.github.com/repos/fetchai/ledger/hooks","issue_events_url":"https://api.github.com/repos/fetchai/ledger/issues/events{/number}","events_url":"https://api.github.com/repos/fetchai/ledger/events","assignees_url":"https://api.github.com/repos/fetchai/ledger/assignees{/user}","branches_url":"https://api.github.com/repos/fetchai/ledger/branches{/branch}","tags_url":"https://api.github.com/repos/fetchai/ledger/tags","blobs_url":"https://api.github.com/repos/fetchai/ledger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fetchai/ledger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fetchai/ledger/git/refs{/sha}","trees_url":"https://api.github.com/repos/fetchai/ledger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fetchai/ledger/statuses/{sha}","languages_url":"https://api.github.com/repos/fetchai/ledger/languages","stargazers_url":"https://api.github.com/repos/fetchai/ledger/stargazers","contributors_url":"https://api.github.com/repos/fetchai/ledger/contributors","subscribers_url":"https://api.github.com/repos/fetchai/ledger/subscribers","subscription_url":"https://api.github.com/repos/fetchai/ledger/subscription","commits_url":"https://api.github.com/repos/fetchai/ledger/commits{/sha}","git_commits_url":"https://api.github.com/repos/fetchai/ledger/git/commits{/sha}","comments_url":"https://api.github.com/repos/fetchai/ledger/comments{/number}","issue_comment_url":"https://api.github.com/repos/fetchai/ledger/issues/comments{/number}","contents_url":"https://api.github.com/repos/fetchai/ledger/contents/{+path}","compare_url":"https://api.github.com/repos/fetchai/ledger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fetchai/ledger/merges","archive_url":"https://api.github.com/repos/fetchai/ledger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fetchai/ledger/downloads","issues_url":"https://api.github.com/repos/fetchai/ledger/issues{/number}","pulls_url":"https://api.github.com/repos/fetchai/ledger/pulls{/number}","milestones_url":"https://api.github.com/repos/fetchai/ledger/milestones{/number}","notifications_url":"https://api.github.com/repos/fetchai/ledger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fetchai/ledger/labels{/name}","releases_url":"https://api.github.com/repos/fetchai/ledger/releases{/id}","deployments_url":"https://api.github.com/repos/fetchai/ledger/deployments","created_at":"2018-01-15T16:15:05Z","updated_at":"2019-11-26T18:36:44Z","pushed_at":"2019-11-26T18:36:41Z","git_url":"git://github.com/fetchai/ledger.git","ssh_url":"git@github.com:fetchai/ledger.git","clone_url":"https://github.com/fetchai/ledger.git","svn_url":"https://github.com/fetchai/ledger","homepage":"https://fetch.ai","size":32993,"stargazers_count":35,"watchers_count":35,"language":"C++","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":34,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":292,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":34,"open_issues":292,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fetchai/ledger/pulls/2024"},"html":{"href":"https://github.com/fetchai/ledger/pull/2024"},"issue":{"href":"https://api.github.com/repos/fetchai/ledger/issues/2024"},"comments":{"href":"https://api.github.com/repos/fetchai/ledger/issues/2024/comments"},"review_comments":{"href":"https://api.github.com/repos/fetchai/ledger/pulls/2024/comments"},"review_comment":{"href":"https://api.github.com/repos/fetchai/ledger/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fetchai/ledger/pulls/2024/commits"},"statuses":{"href":"https://api.github.com/repos/fetchai/ledger/statuses/4e0615f063c045a1b5d2e1847fc53686cde1a8db"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"baykaner"}}