Skip to content

Commit

Permalink
step param
Browse files Browse the repository at this point in the history
  • Loading branch information
JSabadin committed Nov 23, 2024
1 parent 8f0a72e commit db62c8b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions luxonis_ml/tracker/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,13 +501,15 @@ def upload_artifact(
self.log_stored_logs_to_mlflow()

@rank_zero_only
def log_matrix(self, matrix: np.ndarray, name: str) -> None:
def log_matrix(self, matrix: np.ndarray, name: str, step: int) -> None:
"""Logs confusion matrix to the logging service.
@type matrix: np.ndarray
@param matrix: The confusion matrix to log.
@type name: str
@param name: The name used to log the matrix.
@type step: int
@param step: The current step.
"""
if self.is_mlflow:
matrix_data = {
Expand All @@ -518,7 +520,7 @@ def log_matrix(self, matrix: np.ndarray, name: str) -> None:

if self.is_tensorboard:
matrix_str = np.array2string(matrix, separator=", ")
self.experiment["tensorboard"].add_text(name, matrix_str)
self.experiment["tensorboard"].add_text(name, matrix_str, step)

if self.is_wandb:
import wandb
Expand All @@ -529,7 +531,7 @@ def log_matrix(self, matrix: np.ndarray, name: str) -> None:
)
for i, row in enumerate(matrix):
table.add_data(i, *row)
self.experiment["wandb"].log({f"{name}_table": table})
self.experiment["wandb"].log({f"{name}_table": table}, step=step)

@rank_zero_only
def log_images(self, imgs: Dict[str, np.ndarray], step: int) -> None:
Expand Down

0 comments on commit db62c8b

Please sign in to comment.