# tensorplay.nn.init.calculate_gain Source: https://www.tensorplay.cn/docs/generated/tensorplay.nn.init.calculate_gain.html ```python tensorplay.nn.init.calculate_gain(nonlinearity, param=None) ``` Return the recommended gain value for the given nonlinearity. Supported names: linear/conv{1,2,3}d/conv_transpose{1,2,3}d and sigmoid map to 1, tanh to 5/3, relu to sqrt(2), selu to 3/4, and leaky_relu to sqrt(2 / (1 + negative_slope**2)) where the slope is taken from param (default 0.01).