{"id":15556504,"url":"https://github.com/gforge/criterion_ignore","last_synced_at":"2025-08-05T04:07:13.764Z","repository":{"id":70448231,"uuid":"53849977","full_name":"gforge/criterion_ignore","owner":"gforge","description":"For Torch - A parallel criterion with ignore label","archived":false,"fork":false,"pushed_at":"2016-10-25T09:43:46.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-03T13:15:31.290Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gforge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-14T11:14:15.000Z","updated_at":"2016-10-25T09:43:47.000Z","dependencies_parsed_at":"2023-03-03T06:30:42.135Z","dependency_job_id":null,"html_url":"https://github.com/gforge/criterion_ignore","commit_stats":{"total_commits":18,"total_committers":1,"mean_commits":18.0,"dds":0.0,"last_synced_commit":"ef5b9df9eb1f8c8a2fe6d6d62d2e5620758ab163"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gforge%2Fcriterion_ignore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gforge%2Fcriterion_ignore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gforge%2Fcriterion_ignore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gforge%2Fcriterion_ignore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gforge","download_url":"https://codeload.github.com/gforge/criterion_ignore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246132108,"owners_count":20728433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T15:14:02.483Z","updated_at":"2025-03-29T03:22:35.940Z","avatar_url":"https://github.com/gforge.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The criterion_ignore addon for torch/nn\n\nThe package is for use with [torch/nn](https://github.com/torch/nn) and adds a\nmethod for ignoring labels. It is a direct extension of the [ParallelCriterion][1]\nwhere the `:add()` allows you to  specify an ignore label for each criterion that you add.\n\nAs of version 0.2 you now also have the power of `argcheck` for help with arguments\netc. If you mistype an argument then there is an automated help print.\n\n[1]: https://github.com/torch/nn/blob/master/doc/criterion.md#nn.ParallelCriterion\n\n## Installation\n\nIn order to install the package you need to do it directly from the GitHub repo (at the moment):\n\n```bash\nluarocks install https://raw.githubusercontent.com/gforge/criterion_ignore/master/rocks/criterion_ignore-0.2-1.rockspec\n```\n\n## Use case:\n\n```lua\nrequire 'criterion_ignore'\nmodel = nn.Sequential()\nmodel:add(nn.Linear(3,5))\n\ncriterion = nn.ParallelIgnoreCriterion()\nprl = nn.ConcatTable()\nfor i=1,7 do\n    seq = nn.Sequential()\n    seq:add(nn.Linear(5,i + 1))\n    seq:add(nn.SoftMax())\n    prl:add(seq)\n    -- First parameter is weight while the second is the ignore label\n    --  the argcheck allows you though to specify the actual argument names\n    criterion:add{\n        criterion = nn.ClassNLLCriterion(),\n        ignore = 0\n    }\nend\nmodel:add(prl)\n\ninput = torch.rand(3)\ntarget = {1,2,3,4,5,6,7}\noutput = model:forward(input)\nprint(output)\nerr1 = criterion:forward(output,target)\nprint(err1)\n\ntarget[5] = 0\noutput = model:forward(input)\nprint(output)\nerr2 = criterion:forward(output,target)\nprint(err2)\nprint(err1 \u003c err2)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgforge%2Fcriterion_ignore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgforge%2Fcriterion_ignore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgforge%2Fcriterion_ignore/lists"}