From 5fff20c21a1199f560a4d014b5a81decf3fce9e9 Mon Sep 17 00:00:00 2001 From: minqiyang Date: Fri, 14 Dec 2018 17:29:00 +0800 Subject: [PATCH] Change name to huber loss test=develop --- paddle/fluid/API.spec | 2 +- python/paddle/fluid/layers/nn.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/paddle/fluid/API.spec b/paddle/fluid/API.spec index c152a506d..3ecc7af23 100644 --- a/paddle/fluid/API.spec +++ b/paddle/fluid/API.spec @@ -199,7 +199,7 @@ paddle.fluid.layers.merge_selected_rows ArgSpec(args=['x', 'name'], varargs=None paddle.fluid.layers.get_tensor_from_selected_rows ArgSpec(args=['x', 'name'], varargs=None, keywords=None, defaults=(None,)) paddle.fluid.layers.lstm ArgSpec(args=['input', 'init_h', 'init_c', 'max_len', 'hidden_size', 'num_layers', 'dropout_prob', 'is_bidirec', 'is_test', 'name', 'default_initializer', 'seed'], varargs=None, keywords=None, defaults=(0.0, False, False, None, None, -1)) paddle.fluid.layers.psroi_pool ArgSpec(args=['input', 'rois', 'output_channels', 'spatial_scale', 'pooled_height', 'pooled_width', 'name'], varargs=None, keywords=None, defaults=(None,)) -paddle.fluid.layers.huber_regression_loss ArgSpec(args=['input', 'label', 'delta'], varargs=None, keywords=None, defaults=None) +paddle.fluid.layers.huber_loss ArgSpec(args=['input', 'label', 'delta'], varargs=None, keywords=None, defaults=None) paddle.fluid.layers.data ArgSpec(args=['name', 'shape', 'append_batch_size', 'dtype', 'lod_level', 'type', 'stop_gradient'], varargs=None, keywords=None, defaults=(True, 'float32', 0, VarType.LOD_TENSOR, True)) paddle.fluid.layers.open_files ArgSpec(args=['filenames', 'shapes', 'lod_levels', 'dtypes', 'thread_num', 'buffer_size', 'pass_num', 'is_test'], varargs=None, keywords=None, defaults=(None, None, 1, None)) paddle.fluid.layers.read_file ArgSpec(args=['reader'], varargs=None, keywords=None, defaults=None) diff --git a/python/paddle/fluid/layers/nn.py b/python/paddle/fluid/layers/nn.py index 28cb700f8..9922b3370 100644 --- a/python/paddle/fluid/layers/nn.py +++ b/python/paddle/fluid/layers/nn.py @@ -174,7 +174,7 @@ __all__ = [ 'get_tensor_from_selected_rows', 'lstm', 'psroi_pool', - 'huber_regression_loss', + 'huber_loss', ] kIgnoreIndex = -100 @@ -9180,7 +9180,7 @@ def psroi_pool(input, return out -def huber_regression_loss(input, label, delta): +def huber_loss(input, label, delta): """ Huber regression loss is a loss function used in robust regression. Huber regression loss can evaluate the fitness of input to label. @@ -9212,9 +9212,9 @@ def huber_regression_loss(input, label, delta): .. code-block:: python predictions = fluid.layers.softmax(x) - loss = fluid.layers.huber_regression_loss(input=predictions, label=label, 1.0) + loss = fluid.layers.huber_loss(input=predictions, label=label, 1.0) """ - helper = LayerHelper('huber_regression_loss', **locals()) + helper = LayerHelper('huber_loss', **locals()) residual = helper.create_variable_for_type_inference( dtype=helper.input_dtype()) out = helper.create_variable_for_type_inference(dtype=helper.input_dtype()) -- GitLab