Skip to main content
Gradientzoo Python bindings
===========================

.. image:: https://readthedocs.org/projects/python-gradientzoo/badge/?version=latest
:target: http://python-gradientzoo.readthedocs.org/en/latest/?badge=latest
:alt: Documentation Status

This is a Python library for Gradientzoo's API - Version and share your trained
neural network models. Loading a pre-trained neural network is easy with
Gradientzoo. Here's how easy it is to load a model with Tensorflow (full
example below):

.. code:: python

import tensorflow as tf
from gradientzoo.tensorflow import TensorflowGradientzoo

# (build MNIST graph here)

with tf.Session() as sess:
# Load latest weights from Gradientzoo
TensorflowGradientzoo('ericflo/mnist').load(sess)

# Graph is now ready to use!


Saving models is similarly straightforward:

.. code:: python

import tensorflow as tf
from gradientzoo import TensorflowGradientzoo

# (build MNIST graph here)

with tf.Session() as sess:
for epoch in xrange(6):
# Train the model...

# Save the updated weights out to Gradientzoo
TensorflowGradientzoo('ericflo/mnist').save(sess)


Features
--------

Supports saving models in Keras_, variables in Tensorflow_, and networks in Lasagne_, and regular old files using Python with your framework of choice.


Installation
------------

You don't need this source code unless you want to modify the
package. If you just want to use the Gradientzoo Python bindings, you
should run:

pip install --upgrade gradientzoo

or

easy_install --upgrade gradientzoo

See http://www.pip-installer.org/en/latest/index.html for instructions
on installing pip. If you are on a system with easy_install but not
pip, you can use easy_install instead. If you're not using virtualenv,
you may have to prefix those commands with `sudo`. You can learn more
about virtualenv at http://www.virtualenv.org/

To install from source, run:

python setup.py install


Documentation
-------------

Please see http://python-gradientzoo.readthedocs.org/ for the most up-to-date
documentation or visit a project page to see project-specific instructions,
e.g. https://www.gradientzoo.com/ericflo/mnist

Setting up a Gradientzoo Account
--------------------------------

Sign up for Gradientzoo at https://www.gradientzoo.com/register

Contribute
----------

- Issue Tracker: https://github.com/gradientzoo/python-gradientzoo/issues
- Source Code: https://github.com/gradientzoo/python-gradientzoo

Support
-------

If you are having issues, please let us know at support@gradientzoo.com

Full Tensorflow Example
-----------------------

.. code:: python

import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data, mnist
from gradientzoo.tensorflow import TensorflowGradientzoo

learning_rate = 0.01
batch_size = 100

# Build MNIST graph
images_placeholder = tf.placeholder(tf.float32,
shape=(batch_size, mnist.IMAGE_PIXELS))
labels_placeholder = tf.placeholder(tf.int32, shape=(batch_size))
logits = mnist.inference(images_placeholder, 128, 32)
loss = mnist.loss(logits, labels_placeholder)
train_op = mnist.training(loss, learning_rate)
eval_correct = mnist.evaluation(logits, labels_placeholder)

# Start a Tensorflow session
with tf.Session() as sess:
# Load latest weights from Gradientzoo
TensorflowGradientzoo('ericflo/mnist').load(sess)

# Read in some data
data_sets = input_data.read_data_sets('data', False)

# Test the trained network on the dataset
true_count = 0
for step in xrange(data_sets.test.num_examples // batch_size):
images_feed, labels_feed = data_sets.test.next_batch(batch_size, False)

true_count += sess.run(eval_correct, feed_dict={
images_placeholder: images_feed,
labels_placeholder: labels_feed,
})

precision = true_count / float(data_sets.test.num_examples)
print('Num Examples: %d Num Correct: %d Precision: %0.04f' %
(data_sets.test.num_examples, true_count, precision))

.. _`gradientzoo.com/ericflo/mnist`: https://www.gradientzoo.com/ericflo/mnist
.. _`readthedocs.org`: http://python-gradientzoo.readthedocs.org/en/latest/
.. _Keras: http://keras.io/
.. _Tensorflow: https://www.tensorflow.org/
.. _Lasagne: http://lasagne.readthedocs.org/en/latest/

Metadata

Release files for gradientzoo 0.8.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gradientzoo 0.8.7
File Size Uploaded Provenance Actions
gradientzoo-0.8.7.tar.gz 7.4 kB Without provenance Details for gradientzoo-0.8.7.tar.gz

Release files / gradientzoo-0.8.7.tar.gz

Download URL gradientzoo-0.8.7.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
310df5de7c5d412af693c363c81e744d1ea375c4dc830b434a5e2f0c695e9818
BLAKE2b-256 checksum
How to use checksums
16c18712ba47951b2c36eaf4bbc2e2fb707ce6b4c36d307160944b8d927145ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for gradientzoo 0.8.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page