Skip to main content

easyDL - Where Deep learning is meant to be easy.

Project description

EasyDL

EasyDL - Where Deep learning is meant to be easy.

Installation

Run the following to install:

pip install py-easyDL

Usage

EasyDL uses the same methodology as Google's Tensorflow v2.x. Here are some imports from our package.

import easyDL
from easyDL.preprocessing.image import load_single_image,\
    load_images_from_directory, load_images_from_classes_directory
from easyDL.preprocessing.csv import load_csv
from easyDL.preprocessing.datasets import mnist, cifar10, cifar100
from easyDL.preprocessing.utils import shuffle, normalize
from easyDL.models import Model, load_model
from easyDL.activations import Tanh, Softmax, Sigmoid, ReLU, LeakyReLU, Step, Identity
from easyDL.layers import Dense, MaxPooling2D, Conv2D, Flatten, Dropout, BatchNorm
from easyDL.optimizers import GradientDescent, Adam, RMSProp, AdaGrad, MomentumGD, NesterovGD
from easyDL.visualization import plot_losses, plot_accuracy
from easyDL.losses import BinaryCrossEntropy, CategoricalCrossEntropy, \
    SparseCategoricalCrossEntropy, MeanSquaredError
from easyDL.evaluation import plot_evaluation_matrix, plot_confusion_matrix

This is an example using our package.

# Preprocessing
(X_train, Y_train), (X_test, Y_test) = mnist.load_data()
X_train = normalize(X_train[:4000])
Y_train = Y_train[:4000]

X_test = normalize(X_test[:1000])
Y_test = Y_test[:1000]

# Create a model
model = Model()

# Adding layers
model.add(Conv2D(6, kernel_size= (5, 5), input_shape= X_train.shape[1:]))
model.add(BatchNorm())
model.add(ReLU())
model.add(MaxPooling2D())

model.add(Conv2D(16, kernel_size= (5, 5)))
model.add(BatchNorm())
model.add(ReLU())
model.add(MaxPooling2D())

model.add(Flatten())

model.add(Dense(120))
model.add(BatchNorm())
model.add(ReLU())

model.add(Dense(84))
model.add(BatchNorm())
model.add(ReLU())

model.add(Dense(10))
model.add(Softmax())

# Compiling the model
model.compile(loss= 'sparse_categorical_crossentropy', optimizer= Adam(lr= 0.01))

# Training the model
model.fit(X_train, Y_train, validation_data= (X_test, Y_test),
            epochs= 10, batch_size= 64, verbose= True)

# Plotting losses and accuracies
plot_losses(model)
plot_accuracy(model)

# Predicting labels using the model
predictions = model.predict(X_test)

# Plotting confusion matrix
plot_confusion_matrix(Y_test, predictions)

# Printing evaluation matrix
plot_evaluation_matrix(Y_test, predictions)

# Save the model into a .pkl file
model.save('PATH/TO/FILE.pkl')

# Load a saved .pkl model
model = load_model('PATH/TO/FILE.pkl')

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

py_easyDL-0.0.9.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_easyDL-0.0.9-py3-none-any.whl (47.9 kB view details)

Uploaded Python 3

File details

Details for the file py_easyDL-0.0.9.tar.gz.

File metadata

  • Download URL: py_easyDL-0.0.9.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.5

File hashes

Hashes for py_easyDL-0.0.9.tar.gz
Algorithm Hash digest
SHA256 8bca049b99eedeb438fc467ab0851d1c5468dd08e649a38d5b2220aaf7681451
MD5 186bfbe26c8f9a6e3f04251a22e5dd3c
BLAKE2b-256 1a397c882478bc188dd63fc3cfb6bd38d1a1ee41fe2b033b0b931a0abb2b9597

See more details on using hashes here.

File details

Details for the file py_easyDL-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: py_easyDL-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 47.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.5

File hashes

Hashes for py_easyDL-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 125a5a53633f70f08d92b18d5df78811c473d22a11288a23fe511ab1ac32e877
MD5 de284807ae6161eb7187dccf8d36f3dc
BLAKE2b-256 182e49633c3972ef4b579c0f1a49780244bbea39527b14b27a833757cd525f8f

See more details on using hashes here.

Supported by

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