A small library of hand-rolled deep learning models
Project description
LensFlare
LensFlare is an example package I created to help myself and others better understand neural networks. A lot of the code is based off work that I did in the Coursera deeplearning.ai course
An example work flow is shown below:
import tensorflow as tf
from lensflare.classification import TfNNClassifier
from lensflare.util import load_moons_dataset
X_train, y_train = load_moons_dataset()
tf.reset_default_graph()
# layer_dims contains neural network structure parameters
layers_dims=[X_train.shape[0], 200, 80, 10, 1]
clf = TfNNClassifier(layers_dims=layers_dims,
optimizer="adam",
lambd=.05,
keep_prob=0.7,
num_epochs=5000)
clf.fit(X_train, y_train, seed=3)
y_pred_train = clf.transform(X_train, y_train)
Cost after epoch 0: 1.036825
Cost after epoch 1000: 0.108737
Cost after epoch 2000: 0.104837
Cost after epoch 3000: 0.106805
Cost after epoch 4000: 0.105311
INFO:tensorflow:Restoring parameters from results/model
Training Accuracy: 0.983333333333
from lensflare.funcs.tf_funcs import plot_decision_boundary, predict_dec
# Plot decision boundary
predictions, X, dropout_var, sess = predict_dec()
model = lambda X_train: sess.run([predictions], feed_dict={X:X_train, dropout_var: 1.0});
plot_decision_boundary(model, X_train, y_train)
sess.close()
INFO:tensorflow:Restoring parameters from results/model
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
LensFlare-0.0.1.tar.gz
(15.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
LensFlare-0.0.1-py3-none-any.whl
(22.3 kB
view details)
File details
Details for the file LensFlare-0.0.1.tar.gz.
File metadata
- Download URL: LensFlare-0.0.1.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6df7074f4d503546039e3c2f0420f0b9513d07095327c7a60ea0afee1d6cbfb
|
|
| MD5 |
411e2f7601dbfdfab74989c214247e9a
|
|
| BLAKE2b-256 |
9ee785d26131cac3ced0db6c9e3d9c313dc61c8f50968d0f6877860a508fc2ba
|
File details
Details for the file LensFlare-0.0.1-py3-none-any.whl.
File metadata
- Download URL: LensFlare-0.0.1-py3-none-any.whl
- Upload date:
- Size: 22.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63fc76436495fa08ba2ee9f937c1c1db5eb96f596e7c31bc099680233ccc2f9d
|
|
| MD5 |
d194c88a82a022b65d6be2959e1fe3c9
|
|
| BLAKE2b-256 |
b4ca88b0ef191222f1c71faac7bdedd3530f3716bb8437d8fce7ab8c99dbcf8d
|