Finding the decision boundary function for a very basic neural network

56 Views Asked by At

I have a simple neural network and want to draw its decision boundary. 2 input neurons(x,y), 3 hidden neurons, and 2 output neurons. So essentially drawing a line for outputNeuron1 - outputNeuron2 = zero. Like this: https://www.desmos.com/calculator/9lccqzsnoy

I am trying to code this myself and to get the points through which I can draw a line, I thought I would try to rewrite outputNeuron1 - outputNeuron2 = 0 into a 'y=' function. I am trying to do this with a linear activation function first because it's easier. So I manually found:My Calculations

My question is: How can I convert the matrix for the two output neurons into a function since doing this manually means I can't have the user define how many hidden layers(and their sizes) and outputNeurons there are. Any help is appreciated!

I already posted a similar question on StackOverflow, but I was told this is more of a math problem than a coding problem. Please let me know if I've done something wrong in the calculations :)

1

There are 1 best solutions below

0
On

I found the answer I was looking for: Answer

For anyone who stumbles upon this and wonders how to code it: https://stackoverflow.com/questions/61716179/how-do-i-graph-a-b-0