https://github.com/morvanzhou/npnet
Build neural networks based only on Numpy
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (8.0%) to scientific vocabulary
Keywords
Repository
Build neural networks based only on Numpy
Basic Info
Statistics
- Stars: 168
- Watchers: 7
- Forks: 33
- Open Issues: 1
- Releases: 0
Topics
Metadata Files
README.md
Simple Neural Networks
This is a repo for building a simple Neural Net based only on Numpy.
The usage is similar to Pytorch. There are only limited codes involved to be functional. Unlike those popular but complex packages such as Tensorflow and Pytorch, you can dig into my source codes smoothly.
The main purpose of this repo is for you to understand the code rather than implementation. So please feel free to read the codes.
Simple usage
Build a network with a python class and train it.
```python import npnet
class Net(npnet.Module): def init(self): super().init() self.l1 = npnet.layers.Dense(nin=1, nout=10, activation=npnet.act.tanh) self.out = npnet.layers.Dense(10, 1)
def forward(self, x):
x = self.l1(x)
o = self.out(x)
return o
```
The training procedure starts by defining an optimizer and loss.
```python net = Net() opt = npnet.optim.Adam(net.params, lr=0.1) loss_fn = npnet.losses.MSE()
for _ in range(1000): o = net.forward(x) loss = loss_fn(o, y) net.backward(loss) opt.step() ```
Demo
- A naked and step-by-step network without using my module.
- Train regressor
- Train classifier
- Train CNN
- Save and restore a trained net
Install
pip install npnet
Download or fork
Download link
Fork this repo:
$ git clone https://github.com/MorvanZhou/npnet.git
Results

Owner
- Name: Morvan
- Login: MorvanZhou
- Kind: user
- Website: https://mofanpy.com
- Repositories: 39
- Profile: https://github.com/MorvanZhou
Deep Learning Research & Development at Tencent
GitHub Events
Total
- Watch event: 6
- Fork event: 1
Last Year
- Watch event: 6
- Fork event: 1
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Morvan Zhou | m****u@g****m | 20 |
| morvanzhou | m****u@t****m | 5 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 8 months ago
All Time
- Total issues: 1
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 1
- Total pull request authors: 0
- Average comments per issue: 1.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- anxingle (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 59 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 6
- Total maintainers: 1
pypi.org: npnet
neural net powered by numpy
- Homepage: https://github.com/MorvanZhou/npnet
- Documentation: https://npnet.readthedocs.io/
- License: MIT License
-
Latest release: 0.0.10
published about 3 years ago
Rankings
Maintainers (1)
Dependencies
- numpy >=1.22.3
- build * development
- flake8 ==3.9.2 development
- matplotlib ==3.5.0 development
- tox ==3.24.3 development
- twine * development