pycasx.tools.NNet.nnet

NNet runtime.

Module Contents

Classes

NNet

Class that represents a fully connected ReLU network from a .nnet file.

class pycasx.tools.NNet.nnet.NNet(filename)

Class that represents a fully connected ReLU network from a .nnet file.

Parameters:

filename (str) – A .nnet file to load

numLayers

Number of weight matrices or bias vectors in neural network

Type:

int

layerSizes

Size of input layer, hidden layers, and output layer

Type:

list of ints

inputSize

Size of input

Type:

int

outputSize

Size of output

Type:

int

mins

Minimum values of inputs

Type:

list of floats

maxes

Maximum values of inputs

Type:

list of floats

means

Means of inputs and mean of outputs

Type:

list of floats

ranges

Ranges of inputs and range of outputs

Type:

list of floats

weights

Weight matrices in network

Type:

list of numpy arrays

biases

Bias vectors in network

Type:

list of numpy arrays

evaluate_network(inputs)

Evaluate network using given inputs.

Parameters:

inputs (numpy array of floats) – Network inputs to be evaluated

Returns:

Network output

Return type:

(numpy array of floats)

evaluate_network_multiple(inputs)

Evaluate network using multiple sets of inputs.

Parameters:

inputs (numpy array of floats) – Array of network inputs to be evaluated.

Returns:

Network outputs for each set of inputs

Return type:

(numpy array of floats)

num_inputs()

Get network input size.

Return type:

int

num_outputs()

Get network output size.

Return type:

int