I originally asked this on AI StackExchange here, but since it's an algorithm question it might be more suitable here.
I have a shape on a 2D plane, and I want to draw a neural network to detect if a point (x,y) is within the shape, or outside the shape.
As a test, let's say I have a rectangle, who's four points are bound by:
(1,3), (2,3), (1,1) and (2,1).
The equations for the lines of this shape are:
x=2
x=1
y=1
y=3
My ultimate question is how do I convert this into a set of weights and thresholds in a neural network. For the algorithm, I was thinking my neural network will have 2 input neurons (one for each x co-ordinate and one for y), and then a hidden layer with two neurons, and then an output layer with one neuron descibing 'is in the rectangle, or not'. So it's a fully connected network?
I was thinking I want the values that will be within the shape to be:
1 ≤ x ≤ 2 (I want x to be between 1 and 2) AND
1 ≤ y ≤ 3 (I want y to be between 1 and 3)
But I don't understand how to actually convert this into weights and thresholds? I have come across the equation
y = -(Wx/Wx)x - (Wb/Wy)
...but without y values in this case, I'm not sure how this applies? I would like to solve this example, but using a method that would be applicable to other shapes (e.g. a cube or a triangle).
Update 1: Similar to the way you can draw a perceptron for an AND/NOT etc gate manually, I want to translate a 2D shape to a NN manually so I can understand the process.
So at the minute I have a NN with three input nodes (X, Y and B), and four hidden nodes in one layer (one for each line of rectangle). But given a rectangle, I don't know how to solve for equation of line for say the line (3,3) (3,6), because the slope is undefined (6-3/3-3), so then I don't know how that slots into y=-Wx/Wy(x) - Wb/Wy to work out weights and bias.