Skip to main content

Deep Learning for Simple Folk. Built on Keras

Project description

Deep Learning for Simple Folk

Built in Python 3 on Keras 2.

CircleCI codecov Documentation Status PyPI version

Read the documentation at conx.readthedocs.io

Ask questions on the mailing list: conx-users

Implements Deep Learning neural network algorithms using a simple interface with easy visualizations and useful analytical. Built on top of Keras, which can use either TensorFlow, Theano, or CNTK.

The network is specified to the constructor by providing sizes. For example, Network(“XOR”, 2, 5, 1) specifies a network named “XOR” with a 2-node input layer, 5-unit hidden layer, and a 1-unit output layer.

Example

Computing XOR via a target function:

from conx import Network, SGD

dataset = [[[0, 0], [0]],
           [[0, 1], [1]],
           [[1, 0], [1]],
           [[1, 1], [0]]]

net = Network("XOR", 2, 5, 1, activation="sigmoid")
net.set_dataset(dataset)
net.compile(error='mean_squared_error',
            optimizer=SGD(lr=0.3, momentum=0.9))
net.train(2000, report_rate=10, accuracy=1)
net.test()

Creates dynamic, rendered visualizations like this:

Install

conx requires Python3, and some other Python modules that are installed automatically with pip.

Note: you may need to use pip3, or admin privileges (eg, sudo), or a user environment.

pip install conx -U

You will need to decide whether to use Theano, TensorFlow, or CNTK. Pick one. See docs.microsoft.com for installing CNTK on Windows or Linux. All platforms can also install either of the others using pip:

pip install theano

or

pip install tensorflow

On MacOS, you may also need to render the SVG visualizations:

brew install cairo

Use with Jupyter Notebooks

To use the Network.dashboard() and camera functions, you will need to install and enable ipywidgets:

With pip:

pip install ipywidgets
jupyter nbextension enable --py widgetsnbextension

With conda

conda install -c conda-forge ipywidgets

Installing ipywidgets with conda will also enable the extension for you.

Changing Keras Backends

To use a Keras backend other than TensorFlow, edit (or create) ~/.keras/kerson.json, like:

{
    "backend": "theano",
    "image_data_format": "channels_last",
    "epsilon": 1e-07,
    "floatx": "float32"
}

Examples

See the notebooks folder and the documentation for additional examples.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

conx-3.2.4.tar.gz (43.1 kB view details)

Uploaded Source

Built Distribution

conx-3.2.4-py2.py3-none-any.whl (49.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file conx-3.2.4.tar.gz.

File metadata

  • Download URL: conx-3.2.4.tar.gz
  • Upload date:
  • Size: 43.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for conx-3.2.4.tar.gz
Algorithm Hash digest
SHA256 469ecfcc22f3a8947b7ad08bdf8844924ff6d04ee813046b14aa11ec6ec53714
MD5 e1af9cfa4e3eede419b1165e349bb0d8
BLAKE2b-256 0606e2c7c659d5e24654fa3e3303cd756e2e57f25f988ba88fb490ce6cc90197

See more details on using hashes here.

File details

Details for the file conx-3.2.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for conx-3.2.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 195c1a70fd19bf4c61d3a297d5eace7429f572d9053220d85b10df04870748ee
MD5 c650ba1c5917f29c290c5bf3b54320ba
BLAKE2b-256 e71359f3dfa7b11ff7f5150ea9d3f6ebd7bcfbe2147696bfa1552028e2d8d95c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page