未验证 提交 194a22c5 编写于 作者: X XiaoguangHu 提交者: GitHub

reorganize the paddle api test=develop (#23151)

上级 46b8d282
# 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.
# TODO: define the functions to manipulate devices
# __all__ = ['cpu_places',
# 'CPUPlace',
# 'cuda_pinned_places',
# 'cuda_places',
# 'CUDAPinnedPlace',
# 'CUDAPlace',
# 'is_compiled_with_cuda']
# 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.
# TODO: define the distribution functions
# __all__ = ['Categorical',
# 'MultivariateNormalDiag',
# 'Normal',
# 'sampling_id',
# 'Uniform']
# 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.
# TODO: define distributed api under this directory,
# __all__ = ['metric',
# 'optimizer',
# 'RoleMaker',
# 'dataset',
# ' DatasetFactory',
# ' InMemoryDataset',
# ' QueueDataset',
# 'transpiler',
# ' DistributeTranspiler',
# ' DistributeTranspilerConfig',
# ' HashName',
# ' RoundRobin',
# 'collective']
# 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.
# TODO: import framework api under this directory
# __all__ = ['append_backward',
# 'gradients',
# 'Executor',
# 'global_scope',
# 'scope_guard',
# 'BuildStrategy',
# 'CompiledProgram',
# 'default_main_program',
# 'default_startup_program',
# 'create_global_var',
# 'create_parameter',
# 'create_py_reader_by_data',
# 'Print',
# 'py_func',
# 'ExecutionStrategy',
# 'in_dygraph_mode',
# 'name_scope',
# 'ParallelExecutor',
# 'ParamAttr',
# 'Program',
# 'program_guard',
# 'Variable',
# 'WeightNormParamAttr',
# 'Model',
# 'Sequential']
# 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.
# TODO: define framework api
# __all__ = ['set_default_dtype',
# 'get_default_dtype']
# 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.
# TODO: define random api
# __all__ = ['manual_seed']
# 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.
# TODO: define api used to run in imperative mode
# __all__ = ['BackwardStrategy',
# 'guard',
# 'Layer',
# 'LayerList',
# 'load_dygraph',
# 'save_dygraph',
# 'prepare_context',
# 'to_variable',
# 'TracedLayer',
# 'no_grad',
# 'ParameterList']
# 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.
# TODO: define all functions about input & output in this directory
# __all__ = ['Dataset',
# 'Sampler',
# 'Transform',
# 'DataLoader',
# 'load',
# 'save',
# 'load_program_state',
# 'set_program_state',
# 'load_inference_model',
# 'save_inference_model',
# 'batch',
# 'shuffle',
# 'buffered',
# 'cache',
# 'chain',
# 'firstn',
# 'compose',
# 'map_readers',
# 'xmap_readers']
# 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.
# TODO: define the functions to calculate metric in this directory
# __all__ = ['Accuracy',
# 'Auc',
# 'ChunkEvaluator',
# 'CompositeMetric',
# 'DetectionMAP',
# 'EditDistance',
# 'Precesion',
# 'Recall',
# 'accuracy',
# 'auc',
# 'chunk_eval',
# 'cos_sim',
# 'mean_iou']
# 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.
# TODO: import all neural network related api under this directory,
# including layers, linear, conv, rnn etc.
# __all__ = [ ]
# 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.
# TODO: define the functions to clip gradient of parameter
# __all__ = ['ErrorClipByValue',
# 'GradientClipByGlobalNorm',
# 'GradientClipByNorm',
# 'GradientClipByValue',
# 'set_gradient_clip',
# 'clip',
# 'clip_by_norm']
# 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.
# TODO: define the control flow api
# __all__ = ['case',
# 'cond',
# 'DynamicRNN',
# 'StaticRNN',
# 'switch_case',
# 'while_loop',
# 'rnn']
# 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.
# TODO: define api to implement decoding algorithm
# __all__ = ['BeamSearchDecoder',
# 'Decoder',
# 'beam_search',
# 'beam_search_decode',
# 'crf_decoding',
# 'ctc_greedy_decoder',
# 'dynamic_decode',
# 'gather_tree']
# 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.
# TODO: define activation functions of neural network
# __all__ = ['brelu',
# 'elu',
# 'erf',
# 'gelu',
# 'hard_shrink',
# 'hard_sigmoid',
# 'hard_swish',
# 'hsigmoid',
# 'leaky_relu',
# 'logsigmoid',
# 'maxout',
# 'prelu',
# 'relu',
# 'relu6',
# 'selu',
# 'sigmoid',
# 'soft_relu',
# 'softmax',
# 'softplus',
# 'softshrink',
# 'softsign',
# 'swish',
# 'tanh_shrink',
# 'thresholded_relu',
# 'log_softmax']
# 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.
# TODO: define the common functions to build a neural network
# __all__ = ['dropout',
# 'embedding',
# 'fc',
# 'label_smooth',
# 'one_hot',
# 'pad',
# 'pad_constant_like',
# 'pad2d',
# 'unfold',
# 'bilinear_tensor_product',
# 'assign',
# 'interpolate']
# 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.
# TODO: define functions of convolutional neural network
# __all__ = ['conv2d',
# 'conv2d_transpose',
# 'conv3d',
# 'conv3d_transpose']
# 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.
# TODO: define the extention functions
# __all__ = ['add_position_encoding',
# 'autoincreased_step_counter',
# 'continuous_value_model',
# 'filter_by_instag',
# 'linear_chain_crf',
# 'merge_selected_rows',
# 'multiclass_nms',
# 'polygon_box_transform',
# 'random_crop',
# 'row_conv',
# 'rpn_target_assign',
# 'similarity_focus',
# 'target_assign',
# 'temporal_shift',
# 'warpctc',
# 'diag_embed']
# 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.
# TODO: define learning rate decay
# __all__ = ['cosine_decay',
# 'exponential_decay',
# 'inverse_time_decay',
# 'natural_exp_decay',
# 'noam_decay',
# 'piecewise_decay',
# 'polynomial_decay',
# 'linear_lr_warmup']
# 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.
# TODO: define functions which accept only LoDTensor as input
# __all__ = ['sequence_concat',
# 'sequence_conv',
# 'sequence_enumerate',
# 'sequence_expand_as',
# 'sequence_expand',
# 'sequence_first_step',
# 'sequence_last_step',
# 'sequence_mask',
# 'sequence_pad',
# 'sequence_pool',
# 'sequence_reshape',
# 'sequence_reverse',
# 'sequence_scatter',
# 'sequence_slice',
# 'sequence_softmax',
# 'sequence_unpad',
# 'array_length',
# 'array_read',
# 'array_write',
# 'create_array',
# 'hash',
# 'im2sequence',
# 'lod_append',
# 'lod_reset',
# 'reorder_lod_tensor_by_rank',
# 'tensor_array_to_tensor',
# 'dynamic_gru',
# 'dynamic_lstm',
# 'dynamic_lstmp']
# 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.
# TODO: define loss functions of neural network
# __all__ = ['bpr_loss',
# 'center_loss',
# 'cross_entropy',
# 'dice_loss',
# 'edit_distance',
# 'huber_loss',
# 'iou_similarity',
# 'kldiv_loss',
# 'log_loss',
# 'margin_rank_loss',
# 'mse_loss',
# 'nce',
# 'npair_loss',
# 'rank_loss',
# 'sampled_softmax_with_cross_entropy',
# 'sigmoid_cross_entropy_with_logits',
# 'sigmoid_focal_loss',
# 'smooth_l1',
# 'softmax_with_cross_entropy',
# 'square_error_cost',
# 'ssd_loss',
# 'teacher_student_sigmoid_loss']
# 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.
# TODO: define normalization api
# __all__ = ['batch_norm',
# 'data_norm',
# 'group_norm',
# 'instance_norm',
# 'l2_normalize',
# 'layer_norm',
# 'lrn',
# 'spectral_norm']
# 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.
# TODO: define pooling functions
# __all__ = ['pool2d',
# 'pool3d',
# 'adaptive_pool2d',
# 'adaptive_pool3d']
# 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.
# TODO: define function of recurrent neural network
# __all__ = ['gru_unit',
# 'lstm',
# 'lstm_unit']
# 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.
# TODO: define the classes of Transformer neural network
# __all__ = [ ]
# 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.
# TODO: define specitial functions used in computer vision task
# __all__ = ['affine_channel',
# 'affine_grid',
# 'anchor_generator',
# 'bipartite_match',
# 'box_clip',
# 'box_coder',
# 'box_decoder_and_assign',
# 'collect_fpn_proposals',
# 'deformable_conv',
# 'deformable_roi_pooling',
# 'density_prior_box',
# 'detection_output',
# 'distribute_fpn_proposals',
# 'fsp_matrix',
# 'generate_mask_labels',
# 'generate_proposal_labels',
# 'generate_proposals',
# 'grid_sampler',
# 'image_resize',
# 'image_resize_short',
# 'multi_box_head',
# 'pixel_shuffle',
# 'prior_box',
# 'prroi_pool',
# 'psroi_pool',
# 'resize_bilinear',
# 'resize_nearest',
# 'resize_trilinear',
# 'retinanet_detection_output',
# 'retinanet_target_assign',
# 'roi_align',
# 'roi_perspective_transform',
# 'roi_pool',
# 'shuffle_channel',
# 'space_to_depth',
# 'yolo_box',
# 'yolov3_loss']
# 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.
# TODO: define the initializers to create a Parameter in neural network
# __all__ = ['Bilinear',
# 'Constant',
# 'MSRA',
# 'Normal',
# 'TruncatedNormal',
# 'Uniform',
# 'Xavier']
# 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.
# TODO: define input placeholders of neural network
# __all__ = ['data', 'Input']
# 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.
# TODO: define activation functions of neural network
# __all__ = ['PReLU', 'ReLU', 'Sigmoid', 'Softmax', 'LogSoftmax']
# 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.
# TODO: define the common classes to build a neural network
# __all__ = ['BilinearTensorProduct',
# 'Pool2D',
# 'Embedding',
# 'Linear',
# 'UpSample']
# 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.
# TODO: define classes of convolutional neural network
# __all__ = ['Conv2D',
# 'Conv2DTranspose',
# 'Conv3D',
# 'Conv3DTranspose',
# 'TreeConv',
# 'Conv1D']
# 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.
# TODO: define learning rate decay
# __all__ = ['CosineDecay',
# 'ExponentialDecay',
# 'InverseTimeDecay',
# 'NaturalExpDecay',
# 'NoamDecay',
# 'PiecewiseDecay',
# 'PolynomialDecay']
# 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.
# TODO: define loss functions of neural network
# __all__ = ['NCELoss',
# 'CrossEntropyLoss',
# 'MSELoss',
# 'L1Loss',
# 'NLLLoss',
# 'BCELoss']
# 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.
# TODO: define normalization api
# __all__ = ['BatchNorm',
# 'GroupNorm',
# 'LayerNorm',
# 'SpectralNorm']
# 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.
# TODO: define classes of recurrent neural network
# __all__ = ['RNNCell', 'GRUCell', 'LSTMCell']
# 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.
# TODO: define the classes of Transformer neural network
# __all__ = [ ]
# 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.
# TODO: define all optimizers in this directory,
# __all__ = ['Adadelta',
# 'AdadeltaOptimizer',
# 'Adagrad',
# 'AdagradOptimizer',
# 'Adam',
# 'Adamax',
# 'AdamaxOptimizer',
# 'AdamOptimizer',
# 'DecayedAdagrad',
# 'DecayedAdagradOptimizer',
# 'DGCMomentumOptimizer',
# 'Dpsgd',
# 'DpsgdOptimizer',
# 'ExponentialMovingAverage',
# 'Ftrl',
# 'FtrlOptimizer',
# 'LambOptimizer',
# 'LarsMomentum',
# 'LarsMomentumOptimizer',
# 'LookaheadOptimizer',
# 'ModelAverage',
# 'Momentum',
# 'MomentumOptimizer',
# 'PipelineOptimizer',
# 'RecomputeOptimizer',
# 'RMSPropOptimizer',
# 'SGD',
# 'SGDOptimizer']
# 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.
# TODO: define the regularizer functions
# __all__ = ['L1Decay',
# 'L1DecayRegularizer',
# 'L2Decay',
# 'L2DecayRegularizer']
# 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.
# TODO: import all tensor api under this directory,
# including tensor creation, manipulation, math, etc.
# __all__ = [ ]
# 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.
# TODO: define functions to get tensor attributes
# __all__ = ['rank', 'shape']
# 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.
# TODO: define functions to get create a tensor
# __all__ = ['create_tensor',
# 'create_lod_tensor',
# 'create_random_int_lodtensor',
# 'crop_tensor',
# 'diag', 'eye',
# 'fill_constant',
# 'get_tensor_from_selected_rows',
# 'linspace',
# 'ones',
# 'ones_like',
# 'range',
# 'zeros',
# 'zeros_like',
# 'arrange',
# 'eye',
# 'full',
# 'linspace',
# 'full_like',
# 'triu',
# 'tril',
# 'meshgrid']
# 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.
# TODO: define functions to save & load a tensor
# __all__ = ['save', 'load']
# 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.
# TODO: define functions of linear algebra
# __all__ = ['matmul',
# 'dot',
# 'einsum',
# 'morm',
# 'transpose',
# 'dist',
# 't',
# 'cross',
# 'cholesky',
# 'tensordot']
# 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.
# TODO: define logic functions of a tensor
# __all__ = ['equal',
# 'greater_equal',
# 'greater_than',
# 'is_empty',
# 'isfinite',
# 'less_equal',
# 'less_than',
# 'logical_and',
# 'logical_not',
# 'logical_or',
# 'logical_xor',
# 'not_equal',
# 'reduce_all',
# 'reduce_any',
# 'allclose',
# 'elementwise_equal',
# 'isnan']
# 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.
# TODO: define functions to manipulate a tensor
# __all__ = ['cast',
# 'concat',
# 'expand',
# 'expand_as',
# 'flatten',
# 'gather',
# 'gather_nd',
# 'reshape',
# 'reverse',
# 'scatter',
# 'scatter_nd_add',
# 'scatter_nd',
# 'shard_index',
# 'slice',
# 'split',
# 'squeeze',
# 'stack',
# 'strided_slice',
# 'transpose',
# 'unique',
# 'unique_with_counts',
# 'unsqueeze',
# 'unstack',
# 'flip',
# 'unbind',
# 'roll']
# 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.
# TODO: define math functions
# __all__ = ['abs',
# 'acos',
# 'asin',
# 'atan',
# 'ceil',
# 'cos',
# 'cumsum',
# 'elementwise_add',
# 'elementwise_div',
# 'elementwise_floordiv',
# 'elementwise_max',
# 'elementwise_min',
# 'elementwise_mod',
# 'elementwise_mul',
# 'elementwise_pow',
# 'elementwise_sub',
# 'exp',
# 'floor',
# 'increment',
# 'log',
# 'mul',
# 'multiplex',
# 'pow',
# 'reciprocal',
# 'reduce_max',
# 'reduce_min',
# 'reduce_prod',
# 'reduce_sum',
# 'round',
# 'rsqrt',
# 'scale',
# 'sign',
# 'sin',
# 'sqrt',
# 'square',
# 'stanh',
# 'sum',
# 'sums',
# 'tanh',
# 'elementwise_sum',
# 'max',
# 'min',
# 'mm',
# 'div',
# 'add',
# 'atan',
# 'logsumexp',
# 'inverse',
# 'log1p',
# 'erf',
# 'addcmul',
# 'addmm']
# 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.
# TODO: define random functions
# __all__ = ['gaussin',
# 'uniform',
# 'shuffle',
# 'randn',
# 'randperm',
# 'rand',
# 'randint']
# 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.
# TODO: define searching & indexing functions of a tensor
# __all__ = ['argmax',
# 'argmin',
# 'argsort',
# 'has_inf',
# 'has_nan',
# 'masked_select',
# 'topk',
# 'where',
# 'index_select',
# 'nonzero',
# 'sort']
# 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.
# TODO: define statistical functions of a tensor
# __all__ = ['mean', 'reduce_mean', 'std', 'var']
# 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.
# TODO: define the basic tensor classes
# __all__ = ['Tensor', 'LoDTensor', 'LoDTensorArray']
......@@ -14,3 +14,14 @@
from .plot import Ploter
__all__ = ['dump_config', 'Ploter']
#TODO: define new api under this directory
# __all__ = ['profiler',
# 'profiler.cuda_profiler',
# 'profiler.profiler',
# 'profiler.reset_profiler',
# 'profiler.start_profiler',
# 'profiler.stop_profiler',
# 'unique_name',
# 'load_op_library',
# 'require_version']
# Copyright (c) 2016 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.
#TODO: define new api of profiler
# __all__ = ['cuda_profiler',
# 'profiler',
# 'reset_profiler',
# 'start_profiler',
# 'stop_profiler']
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册