Implementing Loss Functions

WARNING:tensorflow:From /opt/anaconda3/lib/python3.8/site-packages/tensorflow/python/compat/v2_compat.py:111: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.
Instructions for updating:
non-resource variables are not supported in the long term

L2 norm loss function

[<matplotlib.lines.Line2D at 0x7fdf74c019d0>]
../../_images/output_8_1.png
83.667336
TensorShape([Dimension(500)])

L1 norm loss function

[<matplotlib.lines.Line2D at 0x7fdf75bb4370>]
../../_images/output_14_1.png
[<matplotlib.lines.Line2D at 0x7fdf76d2ac40>]
../../_images/output_15_1.png

Pesudo-Hubber Loss Function

(-0.25, 0.25)
../../_images/output_19_1.png
[<matplotlib.lines.Line2D at 0x7fdf586e2670>]
../../_images/output_20_1.png
[<matplotlib.lines.Line2D at 0x7fdf58b77c10>]
../../_images/output_23_1.png
[<matplotlib.lines.Line2D at 0x7fdf58db87c0>]
../../_images/output_24_1.png
[<matplotlib.lines.Line2D at 0x7fdf58ead1f0>]
../../_images/output_26_1.png