A naive implementation of a neural network. The code structure is heavily inspired by PyTorch and TensorFlow. However, this package is used for educational purposes and is not intended to be adopted in production.
git clone https://github.com/reshalfahsi/neuralnetwork
cd neuralnetwork
pip install .
Here is a short example of the usage of neuralnetwork
components. For the complete demo, please take a look at examples/classification.py
and notebook/Classification.ipynb
for the classification problem. We also provide am example for regression problem: examples/regression.py
and notebook/Regression.ipynb
.
import neuralnetwork.nn as nn
import numpy as np
input = np.random.randn(1, 1, 200)
m = nn.Linear(200, 100)
out = m(input)
print(out.shape)
# (1, 1, 100)