Code Monkey home page Code Monkey logo

kata-ialib's Introduction

kata-ialib: Artificial intelligence library

This library contains the implementation of artificial intelligence modules of different types and classes. Besides, the project includes visualization, preprocessing utilities, and script examples that tests the functionality of the artificial intelligence components.

Examples of Usage

Perceptron Example

from nnetwork.neurons.perceptron import PerceptronGD
from visualizer import ErrorPlotter, NeuronPlotter, NeuronAnimation
from sklearn import datasets

iris = datasets.load_iris()
x = iris.data[:, :2]
y = iris.target
x, y = x[y != 2], y[y != 2]
    
model = PerceptronGD(lr=0.01, n_epochs=50)
history = model.fit(x, y)

ErrorPlotter().init(errors=history['errors']).show()
NeuronPlotter().init(x=x, y=y, model=model).show()
NeuronAnimation().init(x=x, y=y, model=model).show()

Adaline Example

from nnetwork.neurons.adaline import AdalineGD
from visualizer import ErrorPlotter, NeuronPlotter, NeuronAnimation
from sklearn import datasets
import preprocessing
import numpy as np

iris = datasets.load_iris()
x, y = iris['data'], iris['target']

x = preprocessing.normalize_data(x[50:150, :2])
y = np.where(y[50:150] == 2, -1, y[50:150])
    
model = AdalineGD(lr=0.01, n_epochs=50)
history = model.fit(x, y)

ErrorPlotter().init(errors=history['errors']).show()
NeuronPlotter().init(x=x, y=y, model=model).show()
NeuronAnimation().init(x=x, y=y, model=model).show()

Growing Neural Gas Example

from nnetwork.growing_neural_gas.growing_neural_gas import GrowingNeuralGas
from visualizer import ErrorPlotter, GrowingNeuralGasPlotter, GrowingNeuralGasAnimation
from sklearn import datasets
import tensorflow as tf

iris = datasets.load_iris()
iris = iris.data[:, :]
data = tf.Variable(iris, dtype=tf.float32)

model = GrowingNeuralGas(a_max=4, max_number_units=100, max_clusters=4)
history = model.fit(data)

ErrorPlotter().init(errors=history['errors']).show()
GrowingNeuralGasPlotter().init(history=history).show()
GrowingNeuralGasAnimation().init(history=history).show()

kata-ialib's People

Contributors

losedavidpb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.