26 template<
typename SAMPLEDLOSSFUNC>
requires concepts::sampledlossfunction<SAMPLEDLOSSFUNC>
52 for(
size_t i=0; i <
_index.size(); ++i)
64 inline Value
operator()(Size_t idx, Mask mask=
true)
const
67 if(bbm::none(mask))
return 0;
78 for(
size_t i; i <
_index.size(); ++i)
79 err +=
operator()(i, mask);
All BBM methods are defined to operate on a variety of value types and spectrum types....
Definition: vector_util.h:27
sampled loss function concept
Definition: sampledlossfunction.h:27
sampled loss function contract
#define BBM_CHECK_CONCEPT(CONCEPTNAME, CLASSNAME,...)
Check a class for a concept with bbm::concepts::archetypes in the namespace.
Definition: macro.h:35
Definition: aggregatebsdf.h:29
Random generator wrapper around Drjit's PCG32.
Definition: random.h:34
Value operator()(Size_t idx, Mask mask=true) const
Compute the loss over the I-th sample.
Definition: batch.h:64
void update(void)
Init the list of random indices.
Definition: batch.h:48
Size_t samples(void) const
Returns the number of samples.
Definition: batch.h:59
bbm::rng< Size_t > _rng
Definition: batch.h:89
SAMPLEDLOSSFUNC _sampledlossfunc
Definition: batch.h:91
batch(size_t batchsize, const SAMPLEDLOSSFUNC &sampledlossfunc, seed_t seed=default_seed)
Constructor.
Definition: batch.h:40
BBM_IMPORT_CONFIG(SAMPLEDLOSSFUNC)
Value operator()(Mask mask=true) const
Compute loss over all samples.
Definition: batch.h:75
bbm::vector< Size_t > _index
Definition: batch.h:90
Definition: sampledlossfunction.h:46
Extensions for the STL vector class.