You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Applies spectral normalization to a parameter according to the
145
172
following Calculation:
@@ -176,7 +203,7 @@ def spectral_norm(
176
203
name(str, optional): Name of the weight parameter. Default: 'weight'.
177
204
n_power_iterations(int, optional): The number of power iterations to calculate spectral norm. Default: 1.
178
205
eps(float, optional): The epsilon for numerical stability in calculating norms. Default: 1e-12.
179
-
dim(int, optional): The index of dimension which should be permuted to the first before reshaping Input(Weight) to matrix, it should be set as 0 if Input(Weight) is the weight of fc layer, and should be set as 1 if Input(Weight) is the weight of conv layer. Default: None.
206
+
dim(int|None, optional): The index of dimension which should be permuted to the first before reshaping Input(Weight) to matrix, it should be set as 0 if Input(Weight) is the weight of fc layer, and should be set as 1 if Input(Weight) is the weight of conv layer. Default: None.
180
207
181
208
Returns:
182
209
Layer, the original layer with the spectral norm hook.
0 commit comments