class ProblemPreprocessing[source]

ProblemPreprocessing(name:str=None, normalize:bool=False) :: Preprocessing

A parent class for several problem preprocessing strategies. Problem preprocessing processes the data based on problem specific information like forces and boundary conditions.

Type Default Details
name str None The name of the preprocessing.
normalize bool False Whether to normalize the output of the preprocessing.

ProblemPreprocessing.__call__[source]

ProblemPreprocessing.__call__(problem_or_solution:Union[ForwardRef('dl4to.problem.Problem'), ForwardRef('dl4to.solution.Solution')])

Applies the preprocessing to a problem or solution object. Returns a torch.Tensor object. If a solution object is passed, then it is automatically converted to a problem object via solution.problem.

Type Default Details
problem_or_solution typing.Union[ForwardRef('dl4to.problem.Problem'), ForwardRef('dl4to.solution.Solution')] A problem or solution object.

class TrivialPreprocessing[source]

TrivialPreprocessing(normalize:bool=False, dataset:dl4to.datasets.TopoDataset=None) :: ProblemPreprocessing

The output of trivial preprocessing [1] is a 7-channel tensor which results from the channel-wise concatenation of Dirichlet boundary conditions, design space information and loads. It is possible to normalize each sample’s F via the infinity norm over all forces in a dataset.

Type Default Details
normalize bool False Whether to normalize the forces in the output of the preprocessing. If True, then a dataset is required.
dataset dl4to.datasets.TopoDataset None A dataset that is used for the normalization of the forces in the output of the preprocessing. Is only used if normalize=True.

class ForcePreprocessing[source]

ForcePreprocessing(normalize:bool=False, dataset:dl4to.datasets.TopoDataset=None) :: ProblemPreprocessing

The input of the neural network is the 3-channel force tensor F. It is possible to normalize each sample’s F via the mean absolute maximum over a dataset.

Type Default Details
normalize bool False Whether to normalize the forces in the output of the preprocessing. If True, then a dataset is required.
dataset dl4to.datasets.TopoDataset None A dataset that is used for the normalization of the forces in the output of the preprocessing. Is only used if normalize=True.

class ConvexHullPreprocessing[source]

ConvexHullPreprocessing() :: ProblemPreprocessing

The convex hull of a binary image is the set of pixels included in the smallest convex polygon that surround all white pixels in the input. Convex hull preprocessing [1] generalizes this to 3d voxels and constructs a polygon with density 1 that connects the force allocation points to points with homogeneous Dirichlet boundary conditions. This binary density polygon is the output of this preprocessing.

References

[1] Dittmer, Sören, et al. "SELTO: Sample-Efficient Learned Topology Optimization." arXiv preprint arXiv:2209.05098 (2022).