battelle.nn.NeuralNetwork

class battelle.nn.NeuralNetwork

Instance of a neural network.

layers

A list of every layer in the neural network

Type

List<Layer>

__init__()

Methods

__init__()

add_layer(layer)

Adds a layer to the neural network

backward(x, label[, learning_rate])

Updates weights for features x and label label using the backpropagation algorithm.

get_metrics(features, labels, binary_function)

Compute metrics for a binary classification using data from features and labels.

get_weighted_accuracy(features, labels)

Compute weighted accuracy for a multiclass classification using data from features and labels.

load_from_file(filename)

Load a network from file filename.

predict(x)

Makes a prediction for features x

predict_steps(x)

Makes a prediction for features x, while remembering the intermediate values of x in each layer

print_weights()

Prints the weights of all neurons of the neural net (used for debugging purposes)

save_to_file(filename)

Save current network to file filename.

train(x, y[, learning_rate])

Train the neural network with dataset of features x and of corresponding labels y.

Attributes

layers