def testOnSequenceData(module, dataset):
 target = dataset.getField('target')
 output = ModuleValidator.calculateModuleOutput(module, dataset)
 ends = SequenceHelper.getSequenceEnds(dataset)
 summed_output = zeros(dataset.outdim)
 class_output = []
 class_target = []
 for j in range(len(output)):
  summed_output += output[j]
  if (j in ends):
   class_output.append(argmax(summed_output))
   class_target.append(argmax(target[j]))
   summed_output = zeros(dataset.outdim)
 class_output = array(class_output)
 class_target = array(class_target)
 return Validator.classificationPerformance(class_output, class_target)

def testOnSequenceData ( module , dataset ) : target = dataset . getField ( 'target' ) output = ModuleValidator . calculateModuleOutput ( module , dataset ) ends = SequenceHelper . getSequenceEnds ( dataset ) summed_output = zeros ( dataset . outdim ) class_output = [ ] class_target = [ ] for j in range ( len ( output ) ) : summed_output += output [ j ] if ( j in ends ) : class_output . append ( argmax ( summed_output ) ) class_target . append ( argmax ( target [ j ] ) ) summed_output = zeros ( dataset . outdim ) class_output = array ( class_output ) class_target = array ( class_target ) return Validator . classificationPerformance ( class_output , class_target )
fetch targets and calculate the modules output on dataset .