Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In general, if you are training your ANN using back propagation, you are basically training an input-output map. This means that your training set has to comprise known input-output relations (none of your unknown values included in the training set). The ANN then becomes an approximation of the actual relationship between your inputs and outputs.</p> <p>You can then call <code>x = net.activate([seq])</code> where <code>seq</code> is the input sequence associated with the unknown value <code>x</code>.</p> <p>If <code>x</code> is an unknown input sequence for a known result, then you have to call the inverse of the ANN. I do not think there is a simple way of inverting an ANN in pybrain, but you could just train an ANN with the inverse of your original training data. In other words, use your known results as the training inputs, and their associated sequences as the training results.</p> <p>The main thing to consider is the appropriateness of the tool and the training data for what you are trying to do. If you just want to predict <code>x</code> as a function of the previous number, then I think you are training correctly. I am guessing <code>x</code> is going to be a function of the previous <code>n</code> numbers though, in which case you want to update your data set as:</p> <pre><code>n = 10 for ind in range(len(myList)): # Don't overrun our bounds if ind == len(myList)-1: break # Check that our sequence is valid for i in range(ind-n, ind+1): if i &gt;= 0 and myList[i] == "x": # we have an invalid sequence ind += i # start next seq after invalid entry break # Add valid training sequence to data set ds.addSample(myList[ind-n:ind],myList[ind+1]) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload