使用Python和NumPy库创建生成器。
示例代码:
import numpy as np
def custom_generator(batch_size): while True: # generate batch samples batch_x = np.random.rand(batch_size, 10) batch_y = np.random.rand(batch_size, 1)
yield batch_x, batch_y
上一篇:不是原生的英特尔OpenCL运行时期望有大量速度损失
下一篇:不是在原有的文件中写入内容,而是创建一个新的文本文件。