{ "info": { "author": "Ray Xu", "author_email": "rxuniverse@google.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2" ], "description": "# CoordConv for Keras\nKeras implementation of CoordConv from the paper [An intriguing failing of convolutional neural networks and the CoordConv solution](https://arxiv.org/abs/1807.03247).\n\nExtends the `CoordinateChannel` concatenation from only 2D rank (images) to 1D (text / time series) and 3D tensors (video / voxels).\n\n# Usage\n\nImport `coord.py` and call it *before* any convolution layer in order to attach the coordinate channels to the input.\n\nThere are **3 different versions of CoordinateChannel** - 1D, 2D and 3D for each of `Conv1D`, `Conv2D` and `Conv3D`. \n\n```python\nfrom coord import CoordinateChannel2D\n\n# prior to first conv\nip = Input(shape=(64, 64, 2))\nx = CoordinateChannel2D()(ip)\nx = Conv2D(...)(x) # This defines the `CoordConv` from the paper.\n...\nx = CoordinateChannel2D(use_radius=True)(x)\nx = Conv2D(...)(x) # This adds the 3rd channel for the radius.\n```\n\n# Experiments\n\nThe experiments folder contains the `Classification` of a 64x64 grid using the coordinate index as input as in the paper for both `Uniform` and `Quadrant` datasets.\n\n## Creating the datasets\nFirst, edit the `make_dataset.py` file to change the `type` parameter - to either `uniform` or `quadrant`. This will generate 2 folders for the datasets and several numpy files.\n\n## Uniform Dataset\nThe uniform dataset model can be trained and evaluated in less than 10 epochs using `train_uniform_classifier.py`.\n\n|Train | Test | Predictions |\n|:---: | :---: | :-----------: |\n| | | |\n\n## Quadrant Dataset\nThe quadrant dataset model can be trained and evaluated in less than 25 epochs using `train_quadrant_classifier.py`\n\n|Train | Test | Predictions |\n|:---: | :---: | :-----------: |\n| | | |\n\n# Checks\n\nTo see if the implementation of CoordConv index concatenation is correct, please refer to the numpy implementations in\nthe `checks` directory, for the implementation of all 3 versions.\n\n## **Difference from paper**\nThis implementation of the coordinate channels creation differs slightly from the original paper.\n\nThe major difference is that for 2/3D Convolutions, it may not be the case that the height and width are the same\nfor all layers. The original implementation would throw an error due to shape mismatch during the concatenation.\n\nTo over come this, the `np.ones()` operation which occurs at the first of every channel is modified and a few\ntranspose operations are added to account for this change.\n\nThis modification along with some transpose operations allows for height and width to be different and still work.\n\n## Theano Support\n\nTheano is partially supported with the `coord_theano.py` script and using passing a static batch size to the Input layer.\n\n# Requirements\n\n- Keras 2.2.0+\n- Either Tensorflow or CNTK backend.\n- Matplotlib (to plot images only)\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "Keras-CoordConv", "package_url": "https://pypi.org/project/Keras-CoordConv/", "platform": "", "project_url": "https://pypi.org/project/Keras-CoordConv/", "project_urls": null, "release_url": "https://pypi.org/project/Keras-CoordConv/0.6/", "requires_dist": [ "keras" ], "requires_python": "", "summary": "Keras implementation of CoordConv from the paper [An intriguing failing of convolutional neural networks and the CoordConv solution](https://arxiv.org/abs/1807.03247).", "version": "0.6" }, "last_serial": 4545266, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "ff2a23ab821cda370010b0cea3ae51ed", "sha256": "23a80a5cfc4f9bdcd51b1b5f50fdf0526aa130cd4d5a7084c4b8a482b0c8c9a2" }, "downloads": -1, "filename": "Keras_CoordConv-0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "ff2a23ab821cda370010b0cea3ae51ed", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 8615, "upload_time": "2018-11-30T01:52:49", "url": "https://files.pythonhosted.org/packages/41/75/bf39e0cd229a42cb2595d39448ba6eece71bfc338653a9aa8d8d586ce6b2/Keras_CoordConv-0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e1cd055dfb46e8f1d79039997f4f2220", "sha256": "704290384959745d24cb5211cd5d105b8f5bce447cdb5ad4fb1239417cfeee41" }, "downloads": -1, "filename": "Keras_CoordConv-0.2.tar.gz", "has_sig": false, "md5_digest": "e1cd055dfb46e8f1d79039997f4f2220", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4626, "upload_time": "2018-11-30T01:52:51", "url": "https://files.pythonhosted.org/packages/59/44/0e967f489e0d28d27d8599692d624d1d03337b8fd72730a23dbe0d229531/Keras_CoordConv-0.2.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "870f1c762b96b00076a4f2d458a894bc", "sha256": "34347324115efefe22e0102956ad292fce6a8e98f47248c1f2edad62c0b5ad79" }, "downloads": -1, "filename": "Keras_CoordConv-0.6-py2-none-any.whl", "has_sig": false, "md5_digest": "870f1c762b96b00076a4f2d458a894bc", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 13604, "upload_time": "2018-11-30T02:16:26", "url": "https://files.pythonhosted.org/packages/59/5d/2a16ffcc395f23c0158fedcdac9b7ab731062fca335899409489fb644881/Keras_CoordConv-0.6-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5591da18c7b57b7cd9bd66b943f12db8", "sha256": "3d1a12fb131a91003dae3faa3dde8f5e06072b6e3094392e5f254d0fe8b4eee9" }, "downloads": -1, "filename": "Keras_CoordConv-0.6.tar.gz", "has_sig": false, "md5_digest": "5591da18c7b57b7cd9bd66b943f12db8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6198, "upload_time": "2018-11-30T02:16:28", "url": "https://files.pythonhosted.org/packages/d2/aa/4bbce2d9645afa6523df8d8a53832d8999367e8f89297a43382146814f15/Keras_CoordConv-0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "870f1c762b96b00076a4f2d458a894bc", "sha256": "34347324115efefe22e0102956ad292fce6a8e98f47248c1f2edad62c0b5ad79" }, "downloads": -1, "filename": "Keras_CoordConv-0.6-py2-none-any.whl", "has_sig": false, "md5_digest": "870f1c762b96b00076a4f2d458a894bc", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 13604, "upload_time": "2018-11-30T02:16:26", "url": "https://files.pythonhosted.org/packages/59/5d/2a16ffcc395f23c0158fedcdac9b7ab731062fca335899409489fb644881/Keras_CoordConv-0.6-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5591da18c7b57b7cd9bd66b943f12db8", "sha256": "3d1a12fb131a91003dae3faa3dde8f5e06072b6e3094392e5f254d0fe8b4eee9" }, "downloads": -1, "filename": "Keras_CoordConv-0.6.tar.gz", "has_sig": false, "md5_digest": "5591da18c7b57b7cd9bd66b943f12db8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6198, "upload_time": "2018-11-30T02:16:28", "url": "https://files.pythonhosted.org/packages/d2/aa/4bbce2d9645afa6523df8d8a53832d8999367e8f89297a43382146814f15/Keras_CoordConv-0.6.tar.gz" } ] }