Adding LpNorm regularization for sparse features in DPER3 (#38582)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/38582
Adding LpNorm regularization for sparse features in DPER3. This is done using a sparse regularization op with run_after_optimizer (see D21003029).
* Added code calling new caffe2 operator from D21003029 to caffe2/python/regularizer.py
* Added l1norm and l2norm to sparse regularizer thrift definition.
* Added the new regularization references to test utils.
* Added a new file for unit tests "sparse_nn_sparse_reg_test.py"
Test Plan:
buck test mode/dev //caffe2/caffe2/fb/dper/layer_models/tests:sparse_nn_sparse_reg_test
buck test mode/dev //caffe2/caffe2/fb/dper/layer_models/tests:sparse_nn_reg_test
DPER canary: https://fburl.com/fblearner/rcp5yzeh
New DPER canary: https://fburl.com/fblearner/0krgd74x
Differential Revision: D20704248
fbshipit-source-id: 7e3d5013b3ff3da95ea027f0f2dd855f3ae8e41d