# How to draw a hyperplane using the weights calculated

In the simple example where I have n input neurons, I can consider this to be a point in a n-dimensional space.

If the output layer is just one neuron with value 0 or 1, if I get convergence, the neural net should define a hyperplane dividing the two classes of points - those mapped to 0 and those mapped to 1. How do I calculate this hyperplane using the (n,1) matrix of weights I calculated?

## 2 Answers

If you have only an input layer, one set of weights, and an output layer, you can solve this directly with $$X \cdot w = threshold$$

However if you add in hidden layers, you no longer necessarily have a hyperplane, as in order to be a hyperplane it must be able to be expressed as the "solution of a single algebraic equation of degree 1."

Even if you can't solve directly, you can still get a sense for the response surface by evaluating your network's output over a wide range of inputs.

I think a better to way to think about a neural net as you have it written is that it is a function.

$$f_{nn} : \mathbb{R}^n \rightarrow \{0, 1\}$$

which is generally a non-linear decision boundary. You did not indicate your network structure and activation function. If your data is linearly separable then a single layer perceptron will define weights for you in the input layer, plus a bias input node for the intercept.

If you specifically want a separating hyperplane you could consider support vector machines. See here.

https://stackoverflow.com/a/8021219/431895