irtk.model.Model

class irtk.model.Model(scene: Any)

Abstract base class for models. A model optimizes certain scene parameters and can be combined with other models to form an inverse rendering pipeline. Encapsulating an inverse rendering algorithm in a model promotes reusability. For example, you can combine existing models with your own to quickly form a new inverse rendering pipeline.

scene

The scene object associated with the model.

__init__(scene: Any) None

Initialize the Model.

Parameters:

scene – The scene object associated with the model.

get_regularization() torch.Tensor

Get the regularization term.

Returns:

A torch tensor containing the regularization value.

abstract get_results() Any

Get the results of the model. Must be implemented by subclasses.

initialize() None

Initialize the model. Can be overridden by subclasses.

load_states(state_path: str) None

Load the model states from a file.

Parameters:

state_path – The path to load the states from.

save_states(state_path: str) None

Save the model states to a file.

Parameters:

state_path – The path to save the states to.

schedule_lr(curr_iter: int) None

Schedule the learning rate.

Parameters:

curr_iter – The current iteration number.

abstract set_data() None

Set the data for the model. Must be implemented by subclasses.

abstract step() None

Perform a step in the model. Must be implemented by subclasses.

abstract write_results(result_path: str) None

Write the results to a file.

Parameters:

result_path – The path to write the results to.

abstract zero_grad() None

Zero out the gradients. Must be implemented by subclasses.