MultiFeedForward#

class MultiFeedForward(ffn_dict)[source]#

Bases: Module, ABC

Multi Feed Forward neural network model class.

This model allows to create a network with multiple Feed Forward neural networks combined together. The user is required to define the forward method to choose how to combine the networks.

Example:
>>> from pina.model import MultiFeedForward
>>> class MyModel(MultiFeedForward):
...     def forward(self, x):
...         return self.ffn1(x) + self.ffn2(x)
>>> model = MyModel({
...     "ffn1": {"input_dimensions": 2, "output_dimensions": 1},
...     "ffn2": {"input_dimensions": 2, "output_dimensions": 1},
... })

Initialization of the MultiFeedForward class.

Parameters:

ffn_dict (dict) – A dictionary containing the Feed Forward neural networks to be combined.

Raises:

TypeError – If the input is not a dictionary.

abstract forward(*args, **kwargs)[source]#

Forward pass for the MultiFeedForward model.

The user is required to define this method to choose how to combine the networks.