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.3.tar.gz (5.4 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.3-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: phitodeep-0.1.3.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.3 CPython/3.12.3 Linux/6.17.0-1008-azure

File hashes

Hashes for phitodeep-0.1.3.tar.gz
Algorithm Hash digest
SHA256 6b6efff2f36ed4463026f4247ea3383d9feb72d908fcce960054413cccb9d531
MD5 8b191651ac10894c2577ee474c938466
BLAKE2b-256 0c1235d7576c38cc3d4bf3d91f340e9481e6a840bdadf6e2346278e233b63cbb

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for phitodeep-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 251e43bacb3daa3fee524c8211370c878178e8a947c5bfcb4a0e62b4103e2b5c
MD5 2a83d489c54ba6e3feff3c96bd5ea161
BLAKE2b-256 b2ec37488d55fa73b5c2a99dce17464b216d638a4dd8b61a9a57131f47abbb25

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