{ "info": { "author": "Amartya Sanyal", "author_email": "amartya18x@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "[![Build Status](https://travis-ci.org/amartya18x/easyGrad.svg?branch=master)](https://travis-ci.org/amartya18x/easyGrad)\n# Easy Grad\n\nThis library aims to provide an easy implementation of doing symbolic operations in python\n## Operators allowed\n\n- *exp(x)* and *log(x)*\n```Python\ndef testOps():\n x = Integer('x')\n y = ops.log(x)\n z = ops.exp(y)\n graph = GradGraph(z)\n graph.getOutput({x: 1})\n graph.getGradients(wrt=x)\n print x.gradient\n```\n- *Sigmoid(x)*\n```Python\n\ndef activ_fns():\n x = Double('x')\n z = ops.sigmoid(x)\n graph = GradGraph(z)\n graph.getOutput({x: 110.5})\n graph.getGradients(wrt=x)\n print x.gradient\n```\n- *Tanh(x)*\n```Python\n\ndef activ_fns():\n x = Double('x')\n z = ops.tanh(x)\n graph = GradGraph(z)\n graph.getOutput({x: 110.5})\n graph.getGradients(wrt=x)\n print x.gradient\n```\n\n## Testing\n\n```Python\ndef gradTestSimple(): \n a = Integer(\"a\") \n b = Integer(\"b\") \n c = a + b \n d = b + 6 \n e = c * d \n graph = GradGraph(e) \n graph.getOutput({a: 32, \n b: 11}) \n graph.getGradients(wrt=b) \n print a.gradient, b.gradient \n```\n### Here is a more complex example.\n```Python\ndef gradTest(): \n x = Integer(\"Int1x\") \n y = Integer(\"Int2y\") \n z = Integer(\"Int3z\") \n p = Integer(\"Int4p\") \n k = p * z \n t = y * k \n m = k + t \n n = m * z \n graph = GradGraph(n) \n graph.getOutput({x: 9, \n y: 9, \n z: 9, \n p: 2}) \n graph.getGradients(wrt=z) \n print x.gradient, y.gradient, z.gradient, p.gradient\n```\n### This is the same examples as above but the commands are not three op commands.\n\n```Python\ndef gradTestLong(): \n x = Integer(\"Int1x\") \n y = Integer(\"Int2y\") \n z = Integer(\"Int3z\") \n p = Integer(\"Int4p\") \n k = p * z \n n = (k + (y * p * z)) * z \n graph = GradGraph(n) \n graph.getOutput({x: 9, \n y: 9, \n z: 9, \n p: 2}) \n graph.getGradients(wrt=z) \n print x.gradient, y.gradient, z.gradient, p.gradient\n```\nTensor Operations\n```Python\n\ndef dotProduct():\n x = DoubleTensor(\"Tensor1\")\n y = x.dot([3, 4])\n z = y.dot([4, 5])\n graph = GradGraph(z)\n output = graph.getOutput({x: [3, 4]})\n graph.getGradients(wrt=x)\n assert(np.all(output == [100, 125]))\n assert(np.all(x.gradient == [[ 12., 16.], [ 15., 20.]]))\n\t\n\n\ndef TensorOp():\n x = DoubleTensor(\"Tensor1\")\n y = x - [3, 4]\n z = ops.log(y * x)\n graph = GradGraph(z)\n output = graph.getOutput({x: [10]})\n assert(np.all(np.isclose(output, np.log(10 * (10 - np.asarray([3, 4]))))))\n graph.getGradients(wrt=x)\n a = 2 * 10 - np.asarray([3, 4])\n b = 1.0/np.exp(np.asarray(output))\n assert(np.all(np.isclose(x.gradient, a * b)))\n\n\n```", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://packages.python.org/easyGrad", "keywords": "autodiff machine-learning deep learning", "license": "License.md", "maintainer": "", "maintainer_email": "", "name": "easyGrad", "package_url": "https://pypi.org/project/easyGrad/", "platform": "", "project_url": "https://pypi.org/project/easyGrad/", "project_urls": { "Homepage": "http://packages.python.org/easyGrad" }, "release_url": "https://pypi.org/project/easyGrad/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "A python package to do auto differentiation.", "version": "1.0.0" }, "last_serial": 3128688, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "26db512487fabfd803102f676589759b", "sha256": "d17f2dcee4c7d4f6ccf99cc0befdefdedd4d73d3d1cf862000d510e223ec0c45" }, "downloads": -1, "filename": "easyGrad-0.0.1.tar.gz", "has_sig": false, "md5_digest": "26db512487fabfd803102f676589759b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5307, "upload_time": "2017-08-09T21:38:43", "url": "https://files.pythonhosted.org/packages/53/3b/10de158a4ba36aaf9b5e2be7553506c4d3accf04b5e09b6ef51acca62b11/easyGrad-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "98daf4123676af045f63358592531feb", "sha256": "f30219129e99103fa1b4322022477ca45bf4f8f541b5b76cbcf5fcf5818e2be2" }, "downloads": -1, "filename": "easyGrad-0.0.2.tar.gz", "has_sig": false, "md5_digest": "98daf4123676af045f63358592531feb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2026, "upload_time": "2017-08-09T21:51:50", "url": "https://files.pythonhosted.org/packages/18/43/c79644f30a481553929a9af00044c5fbc11bdc27f771a858def632c71416/easyGrad-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "2f77864ca1b8e3c2613db549a293988d", "sha256": "224629cf7fd746582f292a8ee17824b1430c4a453526e5d0b9aafc3bca8167fb" }, "downloads": -1, "filename": "easyGrad-0.0.3.tar.gz", "has_sig": false, "md5_digest": "2f77864ca1b8e3c2613db549a293988d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3350, "upload_time": "2017-08-09T22:00:34", "url": "https://files.pythonhosted.org/packages/4d/49/30aac53ee0957873de2faaf1ac31a3bf2fa14c2dff0c121d9f877553bbb0/easyGrad-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "ae0902d44c4e17fce7a047c85254d3b1", "sha256": "bbee61d3481a1ec6b6e5fcb7340eec7b6d29993e78c46e60f6e1fbfe4348519d" }, "downloads": -1, "filename": "easyGrad-0.0.4-py2.7.egg", "has_sig": false, "md5_digest": "ae0902d44c4e17fce7a047c85254d3b1", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 20432, "upload_time": "2017-08-28T05:07:03", "url": "https://files.pythonhosted.org/packages/28/7e/b74c2a0a1ed9de5da66dab305df198bf5ba80c936819e37abce62d54da5a/easyGrad-0.0.4-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "e9af9519c7c8318ecb57bfee4844ddb7", "sha256": "843f676b6670cf2f325b16600551e29ec2572f57a9fc52ff47bbbe22107dfcc4" }, "downloads": -1, "filename": "easyGrad-0.0.4.tar.gz", "has_sig": false, "md5_digest": "e9af9519c7c8318ecb57bfee4844ddb7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5507, "upload_time": "2017-08-28T04:21:39", "url": "https://files.pythonhosted.org/packages/7b/e2/6de72c5162b314f1c36e87f612e3bc201ed595b499d7efe9907002d0d65c/easyGrad-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "2116439d14dc0f7093e781e9ab27cef5", "sha256": "9fa8e70c99bfbc5c718c1f7de41fa501cc6cdcf2f64245b46828a7c8928f3c11" }, "downloads": -1, "filename": "easyGrad-0.0.5.tar.gz", "has_sig": false, "md5_digest": "2116439d14dc0f7093e781e9ab27cef5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6144, "upload_time": "2017-08-28T05:07:35", "url": "https://files.pythonhosted.org/packages/33/53/111367356d0fd107e6d38c5763bce349151d831d6d6eb9835e0550dd18c7/easyGrad-0.0.5.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "1461ba82e8a6e64ebdae601aadaf0941", "sha256": "85cce77651587aae25851aa8f2b3654f5f98f8197c427f686e786247ffca7cc1" }, "downloads": -1, "filename": "easyGrad-1.0.0.tar.gz", "has_sig": false, "md5_digest": "1461ba82e8a6e64ebdae601aadaf0941", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6361, "upload_time": "2017-08-28T10:40:03", "url": "https://files.pythonhosted.org/packages/9a/99/35c5846e0942c7a0b82aa100b983bb1ca244c22060d7a9fd09b43d035594/easyGrad-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1461ba82e8a6e64ebdae601aadaf0941", "sha256": "85cce77651587aae25851aa8f2b3654f5f98f8197c427f686e786247ffca7cc1" }, "downloads": -1, "filename": "easyGrad-1.0.0.tar.gz", "has_sig": false, "md5_digest": "1461ba82e8a6e64ebdae601aadaf0941", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6361, "upload_time": "2017-08-28T10:40:03", "url": "https://files.pythonhosted.org/packages/9a/99/35c5846e0942c7a0b82aa100b983bb1ca244c22060d7a9fd09b43d035594/easyGrad-1.0.0.tar.gz" } ] }