Beispiel #1
0
EPOCH_STEP = 256 * 5
N_REPLICATES = 5

SPECT_ENT_BANDS = 2 ** np.arange(0,8)/2

fun_to_test = [
                  {"times":100,"name":"hfd", "is_original":True,"fun": lambda x: pyeeg.hfd(x,2**3)},
                  {"times":100,"name":"hfd", "is_original":False,"fun": lambda x: univ.hfd(x,2**3)},
                  {"times":100,"name":"hjorth", "is_original":True,"fun": lambda x: pyeeg.hjorth(x)},
                  {"times":100,"name":"hjorth", "is_original":False,"fun": lambda x: univ.hjorth(x)},
                  {"times":100,"name":"pfd", "is_original":True, "fun":lambda x: pyeeg.pfd(x)},
                  {"times":100,"name":"pfd", "is_original":False, "fun":lambda x: pyeeg.pfd(x)},
                  {"times":2,"name":"samp_ent", "is_original":True, "fun":lambda x: pyeeg.samp_entropy(x,2,1.5)},
                  {"times":10,"name":"samp_ent", "is_original":False, "fun":lambda x: univ.samp_entropy(x,2,1.5,relative_r=False)},
                  {"times":2,"name":"ap_ent", "is_original":True, "fun":lambda x: pyeeg.ap_entropy(x,2,1.5)},
                  {"times":10,"name":"ap_ent", "is_original":False, "fun":lambda x: univ.ap_entropy(x,2,1.5)},
                  {"times":10,"name":"svd_ent", "is_original":True, "fun":lambda x: pyeeg.svd_entropy(x,2,3)},
                  {"times":100,"name":"svd_ent", "is_original":False, "fun":lambda x: univ.svd_entropy(x,2,3)},
                  {"times":10,"name":"fisher_info", "is_original":True, "fun":lambda x: pyeeg.fisher_info(x,2,3)},
                  {"times":100, "name":"fisher_info", "is_original":False, "fun":lambda x: univ.fisher_info(x,2,3)},
                  {"times":100,"name":"spectral_entropy", "is_original":True, "fun":lambda x: pyeeg.spectral_entropy(x,SPECT_ENT_BANDS,256)},
                  {"times":100, "name":"spectral_entropy", "is_original":False, "fun":lambda x: univ.spectral_entropy(x,256, SPECT_ENT_BANDS)},

    ]


def make_one_rep():
    ldfs = []
    for n in range(MIN_EPOCH_N, MAX_EPOCH_N + 1, EPOCH_STEP):
        a = numpy.random.normal(size=n)
        for fun in fun_to_test:
Beispiel #2
0
     "times": 10,
     "name": "samp_ent",
     "is_original": False,
     "fun": lambda x: univ.samp_entropy(x, 2, 1.5, relative_r=False)
 },
 {
     "times": 2,
     "name": "ap_ent",
     "is_original": True,
     "fun": lambda x: pyeeg.ap_entropy(x, 2, 1.5)
 },
 {
     "times": 10,
     "name": "ap_ent",
     "is_original": False,
     "fun": lambda x: univ.ap_entropy(x, 2, 1.5)
 },
 {
     "times": 10,
     "name": "svd_ent",
     "is_original": True,
     "fun": lambda x: pyeeg.svd_entropy(x, 2, 3)
 },
 {
     "times": 100,
     "name": "svd_ent",
     "is_original": False,
     "fun": lambda x: univ.svd_entropy(x, 2, 3)
 },
 {
     "times": 10,
Beispiel #3
0
    def test_ap_entropy(self):
        ref = 0.39260453872556883
        ans = univariate.ap_entropy(white_noise, 2, 1.5)

        self.assertAlmostEqual(ref, ans)
Beispiel #4
0
    def test_ap_entropy(self):
        ref =  0.39260453872556883
        ans = univariate.ap_entropy(white_noise, 2, 1.5)

        self.assertAlmostEqual(ref, ans)