Sequential
info
NeuralPy Sequential Model Class is mostly stable and can be used for any project. In the future, any chance of breaking changes is very low.
Sequential is a linear stack of layers with single input and output layer. It is one of the simplest types of models. In Sequential models, each layer has a single input and output tensor.
The Sequential model works on top of Model class, so all the methods that are available on the Model is also available here in Sequential class
Supported Arguments
force_cpu=False
: (Boolean) If True, then uses CPU even if CUDA is availabletraining_device=None
: (NeuralPy device class) Device that will be used for training predictionsrandom_state
: (Integer) Random state for the device
Supported Methods
.add()
method:
In a Sequential model, the .add()
method is responsible for adding a new layer to the model. It accepts a NeuralPy layer class as an argument and builds a model, and based on that. The .add() method can be called as many times as needed. There is no limitation on that, assuming you have enough computation power to handle it.
Supported Arguments
layer
: (NeuralPy layer classes) Adds a layer into the model
Example Codes
.build()
method:
In a Sequential model, the .build()
method is responsible for building the PyTorch model from the NeuralPy model.
After finishing the architecture of the model, the model needed to be built before training.
Supported Arguments:
- There is no argument for this model