3.3.4. unit_scaling.constraints.hmean

unit_scaling.constraints.hmean(*scales: float) float[source]

Computes the harmonic mean of the provided scales. Used in Xavier/Glorot scaling.

Parameters:

scales – (*float): the group of constrained scales

Returns:

the harmonic mean.

Return type:

float