A neural network is built for a dataset that has binary target value (0 or 1). The cost function used for these applications is 'cross entropy' which is defined as follows. Cost Function = -( (target-log(compValue) + (1 − target) + log(1-compValue))) Compute the cost function values using TensorFlow for the following cases. Cost Function 1 2 3 4 5 1 2 3 4 5 Observed output Target 0 0 0 0 0 Observed output Target 1 1 1 1 1 Computed Value 0.95 0.8 0.6 0.4 0.1 Computed Output 0.95 0.8 0.6 0.4 0.1 Answer: Target= 0 Computed Value = 0.95 Cost Function= Computed Value = 0.8 Cost Function = Computed Value = 0.6 Cost Function= Computed Value = 0.4 Cost Function= Computed Value = 0.1 Cost Function= ? ? Cost Function Target= 1 Computed Value = 0.95 Cost Function= 0.8 Cost Function= 0.6 Cost Function= Computed Value = Computed Value = Computed Value = 0.4 Cost Function= Computed Value = 0.1 Cost Function = ? ? ? ? ? ? ? ? 2.99573227355399 1.6094379124341005 0.916290731874155 0.5108256237659907 0.10536051565782628 0.05129329438755058 0.2231435513142097 0.5108256237659907 0.916290731874155 2.3025850929940455
A neural network is built for a dataset that has binary target value (0 or 1). The cost function used for these applications is 'cross entropy' which is defined as follows. Cost Function = -( (target-log(compValue) + (1 − target) + log(1-compValue))) Compute the cost function values using TensorFlow for the following cases. Cost Function 1 2 3 4 5 1 2 3 4 5 Observed output Target 0 0 0 0 0 Observed output Target 1 1 1 1 1 Computed Value 0.95 0.8 0.6 0.4 0.1 Computed Output 0.95 0.8 0.6 0.4 0.1 Answer: Target= 0 Computed Value = 0.95 Cost Function= Computed Value = 0.8 Cost Function = Computed Value = 0.6 Cost Function= Computed Value = 0.4 Cost Function= Computed Value = 0.1 Cost Function= ? ? Cost Function Target= 1 Computed Value = 0.95 Cost Function= 0.8 Cost Function= 0.6 Cost Function= Computed Value = Computed Value = Computed Value = 0.4 Cost Function= Computed Value = 0.1 Cost Function = ? ? ? ? ? ? ? ? 2.99573227355399 1.6094379124341005 0.916290731874155 0.5108256237659907 0.10536051565782628 0.05129329438755058 0.2231435513142097 0.5108256237659907 0.916290731874155 2.3025850929940455
Related questions
Question
Please help step by step with explanation for tensorflow code with a final code for understanding thank you.
![Problem#4
A neural network is built for a dataset that has binary target value (0 or 1).
The cost function used for these applications is 'cross entropy' which is defined as follows.
Cost Function = ( (target log(compValue) + (1 - target) * log(1- compValue)) )
Compute the cost function values using TensorFlow for the following cases.
Cost Function
Observed
output
Computed
Value
Answer:
Target
1
2
3
45
1
2
3
4
5
Target
0
0
0
0
0
Observed
output
0
Computed Value =
Computed Value =
Computed Value =
Computed Value =
Computed Value =
Target
1
1
1
1
1
0.95
0.8
0.6
0.4
0.1
Computed
Output
0.95
0.8
0.6
0.4
0.1
?
?
?
?
?
Cost Function
?
?
?
?
?
0.95 Cost Function = 2.99573227355399
0.8 Cost Function = 1.6094379124341005
Cost Function = 0.916290731874155
Cost Function = 0.5108256237659907
0.10536051565782628
0.6
0.4
0.1 Cost Function =
Target= 1
Computed Value = 0.95 Cost Function = 0.05129329438755058
Computed Value =
0.8 Cost Function =
Computed Value = 0.6 Cost Function =
Computed Value = 0.4 Cost Function =
Computed Value = 0.1 Cost Function =
0.2231435513142097
0.5108256237659907
0.916290731874155
2.3025850929940455](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F75d451d4-8631-47c4-96fa-d3dc34739cc7%2F357cd241-20cb-4f7a-a55a-4e97a01bf3d5%2Fa5bxw2b_processed.png&w=3840&q=75)
Transcribed Image Text:Problem#4
A neural network is built for a dataset that has binary target value (0 or 1).
The cost function used for these applications is 'cross entropy' which is defined as follows.
Cost Function = ( (target log(compValue) + (1 - target) * log(1- compValue)) )
Compute the cost function values using TensorFlow for the following cases.
Cost Function
Observed
output
Computed
Value
Answer:
Target
1
2
3
45
1
2
3
4
5
Target
0
0
0
0
0
Observed
output
0
Computed Value =
Computed Value =
Computed Value =
Computed Value =
Computed Value =
Target
1
1
1
1
1
0.95
0.8
0.6
0.4
0.1
Computed
Output
0.95
0.8
0.6
0.4
0.1
?
?
?
?
?
Cost Function
?
?
?
?
?
0.95 Cost Function = 2.99573227355399
0.8 Cost Function = 1.6094379124341005
Cost Function = 0.916290731874155
Cost Function = 0.5108256237659907
0.10536051565782628
0.6
0.4
0.1 Cost Function =
Target= 1
Computed Value = 0.95 Cost Function = 0.05129329438755058
Computed Value =
0.8 Cost Function =
Computed Value = 0.6 Cost Function =
Computed Value = 0.4 Cost Function =
Computed Value = 0.1 Cost Function =
0.2231435513142097
0.5108256237659907
0.916290731874155
2.3025850929940455
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)