logger#
- class pointrix.logger.writer.ItersPerSecColumn(suffix='it/s')#
Bases:
ProgressColumn
Renders the iterations per second for a progress bar.
- render(task: Task) Text #
Show data transfer speed.
- class pointrix.logger.writer.LogColumn#
Bases:
ProgressColumn
Renders the log for a progress bar.
- render(task: Task) Text #
Show data transfer speed.
- class pointrix.logger.writer.ProgressLogger(description: str, suffix: str | None = None)#
Bases:
object
A class to log the progress of the training.
- Parameters:
description (str) – The description of the progress.
total_iter (int) – The total number of iterations.
suffix (Optional[str], optional) – The suffix of the progress, by default None
Examples
>>> progress_logger = ProgressLogger("Training", 1000) >>> progress_logger.create_task("Training", 1000) >>> with progress_logger.progress: >>> for i in range(1000): >>> progress_logger.update()
- add_task(name: str, description: str, total_iter: int, log_dict: Dict[str, Any] | None = {})#
Add a task to the progress.
- Parameters:
description (str) – The description of the task.
total_iter (int) – The total number of iterations.
- reset(name: str, visible: bool | None = True)#
Reset the progress.
Examples
>>> progress_logger.reset()
- start()#
Start the progress.
Examples
>>> progress_logger.start()
- start_task(name: str)#
Start the task.
Examples
>>> progress_logger.start_task()
- stop()#
Stop the progress.
Examples
>>> progress_logger.stop()
- stop_task(name: str)#
Stop the task.
Examples
>>> progress_logger.stop_task()
- update(name: str, step: int = 1, log: Dict[str, Any] | None = {})#
Update the progress.
- Parameters:
step (int, optional) – The step to advance, by default 1
log (Optional[Dict[str, Any]], optional) – The log dictionary, by default None
- class pointrix.logger.writer.TensorboardWriter(log_dir, **kwargs)#
Bases:
Writer
Tensorboard writer.
- Parameters:
log_dir (Path) – The directory to save the logs.
- write_config(name: str, config_dict: Dict[str, Any], step: int)#
Write a config to the writer.
- Parameters:
name (str) – The name of the config.
config_dict (Dict[str, Any]) – The config.
step (int) – The step of the config.
- write_image(name: str, image: Float[Tensor, 'H W C'], step: int, caption: str | None = None)#
Write an image to the writer.
- Parameters:
name (str) – The name of the image.
image (Float[Tensor, "H W C"]) – The image.
step (int) – The step of the image.
caption (Union[str, None], optional) – The caption of the image, by default None
- write_scalar(name: str, scalar: float | Tensor, step: int)#
Write a scalar value to the writer.
- Parameters:
name (str) – The name of the scalar.
scalar (Union[float, torch.Tensor]) – The scalar value.
step (int) – The step of the scalar.
- class pointrix.logger.writer.WandbWriter(log_dir, experiment_name: str, project_name: str = 'pointrix-project', logcfg: Dict[str, Any] = {})#
Bases:
Writer
- write_config(name: str, config_dict: Dict[str, Any], step: int)#
Function that writes out the config to wandb
- Parameters:
config – config dictionary to write out
- write_image(name: str, image: Float[Tensor, 'H W C'], step: int, caption=None)#
Write an image to the writer.
- Parameters:
name (str) – The name of the image.
image (Float[Tensor, "H W C"]) – The image.
step (int) – The step of the image.
caption (Union[str, None], optional) – The caption of the image, by default None
- write_scalar(name: str, scalar: float | Tensor, step: int)#
Write a scalar value to the writer.
- Parameters:
name (str) – The name of the scalar.
scalar (Union[float, torch.Tensor]) – The scalar value.
step (int) – The step of the scalar.
- class pointrix.logger.writer.Writer(log_dir: Path)#
Bases:
object
Base class for writers.
- Parameters:
log_dir (Path) – The directory to save the logs.
- abstract write_config(name: str, config_dict: Dict[str, Any], step: int)#
Write a config to the writer.
- Parameters:
name (str) – The name of the config.
config_dict (Dict[str, Any]) – The config.
step (int) – The step of the config.
- abstract write_image(name: str, image: Float[Tensor, 'H W C'], step: int, caption: str | None = None)#
Write an image to the writer.
- Parameters:
name (str) – The name of the image.
image (Float[Tensor, "H W C"]) – The image.
step (int) – The step of the image.
caption (Union[str, None], optional) – The caption of the image, by default None
- abstract write_scalar(name: str, scalar: float | Tensor, step: int)#
Write a scalar value to the writer.
- Parameters:
name (str) – The name of the scalar.
scalar (Union[float, torch.Tensor]) – The scalar value.
step (int) – The step of the scalar.
- pointrix.logger.writer.logproject(file_dir: Path, save_dir: Path, suffix: str)#
Filter files with suffix and save them to save_dir.