Ann 1
Ann 1
Sign up to join this community The best answers are voted up and
rise to the top
Closed. This question needs details or clarity. It is not currently accepting answers.
1 Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
I'm working on a covid-19 dataset, and I'm interested in using the Artificial Neural Network
(ANN) to measure the effect of some independent variables namely: confirmed cases, new
cases, and total deaths on the response variable new deaths. The attached is the output using
R Kindly explain how to explain this output, it does not look like the normal linear regression
I'm familiar with.
.
Share Cite Improve this question Follow asked Sep 24, 2020 at 11:04
Seyi
121 4
4 It does not look like the normal linear regression because it is not a linear regression. If you want to
use neural nets you will have to learn, what they are. It will be really hard to answer your question
withouht further indication, what knowledge of neural nets you already have so one can built upon that.
– Bernhard Sep 24, 2020 at 12:17
Let's simplify your figure and understand at a more generalized level. This neural network has
three layers: Input, Hidden and Output. Each layer has multiple neurons whose activations are
3 determined by:
Now coming back to the figure you have provided, here are some example of weights and
biases using my notation:
2
θ = 0.35826
1,1
2
θ = −6.11547
2,1
3
θ = −2.24362
3,1
2
b = 0.85928
1
3
b = 0.01803
1
and so on...
Now that we know what each symbol means let's write some equations to get activation of
each neuron. Let's assume a tanh activation function.
2 2
h1 = tanh(θ x1 + θ x2
1,1 2,1
2 2 2
+ θ x3 + b ) = tanh( ∑ θ
3,1 1 i,1
i=1:3
2
xi + b )
1
2 2
h2 = tanh( ∑ θ xi + b )
i,2 2
i=1:3
3 2
h3 = tanh( ∑ θ xi + b )
i,2 3
i=1:3
3 3
y = tanh( ∑ θ hi + b )
i,1 1
i=1:3
Share Cite Improve this answer Follow answered Sep 25, 2020 at 16:12
kedarps
3,532 2 22 30
Blue represents the bias terms (kind of like the intercept in linear regression).
2
To get the value of a neuron (black circle) towards the right, take the value in the circles to the
left, multiply by the weight on the connecting line, and add up those values for all circles
pointing towards your circle. We’d typically use a nonlinear activation function, too, such a
ReLU, though you have not indicated what you used (if any).
I recommend writing out the full equation of this small neural network, and I hope no one
ruins the fun for you before you try to work through it.
EDIT
g = activation(0.01803
+ 2.31748d + 1.00955e
− 2.24362f )
Use this to unpack the other six neurons. Then write g in terms of the three predictor
variables.
Share Cite Improve this answer edited Sep 29, 2020 at 16:38 answered Sep 24, 2020 at 11:09
Follow Dave
60.8k 7 93 268
1 Use the picture to write down the equation on a sheet of paper. No knowledge of R or any other
software is necessary for this. (Well...you’ll have to know the activation functions in each neuron,
which you’ll get from your code.) – Dave Sep 24, 2020 at 11:28
1 Using the package neuralnet the preset activation function will be logistic, unless other options
were chosen. – Bernhard Sep 24, 2020 at 12:14
1 @user2579677 you are missing the effect of the activation functions – desertnaut Sep 24, 2020 at
14:05
1 @user2579677 You've missed the activation functions and the multiple layers. Take another shot,
making use of all 16 numbers in your picture. – Dave Sep 24, 2020 at 14:20
1 Well I got g by adding up something about the arrows points towards it. Take a shot at writing d by
considering the arrows pointing towards it. – Dave Oct 1, 2020 at 14:13