Skip to main content

A cross-platform library for easy-access AI tools

Project description

Ingine - a cross-platform AI toolbox

Features

  • Artifical Neural Networks with:
    • Classifier builder;
    • Regressor builder;
    • Custom layer builder;
    • Custom keras access.
  • Evolutional algorithms;

Ready examples

  • 8 queens puzzle;
  • Seabatlle ANN;
  • Handwritten digit recognition ANN;
  • Boston Housing;
  • Salesman issue resolving;

HOW TO?

Classify:

from ingine import ann

"""getting dataset"""
(X_train, Y_train), (X_test, Y_test) = get_dataset()

categorizer = ann.get_categorizer(X_train, y_train, num_cat = 10)

"""check out how it works!"""
print(categorizer(X_train[0]), Y_train[0])

Regression:

from ingine import ann

"""getting dataset"""
(X_train, Y_train), (X_test, Y_test)**** = get_dataset()

regression = ann.get_regression(X_train, y_train)

"""check out how it works!"""
print(regression(X_train[0]), Y_train[0])

Custom layer configuration:

from ingine import ann
from keras.layers import Dense

"""getting dataset"""
(X_train, Y_train), (X_test, Y_test) = get_dataset()

# defining layers
layers = [Dense(100, input_dim = 100, activation = "softsign", kernel_initializer = "normal"),
          Dense(20, activation = "softsign", kernel_initializer = "normal"),
          Dense(10, activation = "softsign", kernel_initializer = "normal"),
          Dense(100, activation = "softsign", kernel_initializer = "normal")]

customnn = ann.get_customnn(X_train, Y_train, layers = layers)

"""check out how it works!"""
print(customnn(X_train[0]), Y_train[0])

Evolutional optimizer:

from ingine import ga
import random as rnd

"""define an example creature"""
data = [1, 2, 3, 4]

"""define a representation function of creature"""
def create_individual(data):
    return data[:]

"""define a crossover function"""
def crossover(creature1, creature2):
    r1 = [rnd.randint(1, 10) for _ in range(4)]
    r2 = [rnd.randint(1, 10) for _ in range(4)]
    return r1, r2

"""define an mutation function"""
def mutate(creature):
    a = rnd.randint(0, len(creature)-1)
    b = rnd.randint(0, len(creature)-1)
    creature[a], creature[b] = creature[a] + 1, creature[b] + 1

"""define a selection function"""
def selection(population):
    return rnd.choice(population)

"""define a fitness function"""
def fitness(creature, data):
    return abs(sum(creature) - 100)

"""getting an optimizer"""
optimiser = ga.get_optimizer(data,
                             fitness,
                             maximise_fitness = False,
                             create_individual = create_individual,
                             mutate = mutate,
                             crossover = crossover)

"""check out how it works!"""
res = optimiser()[1]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ingine-0.1.7.tar.gz (323.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ingine-0.1.7-py3-none-any.whl (717.5 kB view details)

Uploaded Python 3

File details

Details for the file ingine-0.1.7.tar.gz.

File metadata

  • Download URL: ingine-0.1.7.tar.gz
  • Upload date:
  • Size: 323.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.5

File hashes

Hashes for ingine-0.1.7.tar.gz
Algorithm Hash digest
SHA256 d3a1155d6af317f4b2562aeb14cf7aecf2158e63fb04489625adb5fe08a866ca
MD5 93ef260e6a3a36bdbcf23fb5e654253e
BLAKE2b-256 3e317ddd7bbed43cd7aae2c1bd64866ddf9c4a050bbb926a98024741c6382ae7

See more details on using hashes here.

File details

Details for the file ingine-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: ingine-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 717.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.5

File hashes

Hashes for ingine-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 cc7077130b5753e76b4820b54a39ce2d5ca3a50a33353f84249c27debad094bf
MD5 88c4916f031886d6d5118bffad3def8e
BLAKE2b-256 c05e52254b395791ec59d1af00bca1a4ec876a7c9ccefb73f85a62fd99b95f2a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page