From 8e019748058de19dd920aafd9ad522d4dc1f2bb3 Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 18 Apr 2019 15:24:45 +0800 Subject: [PATCH] add X2Paddle (#802) --- doc/fluid/api_guides/X2Paddle/Caffe-Fluid.rst | 45 +++++ .../api_guides/X2Paddle/TensorFlow-Fluid.rst | 154 ++++++++++++++++++ doc/fluid/api_guides/index_cn.rst | 2 + 3 files changed, 201 insertions(+) create mode 100644 doc/fluid/api_guides/X2Paddle/Caffe-Fluid.rst create mode 100644 doc/fluid/api_guides/X2Paddle/TensorFlow-Fluid.rst diff --git a/doc/fluid/api_guides/X2Paddle/Caffe-Fluid.rst b/doc/fluid/api_guides/X2Paddle/Caffe-Fluid.rst new file mode 100644 index 000000000..c3b078d29 --- /dev/null +++ b/doc/fluid/api_guides/X2Paddle/Caffe-Fluid.rst @@ -0,0 +1,45 @@ +.. _Caffe-Fluid: + +######################## +Caffe-Fluid常用层对应表 +######################## + +本文档梳理了Caffe常用Layer与PaddlePaddle API对应关系和差异分析。根据文档对应关系,有Caffe使用经验的用户,可根据对应关系,快速熟悉PaddlePaddle的接口使用。 + + +.. csv-table:: + :header: "序号", "Caffe Layer", "Fluid接口", "备注" + :widths: 1, 8, 8, 3 + + "1", "`AbsVal `_", ":ref:`cn_api_fluid_layers_abs`", "功能一致" + "2", "`Accuracy `_", ":ref:`cn_api_fluid_layers_accuracy`", "`差异对比 `_" + "3", "`ArgMax `_", ":ref:`cn_api_fluid_layers_argmax`", "`差异对比 `_" + "4", "`BatchNorm `_", ":ref:`cn_api_fluid_layers_batch_norm`", "`差异对比 `_" + "5", "`BNLL `_", ":ref:`cn_api_fluid_layers_softplus`", "功能一致" + "6", "`Concat `_", ":ref:`cn_api_fluid_layers_concat`", "功能一致" + "7", "`Convolution `_", ":ref:`cn_api_fluid_layers_conv2d`", "`差异对比 `_" + "8", "`Crop `_", ":ref:`cn_api_fluid_layers_crop`", "`差异对比 `_" + "9", "`Deconvolution `_", ":ref:`cn_api_fluid_layers_conv2d_transpose`", "`差异对比 `_" + "10", "`Dropout `_", ":ref:`cn_api_fluid_layers_dropout`", "`差异对比 `_" + "11", "`Eltwise `_", "无相应接口", "`Fluid实现 `_" + "12", "`ELU `_", ":ref:`cn_api_fluid_layers_elu`", "功能一致" + "13", "`EuclideanLoss `_", ":ref:`cn_api_fluid_layers_square_error_cost`", "`差异对比 `_" + "14", "`Exp `_", ":ref:`cn_api_fluid_layers_exp`", "`差异对比 `_" + "15", "`Flatten `_", ":ref:`cn_api_fluid_layers_reshape`", "`差异对比 `_" + "16", "`InnerProduct `_", ":ref:`cn_api_fluid_layers_fc`", "`差异对比 `_" + "17", "`Input `_", ":ref:`cn_api_fluid_layers_data`", "`差异对比 `_" + "18", "`Log `_", ":ref:`cn_api_fluid_layers_log`", "`差异对比 `_" + "19", "`LRN `_", ":ref:`cn_api_fluid_layers_lrn`", "`差异对比 `_" + "20", "`Pooling `_", ":ref:`cn_api_fluid_layers_pool2d`", "`差异对比 `_" + "21", "`Power `_", ":ref:`cn_api_fluid_layers_pow`", "`差异对比 `_" + "22", "`PReLU `_", ":ref:`cn_api_fluid_layers_prelu`", "功能一致" + "23", "`Reduction `_", "无相应接口", "`Fluid实现 `_" + "24", "`ReLU `_", ":ref:`cn_api_fluid_layers_leaky_relu`", "功能一致" + "25", "`Reshape `_", ":ref:`cn_api_fluid_layers_reshape`", "`差异对比 `_" + "26", "`SigmoidCrossEntropyLoss `_", ":ref:`cn_api_fluid_layers_sigmoid_cross_entropy_with_logits`", "`差异对比 `_" + "27", "`Sigmoid `_", ":ref:`cn_api_fluid_layers_sigmoid`", "功能一致" + "28", "`Slice `_", ":ref:`cn_api_fluid_layers_slice`", "`差异对比 `_" + "29", "`SoftmaxWithLoss `_", ":ref:`cn_api_fluid_layers_softmax_with_cross_entropy`", "`差异对比 `_" + "30", "`Softmax `_", ":ref:`cn_api_fluid_layers_softmax`", "`差异对比 `_" + "31", "`TanH `_", ":ref:`cn_api_fluid_layers_tanh`", "功能一致" + "32", "`Tile `_", ":ref:`cn_api_fluid_layers_expand`", "`差异对比 `_" diff --git a/doc/fluid/api_guides/X2Paddle/TensorFlow-Fluid.rst b/doc/fluid/api_guides/X2Paddle/TensorFlow-Fluid.rst new file mode 100644 index 000000000..b0e8a315f --- /dev/null +++ b/doc/fluid/api_guides/X2Paddle/TensorFlow-Fluid.rst @@ -0,0 +1,154 @@ +.. _TensorFlow-Fluid: + +############################### +TensorFlow-Fluid常用接口对应表 +############################### + +本文档基于TensorFlow v1.13梳理了常用API与PaddlePaddle API对应关系和差异分析。根据文档对应关系,有TensorFlow使用经验的用户,可根据对应关系,快速熟悉PaddlePaddle的接口使用。 + +.. csv-table:: + :header: "序号", "TensorFlow接口", "Fluid接口", "备注" + :widths: 1, 8, 8, 3 + + "1", "`tf.abs `_", ":ref:`cn_api_fluid_layers_abs`", "功能一致" + "2", "`tf.add `_", ":ref:`cn_api_fluid_layers_elementwise_add`", "功能一致" + "3", "`tf.argmax `_", ":ref:`cn_api_fluid_layers_argmax`", "功能一致" + "4", "`tf.argmin `_", ":ref:`cn_api_fluid_layers_argmin`", "功能一致" + "5", "`tf.assign `_", ":ref:`cn_api_fluid_layers_assign`", "功能一致" + "6", "`tf.assign_add `_", ":ref:`cn_api_fluid_layers_increment`", "功能一致" + "7", "`tf.case `_", ":ref:`cn_api_fluid_layers_Switch`", "`差异对比 `_" + "8", "`tf.cast `_", ":ref:`cn_api_fluid_layers_cast`", "功能一致" + "9", "`tf.clip_by_global_norm `_", ":ref:`cn_api_fluid_clip_GradientClipByGlobalNorm`", "`差异对比 `_" + "10", "`tf.clip_by_norm `_", ":ref:`cn_api_fluid_layers_clip_by_norm`", "`差异对比 `_" + "11", "`tf.clip_by_value `_", ":ref:`cn_api_fluid_layers_clip`", "功能一致" + "12", "`tf.concat `_", ":ref:`cn_api_fluid_layers_concat`", "功能一致" + "13", "`tf.cond `_", ":ref:`cn_api_fluid_layers_ifElse`", "功能一致" + "14", "`tf.constant `_", ":ref:`cn_api_fluid_layers_fill_constant`", "功能一致" + "15", "`tf.contrib.layers.batch_norm `_", ":ref:`cn_api_fluid_layers_batch_norm`", "功能一致" + "16", "`tf.contrib.layers.flatten `_", ":ref:`cn_api_fluid_layers_flatten`", "`差异对比 `_" + "17", "`tf.contrib.layers.fully_connected `_", ":ref:`cn_api_fluid_layers_fc`", "功能一致" + "18", "`tf.contrib.layers.one_hot_encoding `_", ":ref:`cn_api_fluid_layers_one_hot`", "功能一致" + "19", "`tf.contrib.layers.softmax `_", ":ref:`cn_api_fluid_layers_softmax`", "功能一致" + "20", "`tf.contrib.layers.xavier_initializer `_", ":ref:`cn_api_fluid_initializer_Xavier`", "功能一致" + "21", "`tf.contrib.rnn.GRUCell `_", ":ref:`cn_api_fluid_layers_gru_unit`", "`差异对比 `_" + "22", "`tf.contrib.rnn.MultiRNNCell `_", "无相应接口", "`Fluid实现 `_" + "23", "`tf.contrib.rnn.static_rnn `_", ":ref:`cn_api_fluid_layers_DynamicRNN`", "功能一致" + "24", "`tf.convert_to_tensor `_", ":ref:`cn_api_fluid_layers_assign`", "功能一致" + "25", "`tf.cos `_", ":ref:`cn_api_fluid_layers_cos`", "功能一致" + "26", "`tf.div `_", ":ref:`cn_api_fluid_layers_elementwise_div`", "功能一致" + "27", "`tf.divide `_", ":ref:`cn_api_fluid_layers_elementwise_div`", "功能一致" + "28", "`tf.dropout `_", ":ref:`cn_api_fluid_layers_dropout`", "`差异对比 `_" + "29", "`tf.equal `_", "`运算符== `_", "功能一致" + "30", "`tf.exp `_", ":ref:`cn_api_fluid_layers_exp`", "功能一致" + "31", "`tf.expand_dims `_", ":ref:`cn_api_fluid_layers_unsqueeze`", "`差异对比 `_" + "32", "`tf.fill `_", ":ref:`cn_api_fluid_layers_fill_constant`", "功能一致" + "33", "`tf.floor `_", ":ref:`cn_api_fluid_layers_floor`", "功能一致" + "34", "`tf.gather `_", ":ref:`cn_api_fluid_layers_gather`", "功能一致" + "35", "`tf.greater `_", "`运算符> `_", "功能一致" + "36", "`tf.greater_equal `_", "`运算符>= `_", "功能一致" + "37", "`tf.image.non_max_suppression `_", ":ref:`cn_api_fluid_layers_multiclass_nms`", "`差异对比 `_" + "38", "`tf.image.resize_bilinear `_", ":ref:`cn_api_fluid_layers_resize_bilinear`", "功能一致" + "39", "`tf.image.resize_images `_", ":ref:`cn_api_fluid_layers_image_resize`", "`差异对比 `_" + "40", "`tf.image.resize_nearest_neighbor `_", ":ref:`cn_api_fluid_layers_resize_nearest`", "功能一致" + "41", "`tf.is_finite `_", ":ref:`cn_api_fluid_layers_isfinite`", "`差异对比 `_" + "42", "`tf.layers.batch_normalization `_", ":ref:`cn_api_fluid_layers_batch_norm`", "功能一致" + "43", "`tf.layers.conv2d `_", ":ref:`cn_api_fluid_layers_conv2d`", "`差异对比 `_" + "44", "`tf.layers.dense `_", ":ref:`cn_api_fluid_layers_fc`", "`差异对比 `_" + "45", "`tf.layers.dropout `_", ":ref:`cn_api_fluid_layers_dropout`", "功能一致" + "46", "`tf.layers.Dropout `_", ":ref:`cn_api_fluid_layers_dropout`", "功能一致" + "47", "`tf.layers.flatten `_", ":ref:`cn_api_fluid_layers_flatten`", "功能一致" + "48", "`tf.less `_", "`运算符< `_", "功能一致" + "49", "`tf.less_equal `_", "`运算符<= `_", "功能一致" + "50", "`tf.log `_", ":ref:`cn_api_fluid_layers_log`", "功能一致" + "51", "`tf.logical_and `_", ":ref:`cn_api_fluid_layers_logical_and`", "功能一致" + "52", "`tf.logical_not `_", ":ref:`cn_api_fluid_layers_logical_not`", "功能一致" + "53", "`tf.logical_or `_", ":ref:`cn_api_fluid_layers_logical_or`", "功能一致" + "54", "`tf.losses.mean_squared_error `_", ":ref:`cn_api_fluid_layers_square_error_cost`", "`差异对比 `_" + "55", "`tf.losses.sigmoid_cross_entropy `_", ":ref:`cn_api_fluid_layers_sigmoid_cross_entropy_with_logits`", "`差异对比 `_" + "56", "`tf.losses.softmax_cross_entropy `_", ":ref:`cn_api_fluid_layers_softmax_with_cross_entropy`", "功能一致" + "57", "`tf.matmul `_", ":ref:`cn_api_fluid_layers_matmul`", "`差异对比 `_" + "58", "`tf.maximum `_", ":ref:`cn_api_fluid_layers_elementwise_max`", "功能一致" + "59", "`tf.metrics.accuracy `_", ":ref:`cn_api_fluid_layers_accuracy`", "功能一致" + "60", "`tf.metrics.mean `_", ":ref:`cn_api_fluid_layers_mean`", "功能一致" + "61", "`tf.minimum `_", ":ref:`cn_api_fluid_layers_elementwise_min`", "功能一致" + "62", "`tf.multiply `_", ":ref:`cn_api_fluid_layers_elementwise_mul`", "功能一致" + "63", "`tf.nn.avg_pool `_", ":ref:`cn_api_fluid_layers_pool2d`", "`差异对比 `_" + "64", "`tf.nn.batch_normalization `_", ":ref:`cn_api_fluid_layers_batch_norm`", "功能一致" + "65", "`tf.nn.bidirectional_dynamic_rnn `_", "无相应接口", "`Fluid实现 `_" + "66", "`tf.nn.conv2d `_", ":ref:`cn_api_fluid_layers_conv2d`", "`差异对比 `_" + "67", "`tf.nn.conv2d_transpose `_", ":ref:`cn_api_fluid_layers_conv2d_transpose`", "`差异对比 `_" + "68", "`tf.nn.conv3d_transpose `_", ":ref:`cn_api_fluid_layers_conv3d_transpose`", "`差异对比 `_" + "69", "`tf.nn.depthwise_conv2d `_", ":ref:`cn_api_fluid_layers_conv2d`", "`差异对比 `_" + "70", "`tf.nn.dynamic_rnn `_", ":ref:`cn_api_fluid_layers_DynamicRNN`", "`差异对比 `_" + "71", "`tf.nn.l2_normalize `_", ":ref:`cn_api_fluid_layers_l2_normalize`", "`差异对比 `_" + "72", "`tf.nn.leaky_relu `_", ":ref:`cn_api_fluid_layers_leaky_relu`", "功能一致" + "73", "`tf.nn.lrn `_", ":ref:`cn_api_fluid_layers_lrn`", "`差异对比 `_" + "74", "`tf.nn.max_pool `_", ":ref:`cn_api_fluid_layers_pool2d`", "`差异对比 `_" + "75", "`tf.nn.relu `_", ":ref:`cn_api_fluid_layers_relu`", "功能一致" + "76", "`tf.nn.relu6 `_", ":ref:`cn_api_fluid_layers_relu6`", "功能一致" + "77", "`tf.nn.rnn_cell.LSTMCell `_", ":ref:`cn_api_fluid_layers_lstm_unit`", "`差异对比 `_" + "78", "`tf.nn.separable_conv2d `_", "无相应接口", "`Fluid实现 `_" + "79", "`tf.nn.sigmoid `_", ":ref:`cn_api_fluid_layers_sigmoid`", "功能一致" + "80", "`tf.nn.sigmoid_cross_entropy_with_logits `_", ":ref:`cn_api_fluid_layers_sigmoid_cross_entropy_with_logits`", "功能一致" + "81", "`tf.nn.softmax `_", ":ref:`cn_api_fluid_layers_softmax`", "功能一致" + "82", "`tf.nn.softmax_cross_entropy_with_logits `_", ":ref:`cn_api_fluid_layers_softmax_with_cross_entropy`", "`差异对比 `_" + "83", "`tf.nn.softplus `_", ":ref:`cn_api_fluid_layers_softplus`", "功能一致" + "84", "`tf.nn.softsign `_", ":ref:`cn_api_fluid_layers_softsign`", "功能一致" + "85", "`tf.nn.tanh `_", ":ref:`cn_api_fluid_layers_tanh`", "功能一致" + "86", "`tf.one_hot `_", ":ref:`cn_api_fluid_layers_one_hot`", "`差异对比 `_" + "87", "`tf.ones `_", ":ref:`cn_api_fluid_layers_ones`", "功能一致" + "88", "`tf.ones_initializer `_", ":ref:`cn_api_fluid_initializer_Constant`", "功能一致" + "89", "`tf.pad `_", ":ref:`cn_api_fluid_layers_pad`", "`差异对比 `_" + "90", "`tf.placeholder `_", ":ref:`cn_api_fluid_layers_data`", "`差异对比 `_" + "91", "`tf.pow `_", ":ref:`cn_api_fluid_layers_pow`", "`差异对比 `_" + "92", "`tf.print `_", ":ref:`cn_api_fluid_layers_print`", "`差异对比 `_" + "93", "`tf.py_func `_", ":ref:`cn_api_fluid_layers_py_func`", "功能一致" + "94", "`tf.random_normal `_", ":ref:`cn_api_fluid_layers_gaussian_random`", "功能一致" + "95", "`tf.random_normal_initializer `_", ":ref:`cn_api_fluid_initializer_Normal`", "功能一致" + "96", "`tf.random_uniform `_", ":ref:`cn_api_fluid_layers_uniform_random`", "功能一致" + "97", "`tf.random_uniform_initializer `_", ":ref:`cn_api_fluid_initializer_UniformInitializer`", "功能一致" + "98", "`tf.reduce_logsumexp `_", "无相应接口", "`Fluid实现 `_" + "99", "`tf.reduce_max `_", ":ref:`cn_api_fluid_layers_reduce_max`", "功能一致" + "100", "`tf.reduce_mean `_", ":ref:`cn_api_fluid_layers_reduce_mean`", "功能一致" + "101", "`tf.reduce_min `_", ":ref:`cn_api_fluid_layers_reduce_min`", "功能一致" + "102", "`tf.reduce_sum `_", ":ref:`cn_api_fluid_layers_reduce_sum`", "功能一致" + "103", "`tf.reshape `_", ":ref:`cn_api_fluid_layers_reshape`", "`差异对比 `_" + "104", "`tf.reverse `_", ":ref:`cn_api_fluid_layers_reverse`", "功能一致" + "105", "`tf.reverse_sequence `_", ":ref:`cn_api_fluid_layers_sequence_reverse`", "`差异对比 `_" + "106", "`tf.reverse_v2 `_", ":ref:`cn_api_fluid_layers_reverse`", "功能一致" + "107", "`tf.round `_", ":ref:`cn_api_fluid_layers_round`", "功能一致" + "108", "`tf.rsqrt `_", "无相应接口", "`Fluid实现 `_" + "109", "`tf.scalar_mul `_", ":ref:`cn_api_fluid_layers_scale`", "功能一致" + "110", "`tf.scatter_update `_", ":ref:`cn_api_fluid_layers_scatter`", "`差异对比 `_" + "111", "`tf.sequence_mask `_", ":ref:`cn_api_fluid_layers_sequence_mask`", "功能一致" + "112", "`tf.shape `_", ":ref:`cn_api_fluid_layers_shape`", "功能一致" + "113", "`tf.sigmoid `_", ":ref:`cn_api_fluid_layers_sigmoid`", "功能一致" + "114", "`tf.sin `_", ":ref:`cn_api_fluid_layers_sin`", "功能一致" + "115", "`tf.slice `_", ":ref:`cn_api_fluid_layers_slice`", "`差异对比 `_" + "116", "`tf.split `_", ":ref:`cn_api_fluid_layers_split`", "`差异对比 `_" + "117", "`tf.sqrt `_", ":ref:`cn_api_fluid_layers_sqrt`", "功能一致" + "118", "`tf.square `_", ":ref:`cn_api_fluid_layers_square`", "功能一致" + "119", "`tf.squared_difference `_", "无相应接口", "`Fluid实现 `_" + "120", "`tf.squeeze `_", ":ref:`cn_api_fluid_layers_squeeze`", "功能一致" + "121", "`tf.stack `_", ":ref:`cn_api_fluid_layers_stack`", "功能一致" + "122", "`tf.stop_gradient `_", "无相应接口", "`Fluid实现 `_" + "123", "`tf.subtract `_", ":ref:`cn_api_fluid_layers_elementwise_sub`", "功能一致" + "124", "`tf.tanh `_", ":ref:`cn_api_fluid_layers_tanh`", "功能一致" + "125", "`tf.tile `_", ":ref:`cn_api_fluid_layers_expand`", "功能一致" + "126", "`tf.top_k `_", ":ref:`cn_api_fluid_layers_topk`", "`差异对比 `_" + "127", "`tf.train.AdagradOptimizer `_", ":ref:`cn_api_fluid_optimizer_AdagradOptimizer`", "功能一致" + "128", "`tf.train.AdamOptimizer `_", ":ref:`cn_api_fluid_optimizer_Adam`", "功能一致" + "129", "`tf.train.exponential_decay `_", ":ref:`cn_api_fluid_layers_exponential_decay`", "功能一致" + "130", "`tf.train.GradientDescentOptimizer `_", ":ref:`cn_api_fluid_optimizer_SGDOptimizer`", "功能一致" + "131", "`tf.train.MomentumOptimizer `_", ":ref:`cn_api_fluid_optimizer_MomentumOptimizer`", "功能一致" + "132", "`tf.train.polynomial_decay `_", ":ref:`cn_api_fluid_layers_polynomial_decay`", "功能一致" + "133", "`tf.train.RMSPropOptimizer `_", ":ref:`cn_api_fluid_optimizer_RMSPropOptimizer`", "功能一致" + "134", "`tf.transpose `_", ":ref:`cn_api_fluid_layers_transpose`", "功能一致" + "135", "`tf.truediv `_", ":ref:`cn_api_fluid_layers_elementwise_div`", "功能一致" + "136", "`tf.truncated_normal `_", ":ref:`cn_api_fluid_initializer_TruncatedNormal`", "功能一致" + "137", "`tf.truncated_normal_initializer `_", ":ref:`cn_api_fluid_initializer_TruncatedNormal`", "功能一致" + "138", "`tf.unstack `_", ":ref:`cn_api_fluid_layers_unstack`", "功能一致" + "139", "`tf.Variable `_", ":ref:`cn_api_fluid_layers_create_parameter`", "功能一致" + "140", "`tf.while_loop `_", ":ref:`cn_api_fluid_layers_While`", "`差异对比 `_" + "141", "`tf.zeros `_", ":ref:`cn_api_fluid_layers_zeros`", "功能一致" + "142", "`tf.zeros_initializer `_", ":ref:`cn_api_fluid_initializer_Constant`", "功能一致" diff --git a/doc/fluid/api_guides/index_cn.rst b/doc/fluid/api_guides/index_cn.rst index 01e9d93ba..ee81d9ef2 100755 --- a/doc/fluid/api_guides/index_cn.rst +++ b/doc/fluid/api_guides/index_cn.rst @@ -21,3 +21,5 @@ API分类检索 low_level/compiled_program.rst low_level/parameter.rst low_level/distributed/index.rst + X2Paddle/TensorFlow-Fluid.rst + X2Paddle/Caffe-Fluid.rst -- GitLab