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

icon
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
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer