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
€61.75
List Price:  €88.22
You save:  €26.47
£51.80
List Price:  £74
You save:  £22.20
CA$96.75
List Price:  CA$138.22
You save:  CA$41.47
A$108.63
List Price:  A$155.19
You save:  A$46.56
S$90.14
List Price:  S$128.77
You save:  S$38.63
HK$548.59
List Price:  HK$783.73
You save:  HK$235.14
CHF 57.88
List Price:  CHF 82.69
You save:  CHF 24.81
NOK kr709.66
List Price:  NOK kr1,013.84
You save:  NOK kr304.18
DKK kr460.47
List Price:  DKK kr657.84
You save:  DKK kr197.37
NZ$117.24
List Price:  NZ$167.50
You save:  NZ$50.25
د.إ257.07
List Price:  د.إ367.26
You save:  د.إ110.18
৳8,552.96
List Price:  ৳12,219.04
You save:  ৳3,666.07
₹5,972.21
List Price:  ₹8,532.10
You save:  ₹2,559.88
RM295.70
List Price:  RM422.45
You save:  RM126.75
₦110,980.34
List Price:  ₦158,550.14
You save:  ₦47,569.80
₨19,823.64
List Price:  ₨28,320.70
You save:  ₨8,497.06
฿2,284.12
List Price:  ฿3,263.17
You save:  ฿979.04
₺2,734.17
List Price:  ₺3,906.12
You save:  ₺1,171.95
B$394.82
List Price:  B$564.06
You save:  B$169.23
R1,252.96
List Price:  R1,790.03
You save:  R537.06
Лв120.92
List Price:  Лв172.75
You save:  Лв51.83
₩96,097.09
List Price:  ₩137,287.44
You save:  ₩41,190.35
₪247.80
List Price:  ₪354.01
You save:  ₪106.21
₱3,881.61
List Price:  ₱5,545.39
You save:  ₱1,663.78
¥10,094.44
List Price:  ¥14,421.25
You save:  ¥4,326.81
MX$1,349.29
List Price:  MX$1,927.64
You save:  MX$578.35
QR256.03
List Price:  QR365.77
You save:  QR109.74
P940.26
List Price:  P1,343.29
You save:  P403.02
KSh9,042.70
List Price:  KSh12,918.70
You save:  KSh3,876
E£3,487.51
List Price:  E£4,982.38
You save:  E£1,494.86
ብር9,522.69
List Price:  ብር13,604.43
You save:  ብር4,081.74
Kz63,827.73
List Price:  Kz91,186.38
You save:  Kz27,358.65
CLP$65,717.81
List Price:  CLP$93,886.61
You save:  CLP$28,168.80
CN¥503.20
List Price:  CN¥718.88
You save:  CN¥215.68
RD$4,127.93
List Price:  RD$5,897.30
You save:  RD$1,769.36
DA9,249.25
List Price:  DA13,213.78
You save:  DA3,964.53
FJ$158.10
List Price:  FJ$225.87
You save:  FJ$67.76
Q537.47
List Price:  Q767.84
You save:  Q230.37
GY$14,677.31
List Price:  GY$20,968.48
You save:  GY$6,291.17
ISK kr8,880.33
List Price:  ISK kr12,686.73
You save:  ISK kr3,806.40
DH646.61
List Price:  DH923.77
You save:  DH277.15
L1,209.75
List Price:  L1,728.29
You save:  L518.54
ден3,798.11
List Price:  ден5,426.11
You save:  ден1,627.99
MOP$565.56
List Price:  MOP$807.98
You save:  MOP$242.42
N$1,253.73
List Price:  N$1,791.12
You save:  N$537.39
C$2,578.06
List Price:  C$3,683.10
You save:  C$1,105.04
रु9,567.18
List Price:  रु13,667.98
You save:  रु4,100.80
S/256.16
List Price:  S/365.97
You save:  S/109.80
K287.44
List Price:  K410.65
You save:  K123.20
SAR262.52
List Price:  SAR375.05
You save:  SAR112.52
ZK1,893.06
List Price:  ZK2,704.49
You save:  ZK811.42
L312.19
List Price:  L446.01
You save:  L133.81
Kč1,538.66
List Price:  Kč2,198.18
You save:  Kč659.52
Ft24,912.57
List Price:  Ft35,590.91
You save:  Ft10,678.34
SEK kr672.24
List Price:  SEK kr960.39
You save:  SEK kr288.14
ARS$80,943.07
List Price:  ARS$115,637.92
You save:  ARS$34,694.84
Bs484.05
List Price:  Bs691.53
You save:  Bs207.48
COP$290,737.30
List Price:  COP$415,356.81
You save:  COP$124,619.50
₡35,635.48
List Price:  ₡50,910.02
You save:  ₡15,274.53
L1,824.50
List Price:  L2,606.54
You save:  L782.04
₲559,699.84
List Price:  ₲799,605.48
You save:  ₲239,905.63
$U2,909.40
List Price:  $U4,156.46
You save:  $U1,247.06
zł262.16
List Price:  zł374.54
You save:  zł112.37
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.