DeepONet#
- class pinnx.nn.DeepONet(layer_sizes_branch, layer_sizes_trunk, activation, kernel_initializer=KaimingUniform(mode=fan_in, nonlinearity=relu, unit=1), num_outputs=1, multi_output_strategy=None, input_transform=None, output_transform=None)[source]#
Deep operator network.
- Parameters:
layer_sizes_branch (
Sequence[int]) – A list of integers as the width of a fully connected network, or (dim, f) where dim is the input dimension and f is a network function. The width of the last layer in the branch and trunk net should be the same for all strategies except “split_branch” and “split_trunk”.layer_sizes_trunk (
Sequence[int]) – A list of integers as the width of a fully connected network.activation (
Union[str,Callable,Dict[str,str],Dict[str,Callable]]) – If activation is astring, then the same activation is used in both trunk and branch nets. If activation is adict, then the trunk net uses the activation activation[“trunk”], and the branch net uses activation[“branch”].num_outputs (
int) – Number of outputs. In case of multiple outputs, i.e., num_outputs > 1, multi_output_strategy below should be set.multi_output_strategy (str or None) –
None, “independent”, “split_both”, “split_branch” or “split_trunk”. It makes sense to set in case of multiple outputs.None
Classical implementation of DeepONet with a single output. Cannot be used with num_outputs > 1.
independent
Use num_outputs independent DeepONets, and each DeepONet outputs only one function.
split_both
Split the outputs of both the branch net and the trunk net into num_outputs groups, and then the kth group outputs the kth solution.
split_branch
Split the branch net and share the trunk net. The width of the last layer in the branch net should be equal to the one in the trunk net multiplied by the number of outputs.
split_trunk
Split the trunk net and share the branch net. The width of the last layer in the trunk net should be equal to the one in the branch net multiplied by the number of outputs.