data file input

Discussion in 'C++' started by GB, Oct 22, 2006.

  1. GB

    GB Guest

    Help needed: in the C++ code of Backprapagation I am using data in the
    way shwon below.
    I need to change the program, so that it reads same data (actually I
    need to put more complex data, for 64 inputs and 5 outputs; that is why
    I need this change - too bulky to use in the code) but for the input
    data file.
    The question is - what exactly code going to accomplish that and how do
    I organise the data file.
    Thanking in advance
    GB
    ======================
    // read in the data
    void initData(void)
    {
    printf("initialising data\n");
    // the data here is the XOR data
    // it has been rescaled to the range
    // [-1][1]
    // an extra input valued 1 is also added
    // to act as the bias
    // the output must lie in the range -1 to 1

    trainInputs[0][0] = 1;
    trainInputs[0][1] = -1;
    trainInputs[0][2] = 1; //bias
    trainOutput[0] = 1;

    trainInputs[1][0] = -1;
    trainInputs[1][1] = 1;
    trainInputs[1][2] = 1; //bias
    trainOutput[1] = 1;

    trainInputs[2][0] = 1;
    trainInputs[2][1] = 1;
    trainInputs[2][2] = 1; //bias
    trainOutput[2] = -1;

    trainInputs[3][0] = -1;
    trainInputs[3][1] = -1;
    trainInputs[3][2] = 1; //bias
    trainOutput[3] = -1;

    }
    GB, Oct 22, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    392
  2. Roberto
    Replies:
    3
    Views:
    308
  3. Walter
    Replies:
    6
    Views:
    236
    Bob Barrows [MVP]
    Sep 17, 2004
  4. Stephen Moon

    reading output file data as input data

    Stephen Moon, Feb 28, 2004, in forum: Perl Misc
    Replies:
    5
    Views:
    173
    Tad McClellan
    Feb 29, 2004
  5. Tarkeshwar
    Replies:
    2
    Views:
    188
Loading...

Share This Page