Skip to main content

Neural network library

Project description


Nait

Provides functions and classes for creating and

training neural networks.



  • Network

  • Network.train

  • Network.predict

  • Network.mutate

  • Layer

  • Layer.forward

  • Layer.mutate

  • Neuron

  • Neuron.parse

  • Neuron.mutate

  • Activation

  • Activation.calculate

  • evaluate

  • save

  • load


Network

class

Syntax

Network(layers)

Arguments

  • layers list

Network.train

method

Syntax

train(x=[], y=[], epochs=5000, rate=1, batch_size=10, sample_size=None, square_loss=True, visual=True, loss_function=None)

Arguments

  • x list

  • y list

  • epochs int

  • rate int / float

  • batch_size int

  • sample_size int

  • square_loss bool

  • visual bool

  • loss_function function


Network.predict

method

Syntax

predict(inputs)

Arguments

  • inputs list

Network.mutate

method

Syntax

mutate(rate)

Arguments

  • rate int / float

Layer

class

Syntax

Layer(inputs=4, neurons=4, activation="linear")

Arguments

  • inputs int

  • neurons int

  • activation "linear" / "step" / "relu" / "tanh" / "hardmax" / "sigmoid" / "softmax" / "leaky relu"


Layer.forward

method

Syntax

forward(inputs)

Arguments

  • inputs list

Layer.mutate

method

Syntax

mutate(rate)

Arguments

  • rate int / float

Neuron

class

Syntax

Neuron(weights, bias)

Arguments

  • weights list

  • bias int / float


Neuron.parse

method

Syntax

parse(inputs)

Arguments

  • inputs list

Neuron.mutate

method

Syntax

mutate(rate)

Arguments

  • rate int / float

Activation

class

Syntax

Activation(function)

Arguments

  • function "linear" / "step" / "relu" / "tanh" / "hardmax" / "sigmoid" / "softmax" / "leaky relu"

Activation.calculate

method

Syntax

calculate(x)

Arguments

  • x int / float

evaluate

function

Syntax

evaluate(network, x, y)

Arguments

  • network Network

  • x list

  • y list


save

function

Syntax

save(network, path)

Arguments

  • network Network

  • path str


load

function

Syntax

load(path)

Arguments

  • path str


Changelog - Nait 3.0.4


  • Complete rewrite


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

nait-3.0.4.tar.gz (5.1 kB view hashes)

Uploaded Source

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