What value to put for the target vector in training neural network?

247 Views Asked by At

I am training a neural network to recognize image of a fruit(apple). I have taken 120 images of size 8x8 of which 40 are positive and remaining are negative. So my input is 64x120 and my target vector is 1x120. But what will be the values in my target vector? How do i assign it? Previously, i have assigned target = 1x120 matrix (first 40 column = 1 and last 80 column = 0) as the first 40 are positive images. Is this correct?

1

There are 1 best solutions below

2
On

The input should be for a single image, so a 64 vector, and the output should be a yes no value, so a scalar (vector of 1 element) with a value of 1 for positive, and 0 for negative.

Other values may be used, depending on your network layers. For example +1,-1 or 0.95,0.05