neural-network
is a library that allows you to create and train a neural network of a given configuration.
create_network(layers_size)
layers_size
- list of the number of neurons on each layer (starting from the input layer)
train(weights, test_datasets, iterations, learning_rate)
weights
- network weightstest_datasets
- list of typles of input datasets and expected datasetsiterations
- number of interationslearning_rate
- (0, 1) neural network learning speed / accuracy
predict(weights, input_datasets, reliable_limit)
weights
- network weightsinput_datasets
- list of input datasetsreliable_limit
- (0, 0.5) limit of unknown results
Example:
train_datasets = [
([0, 0, 1], [1]),
([0, 1, 1], [0]),
([1, 0, 1], [1]),
([1, 1, 1], [1]),
([0, 0, 0], [0])
]
weights = create_weights([3, 2, 1])
train(weights, train_datasets, 6000, 0.05)
assert predict(weights, [0, 1, 0], 0.35) == [0]
- See github for full contributors list