В нем также говорится, что, изменяя биты аргументов, можно поднять ограничение до максимума 2 ** 64 (для меня этого достаточно).
Код: Выделить всё
sampler = qmc.Sobol(d=2, scramble=True, bits=64)Вот это код в минимальной воспроизводимой версии
Код: Выделить всё
from scipy.stats import qmc
from tqdm import tqdm
def run_simulation_batch_cupy_QMC(samples, a):
batch_size = 2 ** 27
n_batches = samples // batch_size
sampler = qmc.Sobol(d=2, scramble=True, bits=64)
for i in tqdm(range(n_batches)):
qmc_samples = sampler.random(n=batch_size)
#Here there is some computation I cut off
if __name__ == "__main__":
samples = 2 ** 34 #Samples must be, to get the bug, greater than 10 ** 10 and a power of 2 so 2**34
a_values = [1.1, 1.2, 1.3] #Example
for a in tqdm(a_values):
run_simulation_batch_cupy_QMC(samples, a)
Подробнее здесь: https://stackoverflow.com/questions/797 ... -25-of-the
Мобильная версия