@@ -29,37 +29,49 @@ def warning_function(new, old):
2929
3030class Condition :
3131 """
32- The class ``Condition`` is used to represent the constraints (physical
33- equations, boundary conditions, etc.) that should be satisfied in the
34- problem at hand. Condition objects are used to formulate the
35- PINA :class:`~pina.problem.abstract_problem.AbstractProblem` object.
36- Conditions can be specified in four ways:
37-
38- 1. By specifying the input and target of the condition; in such a
39- case, the model is trained to produce the output points given the input
40- points. Those points can either be torch.Tensor, LabelTensors, Graph.
41- Based on the type of the input and target, there are different
42- implementations of the condition. For more details, see
43- :class:`~pina.condition.input_target_condition.InputTargetCondition`.
44-
45- 2. By specifying the domain and the equation of the condition; in such
46- a case, the model is trained to minimize the equation residual by
47- evaluating it at some samples of the domain.
48-
49- 3. By specifying the input and the equation of the condition; in
50- such a case, the model is trained to minimize the equation residual by
51- evaluating it at the passed input points. The input points must be
52- a LabelTensor. Based on the type of the input, there are different
53- implementations of the condition. For more details, see
54- :class:`~pina.condition.input_equation_condition.InputEquationCondition`
55- .
56-
57- 4. By specifying only the input data; in such a case the model is
58- trained with an unsupervised costum loss and uses the data in training.
59- Additionaly conditioning variables can be passed, whenever the model
60- has extra conditioning variable it depends on. Based on the type of the
61- input, there are different implementations of the condition. For more
62- details, see :class:`~pina.condition.data_condition.DataCondition`.
32+ Represents constraints (such as physical equations, boundary conditions,
33+ etc.) that must be satisfied in a given problem. Condition objects are used
34+ to formulate the PINA
35+ :class:`~pina.problem.abstract_problem.AbstractProblem` object.
36+
37+ There are different types of conditions:
38+
39+ - :class:`~pina.condition.input_target_condition.InputTargetCondition`:
40+ Defined by specifying both the input and the target of the condition. In
41+ this case, the model is trained to produce the target given the input. The
42+ input and output data must be one of the :class:`torch.Tensor`,
43+ :class:`~pina.label_tensor.LabelTensor`,
44+ :class:`~torch_geometric.data.Data`, or :class:`~pina.graph.Graph`.
45+ Different implementations exist depending on the type of input and target.
46+ For more details, see
47+ :class:`~pina.condition.input_target_condition.InputTargetCondition`.
48+
49+ - :class:`~pina.condition.domain_equation_condition.DomainEquationCondition`
50+ : Defined by specifying both the domain and the equation of the condition.
51+ Here, the model is trained to minimize the equation residual by evaluating
52+ it at sampled points within the domain.
53+
54+ - :class:`~pina.condition.input_equation_condition.InputEquationCondition`:
55+ Defined by specifying the input and the equation of the condition. In this
56+ case, the model is trained to minimize the equation residual by evaluating
57+ it at the provided input. The input must be either a
58+ :class:`~pina.label_tensor.LabelTensor` or a :class:`~pina.graph.Graph`.
59+ Different implementations exist depending on the type of input. For more
60+ details, see
61+ :class:`~pina.condition.input_equation_condition.InputEquationCondition`.
62+
63+ - :class:`~pina.condition.data_condition.DataCondition`:
64+ Defined by specifying only the input. In this case, the model is trained
65+ with an unsupervised custom loss while using the provided data during
66+ training. The input data must be one of :class:`torch.Tensor`,
67+ :class:`~pina.label_tensor.LabelTensor`,
68+ :class:`~torch_geometric.data.Data`, or :class:`~pina.graph.Graph`.
69+ Additionally, conditional variables can be provided when the model
70+ depends on extra parameters. These conditional variables must be either
71+ :class:`torch.Tensor` or :class:`~pina.label_tensor.LabelTensor`.
72+ Different implementations exist depending on the type of input.
73+ For more details, see
74+ :class:`~pina.condition.data_condition.DataCondition`.
6375
6476 :Example:
6577
@@ -94,7 +106,8 @@ class Condition:
94106
95107 def __new__ (cls , * args , ** kwargs ):
96108 """
97- Check the input arguments and return the appropriate Condition object.
109+ Instantiate the appropriate Condition object based on the keyword
110+ arguments passed.
98111
99112 :raises ValueError: If no keyword arguments are passed.
100113 :raises ValueError: If the keyword arguments are invalid.
0 commit comments