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

Uploaded CPython 3.12Windows x86-64

ai_dan_core-0.1.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (303.7 kB view details)

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

ai_dan_core-0.1.1-cp312-cp312-macosx_13_0_x86_64.whl (172.1 kB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

ai_dan_core-0.1.1-cp312-cp312-macosx_13_0_arm64.whl (167.0 kB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

ai_dan_core-0.1.1-cp311-cp311-win_amd64.whl (309.6 kB view details)

Uploaded CPython 3.11Windows x86-64

ai_dan_core-0.1.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (304.1 kB view details)

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

ai_dan_core-0.1.1-cp311-cp311-macosx_13_0_x86_64.whl (172.4 kB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

ai_dan_core-0.1.1-cp311-cp311-macosx_13_0_arm64.whl (167.1 kB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

ai_dan_core-0.1.1-cp310-cp310-win_amd64.whl (308.5 kB view details)

Uploaded CPython 3.10Windows x86-64

ai_dan_core-0.1.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (303.3 kB view details)

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

ai_dan_core-0.1.1-cp310-cp310-macosx_13_0_x86_64.whl (171.0 kB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

ai_dan_core-0.1.1-cp310-cp310-macosx_13_0_arm64.whl (166.0 kB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

File details

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

File metadata

  • Download URL: ai_dan_core-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 5467a4dd351ce1e83762a9f47f47f3493cdd9034cfff4dcc0b1677f576c29d6a
MD5 a5b51b1fc20f8f407eea29e3e1c758da
BLAKE2b-256 99bec126adb40f9e02f8c2c46daa68379fcb7885cc828205d4c29cb3ff4df9a6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ai_dan_core-0.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ee35f9514fd6229984d8bfb4a1660e3ecc38b3b9ea0d65145e05cc0bf5ba1d62
MD5 eb801aa82f9f97b93c88b165404ad845
BLAKE2b-256 fa39a33a8626e8f625cc0cab5ec4b5e0589cca2325b847f8c3ad3a5b91aabb59

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ai_dan_core-0.1.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5d8dc3ee0ff20be22ffc25cac1c443cf59ade2e85ecccbd7deaa416887d9d8de
MD5 4d5197cd0da9270341fed3c9077bbd35
BLAKE2b-256 870e46570a252b465d8d960f0c978e274ec6894b88d0085f7ecbe6f3687a101f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ai_dan_core-0.1.1-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 66f799b8ac34e3b302d3d6c441eb83acf37457f295d5212a56d936499e9198b1
MD5 3c76c810e5266106d41cd2f9c3eb75e2
BLAKE2b-256 f24b68ddddfe36dd19abb85c66acb525eabc1ed0e9eb3af9ba70b21a25d56b61

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ai_dan_core-0.1.1-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 549a62662dffb6e3d97d9e05230107f6c9e038286268f26c53973f92c2133752
MD5 7814644f56c8de2bd808e3f1757801eb
BLAKE2b-256 b429d4fa9e46286a3cc4b01ecffd1bb7cfe6c0fdcb6296015bf6dfd7b865afd7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ai_dan_core-0.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fa19d6f42c0ba0ac22f23b68759c78355666c8c0044f54180ea197f13fc5a25f
MD5 bac99ac3c7c48b7b80ffd42fd222c99b
BLAKE2b-256 76c8370282823a708f921fc1b5c83a3588d5cb35aab6f5cf2486b13695933498

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ai_dan_core-0.1.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b2415a3506b5a436ac97c77f3de61dc04feca248dc30e257c1e6774058fbc2f5
MD5 c4620ba95df9346d20885a775ac2dcb0
BLAKE2b-256 a38c6fa9f14df1967b51b4cc396801e2f81833191dde8f0ae4d7fc317bdb8c82

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ai_dan_core-0.1.1-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 4287c3b1e65f9bf9a7106c5e24e8f5b8ddfe65b37ab508669e1239138a27e383
MD5 f248839c4c35eab2b0c57bf7466f9b3d
BLAKE2b-256 e892e6eb1ee4838b3839d5d6d37f81ab70d8cf9e30dc7a8328640a117ee60e02

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ai_dan_core-0.1.1-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 a835d296908c867c181baf34058f07123aea1002a3a4b1ca836907714755ea88
MD5 749e9a684c13288a7647e193c0d00857
BLAKE2b-256 265c92ffe32b06f8032c0ff0822f28a84531f6b6de04edd73f014d2a2941acb3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ai_dan_core-0.1.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4ca5ca2c3bbd7c8cff38ad7a6388bff15484659c26c973e4482cbfee4a390559
MD5 b981cb8a1e027cf1a856f49891f0ff77
BLAKE2b-256 7f928b1b134da9a69f56a49a202c9a7c772a22fcb56c00da9ac7ef7869c5214c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ai_dan_core-0.1.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f36437f842ada2fef153f56c3a34974e71a0d96104f12916990305fd53502026
MD5 57256af122ce0db3e16133e4a37195ac
BLAKE2b-256 69c5ca3c598c6eed3ede1bc0115532090346740d5f13a65d2ef380c60c635b55

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ai_dan_core-0.1.1-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 e8715c188f64768cb0bed049395468a94c5e8f7554221382a1403db2b1c993e2
MD5 1700adce72bbb50c916e602c52c26e7d
BLAKE2b-256 50dfd97a992302961a4fd3ebf0f4d263d9c7f84141bf8f823dbc01c5e4986ad2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for ai_dan_core-0.1.1-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 087de79cfbd4479a098451f7dbf26194389195dc4132bd955d3fd7517a37d02b
MD5 82108063884a9df37915673c4d6eeee7
BLAKE2b-256 f07fd55cfbedae5b594153464dbbe4d17c4a7440557a9682a4248d6d53cfe8c3

See more details on using hashes here.

Provenance

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