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.0.3.tar.gz
.
File metadata
- Download URL: npnn-0.0.3.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3aafcd2d5a5bbb2aeef1a5514eee5f15d7130546cd2138b303e84697ff7e1162 |
|
MD5 | 290f5116bfc75dbf0677d70a88879e3a |
|
BLAKE2b-256 | 350d40b38fc3ead7bb2c966e1efd97d0869929f8d22f5c99fd5dcaa20a0e350d |
File details
Details for the file npnn-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: npnn-0.0.3-py3-none-any.whl
- Upload date:
- Size: 10.4 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 | 6a9046e706aab3c245dc93cdc8c2e47ef2709e3ecf6b92fccea5d67304c36325 |
|
MD5 | 11e299389a772c8f87d467007f2c1526 |
|
BLAKE2b-256 | b92a0e0b733448e274fd3d11a90d97a9666604ba5fade77b9e7614d502d301d8 |