Models¶
Simple neural-network models used for small-scale experiments.
This module exposes four lightweight constructors — full(), conv(),
logit() and linear() — that can be registered automatically by the
experiments.Model loader because they are listed in __all__.
Each constructor returns a ready-to-use torch.nn.Module.
Example:¶
>>> from experiments import Model, Configuration
>>> config = Configuration(device="cpu")
>>> model = Model("simples-full", config)
>>> output = model.run(torch.randn(4, 1, 28, 28))
- experiments.models.simples.conv(*args, **kwargs)[source]¶
Build a small convolutional model for MNIST.
- experiments.models.simples.full(*args, **kwargs)[source]¶
Build a small fully-connected model for MNIST.
See also
For the model wrapper that loads these constructors, see Model.