numpynet
Convolutional Neural Network written from scratch using numpy with API similar to tensorflow. Library was compared with tensorflow versions of network (demo directory) and achieved very close results.
Implemented Elements
Layers
InputLayerDenseLayerBiasLayerActivationLayer (relu, leaky reLu, sigmoid, tanh, sin)DropoutLayerFlattenLayerConv2DLayer (with bias & stride)Pool2DLayer (max, min)Padding2DLayerCrop2DLayerSoftmaxLayer
Losses
MSECCE
Initializers
ConstantInitializerRandomNormalInitializerRandomUniformInitializerGlorotUniformInitialization
Metrics
CategoricalAccuracy
Callbacks
ModelCheckpointEarlyStopping
Usage Example
Definition
layers = [
numpynet.layers.InputLayer((28, 28, 1)),
numpynet.layers.Conv2DLayer(32, kernel_size=3, stride=1),
numpynet.layers.ActivationLayer('relu'),
numpynet.layers.FlattenLayer(),
numpynet.layers.DenseLayer(128),
numpynet.layers.BiasLayer(),
numpynet.layers.ActivationLayer('relu'),
numpynet.layers.DropoutLayer(0.5),
numpynet.layers.DenseLayer(10),
numpynet.layers.BiasLayer(),
numpynet.layers.SoftmaxLayer(),
]
model = numpynet.network.Sequential(layers)
Compilation
model.compile(
loss='cce',
metrics=['categorical_accuracy']
)
Fitting
checkpoint_callback = numpynet.callbacks.ModelCheckpoint('checkpoint.dat')
history = model.fit(
train_x,
train_y,
validation_data=(test_x, test_y),
learning_rate=0.001,
epochs=10,
callbacks=[checkpoint_callback],
)
Predicting
predictions = model.predict(test_x)
Metadata
Release files for numpynet 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| numpynet-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for numpynet-0.1.0-py3-none-any.whl |
Release files / numpynet-0.1.0-py3-none-any.whl
| Download URL | numpynet-0.1.0-py3-none-any.whl |
|---|---|
| Size | 19.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b30ea985b5efb1a113ccecc1640f3d7e105859ae70274ca46c9ff8957beb53a0
|
|
BLAKE2b-256 checksum How to use checksums |
cbacdf4552feb943c8508eeb2af1463e51e2cdc5703bf13463c10d3250bcc27c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.7
|
Security for numpynet 0.1.0
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.