コード例 #1
0
ファイル: Segments.py プロジェクト: yanyan-cas/tstop
 def fromJSONDict(cls, json):
     return cls(segment_start = cond_get(json, 'segment_start'),
                labels        = cond_get(json, 'labels'),
                filename      = cond_get(json, 'filename'),
                learning      = cond_get(json, 'learning'),
                window_size   = cond_get(json, 'window_size'),
                data_index    = cond_get(json, 'data_index'),
                tau           = cond_get(json, 'tau'))
コード例 #2
0
ファイル: CrossValidation.py プロジェクト: yanyan-cas/tstop
 def fromJSONDict(cls, json):
     return cls(None, 
                config=Configuration.fromJSONDict(json['config']),
                kernel_module=cond_get(json, 'kernel_module'), 
                kernel_arg=cond_get(json, 'kernel_arg'),
                distances_module=cond_get(json, 'distances_module'), 
                distances_arg=cond_get(json, 'distances_arg'),
                learning_module=cond_get(json, 'learning_module'), 
                learning_arg=cond_get(json, 'learning_arg'), 
                partitions=cond_get(json, 'partitions'))
コード例 #3
0
ファイル: Configuration.py プロジェクト: gpersistence/tstop
def ArgsIter(args_l):
    for args in args_l :
        # make all the variable entries lists if they aren't already
        iterargs = dict(map(lambda x: (x, cond_get_list(args,x)), 
                            ['segment_size', 'segment_stride', 'window_size', 'window_stride', \
                             'max_simplices', 'persistence_epsilon', 'post_process_arg']))
        if not ('data_index' in args.keys()) or args['data_index'] == None :
            iterargs['data_index'] = [None]
        elif not isinstance(args['data_index'], list) :
            iterargs['data_index'] = [args['data_index']]
        else :
            if isinstance(args['data_index'][0], list) :
                iterargs['data_index'] = args['data_index']
            else :
                iterargs['data_index'] = [args['data_index']]
        for (data_index, segment_size, segment_stride, window_size,
             window_stride, max_simplices, persistence_epsilon, post_process_arg) in \
            itertools.product(iterargs['data_index'], 
                              iterargs['segment_size'], 
                              iterargs['segment_stride'], 
                              iterargs['window_size'], 
                              iterargs['window_stride'], 
                              iterargs['max_simplices'],
                              iterargs['persistence_epsilon'],
                              iterargs['post_process_arg']) :
            yield Configuration(max_simplices, 
                                persistence_epsilon, 
                                segment_stride,
                                segment_size, 
                                window_size, 
                                window_stride,
                                cond_get(args,'kernel_scale'), 
                                cond_get(args,'kernel_gamma'), 
                                cond_get(args,'invariant_epsilon'), 
                                cond_get(args, 'data_file'), 
                                data_index,
                                cond_get(args,'label_index'),
                                cond_get(args,'out_directory'), 
                                cond_get(args,'threads'),
                                cond_get(args,'learning_split'),
                                cond_get(args,'learning_iterations'), 
                                cond_get(args,'learning_C'),
                                cond_get(args,'cv_iterations'),
                                cond_get(args,'persistence_degree'),
                                cond_get(args,'reevaluate'), 
                                cond_get(args,'data_type'),
                                cond_get(args,'post_process'),
                                post_process_arg,
                                cond_get(args,'stop_after'),
                                cond_get(args,'status'))
コード例 #4
0
ファイル: Configuration.py プロジェクト: gpersistence/tstop
 def fromJSONDict(cls, json) :
     return cls( cond_get(json,'max_simplices'), 
                 cond_get(json,'persistence_epsilon'), 
                 cond_get(json,'segment_stride'),
                 cond_get(json,'segment_size'), 
                 cond_get(json,'window_size'),
                 cond_get(json,'window_stride'), 
                 cond_get(json,'kernel_scale'),
                 cond_get(json,'kernel_gamma'),
                 cond_get(json,'invariant_epsilon'), 
                 cond_get(json,'data_file'), 
                 cond_get(json,'data_index'),
                 cond_get(json,'label_index'), 
                 cond_get(json,'out_directory'),
                 cond_get(json,'threads'), 
                 cond_get(json,'learning_split'),
                 cond_get(json,'learning_iterations'), 
                 cond_get(json,'learning_C'),
                 cond_get(json,'cv_iterations'),
                 cond_get(json,'persistence_degree'), 
                 cond_get(json,'reevaluate'),
                 cond_get(json,'data_type'), 
                 cond_get(json,'post_process'),
                 cond_get(json,'post_process_arg'), 
                 cond_get(json,'stop_after'),
                 cond_get(json,'status'))
コード例 #5
0
 def fromJSONDict(cls, json):
     return cls(cond_get(json,'min'),
                cond_get(json,'mean'),
                cond_get(json,'max'),
                cond_get(json,'std'))
コード例 #6
0
ファイル: Configuration.py プロジェクト: yanyan-cas/tstop
def ArgsIter(args_l):
    for args in args_l:
        # make all the variable entries lists if they aren't already
        iterargs = dict(map(lambda x: (x, cond_get_list(args,x)),
                            ['segment_size', 'segment_stride', 'window_size', 'window_stride', \
                             'max_simplices', 'persistence_epsilon', 'post_process_arg']))
        if not ('data_index' in args.keys()) or args['data_index'] == None:
            iterargs['data_index'] = [None]
        elif not isinstance(args['data_index'], list):
            iterargs['data_index'] = [args['data_index']]
        else:
            if isinstance(args['data_index'][0], list):
                iterargs['data_index'] = args['data_index']
            else:
                iterargs['data_index'] = [args['data_index']]
        for (data_index, segment_size, segment_stride, window_size,
             window_stride, max_simplices, persistence_epsilon, post_process_arg) in \
            itertools.product(iterargs['data_index'],
                              iterargs['segment_size'],
                              iterargs['segment_stride'],
                              iterargs['window_size'],
                              iterargs['window_stride'],
                              iterargs['max_simplices'],
                              iterargs['persistence_epsilon'],
                              iterargs['post_process_arg']) :
            yield Configuration(max_simplices, persistence_epsilon,
                                segment_stride, segment_size, window_size,
                                window_stride, cond_get(args, 'kernel_scale'),
                                cond_get(args, 'kernel_gamma'),
                                cond_get(args, 'invariant_epsilon'),
                                cond_get(args, 'data_file'), data_index,
                                cond_get(args, 'label_index'),
                                cond_get(args, 'out_directory'),
                                cond_get(args, 'threads'),
                                cond_get(args, 'learning_split'),
                                cond_get(args, 'learning_iterations'),
                                cond_get(args, 'learning_C'),
                                cond_get(args, 'cv_iterations'),
                                cond_get(args, 'persistence_degree'),
                                cond_get(args, 'reevaluate'),
                                cond_get(args, 'data_type'),
                                cond_get(args,
                                         'post_process'), post_process_arg,
                                cond_get(args, 'stop_after'),
                                cond_get(args, 'status'))
コード例 #7
0
ファイル: Configuration.py プロジェクト: yanyan-cas/tstop
 def fromJSONDict(cls, json):
     return cls(cond_get(json, 'max_simplices'),
                cond_get(json, 'persistence_epsilon'),
                cond_get(json, 'segment_stride'),
                cond_get(json,
                         'segment_size'), cond_get(json, 'window_size'),
                cond_get(json, 'window_stride'),
                cond_get(json, 'kernel_scale'),
                cond_get(json, 'kernel_gamma'),
                cond_get(json, 'invariant_epsilon'),
                cond_get(json, 'data_file'), cond_get(json, 'data_index'),
                cond_get(json, 'label_index'),
                cond_get(json, 'out_directory'), cond_get(json, 'threads'),
                cond_get(json, 'learning_split'),
                cond_get(json, 'learning_iterations'),
                cond_get(json, 'learning_C'),
                cond_get(json, 'cv_iterations'),
                cond_get(json, 'persistence_degree'),
                cond_get(json, 'reevaluate'), cond_get(json, 'data_type'),
                cond_get(json, 'post_process'),
                cond_get(json, 'post_process_arg'),
                cond_get(json, 'stop_after'), cond_get(json, 'status'))
コード例 #8
0
 def fromJSONDict(cls, json):
     return cls(train=cond_get(json, 'train'),
                test=cond_get(json, 'test'),
                state=cond_get(json, 'state'))
コード例 #9
0
ファイル: Learning.py プロジェクト: yanyan-cas/tstop
 def fromJSONDict(cls, json):
     return cls(Configuration.fromJSONDict(json['config']), 
                cond_get_obj_list(json, 'results', LearningResult),
                cond_get(json, 'kernel_files'))
コード例 #10
0
ファイル: Learning.py プロジェクト: yanyan-cas/tstop
 def fromJSONDict(cls, json) :
     return cls(cond_get(json, 'seed'),
                json['train_labels'], 
                json['test_labels'], 
                json['test_results'], 
                cond_get(json, 'mkl_weights'))
コード例 #11
0
 def fromJSONDict(cls, json):
     return cls(train = cond_get(json, 'train'),
                test  = cond_get(json, 'test'),
                state = cond_get(json, 'state'))
コード例 #12
0
 def fromJSONDict(cls, json):
     return cls(SegmentInfo.fromJSONDict(json['segment_info'])
                if 'segment_info' in json else None,
                points=cond_get(json, 'points'))