{"action":"created","comment":{"url":"https://api.github.com/repos/mlpack/mlpack/pulls/comments/66709979","id":66709979,"diff_hunk":"@@ -0,0 +1,67 @@\n+/**\n+ * @file tasks.hpp\n+ * @author Bang Liu\n+ *\n+ * Definition of Population class.\n+ */\n+#ifndef MLPACK_METHODS_NE_POPULATION_HPP\n+#define MLPACK_METHODS_NE_POPULATION_HPP\n+\n+#include <cstddef>\n+\n+#include <mlpack/core.hpp>\n+#include <mlpack/methods/ann/performance_functions/cee_function.hpp>\n+\n+#include \"link_gene.hpp\"\n+#include \"neuron_gene.hpp\"\n+#include \"genome.hpp\"\n+\n+namespace mlpack {\n+namespace ne {\n+\n+/**\n+ * This class defines task xor.\n+ */\n+template<typename FitnissFunction = MeanSquaredErrorFunction>\n+class TaskXor {\n+ public:\n+  // Evaluate genome's fitness for this task.\n+  double EvalFitness(Genome& genome) {\n+  \t// Check input size\n+  \tif (genome.NumInput() != 3 || genome.NumOutput() != 1) {\n+  \t  return -1;  // -1 means network structure input/output dimension not correct.\n+  \t}\n+\n+    // Input, output pairs for evaluate fitness.\n+  \tstd::vector<std::vector<double>> inputs;\n+  \tstd::vector<double> input1 = {0, 0, 1};\n+  \tstd::vector<double> input2 = {0, 1, 1};\n+  \tstd::vector<double> input3 = {1, 0, 1};\n+  \tstd::vector<double> input4 = {1, 1, 1};\n+  \tinputs.push_back(input1);\n+  \tinputs.push_back(input2);\n+  \tinputs.push_back(input3);\n+  \tinputs.push_back(input4);\n+\n+  \tstd::vector<double> outputs;\n+  \toutputs.push_back(1);\n+  \toutputs.push_back(0);\n+  \toutputs.push_back(1);\n+  \toutputs.push_back(0);\n+","path":"src/mlpack/methods/ne/tasks.hpp","position":51,"original_position":51,"commit_id":"65f093daf32f6cb353cd6b9304bab88a5e096fdc","original_commit_id":"65f093daf32f6cb353cd6b9304bab88a5e096fdc","user":{"login":"BangLiu","id":4156705,"avatar_url":"https://avatars.githubusercontent.com/u/4156705?v=3","gravatar_id":"","url":"https://api.github.com/users/BangLiu","html_url":"https://github.com/BangLiu","followers_url":"https://api.github.com/users/BangLiu/followers","following_url":"https://api.github.com/users/BangLiu/following{/other_user}","gists_url":"https://api.github.com/users/BangLiu/gists{/gist_id}","starred_url":"https://api.github.com/users/BangLiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BangLiu/subscriptions","organizations_url":"https://api.github.com/users/BangLiu/orgs","repos_url":"https://api.github.com/users/BangLiu/repos","events_url":"https://api.github.com/users/BangLiu/events{/privacy}","received_events_url":"https://api.github.com/users/BangLiu/received_events","type":"User","site_admin":false},"body":"@zoq Reasonable. I will revise it then.","created_at":"2016-06-11T18:40:21Z","updated_at":"2016-06-11T18:40:21Z","html_url":"https://github.com/mlpack/mlpack/pull/686#discussion_r66709979","pull_request_url":"https://api.github.com/repos/mlpack/mlpack/pulls/686","_links":{"self":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/comments/66709979"},"html":{"href":"https://github.com/mlpack/mlpack/pull/686#discussion_r66709979"},"pull_request":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/686"}}},"pull_request":{"url":"https://api.github.com/repos/mlpack/mlpack/pulls/686","id":72912680,"html_url":"https://github.com/mlpack/mlpack/pull/686","diff_url":"https://github.com/mlpack/mlpack/pull/686.diff","patch_url":"https://github.com/mlpack/mlpack/pull/686.patch","issue_url":"https://api.github.com/repos/mlpack/mlpack/issues/686","number":686,"state":"open","locked":false,"title":"NeuralEvolution - implemented gene, genome","user":{"login":"BangLiu","id":4156705,"avatar_url":"https://avatars.githubusercontent.com/u/4156705?v=3","gravatar_id":"","url":"https://api.github.com/users/BangLiu","html_url":"https://github.com/BangLiu","followers_url":"https://api.github.com/users/BangLiu/followers","following_url":"https://api.github.com/users/BangLiu/following{/other_user}","gists_url":"https://api.github.com/users/BangLiu/gists{/gist_id}","starred_url":"https://api.github.com/users/BangLiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BangLiu/subscriptions","organizations_url":"https://api.github.com/users/BangLiu/orgs","repos_url":"https://api.github.com/users/BangLiu/repos","events_url":"https://api.github.com/users/BangLiu/events{/privacy}","received_events_url":"https://api.github.com/users/BangLiu/received_events","type":"User","site_admin":false},"body":"This PR implements the concepts in NE algorithms by classes.\r\nThe finished classes (for current CNE algorithm) includes:\r\nLinkGene\r\nNeuronGene\r\nGenome\r\n\r\nClasses in progress includes:\r\nPopulation\r\nCNE ","created_at":"2016-06-07T17:06:37Z","updated_at":"2016-06-11T18:40:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"59eaaa53e2a3a512078dcdedc09c5aaede1d1139","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mlpack/mlpack/pulls/686/commits","review_comments_url":"https://api.github.com/repos/mlpack/mlpack/pulls/686/comments","review_comment_url":"https://api.github.com/repos/mlpack/mlpack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mlpack/mlpack/issues/686/comments","statuses_url":"https://api.github.com/repos/mlpack/mlpack/statuses/65f093daf32f6cb353cd6b9304bab88a5e096fdc","head":{"label":"BangLiu:ne","ref":"ne","sha":"65f093daf32f6cb353cd6b9304bab88a5e096fdc","user":{"login":"BangLiu","id":4156705,"avatar_url":"https://avatars.githubusercontent.com/u/4156705?v=3","gravatar_id":"","url":"https://api.github.com/users/BangLiu","html_url":"https://github.com/BangLiu","followers_url":"https://api.github.com/users/BangLiu/followers","following_url":"https://api.github.com/users/BangLiu/following{/other_user}","gists_url":"https://api.github.com/users/BangLiu/gists{/gist_id}","starred_url":"https://api.github.com/users/BangLiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BangLiu/subscriptions","organizations_url":"https://api.github.com/users/BangLiu/orgs","repos_url":"https://api.github.com/users/BangLiu/repos","events_url":"https://api.github.com/users/BangLiu/events{/privacy}","received_events_url":"https://api.github.com/users/BangLiu/received_events","type":"User","site_admin":false},"repo":{"id":58986089,"name":"mlpack","full_name":"BangLiu/mlpack","owner":{"login":"BangLiu","id":4156705,"avatar_url":"https://avatars.githubusercontent.com/u/4156705?v=3","gravatar_id":"","url":"https://api.github.com/users/BangLiu","html_url":"https://github.com/BangLiu","followers_url":"https://api.github.com/users/BangLiu/followers","following_url":"https://api.github.com/users/BangLiu/following{/other_user}","gists_url":"https://api.github.com/users/BangLiu/gists{/gist_id}","starred_url":"https://api.github.com/users/BangLiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BangLiu/subscriptions","organizations_url":"https://api.github.com/users/BangLiu/orgs","repos_url":"https://api.github.com/users/BangLiu/repos","events_url":"https://api.github.com/users/BangLiu/events{/privacy}","received_events_url":"https://api.github.com/users/BangLiu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BangLiu/mlpack","description":"mlpack: a scalable C++ machine learning library","fork":true,"url":"https://api.github.com/repos/BangLiu/mlpack","forks_url":"https://api.github.com/repos/BangLiu/mlpack/forks","keys_url":"https://api.github.com/repos/BangLiu/mlpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BangLiu/mlpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BangLiu/mlpack/teams","hooks_url":"https://api.github.com/repos/BangLiu/mlpack/hooks","issue_events_url":"https://api.github.com/repos/BangLiu/mlpack/issues/events{/number}","events_url":"https://api.github.com/repos/BangLiu/mlpack/events","assignees_url":"https://api.github.com/repos/BangLiu/mlpack/assignees{/user}","branches_url":"https://api.github.com/repos/BangLiu/mlpack/branches{/branch}","tags_url":"https://api.github.com/repos/BangLiu/mlpack/tags","blobs_url":"https://api.github.com/repos/BangLiu/mlpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BangLiu/mlpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BangLiu/mlpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/BangLiu/mlpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BangLiu/mlpack/statuses/{sha}","languages_url":"https://api.github.com/repos/BangLiu/mlpack/languages","stargazers_url":"https://api.github.com/repos/BangLiu/mlpack/stargazers","contributors_url":"https://api.github.com/repos/BangLiu/mlpack/contributors","subscribers_url":"https://api.github.com/repos/BangLiu/mlpack/subscribers","subscription_url":"https://api.github.com/repos/BangLiu/mlpack/subscription","commits_url":"https://api.github.com/repos/BangLiu/mlpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/BangLiu/mlpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/BangLiu/mlpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/BangLiu/mlpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/BangLiu/mlpack/contents/{+path}","compare_url":"https://api.github.com/repos/BangLiu/mlpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BangLiu/mlpack/merges","archive_url":"https://api.github.com/repos/BangLiu/mlpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BangLiu/mlpack/downloads","issues_url":"https://api.github.com/repos/BangLiu/mlpack/issues{/number}","pulls_url":"https://api.github.com/repos/BangLiu/mlpack/pulls{/number}","milestones_url":"https://api.github.com/repos/BangLiu/mlpack/milestones{/number}","notifications_url":"https://api.github.com/repos/BangLiu/mlpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BangLiu/mlpack/labels{/name}","releases_url":"https://api.github.com/repos/BangLiu/mlpack/releases{/id}","deployments_url":"https://api.github.com/repos/BangLiu/mlpack/deployments","created_at":"2016-05-17T03:04:31Z","updated_at":"2016-05-17T03:04:35Z","pushed_at":"2016-06-10T13:29:10Z","git_url":"git://github.com/BangLiu/mlpack.git","ssh_url":"git@github.com:BangLiu/mlpack.git","clone_url":"https://github.com/BangLiu/mlpack.git","svn_url":"https://github.com/BangLiu/mlpack","homepage":null,"size":145490,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mlpack:master","ref":"master","sha":"44883afb19a2f2dd0e1fe29d96c873bf97335521","user":{"login":"mlpack","id":10216045,"avatar_url":"https://avatars.githubusercontent.com/u/10216045?v=3","gravatar_id":"","url":"https://api.github.com/users/mlpack","html_url":"https://github.com/mlpack","followers_url":"https://api.github.com/users/mlpack/followers","following_url":"https://api.github.com/users/mlpack/following{/other_user}","gists_url":"https://api.github.com/users/mlpack/gists{/gist_id}","starred_url":"https://api.github.com/users/mlpack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlpack/subscriptions","organizations_url":"https://api.github.com/users/mlpack/orgs","repos_url":"https://api.github.com/users/mlpack/repos","events_url":"https://api.github.com/users/mlpack/events{/privacy}","received_events_url":"https://api.github.com/users/mlpack/received_events","type":"Organization","site_admin":false},"repo":{"id":28149409,"name":"mlpack","full_name":"mlpack/mlpack","owner":{"login":"mlpack","id":10216045,"avatar_url":"https://avatars.githubusercontent.com/u/10216045?v=3","gravatar_id":"","url":"https://api.github.com/users/mlpack","html_url":"https://github.com/mlpack","followers_url":"https://api.github.com/users/mlpack/followers","following_url":"https://api.github.com/users/mlpack/following{/other_user}","gists_url":"https://api.github.com/users/mlpack/gists{/gist_id}","starred_url":"https://api.github.com/users/mlpack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlpack/subscriptions","organizations_url":"https://api.github.com/users/mlpack/orgs","repos_url":"https://api.github.com/users/mlpack/repos","events_url":"https://api.github.com/users/mlpack/events{/privacy}","received_events_url":"https://api.github.com/users/mlpack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mlpack/mlpack","description":"mlpack: a scalable C++ machine learning library","fork":false,"url":"https://api.github.com/repos/mlpack/mlpack","forks_url":"https://api.github.com/repos/mlpack/mlpack/forks","keys_url":"https://api.github.com/repos/mlpack/mlpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mlpack/mlpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mlpack/mlpack/teams","hooks_url":"https://api.github.com/repos/mlpack/mlpack/hooks","issue_events_url":"https://api.github.com/repos/mlpack/mlpack/issues/events{/number}","events_url":"https://api.github.com/repos/mlpack/mlpack/events","assignees_url":"https://api.github.com/repos/mlpack/mlpack/assignees{/user}","branches_url":"https://api.github.com/repos/mlpack/mlpack/branches{/branch}","tags_url":"https://api.github.com/repos/mlpack/mlpack/tags","blobs_url":"https://api.github.com/repos/mlpack/mlpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mlpack/mlpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mlpack/mlpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/mlpack/mlpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mlpack/mlpack/statuses/{sha}","languages_url":"https://api.github.com/repos/mlpack/mlpack/languages","stargazers_url":"https://api.github.com/repos/mlpack/mlpack/stargazers","contributors_url":"https://api.github.com/repos/mlpack/mlpack/contributors","subscribers_url":"https://api.github.com/repos/mlpack/mlpack/subscribers","subscription_url":"https://api.github.com/repos/mlpack/mlpack/subscription","commits_url":"https://api.github.com/repos/mlpack/mlpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/mlpack/mlpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/mlpack/mlpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/mlpack/mlpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/mlpack/mlpack/contents/{+path}","compare_url":"https://api.github.com/repos/mlpack/mlpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mlpack/mlpack/merges","archive_url":"https://api.github.com/repos/mlpack/mlpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mlpack/mlpack/downloads","issues_url":"https://api.github.com/repos/mlpack/mlpack/issues{/number}","pulls_url":"https://api.github.com/repos/mlpack/mlpack/pulls{/number}","milestones_url":"https://api.github.com/repos/mlpack/mlpack/milestones{/number}","notifications_url":"https://api.github.com/repos/mlpack/mlpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mlpack/mlpack/labels{/name}","releases_url":"https://api.github.com/repos/mlpack/mlpack/releases{/id}","deployments_url":"https://api.github.com/repos/mlpack/mlpack/deployments","created_at":"2014-12-17T18:16:59Z","updated_at":"2016-06-11T09:06:42Z","pushed_at":"2016-06-11T17:37:09Z","git_url":"git://github.com/mlpack/mlpack.git","ssh_url":"git@github.com:mlpack/mlpack.git","clone_url":"https://github.com/mlpack/mlpack.git","svn_url":"https://github.com/mlpack/mlpack","homepage":null,"size":165351,"stargazers_count":867,"watchers_count":867,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":346,"mirror_url":null,"open_issues_count":71,"forks":346,"open_issues":71,"watchers":867,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/686"},"html":{"href":"https://github.com/mlpack/mlpack/pull/686"},"issue":{"href":"https://api.github.com/repos/mlpack/mlpack/issues/686"},"comments":{"href":"https://api.github.com/repos/mlpack/mlpack/issues/686/comments"},"review_comments":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/686/comments"},"review_comment":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/686/commits"},"statuses":{"href":"https://api.github.com/repos/mlpack/mlpack/statuses/65f093daf32f6cb353cd6b9304bab88a5e096fdc"}}}}
{"actor":{"display_login":"BangLiu"}}