mlp function

Single layer neural network