SiaNet/Data/DataFrame.cs
/// <summary>
/// Get batch data with specified start index and size
/// </summary>
/// <param name="start">The start.</param>
/// <param name="size">The size.</param>
/// <param name="axis">The axis.</param>
/// <returns></returns>
Get batch data with specified start index and size
Get batch data with specified start index and size
public Tensor GetBatch(int start, int size, int axis = 0)
        {
            NDArray data = null;
            if (start + size <= Shape[0])
            {
                return K.SliceRows(GetTensor(), start, start + size - 1);
            }
            else
            {
                return K.SliceRows(GetTensor(), start, Shape[0] - 1);
            }
        }
public Tensor GetBatch ( int start , int size , int axis = 0 ) { NDArray data = null ; if ( start + size <= Shape [ 0 ] ) { return K . SliceRows ( GetTensor ( ) , start , start + size - 1 ) ; } else { return K . SliceRows ( GetTensor ( ) , start , Shape [ 0 ] - 1 ) ; } }
Get batch data with specified start index and size
Get batch data with specified start index and size
//data = UnderlayingVariable[new NDArray(Enumerable.Range(start, size).ToArray())]; //int count = (int)Shape[0] - start; //data = UnderlayingVariable[new NDArray(Enumerable.Range(start, count).ToArray())]; //return K.CreateVariable(data.Data<float>(), BackendUtil.Int2Long(data.shape));
None
start
int
None
size
int
None
axis
int
None