This pull request introduces base classes for sampling and an example (namely a uniform box-sampler). Samplers should cater to both continuous and discrete domains. By incorporating abstract base classes Sampler and BoxSampler, alongside a concrete implementation UniformBoxSampler, this pr introduces the groundwork for a flexible and extensible sampling module.
Sampling for operator learning is not only relevant for creating discrete representations of functions but could also be used to extend the capabilities of operators (resampling inside the operator). Therefore should this feature not be tied to the data module.
Which issue does this PR tackle?
Lack of a unified structure for sampling strategies.
How does it solve the problem?
Creation of a new sub-module discrete.
Abstract Base Classes: The introduction of Sampler and BoxSampler abstract base classes. These classes outline essential methods that all derived samplers must implement, such as sampling methods and initialization routines.
Sampler and BoxSampler are distinct classes as not all domains are boxes (spheres, tori, or more complex geometries).
UniformBoxSampler: Serves as a concrete implementation of the BoxSampler abstract class, offering a ready-to-use sampler that uniformly samples within specified bounds. This addition demonstrates the practical application of the new abstract classes.
How are the changes tested?
Unittests:
intialization
delta
within bounds sampling
is uniform distribution
Checklist for Contributors
[x] Scope: This PR tackles exactly one problem.
[x] Conventions: The branch follows the feature/title-slug convention.
[x] Conventions: The PR title follows the Bugfix: Title convention.
[x] Coding style: The code passes all pre-commit hooks.
[x] Documentation: All changes are well-documented.
[x] Tests: New features are tested and all tests pass successfully.
[x] Changelog: Updated CHANGELOG.md for new features or breaking changes.
[x] Review: A suitable reviewer has been assigned.
Checklist for Reviewers:
[x] The PR solves the issue it claims to solve and only this one.
[x] Changes are tested sufficiently and all tests pass.
Feature: Sampler
Description
This pull request introduces base classes for sampling and an example (namely a uniform box-sampler). Samplers should cater to both continuous and discrete domains. By incorporating abstract base classes
Sampler
andBoxSampler
, alongside a concrete implementationUniformBoxSampler
, this pr introduces the groundwork for a flexible and extensible sampling module. Sampling for operator learning is not only relevant for creating discrete representations of functions but could also be used to extend the capabilities of operators (resampling inside the operator). Therefore should this feature not be tied to thedata
module.Which issue does this PR tackle?
How does it solve the problem?
discrete
.Sampler
andBoxSampler
abstract base classes. These classes outline essential methods that all derived samplers must implement, such as sampling methods and initialization routines.Sampler
andBoxSampler
are distinct classes as not all domains are boxes (spheres, tori, or more complex geometries).UniformBoxSampler
: Serves as a concrete implementation of theBoxSampler
abstract class, offering a ready-to-use sampler that uniformly samples within specified bounds. This addition demonstrates the practical application of the new abstract classes.How are the changes tested?
Checklist for Contributors
feature/title-slug
convention.Bugfix: Title
convention.Checklist for Reviewers: