未验证 提交 1b83de2e 编写于 作者: Z zhiboniu 提交者: GitHub

update 2.0 public api in optimizer (#31944)

上级 7a681f0b
...@@ -12,19 +12,27 @@ ...@@ -12,19 +12,27 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
__all__ = [ from .optimizer import Optimizer # noqa: F401
'Optimizer', 'Adagrad', 'Adam', 'AdamW', 'Adamax', 'RMSProp', 'Adadelta', from .adagrad import Adagrad # noqa: F401
'SGD', 'Momentum', 'Lamb', 'lr' from .adam import Adam # noqa: F401
] from .adamw import AdamW # noqa: F401
from .adamax import Adamax # noqa: F401
from .rmsprop import RMSProp # noqa: F401
from .adadelta import Adadelta # noqa: F401
from .sgd import SGD # noqa: F401
from .momentum import Momentum # noqa: F401
from .lamb import Lamb # noqa: F401
from . import lr # noqa: F401
from .optimizer import Optimizer __all__ = [ #noqa
from .adagrad import Adagrad 'Optimizer',
from .adam import Adam 'Adagrad',
from .adamw import AdamW 'Adam',
from .adamax import Adamax 'AdamW',
from .rmsprop import RMSProp 'Adamax',
from .adadelta import Adadelta 'RMSProp',
from .sgd import SGD 'Adadelta',
from .momentum import Momentum 'SGD',
from .lamb import Lamb 'Momentum',
from . import lr 'Lamb'
]
...@@ -17,8 +17,6 @@ from ..fluid import core ...@@ -17,8 +17,6 @@ from ..fluid import core
from ..fluid import framework from ..fluid import framework
from ..fluid.framework import Variable, name_scope from ..fluid.framework import Variable, name_scope
__all__ = ["Adadelta"]
class Adadelta(Optimizer): class Adadelta(Optimizer):
r""" r"""
......
...@@ -17,8 +17,6 @@ from ..fluid import core ...@@ -17,8 +17,6 @@ from ..fluid import core
from ..fluid import framework from ..fluid import framework
from ..fluid.framework import Variable from ..fluid.framework import Variable
__all__ = ["Adagrad"]
class Adagrad(Optimizer): class Adagrad(Optimizer):
r""" r"""
......
...@@ -24,8 +24,6 @@ from ..fluid.dygraph import base as imperative_base ...@@ -24,8 +24,6 @@ from ..fluid.dygraph import base as imperative_base
import paddle import paddle
__all__ = ["Adam"]
class Adam(Optimizer): class Adam(Optimizer):
r""" r"""
......
...@@ -17,8 +17,6 @@ from ..fluid import core ...@@ -17,8 +17,6 @@ from ..fluid import core
from ..fluid import framework from ..fluid import framework
from ..fluid.framework import Variable, name_scope from ..fluid.framework import Variable, name_scope
__all__ = ["Adamax"]
class Adamax(Optimizer): class Adamax(Optimizer):
r""" r"""
......
...@@ -19,8 +19,6 @@ from ..fluid import framework ...@@ -19,8 +19,6 @@ from ..fluid import framework
from ..fluid.dygraph import base as imperative_base from ..fluid.dygraph import base as imperative_base
import paddle import paddle
__all__ = ['AdamW']
class AdamW(Adam): class AdamW(Adam):
r""" r"""
......
...@@ -17,8 +17,6 @@ from ..fluid import core ...@@ -17,8 +17,6 @@ from ..fluid import core
from ..fluid import framework from ..fluid import framework
from ..fluid.framework import Variable from ..fluid.framework import Variable
__all__ = ["Lamb"]
class Lamb(Optimizer): class Lamb(Optimizer):
r""" r"""
......
...@@ -17,10 +17,19 @@ import numpy ...@@ -17,10 +17,19 @@ import numpy
import warnings import warnings
from paddle import Tensor from paddle import Tensor
__all__ = [ __all__ = [ #noqa
'LRScheduler', 'NoamDecay', 'PiecewiseDecay', 'NaturalExpDecay', 'LRScheduler',
'InverseTimeDecay', 'PolynomialDecay', 'LinearWarmup', 'ExponentialDecay', 'NoamDecay',
'MultiStepDecay', 'StepDecay', 'LambdaDecay', 'ReduceOnPlateau', 'PiecewiseDecay',
'NaturalExpDecay',
'InverseTimeDecay',
'PolynomialDecay',
'LinearWarmup',
'ExponentialDecay',
'MultiStepDecay',
'StepDecay',
'LambdaDecay',
'ReduceOnPlateau',
'CosineAnnealingDecay' 'CosineAnnealingDecay'
] ]
......
...@@ -21,7 +21,6 @@ from ..fluid import unique_name ...@@ -21,7 +21,6 @@ from ..fluid import unique_name
from ..fluid import layers from ..fluid import layers
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.fluid.regularizer import L2DecayRegularizer from paddle.fluid.regularizer import L2DecayRegularizer
__all__ = ["Momentum"]
class Momentum(Optimizer): class Momentum(Optimizer):
......
...@@ -42,8 +42,6 @@ from ..fluid.wrapped_decorator import signature_safe_contextmanager ...@@ -42,8 +42,6 @@ from ..fluid.wrapped_decorator import signature_safe_contextmanager
from .. import compat as cpt from .. import compat as cpt
from .lr import LRScheduler from .lr import LRScheduler
__all__ = ['Optimizer']
class Optimizer(object): class Optimizer(object):
r"""Optimizer Base class. r"""Optimizer Base class.
......
...@@ -17,8 +17,6 @@ from ..fluid import core ...@@ -17,8 +17,6 @@ from ..fluid import core
from ..fluid import framework from ..fluid import framework
from ..fluid.framework import Variable from ..fluid.framework import Variable
__all__ = ["RMSProp"]
class RMSProp(Optimizer): class RMSProp(Optimizer):
r""" r"""
......
...@@ -17,7 +17,6 @@ from ..fluid import core ...@@ -17,7 +17,6 @@ from ..fluid import core
from ..fluid import framework from ..fluid import framework
from ..fluid.framework import Variable, name_scope from ..fluid.framework import Variable, name_scope
from ..fluid.dygraph import no_grad from ..fluid.dygraph import no_grad
__all__ = ["SGD"]
class SGD(Optimizer): class SGD(Optimizer):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册