Given the matrix $\mathbf{W} \in \mathbb{R}^{N \times N}$ and the vector $\mathbf{y} \in \{\pm 1\}^N$, how to solve
$$\min_{\mathbf{x}\in \{\pm 1\}^N} \left\| \operatorname{sign}(\mathbf{Wx}) - \mathbf{y} \right\|_2^2$$
where $\operatorname{sign}(\cdot)$ is applied elementwise to a vector?
I have tried $\mathbf{x} = \operatorname{sign}\left(\mathbf{W}^{-1}\mathbf{y}\right)$ and $\mathbf{x} = \operatorname{sign}\left(\mathbf{W}^{T}\mathbf{y}\right)$ but found they don't work well.
This optimization problem was formulated while reading literature on neural networks, namely, Hopfield networks.
\|
doesn't indicate whether it is opening or closing, and so spaces poorly with\operatorname
d operators. Consider, for example, $\|\operatorname{sign}(\cdot)\|$\|\operatorname{sign}(\cdot)\|
vs. $\lVert\operatorname{sign}(\cdot)\rVert$\lVert\operatorname{sign}(\cdot)\rVert
. I edited accordingly. This effect can also be accomplished with\left\|
and\right\|
, as you did in the body, but that can have a jarring effect: e.g., $\displaystyle\left\|a_{\frac1 2}\right\|$ is too big for many people. $\endgroup$