Skip to content

Neural-Net-Numpy(NNN) is a simple python package for training neural networks using only numpy components

Notifications You must be signed in to change notification settings

atkamara/deeplearning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neural-Net-Numpy(nnn)

nn

Check Documentation for more

Quick start

Step 0. Install neural-net-numpy

$ pip install -i https://test.pypi.org/simple/ neural-net-numpy

Step 1. Import modules from neural_net package

from neural_net.architecture import Sequential
from neural_net.layers import Fullyconnected,Activation
from neural_net.init_funcs import zeros,XavierHe
from neural_net.activation import σ,Softmax,LeakyReLU,Tanh,ELU,ReLU
from neural_net.cost import BinaryCrossEntropy,CrossEntropy
from neural_net.metrics import accuracy
from neural_net.pipeline import onehot,scaler,shuffle,Batch
from neural_net.utils import IrisDatasetDownloader

Step 2. Define Your Model

NNN = Sequential(
        [
        Fullyconnected(2,50,XavierHe("Uniform","ReLU").init_func),
        Activation(LeakyReLU),     
        Fullyconnected(50,1,XavierHe("Uniform","Sigmoid").init_func),
        Activation(σ)
        ],
    BinaryCrossEntropy
    )

Step 3. Import or create your training dataset

import numpy

n,k = 5000,2
X = numpy.random.uniform(-100,100,size=(n,k))
y =( (X[:, 0]**2 + X[:, 1]**2)/numpy.pi < 1000).reshape(-1,1)+0

Step 4. Train your model

NNN.train(scaler(X),y,metrics=accuracy)

Step 5. Make predictions

NNN.predict(X)

About

Neural-Net-Numpy(NNN) is a simple python package for training neural networks using only numpy components

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages