Given a dataset, this function will create batches of data for use in traversing the total data set in more manageable segments. You can see how it is called from the GetNextDataBatch() function shown previously:
internal static float[] CreateBatch(float[][] data, int start, int count)
{
var lst = new List<float>();
for (int i = start; i < start + count; i++)
{
if (i >= data.Length)
break;
lst.AddRange(data[i]);
}
return lst.ToArray();
}