#๐ Back propogation
44 messages ยท Page 1 of 1 (latest)
@wild scroll
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
have you tried to solve (a)?
ive done A
i dont know how to do B
@slow nova
Do u want my code on A?
x1 = 0.5
b1 = -0.2
b2 = 0.4
w1 = 0.2
w2 = 0.8
yt = 0.4
n1 = 0.1
def z(v):
return 1/(1+e**-v)
Hey @wild scroll!
It looks like you're trying to paste code into this channel.
Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.
To do this, use the following method:
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
You can **edit your original message** to correct your code block.
h1 = x1 * w1 + b1
O1 =z(h1) * w2 + b2
y = z(O1)
y
@wild scroll I don't want to mislead you, so I'll need time to work it out on my own
@slow nova
Do u know how I can find the derivative using code
Like i want to find the derivative of Err
Err = ((1/2) * (yt - y)**2)
Err
How would I do that?
you have to keep substituting y
you know that y is sigmoid(o1), and you know that o1 is sigmoid(h1)w2) + b2
etc
I don't know how your homework wants you to do it. usually, pytorch would handle it for you (which is why I had to check)
but the first line here is the formula for updating w2. and then the first two lines of the derivative.
and then you'd do the same thing but replace w2 with w1
i know how to find the derivative
i just dont know how to write it down in code
and the way ur supposed to do it
is this
new weight = old weight - learning rate * partial derivative of errpr respect to weigt
okay, so what is the partial derivative of the error wrt w2?
expressed only in terms of functions and values that are already defined
you have to actually solve the derivative until you only have operations like multiplication, division, addition, subtraction, and sigmoid.
once you've done all that by hand (not with python), you can then write a python statement that calculates it.
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.