https://github.com/morvanzhou/npnet

Build neural networks based only on Numpy

https://github.com/morvanzhou/npnet

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

backpropagation layer neural-network numpy simple
Last synced: 5 months ago · JSON representation

Repository

Build neural networks based only on Numpy

Basic Info
  • Host: GitHub
  • Owner: MorvanZhou
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 10.9 MB
Statistics
  • Stars: 168
  • Watchers: 7
  • Forks: 33
  • Open Issues: 1
  • Releases: 0
Topics
backpropagation layer neural-network numpy simple
Created over 7 years ago · Last pushed about 3 years ago
Metadata Files
Readme License

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

Install

pip install npnet

Download or fork

Download link

Fork this repo: $ git clone https://github.com/MorvanZhou/npnet.git

Results

img

Owner

  • Name: Morvan
  • Login: MorvanZhou
  • Kind: user

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

All Time
  • Total Commits: 25
  • Total Committers: 2
  • Avg Commits per committer: 12.5
  • Development Distribution Score (DDS): 0.2
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email 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

  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 59 Last month
Rankings
Stargazers count: 5.7%
Forks count: 7.1%
Dependent packages count: 10.1%
Average: 15.6%
Dependent repos count: 21.6%
Downloads: 33.4%
Maintainers (1)
Last synced: 7 months ago

Dependencies

requirements.txt pypi
  • numpy >=1.22.3
requirements_dev.txt pypi
  • build * development
  • flake8 ==3.9.2 development
  • matplotlib ==3.5.0 development
  • tox ==3.24.3 development
  • twine * development
pyproject.toml pypi