Пример #1
0
 def setup(self):
     filePtr = open('tests/icatestsignals.db', 'r')
     signalDict = cPickle.load(filePtr)
     filePtr.close()
     # setup the test data
     self.signals = np.vstack([signalDict[k] for k in signalDict])
     # standardize signals
     self.signals = standardize(self.signals, stdtype='row')
     # mixing
     self.A = np.random.randn(len(self.signals), len(self.signals))
     self.X = np.dot(self.A, self.signals)
     # ica options
     icaOptions = dict()
     icaOptions['nonlinearity'] = 'logcosh'
     icaOptions['maxIterations'] = 500
     icaOptions['tolerance'] = 1.0e-05
     # this is just to get the setup to run; test_has_ica will fail if rpy2ica isn't there
     # other tests may pass if you have pyica installed, however
     try:
         from rpy2ica import fastica
         icaMethod = fastica
     except:
         icaMethod = None
     # RAICAR object
     self.K = 10
     # data logger
     self.logger = Logger('tests/runlog.txt')
     # raicar object
     self.mycar = RAICAR(projDirectory='tests/raicartest',
                         K=self.K,
                         nSignals=3,
                         icaOptions=icaOptions,
                         icaMethod=icaMethod)
Пример #2
0
 def setup(self):
     filePtr = open('tests/icatestsignals.db','r')
     signalDict = cPickle.load(filePtr)
     filePtr.close()
     # setup the test data
     self.signals = np.vstack([signalDict[k] for k in signalDict])
     # standardize signals
     self.signals = standardize(self.signals,stdtype='row')
     # mixing
     self.A = np.random.randn(len(self.signals),len(self.signals))
     self.X = np.dot(self.A,self.signals)
     # ica options
     icaOptions = dict()
     icaOptions['nonlinearity'] = 'logcosh'
     icaOptions['maxIterations'] = 500
     icaOptions['tolerance'] = 1.0e-05
     # this is just to get the setup to run; test_has_ica will fail if rpy2ica isn't there
     # other tests may pass if you have pyica installed, however
     try:
         from rpy2ica import fastica
         icaMethod = fastica
     except:
         icaMethod = None
     # RAICAR object
     self.K = 10
     # data logger
     self.logger = Logger('tests/runlog.txt')
     # raicar object
     self.mycar = RAICAR(projDirectory='tests/raicartest',K=self.K,nSignals=3,icaOptions=icaOptions,icaMethod=icaMethod)