0
Machine Learning: The Sigmoid Function
Calculate Node Output. Task You are given the values for w1, w2, b, x1 and x2 and you must compute the output for the node. Use the sigmoid as the activation function. Input Format w1, w2, b, x1 and x2 on one line separated by spaces Output Format Float rounded to 4 decimal places Sample Input 0 1 2 1 2 Sample Output 0.9820 I'm having trouble, and the due date is today, which I think is stupid, since these things take WAY longer to learn than usual. If anyone can give the answer to me, I would be glad. Thanks.
10 Answers
+ 10
w1, w2, b, x1, x2 = [float(x) for x in input().split()]
import math
output = w1*x1 + w2*x2 + b
output = round(1/(1 + math.exp(output*-1)), 4)
print(output)
+ 2
import math
w1, w2, b, x1, x2 = [float(x) for x in input().split()]
r = w1*x1 + w2*x2 + b
def sigmoid(r):
sig = 1 / (1+math.exp(-r))
print(round(sig, 4))
sigmoid(r)
+ 2
ANS :
w1, w2, b, x1, x2 = [float(x) for x in input().split()]
import math
y=(w1*x1)+(w2*x2)+b
z = math.exp(-y)
sig = 1 / (1 + z)
sig = round(sig,4)
print(sig)
+ 1
Siavosh sanoodi please see my code above
0
Show. Your. Attempt.
0
Value =( W1*X1 + W2 * X2 ) + b
Then put value in sigmoid function
Sigmoid = 1/(1+(e**-value)) -> import e from math (from math import e)
https://code.sololearn.com/cAc6grWX9IBZ/?ref=app
here is the solution!
0
I can't answer to this question
please someone help me
Machine Learning - The Sigmoid Function
Task
You are given the values for w1, w2, b, x1 and x2 and you must compute the output for the node. Use the sigmoid as the activation function.
0
It says that the result should be 0.982
0
w1, w2, b, x1, x2 = [float(x) for x in input().split()]
import math
output = w1*x1 + w2*x2 + b
output = round(1/(1 + math.exp(output*-1)), 4)
print(output)
0
My solution
import math
w1, w2, b, x1, x2 = [float(x) for x in input().split()]
def sigmoid(out):
sigmoids=round(1/(1+math.exp(out*-1)),4)
return sigmoids
output=w1*x1+w2*x2+b;
print(sigmoid(output))