{"id":19382890,"url":"https://github.com/locuslab/uniform-convergence-neurips19","last_synced_at":"2026-03-02T00:32:29.701Z","repository":{"id":96318767,"uuid":"217649965","full_name":"locuslab/uniform-convergence-NeurIPS19","owner":"locuslab","description":"The code for the NeurIPS19 paper and blog on \"Uniform convergence may be unable to explain generalization in deep learning\".","archived":false,"fork":false,"pushed_at":"2019-10-26T03:30:29.000Z","size":453,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-23T20:47:53.136Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","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/locuslab.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":"2019-10-26T03:21:57.000Z","updated_at":"2021-11-14T05:54:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"b44d2e35-9fc0-40a6-a08f-1b21b1404550","html_url":"https://github.com/locuslab/uniform-convergence-NeurIPS19","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/locuslab/uniform-convergence-NeurIPS19","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Funiform-convergence-NeurIPS19","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Funiform-convergence-NeurIPS19/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Funiform-convergence-NeurIPS19/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Funiform-convergence-NeurIPS19/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/locuslab","download_url":"https://codeload.github.com/locuslab/uniform-convergence-NeurIPS19/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locuslab%2Funiform-convergence-NeurIPS19/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29988046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T22:42:38.399Z","status":"ssl_error","status_checked_at":"2026-03-01T22:41:51.863Z","response_time":124,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-11-10T09:23:48.412Z","updated_at":"2026-03-02T00:32:24.677Z","avatar_url":"https://github.com/locuslab.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"## What does the code do.\n\nThe file ```experiments.py``` contains all the code required to run our experiments. Each run of this script trains a fully connected feedforward neural network on two random draws of a subset of the MNIST dataset from the same initialization. The results of the experiment (such as the numerical values of the NUMERATOR of the generalization bounds) are saved inside a new folder. The folder name is automatically assigned to be the lowest available integer in the parent folder.\n\nPlease see ```spec-file.txt``` and ```package-list.txt``` for the dependencies.\n\n#### Note: The file ```uniform-convergence.ipynb``` is a Jupyter Notebook that presents the code in a much more aesthetic format (although for slightly different parameter settings). The code in the notebook also prints the plots for you (which this script unfortunately does not). You can also find this notebook in our blog: https://locuslab.github.io/2019-07-09-uniform-convergence/\n\nThe rest of the document describes experiments.py\n\n\n## How to run the code.\n\nThe script has six options relevant to the paper that can be used as follows:\n\n```python experiments.py --h_dim=1024 --depth=5 --n_train=4096  --margin=10 --n_batch=64 --threshold=0.01```\n \n\n```h_dim``` sets the width of the network.   \n```depth``` corresponds to the number of hidden layers in the network.   \n```n_train``` is the size of the training dataset.   \n```margin``` and ```threshold``` determine the number of epochs until which the network is optimized to minimize the cross entropy loss. Specifically, the code will stop at the epoch when at least 1-threshold of the training data is classified by the given margin.\n\n\n## Where do I find the results.\n\n\nThe results of the experiments are stored as follows:\n\n```readme.txt```: contains the hyperparameters of the experiment.   \n\n```bounds.txt```: \t   \nContains a list of 6 numerical values corresponding to the NUMERATOR of the following generalization bounds (in the paper, we plot this divided by the denominator):   \nThe first value is the PAC-Bayes-based bound from Neyshabur et al '18   \nThe second value is the same bound replaced with distance from initialization.   \nThe third value is the same bound replaced with distance from weights learned on another subset.   \nThe fourth value is the covering number based bound from Bartlett et al '17   \nThe fifth value is the same bound but with distance from initialization (not l2).   \nThe final value is the bound from Neyshabur'19 et al., that applies only to single hidden layer networks.   \n\n```distance_between_weights.txt```:   \nContains a list of values corresponding to the l2 norm between the weights learned on two different datasets from the same initialization. Each value corresponds to the weight matrix at a particular depth (with the first value corresponding to the weight matrix following the input layer).   \n\n```distance_from_initialization.txt```:   \nContains l2 norms of the update matrices.   \n\n```spectral_norm.txt```:   \nContains spectral norms of the learned weight matrices.   \n\n```frobenius_norm.txt```:   \nContains the frobenius norms of the learned weight matrices.   \n\n```test_errors.txt```:   \nContains the two test errors from the two runs.   \n\n\n```margins.txt```:   \nContains the margin of the network on each training datapoint.   \n\n\n```test_margins.txt```:   \nContains the margin of the network on each test datapoint.   \n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocuslab%2Funiform-convergence-neurips19","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flocuslab%2Funiform-convergence-neurips19","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocuslab%2Funiform-convergence-neurips19/lists"}