{ "info": { "author": "CyberZHG", "author_email": "CyberZHG@users.noreply.github.com", "bugtrack_url": null, "classifiers": [ "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6" ], "description": "# Keras LR Multiplier\n\n[![Travis](https://travis-ci.org/CyberZHG/keras-lr-multiplier.svg)](https://travis-ci.org/CyberZHG/keras-lr-multiplier)\n[![Coverage](https://coveralls.io/repos/github/CyberZHG/keras-lr-multiplier/badge.svg?branch=master)](https://coveralls.io/github/CyberZHG/keras-lr-multiplier)\n[![Version](https://img.shields.io/pypi/v/keras-lr-multiplier.svg)](https://pypi.org/project/keras-lr-multiplier/)\n![Downloads](https://img.shields.io/pypi/dm/keras-lr-multiplier.svg)\n\n![](https://img.shields.io/badge/keras-tensorflow-blue.svg)\n![](https://img.shields.io/badge/keras-tf.keras-blue.svg)\n![](https://img.shields.io/badge/keras-tf.keras/eager-blue.svg)\n![](https://img.shields.io/badge/keras-tf.keras/2.0_beta-blue.svg)\n\n\\[[\u4e2d\u6587](https://github.com/CyberZHG/keras-lr-multiplier/blob/master/README.zh-CN.md)|[English](https://github.com/CyberZHG/keras-lr-multiplier/blob/master/README.md)\\]\n\nLearning rate multiplier wrapper for optimizers.\n\n## Install\n\n```bash\npip install keras-lr-multiplier\n```\n\n## Usage\n\n### Basic\n\n`LRMultiplier` is a wrapper for optimizers to assign different learning rates to specific layers (or weights). The first argument is the original optimizer which could be either an identifier (e.g. `'Adam'`) or an initialized object (e.g. `Adam(lr=1e-2)`). The second argument is a dict that maps prefixes to learning rate multipliers. The multiplier for a weight is the value mapped from the __longest matched prefix__ in the given dict, and the default multiplier `1.0` will be used if there is no prefix matched.\n\n```python\nfrom keras.models import Sequential\nfrom keras.layers import Dense\nfrom keras_lr_multiplier import LRMultiplier\n\nmodel = Sequential()\nmodel.add(Dense(\n units=5,\n input_shape=(5,),\n activation='tanh',\n name='Dense',\n))\nmodel.add(Dense(\n units=2,\n activation='softmax',\n name='Output',\n))\nmodel.compile(\n optimizer=LRMultiplier('adam', {'Dense': 0.5, 'Output': 1.5}),\n loss='sparse_categorical_crossentropy',\n)\n```\n\n### Lambda\n\nThe multiplier can be a callable object. The input argument is the number of steps starting from 0.\n\n```python\nfrom keras import backend as K\nfrom keras_lr_multiplier import LRMultiplier\n\nLRMultiplier('adam', {'Dense': lambda t: 2.0 - K.minimum(1.9, t * 1e-4)})\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/CyberZHG/keras-lr-multiplier", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "keras-lr-multiplier", "package_url": "https://pypi.org/project/keras-lr-multiplier/", "platform": "", "project_url": "https://pypi.org/project/keras-lr-multiplier/", "project_urls": { "Homepage": "https://github.com/CyberZHG/keras-lr-multiplier" }, "release_url": "https://pypi.org/project/keras-lr-multiplier/0.8.0/", "requires_dist": null, "requires_python": "", "summary": "Learning rate multiplier", "version": "0.8.0" }, "last_serial": 5905259, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "02dd2ef0ef3f11901d63187cd8cd2e66", "sha256": "899a2d1328b3772bc9c8bc60fdb90a2d70d41375ae1261886429e2cb6382ad78" }, "downloads": -1, "filename": "keras-lr-multiplier-0.1.0.tar.gz", "has_sig": false, "md5_digest": "02dd2ef0ef3f11901d63187cd8cd2e66", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3398, "upload_time": "2019-04-28T11:48:45", "url": "https://files.pythonhosted.org/packages/92/a2/eb506091d3e2afb0c15f3766e71f9b76c099fd81493351e84d93719a47a0/keras-lr-multiplier-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "f57a8988288996f807f0043409bce02a", "sha256": "e02077dea89d75f3ee4624c5c0a4061c874004b1a1e5c6bcd47f3b5c6b4da0e2" }, "downloads": -1, "filename": "keras-lr-multiplier-0.2.0.tar.gz", "has_sig": false, "md5_digest": "f57a8988288996f807f0043409bce02a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3650, "upload_time": "2019-04-30T08:49:30", "url": "https://files.pythonhosted.org/packages/0d/48/fc07dcf4e82e3ff32f4cf4d2d2ebc4e428ecee45e443838f03f6694c9679/keras-lr-multiplier-0.2.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "30560fbf195487a69d1c0e677cfe2e18", "sha256": "9d2f76fab992a5873788fa5235309e5ffe292d9021951738fc913edf2562ce71" }, "downloads": -1, "filename": "keras-lr-multiplier-0.4.0.tar.gz", "has_sig": false, "md5_digest": "30560fbf195487a69d1c0e677cfe2e18", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4733, "upload_time": "2019-05-16T08:17:16", "url": "https://files.pythonhosted.org/packages/19/56/661978153766f86fa142056b6d6b461ce98cb8c061c7ef92385360b622d3/keras-lr-multiplier-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "e8e4c7bbda92e33a837b79e9c4d0e22d", "sha256": "455a9b8978ead2df5fe38a884cda06576378177f3f681ecd3ee0b6d082b9fb83" }, "downloads": -1, "filename": "keras-lr-multiplier-0.5.0.tar.gz", "has_sig": false, "md5_digest": "e8e4c7bbda92e33a837b79e9c4d0e22d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5165, "upload_time": "2019-06-03T03:26:03", "url": "https://files.pythonhosted.org/packages/9e/c5/a9e164bc685c7a3217fe4b3d189158193a3be10973110273dab90bdc9100/keras-lr-multiplier-0.5.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "8ceec2f1b753364ce3b4396f23b63643", "sha256": "064c89f714be1a4df7253e0eb1fce73e7a45dbaeffe21cf20acb6f71c12875e0" }, "downloads": -1, "filename": "keras-lr-multiplier-0.6.0.tar.gz", "has_sig": false, "md5_digest": "8ceec2f1b753364ce3b4396f23b63643", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6452, "upload_time": "2019-06-11T07:10:13", "url": "https://files.pythonhosted.org/packages/92/4f/857cc5a4f7d65318a7095e6a31cec3905e6d9e33a1857064f1c7e65d7331/keras-lr-multiplier-0.6.0.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "6a757e7b2e6af387915d4c9f2db34f9a", "sha256": "d782c1d66ba1c36e50d973276622f7d6d7f199a7437748fb53b27f69cf4748ee" }, "downloads": -1, "filename": "keras-lr-multiplier-0.7.0.tar.gz", "has_sig": false, "md5_digest": "6a757e7b2e6af387915d4c9f2db34f9a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6402, "upload_time": "2019-06-11T07:35:52", "url": "https://files.pythonhosted.org/packages/d5/5d/18576888b68b7dfa54cbd20438e85ace697e1e18b08875c84205875099bb/keras-lr-multiplier-0.7.0.tar.gz" } ], "0.8.0": [ { "comment_text": "", "digests": { "md5": "789302c62f4c518a5b51fc0418017474", "sha256": "d64df32ff92855ef1cf92c29f87ccb01ea8a8b915e7a733c601454b417b0e063" }, "downloads": -1, "filename": "keras-lr-multiplier-0.8.0.tar.gz", "has_sig": false, "md5_digest": "789302c62f4c518a5b51fc0418017474", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5662, "upload_time": "2019-09-30T07:17:58", "url": "https://files.pythonhosted.org/packages/7d/78/0eed4862a7274fb491b50881dd2f0dac996ff5774dc4a30c4b628fb78b25/keras-lr-multiplier-0.8.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "789302c62f4c518a5b51fc0418017474", "sha256": "d64df32ff92855ef1cf92c29f87ccb01ea8a8b915e7a733c601454b417b0e063" }, "downloads": -1, "filename": "keras-lr-multiplier-0.8.0.tar.gz", "has_sig": false, "md5_digest": "789302c62f4c518a5b51fc0418017474", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5662, "upload_time": "2019-09-30T07:17:58", "url": "https://files.pythonhosted.org/packages/7d/78/0eed4862a7274fb491b50881dd2f0dac996ff5774dc4a30c4b628fb78b25/keras-lr-multiplier-0.8.0.tar.gz" } ] }