{ "info": { "author": "yufan", "author_email": "yufanzhou1993@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "some simple functions based on tensorflow\n\n#####################\nSimple Example here\n\n#####################\nimport tensorflow as tf\nfrom yfml.layers import *\nfrom yfml.train import *\nfrom yfml.utils import *\nfrom yfml.quick_build import *\nfrom tensorflow.examples.tutorials.mnist import input_data\n\n\nmnist = input_data.read_data_sets('MNIST_data', one_hot=True)\ntrain_data, train_label = mnist.train.next_batch(50000)\ntraining_data = Data(train_data, train_label)\nx = fl_holder([None, 784])\ny = fl_holder([None, 10])\nif_training = bool_holder()\nx_ = reshape(x, [-1, 28, 28, 1])\nfinal = mix_stack('stack', x_, types=['conv2d', 'maxpool2d', 'conv2d', 'maxpool2d', 'fc', 'fc'],\n shapes=[16, 2, 32, 2, 256, 10], use_batch_norm=False, if_training=if_training,\n activation_fn='relu', last_activation_fn='softmax')\nloss = loss_fn(final, y)\nopt = optimize(loss, 0.001, optimizer='adam', regularizer=['l2', 0.001])\naccuracy = compute_accuracy(final, y)\nsess = tf.Session()\nsess.run(tf.global_variables_initializer())\nfor i in range(1000):\n training_data.shuffle()\n iter = 50000//100\n avg_acc = 0.\n for j in range(iter):\n xs, ys = training_data.next_batch(100)\n acc, _ = sess.run([accuracy, opt], {x: xs, y: ys, if_training:True})\n avg_acc += acc/iter\n print('accuracy is : ', avg_acc)\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": "MIT License", "maintainer": "", "maintainer_email": "", "name": "yfml", "package_url": "https://pypi.org/project/yfml/", "platform": "all", "project_url": "https://pypi.org/project/yfml/", "project_urls": null, "release_url": "https://pypi.org/project/yfml/0.1.0/", "requires_dist": [ "tensorflow", "numpy", "scipy", "matplotlib", "bleach (>=3.1.0)" ], "requires_python": "", "summary": "based on tensorflow", "version": "0.1.0" }, "last_serial": 4744760, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "606a57262011edd5c2ab70f16b8cbd8f", "sha256": "d6c8435e6cbc27829f0607d110d0e91335a312f345d01b14d7fe49d07a8f2fae" }, "downloads": -1, "filename": "yfml-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "606a57262011edd5c2ab70f16b8cbd8f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7246, "upload_time": "2019-01-26T23:04:00", "url": "https://files.pythonhosted.org/packages/fa/33/128db148a74270948aebbf892d57c40d55f1410476b145f995f31c594c97/yfml-0.1.0-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "606a57262011edd5c2ab70f16b8cbd8f", "sha256": "d6c8435e6cbc27829f0607d110d0e91335a312f345d01b14d7fe49d07a8f2fae" }, "downloads": -1, "filename": "yfml-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "606a57262011edd5c2ab70f16b8cbd8f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 7246, "upload_time": "2019-01-26T23:04:00", "url": "https://files.pythonhosted.org/packages/fa/33/128db148a74270948aebbf892d57c40d55f1410476b145f995f31c594c97/yfml-0.1.0-py2.py3-none-any.whl" } ] }