Skip to contents

Sample the steps that actually carry loss instead of drawing uniformly.

Usage

importance_weights(step_losses, uniform = FALSE, smoothing = 0.1)

Arguments

step_losses

Numeric per-step losses.

uniform

Use uniform weights.

smoothing

Additive constant in the square-root.

Value

A list with weights, uniform, effective_steps (and note for the importance path).

Examples

importance_weights(step_losses = c(0.9, 0.5, 0.2, 0.1, 0.05))$weights
#> [1] 0.3336740 0.2568082 0.1741145 0.1324369 0.1029664