Skip to content

Commit

Permalink
mlmc batch size now accounts for jumps
Browse files Browse the repository at this point in the history
  • Loading branch information
piers-hinds committed May 4, 2023
1 parent b907976 commit f55373b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sde_mc/mlmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ def get_optimal_trials(trials, levels, epsilon, solver, payoff, discounter):
return optimal_trials.ceil().long().tolist()


def mlmc_bs_from_trials(trials, levels, max_mem=5*10**8, dim=1):
return torch.minimum(max_mem / (dim * torch.tensor(levels)), trials).ceil().long()
def mlmc_bs_from_trials(trials, levels, max_mem=5*10**8, dim=1, max_jumps=0):
return torch.minimum(max_mem / (dim * (torch.tensor(levels) + max_jumps)), trials).ceil().long()

0 comments on commit f55373b

Please sign in to comment.