Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_net missing one case? #1

Open
K0IN opened this issue Feb 18, 2021 · 0 comments
Open

test_net missing one case? #1

K0IN opened this issue Feb 18, 2021 · 0 comments

Comments

@K0IN
Copy link

K0IN commented Feb 18, 2021

test_net misses one iteration and therefore always displays one misses one (correct) case,

image
image
image

test code:

int main(int argc, char **argv)
{
    float in_0[] = {0, 0};
    float in_1[] = {0, 1};
    float in_2[] = {1, 0};
    float in_3[] = {1, 1};

    float *in[4] = {
        in_0, in_1, in_2, in_3};

    float f[] = {0, 1, 1, 0};

    float *tg[4] = {
        &f[0],
        &f[1],
        &f[2],
        &f[3],
    };

    Dim dim = {4, 2};
    const int n_epoch = 200;

    float J[n_epoch];
    float acc[n_epoch];

    Dim in_size = {4, 5};
    Dim out_out = {5, 1};

    NeuralNet *ann = create_net(in_size, out_out);
    // add_hidden_layer(ann, 10);

    train_net(ann, in, tg, J, acc, dim, n_epoch);

    test_net(ann, in, tg, dim);
    print_net(ann);
    free_net(ann);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant