{ "info": { "author": "zhaofeng-shu33", "author_email": "616545598@qq.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# ace_nn\n[![Build Status](https://travis-ci.org/zhaofeng-shu33/ace_nn.svg?branch=master)](https://travis-ci.org/zhaofeng-shu33/ace_nn)\n\n## Introduction\n\nThis repo contains experimental implementation of ace algorithm via neural network. It is shown by **xiangxiang-xu** that calculating optimal features by *Alternating Conditional Expectation* is equivalent to maximize *H-score*. \n\n## How to run\n\nThree examples are provided ( one for continuous variable and the other twos are for discrete variable) and their results are the same as `ace`. The main function is `ace_nn` and its parameters are very similar to [`ace_cream`](https://github.com/zhaofeng-shu33/ace_cream). \n\n```python\nimport numpy as np\nfrom ace_nn import ace_nn\n# discrete case, binary symmetric channel with crossover probability 0.1\nN_SIZE = 1000\nx = np.random.choice([0,1], size=N_SIZE)\nn = np.random.choice([0,1], size=N_SIZE, p=[0.9, 0.1])\ny = np.mod(x + n, 2)\n# set both x(cat=0) and y(cat=-1) as categorical type\ntx, ty = ace_nn(x, y, cat=[-1,0], epochs=100)\n\n# continuous case\nx = np.random.uniform(0, np.pi, 200)\ny = np.exp(np.sin(x)+np.random.normal(size=200)/2)\ntx, ty = ace_nn(x, y)\n```\n\nFor more detail, run `help(ace_nn)` to see the parameters and returns of this function.\n\n## Further discussion\n\nCurrently, the neural networks used to approximate optimal $f(x)$ and $g(y)$ are two-layer MLP with `tanh` as activation function. More turns of epochs are needed for large alphabet $|\\mathcal{X}|$ and $|\\mathcal{Y}|$ and the running time is not short.\n\nAlso, `batch_size` and `hidden_units_num` can be hypertuned, and there is no guarantee that current configuration of neural network is optimal for solving ace.\n\n## Application\nwe can use `ace_nn(x, y, return_hscore = True)` to calculate a lower bound of $\\frac{\\norm{B}_F^2}{2}$", "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/zhaofeng-shu33/ace_nn", "keywords": "", "license": "Apache License Version 2.0", "maintainer": "zhaofeng-shu33", "maintainer_email": "616545598@qq.com", "name": "ace-nn", "package_url": "https://pypi.org/project/ace-nn/", "platform": "", "project_url": "https://pypi.org/project/ace-nn/", "project_urls": { "Homepage": "https://github.com/zhaofeng-shu33/ace_nn" }, "release_url": "https://pypi.org/project/ace-nn/0.2/", "requires_dist": null, "requires_python": "", "summary": "Alternating Conditional Exceptation with Neural Network", "version": "0.2" }, "last_serial": 4883796, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "5340b179c82ee26c5fe384289669c511", "sha256": "1ac0af77e8709d5ff5d5af905f318c471aca4ddb2826a5024f587e8def270ba9" }, "downloads": -1, "filename": "ace_nn-0.1.tar.gz", "has_sig": false, "md5_digest": "5340b179c82ee26c5fe384289669c511", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3799, "upload_time": "2019-03-01T11:28:23", "url": "https://files.pythonhosted.org/packages/d7/31/2157850a793a2842f72c10fb12c6a8e4293a5280475e41c6647bb02cf18f/ace_nn-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "22d9b1bdab87e39d0f525baf9c204755", "sha256": "c51c7c2b0853c6945173def0170eb93b28275ffee8de81ee66ef6c7ea338f519" }, "downloads": -1, "filename": "ace_nn-0.2.tar.gz", "has_sig": false, "md5_digest": "22d9b1bdab87e39d0f525baf9c204755", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3793, "upload_time": "2019-03-01T11:31:13", "url": "https://files.pythonhosted.org/packages/b1/cc/69418eba970547c4fed55a8e7bfdd0ec83dd5646a3a59db8e1cf35c172f8/ace_nn-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "22d9b1bdab87e39d0f525baf9c204755", "sha256": "c51c7c2b0853c6945173def0170eb93b28275ffee8de81ee66ef6c7ea338f519" }, "downloads": -1, "filename": "ace_nn-0.2.tar.gz", "has_sig": false, "md5_digest": "22d9b1bdab87e39d0f525baf9c204755", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3793, "upload_time": "2019-03-01T11:31:13", "url": "https://files.pythonhosted.org/packages/b1/cc/69418eba970547c4fed55a8e7bfdd0ec83dd5646a3a59db8e1cf35c172f8/ace_nn-0.2.tar.gz" } ] }