Convolutional neural network implementation using NumPy. Just three layers are created which are convolution (conv for short), ReLU, and max pooling. The major steps involved are as follows:
-
Reading the input image.
-
Preparing filters.
-
Conv layer: Convolving each filter with the input image.
-
ReLU layer: Applying ReLU activation function on the feature maps (output of conv layer).
-
Max Pooling layer: Applying the pooling operation on the output of ReLU layer.
-
Stacking conv, ReLU, and max pooling layers
The project is tested using Python 3.5.2 installed inside Anaconda 4.2.0 (64-bit) NumPy version used is 1.14.0
The file named example.py is an example of using the project.
The code starts by reading an input image. That image can be either single or multi-dimensional image. In this examplel, an input gray is used and this is why it is required to ensure the image is already gray.
The filters of the first conv layer are prepared according to the input image dimensions. The filter is created by specifying the following:
-
Number of filters.
-
Size of first dimension.
-
Size of second dimension.
-
Size of third dimension and so on.
Because the previous image is just gray, then the filter will have just width and height and no depth. That is why it is created by specifying just three numbers (number of filters, width, and height).
The code can still work with RGb images. The only difference is using filters of similar shape to the image. If the image is RGB and not converted to gray, then the filter will be created by specifying 4 numbers (number of filters, width, height, and number of channels).
For more details, refer to the article describing this project which is titled "Building Convolutional Neural Network using NumPy from Scratch". It is available in these links:
LinkedIn: https://www.linkedin.com/pulse/building-convolutional-neural-network-using-numpy-from-ahmed-gad/
KDnuggets: https://www.kdnuggets.com/2018/04/building-convolutional-neural-network-numpy-scratch.html It is also translated into Chinese: http://m.aliyun.com/yunqi/articles/585741
Contact the author:
KDnuggets: https://www.kdnuggets.com/author/ahmed-gad LinkedIn: https://www.linkedin.com/in/ahmedfgad
Facebook: https://www.facebook.com/ahmed.f.gadd
Metadata
Release files for numpycnn 1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| numpycnn-1.7.tar.gz | 4.7 kB | Without provenance | Details for numpycnn-1.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| numpycnn-1.7-py3-none-any.whl | Python 3 | none | any | Details for numpycnn-1.7-py3-none-any.whl |
Total release size: 10.5 kB
Release files / numpycnn-1.7.tar.gz
| Download URL | numpycnn-1.7.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
deb93d90b8955756c0d51face066a51c9547ac8fb857b2d64675fe6ffa6291b8
|
|
BLAKE2b-256 checksum How to use checksums |
5aa79cd52d60331836bb9373a734b42f1f73c82cb374fd0ae40ef9d159387783
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / numpycnn-1.7-py3-none-any.whl
| Download URL | numpycnn-1.7-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7d0e90ad38ca6aad29b885eef903af4ab2dc81fa05abe4de51a5f94c1c83fc0c
|
|
BLAKE2b-256 checksum How to use checksums |
77fcbca648b339effddf3df4fc8f53b8725f516b31ed00ddbd6c67cf89cf2231
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for numpycnn 1.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.