{"action":"created","comment":{"url":"https://api.github.com/repos/IllinoisCogComp/saul/pulls/comments/87752065","pull_request_review_id":8350593,"id":87752065,"diff_hunk":"@@ -1,6 +1,117 @@\n-* Designing flexible learning models including various configurations such as:\n \n-   * Local models i.e. single classifiers. (Learning only models (LO)).\n-   * Constrained conditional models (CCM)[1] for training independent classifiers and using them jointly for global decision making in prediction time. (Learning+Inference (L+I)).\n-   * Global models for joint training and joint inference (Inference-Based-Training (IBT)).\n-   * Pipeline models for complex problems where the output of each layer is used as the input of the next layer.\n+\n+#Learning Paradigms\n+\n+/*Documented by Parisa Kordjamshidi*/\n+\n+Saul facilitates the flexible design of complex learning models with various configurations.\n+By complex models we mean the models that aim at prediction of more than one output variable where these outputs might have relationships to each other.\n+Such models can be designed using the following paradigms,\n+\n+   * [Local models](#local) trains single classifiers (Learning only models (LO)) each of which learns and predicts a single variable in the output independently.\n+   * [Constrained conditional models (CCM)](#L+I) for training independent classifiers and using them jointly for global decision making in prediction time. (Learning+Inference (L+I)).\n+   * [Global models](#IBT) for joint training and joint inference (Inference-Based-Training (IBT)).\n+   * [Pipeline models](#pipeline) for complex problems where the output of each model is used as the input of the next model (these models are different layers in a pipeline).\n+\n+The above mentioned paradigms can be tested using this simple badge classifier example, [here](saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala).\n+\n+<a name=\"local\">\n+##Local models\n+These models are a set of single classifiers. Each classifier is defined with the `Learnable` construct and is trained and makes prediction independent from other classifiers.\n+ The `Learnable` construct requires specifying a single output variable, that is, a label which is itself a property in the data model, and the features which is also a\n+ comma separated list of properties.\n+\n+ ```scala\n+ object ClassifierName extends Learnable (node) {\n+   def label = property1\n+   def feature = using(property2,property3,...)\n+   //a comma separated list of properties\n+ }\n+ ```\n+\n+ For the details about the `Learnable` construct see [here](SAULLANGUAGE.md).\n+\n+<a name=\"L+I\">\n+##Learning+Inference models\n+These models are useful for when we need to consider the global relations between the outputs of a bunch of classifiers during the\n+prediction time. Each classifier is defined with the same `Learnable` construct as a local model. In addition to the Learnable definitions, the programmer\n+has the possibility to define a number of logical constraints between the output of the Learnables (classifiers).\n+Having the constraint definitions in place (see [here](SAULLANGUAGE.md) for syntax details), the programmer is able to define\n+new constrained classifiers that use the Learnables and constraints.\n+\n+```scala\n+object ConstrainedClassifierName extends ConstrainedClassifier[local_node_type,global_node_type](LocalClassifier)\n+ {\n+   def subjectTo = constraintExpression\n+   // Logical constraint expression comes here, it defines the relations between the\n+   // LocalClassifier and other Learnables defined before\n+ }\n+ ```\n+When we use the above `ConstrainedClassifierName` to call test or make predictions, the `LocalClassifier` is used\n+but the predictions are made in way that `constraintExpression` is hold. There is no limitation for the type of local classifiers.\n+They can be SVMs, decision trees or any other learning models available in Saul, [here](https://github.com/IllinoisCogComp/lbjava/blob/master/lbjava/doc/ALGORITHMS.md)\n+                                                                                  and [here](https://github.com/IllinoisCogComp/saul/blob/master/saul-core/src/main/java/edu/illinois/cs/cogcomp/saul/learn/SaulWekaWrapper.md).\n+\n+<a name=\"IBT\">\n+##Inference-based Learning\n+For the inference based models the basic definitions are exactly similar to the L+I models. In other words, the programmer\n+just needs to define the `Learnables` and `ConstrainedClassifiers`. However, to train the ConstrainedClassifiers jointly, instead of\n+training local classifiers independently, there are a couple of joint training functions that can be called.\n+These functions receive the list of constrained classifiers as input and train their parameters jointly. In contrast to\n+L+I models here the local classifiers can be defined as `SparsePerceptron`s or `SparseNetworkLearner`s only. This is because the\n+joint training should have its own strategy for the wight updates of the involved variables (those variables come down to be the outputs of the local classifiers here).\n+For the two cases the programmer can use\n+\n+```scala\n+ JointTrainSparseNetwork.train(param1,param2,...) /* a list of parameters go here*/\n+ JointTrainSparsePerceptron.train(param1,param2,...) /*a list of parameters here*/\n+```\n+\n+For example,\n+\n+ ```scala JointTrainSparseNetwork.train(badge, cls, 5, init = true, lossAugmented = true)```","path":"saul-core/doc/MODELS.md","position":77,"original_position":77,"commit_id":"0776234715e8b9503c916ef3b00b26a709024dd9","original_commit_id":"0776234715e8b9503c916ef3b00b26a709024dd9","user":{"login":"danyaljj","id":2441454,"avatar_url":"https://avatars.githubusercontent.com/u/2441454?v=3","gravatar_id":"","url":"https://api.github.com/users/danyaljj","html_url":"https://github.com/danyaljj","followers_url":"https://api.github.com/users/danyaljj/followers","following_url":"https://api.github.com/users/danyaljj/following{/other_user}","gists_url":"https://api.github.com/users/danyaljj/gists{/gist_id}","starred_url":"https://api.github.com/users/danyaljj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danyaljj/subscriptions","organizations_url":"https://api.github.com/users/danyaljj/orgs","repos_url":"https://api.github.com/users/danyaljj/repos","events_url":"https://api.github.com/users/danyaljj/events{/privacy}","received_events_url":"https://api.github.com/users/danyaljj/received_events","type":"User","site_admin":false},"body":"style doesn't render correctly. You probably need to move the code into new lines. ","created_at":"2016-11-14T08:02:17Z","updated_at":"2016-11-14T08:02:17Z","html_url":"https://github.com/IllinoisCogComp/saul/pull/445#discussion_r87752065","pull_request_url":"https://api.github.com/repos/IllinoisCogComp/saul/pulls/445","_links":{"self":{"href":"https://api.github.com/repos/IllinoisCogComp/saul/pulls/comments/87752065"},"html":{"href":"https://github.com/IllinoisCogComp/saul/pull/445#discussion_r87752065"},"pull_request":{"href":"https://api.github.com/repos/IllinoisCogComp/saul/pulls/445"}}},"pull_request":{"url":"https://api.github.com/repos/IllinoisCogComp/saul/pulls/445","id":92412017,"html_url":"https://github.com/IllinoisCogComp/saul/pull/445","diff_url":"https://github.com/IllinoisCogComp/saul/pull/445.diff","patch_url":"https://github.com/IllinoisCogComp/saul/pull/445.patch","issue_url":"https://api.github.com/repos/IllinoisCogComp/saul/issues/445","number":445,"state":"open","locked":false,"title":"Loss augmented inference using SparseNetworks","user":{"login":"kordjamshidi","id":5544447,"avatar_url":"https://avatars.githubusercontent.com/u/5544447?v=3","gravatar_id":"","url":"https://api.github.com/users/kordjamshidi","html_url":"https://github.com/kordjamshidi","followers_url":"https://api.github.com/users/kordjamshidi/followers","following_url":"https://api.github.com/users/kordjamshidi/following{/other_user}","gists_url":"https://api.github.com/users/kordjamshidi/gists{/gist_id}","starred_url":"https://api.github.com/users/kordjamshidi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kordjamshidi/subscriptions","organizations_url":"https://api.github.com/users/kordjamshidi/orgs","repos_url":"https://api.github.com/users/kordjamshidi/repos","events_url":"https://api.github.com/users/kordjamshidi/events{/privacy}","received_events_url":"https://api.github.com/users/kordjamshidi/received_events","type":"User","site_admin":false},"body":"Also added the badge example with constraints as a test example. ","created_at":"2016-11-04T20:40:16Z","updated_at":"2016-11-14T08:02:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eef96c36bf1e127625c66b73d1a91e01de8fa227","assignee":{"login":"danyaljj","id":2441454,"avatar_url":"https://avatars.githubusercontent.com/u/2441454?v=3","gravatar_id":"","url":"https://api.github.com/users/danyaljj","html_url":"https://github.com/danyaljj","followers_url":"https://api.github.com/users/danyaljj/followers","following_url":"https://api.github.com/users/danyaljj/following{/other_user}","gists_url":"https://api.github.com/users/danyaljj/gists{/gist_id}","starred_url":"https://api.github.com/users/danyaljj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danyaljj/subscriptions","organizations_url":"https://api.github.com/users/danyaljj/orgs","repos_url":"https://api.github.com/users/danyaljj/repos","events_url":"https://api.github.com/users/danyaljj/events{/privacy}","received_events_url":"https://api.github.com/users/danyaljj/received_events","type":"User","site_admin":false},"assignees":[{"login":"danyaljj","id":2441454,"avatar_url":"https://avatars.githubusercontent.com/u/2441454?v=3","gravatar_id":"","url":"https://api.github.com/users/danyaljj","html_url":"https://github.com/danyaljj","followers_url":"https://api.github.com/users/danyaljj/followers","following_url":"https://api.github.com/users/danyaljj/following{/other_user}","gists_url":"https://api.github.com/users/danyaljj/gists{/gist_id}","starred_url":"https://api.github.com/users/danyaljj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danyaljj/subscriptions","organizations_url":"https://api.github.com/users/danyaljj/orgs","repos_url":"https://api.github.com/users/danyaljj/repos","events_url":"https://api.github.com/users/danyaljj/events{/privacy}","received_events_url":"https://api.github.com/users/danyaljj/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/IllinoisCogComp/saul/pulls/445/commits","review_comments_url":"https://api.github.com/repos/IllinoisCogComp/saul/pulls/445/comments","review_comment_url":"https://api.github.com/repos/IllinoisCogComp/saul/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IllinoisCogComp/saul/issues/445/comments","statuses_url":"https://api.github.com/repos/IllinoisCogComp/saul/statuses/0776234715e8b9503c916ef3b00b26a709024dd9","head":{"label":"kordjamshidi:loss-augmented","ref":"loss-augmented","sha":"0776234715e8b9503c916ef3b00b26a709024dd9","user":{"login":"kordjamshidi","id":5544447,"avatar_url":"https://avatars.githubusercontent.com/u/5544447?v=3","gravatar_id":"","url":"https://api.github.com/users/kordjamshidi","html_url":"https://github.com/kordjamshidi","followers_url":"https://api.github.com/users/kordjamshidi/followers","following_url":"https://api.github.com/users/kordjamshidi/following{/other_user}","gists_url":"https://api.github.com/users/kordjamshidi/gists{/gist_id}","starred_url":"https://api.github.com/users/kordjamshidi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kordjamshidi/subscriptions","organizations_url":"https://api.github.com/users/kordjamshidi/orgs","repos_url":"https://api.github.com/users/kordjamshidi/repos","events_url":"https://api.github.com/users/kordjamshidi/events{/privacy}","received_events_url":"https://api.github.com/users/kordjamshidi/received_events","type":"User","site_admin":false},"repo":{"id":61810279,"name":"saul","full_name":"kordjamshidi/saul","owner":{"login":"kordjamshidi","id":5544447,"avatar_url":"https://avatars.githubusercontent.com/u/5544447?v=3","gravatar_id":"","url":"https://api.github.com/users/kordjamshidi","html_url":"https://github.com/kordjamshidi","followers_url":"https://api.github.com/users/kordjamshidi/followers","following_url":"https://api.github.com/users/kordjamshidi/following{/other_user}","gists_url":"https://api.github.com/users/kordjamshidi/gists{/gist_id}","starred_url":"https://api.github.com/users/kordjamshidi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kordjamshidi/subscriptions","organizations_url":"https://api.github.com/users/kordjamshidi/orgs","repos_url":"https://api.github.com/users/kordjamshidi/repos","events_url":"https://api.github.com/users/kordjamshidi/events{/privacy}","received_events_url":"https://api.github.com/users/kordjamshidi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kordjamshidi/saul","description":"Saul : Declarative Learning-Based Programming","fork":true,"url":"https://api.github.com/repos/kordjamshidi/saul","forks_url":"https://api.github.com/repos/kordjamshidi/saul/forks","keys_url":"https://api.github.com/repos/kordjamshidi/saul/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kordjamshidi/saul/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kordjamshidi/saul/teams","hooks_url":"https://api.github.com/repos/kordjamshidi/saul/hooks","issue_events_url":"https://api.github.com/repos/kordjamshidi/saul/issues/events{/number}","events_url":"https://api.github.com/repos/kordjamshidi/saul/events","assignees_url":"https://api.github.com/repos/kordjamshidi/saul/assignees{/user}","branches_url":"https://api.github.com/repos/kordjamshidi/saul/branches{/branch}","tags_url":"https://api.github.com/repos/kordjamshidi/saul/tags","blobs_url":"https://api.github.com/repos/kordjamshidi/saul/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kordjamshidi/saul/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kordjamshidi/saul/git/refs{/sha}","trees_url":"https://api.github.com/repos/kordjamshidi/saul/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kordjamshidi/saul/statuses/{sha}","languages_url":"https://api.github.com/repos/kordjamshidi/saul/languages","stargazers_url":"https://api.github.com/repos/kordjamshidi/saul/stargazers","contributors_url":"https://api.github.com/repos/kordjamshidi/saul/contributors","subscribers_url":"https://api.github.com/repos/kordjamshidi/saul/subscribers","subscription_url":"https://api.github.com/repos/kordjamshidi/saul/subscription","commits_url":"https://api.github.com/repos/kordjamshidi/saul/commits{/sha}","git_commits_url":"https://api.github.com/repos/kordjamshidi/saul/git/commits{/sha}","comments_url":"https://api.github.com/repos/kordjamshidi/saul/comments{/number}","issue_comment_url":"https://api.github.com/repos/kordjamshidi/saul/issues/comments{/number}","contents_url":"https://api.github.com/repos/kordjamshidi/saul/contents/{+path}","compare_url":"https://api.github.com/repos/kordjamshidi/saul/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kordjamshidi/saul/merges","archive_url":"https://api.github.com/repos/kordjamshidi/saul/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kordjamshidi/saul/downloads","issues_url":"https://api.github.com/repos/kordjamshidi/saul/issues{/number}","pulls_url":"https://api.github.com/repos/kordjamshidi/saul/pulls{/number}","milestones_url":"https://api.github.com/repos/kordjamshidi/saul/milestones{/number}","notifications_url":"https://api.github.com/repos/kordjamshidi/saul/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kordjamshidi/saul/labels{/name}","releases_url":"https://api.github.com/repos/kordjamshidi/saul/releases{/id}","deployments_url":"https://api.github.com/repos/kordjamshidi/saul/deployments","created_at":"2016-06-23T14:10:52Z","updated_at":"2016-06-23T14:16:01Z","pushed_at":"2016-11-11T22:15:12Z","git_url":"git://github.com/kordjamshidi/saul.git","ssh_url":"git@github.com:kordjamshidi/saul.git","clone_url":"https://github.com/kordjamshidi/saul.git","svn_url":"https://github.com/kordjamshidi/saul","homepage":"","size":14158,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"IllinoisCogComp:master","ref":"master","sha":"8522b7d131f9d792359851a407c936fc7574401e","user":{"login":"IllinoisCogComp","id":14893101,"avatar_url":"https://avatars.githubusercontent.com/u/14893101?v=3","gravatar_id":"","url":"https://api.github.com/users/IllinoisCogComp","html_url":"https://github.com/IllinoisCogComp","followers_url":"https://api.github.com/users/IllinoisCogComp/followers","following_url":"https://api.github.com/users/IllinoisCogComp/following{/other_user}","gists_url":"https://api.github.com/users/IllinoisCogComp/gists{/gist_id}","starred_url":"https://api.github.com/users/IllinoisCogComp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IllinoisCogComp/subscriptions","organizations_url":"https://api.github.com/users/IllinoisCogComp/orgs","repos_url":"https://api.github.com/users/IllinoisCogComp/repos","events_url":"https://api.github.com/users/IllinoisCogComp/events{/privacy}","received_events_url":"https://api.github.com/users/IllinoisCogComp/received_events","type":"Organization","site_admin":false},"repo":{"id":43462781,"name":"saul","full_name":"IllinoisCogComp/saul","owner":{"login":"IllinoisCogComp","id":14893101,"avatar_url":"https://avatars.githubusercontent.com/u/14893101?v=3","gravatar_id":"","url":"https://api.github.com/users/IllinoisCogComp","html_url":"https://github.com/IllinoisCogComp","followers_url":"https://api.github.com/users/IllinoisCogComp/followers","following_url":"https://api.github.com/users/IllinoisCogComp/following{/other_user}","gists_url":"https://api.github.com/users/IllinoisCogComp/gists{/gist_id}","starred_url":"https://api.github.com/users/IllinoisCogComp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IllinoisCogComp/subscriptions","organizations_url":"https://api.github.com/users/IllinoisCogComp/orgs","repos_url":"https://api.github.com/users/IllinoisCogComp/repos","events_url":"https://api.github.com/users/IllinoisCogComp/events{/privacy}","received_events_url":"https://api.github.com/users/IllinoisCogComp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/IllinoisCogComp/saul","description":"Saul : Declarative Learning-Based Programming","fork":false,"url":"https://api.github.com/repos/IllinoisCogComp/saul","forks_url":"https://api.github.com/repos/IllinoisCogComp/saul/forks","keys_url":"https://api.github.com/repos/IllinoisCogComp/saul/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IllinoisCogComp/saul/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IllinoisCogComp/saul/teams","hooks_url":"https://api.github.com/repos/IllinoisCogComp/saul/hooks","issue_events_url":"https://api.github.com/repos/IllinoisCogComp/saul/issues/events{/number}","events_url":"https://api.github.com/repos/IllinoisCogComp/saul/events","assignees_url":"https://api.github.com/repos/IllinoisCogComp/saul/assignees{/user}","branches_url":"https://api.github.com/repos/IllinoisCogComp/saul/branches{/branch}","tags_url":"https://api.github.com/repos/IllinoisCogComp/saul/tags","blobs_url":"https://api.github.com/repos/IllinoisCogComp/saul/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IllinoisCogComp/saul/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IllinoisCogComp/saul/git/refs{/sha}","trees_url":"https://api.github.com/repos/IllinoisCogComp/saul/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IllinoisCogComp/saul/statuses/{sha}","languages_url":"https://api.github.com/repos/IllinoisCogComp/saul/languages","stargazers_url":"https://api.github.com/repos/IllinoisCogComp/saul/stargazers","contributors_url":"https://api.github.com/repos/IllinoisCogComp/saul/contributors","subscribers_url":"https://api.github.com/repos/IllinoisCogComp/saul/subscribers","subscription_url":"https://api.github.com/repos/IllinoisCogComp/saul/subscription","commits_url":"https://api.github.com/repos/IllinoisCogComp/saul/commits{/sha}","git_commits_url":"https://api.github.com/repos/IllinoisCogComp/saul/git/commits{/sha}","comments_url":"https://api.github.com/repos/IllinoisCogComp/saul/comments{/number}","issue_comment_url":"https://api.github.com/repos/IllinoisCogComp/saul/issues/comments{/number}","contents_url":"https://api.github.com/repos/IllinoisCogComp/saul/contents/{+path}","compare_url":"https://api.github.com/repos/IllinoisCogComp/saul/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IllinoisCogComp/saul/merges","archive_url":"https://api.github.com/repos/IllinoisCogComp/saul/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IllinoisCogComp/saul/downloads","issues_url":"https://api.github.com/repos/IllinoisCogComp/saul/issues{/number}","pulls_url":"https://api.github.com/repos/IllinoisCogComp/saul/pulls{/number}","milestones_url":"https://api.github.com/repos/IllinoisCogComp/saul/milestones{/number}","notifications_url":"https://api.github.com/repos/IllinoisCogComp/saul/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IllinoisCogComp/saul/labels{/name}","releases_url":"https://api.github.com/repos/IllinoisCogComp/saul/releases{/id}","deployments_url":"https://api.github.com/repos/IllinoisCogComp/saul/deployments","created_at":"2015-09-30T22:21:38Z","updated_at":"2016-11-07T00:39:15Z","pushed_at":"2016-11-11T22:15:13Z","git_url":"git://github.com/IllinoisCogComp/saul.git","ssh_url":"git@github.com:IllinoisCogComp/saul.git","clone_url":"https://github.com/IllinoisCogComp/saul.git","svn_url":"https://github.com/IllinoisCogComp/saul","homepage":"","size":14969,"stargazers_count":16,"watchers_count":16,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":113,"forks":13,"open_issues":113,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IllinoisCogComp/saul/pulls/445"},"html":{"href":"https://github.com/IllinoisCogComp/saul/pull/445"},"issue":{"href":"https://api.github.com/repos/IllinoisCogComp/saul/issues/445"},"comments":{"href":"https://api.github.com/repos/IllinoisCogComp/saul/issues/445/comments"},"review_comments":{"href":"https://api.github.com/repos/IllinoisCogComp/saul/pulls/445/comments"},"review_comment":{"href":"https://api.github.com/repos/IllinoisCogComp/saul/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IllinoisCogComp/saul/pulls/445/commits"},"statuses":{"href":"https://api.github.com/repos/IllinoisCogComp/saul/statuses/0776234715e8b9503c916ef3b00b26a709024dd9"}}}}
{"actor":{"display_login":"danyaljj"}}