NumPy Neural Network
Project description
npnn
NumPy Neural Network
What's npnn?
npnn
is a a torch-like Python module for gradient descent based machine learning implemented withnumpy
.
Dependency
Basically npnn
only depends on numpy
(the latest version 1.26.4 is verified).
If you have CUDA devices available, then you can easily get a acceleration by installing suitable version of cupy
. In this case npnn
will use cupy
api rather than numpy
api.
For example, my PC have CUDA v12.x (x86_64), so I use command:
pip install cupy-cuda12x
pip install npnn
or in short:
pip install npnn[cuda12x]
check cupy documentation for more information.
API references
See npnn WIKI.
Work with npnn!
Here we will construct a image classification neural network with npnn.
BTW, this is a course assignment of DATA620004, School of Data Science, Fudan University.
Task
Construct and Train a neural network on Fashion-MNIST to do image classification.
-
Implement gradient backpropagation algorithm by hand,you can use
numpy
but DO NOT usepytorch
ortensorflow
to do autograd. -
Submit source code including at least four parts:
model definition
,training
,parameters searching
andtesting
.
Implementation
dataset.py
: provide Fashion MNIST datasetmodel.py
: model definitiontrain.py
: model trainingsearch.py
: parameters searchingtest.py
: model testingviz.py
: visualizationutils.py
: some misc function, such assave_model
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
Built Distribution
File details
Details for the file npnn-0.1.0.tar.gz
.
File metadata
- Download URL: npnn-0.1.0.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0955acd3a64d520be065c68fab87617484cf03e78d669db619a3517f999d45bb |
|
MD5 | b227659feafbc6b0adb716fa8fd8a86a |
|
BLAKE2b-256 | 8b40f20e1c7d2cd74e3a87a2f860b6a89fe8e435b84c23da211233a90d3edca7 |
File details
Details for the file npnn-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: npnn-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a47ec36de0de61e6b53ddc40ed31dcf60ea52b0caacb01c6413df8a7c6af5c90 |
|
MD5 | 2e3d90c90c20f61506ed0cbfa4a99b8f |
|
BLAKE2b-256 | db693114e158c99a68b6fab1133bd05d44ab935634dc971b47b613cceb854f24 |