#include <batch.h>
|
| | BBM_IMPORT_CONFIG (SAMPLEDLOSSFUNC) |
| |
| | batch (size_t batchsize, const SAMPLEDLOSSFUNC &sampledlossfunc, seed_t seed=default_seed) |
| | Constructor.
|
| |
| void | update (void) |
| | Init the list of random indices.
|
| |
| Size_t | samples (void) const |
| | Returns the number of samples.
|
| |
| Value | operator() (Size_t idx, Mask mask=true) const |
| | Compute the loss over the I-th sample.
|
| |
| Value | operator() (Mask mask=true) const |
| | Compute loss over all samples.
|
| |
◆ batch()
| batch |
( |
size_t |
batchsize, |
|
|
const SAMPLEDLOSSFUNC & |
sampledlossfunc, |
|
|
seed_t |
seed = default_seed |
|
) |
| |
|
inline |
Constructor.
Wrapper around sampled loss functions that only evaluates the loss for a subset of the samples. Each update re-randomizes the subset.
- Parameters
-
| batchsize | = size of the batch (same batch size for all packets) |
| sampedlosfunc | = any sampled loss function (to be subsampled). |
◆ BBM_IMPORT_CONFIG()
| BBM_IMPORT_CONFIG |
( |
SAMPLEDLOSSFUNC |
| ) |
|
◆ operator()() [1/2]
| Value operator() |
( |
Mask |
mask = true | ) |
const |
|
inline |
Compute loss over all samples.
◆ operator()() [2/2]
| Value operator() |
( |
Size_t |
idx, |
|
|
Mask |
mask = true |
|
) |
| const |
|
inline |
Compute the loss over the I-th sample.
◆ samples()
| Size_t samples |
( |
void |
| ) |
const |
|
inline |
Returns the number of samples.
◆ update()
Init the list of random indices.
◆ _index
◆ _rng
◆ _sampledlossfunc
| SAMPLEDLOSSFUNC _sampledlossfunc |
|
private |
The documentation for this struct was generated from the following file: