python - Sequence Pattern recognition with Pybrain -
I am constantly trying to use recurrent neural networks to classify a series of data. To be more specific, I have a sequence of sensor reading (which is continuous over time), I have to learn an algorithm which can detect the state related to this pattern, given the readings change.
Example:
Time step_1: 1.4
Time step_2: 1
Time step_3: 0.8
State = New Sequence:
Time Phase 1: 0.4
Time Phase 2: 0.3
Time Phase 3: 0.1
State = Sitting
I actually have 12 censors, I'm just showing a sequence of numbers for convenience. (Numbers are not real, I'm just trying to fulfill this idea)!
I am trying to make my network with PyBrain RNN, however, I can not get a Data Set Container that can detect it, like information I tried to use sequential data But after some testing I came to know that this number is the next element in the sequence of numbers. Here's how I prepare my dataset:
self.alldata = SequentialDataSet (ds.num_features, 1) # Now add samples to the data set. Idx = 1 self.alldata.newSequence () for samples in ds.all_moves: self.alldata.addSample (sample.get_features (), [ds.get_classes (.) Index (sample.class_)]) IDX + = 1 (Idx% 6 == 0): # I want 6 consecutive readings at one time pdb.set_trace () self.alldata.newSequence () self.tstdata, self.trndata = self.alldata.splitWithProportion (0.25) How can I do this differently but any thoughts, does this deal with Payberg deal with classification problem?
a solution
You can implement this strategy:
You probably should have an additional input with 12 sensor inputs, which The timestep represents the classification from T-1, I have shown only 4 inputs to the diagram.
Comments
Post a Comment