{"id":17046031,"url":"https://github.com/vzhong/torchlib","last_synced_at":"2026-04-26T10:30:19.064Z","repository":{"id":35713969,"uuid":"39991892","full_name":"vzhong/torchlib","owner":"vzhong","description":"Data structures, algorithms, and ML/NLP tools in Lua.","archived":true,"fork":false,"pushed_at":"2017-08-31T20:58:37.000Z","size":841,"stargazers_count":26,"open_issues_count":0,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-12T05:08:26.074Z","etag":null,"topics":["deep-learning","torch"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vzhong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-31T07:08:45.000Z","updated_at":"2025-01-31T01:42:33.000Z","dependencies_parsed_at":"2022-08-18T00:40:22.703Z","dependency_job_id":null,"html_url":"https://github.com/vzhong/torchlib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vzhong%2Ftorchlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vzhong%2Ftorchlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vzhong%2Ftorchlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vzhong%2Ftorchlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vzhong","download_url":"https://codeload.github.com/vzhong/torchlib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240058637,"owners_count":19741491,"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":["deep-learning","torch"],"created_at":"2024-10-14T09:44:13.557Z","updated_at":"2026-04-26T10:30:19.019Z","avatar_url":"https://github.com/vzhong.png","language":"Lua","funding_links":[],"categories":["Libraries"],"sub_categories":["ETC"],"readme":"# Torchlib\n\n[![wercker status](https://app.wercker.com/status/c7bd97d06535598d96937e0cf5ace629/s/master \"wercker status\")](https://app.wercker.com/project/bykey/c7bd97d06535598d96937e0cf5ace629)\n[![codecov](https://codecov.io/gh/vzhong/torchlib/branch/master/graph/badge.svg)](https://codecov.io/gh/vzhong/torchlib)\n\n[View documentation](http://torchlib.github.io).\n\nData structures and libraries for Torch. All instances are Torch serializable with `torch.save` and `torch.load`.\n\n\n## Installation\n\nYou can install `torchlib` as follows:\n\n`git clone https://github.com/vzhong/torchlib.git \u0026\u0026 cd torchlib \u0026\u0026 luarocks make`\n\nTorchlib is namespaced locally. To use it:\n\n```lua\nlocal tl = require 'torchlib'\n\nlocal m = tl.DirectedGraph()\n...\n```\n\nExamples and use cases are shown in the documentation.\n\n\n## Documentation\n\nThe documentation is hosted [here](http://www.victorzhong.com/torchlib).\nAlternatively you can build your own documentation with `docroc`, which you can get [here](https://github.com/vzhong/docroc).\n\n\n## Overview\n\nTorchlib's can be divided into categories based on usecases.\n\n### Basic Datastructures and Algorithms\n\n- Graphs\n- Lists, heaps, queues and stacks\n- Maps and counters\n- Sets\n- Trees\n\n### Machine Learning\n\nThe machine learning package contains utilities that facilitate the training of and evaluation of machine learning models. These include:\n\n- Dataset, which provides mechanisms for subsampling, shuffling, batching of arbitrary examples.\n- Vocab, for mapping between indices and words.\n- Model, an abstract class to facilitate the training of Torch based machine learning models.\n- Scorer, for evaluating precision/recall metrics.\n- ProbTable, for modeling probability distributions.\n- Experiment, for logging experiment progress to a postgres instance.\n\n### Utilities\n\n- Downloader, for downloading content via http.\n- Global, global convenience functions namespaced under `tl`.\n- String, string convenience functions namespaced under `tl.string` and monkeypatched into `string`.\n- Table, table convenience functions namespaced under `tl.table` and monkeypatched into `table`.\n\n\n## Contribution\n\nPull requests are welcome! Torchlib is unit tested with the default Torch testing framework. Continuous integration is hosted on [Wercker](http://wercker.com/) which also automatically builds the documentations and deploys them on Github pages (of this repo).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvzhong%2Ftorchlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvzhong%2Ftorchlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvzhong%2Ftorchlib/lists"}