Skip to content

A python package to simulate various neural network models

License

Notifications You must be signed in to change notification settings

Mosbius/Neuronmodels

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

neuronmodels Package

A Python package containing implementations of various neural network components.

Installation

pip install neuronmodels==0.1b


or

pip install neuronmodels

Usage

Activation Functions

python
Copy code
import numpy as np
from neuronmodels import sigmoid, tanh, relu, leaky_relu, softmax, der_sigmoid

# Example usage
x = np.array([0.5, -0.2, 0.1])
result_sigmoid = sigmoid(x)
result_tanh = tanh(x)
result_relu = relu(x)
result_leaky_relu = leaky_relu(x)
result_softmax = softmax(x)
result_der_sigmoid = der_sigmoid(x)

MP Neuron Model

from neuronmodels import MPNeuron

# Example usage
weights = [0.2, -0.5, 1.0]
threshold = 0.5
mp_neuron = MPNeuron(weights, threshold)

inputs = [0.1, -0.3, 0.5]
output = mp_neuron.activate(inputs)
print("MPNeuron Output:", output)

backpropogation network

from neuronmodels import backpropogation

# Example usage
input_size = 3
hidden_size = 4
output_size = 2
nn = backpropogation(input_size, hidden_size, output_size)

inputs = np.array([[0.1, -0.2, 0.3]])
targets = np.array([[0.4, 0.7]])
learning_rate = 0.01

nn.train(inputs, targets, learning_rate)

Perceptron model

from neuronmodels import Perceptron

# Example usage
input_size = 3
learning_rate = 0.1
epochs = 100
perceptron = Perceptron(input_size, learning_rate, epochs)

training_inputs = np.array([[0.1, -0.2, 0.3], [0.4, 0.5, -0.6]])
labels = np.array([1, 0])

perceptron.train(training_inputs, labels)

About

A python package to simulate various neural network models

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages