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.67
List Price:  €85.25
You save:  €25.57
£51.54
List Price:  £73.64
You save:  £22.09
CA$95.16
List Price:  CA$135.96
You save:  CA$40.79
A$97.18
List Price:  A$138.83
You save:  A$41.65
S$89.17
List Price:  S$127.39
You save:  S$38.22
HK$548.37
List Price:  HK$783.42
You save:  HK$235.05
CHF 54.67
List Price:  CHF 78.11
You save:  CHF 23.43
NOK kr650.65
List Price:  NOK kr929.54
You save:  NOK kr278.89
DKK kr446.19
List Price:  DKK kr637.44
You save:  DKK kr191.25
NZ$118.68
List Price:  NZ$169.56
You save:  NZ$50.87
د.إ257.03
List Price:  د.إ367.21
You save:  د.إ110.17
৳8,589.53
List Price:  ৳12,271.28
You save:  ৳3,681.75
₹6,642.78
List Price:  ₹9,490.10
You save:  ₹2,847.31
RM277.86
List Price:  RM396.96
You save:  RM119.10
₦96,304.84
List Price:  ₦137,584.24
You save:  ₦41,279.40
₨19,511.46
List Price:  ₨27,874.71
You save:  ₨8,363.25
฿2,276.98
List Price:  ฿3,252.96
You save:  ฿975.98
₺3,159.52
List Price:  ₺4,513.79
You save:  ₺1,354.27
B$349.45
List Price:  B$499.24
You save:  B$149.78
R1,169.62
List Price:  R1,670.96
You save:  R501.33
Лв116.78
List Price:  Лв166.84
You save:  Лв50.05
₩102,977.68
List Price:  ₩147,117.28
You save:  ₩44,139.60
₪206.03
List Price:  ₪294.34
You save:  ₪88.31
₱4,288.63
List Price:  ₱6,126.88
You save:  ₱1,838.24
¥10,993.53
List Price:  ¥15,705.72
You save:  ¥4,712.19
MX$1,221.88
List Price:  MX$1,745.62
You save:  MX$523.74
QR255
List Price:  QR364.31
You save:  QR109.30
P946.32
List Price:  P1,351.94
You save:  P405.62
KSh9,039.20
List Price:  KSh12,913.70
You save:  KSh3,874.50
E£3,754.24
List Price:  E£5,363.43
You save:  E£1,609.19
ብር10,986.68
List Price:  ብር15,695.93
You save:  ብር4,709.25
Kz64,250.82
List Price:  Kz91,790.82
You save:  Kz27,540
CLP$62,921.01
List Price:  CLP$89,891.01
You save:  CLP$26,970
CN¥477.90
List Price:  CN¥682.75
You save:  CN¥204.84
RD$4,157.40
List Price:  RD$5,939.40
You save:  RD$1,782
DA9,272.76
List Price:  DA13,247.36
You save:  DA3,974.60
FJ$153.42
List Price:  FJ$219.18
You save:  FJ$65.76
Q534.82
List Price:  Q764.07
You save:  Q229.24
GY$14,645.56
List Price:  GY$20,923.13
You save:  GY$6,277.56
ISK kr8,586.37
List Price:  ISK kr12,266.77
You save:  ISK kr3,680.40
DH647.49
List Price:  DH925.03
You save:  DH277.53
L1,200.31
List Price:  L1,714.81
You save:  L514.49
ден3,678.98
List Price:  ден5,255.92
You save:  ден1,576.93
MOP$564.87
List Price:  MOP$807
You save:  MOP$242.12
N$1,166.03
List Price:  N$1,665.83
You save:  N$499.80
C$2,569.33
List Price:  C$3,670.63
You save:  C$1,101.30
रु10,624.73
List Price:  रु15,178.84
You save:  रु4,554.10
S/245.48
List Price:  S/350.71
You save:  S/105.22
K303.66
List Price:  K433.83
You save:  K130.16
SAR262.46
List Price:  SAR374.96
You save:  SAR112.49
ZK1,321.46
List Price:  ZK1,887.88
You save:  ZK566.42
L310.62
List Price:  L443.76
You save:  L133.14
Kč1,454.86
List Price:  Kč2,078.46
You save:  Kč623.60
Ft21,692.94
List Price:  Ft30,991.25
You save:  Ft9,298.30
SEK kr644.88
List Price:  SEK kr921.30
You save:  SEK kr276.42
ARS$97,475.63
List Price:  ARS$139,256.87
You save:  ARS$41,781.24
Bs483.72
List Price:  Bs691.06
You save:  Bs207.33
COP$253,351.36
List Price:  COP$361,946.03
You save:  COP$108,594.66
₡31,826.91
List Price:  ₡45,468.96
You save:  ₡13,642.05
L1,863.13
List Price:  L2,661.73
You save:  L798.60
₲435,586.79
List Price:  ₲622,293.52
You save:  ₲186,706.72
$U2,791.86
List Price:  $U3,988.55
You save:  $U1,196.68
zł253.44
List Price:  zł362.08
You save:  zł108.63
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.