hashtron.net.feedforward package

Submodules

hashtron.net.feedforward.feedforward_network module

class hashtron.net.feedforward.feedforward_network.FeedforwardNetwork(net)[source]

Bases: object

forward(in_val, l: int, worst: int, neg: int) -> (<class 'hashtron.net.input.Input'>, <class 'bool'>)[source]

Forward pass through the network.

Parameters:
  • in_val – The input to the layer.

  • l – The layer index.

  • worst – The index of the worst hashtron.

  • neg – Whether to negate the worst hashtron’s output.

Returns:

The intermediate output and a boolean indicating if the worst hashtron’s output was computed.

get_bits() int[source]
get_classes() int[source]
infer(in_val) int[source]

Infer the network output based on input.

Parameters:

in_val – The input to the network.

Returns:

The output of the network.

len_layers() int[source]

Get the number of layers in the network.

Returns:

The number of layers.

new_combiner(layer: Layer) None[source]
new_layer(n: int, bits: int, premodulo: int = 0) None[source]

hashtron.net.feedforward.io module

class hashtron.net.feedforward.io.FeedforwardNetworkIO(net)[source]

Bases: object

read_zlib_weights_from_file(file_name: str) bool[source]

hashtron.net.feedforward.net module

class hashtron.net.feedforward.net.Net[source]

Bases: object

static new()[source]
new_combiner(layer: Layer) None[source]
new_layer(n: int, bits: int, premodulo: int = 0) None[source]

hashtron.net.feedforward.test_net module

class hashtron.net.feedforward.test_net.TestNetConstruct(methodName='runTest')[source]

Bases: TestCase

test_construct()[source]
test_sqrt()[source]

Module contents