{ "info": { "author": "Ravindra Marella", "author_email": "mv.ravindra007@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "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", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Software Development", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "A framework for quickly creating machine learning models using Estimator API of TensorFlow.\n\n\n\n- [Installation](#installation)\n- [Getting Started](#getting-started)\n\t- [Example: CNN MNIST Classifier](#example-cnn-mnist-classifier)\n\t- [Model Function](#model-function)\n- [License](#license)\n\n\n\n\n## Installation\n\n[Install TensorFlow]:\n\n```sh\npip install tensorflow\n```\n\nand run:\n\n```sh\npip install estimator\n```\n\nIt is recommended to use a [virtual environment].\n\n\n## Getting Started\n\n```py\nfrom estimator import Model\nimport tensorflow as tf\n\n# Define the network architecture - layers, number of units, activations etc.\ndef network(inputs):\n hidden = tf.layers.Dense(units=64, activation=tf.nn.relu)(inputs)\n outputs = tf.layers.Dense(units=10)(hidden)\n return outputs\n\n# Configure the learning process - loss, optimizer, evaluation metrics etc.\nmodel = Model(network,\n loss='sparse_softmax_cross_entropy',\n optimizer=('GradientDescent', 0.001),\n metrics=['accuracy'])\n\n# Train the model using training data\nmodel.train(x_train, y_train, epochs=30, batch_size=128)\n\n# Evaluate the model performance on test or validation data\nloss_and_metrics = model.evaluate(x_test, y_test)\n\n# Use the model to make predictions for new data\npredictions = model.predict(x)\n# or call the model directly\npredictions = model(x)\n```\n\nMore configuration options are available:\n\n```py\nmodel = Model(network,\n loss='sparse_softmax_cross_entropy',\n optimizer=optimizer('GradientDescent', 0.001),\n metrics=['accuracy'],\n model_dir='/tmp/my_model')\n```\n\nYou can also use custom functions for loss and metrics:\n\n```py\ndef custom_loss(labels, outputs):\n pass\n\ndef custom_metric(labels, outputs):\n pass\n\nmodel = Model(network,\n loss=custom_loss,\n optimizer=('GradientDescent', 0.001),\n metrics=['accuracy', custom_metric])\n```\n\n### Example: CNN MNIST Classifier\n\nThis example is based on the [MNIST example] of TensorFlow:\n\n```py\nfrom estimator import Model, GradientDescent, TRAIN\nimport tensorflow as tf\n\ndef network(x, mode):\n x = tf.reshape(x, [-1, 28, 28, 1])\n x = tf.layers.Conv2D(filters=32, kernel_size=[5, 5], padding='same', activation=tf.nn.relu)(x)\n x = tf.layers.MaxPooling2D(pool_size=[2, 2], strides=2)(x)\n x = tf.layers.Conv2D(filters=64, kernel_size=[5, 5], padding='same', activation=tf.nn.relu)(x)\n x = tf.layers.MaxPooling2D(pool_size=[2, 2], strides=2)(x)\n x = tf.layers.Flatten()(x)\n x = tf.layers.Dense(units=1024, activation=tf.nn.relu)(x)\n x = tf.layers.Dropout(rate=0.4)(x, training=mode == TRAIN)\n x = tf.layers.Dense(units=10)(x)\n return x\n\n# Configure the learning process\nmodel = Model(network,\n loss='sparse_softmax_cross_entropy',\n optimizer=('GradientDescent', 0.001))\n```\n\n`mode` parameter specifies whether the model is used for training, evaluation or prediction.\n\n### Model Function\n\nTo have more control, you may configure the model inside a function using `Estimator` class:\n\n```py\nfrom estimator import Estimator, PREDICT\nimport tensorflow as tf\n\ndef model(features, labels, mode):\n # Define the network architecture\n hidden = tf.layers.Dense(units=64, activation=tf.nn.relu)(features)\n outputs = tf.layers.Dense(units=10)(hidden)\n predictions = tf.argmax(outputs, axis=1)\n # In prediction mode, simply return predictions without configuring learning process\n if mode == PREDICT:\n return predictions\n\n # Configure the learning process for training and evaluation modes\n loss = tf.losses.sparse_softmax_cross_entropy(labels, outputs)\n optimizer = tf.train.GradientDescentOptimizer(0.001)\n accuracy = tf.metrics.accuracy(labels, predictions)\n return dict(loss=loss,\n optimizer=optimizer,\n metrics={'accuracy': accuracy})\n\n# Create the model using model function\nmodel = Estimator(model)\n\n# Train the model\nmodel.train(x_train, y_train, epochs=30, batch_size=128)\n```\n\n\n## License\n\n[MIT][license]\n\n\n[license]: /LICENSE\n[virtual environment]: https://docs.python.org/3/library/venv.html\n[MNIST example]: https://www.tensorflow.org/tutorials/layers#building_the_cnn_mnist_classifier\n[Install TensorFlow]: https://www.tensorflow.org/install/", "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/AppliedDeepLearning/estimator", "keywords": "estimator tensorflow neural-network deep-learning machine-learning", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "estimator", "package_url": "https://pypi.org/project/estimator/", "platform": "", "project_url": "https://pypi.org/project/estimator/", "project_urls": { "Homepage": "https://github.com/AppliedDeepLearning/estimator" }, "release_url": "https://pypi.org/project/estimator/0.0.10/", "requires_dist": null, "requires_python": "", "summary": "A framework for quickly creating machine learning models using Estimator API of TensorFlow.", "version": "0.0.10" }, "last_serial": 3850385, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "207e16bb7744e1240dce49d860d1570c", "sha256": "017a55d841c103f88abbea8d49d7180c60f4818f097c6c0753b344c205f7d377" }, "downloads": -1, "filename": "estimator-0.0.0.tar.gz", "has_sig": false, "md5_digest": "207e16bb7744e1240dce49d860d1570c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4913, "upload_time": "2018-04-17T21:29:24", "url": "https://files.pythonhosted.org/packages/04/4b/da24b46e543f0d799fd02c7c2c393a87fdcd04100e114cbb875f275eebb0/estimator-0.0.0.tar.gz" } ], "0.0.1": [ { "comment_text": "", "digests": { "md5": "323d2d52945519c20ba56fc27792fb93", "sha256": "9456adf35a9553773764eb3ac2337c4269fa12aa22979f2d90bc55ff922f3c4f" }, "downloads": -1, "filename": "estimator-0.0.1.tar.gz", "has_sig": false, "md5_digest": "323d2d52945519c20ba56fc27792fb93", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4915, "upload_time": "2018-04-17T21:57:19", "url": "https://files.pythonhosted.org/packages/51/39/db87f2105bc1df8180a2db0e2205ea9efb99e83a75da374f87ed94b6744d/estimator-0.0.1.tar.gz" } ], "0.0.10": [ { "comment_text": "", "digests": { "md5": "2cd6e15127ee705f01ccf2188c0b9b52", "sha256": "aefd7d76940d283deefee1497f15487cd0521463e33f2f4c05507883af834bd6" }, "downloads": -1, "filename": "estimator-0.0.10.tar.gz", "has_sig": false, "md5_digest": "2cd6e15127ee705f01ccf2188c0b9b52", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6054, "upload_time": "2018-05-10T12:42:06", "url": "https://files.pythonhosted.org/packages/c3/d2/62b223dc958401a6a7245c09dfe3975118f12798c1238ab9542ccb2e0e13/estimator-0.0.10.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "b4a0228c63bb707f7d47ad05d99d0185", "sha256": "984c95512a473ec71f016cd6629fbe989dcdbb335851f36a2e7c6292372ea61b" }, "downloads": -1, "filename": "estimator-0.0.2.tar.gz", "has_sig": false, "md5_digest": "b4a0228c63bb707f7d47ad05d99d0185", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5242, "upload_time": "2018-04-18T18:04:09", "url": "https://files.pythonhosted.org/packages/ab/ad/8c32f38fe35036146b94cdff206c0df101f075372b80b7bd30e4419f01bb/estimator-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "a2d4a9c000ce3129dc16fc8a10bd60a5", "sha256": "0495c0764346913415ddcb070c4a1ed9d5b41332c327615114d181a782203dc9" }, "downloads": -1, "filename": "estimator-0.0.3.tar.gz", "has_sig": false, "md5_digest": "a2d4a9c000ce3129dc16fc8a10bd60a5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5258, "upload_time": "2018-04-30T17:33:10", "url": "https://files.pythonhosted.org/packages/db/b2/346c9950f59da8a52752ec34b317c8e4e26df13189006dcb8e40e8face20/estimator-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "d52c47adc4383c6762995730cbbd2824", "sha256": "b30850efd1295db95dfc9f60c4af947252473de64849c5f849b22969e0bb07dd" }, "downloads": -1, "filename": "estimator-0.0.4.tar.gz", "has_sig": false, "md5_digest": "d52c47adc4383c6762995730cbbd2824", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5265, "upload_time": "2018-05-07T08:25:58", "url": "https://files.pythonhosted.org/packages/a6/d6/d14246fd85a718bce79982b03017637367b85419f69d02e1b9f37232052b/estimator-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "d8421c7ddacc9182109c48ccb74f1df6", "sha256": "7a3d162c2176399bf4d1f7d598feedb797d43ea9c98a607ced5a8549a1a81991" }, "downloads": -1, "filename": "estimator-0.0.5.tar.gz", "has_sig": false, "md5_digest": "d8421c7ddacc9182109c48ccb74f1df6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5854, "upload_time": "2018-05-07T16:43:54", "url": "https://files.pythonhosted.org/packages/95/05/31af274c23544f257da0c7e26830682b821d63d21dc838c0e06f01708f4b/estimator-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "9cc9518f342f27ed5fe2882fdf03b94b", "sha256": "2822e5e3200694a313c486023a6adb1e043c65ebd60836157e9436bbdd77720a" }, "downloads": -1, "filename": "estimator-0.0.6.tar.gz", "has_sig": false, "md5_digest": "9cc9518f342f27ed5fe2882fdf03b94b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5875, "upload_time": "2018-05-08T16:25:57", "url": "https://files.pythonhosted.org/packages/64/f2/62cbf66cc6d485c6d89e47c42f8148e6fc1178d86e5b870491ca0f467448/estimator-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "6431c2d24a0813cbf3b898cf1ca71cc3", "sha256": "4a5a6f032e0cec93bfd1bb2fe4c3305327bf321c5b4fef88f85f4c7f7c588065" }, "downloads": -1, "filename": "estimator-0.0.7.tar.gz", "has_sig": false, "md5_digest": "6431c2d24a0813cbf3b898cf1ca71cc3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5888, "upload_time": "2018-05-08T18:34:11", "url": "https://files.pythonhosted.org/packages/84/9f/5c9456b1c10bd0a246533787ebdad15366228d5156effe93e25c6ead1934/estimator-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "5a395839cb9ad0530e1f7cd4080dfd7b", "sha256": "9115f2f23d50f537967e106b1e4d8f36ef3461cf516e095ff4fbb05d30afe9d7" }, "downloads": -1, "filename": "estimator-0.0.8.tar.gz", "has_sig": false, "md5_digest": "5a395839cb9ad0530e1f7cd4080dfd7b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5942, "upload_time": "2018-05-09T08:24:16", "url": "https://files.pythonhosted.org/packages/3e/1d/771d55afa33b046f7f4abd48b91eaf9d105939ca9741349f9d937ea37a36/estimator-0.0.8.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "aa437f4e1711cf4351da023187c6fea8", "sha256": "0a550cdf62d23eab40d0f331687d74658a193509a70b9246979b9f08255e8093" }, "downloads": -1, "filename": "estimator-0.0.9.tar.gz", "has_sig": false, "md5_digest": "aa437f4e1711cf4351da023187c6fea8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6016, "upload_time": "2018-05-10T07:24:26", "url": "https://files.pythonhosted.org/packages/f2/e3/7dea22d6cdae91acb1d82cacd1304259e9302307c162061e2eeffbf40a27/estimator-0.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2cd6e15127ee705f01ccf2188c0b9b52", "sha256": "aefd7d76940d283deefee1497f15487cd0521463e33f2f4c05507883af834bd6" }, "downloads": -1, "filename": "estimator-0.0.10.tar.gz", "has_sig": false, "md5_digest": "2cd6e15127ee705f01ccf2188c0b9b52", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6054, "upload_time": "2018-05-10T12:42:06", "url": "https://files.pythonhosted.org/packages/c3/d2/62b223dc958401a6a7245c09dfe3975118f12798c1238ab9542ccb2e0e13/estimator-0.0.10.tar.gz" } ] }