doc(condtions): fix rst-rendering issues
reStructured Text is so hard to work with. Why don't people just use markdown?
@@ -4,21 +4,24 @@ import warnings
class BaseCondition:
r"""Base class for all conditions.
+
A condition is a tool to `re-parameterize` the output(s) of a neural network.
such that the re-parameterized output(s) will automatically satisfy initial conditions (ICs)
and boundary conditions (BCs) of the PDEs/ODEs that are being solved.
.. note::
- The nouns "(re)parameterization" and "condition" are used interchangeably in the documentation and the library.
- The verbs "(re)parameterize" and "enforce" are different in that *(re)parameterize* is said of network outputs
- whereas *enforce* is said of networks themselves.
+ - The nouns *(re-)parameterization* and *condition* are used interchangeably in the documentation and library.
+ - The verbs *(re-)parameterize* and *enforce* are different:
+
+ - *(re)parameterize* is said of network outputs;
+ - *enforce* is said of networks themselves.
"""
def __init__(self):
self.ith_unit = None
def parameterize(self, output_tensor, *input_tensors):
- f"""[ABSTRACT METHOD] Re-parameterize output(s) of a network.
+ r"""Re-parameterize output(s) of a network.
:param output_tensor: Output of the neural network.
:type output_tensor: `torch.Tensor`
@@ -28,12 +31,12 @@ class BaseCondition:
:rtype: `torch.Tensor`
.. note::
- This method is abstract for {self.__class__.__name__}
+ This method is **abstract** for BaseCondition
"""
raise ValueError(f"Abstract {self.__class__.__name__} cannot be parameterized")
def enforce(self, net, *coordinates):
- f"""Enforces this condition on a network.
+ r"""Enforces this condition on a network.
:param net: The network whose output is to be re-parameterized.
:type net: `torch.nn.Module`
@@ -45,7 +48,7 @@ class BaseCondition:
return self.parameterize(net(*coordinates), *coordinates)
def set_impose_on(self, ith_unit):
- r"""[DEPRECATED] When training several functions with a single (multi-output network), this method is called
+ r"""**[DEPRECATED]** When training several functions with a single (multi-output network), this method is called
(by a `Solver` class or a `solve` function) to keep track of which output is being parameterized.
:param ith_unit: The index of network output to be parameterized.
@@ -94,6 +97,8 @@ class NoCondition(BaseCondition):
"""
def parameterize(self, output_tensor, *input_tensors):
+ f"""Performs no re-parameterization, or identity parameterization, in this case.
+ """
return output_tensor
