artist.raytracing.sampling
Classes
Initialize the dataset. |
|
Set up a custom distributed sampler to assign data to each rank or leave them idle. |
Module Contents
- class artist.raytracing.sampling.DistortionsDataset(light_source: artist.scene.light_source.LightSource, number_of_points_per_heliostat: int, number_of_active_heliostats: int, random_seed: int = 7)
Bases:
torch.utils.data.DatasetInitialize the dataset.
This class implements a custom dataset according to the
torchinterface. The content of this dataset are the distortions. The distortions are used in our version of “heliostat”-tracing to indicate how each incoming ray must be multiplied and scattered on the heliostat. According totorch, this dataset must implement a function to return the length of the dataset and one function to retrieve an element through an index.Parameters
- light_sourceLightSource
The light source used to model the distortions.
- number_of_points_per_heliostatint
The number of points on the heliostats for which distortions are created.
- number_of_active_heliostatsint
The number of active heliostats in the scenario.
- random_seedint
The random seed used for generating the distortions (default is 7).
- class artist.raytracing.sampling.RestrictedDistributedSampler(number_of_samples: int, number_of_active_heliostats: int, world_size: int = 1, rank: int = 0)
Bases:
torch.utils.data.SamplerSet up a custom distributed sampler to assign data to each rank or leave them idle.
Parameters
- number_of_samplesint
Length of the dataset or total number of samples.
- number_of_active_heliostatsint
Number of active heliostats.
- world_sizeint
World size or total number of processes (default is 1).
- rankint
Rank of the current process (default is 0).
- rank_indices = []