This repository contains the python implementation for a few soft computing algorithms.
Implemented algorithms:
- Hebb Net
- Single layer perceptron
- Multi layer perceptron (single hidden layer)
Clone the repository using:
git clone https://github.com/ksaswin/Soft-Computing-Algorithms.gitMove into the cloned repository:
cd Soft-ComputingInstall the required dependencies:
pip install -r requirements.txtImport the packages from different modules using:
from hebbnet.hebb_net import HebbNet
from single_layer_perceptron.slp import SingleLayerPerceptronCreate the model for each algorithm using:
input_list = [[1, 1], [1, -1], [-1, 1], [-1, -1]]
targets = [1, -1, -1, -1]
hebb_model = HebbNet()
slp_model = SingleLayerPerceptron()
hebb_model.train_model(input_list, targets)
slp_model.train_model(input_list, targets, alpha=1, max_epochs=3)The example above creates the models for a two input AND gate.