@@ -297,7 +296,7 @@ All the gradient check unit tests are located in :code:`paddle/gserver/tests/tes
...
@@ -297,7 +296,7 @@ All the gradient check unit tests are located in :code:`paddle/gserver/tests/tes
+ each inputs needs to call :code:`config.layerConfig.add_inputs();` once.
+ each inputs needs to call :code:`config.layerConfig.add_inputs();` once.
+ call :code:`testLayerGrad` to perform gradient checks. It has the following arguments.
+ call :code:`testLayerGrad` to perform gradient checks. It has the following arguments.
- layer and input configurations. (:code:`config` in our example)
- layer and input configurations. (:code:`config` in our example)
- type of the input. (:code:`fc` in our example)
- type of the layer. (:code:`fc` in our example)
- batch size of the gradient check. (100 in our example)
- batch size of the gradient check. (100 in our example)
- whether the input is transpose. Most layers need to set it to :code:`false`. (:code:`false` in our example)
- whether the input is transpose. Most layers need to set it to :code:`false`. (:code:`false` in our example)
- whether to use weights. Some layers or activations perform normalization so that the sum of their output is a constant. For example, the sum of output of a softmax activation is one. In this case, we cannot correctly compute the gradients using regular gradient check techniques. A weighted sum of the output, which is not a constant, is utilized to compute the gradients. (:code:`true` in our example, because the activation of a fully connected layer can be softmax)
- whether to use weights. Some layers or activations perform normalization so that the sum of their output is a constant. For example, the sum of output of a softmax activation is one. In this case, we cannot correctly compute the gradients using regular gradient check techniques. A weighted sum of the output, which is not a constant, is utilized to compute the gradients. (:code:`true` in our example, because the activation of a fully connected layer can be softmax)
...
@@ -310,7 +309,7 @@ All the gradient check unit tests are located in :code:`paddle/gserver/tests/tes
...
@@ -310,7 +309,7 @@ All the gradient check unit tests are located in :code:`paddle/gserver/tests/tes