Implement a simple neural network in C# .NET — Part 1

Deepak Battini
Coinmonks

--

Last article “function of a neuron“, we saw how an artificial neuron is functioning with manual training on AND gate data. We saw that after 6th iteration a simple network learned and is now capable of predicting. Let’s put together the learning in the form of code and do it programmatically. I will divide this post into two parts:

  1. Create the neural network structure
  2. Train with AND gate data using backpropagation algorithm

The idea of this building from scratch is to get to know more via code and not the intention to build another deep learning library. There are many libraries which do the job for you, and we will talk about those later by building more complex network and train with lots of data (CSV and images). The idea of this post of to make the concept more clear which will help build more knowledge with the already available libraries for deep learning.

Before going into the code and divide it into various classes and function, let see the below diagram again. We will use some notion from the below diagram while building your own first neural network program.

Pulse

A pulse is an electric signal passing through the dendrite of neuron which forms the basis of data (value stored in double datatype). Below is the simple…

--

--

Deepak Battini
Coinmonks

Programmer and founder of blazorly.com. passionate open-source contributor, loves to combine cutting-edge tech expertise.