File tree Expand file tree Collapse file tree 1 file changed +28
-6
lines changed Expand file tree Collapse file tree 1 file changed +28
-6
lines changed Original file line number Diff line number Diff line change @@ -508,13 +508,35 @@ def sparse_dense_matmul(x, y):
508508# Regularization
509509
510510
511- def l1_regularization (x ):
512- """Implement the L1 weight decay regularization."""
511+ def l1_regularization (l1 ):
512+ """A regularizer that applies a L1 regularization penalty or L1 weight decay.
513513
514+ Warning:
515+ The implementation may vary across different backends.
516+
517+ Args:
518+ l1 (float): L1 regularization factor.
519+ """
520+
521+
522+ def l2_regularization (l2 ):
523+ """A regularizer that applies a L2 regularization penalty or L2 weight decay.
524+
525+ Warning:
526+ The implementation may vary across different backends.
527+
528+ Args:
529+ l2 (float): L2 regularization factor.
530+ """
514531
515- def l2_regularization (x ):
516- """Implement the L2 weight decay regularization."""
517532
533+ def l1_l2_regularization (l1 , l2 ):
534+ """A regularizer that applies both L1 and L2 regularization penalties or L1 and L2 weight decay.
518535
519- def l1_l2_regularization (x ,y ):
520- """Implement the L1 and L2 weight decay regularization."""
536+ Warning:
537+ The implementation may vary across different backends.
538+
539+ Args:
540+ l1 (float): L1 regularization factor.
541+ l2 (float): L2 regularization factor.
542+ """
You can’t perform that action at this time.
0 commit comments