# Single artificial neuron easily extendable to neural network

I'm working on implementation of artificial neuron which be extended to neural net. I want do implementation by myself to fully understand how it works. I start with perceptron with threshold activation function:

and then questions come along

• can implementaion be change to operate with more than 2 classes?
• if I build network with few layers, first (and nexts) layers should return predicted class or value from first layer?
• Is better artificial neuron to build neural net than perceptron?

• The implementation can be changed for more than two classes. You can either use two neurons or you can use the following structure: $$f(x)=\left\{\array{2 & \textrm{if} \;wx+b>0\\ 1 & \textrm{if} \; wx+b\leq 0 \; \textrm{and}\;ux+c>0\\ 0 & \textrm{otherwise} \\ }\right.$$ where $u$ is of the same size as $w$ and $c$ is a scalar.