Skip to content

Commit 9eac095

Browse files
committed
moving damping constant to class global
1 parent 7cf8d25 commit 9eac095

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

docs/source/overview/imitation-learning/teleop_imitation.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,12 @@ Visualizing results
293293
^^^^^^^^^^^^^^^^^^^
294294

295295
.. tip::
296-
296+
297297
**Important: Testing Multiple Checkpoint Epochs**
298-
299-
When evaluating policy performance, it is common for different training epochs to yield significantly different results.
300-
If you don't see the expected performance, **always test policies from various epochs** (not just the final checkpoint)
301-
to find the best-performing model. Model performance can vary substantially across training, and the final epoch
298+
299+
When evaluating policy performance, it is common for different training epochs to yield significantly different results.
300+
If you don't see the expected performance, **always test policies from various epochs** (not just the final checkpoint)
301+
to find the best-performing model. Model performance can vary substantially across training, and the final epoch
302302
is not always optimal.
303303

304304
By inferencing using the generated model, we can visualize the results of the policy:
@@ -326,7 +326,7 @@ By inferencing using the generated model, we can visualize the results of the po
326326
327327
.. tip::
328328

329-
**If you don't see expected performance results:** Test policies from multiple checkpoint epochs, not just the final one.
329+
**If you don't see expected performance results:** Test policies from multiple checkpoint epochs, not just the final one.
330330
Policy performance can vary significantly across training epochs, and intermediate checkpoints often outperform the final model.
331331

332332
.. note::
@@ -530,7 +530,7 @@ Visualize the results of the trained policy by running the following command, us
530530

531531
.. tip::
532532

533-
**If you don't see expected performance results:** It is critical to test policies from various checkpoint epochs.
533+
**If you don't see expected performance results:** It is critical to test policies from various checkpoint epochs.
534534
Performance can vary significantly between epochs, and the best-performing checkpoint is often not the final one.
535535

536536
.. figure:: https://download.isaacsim.omniverse.nvidia.com/isaaclab/images/gr-1_steering_wheel_pick_place_policy.gif
@@ -664,7 +664,7 @@ Visualize the trained policy performance:
664664

665665
.. tip::
666666

667-
**If you don't see expected performance results:** Always test policies from various checkpoint epochs.
667+
**If you don't see expected performance results:** Always test policies from various checkpoint epochs.
668668
Different epochs can produce significantly different results, so evaluate multiple checkpoints to find the optimal model.
669669

670670
.. figure:: https://download.isaacsim.omniverse.nvidia.com/isaaclab/images/locomanipulation-g-1_steering_wheel_pick_place.gif
@@ -878,7 +878,7 @@ Visualize the results of the trained policy by running the following command, us
878878

879879
.. tip::
880880

881-
**If you don't see expected performance results:** Test policies from various checkpoint epochs, not just the final one.
881+
**If you don't see expected performance results:** Test policies from various checkpoint epochs, not just the final one.
882882
Policy performance can vary substantially across training, and intermediate checkpoints often yield better results.
883883

884884
.. figure:: https://download.isaacsim.omniverse.nvidia.com/isaaclab/images/gr-1_nut_pouring_policy.gif

source/isaaclab/isaaclab/controllers/pink_ik/null_space_posture_task.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ class NullSpacePostureTask(Task):
7777
7878
"""
7979

80+
# Regularization factor for pseudoinverse computation to ensure numerical stability
81+
PSEUDOINVERSE_DAMPING_FACTOR: float = 1e-9
82+
8083
def __init__(
8184
self,
8285
cost: float,
@@ -242,16 +245,13 @@ def compute_jacobian(self, configuration: Configuration) -> np.ndarray:
242245
# Use fast pseudoinverse computation with direct LAPACK/BLAS calls
243246
m, n = J_combined.shape
244247

245-
# Determine damping factor for numerical stability
246-
damping = 1e-9
247-
248248
# Wide matrix (typical for robotics): use left pseudoinverse
249249
# J^+ = J^T @ inv(J @ J^T + λ²I)
250250
# This is faster because we invert an m×m matrix instead of n×n
251251

252252
# Compute J @ J^T using BLAS (faster than numpy)
253253
JJT = blas.dgemm(1.0, J_combined, J_combined.T)
254-
np.fill_diagonal(JJT, JJT.diagonal() + damping**2)
254+
np.fill_diagonal(JJT, JJT.diagonal() + self.PSEUDOINVERSE_DAMPING_FACTOR**2)
255255

256256
# Use LAPACK's Cholesky factorization (dpotrf = Positive definite TRiangular Factorization)
257257
L, info = lapack.dpotrf(JJT, lower=1, clean=False, overwrite_a=True)

0 commit comments

Comments
 (0)