Refinement Interface#
- class RefinementInterface(sample_every, condition_to_update=None)[source]#
Bases:
Callback
Interface class of Refinement approaches.
Initializes the RefinementInterface.
- Parameters:
- on_train_start(trainer, solver)[source]#
Called when the training begins. It initializes the conditions and dataset.
- Parameters:
trainer (Trainer) – The trainer object.
solver (SolverInterface) – The solver object associated with the trainer.
- Raises:
RuntimeError – If the solver is not a PINNInterface.
RuntimeError – If the conditions do not have a domain to sample from.
- on_train_epoch_end(trainer, solver)[source]#
Performs the refinement at the end of each training epoch (if needed).
- Parameters:
~lightning.pytorch.trainer.trainer.Trainer – The trainer object.
solver (PINNInterface) – The solver object.
- abstract sample(current_points, condition_name, solver)[source]#
Samples new points based on the condition.
- Parameters:
current_points – Current points in the domain.
condition_name – Name of the condition to update.
solver (PINNInterface) – The solver object.
- Returns:
New points sampled based on the R3 strategy.
- Return type:
- property dataset#
Returns the dataset for training.
- property initial_population_size#
Returns the dataset for training size.