提交 1c9fc655 编写于 作者: Q qiaolongfei

update

上级 e2783bb6
...@@ -603,7 +603,7 @@ def prior_box(input, ...@@ -603,7 +603,7 @@ def prior_box(input,
offset=0.5, offset=0.5,
name=None): name=None):
""" """
**Prior box operator** **Prior Box Operator**
Generate prior boxes for SSD(Single Shot MultiBox Detector) algorithm. Generate prior boxes for SSD(Single Shot MultiBox Detector) algorithm.
Each position of the input produce N prior boxes, N is determined by Each position of the input produce N prior boxes, N is determined by
...@@ -632,12 +632,15 @@ def prior_box(input, ...@@ -632,12 +632,15 @@ def prior_box(input,
name(str): Name of the prior box op. Default: None. name(str): Name of the prior box op. Default: None.
Returns: Returns:
boxes(Variable): the output prior boxes of PriorBox. tuple: A tuple with two Variable (boxes, variances)
boxes: the output prior boxes of PriorBox.
The layout is [H, W, num_priors, 4]. The layout is [H, W, num_priors, 4].
H is the height of input, W is the width of input, H is the height of input, W is the width of input,
num_priors is the total num_priors is the total
box count of each position of input. box count of each position of input.
Variances(Variable): the expanded variances of PriorBox.
variances: the expanded variances of PriorBox.
The layout is [H, W, num_priors, 4]. The layout is [H, W, num_priors, 4].
H is the height of input, W is the width of input H is the height of input, W is the width of input
num_priors is the total num_priors is the total
...@@ -646,7 +649,8 @@ def prior_box(input, ...@@ -646,7 +649,8 @@ def prior_box(input,
Examples: Examples:
.. code-block:: python .. code-block:: python
box, var = prior_box(
box, var = fluid.layers.prior_box(
input=conv1, input=conv1,
image=images, image=images,
min_sizes=[100.], min_sizes=[100.],
...@@ -721,11 +725,9 @@ def multi_box_head(inputs, ...@@ -721,11 +725,9 @@ def multi_box_head(inputs,
stride=1, stride=1,
name=None): name=None):
""" """
**Prior_boxes**
Generate prior boxes for SSD(Single Shot MultiBox Detector) Generate prior boxes for SSD(Single Shot MultiBox Detector)
algorithm. The details of this algorithm, please refer the algorithm. The details of this algorithm, please refer the
section 2.2 of SSD paper (SSD: Single Shot MultiBox Detector) section 2.2 of SSD paper `SSD: Single Shot MultiBox Detector
<https://arxiv.org/abs/1512.02325>`_ . <https://arxiv.org/abs/1512.02325>`_ .
Args: Args:
...@@ -766,24 +768,27 @@ def multi_box_head(inputs, ...@@ -766,24 +768,27 @@ def multi_box_head(inputs,
name(str): Name of the prior box layer. Default: None. name(str): Name of the prior box layer. Default: None.
Returns: Returns:
mbox_loc(Variable): The predicted boxes' location of the inputs. tuple: A tuple with four Variables. (mbox_loc, mbox_conf, boxes, variances)
The layout is [N, H*W*Priors, 4]. where Priors
is the number of predicted boxes each position of each input. mbox_loc: The predicted boxes' location of the inputs. The layout
mbox_conf(Variable): The predicted boxes' confidence of the inputs. is [N, H*W*Priors, 4]. where Priors is the number of predicted
The layout is [N, H*W*Priors, C]. where Priors boxes each position of each input.
is the number of predicted boxes each position of each input
and C is the number of Classes. mbox_conf: The predicted boxes' confidence of the inputs. The layout
boxes(Variable): the output prior boxes of PriorBox. is [N, H*W*Priors, C]. where Priors is the number of predicted boxes
The layout is [num_priors, 4]. num_priors is the total each position of each input and C is the number of Classes.
box count of each position of inputs.
Variances(Variable): the expanded variances of PriorBox. boxes: the output prior boxes of PriorBox. The layout is [num_priors, 4].
The layout is [num_priors, 4]. num_priors is the total num_priors is the total box count of each position of inputs.
box count of each position of inputs
variances: the expanded variances of PriorBox. The layout is
[num_priors, 4]. num_priors is the total box count of each position of inputs
Examples: Examples:
.. code-block:: python .. code-block:: python
mbox_locs, mbox_confs, box, var = layers.multi_box_head(
mbox_locs, mbox_confs, box, var = fluid.layers.multi_box_head(
inputs=[conv1, conv2, conv3, conv4, conv5, conv5], inputs=[conv1, conv2, conv3, conv4, conv5, conv5],
image=images, image=images,
num_classes=21, num_classes=21,
......
...@@ -163,8 +163,6 @@ def polynomial_decay(learning_rate, ...@@ -163,8 +163,6 @@ def polynomial_decay(learning_rate,
power=1.0, power=1.0,
cycle=False): cycle=False):
""" """
**Polynomial Decay**
Applies polynomial decay to the initial learning rate. Applies polynomial decay to the initial learning rate.
.. code-block:: python .. code-block:: python
...@@ -178,14 +176,14 @@ def polynomial_decay(learning_rate, ...@@ -178,14 +176,14 @@ def polynomial_decay(learning_rate,
Args: Args:
learning_rate(Variable|float32): A scalar float32 value or a Variable. This learning_rate(Variable|float32): A scalar float32 value or a Variable. This
will be the initial learning rate during training will be the initial learning rate during training.
decay_steps(int32): A Python `int32` number. decay_steps(int32): A Python `int32` number.
end_learning_rate(float, Default: 0.0001): A Python `float` number. end_learning_rate(float): A Python `float` number.
power(float, Default: 1.0): A Python `float` number power(float): A Python `float` number.
cycle(bool, Default: False): Boolean. If set true, decay the learning rate every decay_steps. cycle(bool): If set true, decay the learning rate every decay_steps.
Returns: Returns:
The decayed learning rate Variable: The decayed learning rate
""" """
global_step = _decay_step_counter() global_step = _decay_step_counter()
......
...@@ -40,14 +40,14 @@ __all__ = [ ...@@ -40,14 +40,14 @@ __all__ = [
def create_tensor(dtype, name=None, persistable=False): def create_tensor(dtype, name=None, persistable=False):
""" """
**Create a Tensor** Create an variable, which will hold a LoDTensor with data type dtype.
Args: Args:
dtype (string): 'float32'|'int32'|..., the data type of the dtype(string): 'float32'|'int32'|..., the data type of the
created tensor. created tensor.
name (string, Default: None): The name of the created tensor, if not set, name(string): The name of the created tensor, if not set,
the name will be a random unique one. the name will be a random unique one.
persistable (bool, Default: False): Set the persistable flag of the create tensor. persistable(bool): Set the persistable flag of the create tensor.
Returns: Returns:
Variable: The tensor variable storing the created tensor. Variable: The tensor variable storing the created tensor.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册