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.4.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.4-cp312-cp312-win_amd64.whl (308.2 kB view details)

Uploaded CPython 3.12Windows x86-64

ai_dan_core-0.1.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (302.2 kB view details)

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

ai_dan_core-0.1.4-cp312-cp312-macosx_13_0_x86_64.whl (170.9 kB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

ai_dan_core-0.1.4-cp312-cp312-macosx_13_0_arm64.whl (165.5 kB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

ai_dan_core-0.1.4-cp311-cp311-win_amd64.whl (308.5 kB view details)

Uploaded CPython 3.11Windows x86-64

ai_dan_core-0.1.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (303.1 kB view details)

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

ai_dan_core-0.1.4-cp311-cp311-macosx_13_0_x86_64.whl (171.1 kB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

ai_dan_core-0.1.4-cp311-cp311-macosx_13_0_arm64.whl (165.6 kB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

ai_dan_core-0.1.4-cp310-cp310-win_amd64.whl (307.0 kB view details)

Uploaded CPython 3.10Windows x86-64

ai_dan_core-0.1.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (301.9 kB view details)

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

ai_dan_core-0.1.4-cp310-cp310-macosx_13_0_x86_64.whl (169.7 kB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

ai_dan_core-0.1.4-cp310-cp310-macosx_13_0_arm64.whl (164.3 kB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

File details

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

File metadata

  • Download URL: ai_dan_core-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 d60fb225a07d3f77c063e5450656c0b29110209e08194f1ab9ad1f43d31020a7
MD5 ebe200080b2dca50a7941fa0e44b8376
BLAKE2b-256 97b91bdf735158232ebb4e4d0745245c6e9da3720c86196fad70c73df6aaf6ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.4.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.4-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 99fe3264d078b30ff54eb3406949e542e412f897c6d9b14752f59dacf13b235c
MD5 575540d4ea5663b25046f0459e6b8255
BLAKE2b-256 fd58838b8d3fb0f488ffa31c7e3ab5ecdd6db641488439c68041726917005e21

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.4-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.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.4-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b3e662fe0ab71c671da5e1c7ee5e0ef64beb23727c99bbd114e379cbe8e9893c
MD5 0c97fb40d9d79b334a796afafd073686
BLAKE2b-256 a86a80a0729c917113b963b953e4a74f54c5cda638c0166545e12e6b4cf8b755

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.4-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.4-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.4-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 1acad22a45f36587e4a3426b38aece04f5a1d2fb75c267be1938ddba36f26d73
MD5 9992cdce5547e73e51bb6b9cb147675e
BLAKE2b-256 fd5f19e63cedfc7f2fec54f66938613cb7a43f76e906ac087ddd2569f8f07f4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.4-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.4-cp312-cp312-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.4-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 671fe15184f31feb4fa1655943830ac0c8314595cb472a55975c544a61e9f883
MD5 203553c8123e34b51f812929d67018c0
BLAKE2b-256 5e20d4fabd7747989cc29202fda7af262fb014637ea8b4d301f35d648215fe54

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.4-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.4-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ea857e70f71f68028a7b0f1f700d6411e8b06f85b83c7f1f53ad24a93e16301a
MD5 6239b2d051bfea31d8b87a7dc2feecec
BLAKE2b-256 77d183d93aace1982a95c638f316bd5a72dffaa68ddb59b0c6f6239fbec5b291

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.4-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.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 667bd47806da9ecdeded9fa8535c31754eab29464a1228175f148406ec26e8b7
MD5 ae39a0a5d324a5135185b16abc9c2e1b
BLAKE2b-256 b444092ae8df18e6dfe736d88cc10744926d8f1a7b76f509fd23584a2578a004

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.4-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.4-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.4-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 83ba29635f8f3b63309b1bba750924300eef94616b5f9a37f1121aaee640e45a
MD5 c934b82e5fba671476fe36b47b5df34e
BLAKE2b-256 b8aad54e87528fb5074cdf14019a543de82b724b066a64a3a628f47f6e36943b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.4-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.4-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.4-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 e82729aa863fc8b0c40d1b188c3e57e0c532ddcf176c9edce241a4efad36225d
MD5 eb730b3225b9f998d44d8135565d26ef
BLAKE2b-256 ea3f16c60459a2234c0938958e32f517ee2621f3422413ec92c3798f4f941bcc

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.4-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.4-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 f939c47cdc7f9d31604b207fc2170cc6d8ed53cfd96d728b16e740d4e18905b7
MD5 18ec410de71a25499fdb7e1fb43f12f4
BLAKE2b-256 7982099e28ba31c17262e549bcc9e16c082dca5e79f687061829c23eb22ade30

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.4-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.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f8668efa399e82a1a84678aac64e3311090b9f3190d2aa0d426f09a47e45b749
MD5 97c8a4c26fcc76b2ba863fac294a001f
BLAKE2b-256 8c72334d47d94d4ae5273c9f48895255a5252c46d8241d2b37ea759457da9476

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.4-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.4-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.4-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 f47c193af950b2989f14987278d9cdd99de21c89c4f61022ca1216d44db0d21c
MD5 e29e2d3d5857ba4ea9733f3254f3db15
BLAKE2b-256 89f0e6916aa0f43d0c1f33fd62f660096196cd7c84d891e9ada1d96554157059

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.4-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.4-cp310-cp310-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for ai_dan_core-0.1.4-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 d0284123909d93fe63bb6c14cbf61b7fa46d7336af66db08ff2d25d0674989a3
MD5 d2b0ccd8bc4aa2e90d200fefbf230620
BLAKE2b-256 8986ace4ab1ecc973f5bf42e586e5d396d76337b85396865db6bca719e9995e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_dan_core-0.1.4-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