November 2019
Intermediate to advanced
296 pages
7h 52m
English
Optimization is processed by the minimize method of the optimizer. The method is called per iteration of the optimization process. Thus, it is necessary to call it multiple times until the returned value from the loss function converges:
for (let i = 0; i < 100; i++) { const l = optimizer.minimize(() => loss(f_x(xs), ys), true); losses.push(l.dataSync());}
Since the minimize method returns the tensor containing the loss value of the iteration, we can visualize the history of the loss function in the training process. The following chart visualizes the loss values in 100 iterations:

The preceding chart ...
Read now
Unlock full access