data#
import tensorwaves.data
The data
module takes care of data generation.
- class NumpyDomainGenerator(boundaries: dict[str, tuple[float, float]])[source]#
Bases:
DataGenerator
Generate a uniform
DataSample
as a domain for aFunction
.- Parameters:
boundaries – A mapping of the keys in the
DataSample
that is to be generated. The boundaries have to be atuple
of a minimum and a maximum value that define the range for each key in theDataSample
.
- generate(size: int, rng: RealNumberGenerator) DataSample [source]#
Generate a
DataSample
withsize
events.- Returns:
A
tuple
of aDataSample
with an array of weights.
- class IntensityDistributionGenerator(domain_generator: DataGenerator, function: Function, domain_transformer: DataTransformer | None = None, bunch_size: int = 50000)[source]#
Bases:
DataGenerator
Generate an hit-and-miss
DataSample
distribution for aFunction
.- Parameters:
domain_generator – A
DataGenerator
that can be used to generate a domainDataSample
over which to evaluate thefunction
.function – An intensity
Function
with which the output distributionDataSample
is generated using a hit-and-miss strategy.domain_transformer – Optional
DataTransformer
that can convert a generated domainDataSample
to aDataSample
that thefunction
can take as input.bunch_size – Size of a bunch that is generated during a hit-and-miss iteration.
- generate(size: int, rng: RealNumberGenerator) DataSample [source]#
Generate a
DataSample
withsize
events.- Returns:
A
tuple
of aDataSample
with an array of weights.
Submodules and Subpackages