cogent
Library Listed Dormant
Basic neural network library for classification.
- Downloads
- 0
- Dependents
- 0
- Stars
- 45
- Forks
- 2
- Contributors
- 1
- Commits
- 358
- Latest release
- 0.6.3 ·
About
A note
I'm real busy...
I have been developing some auto-differentiation stuff with rust-ad, when that has full support I plan to entirely rework Cogent to be more general purpose like PyTorch and also include all the functionality of simple_optimization to make a fully featured optimization library (you might consider ML a sub-category of optimization).
Introduction
Cogent is a very basic library for training basic neural networks for classification tasks. It is designed to be as simple as feasible. Hyperparameters in neural network training can be set automatically, so why not? Ideally you could simply do:
let net = NeuralNetwork::Train(&data);
This is the most basic and not quite there yet implementation of that idea.
Training a network to classify MNIST:
Read the full README
// Uses
use cogent::{
NeuralNetwork,
EvaluationData,MeasuredCondition
};
use ndarray::{Array2,Axis};
// Setup
// ----------
// 784-ReLU->800-Softmax->10
let mut net = NeuralNetwork::new(784,&[
Layer::Dense(800,Activation::ReLU),
Layer::Dense(10,Activation::Softmax)
]);
// Setting training and testing data.
// `get_mnist_dataset(bool)` simply gets MNIST dataset.
// The boolean specifies if it is the MNIST testing data (`true`) or training data (`false`).
// Sets training and testing data.
let (mut train_data,mut train_labels):(Array2<f32>,Array2<usize>) = get_mnist_dataset(false);
let (test_data,test_labels):(Array2<f32>,Array2<usize>) = get_mnist_dataset(true);
// Execution
// ----------
// Trains until no notable accuracy improvements are being made over a number of iterations.
// By default this would end training if 0.5% accuracy improvement was not seen over 12 iterations/epochs.
net.train(&mut train_data,&mut train_labels)
.evaluation_data(EvaluationData::Actual(&test_data,&test_labels)) // Sets evaluation data
.l2(0.1) // Implements L2 regularisation with a 0.1 lambda vlaue
.tracking() // Prints backpropgation progress within each iteration
.log_interval(MeasuredCondition::Iteration(1)) // Prints evaluation after each iteration
.go();
// If evaluation data is not set manually it will simply shuffle and split off a random group from training data to be evaluation data.
// In the case of MNIST where training and evaluation datasets are given seperately, it makes sense to set it as such.
// Evaluation
// ----------
let (cost,correctly_classified):(f32,u32) = net.evaluate(&test_data,&test_labels,None); // (cost,examples correctly classified)
println!("Cost: {:.2}",cost);
println!(
"Accuracy: {}/{} ({:.2}%)",
correctly_classified,
test_data.len_of(Axis(1)),
correctly_classified as f32 / test_data.len_of(Axis(1)) as f32
);
While a huge amount of my work has gone into making this and learning the basics of neural networks along the way, I am immensely (and I cannot stress this enough) amateur in inumerable ways.
If you find any issues I would really appreciate if you could let me know (and possibly suggest any solutions).
Features
- GPU compute using ArrayFire Rust Bindings
- Optimisers: Stochastic gradient descent.
- Layers: Dense, Dropout
- Activations: Softmax, Sigmoid, Tanh, ReLU.
- Loss functions: Mean sqaured error, Cross entropy.
- Misc: L2 regularisation
Installation
- Setup ArrayFire Rust bindings (Ignore step 4).
- Add
cogent = "^0.6"toCargo.toml.
TODO (See note)
- Convolutional layers.
- Meticulous testing (making sure things work).
- Optimise usage of VRAM.
- Meticulous benchmarking (making sure things are fast).
- Benchmarking against other popular neural network libraries (Keras etc.)
- Automatic net creation: Bayesian optimisation of everything.
Please note that things may not be developed inorder, it is only my estimation.
Compatibility
- Runs on
- GPU support unknown
What shows it
- no dependency or feature matches a backend row
- Native code
- None found
- No native code found
- Python bindings
- No Python binding crate found
- License
- Apache-2.0
Compare with similar projects
Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.
| Project | Downloads | Dependents | Stars | Latest release | Runs on (GPU) | Native code | License |
|---|---|---|---|---|---|---|---|
|
Basic neural network library for classification. |
0 downloads over 30 days | 0 | 45 | 0.6.3 | GPU support unknown | No native code found | Apache-2.0 |
|
mlx-rs Featured
Unofficial rust wrapper for Apple's mlx machine learning library. |
33,398 downloads over 30 days | 36 | 389 | 0.34.0 | Metal | Binds native code: mach-sys, mlx, mlx-sys. Build uses a native toolchain: bindgen, cc, cmake | Apache-2.0 OR MIT |
|
boostr Listed
ML framework on numr for training and inference on CPU, CUDA and WebGPU: attention, quantization, inference scheduling and distributed execution. Models include LLaMA, Mamba2, Qwen3.5, Whisper, Kokoro, VITS, VoxCPM2, Silero VAD, CLAP and super-resolution. Loads SafeTensors and GGUF. |
1,265 downloads over 30 days | 7 | 20 | 0.11.2 | CUDA, WebGPU | Binds native code: ring (feature distributed) | Apache-2.0 |
|
ruv-fann Listed
A pure Rust implementation of the Fast Artificial Neural Network (FANN) library Python bindings |
270 downloads over 30 days | 7 | 388 | 0.2.1 | CUDA, WebGPU | Binds native code: libsqlite3-sys, win-sys, torch-sys (feature neural-networks). Build uses a native toolchain: cc | Apache-2.0 OR MIT |
|
The neural network library implemented in Rust |
96 downloads over 30 days | 0 | 121 | 0.2.0 | GPU support unknown | No native code found | MIT |
|
rust-lstm Listed
A complete LSTM neural network library with training capabilities, multiple optimizers, and peephole variants. |
15 downloads over 30 days | 0 | 24 | 0.10.0 | GPU support unknown | No native code found | MIT |
|
Wrapper for the Fast Artificial Neural Networks library |
10 downloads over 30 days | 0 | 16 | 0.1.8 | GPU support unknown | Binds native code: fann-sys | LGPL-3.0 |
Why ListedNo archive, New or Featured rule places it, so it is Listed.
What it lacks for Featured
- It has 0 active dependents and 0 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days. The repository route reads 45 stars, 2 forks and 1 contributor. It needs 4,539 stars, 434 forks and 79 contributors together.
- The project is dormant and not finished. Dormancy rule
What else the check found
- The last activity is on 8 Jun 2022, 1615 days ago. That reaches the 365 days the rules expect, so the project is dormant. Dormancy rule
Not measured: Latest release fails cargo check.
Exact rules: Listed, Featured library. The check on applied thresholds version 9.
Every rule outcome, as the check records it
expected-interval: version 0.6.3 base 300, raised to the 365-day floor: E = 365 daysdormancy: last activity 2022-06-08, 1615 days ago, E = 365: dormantfeatured: not featured: active_users 0 < 11 and new_adopters 0 < 9 and repository route stars 45 (needs 4539), forks 2 (needs 434), contributors 1 (needs 79); dormant and not stablelisted: listed: no archive, new or featured rule applies
Measurements and sources
Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.
Sources6 sources
- Description: the crates.io description
- crates.io database dump, fetched
- RustSec advisory database, fetched
- GitHub repository, fetched
- crates.io package, fetched
- GitHub contributors, fetched
Adoption0 active dependents, 0 new dependents in 365 days1 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Active dependents | 0 | crates.io database dump | Yes | |
| New dependents (365 days) | 0 | crates.io database dump | Yes | |
| Peak active dependents | 0 | crates.io database dump | Yes | |
| Active dependents as a share of the peak | 1 | crates.io database dump | Yes | |
| Binary downloads per release | Not measured | Yes |
MaintenanceLatest human commit: 4 years ago3 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Latest human commit | 2022-06-08 | GitHub repository | Yes | |
| Latest release | 2021-03-03 | crates.io database dump | Yes | |
| First release | 2020-03-02 | crates.io database dump | Yes | |
| Latest version | 0.6.3 | crates.io database dump | Yes | |
| Days the oldest outside issue waits for a reply | 0 | GitHub repository | Yes | |
| Maintainer replies over 365 days | 0 | GitHub repository | Yes | |
| Repository archived | false | GitHub repository | Yes | |
| Repository gone | false | GitHub repository | Yes | |
| Release commit or manifest in the repo | true | crates.io package | Yes | |
| Published docs | true | crates.io database dump | Yes | |
| Latest release fails cargo check | Not measured | Yes | ||
| Build check date | Not measured | Yes | ||
| Build check toolchain | Not measured | Yes |
SecurityUnpatched vulnerabilities: none
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Unpatched vulnerabilities past the grace window | none | RustSec advisory database | Yes | |
| RustSec unmaintained advisory | none | RustSec advisory database | Yes | |
| Deprecation notice | none | crates.io database dump | Yes | |
| Deprecated requirement | none | crates.io database dump | Yes |
Distribution49 releases, 0 downloads over 30 days5 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Releases | 49 | crates.io database dump | Yes | |
| Downloads over 30 days | 0 | crates.io database dump | Yes | |
| Binary downloads over the last 3 releases | Not measured | Yes | ||
| Homebrew installs on request over 365 days | Not measured | Yes | ||
| Repology repository families | Not measured | Yes | ||
| Docker pull growth over 90 days | Not measured | Yes | ||
| Docker pulls at the growth baseline | Not measured | Yes | ||
| Every version a prerelease | false | crates.io database dump | Yes | |
| Every version 0.0.x | false | crates.io database dump | Yes | |
| Every version yanked | false | crates.io database dump | Yes | |
| Crate deleted from crates.io | false | crates.io database dump | Yes |
Repository45 stars, 2 forks, 1 contributors, 358 commits. Stars alone never qualify a project.
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| GitHub stars | 45 | GitHub repository | Yes — one part of the repository route | |
| GitHub forks | 2 | GitHub repository | Yes — one part of the repository route | |
| Contributors with a GitHub account | 1 | GitHub contributors | Yes — one part of the repository route | |
| Commits on the default branch | 358 | GitHub repository | No | |
| Repository's main crate left out of the entry | none | crates.io database dump | Yes |
Facts that never count
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| License | Apache-2.0 | crates.io database dump | No | |
| Runs on, from listed crates and their direct dependencies | GPU support unknown | crates.io database dump | No | |
| What shows each backend | no dependency or feature matches a backend row | crates.io database dump | No | |
| Native code, from listed crates and their dependencies | No native code found | crates.io database dump | No | |
| Python bindings, from direct dependencies of listed crates | No Python binding crate found | crates.io database dump | No | |
| Crates that depend on a listed crate directly | 0 | crates.io database dump | No |
Corrections and review history
No correction applies to this entry.
Judgments
A judgment enters only through an approved issue and a merged pull request.
No judgment applies to this entry.