Joseph Redmon
2014-11-18 d407bffde934ea4c1ee392f24cdf26d9a987199b
src/data.c
@@ -19,6 +19,12 @@
    return lines;
}
void fill_truth_det(char *path, float *truth)
{
    find_replace(path, "imgs", "det");
    find_replace(path, ".JPEG", ".txt");
}
void fill_truth(char *path, char **labels, int k, float *truth)
{
    int i;
@@ -172,7 +178,7 @@
    return d;
}
void get_batch(data d, int n, float *X, float *y)
void get_random_batch(data d, int n, float *X, float *y)
{
    int j;
    for(j = 0; j < n; ++j){
@@ -182,6 +188,17 @@
    }
}
void get_next_batch(data d, int n, int offset, float *X, float *y)
{
    int j;
    for(j = 0; j < n; ++j){
        int index = offset + j;
        memcpy(X+j*d.X.cols, d.X.vals[index], d.X.cols*sizeof(float));
        memcpy(y+j*d.y.cols, d.y.vals[index], d.y.cols*sizeof(float));
    }
}
data load_all_cifar10()
{
    data d;