Skip to main content

A cross-platform library for easy-access AI tools

Project description

Ingine - a cross-platform AI toolbox


  • 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;



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])


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,
                             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 hashes)

Uploaded source

Built Distribution

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

Uploaded py3

Supported by

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