Skip to main content

CPU-based neural network library written in C++

Project description

ai-dan-core

High-performance neural network library with C++ backend and Python bindings.

Features

  • Fast C++ backend with adaptive multi-threading
  • Simple Python API for easy integration
  • Built-in MNIST support for quick experimentation
  • Flexible architecture supporting multiple activation functions and loss functions
  • Model persistence - save and load trained models

Installation

pip install ai-dan-core

Quick Start

import ai_dan

# Create a neural network
network = ai_dan.Network([784, 256, 128, 10],
                         ai_dan.LEAKY_RELU,
                         ai_dan.SOFTMAX)

# Configure training
optimizer = ai_dan.Optimizer(learning_rate=0.001, batch_size=32)
loss = ai_dan.CrossEntropy()

# Train on MNIST
trainer = ai_dan.Trainer(network, optimizer, loss)
trainer.train(ai_dan.MNIST())

# Save the model
network.save("model.ai-dan")

# Load and benchmark
loaded = ai_dan.Network.load("model.ai-dan")
benchmarker = ai_dan.Benchmarker(loaded, ai_dan.MNISTBenchmark())
benchmarker.benchmark()

Activation Functions

  • ai_dan.SIGMOID
  • ai_dan.RELU
  • ai_dan.LEAKY_RELU
  • ai_dan.TANH
  • ai_dan.SOFTMAX

Loss Functions

  • ai_dan.MSE (Mean Squared Error)
  • ai_dan.CROSS_ENTROPY

Training with Callbacks

Monitor training progress with custom callbacks:

def on_step(step, loss_val, input_vec, label_vec, output_vec):
    if step % 1000 == 0:
        print(f"Step {step}, Loss: {loss_val:.4f}")

trainer = ai_dan.Trainer(network, optimizer, loss, on_step)
trainer.train(mnist_data)

Performance

  • Training on MNIST: ~20 seconds for 60,000 samples
  • Throughput: ~3,000 samples/second
  • Typical accuracy: 96%+ on MNIST test set

Requirements

  • Python 3.8+
  • C++23 compatible compiler (GCC 13+, Clang 16+)

License

MIT

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

ai_dan_core-0.1.3.tar.gz (16.4 MB view details)

Uploaded Source

Built Distributions

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

ai_dan_core-0.1.3-cp312-cp312-win_amd64.whl (307.0 kB view details)

Uploaded CPython 3.12Windows x86-64

ai_dan_core-0.1.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (301.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

ai_dan_core-0.1.3-cp312-cp312-macosx_13_0_x86_64.whl (169.5 kB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

ai_dan_core-0.1.3-cp312-cp312-macosx_13_0_arm64.whl (164.4 kB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

ai_dan_core-0.1.3-cp311-cp311-win_amd64.whl (307.2 kB view details)

Uploaded CPython 3.11Windows x86-64

ai_dan_core-0.1.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (301.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

ai_dan_core-0.1.3-cp311-cp311-macosx_13_0_x86_64.whl (169.9 kB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

ai_dan_core-0.1.3-cp311-cp311-macosx_13_0_arm64.whl (164.5 kB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

ai_dan_core-0.1.3-cp310-cp310-win_amd64.whl (306.1 kB view details)

Uploaded CPython 3.10Windows x86-64

ai_dan_core-0.1.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (300.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

ai_dan_core-0.1.3-cp310-cp310-macosx_13_0_x86_64.whl (168.4 kB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

ai_dan_core-0.1.3-cp310-cp310-macosx_13_0_arm64.whl (163.4 kB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

File details

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

File metadata

  • Download URL: ai_dan_core-0.1.3.tar.gz
  • Upload date:
  • Size: 16.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ai_dan_core-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7c2ffa39bb0ccfd72db359425d3a5beb1d580a2f1e1ca0522c4b73ced506ad83
MD5 a7e6e93f99fc7ef2a04daa73cc8922ef
BLAKE2b-256 afb22aabbeff36d7f9fcb1ae66de335999bac415ba91b46eeb473dab5840fbd0

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.3.tar.gz:

Publisher: build-and-publish.yml on A-Mackey/ai-dan-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_dan_core-0.1.3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5e1dd64e7901d99c729d5a021aa5ece98a3a7deb0c5245946235cc785a026639
MD5 b1b3a338a122a8f0107eb593e0bc5b61
BLAKE2b-256 9540212f01da87018046f936cd78cefa3e5d0f3b5136bf494896c2e224066f87

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.3-cp312-cp312-win_amd64.whl:

Publisher: build-and-publish.yml on A-Mackey/ai-dan-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_dan_core-0.1.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ea4b2d5fc28b8347e397589195985764d8863583c779f851251109234afb7182
MD5 d1d0e37da9fb9709529fad0b4f5ebb70
BLAKE2b-256 64cfa0778e0c623f6931b4d1ad5abeced5cfd9ca22477aa4fb2f2dd5cce66b81

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build-and-publish.yml on A-Mackey/ai-dan-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_dan_core-0.1.3-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.3-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 2e6e629a17009a19bd513d69c3c7a5a391a9b5697529a686388c618078c1129e
MD5 69eaaa55832498e63316e23b18c452f9
BLAKE2b-256 ff3b48e58e60f755b72cefbf6ea294eec518f21333aa8bbae4f3f78a383a8949

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.3-cp312-cp312-macosx_13_0_x86_64.whl:

Publisher: build-and-publish.yml on A-Mackey/ai-dan-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_dan_core-0.1.3-cp312-cp312-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.3-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 baf8b5098ec3bcc1bf90b494f392cb0a91e59388296882205b95cc0d5c27f6ce
MD5 e678f5ea6855f574eca37392d379b039
BLAKE2b-256 b6438f1c2114cb90abf8573f4100873b4858cdd61db104b4f4c2e2ef8d3ceb23

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.3-cp312-cp312-macosx_13_0_arm64.whl:

Publisher: build-and-publish.yml on A-Mackey/ai-dan-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_dan_core-0.1.3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 49bbf95ab9ff3bdefb655c3fb3ff2b788027531e27691707edcd2a6c8eb230fd
MD5 405250b2cda6a8dbb7869f9b8c768075
BLAKE2b-256 8a077fb8ce6fb64d30aa81ba5b1c6b94507cac7869357b7ee8891388fada82f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.3-cp311-cp311-win_amd64.whl:

Publisher: build-and-publish.yml on A-Mackey/ai-dan-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_dan_core-0.1.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3263c3dc6dfa92dd70542eeb24258e0a21803a5cfdcbdc813d9f0f74e08bcd64
MD5 5bcd4b824347a59fb24414cfcf9197a5
BLAKE2b-256 351abff4111b5dea2750c1ed91e88606a4e3c37855b5eaac0df14e63900d5b04

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build-and-publish.yml on A-Mackey/ai-dan-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_dan_core-0.1.3-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.3-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 8caff1aede0d90300800eea8b0d53708c22bbfa7be5f44804a66b116ff260cbd
MD5 8b71e801db45d05e94ecf2e0d9af51f8
BLAKE2b-256 62bbe82a65a1cffc25f25454607759e4383da1c02a20613565aafe97ef09a903

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.3-cp311-cp311-macosx_13_0_x86_64.whl:

Publisher: build-and-publish.yml on A-Mackey/ai-dan-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_dan_core-0.1.3-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.3-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 94b0b2eb655cb97e951ec68a36937abf21618c0b76a252616e1091cfa261e777
MD5 065cb86b70b411e03eb05255bd44dafc
BLAKE2b-256 a49a88b38821569fef3f82d189e943dd5434e6e657c8f55d62eb5b8446bb6b08

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.3-cp311-cp311-macosx_13_0_arm64.whl:

Publisher: build-and-publish.yml on A-Mackey/ai-dan-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_dan_core-0.1.3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 416fb5205251f13897b64d8063861ecc2c4e166c6589340a75c81e3300ae9636
MD5 605b8fa1d64c840d01b9975a591c2f4e
BLAKE2b-256 887f05737ab9f56a8fd8ad0bed16aa8ae1fef302910f657e0dfe914b0f596844

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.3-cp310-cp310-win_amd64.whl:

Publisher: build-and-publish.yml on A-Mackey/ai-dan-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_dan_core-0.1.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7314f31ccfde2191f80363aca2a855c50789404c8b42509ec4b7893f92e454f8
MD5 af5eaad932820805f468c5b0484f5c60
BLAKE2b-256 086d4bcb33f5a2a5e8abe91e1f2b2dd74ac5efbc7717cfcb77e5c5cecd3ebbdb

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build-and-publish.yml on A-Mackey/ai-dan-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_dan_core-0.1.3-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.3-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 edcb87a7e715a6c0072a807341a418c4e7131e2cfadd3aebef64b22dcccd0f35
MD5 a71c8c863c3cdd673572437dfd13882c
BLAKE2b-256 af805212d2a8c1be5403412b7b5b33454f866dacc07e5e80684ccc3e3ceaab54

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.3-cp310-cp310-macosx_13_0_x86_64.whl:

Publisher: build-and-publish.yml on A-Mackey/ai-dan-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_dan_core-0.1.3-cp310-cp310-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.3-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 abf4461ffe90b22f15f538ea889ffb9a3e1a8121234a001e57b850c86be5bd3b
MD5 6519d7c25edca03ea5ac5a57f6a29004
BLAKE2b-256 1976b7da3c6153bdc27dd3ef6b4ec2f45861b09ff942f8cd83568f8b96505a45

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.3-cp310-cp310-macosx_13_0_arm64.whl:

Publisher: build-and-publish.yml on A-Mackey/ai-dan-core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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