I use np.random.choice to get random index but run into the following error.
TypeError: only integer scalar arrays can be converted to a scalar index. Any suggestion would be much appreciated.
x_train = [0,1,2,3,4]
train_size = 4
batch_size =3
batch_mask = np.random.choice(train_size, batch_size)
print(batch_mask)
x_batch = x_train[batch_mask]
print(x_batch)