\renewcommand{\[}{\begin{eqnarray}}
\renewcommand{\]}{\end{eqnarray}}

\newcommand{\bc}{\begin{center}}
\newcommand{\ec}{\end{center}}
\newcommand{\bi}{\begin{itemize}}
\newcommand{\ei}{\end{itemize}}
\newcommand{\be}{\begin{enumerate}}
\newcommand{\ee}{\end{enumerate}}

\newcommand{\eq}[1]{Eq. (\ref{#1})}
\newcommand{\Deriv}[2]{\frac{\partial{#1}}{\partial{#2}}}
\newcommand{\DDeriv}[3]{\frac{\partial^2{#1}}{\partial{#2}\partial{#3}}}
\newcommand{\argmin}{\mbox{\rm arg}\hspace{-2pt}\min}
\newcommand{\argmax}{\mbox{\rm arg}\hspace{-2pt}\max}
\newcommand{\sign}{\mbox{\rm sign}}

\newcommand{\ave}[1]{\left\langle\,{#1}\,\right\rangle}
\newcommand{\kldiv}[2]{KL\left(\,{#1}\,\|\,{#2}\,\right)}

\newcommand{\E}[1]{{\mbox{\bf E}\left[{#1}\right]}}
\newcommand{\Ep}[2]{{{\mbox{\bf E}}_{#1}\left[{#2}\right]}}
\newcommand{\PR}[1]{{\Pr\left({#1}\right)}}
\newcommand{\NN}[2]{{{\cal N}\left({#1},{#2}\right)}}

\newcommand{\data}{{\text{data}}}

\newcommand{\ra}{\rightarrow}
\newcommand{\la}{\leftarrow}
\newcommand{\Ra}{\Rightarrow}
\newcommand{\La}{\Leftarrow}

\newcommand{\R}{{\mathcal R}}
\newcommand{\HH}{{\mathcal H}}

% ----- new definitions ------

\newcommand{\comment}[1]{}

\newcommand{\const}{\mbox{\rm{const.}}}

\newcommand{\bx}{{\bf{x}}}
\newcommand{\cX}{{\cal{X}}}
\newcommand{\cY}{{\cal{Y}}}
\newcommand{\bw}{{\bf{w}}}
\newcommand{\Loss}{\mbox{Loss}}


\newcommand{\twovector}[2]{
\left[\begin{array}{l}
{#1}\\
{#2}
\end{array}\right]
}

\newcommand{\twomatrix}[4]{
\left[\begin{array}{ll}
{#1} & {#2}\\
{#3} & {#4}
\end{array}\right]
}

\newcommand{\threevector}[3]{
\left[\begin{array}{l}
{#1}\\
{#2}\\
{#3}
\end{array}\right]
}

\newcommand{\threematrix}[9]{
\left[\begin{array}{rrr}
{#1} & {#2} & {#3}\\
{#4} & {#5} & {#6}\\
{#7} & {#8} & {#9}
\end{array}\right]
}

\newcommand{\twothreematrix}[6]{
\left[\begin{array}{rrr}
{#1} & {#2} & {#3}\\
{#4} & {#5} & {#6}
\end{array}\right]
}

\newcommand{\threetwomatrix}[6]{
\left[\begin{array}{rr}
{#1} & {#2} \\
{#3} & {#4} \\
{#5} & {#6} 
\end{array}\right]
}

\newcommand{\score}[1]{{\rmfamily \it {\bf Scoring:} {#1}}}
\newenvironment{answer}{\begin{quotation}\noindent\textbf{Answer:}\sffamily}{\end{quotation}}
\newenvironment{notes}{\sffamily\slshape}{}

\newcommand{\dbrac}[1]{
\mbox{$[\hspace{-0.25ex}[$}
{#1}
\mbox{$]\hspace{-0.2ex}]$}
}

\newcounter{qnum}
\newcommand{\problem}[1]{\section*{#1}\setcounter{qnum}{0}}
\newenvironment{question}{\stepcounter{qnum}\begin{enumerate}\setcounter{enumi}{-1}\addtocounter{enumi}{\value{qnum}}
\item}{\end{enumerate}}
