Deep Learning for Simple Folk. Built on Keras
Project description
Deep Learning for Simple Folk
Built in Python 3 on Keras 2.
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, Keras version 2.0.8 or greater, 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file conx-3.3.4.tar.gz
.
File metadata
- Download URL: conx-3.3.4.tar.gz
- Upload date:
- Size: 46.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3afc8a3578649a2f75338e7dce6746928734cd2ff1db98667276110218f6a79 |
|
MD5 | 5acfc2c194b8268684395cd49b6becb9 |
|
BLAKE2b-256 | 136442f0a5cf1ae5916eab5e954e0e1710f37e556ca0c5859c14448df323c0df |
File details
Details for the file conx-3.3.4-py2.py3-none-any.whl
.
File metadata
- Download URL: conx-3.3.4-py2.py3-none-any.whl
- Upload date:
- Size: 52.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3803d7fd873473f049119db73ce7f9f1497b51a270a726d9b2eb2aedaa9b8ac |
|
MD5 | 237749c132d5b2c88a30db23cbf2562b |
|
BLAKE2b-256 | 98e53ac24f337232e575274f9efbd9d33dfaa26731e5c25931efd56eef49a47b |