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
€59.63
List Price:  €85.19
You save:  €25.56
£52.34
List Price:  £74.77
You save:  £22.43
CA$96.42
List Price:  CA$137.76
You save:  CA$41.33
A$105.21
List Price:  A$150.31
You save:  A$45.09
S$90.43
List Price:  S$129.19
You save:  S$38.76
HK$544.61
List Price:  HK$778.05
You save:  HK$233.44
CHF 55.82
List Price:  CHF 79.75
You save:  CHF 23.92
NOK kr709.51
List Price:  NOK kr1,013.63
You save:  NOK kr304.12
DKK kr445.26
List Price:  DKK kr636.11
You save:  DKK kr190.85
NZ$120.57
List Price:  NZ$172.26
You save:  NZ$51.68
د.إ257.03
List Price:  د.إ367.21
You save:  د.إ110.17
৳8,539.66
List Price:  ৳12,200.05
You save:  ৳3,660.38
₹6,340
List Price:  ₹9,057.54
You save:  ₹2,717.53
RM286.77
List Price:  RM409.68
You save:  RM122.91
₦101,665.37
List Price:  ₦145,242.47
You save:  ₦43,577.10
₨19,583.60
List Price:  ₨27,977.78
You save:  ₨8,394.17
฿2,200.79
List Price:  ฿3,144.12
You save:  ฿943.33
₺2,988.29
List Price:  ₺4,269.18
You save:  ₺1,280.88
B$379.30
List Price:  B$541.88
You save:  B$162.58
R1,181.11
List Price:  R1,687.37
You save:  R506.26
Лв116.54
List Price:  Лв166.49
You save:  Лв49.95
₩103,228.95
List Price:  ₩147,476.25
You save:  ₩44,247.30
₪225.57
List Price:  ₪322.26
You save:  ₪96.68
₱4,137.45
List Price:  ₱5,910.90
You save:  ₱1,773.45
¥10,901.99
List Price:  ¥15,574.94
You save:  ¥4,672.95
MX$1,260.79
List Price:  MX$1,801.20
You save:  MX$540.41
QR254.67
List Price:  QR363.83
You save:  QR109.16
P925.89
List Price:  P1,322.75
You save:  P396.86
KSh9,011.01
List Price:  KSh12,873.43
You save:  KSh3,862.41
E£3,327.32
List Price:  E£4,753.52
You save:  E£1,426.20
ብር10,918.61
List Price:  ብር15,598.69
You save:  ብር4,680.07
Kz64,180.83
List Price:  Kz91,690.83
You save:  Kz27,510
CLP$63,708.39
List Price:  CLP$91,015.89
You save:  CLP$27,307.50
CN¥493.74
List Price:  CN¥705.37
You save:  CN¥211.63
RD$4,468.86
List Price:  RD$6,384.36
You save:  RD$1,915.50
DA9,077.28
List Price:  DA12,968.10
You save:  DA3,890.82
FJ$159
List Price:  FJ$227.15
You save:  FJ$68.15
Q535.22
List Price:  Q764.64
You save:  Q229.41
GY$14,619.51
List Price:  GY$20,885.90
You save:  GY$6,266.39
ISK kr8,846.73
List Price:  ISK kr12,638.73
You save:  ISK kr3,792
DH642.87
List Price:  DH918.43
You save:  DH275.55
L1,181.28
List Price:  L1,687.62
You save:  L506.33
ден3,667.39
List Price:  ден5,239.35
You save:  ден1,571.96
MOP$560.34
List Price:  MOP$800.52
You save:  MOP$240.18
N$1,178.95
List Price:  N$1,684.29
You save:  N$505.33
C$2,571.85
List Price:  C$3,674.23
You save:  C$1,102.37
रु10,111.14
List Price:  रु14,445.11
You save:  रु4,333.96
S/235.26
List Price:  S/336.11
You save:  S/100.84
K298.10
List Price:  K425.87
You save:  K127.77
SAR262.61
List Price:  SAR375.18
You save:  SAR112.56
ZK1,612.47
List Price:  ZK2,303.63
You save:  ZK691.15
L303.46
List Price:  L433.54
You save:  L130.07
Kč1,446.63
List Price:  Kč2,066.70
You save:  Kč620.07
Ft22,956.02
List Price:  Ft32,795.72
You save:  Ft9,839.70
SEK kr648.80
List Price:  SEK kr926.89
You save:  SEK kr278.09
ARS$100,838.09
List Price:  ARS$144,060.59
You save:  ARS$43,222.50
Bs482.84
List Price:  Bs689.81
You save:  Bs206.96
COP$266,135.40
List Price:  COP$380,209.72
You save:  COP$114,074.32
₡34,954.75
List Price:  ₡49,937.50
You save:  ₡14,982.75
L1,839.74
List Price:  L2,628.31
You save:  L788.57
₲469,383.81
List Price:  ₲670,577.05
You save:  ₲201,193.23
$U2,742.46
List Price:  $U3,917.97
You save:  $U1,175.50
zł252.31
List Price:  zł360.46
You save:  zł108.15
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.