__init__.py 7.6 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#   Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

15
# TODO: import all neural network related api under this directory,
16 17
# including layers, linear, conv, rnn etc.

Z
zhiboniu 已提交
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
from .activation import elu  # noqa: F401
from .activation import elu_  # noqa: F401
from .activation import gelu  # noqa: F401
from .activation import hardshrink  # noqa: F401
from .activation import hardtanh  # noqa: F401
from .activation import hardsigmoid  # noqa: F401
from .activation import hardswish  # noqa: F401
from .activation import leaky_relu  # noqa: F401
from .activation import log_sigmoid  # noqa: F401
from .activation import maxout  # noqa: F401
from .activation import prelu  # noqa: F401
from .activation import relu  # noqa: F401
from .activation import relu_  # noqa: F401
from .activation import relu6  # noqa: F401
from .activation import selu  # noqa: F401
from .activation import sigmoid  # noqa: F401
from .activation import silu  # noqa: F401
from .activation import softmax  # noqa: F401
from .activation import softmax_  # noqa: F401
from .activation import softplus  # noqa: F401
from .activation import softshrink  # noqa: F401
from .activation import softsign  # noqa: F401
from .activation import swish  # noqa: F401
from .activation import tanh  # noqa: F401
from .activation import tanh_  # noqa: F401
from .activation import tanhshrink  # noqa: F401
from .activation import thresholded_relu  # noqa: F401
from .activation import log_softmax  # noqa: F401
from .activation import glu  # noqa: F401
47
from .activation import gumbel_softmax  # noqa: F401
Z
zhiboniu 已提交
48 49 50 51 52 53 54 55 56 57 58
from .common import dropout  # noqa: F401
from .common import dropout2d  # noqa: F401
from .common import dropout3d  # noqa: F401
from .common import alpha_dropout  # noqa: F401
from .common import label_smooth  # noqa: F401
from .common import pad  # noqa: F401
from .common import cosine_similarity  # noqa: F401
from .common import unfold  # noqa: F401
from .common import interpolate  # noqa: F401
from .common import upsample  # noqa: F401
from .common import bilinear  # noqa: F401
59
from .common import class_center_sample  # noqa: F401
Z
zhiboniu 已提交
60 61 62
from .conv import conv1d  # noqa: F401
from .conv import conv1d_transpose  # noqa: F401
from .common import linear  # noqa: F401
63
from .fused_transformer import fused_multi_head_attention  # noqa: F401
Z
zhiboniu 已提交
64 65 66 67 68
from .conv import conv2d  # noqa: F401
from .conv import conv2d_transpose  # noqa: F401
from .conv import conv3d  # noqa: F401
from .conv import conv3d_transpose  # noqa: F401
from .extension import diag_embed  # noqa: F401
69
from .extension import sequence_mask
Z
zhiboniu 已提交
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
from .loss import binary_cross_entropy  # noqa: F401
from .loss import binary_cross_entropy_with_logits  # noqa: F401
from .loss import cross_entropy  # noqa: F401
from .loss import dice_loss  # noqa: F401
from .loss import hsigmoid_loss  # noqa: F401
from .loss import kl_div  # noqa: F401
from .loss import l1_loss  # noqa: F401
from .loss import log_loss  # noqa: F401
from .loss import margin_ranking_loss  # noqa: F401
from .loss import mse_loss  # noqa: F401
from .loss import nll_loss  # noqa: F401
from .loss import npair_loss  # noqa: F401
from .loss import sigmoid_focal_loss  # noqa: F401
from .loss import smooth_l1_loss  # noqa: F401
from .loss import softmax_with_cross_entropy  # noqa: F401
85
from .loss import margin_cross_entropy  # noqa: F401
Z
zhiboniu 已提交
86 87 88 89 90 91 92 93 94 95 96 97 98
from .loss import square_error_cost  # noqa: F401
from .loss import ctc_loss  # noqa: F401
from .norm import batch_norm  # noqa: F401
from .norm import instance_norm  # noqa: F401
from .norm import layer_norm  # noqa: F401
from .norm import local_response_norm  # noqa: F401
from .norm import normalize  # noqa: F401
from .pooling import avg_pool1d  # noqa: F401
from .pooling import avg_pool2d  # noqa: F401
from .pooling import avg_pool3d  # noqa: F401
from .pooling import max_pool1d  # noqa: F401
from .pooling import max_pool2d  # noqa: F401
from .pooling import max_pool3d  # noqa: F401
99

Z
zhiboniu 已提交
100 101 102 103 104 105
from .pooling import adaptive_max_pool1d  # noqa: F401
from .pooling import adaptive_max_pool2d  # noqa: F401
from .pooling import adaptive_max_pool3d  # noqa: F401
from .pooling import adaptive_avg_pool1d  # noqa: F401
from .pooling import adaptive_avg_pool2d  # noqa: F401
from .pooling import adaptive_avg_pool3d  # noqa: F401
106
from .pooling import max_unpool2d  # noqa: F401
107

Z
zhiboniu 已提交
108 109 110 111 112 113 114 115
from .vision import affine_grid  # noqa: F401
from .vision import grid_sample  # noqa: F401
from .vision import pixel_shuffle  # noqa: F401
from .input import one_hot  # noqa: F401
from .input import embedding  # noqa: F401
from ...fluid.layers import gather_tree  # noqa: F401
from ...fluid.layers import temporal_shift  # noqa: F401

116 117
from .sparse_attention import sparse_attention

Z
zhiboniu 已提交
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
__all__ = [     #noqa
           'conv1d',
           'conv1d_transpose',
           'conv2d',
           'conv2d_transpose',
           'conv3d',
           'conv3d_transpose',
           'elu',
           'elu_',
           'gelu',
           'hardshrink',
           'hardtanh',
           'hardsigmoid',
           'hardswish',
           'leaky_relu',
           'log_sigmoid',
           'maxout',
           'prelu',
           'relu',
           'relu_',
           'relu6',
           'selu',
           'softmax',
           'softmax_',
           'softplus',
           'softshrink',
           'softsign',
           'sigmoid',
           'silu',
           'swish',
           'tanh',
           'tanh_',
           'tanhshrink',
           'thresholded_relu',
           'log_softmax',
           'glu',
154
           'gumbel_softmax',
Z
zhiboniu 已提交
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
           'diag_embed',
           'sequence_mask',
           'dropout',
           'dropout2d',
           'dropout3d',
           'alpha_dropout',
           'label_smooth',
           'linear',
           'pad',
           'unfold',
           'interpolate',
           'upsample',
           'bilinear',
           'cosine_similarity',
           'avg_pool1d',
           'avg_pool2d',
           'avg_pool3d',
           'max_pool1d',
           'max_pool2d',
           'max_pool3d',
175
           'max_unpool2d',
Z
zhiboniu 已提交
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
           'adaptive_avg_pool1d',
           'adaptive_avg_pool2d',
           'adaptive_avg_pool3d',
           'adaptive_max_pool1d',
           'adaptive_max_pool2d',
           'adaptive_max_pool3d',
           'binary_cross_entropy',
           'binary_cross_entropy_with_logits',
           'cross_entropy',
           'dice_loss',
           'hsigmoid_loss',
           'kl_div',
           'l1_loss',
           'log_loss',
           'mse_loss',
           'margin_ranking_loss',
           'nll_loss',
           'npair_loss',
           'sigmoid_focal_loss',
           'smooth_l1_loss',
           'softmax_with_cross_entropy',
197
           'margin_cross_entropy',
Z
zhiboniu 已提交
198 199 200 201 202 203 204 205 206
           'square_error_cost',
           'ctc_loss',
           'affine_grid',
           'grid_sample',
           'local_response_norm',
           'pixel_shuffle',
           'embedding',
           'gather_tree',
           'one_hot',
207
           'normalize',
208 209 210
           'temporal_shift',
           'batch_norm',
           'layer_norm',
211 212
           'instance_norm',
           'class_center_sample',
213
           'fused_multi_head_attention',
214
           'sparse_attention',
Z
zhiboniu 已提交
215
]