class DensityRepresenter[source]

DensityRepresenter(problem:dl4to.problem.Problem=None, binarizer_strength:float=1.0) :: Module

A parent class that inherits different density representers. A density representer has a latent density distribution that is for instance used in the optimization steps of SIMP. Additionally, it can be employed for neural reparamterization. Additionally, the density representer has an in-built binarizer, that can be interpreted as a smoothed Heaviside function. The binarizer returns densities that have values closer to 0 and 1.

Type Default Details
problem dl4to.problem.Problem None The problem object for which the density representer is used. The problem object is necessary to grant that boundary and design space constraints are fulfilled. However, the problem does not need to be passed during initializiaton but can also be passed later by overriding density_representer.problem.
binarizer_strength float 1.0 The steepness of the smoothed Heaviside-function. A binarizer strength of infinity would corresponds to a non-smooth classical Heaviside step function.

DensityRepresenter.steepen_binarizer[source]

DensityRepresenter.steepen_binarizer(binarizer_steepening_factor:float=1.1)

Increases the binarizer strength by a factor.

Type Default Details
binarizer_steepening_factor float 1.1 The factor by which to change the current binarizer strength. A value of 1. means that the binarizer does not change.

DensityRepresenter.reset_binarizer[source]

DensityRepresenter.reset_binarizer()

Resets the binarizer strength to its initial value.

DensityRepresenter.__call__[source]

DensityRepresenter.__call__()

Applies the density representer to the latent density representation, followed by the binarizer step and a projection step. The projection step makes sure that the problem conditions are fulfilled and that the density has no values outside of the unit interval. Returns a flattened torch.Tensor containing the density distribution.