Skip to main content

Deep learning framework built from scratch with numpy!

Project description

phitodeep

Deep learning framework built from scratch with numpy!

Installation

$ pip install phitodeep

Usage

MNIST quickstart:

import numpy as np
from datasets import load_dataset

import phitodeep.loss as loss
import phitodeep.model as m

train_dataset = load_dataset("ylecun/mnist", split="train")
test_dataset = load_dataset("ylecun/mnist", split="test")

X_train = train_dataset["image"]
y_train = train_dataset["label"]
X_test = test_dataset["image"]
y_test = test_dataset["label"]

X_train = np.array(X_train).astype(np.float32) / 255.0
y_train = np.array(y_train)
X_test = np.array(X_test).astype(np.float32) / 255.0
y_test = np.array(y_test)
print(X_train.shape, y_train.shape)

model = (
    m.SequentialBuilder()
    .flatten()
    .dense(784, 128)
    .relu()
    .dense(128, 10)
    .softmax()
    .optimizer("adam")
    .loss(loss.CategoricalCrossEntropy())
    .alpha(0.001)
    .epochs(300)
    .batch(32)
    .build()
)

model.summary()

model.train(X_train, y_train, X_test, y_test)

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

phitodeep was created by Ralph Dugue. It is licensed under the terms of the Apache License 2.0 license.

Credits

phitodeep was created with cookiecutter and the py-pkgs-cookiecutter template.

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

phitodeep-0.1.4.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

phitodeep-0.1.4-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file phitodeep-0.1.4.tar.gz.

File metadata

  • Download URL: phitodeep-0.1.4.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.4 CPython/3.12.3 Linux/6.17.0-1010-azure

File hashes

Hashes for phitodeep-0.1.4.tar.gz
Algorithm Hash digest
SHA256 864e758c5c847b3a18e34d3644bd23764a1f709510268b3dddeb0f2e24ae1df2
MD5 977bb1a1870e136ae6b9470430144d26
BLAKE2b-256 b8f485a4b362eac96990d34d9b752ff3597ee6e09c171b8f789db2c7324766b9

See more details on using hashes here.

File details

Details for the file phitodeep-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: phitodeep-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.4 CPython/3.12.3 Linux/6.17.0-1010-azure

File hashes

Hashes for phitodeep-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 954a96b9c5b6f7d86740652b5a4497c94e6b2d9d9495c44ec6a34557efd1d05a
MD5 513e0efdd7e0cf17e1096b06f5e5e4b8
BLAKE2b-256 436a1f4b9dbe5cf4f53bb386d0c9cb53fd88607e4c6cc10b9dc8580b37f9f8a8

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