e_indices = np.random.choice(range(N_fore), size=samples_per_epoch, replace=True)
时间: 2024-06-01 07:12:25 浏览: 135
python np.random.choice方法
5星 · 资源好评率100%
This line of code generates a random sample of indices from the range of 0 to N_fore (exclusive) with a specified size of samples_per_epoch. The parameter "replace=True" allows for repeated sampling of the same index. This is commonly used in machine learning for creating mini-batches during training.
阅读全文