# Help me to understand AI neural networks basics please [closed]

I have read some about AI and I know these bubble graphs and how they supposed to work, the different training concepts ect.

But I totally fail to understand, how to put it in code. Most explainations about AI are high level, how the concept works and so on but not how to actually code it.

I would like to start experimenting myself but I don't know where to start. Are the neurons functions? Variables? Loops?

In python they often use tensor flow but I have difficulties to use something when I don't understand how it's constructed under the hood.

What are simple examples to start trying myself for learning purposes?

## closed as too broad by Djib2011, malioboro, DuttaA, nbro, kenorbSep 6 at 8:55

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• There are multiple sources online, I'd suggest googling "neural network from scratch" if you're looking for a better low-level understanding on how they work. – Djib2011 Aug 30 at 22:51
• if you really want to understand neural network, you can try to code it from scratch as mentioned by @Djib2011. If you want to implement easily, you can try to learn scikit-learn, there is a package called MLPClassifier which is a simple neural network package. – malioboro Aug 31 at 1:22
• @Djib2011 I read a little around and there are quite a few examples... but I still struggle to understand them. Like when you have an NN that gets a random set of [0,1,0,1,1] and it spits out something between 0 and 1... what's the purpose? I don't understand how to actually do something with that. – user6329530 Sep 3 at 10:21

A simple way to gain understanding about neural networks is to, first, understand the Inference part.

Forget about complex neural network architectures like CNNs and RNNs. First try to understand how inference happens step by step in a fully connected multi-layer neural network.

Further, to start with, you should try to understand how a single neuron works. Then it's all about connecting many neurons to form a layer and then creating multiple such layers. Then it will become the bubble graph like you mentioned.

Yes, you can think neurons as functions. It first performs the following operation on inputs and weights.

$$\sum_{i=1}^n w_i x_i$$

Then, the neuron also applies some kind of activation function on the result like tanh, sigmoid, RELU to get y. So, for each bubble in your bubble graph, you perform the following two operations,

• A sigma operation on weights and inputs

• Activation on the result of first step.

Don't get confused by the equations shown in literature. Literature mostly uses linear algebra to convert all the above operations into simple matrix multiplications.

If you understand a forward pass, the operation that happens during inference, understanding backward pass that also happens along with forward pass in training is the next level. But, as the name indicates, to simply put, forward pass works from input to output and backward pass works from output to input.

Note: To simplify things, I have avoided using biases.

• Thank you. The problem for me is always that I struggle learning theoretically. I need to experiment and learn while doing. I don't know how to put inputs and weights into code. That's why I need simple, practical examples that I can play around with. – user6329530 Aug 31 at 11:18
• "I don't know how to put inputs and weights into code". Then you just need to read a lot of resources, and take weeks of reading efforts. We don't know your mathematical education, and you need some of it to understand machine learning techniques (including NN) – Basile Starynkevitch Sep 6 at 5:41
• @user6329530. Like i mentioned in my answer, first try to understand how single neuron works. Then you can expand it to neural networks. Don't get bogged down by the problems AI/ML are solving. If you try to see what it actually doing, its just multiply and accumulate weights and inputs. That's all it does. I suggest you read this article which just says how to emulate logic gates (and/or) with simple neural nets. towardsdatascience.com/… – Kartik Podugu Sep 6 at 15:39

I think you should go in a top-down approach, I mean first you need to implement a neural network and see it working and then you can start going into the details(the depth to which you want to go depends on the individual).This approach worked for me.

I suggest you trying out the MNIST hand written digit classification problem which I guess is a hello world problem in Neural networks. This is a 28x28 image of a number and the task of the neural network is to recognize them. To try out this problem you need very basic knowledge in computer vision and some mathematics.