{ "info": { "author": "Calculation Consulting", "author_email": "info@calculationconsulting.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Science/Research", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering :: Artificial Intelligence" ], "description": "Weight Watcher\n--------------\n\n**Weight Watcher** analyzes the Fat Tails in the weight matrices of Deep\nNeural Networks (DNNs).\n\nThis tool can predict the trends in the generalization accuracy of a\nseries of DNNs, such as VGG11, VGG13, \u2026, or even the entire series of\nResNet models\u2013without needing a test set !\n\nThis relies upon recent research into the `Heavy (Fat) Tailed Self\nRegularization in DNNs `__\n\nThe tool lets one compute a averager capacity, or quality, metric for a\nseries of DNNs, trained on the same data, but with different\nhyperparameters, or even different but related architectures. For\nexample, it can predict that VGG19_BN generalizes better than VGG19, and\nbetter than VGG16_BN, VGG16, etc.\n\nTypes of Capacity Metrics:\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThere are 2 metrics availabe. The average **log Norm**, which is much\nfaster but less accurate. The average **weighted alpha** is more\naccurate but much slower because it needs to both compute the SVD of the\nlayer weight matrices, and thenaa fit the singluar/eigenvalues to a\npower law.\n\n- log Norm (default, fast, less accurate)\n- weighted alpaha (slow, more accurate)\n\nHere is an example of the **Weighted Alpha** capacity metric for all the\ncurrent pretrained VGG models. |alt text|\n\nNotice: we *did not peek* at the ImageNet test data to build this plot.\n\nFrameworks supported\n~~~~~~~~~~~~~~~~~~~~\n\n- Keras\n- PyTorch\n\nLayers supported\n~~~~~~~~~~~~~~~~\n\n- Dense / Linear / Fully Connected (and Conv1D)\n- Conv2D\n\nInstallation\n------------\n\n.. code:: sh\n\n pip install weightwatcher\n\nUsage\n-----\n\nWeight Watcher works with both Keras and pyTorch models.\n\n.. code:: python\n\n import weightwatcher as ww\n watcher = ww.WeightWatcher(model=model)\n results = watcher.analyze()\n\n watcher.get_summary()\n watcher.print_results()\n\nAdvanced Usage\n--------------\n\nThe analyze function has several features described below\n\n.. code:: python\n\n def analyze(self, model=None, layers=[], min_size=50, max_size=0,\n compute_alphas=False, compute_lognorms=True,\n plot=False):\n ...\n\nand in the `Demo\nNotebook `__\n\nweighted alpha (SLOW)\n~~~~~~~~~~~~~~~~~~~~~\n\nPower Law fit, here with pyTorch example\n\n.. code:: python\n\n import weightwatcher as ww\n import torchvision.models as models\n\n model = models.vgg19_bn(pretrained=True)\n watcher = ww.WeightWatcher(model=model)\n results = watcher.analyze(compute_alphas=True)\n data.append({\"name\": \"vgg19bntorch\", \"summary\": watcher.get_summary()})\n\n\n ### data:\n {'name': 'vgg19bntorch',\n 'summary': {'lognorm': 0.81850576,\n 'lognorm_compound': 0.9365272010550088,\n 'alpha': 2.9646726379493287,\n 'alpha_compound': 2.847975521455623,\n 'alpha_weighted': 1.1588882728052485,\n 'alpha_weighted_compound': 1.5002343912892515}},\n\nCapacity Metrics (evarages over all layers):\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n- lognorm: average log norm, fast\n- alpha_weight: average weighted alpha, slow\n\n- alpha: average alpha, not weighted (slow, not as useful)\n\nCompound averages:\n\nSame as above, but averages are computed slightly differently. This will\nbe desrcibed in an upcoming paper.\n\nResults are also provided for every layer; see `Demo\nNotebook `__\n\nAdditional options\n~~~~~~~~~~~~~~~~~~\n\nfilter by layer types\n^^^^^^^^^^^^^^^^^^^^^\n\n.. code:: python\n\n results = watcher.analyze(layers=ww.LAYER_TYPE.CONV1D|ww.LAYER_TYPE.DENSE)\n\nfilter by ids\n^^^^^^^^^^^^^\n\n.. code:: python\n\n results = watcher.analyze(layers=[20])\n\nminimum, maximum size of weight matrix\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nSets the minimum and maximum size of the weight matrices analyzed.\nSetting max is useful for a quick debugging.\n\n.. code:: python\n\n results = watcher.analyze(min_size=50, max_size=500)\n\nplots (for weight_alpha=True)\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nCreate log-log plots for each layer weight matrix to observe how well\nthe power law fits work\n\n.. code:: python\n\n results = watcher.analyze(compute_alphas=True, plot=True)\n\nLinks\n-----\n\n`Demo\nNotebook `__\n\n`Calculation Consulting homepage `__\n\n`Calculated Content Blog `__\n\n--------------\n\n`Implicit Self-Regularization in Deep Neural Networks: Evidence from\nRandom Matrix Theory and Implications for\nLearning `__\n\n`Traditional and Heavy Tailed Self Regularization in Neural Network\nModels `__\n\nNotebook for above 2 papers\n(https://github.com/CalculatedContent/ImplicitSelfRegularization)\n\n`Recent talk (presented at NERSC Summer\n2018) `__\n\n--------------\n\n`Heavy-Tailed Universality Predicts Trends in Test Accuracies for Very\nLarge Pre-Trained Deep Neural\nNetworks `__\n\nNotebook for paper\n(https://github.com/CalculatedContent/PredictingTestAccuracies)\n\n`Latest Talk (presented at UC Berkeley/ICSI\n12/13/2018) `__\n\n--------------\n\nRelease\n-------\n\nPublishing to the PyPI repository:\n\n.. code:: sh\n\n # 1. Check in the latest code with the correct revision number (__version__ in __init__.py)\n vi weightwatcher/__init__.py # Increse release number, remove -dev to revision number\n git commit\n # 2. Check out latest version from the repo in a fresh directory\n cd ~/temp/\n git clone https://github.com/CalculatedContent/WeightWatcher\n cd WeightWatcher/\n # 3. Use the latest version of the tools\n python -m pip install --upgrade setuptools wheel twine\n # 4. Create the package\n python setup.py sdist bdist_wheel\n # 5. Test the package\n twine check dist/*\n # 6. Upload the package to PyPI\n twine upload dist/*\n # 7. Tag/Release in github by creating a new release (https://github.com/CalculatedContent/WeightWatcher/releases/new)\n\nLicense\n-------\n\n`Apache License 2.0 `__\n\n.. |alt text| image:: https://github.com/CalculatedContent/PredictingTestAccuracies/blob/master/img/vgg-w_alphas.png\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://calculationconsulting.com/", "keywords": "Deep Learning Keras Tensorflow pytorch CNN DNN Neural Networks", "license": "Apache License, Version 2.0", "maintainer": "Calculation Consulting", "maintainer_email": "info@calculationconsulting.com", "name": "WeightWatcher", "package_url": "https://pypi.org/project/WeightWatcher/", "platform": "", "project_url": "https://pypi.org/project/WeightWatcher/", "project_urls": { "Code": "https://github.com/calculatedcontent/weightwatcher", "Documentation": "https://calculationconsulting.com/", "Homepage": "https://calculationconsulting.com/", "Issue tracker": "https://github.com/calculatedcontent/weightwatcher/issues" }, "release_url": "https://pypi.org/project/WeightWatcher/0.1.2/", "requires_dist": [ "numpy", "matplotlib", "powerlaw", "tensorflow", "keras", "sklearn", "pandas" ], "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "summary": "Analyze weight matrices of Deep Neural Networks", "version": "0.1.2" }, "last_serial": 5364754, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "785fea77535dc70b76c76fffd8113b80", "sha256": "38311c864b8f9c1c68accc4026b721b2c64acd960936253098208768433904bc" }, "downloads": -1, "filename": "WeightWatcher-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "785fea77535dc70b76c76fffd8113b80", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 12685, "upload_time": "2018-11-28T22:28:07", "url": "https://files.pythonhosted.org/packages/bf/3a/9d78e9d8a5c15c0f6db9bdf124fef786d5c2c836e0cb01563eb8ad06e874/WeightWatcher-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "db8398dd425d9781750169a97802cfa2", "sha256": "b8e726c355572745199ab6228929f6b5caa0c56b0ebd522c44711dc51e91488a" }, "downloads": -1, "filename": "WeightWatcher-0.1.tar.gz", "has_sig": false, "md5_digest": "db8398dd425d9781750169a97802cfa2", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 176157, "upload_time": "2018-11-28T22:28:10", "url": "https://files.pythonhosted.org/packages/5d/8f/48ec5682bff603ca8e8d7927952011dec858162ab557e056d9136b1ff22c/WeightWatcher-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "8a73d717dbf16af77d5fb3d72f4c522f", "sha256": "ba5a455bd27558a691118225e2f9f5df2c05c2fb59f0bec2b79d1264da9f7269" }, "downloads": -1, "filename": "WeightWatcher-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8a73d717dbf16af77d5fb3d72f4c522f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 12895, "upload_time": "2018-11-28T23:44:57", "url": "https://files.pythonhosted.org/packages/b1/a6/233097381d4426cc20201ac13b115814aced6c0068a36fa7bfa882c83301/WeightWatcher-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3604a435a05fdb931a0cdf80398cf470", "sha256": "1f7e76884c00e29e62de4193cd6042ff2c23f622970806c8f707659ec24d29e7" }, "downloads": -1, "filename": "WeightWatcher-0.1.1.tar.gz", "has_sig": false, "md5_digest": "3604a435a05fdb931a0cdf80398cf470", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 176456, "upload_time": "2018-11-28T23:45:01", "url": "https://files.pythonhosted.org/packages/5a/50/bf479252ee110cc3ae851d60d4f54b5a459778681f5861f882fc49b1fe34/WeightWatcher-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "acff91d95e8a30ed174a37114ea4989c", "sha256": "68027aa06d7f8aa460d070e2602f3eb6aadc42346d154c39da89bfd6dd537e25" }, "downloads": -1, "filename": "WeightWatcher-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "acff91d95e8a30ed174a37114ea4989c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 16378, "upload_time": "2019-06-05T23:40:53", "url": "https://files.pythonhosted.org/packages/6e/b4/5b09abc1713ffe8d3f0cad7bde7e678a5263019e1000355f433295133830/WeightWatcher-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e3cc4a1dd0e63cd74ae72598ed8709f0", "sha256": "0cb77eb64875d67792b498a4ec6c59834234dbea1eb6bc26cb2aa885e456911a" }, "downloads": -1, "filename": "WeightWatcher-0.1.2.tar.gz", "has_sig": false, "md5_digest": "e3cc4a1dd0e63cd74ae72598ed8709f0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 93504, "upload_time": "2019-06-05T23:40:57", "url": "https://files.pythonhosted.org/packages/5e/9c/7354258a1c77c713dee09d8c560ebe94a953876f97176b08629a23523c4e/WeightWatcher-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "acff91d95e8a30ed174a37114ea4989c", "sha256": "68027aa06d7f8aa460d070e2602f3eb6aadc42346d154c39da89bfd6dd537e25" }, "downloads": -1, "filename": "WeightWatcher-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "acff91d95e8a30ed174a37114ea4989c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 16378, "upload_time": "2019-06-05T23:40:53", "url": "https://files.pythonhosted.org/packages/6e/b4/5b09abc1713ffe8d3f0cad7bde7e678a5263019e1000355f433295133830/WeightWatcher-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e3cc4a1dd0e63cd74ae72598ed8709f0", "sha256": "0cb77eb64875d67792b498a4ec6c59834234dbea1eb6bc26cb2aa885e456911a" }, "downloads": -1, "filename": "WeightWatcher-0.1.2.tar.gz", "has_sig": false, "md5_digest": "e3cc4a1dd0e63cd74ae72598ed8709f0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", "size": 93504, "upload_time": "2019-06-05T23:40:57", "url": "https://files.pythonhosted.org/packages/5e/9c/7354258a1c77c713dee09d8c560ebe94a953876f97176b08629a23523c4e/WeightWatcher-0.1.2.tar.gz" } ] }