Optimization and Loss Functions

1 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$69.99
List Price:  $99.99
You save:  $30
€60.04
List Price:  €85.78
You save:  €25.73
£52.20
List Price:  £74.57
You save:  £22.37
CA$96.57
List Price:  CA$137.96
You save:  CA$41.39
A$107.16
List Price:  A$153.09
You save:  A$45.93
S$90.17
List Price:  S$128.82
You save:  S$38.65
HK$546.07
List Price:  HK$780.13
You save:  HK$234.06
CHF 56.24
List Price:  CHF 80.34
You save:  CHF 24.10
NOK kr701.61
List Price:  NOK kr1,002.34
You save:  NOK kr300.73
DKK kr448.11
List Price:  DKK kr640.19
You save:  DKK kr192.07
NZ$119.34
List Price:  NZ$170.50
You save:  NZ$51.15
د.إ257.03
List Price:  د.إ367.21
You save:  د.إ110.17
৳8,512.87
List Price:  ৳12,161.77
You save:  ৳3,648.89
₹6,162.88
List Price:  ₹8,804.49
You save:  ₹2,641.61
RM295.88
List Price:  RM422.70
You save:  RM126.82
₦107,536.13
List Price:  ₦153,629.63
You save:  ₦46,093.50
₨19,804.90
List Price:  ₨28,293.93
You save:  ₨8,489.02
฿2,263.93
List Price:  ฿3,234.32
You save:  ฿970.39
₺2,880.27
List Price:  ₺4,114.84
You save:  ₺1,234.57
B$382.90
List Price:  B$547.02
You save:  B$164.12
R1,233.84
List Price:  R1,762.70
You save:  R528.86
Лв117.53
List Price:  Лв167.91
You save:  Лв50.37
₩97,257.52
List Price:  ₩138,945.27
You save:  ₩41,687.75
₪235.73
List Price:  ₪336.77
You save:  ₪101.04
₱4,010.39
List Price:  ₱5,729.37
You save:  ₱1,718.98
¥10,397.50
List Price:  ¥14,854.21
You save:  ¥4,456.71
MX$1,309.19
List Price:  MX$1,870.35
You save:  MX$561.16
QR255.01
List Price:  QR364.32
You save:  QR109.30
P943.39
List Price:  P1,347.77
You save:  P404.37
KSh9,039.20
List Price:  KSh12,913.70
You save:  KSh3,874.50
E£3,401.11
List Price:  E£4,858.94
You save:  E£1,457.82
ብር9,999.68
List Price:  ብር14,285.86
You save:  ብር4,286.18
Kz63,827.73
List Price:  Kz91,186.39
You save:  Kz27,358.65
CLP$68,145.06
List Price:  CLP$97,354.26
You save:  CLP$29,209.20
CN¥499.08
List Price:  CN¥713
You save:  CN¥213.92
RD$4,408.74
List Price:  RD$6,298.47
You save:  RD$1,889.73
DA9,093.35
List Price:  DA12,991.06
You save:  DA3,897.70
FJ$158.28
List Price:  FJ$226.12
You save:  FJ$67.84
Q536.40
List Price:  Q766.32
You save:  Q229.91
GY$14,634.99
List Price:  GY$20,908.02
You save:  GY$6,273.03
ISK kr8,623.46
List Price:  ISK kr12,319.76
You save:  ISK kr3,696.30
DH633.06
List Price:  DH904.41
You save:  DH271.35
L1,154.10
List Price:  L1,648.78
You save:  L494.68
ден3,701.61
List Price:  ден5,288.25
You save:  ден1,586.63
MOP$562.68
List Price:  MOP$803.86
You save:  MOP$241.18
N$1,239.98
List Price:  N$1,771.48
You save:  N$531.49
C$2,575.56
List Price:  C$3,679.53
You save:  C$1,103.97
रु9,878.18
List Price:  रु14,112.30
You save:  रु4,234.11
S/247.37
List Price:  S/353.41
You save:  S/106.03
K293.47
List Price:  K419.26
You save:  K125.79
SAR262.62
List Price:  SAR375.19
You save:  SAR112.57
ZK1,658.21
List Price:  ZK2,368.97
You save:  ZK710.76
L304.89
List Price:  L435.57
You save:  L130.68
Kč1,468.04
List Price:  Kč2,097.30
You save:  Kč629.25
Ft23,641.10
List Price:  Ft33,774.46
You save:  Ft10,133.35
SEK kr660.62
List Price:  SEK kr943.78
You save:  SEK kr283.16
ARS$95,148.96
List Price:  ARS$135,932.91
You save:  ARS$40,783.95
Bs483.58
List Price:  Bs690.86
You save:  Bs207.28
COP$280,654.43
List Price:  COP$400,952.08
You save:  COP$120,297.65
₡35,381.84
List Price:  ₡50,547.65
You save:  ₡15,165.81
L1,844.66
List Price:  L2,635.35
You save:  L790.68
₲505,480.47
List Price:  ₲722,145.91
You save:  ₲216,665.44
$U2,801.15
List Price:  $U4,001.81
You save:  $U1,200.66
zł255.30
List Price:  zł364.73
You save:  zł109.43
Already have an account? Log In

Transcript

Hello everyone. In this video we are going to complete the last helper function for our model. The function applause is used to define loss function and optimizer for the model. It takes three arguments logits, which are pre activated outputs from the last layer of the model, then we have our targets. As you probably know, there are just true labels. And lastly, we have our learning Great.

Let's define our loss function first. The loss function will be mean of sparse softmax cross entropy with logits. It takes two arguments, logics, or our pre activated outputs from the model and targets. And this point you may be confused and probably asked, What is the sparse Word In the Name? And why is it different from the classical softmax cross entropy? The sparse version means that we don't have to convert our targets to one hot encoding versions and the rest is working exactly the same So as we said, it takes two arguments, labels, or targets in our case and logic.

Now we need to define our optimizer. For the model we're going to use atom optimizer, which performs the best for the CNS provide learning rates to it, and called the minimize function to minimize our defined loss. Before we finish this function, we have to return loss and optimizer. And now we are all done and set to build our model that we are going to do in the next video. For now if you have any questions or comments, put them in the comment section. Otherwise, see in the next tutorial

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.