File tree 2 files changed +4
-7
lines changed
2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 26
26
# =====================================================================================
27
27
"""
28
28
"""
29
+ import warnings
29
30
import torch
30
31
31
32
from .normalizers import bjorck_normalization
@@ -57,6 +58,7 @@ def spectral_(
57
58
eps_spectral (float): stopping criterion of iterative power method
58
59
maxiter_spectral (int): maximum number of iterations for the power iteration
59
60
"""
61
+ warnings .warn ("spectral_ initialization is deprecated, use torch.nn.init.orthogonal_ instead" )
60
62
with torch .no_grad ():
61
63
tensor .copy_ (
62
64
spectral_normalization (
@@ -91,6 +93,7 @@ def bjorck_(
91
93
maxiter_bjorck (int): maximum number of iterations for bjorck algorithm
92
94
beta: Value to use for the :math:`\beta` parameter.
93
95
"""
96
+ warnings .warn ("bjorck_ initialization is deprecated, use torch.nn.init.orthogonal_ instead" )
94
97
with torch .no_grad ():
95
98
spectral_tensor = spectral_normalization (
96
99
tensor , None , eps = eps_spectral , maxiter = maxiter_spectral
Original file line number Diff line number Diff line change @@ -174,6 +174,7 @@ def __call__(self, **kwargs):
174
174
Model = module_Unavailable_class
175
175
compute_layer_sv = module_Unavailable_class
176
176
OrthLinearRegularizer = module_Unavailable_class
177
+ SpectralInitializer = module_Unavailable_class
177
178
178
179
MODEL_PATH = "model.h5"
179
180
LIP_LAYERS = "torchlip_layers"
@@ -591,13 +592,6 @@ def scaleDivAlpha(alpha):
591
592
return 1.0 / (1 + 1.0 / alpha )
592
593
593
594
594
- def SpectralInitializer (eps_spectral , eps_bjorck ):
595
- if eps_bjorck is None :
596
- return partial (spectral_ , eps_spectral = eps_spectral )
597
- else :
598
- return partial (bjorck_ , eps_spectral = eps_spectral , eps_bjorck = eps_bjorck )
599
-
600
-
601
595
class tAdd (torch .nn .Module ):
602
596
def __init__ (self ):
603
597
super (tAdd , self ).__init__ ()
You can’t perform that action at this time.
0 commit comments