syna.models package

Submodules

Module contents

class syna.models.MLP(fc_output_sizes, activation=<function sigmoid>)[source]

Bases: Model

Simple multi-layer perceptron.

Args:

fc_output_sizes (iterable[int]): Sizes for successive Linear layers. activation (callable): Activation applied between layers (not after

the final layer). Defaults to F.sigmoid.

forward(x)[source]

Forward pass: apply activation after every layer except the last.

class syna.models.Model[source]

Bases: Layer

Base model class (also a Layer) with a convenience plot method.

The plot method runs forward on the provided inputs and writes a DOT graph of the computation to the given file.

plot(*inputs, to_file='model.png') None[source]

Run forward and save a DOT graph of the output computation.