{"id":24143835,"url":"https://github.com/dnbaker/tilt","last_synced_at":"2025-06-12T12:38:33.514Z","repository":{"id":94818729,"uuid":"371816299","full_name":"dnbaker/tilt","owner":"dnbaker","description":"Biased dataloaders for PyTorch and related utilities","archived":false,"fork":false,"pushed_at":"2021-06-08T12:35:42.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-01T14:33:04.148Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/dnbaker.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-28T20:54:44.000Z","updated_at":"2021-06-08T14:10:32.000Z","dependencies_parsed_at":"2023-04-24T06:02:10.570Z","dependency_job_id":null,"html_url":"https://github.com/dnbaker/tilt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dnbaker/tilt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnbaker%2Ftilt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnbaker%2Ftilt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnbaker%2Ftilt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnbaker%2Ftilt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dnbaker","download_url":"https://codeload.github.com/dnbaker/tilt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dnbaker%2Ftilt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259466576,"owners_count":22862337,"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":"2025-01-12T05:45:42.516Z","updated_at":"2025-06-12T12:38:33.506Z","avatar_url":"https://github.com/dnbaker.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Simple biased samplers for PyTorch\n\n\nFor class-balanced samplers:\n```python\nfrom tilt import make_even_sampler, make_biased_sampler\n\nsampler = make_even_sampler(labels) # Makes a class-balanced sampler\nsampler = make_even_sampler(labels, idx=[1,4, 5]) # Makes a class-balanced sampler over the points 1, 4, 5\nsampler = make_even_sampler(labels, nsamples=10000) # Makes a sampler with 10,000 samples\n```\nFor class-balanced samplers:\n```python\nfrom tilt import make_even_sampler, make_biased_sampler\n\nweights = np.abs(np.random.standard_cauchy((1000,)))\nsampler = make_biased_sampler(weights, nsamples=100000)\n```\n\nThen, pass this as the sampler for PyTorch DataLoader construction.\n\nIn the future, I plan to add in contrastive learning mining utilities and autoaugmentation. For both of these, LSH techniques might come into play.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnbaker%2Ftilt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdnbaker%2Ftilt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdnbaker%2Ftilt/lists"}