Answers.Body: <p>Basic feed forward neural nets (MLPs) are essentially just computing sequences of matrix multiplications (with nonlinear activations in between), so this is in fact easy to code &quot;directly&quot; like you mentioned. The more difficult part is computing the gradients with respect to the parameter matrices (usually with backpropagation). However there really isn't anything that fancy behind the basic neural network model, it really is just sequences of simple blocks.</p>
  <p>You certainly want at least one hidden layer usually, because without it you'll just have a generalized linear model. Neural networks are useful for creating arbitrarily nonlinear models, which can be achieved by adding more layers or more neurons per layer.</p>
  <p>If you want some clarification about how to code a neural net, I recommend taking the classic Andrew Ng ML course on Coursera.</p>
  <p>With regard to the amount of layers, number of neurons, etc, these are hyperparameters -- there is no known way to determine the correct values for them without experimentation.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-05T14:45:34.747Z
Answers.LastActivityDate: 2021-06-05T14:45:34.747Z
Answers.UserDisplayName: harwiltz
Body: <p>I am a little confused on how, you can find online <em>papers</em> that describe complex Machine Learning formulas in a mathematical/probabilistic way, and, in the other hands, <em>easy tutorials</em> that teach you how to use frameworks to create neural networks, without mentioning the maths behind.</p>
  <p>What is not clear is, what is the correlation between these two worlds? What are the &quot;parameters&quot; that make you understand i.e. how many layer to code, what kind of perceptrons to use, etc?</p>
  <p>to make an example:</p>
  <p>Let's take this formula, which in Wikipedia Italy is described as &quot;the standard learning algorytm&quot;:</p>
  <p><a href="https://i.sstatic.net/JGHmp.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/JGHmp.png" alt="enter image description here" /></a></p>
  <p>And suppose that size of <code>w</code> and x is <code>4</code>. , and g(x) and f(x) are, for examples, linear functions.
  What next? Where do I start coding a neural network that solves this problem?</p>
  <p>It would seem more logical to me to code this &quot;directly&quot; without defining perceptrons, convolution, layers etc.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-06-05T05:11:23.120Z
Comments.Text: Hi @Barsaas. Please include your main question in the title
Comments.UserDisplayName: mugoh
Tags: <neural-networks><machine-learning><math><definitions>
Title: how to go from mathematical problem to neural network (and back)?
UserDisplayName: Barsaas
ThreadText: # how to go from mathematical problem to neural network (and back)?
  
  (Asked by: username_0 on 2021-06-04)
  
  I am a little confused on how, you can find online *papers* that describe complex Machine Learning formulas in a mathematical/probabilistic way, and, in the other hands, *easy tutorials* that teach you how to use frameworks to create neural networks, without mentioning the maths behind.
  
  What is not clear is, what is the correlation between these two worlds? What are the "parameters" that make you understand i.e. how many layer to code, what kind of perceptrons to use, etc?
  
  to make an example:
  
  Let's take this formula, which in Wikipedia Italy is described as "the standard learning algorytm":
  
  [![enter image description here](https://i.sstatic.net/JGHmp.png)](https://i.sstatic.net/JGHmp.png)
  
  And suppose that size of `w` and x is `4`. , and g(x) and f(x) are, for examples, linear functions.
  What next? Where do I start coding a neural network that solves this problem?
  
  It would seem more logical to me to code this "directly" without defining perceptrons, convolution, layers etc.
  
  **Tags:** neural-networks, machine-learning, math, definitions
  
  > **Comments:**
  > **username_1**: Hi @username_0. Please include your main question in the title  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2021-06-05. Score: 0
  
  Basic feed forward neural nets (MLPs) are essentially just computing sequences of matrix multiplications (with nonlinear activations in between), so this is in fact easy to code "directly" like you mentioned. The more difficult part is computing the gradients with respect to the parameter matrices (usually with backpropagation). However there really isn't anything that fancy behind the basic neural network model, it really is just sequences of simple blocks.
  
  You certainly want at least one hidden layer usually, because without it you'll just have a generalized linear model. Neural networks are useful for creating arbitrarily nonlinear models, which can be achieved by adding more layers or more neurons per layer.
  
  If you want some clarification about how to code a neural net, I recommend taking the classic Andrew Ng ML course on Coursera.
  
  With regard to the amount of layers, number of neurons, etc, these are hyperparameters -- there is no known way to determine the correct values for them without experimentation.
  
  
  ---
  
  