pihnn.nn.DD_PIHKAN#

class pihnn.nn.DD_PIHKAN(PDE, units, degree, boundary, material={'lambda': 1, 'mu': 1}, has_bias=True, rhs_solution=None)#

Bases: DD_PIHNN

Physics-informed holomorphic Kolmogorov-Arnold networks (PIHKANs) with domain decomposition.

The class is equivalent to pihnn.nn.DD_PIHNN except that the stacked networks are PIHKANs.

Parameters:
  • PDE (str) – Problem to solve, either ‘laplace’, ‘biharmonic’, ‘km’ or ‘km-so’.

  • units (list of int) – List containing number of units at each layer, e.g., [1,10,10,1].

  • degree (int) – KAN polynomial degree \(D\).

  • boundary (pihnn.geometries.boundary) – Geometry of the domain. Needed for information regarding DD partition.

  • activation (callable) – Activation function, by default the complex exponential.

  • has_bias (bool) – Whether to include the bias vector.

  • rhs_solution (callable) – Particular solution to the non-homogeneous problem. E.g., \(x^2+y^2\) for \(\nabla^2u=4\).

forward(z, flat_output=True, real_output=False)#

Forward step, i.e., compute:

\[\mathcal{L}_{L,t,d} \circ \mathcal{L}_{L-1,t,d} \circ \dots \circ \mathcal{L}_{1,t,d} (z)\]

where \(\mathcal{L}_{l,t,d}\) is the \(l\)-th PIHKANLayer for the \(t\)-th complex potential and \(d\)-th domain.

Parameters:
  • z (torch.tensor) – Input of the network, typically a batch of coordinates from the domain boundary.

  • flat_output (bool) – If True, the output of the network is a 1D/flat vector. Otherwise, the output is a 2D tensor where the first dimension is the number of domains and the second dimension is the number of points per domain. The second option is necessary for the training of the network while one can simply consider a flat output in other circumstances. Notice that the output is flat only if the input is also flat.

  • real_output (bool) – Whether to provide the output in the real-valued representation.

Returns:

phi (torch.tensor) - Output of the network.