589442365d133fb993b4ea14b45a9123c6973e46,lazyflow/operators/obsolete/classifierOperators.py,OpTrainRandomForestBlocked,execute,#OpTrainRandomForestBlocked#Any#Any#Any#,117

Before Change


            featMatrix=numpy.concatenate(featMatrix,axis=0)
            labelsMatrix=numpy.concatenate(labelsMatrix,axis=0)

            RF=vigra.learning.RandomForest(100)
            try:
                logger.debug("Learning with Vigra...")
                RF.learnRF(featMatrix.astype(numpy.float32),labelsMatrix.astype(numpy.uint32))
                logger.debug("Vigra finished")
            except:
                logger.error( "ERROR: could not learn classifier" )
                logger.error( "featMatrix shape={}, max={}, dtype={}".format(featMatrix.shape, featMatrix.max(), featMatrix.dtype) )
                logger.error( "labelsMatrix shape={}, max={}, dtype={}".format(labelsMatrix.shape, labelsMatrix.max(), labelsMatrix.dtype ) )
                raise
            finally:
                self.progressSignal(100)
            assert RF is not None, "RF = %r" % RF
            result[0]=RF
        
        return result

    def setInSlot(self, slot, key, value):

After Change


                logger.debug("Learning with Vigra...")
                // train and store self._forest_count forests in parallel
                requests = []
                for i in range(self._forest_count):
                    def train_and_store(number):
                        result[number] = vigra.learning.RandomForest(self._tree_count) 
                        result[number].learnRF(featMatrix.astype(numpy.float32),labelsMatrix.astype(numpy.uint32))
                    req = Request(partial(train_and_store, i))
                    req.submit()
                    requests.append(req)

                for r in requests:
                    r.wait()
                logger.debug("Vigra finished")
            except:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: ilastik/ilastik
Commit Name: 589442365d133fb993b4ea14b45a9123c6973e46
Time: 2012-09-13
Author: christoph.straehle@iwr.uni-heidelberg.de
File Name: lazyflow/operators/obsolete/classifierOperators.py
Class Name: OpTrainRandomForestBlocked
Method Name: execute


Project Name: ilastik/ilastik
Commit Name: efd6b7c39fbefbb1e6f5fdc67ff1d2c64f65d46e
Time: 2012-09-13
Author: christoph.straehle@iwr.uni-heidelberg.de
File Name: lazyflow/operators/obsolete/classifierOperators.py
Class Name: OpTrainRandomForest
Method Name: getOutSlot


Project Name: ilastik/ilastik
Commit Name: ea08da61f3896f02be9b0fdaa1c59612efe273e8
Time: 2013-08-13
Author: Buote.Xu@gmail.com
File Name: ilastik/applets/counting/countingOperators.py
Class Name: OpPredictCounter
Method Name: execute