Skip to content

Change type double to int16_t #57

@lazy-dude

Description

@lazy-dude

Hi,

I want to change all data types from double to int16_t. In genann.h addition :

typedef int16_t ann_t;

Then change every occurrence of double to ann_t. Now modifying example1.c :

const ann_t input[4][2] = {{0, 0}, {0, 1}, {1, 0}, {1, 1}};
const ann_t output[4] = {0, 1, 1, 0};

I also use %hd for printf.

And then , compiling the file example1.c I get the output:

$ ./example1
GENANN example 1.
Train a small ANN to the XOR function using backpropagation.
Output for [0, 0] is 0.
Output for [0, 1] is 0.
Output for [1, 0] is 0.
Output for [1, 1] is 0.

What can I do to get the examples provided to work correctly with new type ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions