Skip to main content

AutoNeuroNet is a fully implemented automatic differentiation engine with custom matrices, a full neural network architecture, and a training pipeline. It comes with Python bindings via PyBind11, enabling quick, easy network development in Python, backed by C++ for enhanced speed and performance.

Project description

AutoNeuroNet logo

AutoNeuroNet is a fully implemented automatic differentiation engine with custom matrices, a full neural network architecture, and a training pipeline. It comes with Python bindings via PyBind11, enabling quick, easy network development in Python, backed by C++ for enhanced speed and performance.

See AutoNeuroNet in action with a simple 3D visualization of gradient descent through reverse-mode automatic differentiation and backpropagation of gradients:

AutoNeuroNet Gradient Decsent 3D Visualization

Install AutoNeuroNet with PIP:

pip install autoneuronet

See the full documentation at https://rishabsa.github.io/AutoNeuroNet/

Quickstart

To get started with AutoNeuroNet, import the package. AutoNeuroNet allows you to make automatically differentiable variables and matrices easily through the Var and Matrix classes, which store values and gradients as doubles.

Scalar Automatic Differentiation

import autoneuronet as ann

x = ann.Var(2.0)
y = x**2 + x * 3.0 + 1.0

# Set the final gradient to 1.0 and perform Backpropagation
y.setGrad(1.0)
y.backward()

print(f"y: {y.val}") # 11.0 = (2)^2 + 3x + 1
print(f"dy/dx: {x.grad}") # 7.0 = 2x + 3

Matrix Initialization

import autoneuronet as ann

X = ann.Matrix(10, 1)  # shape: (10, 1)
y = ann.Matrix(10, 1)  # shape: (10, 1)

for i in range(n_samples):
    X[i, 0] = ann.Var(i)
    y[i, 0] = 5.0 * i + 3.0 # y = 5x + 3

Matrix Math

import autoneuronet as ann

X = ann.Matrix(2, 2)
X[0] = [1.0, 2.0]
X[1] = [3.0, 4.0]

Y = ann.Matrix(2, 2)
Y[0] = [5.0, 6.0]
Y[1] = [7.0, 8.0]

# Z = ann.matmul(X, Y)
Z = X @ Y
print(Z)

# Output:
# Matrix(2 x 2) =
# 19.000000 22.000000
# 43.000000 50.000000

NumPy to Matrix

import autoneuronet as ann
import numpy as np

x = np.array([[1.0, 2.0], [3.0, 4.0]])
X = ann.numpy_to_matrix(x)
print(X)

# Output:
# Matrix(2 x 2) =
# 1.000000 2.000000
# 3.000000 4.000000

Neural Networks, Loss Functions, and Optimizers

AutoNeuroNet supports several types of layers, including Linear fully-connected layers and activations functions such as ReLU, Sigmoid, or Softmax.

import autoneuronet as ann
import numpy as np

model = ann.NeuralNetwork(
    [
        ann.Linear(784, 256, init="kaiming"),
        ann.ReLU(),
        ann.Linear(256, 128, init="kaiming"),
        ann.ReLU(),
        ann.Linear(128, 10, init="kaiming"),
        ann.Softmax(),
    ]
)
optimizer = ann.SGDOptimizer(
    learning_rate=1e-2, model=model, momentum=0.9, weight_decay=1e-4
)

print(model)

AutoNeuroNet also supports several loss functions, such as the MSELoss, MAELoss, BCELoss, CrossEntropyLoss, and CrossEntropyLossWithLogits, and optimizers, such as GradientDescentOptimizer, SGDOptimizer, AdagradOptimizer, RMSPropOptimizer, AdamOptimizer, and AdamWOptimizer.

loss = ann.MSELoss(labels, logits)
loss.setGrad(1.0)
loss.backward()

optimizer.optimize()
optimizer.resetGrad()

print(f"Loss: {loss.getVal()}")

Reference Resources used in the development of AutoNeuroNet:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

autoneuronet-0.1.10-cp313-cp313-win_amd64.whl (184.9 kB view details)

Uploaded CPython 3.13Windows x86-64

autoneuronet-0.1.10-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (258.1 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

autoneuronet-0.1.10-cp313-cp313-macosx_11_0_arm64.whl (194.2 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

autoneuronet-0.1.10-cp313-cp313-macosx_10_13_x86_64.whl (212.7 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

autoneuronet-0.1.10-cp312-cp312-win_amd64.whl (185.0 kB view details)

Uploaded CPython 3.12Windows x86-64

autoneuronet-0.1.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (258.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

autoneuronet-0.1.10-cp312-cp312-macosx_11_0_arm64.whl (194.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

autoneuronet-0.1.10-cp312-cp312-macosx_10_9_x86_64.whl (213.0 kB view details)

Uploaded CPython 3.12macOS 10.9+ x86-64

autoneuronet-0.1.10-cp311-cp311-win_amd64.whl (185.2 kB view details)

Uploaded CPython 3.11Windows x86-64

autoneuronet-0.1.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (256.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

autoneuronet-0.1.10-cp311-cp311-macosx_11_0_arm64.whl (194.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

autoneuronet-0.1.10-cp311-cp311-macosx_10_9_x86_64.whl (208.0 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

autoneuronet-0.1.10-cp310-cp310-win_amd64.whl (184.3 kB view details)

Uploaded CPython 3.10Windows x86-64

autoneuronet-0.1.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (255.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

autoneuronet-0.1.10-cp310-cp310-macosx_11_0_arm64.whl (192.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

autoneuronet-0.1.10-cp310-cp310-macosx_10_9_x86_64.whl (206.6 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

autoneuronet-0.1.10-cp39-cp39-win_amd64.whl (201.6 kB view details)

Uploaded CPython 3.9Windows x86-64

autoneuronet-0.1.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (255.9 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

autoneuronet-0.1.10-cp39-cp39-macosx_11_0_arm64.whl (192.7 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

autoneuronet-0.1.10-cp39-cp39-macosx_10_9_x86_64.whl (206.7 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

File details

Details for the file autoneuronet-0.1.10-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for autoneuronet-0.1.10-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 e858bac0187cadc74f6dd084f85f3bef657eb5e257b1991f849d65ed0af4776a
MD5 854dae61be05d2d862dab3b3e0a621f5
BLAKE2b-256 78aceb5ed18ce8c07a358aab0b4b00b7a098481a2ad8a9de9ceed86d75f6ab1c

See more details on using hashes here.

File details

Details for the file autoneuronet-0.1.10-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for autoneuronet-0.1.10-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a4ac46d318d9eb0b0b27fa3035be492e74420dd864a5c1954c7ab201fd6b5950
MD5 74a501e384cc9640f99b040ddef766f1
BLAKE2b-256 2433614a23fc8717f6a63f58fbeb81feacd577800855b9795f61eb885a863534

See more details on using hashes here.

File details

Details for the file autoneuronet-0.1.10-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for autoneuronet-0.1.10-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2c305d51e01d227ab8bdfd7d82a10e60de87ff98ec60e9ba4c80fc8590717ea1
MD5 c377b5162bad231e1f8fd7ac57daf0b2
BLAKE2b-256 191299e9d7c11e95b3925315662ee7963bb40db949a3e7da19e9872150869a43

See more details on using hashes here.

File details

Details for the file autoneuronet-0.1.10-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for autoneuronet-0.1.10-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 c07e87f0f485c99ecfdc6b5c36960ef775ba2935f42fece3adef814f5f8c9e34
MD5 51290afe84a4aa763e85e0285ef4bbb5
BLAKE2b-256 6263fd011af73a8c9c46bb3e73962974651f36ecd57be79afe4a9f5a725e79f3

See more details on using hashes here.

File details

Details for the file autoneuronet-0.1.10-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for autoneuronet-0.1.10-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 420619f6b37320f476c38dd3e9754db732bd80d5f0cc498d5bef0476e50cc76f
MD5 46a9fd844249a62fa77050e95b412622
BLAKE2b-256 59111b70020f8fa28c7163724b0b4b00a9bd8c52a9dac297944de6e8efb4e6d4

See more details on using hashes here.

File details

Details for the file autoneuronet-0.1.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for autoneuronet-0.1.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a9c257ece1b8b88b9d4d571b9c8fb0b1ac1628b5cc5fbedb0fc88c1ed0402a00
MD5 891cb70f3160fc8a4b2df2817037de32
BLAKE2b-256 1fa45f96ae603fd3b9642807027029d40c68036a6758ee798b4c0e1dfff91f09

See more details on using hashes here.

File details

Details for the file autoneuronet-0.1.10-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for autoneuronet-0.1.10-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 03a0883dc85ff0700591de695acdcb37c9b5e243fdafac23a98fbe6859fd079d
MD5 9d46bf2ab737e59b70ae0d27db99e56c
BLAKE2b-256 df8e3cd3619f78fef393b91259b5318002bb089faa4f8ed06f968afa3e74cc0b

See more details on using hashes here.

File details

Details for the file autoneuronet-0.1.10-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for autoneuronet-0.1.10-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4cecaf1943a5b77cbac7e9048de23f393a14fdeed0fe026b25f050d1f635768b
MD5 2eead9510bac8d14f75d0d308af8223b
BLAKE2b-256 5f5ebd25734bd18735df390380a99a78a304d69d7cd29c4cfb504f5fb6fcbf66

See more details on using hashes here.

File details

Details for the file autoneuronet-0.1.10-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for autoneuronet-0.1.10-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 608f0d6b0a777453366af3bfe7d380f4ffa4191365e606391afdc849b5117065
MD5 b91b38fec524cf80b76fd44accc6f7bd
BLAKE2b-256 c464a3bcd64d73dbeee589e244f1840527a8257dac6271dd17a3b40d95c5bc9c

See more details on using hashes here.

File details

Details for the file autoneuronet-0.1.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for autoneuronet-0.1.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 90d294ac7202c68cbb992368d45aa84e30fa3c762abc19dda51ef221f3a52f8d
MD5 b9d38d4ef4c96c48392dfae6af9e0f29
BLAKE2b-256 17c14ed3739d1a8b886891cabee717387d41e8b8b1b826fbfe7a27bc142a18fd

See more details on using hashes here.

File details

Details for the file autoneuronet-0.1.10-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for autoneuronet-0.1.10-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a67333d3c3e20bbf897f2ed1dd6adf1bf15c83eb402380d7e3f7039f62c1e25c
MD5 55a0130930fd6011792f6cc0023aee9a
BLAKE2b-256 32a20c554681b1a5521ef4d87fc65b58faa78b049018b8180a0249ddfb12ef7f

See more details on using hashes here.

File details

Details for the file autoneuronet-0.1.10-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for autoneuronet-0.1.10-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 975804347999257935584a5037edae5dbb97b63768fc8aa05da523a5ca62235e
MD5 e535185a29e94ce9da75ee427b76904b
BLAKE2b-256 ccfcd27e7f0015217fefcefa0ecc02c18a4a192d3d28077e36291aadb8c11fd6

See more details on using hashes here.

File details

Details for the file autoneuronet-0.1.10-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for autoneuronet-0.1.10-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 10bbd7bfa6aeb9e7027d7e58a6c01b535bb50857acd970d0134b82ff55fcf57d
MD5 2d60d95b4edd958c8e2085106d91c931
BLAKE2b-256 9c085c7b87a4d463dfeec61fc42aa2d2dc6d72adf2e94887ba11ee8d372ec184

See more details on using hashes here.

File details

Details for the file autoneuronet-0.1.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for autoneuronet-0.1.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 80452b3745d462914469be5430aebfcc8cf9382a43acfe04a1f39cebe2375028
MD5 476deb0bb61204cc3b137366e01d7a3e
BLAKE2b-256 2e1f773f9ac380c67ae4644fda3466f84b8fc6e79f77563a9f267b639c615568

See more details on using hashes here.

File details

Details for the file autoneuronet-0.1.10-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for autoneuronet-0.1.10-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 28cf18dc1f220a1b49b11a01249aa4983ee5133a3353055d651232e984c7226d
MD5 258f7f93e2d3f537488a3670e0a004a4
BLAKE2b-256 a3df469e23b3ba861729270f0b26ca1e33f0c1ea8f90af989e8bcc93b452fa5f

See more details on using hashes here.

File details

Details for the file autoneuronet-0.1.10-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for autoneuronet-0.1.10-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a62f037081fc6edf21f9d4b71ee91f0695dfeab7e28dcb39dcf66160482780df
MD5 7287c542faf90c2a3aa835ee517b47cb
BLAKE2b-256 491d44db74f2cf8e5edad1eccd4dccec9b2a0825dcb14618d3f9c14fd598a695

See more details on using hashes here.

File details

Details for the file autoneuronet-0.1.10-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for autoneuronet-0.1.10-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 8a30a345b33d5a297cf336d4101a1c391b7df53926a4c5f371279941c9b3054a
MD5 30ff0de1428f54c766be0ddf8dd22864
BLAKE2b-256 f634c222e9693ccaf0d3e25bfc4754478073255ba73b070272ab2d531ac72b8b

See more details on using hashes here.

File details

Details for the file autoneuronet-0.1.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for autoneuronet-0.1.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 024519e244354349e5a1b1fafeb23a965ae2e6524886c872f840a04db4d1b5cb
MD5 e8674c681c7c7e3206282621401e6723
BLAKE2b-256 e42e71a8994fdf6a270502299ec1c55374756ab88ad0a165e4739679510cee41

See more details on using hashes here.

File details

Details for the file autoneuronet-0.1.10-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for autoneuronet-0.1.10-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0e21124fa001ebd1360fe1efcb93795b3eb9de1ee4df455233cf91d233a284e3
MD5 2f3b46e0bc081e80fb6328dfb2816273
BLAKE2b-256 dea3b90ac692f5515d8c63f84a84000561302c549fb9a598706ff296d65070bd

See more details on using hashes here.

File details

Details for the file autoneuronet-0.1.10-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for autoneuronet-0.1.10-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d955abf01d7d0b9c1ea6571b23e95c0f5bceece754e7bbe8b19850fc1e3c47dc
MD5 bedcc5943668f86c1127a1d9e8a68e40
BLAKE2b-256 9671cea7a51bfe7ebbd06b89e397b4ec35f174958ac0819353852c0e3dcb4d1b

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