From c8656f1a277bcab7d11e9d588d9a02886ec57cee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh-Long=20Luu=20=28=E5=88=98=E6=98=8E=E9=BE=99=29?= Date: Fri, 7 Jul 2023 16:32:09 +0700 Subject: [PATCH] docs: `fabric_methods.rst` using deprecated parameters (#18015) --- docs/source-fabric/api/fabric_methods.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source-fabric/api/fabric_methods.rst b/docs/source-fabric/api/fabric_methods.rst index f10255ca83..4e8a7d3a36 100644 --- a/docs/source-fabric/api/fabric_methods.rst +++ b/docs/source-fabric/api/fabric_methods.rst @@ -98,14 +98,14 @@ This is useful if your model experiences *exploding gradients* during training. fabric.clip_gradients(model, optimizer, clip_val=0.5) # Clip gradients such that their total norm is no bigger than 2.0 - fabric.clip_gradients(model, optimizer, clip_norm=2.0) + fabric.clip_gradients(model, optimizer, max_norm=2.0) # By default, clipping by norm uses the 2-norm - fabric.clip_gradients(model, optimizer, clip_norm=2.0, norm_type=2) + fabric.clip_gradients(model, optimizer, max_norm=2.0, norm_type=2) # You can also choose the infinity-norm, which clips the largest # element among all - fabric.clip_gradients(model, optimizer, clip_norm=2.0, norm_type="inf") + fabric.clip_gradients(model, optimizer, max_norm=2.0, norm_type="inf") The :meth:`~lightning.fabric.fabric.Fabric.clip_gradients` method is agnostic to the precision and strategy being used. Note: Gradient clipping with FSDP is not yet fully supported.