# [GitHub] incubator-madlib pull request #162: MLP: Multilayer Perceptron Phase 2

Github user njayaram2 commented on a diff in the pull request:

--- Diff: doc/design/modules/neural-network.tex ---
@@ -46,41 +47,49 @@ \subsection{Formal Description}
In the remaining part of this section, we will give a formal description
of the derivation of objective function and its gradient.

\paragraph{Objective function.}
-We mostly follow the notations in example 1.5.3 from Bertsekas
\cite{bertsekas1999nonlinear}, for a multilayer perceptron that has $N$ layers
(stages), and the $k$th stage has $n_k$ activation units ($\phi : \mathbb{R} \to \mathbb{R}$), the objective function is given as
-$f_{(y, z)}(u) = \frac{1}{2} \|h(u, y) - z\|_2^2,$
-where $y \in \mathbb{R}^{n_0}$ is the input vector, $z \in \mathbb{R}^{n_N}$ is the output vector,
+We mostly follow the notations in example 1.5.3 from Bertsekas
\cite{bertsekas1999nonlinear}, for a multilayer perceptron that has $N$ layers
(stages), and the $k$th stage has $n_k$ activation units ($\phi : \mathbb{R} \to \mathbb{R}$), the objective function for regression is given as
+$f_{(x, y)}(u) = \frac{1}{2} \|h(u, x) - y\|_2^2,$
+and for classification the objective function is given as
+$f_{(x, y)}(u) = \sum_i (\log(h_i(u, x)) * z_i + (1-\log(h_i(u, x))) *( 1- z_i) ,$
+where $x \in \mathbb{R}^{n_0}$ is the input vector, $y \in \mathbb{R}^{n_N}$ is the output vector (one hot encoded for classification),
\footnote{Of course, the objective function can be defined over a set of
input-output vector pairs, which is simply given as the addition of the above
$f$.}
and the coefficients are given as
--- End diff --

Change classification),\n
\footnote{
to classification),~\footnote{

Similar comment for the second footnote too.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---