Skip to content

Commit c9625d8

Browse files
committed
update hints of apis
1 parent 90836bd commit c9625d8

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

deepxde/backend/backend.py

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff 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+
"""

0 commit comments

Comments
 (0)