当前位置: 首页>>代码示例>>Python>>正文


Python legion.legion_parameters函数代码示例

本文整理汇总了Python中pyclustering.nnet.legion.legion_parameters函数的典型用法代码示例。如果您正苦于以下问题:Python legion_parameters函数的具体用法?Python legion_parameters怎么用?Python legion_parameters使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了legion_parameters函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: template_segmentation_image

def template_segmentation_image(image_file, parameters, steps, time, ccore_flag = True):
    image = read_image(image_file);
    stimulus = rgb2gray(image);
    
    for pixel_index in range(len(stimulus)):
        if (stimulus[pixel_index] < 235): stimulus[pixel_index] = 1;
        else: stimulus[pixel_index] = 0;
    
    if (parameters is None):
        parameters = legion_parameters();
    
    net = legion_network(len(stimulus), parameters, conn_type.GRID_FOUR, ccore = ccore_flag);
    output_dynamic = net.simulate(steps, time, stimulus);
    
    ensembles = output_dynamic.allocate_sync_ensembles();
    
    draw_image_mask_segments(image_file, ensembles);
    # draw_dynamics(output_dynamic.time, output_dynamic.output, x_title = "Time", y_title = "x(t)", separate = ensembles);
    
    # just for checking correctness of results - let's use classical algorithm
    dbscan_instance = dbscan(image, 3, 4, True);
    dbscan_instance.process();
    trustable_clusters = dbscan_instance.get_clusters();
    
    draw_dynamics(output_dynamic.time, output_dynamic.output, x_title = "Time", y_title = "x(t)", separate = trustable_clusters);
开发者ID:Gudui,项目名称:pyclustering,代码行数:25,代码来源:legion_segmentation.py

示例2: thirteen_oscillator_three_stimulated_ensembles_list

def thirteen_oscillator_three_stimulated_ensembles_list():
    "Good example of three synchronous ensembels"
    "Not accurate due to false skipes are observed"
    parameters = legion_parameters();
    parameters.Wt = 4.0;
    parameters.fi = 0.8;
    template_dynamic_legion(15, 1000, 1000, conn_type = conn_type.LIST_BIDIR, stimulus = [1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1], params = parameters, separate_repr = [ [0, 1, 2], [3, 4, 5, 9, 10], [6, 7, 8], [11, 12, 13, 14] ]);
开发者ID:weihuang0908,项目名称:pyclustering,代码行数:7,代码来源:legion_examples.py

示例3: simple_segmentation_example

def simple_segmentation_example():
    "Perfect results!"
    parameters = legion_parameters();
    parameters.eps = 0.02;
    parameters.alpha = 0.005;
    parameters.betta = 0.1;
    parameters.gamma = 7.0;
    parameters.teta = 0.9;
    parameters.lamda = 0.1;
    parameters.teta_x = -0.5;
    parameters.teta_p = 7.0;
    parameters.Wz = 0.7;
    parameters.mu = 0.01;
    parameters.fi = 3.0;
    parameters.teta_xz = 0.1;
    parameters.teta_zx = 0.1;
    
    parameters.ENABLE_POTENTIONAL = False;
    template_dynamic_legion(81, 2500, 2500, 
                            conn_type = conn_type.GRID_FOUR, 
                            params = parameters, 
                            stimulus = [1, 1, 1, 0, 0, 0, 0, 0, 0, 
                                        1, 1, 1, 0, 0, 1, 1, 1, 1, 
                                        1, 1, 1, 0, 0, 1, 1, 1, 1, 
                                        0, 0, 0, 0, 0, 0, 1, 1, 1,
                                        0, 0, 0, 0, 0, 0, 1, 1, 1,
                                        1, 1, 1, 1, 0, 0, 1, 1, 1,
                                        1, 1, 1, 1, 0, 0, 0, 0, 0,
                                        1, 1, 1, 1, 0, 0, 0, 0, 0,
                                        1, 1, 1, 1, 0, 0, 0, 0, 0],
                            separate_repr = [ [0, 1, 2, 9, 10, 11, 18, 19, 20], 
                                              [14, 15, 16, 17, 23, 24, 25, 26, 33, 34, 35, 42, 43, 44, 51, 52, 53], 
                                              [45, 46, 47, 48, 54, 55, 56, 57, 63, 64, 65, 66, 72, 73, 74, 75] ]);
开发者ID:alishakiba,项目名称:pyclustering,代码行数:33,代码来源:legion_examples.py

示例4: sixteen_oscillator_two_stimulated_ensembles_grid

def sixteen_oscillator_two_stimulated_ensembles_grid():
    "Not accurate false due to spikes are observed"
    parameters = legion_parameters();
    parameters.teta_x = -1.1;
    template_dynamic_legion(16, 2000, 1500, conn_type = conn_type.GRID_FOUR, params = parameters, stimulus = [1, 1, 1, 0, 
                                                                                                              1, 1, 1, 0, 
                                                                                                              0, 0, 0, 1, 
                                                                                                              0, 0, 1, 1]);
开发者ID:weihuang0908,项目名称:pyclustering,代码行数:8,代码来源:legion_examples.py

示例5: testUstimulatedOscillatorWithoutLateralPotential

 def testUstimulatedOscillatorWithoutLateralPotential(self):
     params = legion_parameters();
     params.teta = 0;    # because no neighbors at all
   
     net = legion_network(1, type_conn = conn_type.NONE, parameters = params, ccore = False);
     dynamic = net.simulate(1000, 200, [0]);
      
     assert extract_number_oscillations(dynamic.output, amplitude_threshold = 0.0) == 0;
开发者ID:annoviko,项目名称:pyclustering,代码行数:8,代码来源:ut_legion.py

示例6: testStimulatedOscillatorWithoutLateralPotential

 def testStimulatedOscillatorWithoutLateralPotential(self):
     params = legion_parameters();
     params.teta = 0;    # because no neighbors at all
      
     net = legion_network(1, type_conn = conn_type.NONE, parameters = params, ccore = False);
     dynamic = net.simulate(2000, 400, [1]);
      
     assert extract_number_oscillations(dynamic.output) > 1;
开发者ID:annoviko,项目名称:pyclustering,代码行数:8,代码来源:ut_legion.py

示例7: testStimulatedOscillatorWithoutLateralPotential

 def testStimulatedOscillatorWithoutLateralPotential(self):
     params = legion_parameters();
     params.teta = 0;    # because no neighbors at all
      
     net = legion_network(1, [1], type_conn = conn_type.NONE, parameters = params);
     (t, x, z) = net.simulate(1000, 200);
      
     assert extract_number_oscillations(x) > 1;      
开发者ID:weihuang0908,项目名称:pyclustering,代码行数:8,代码来源:legion_tests.py

示例8: testUnstimulatedTwoOscillators

 def testUnstimulatedTwoOscillators(self):
     params = legion_parameters();
     params.teta_p = 2.5;
      
     net = legion_network(2, [0, 0], type_conn = conn_type.LIST_BIDIR, parameters = params);
     (t, x, z) = net.simulate(1000, 1000);
      
     assert extract_number_oscillations(x, 0) == 1;
     assert extract_number_oscillations(x, 1) == 1;
开发者ID:weihuang0908,项目名称:pyclustering,代码行数:9,代码来源:legion_tests.py

示例9: segmentation_image_simple1

def segmentation_image_simple1():
    "Perfect"
    parameters = legion_parameters();
    parameters.eps = 0.02;
    parameters.alpha = 0.005;
    parameters.betta = 0.1;
    parameters.gamma = 7.0;
    parameters.teta = 0.9;
    parameters.lamda = 0.1;
    parameters.teta_x = -0.5;
    parameters.teta_p = 7.0;
    parameters.Wz = 0.7;
    parameters.mu = 0.01;
    parameters.fi = 3.0;
    parameters.teta_xz = 0.1;
    parameters.teta_zx = 0.1;
    
    parameters.ENABLE_POTENTIONAL = False;
    
    template_segmentation_image(IMAGE_SIMPLE_SAMPLES.IMAGE_SIMPLE12, parameters, 2000, 2000, True);
开发者ID:Gudui,项目名称:pyclustering,代码行数:20,代码来源:legion_segmentation.py

示例10: three_oscillator_mix_stimulated_list

def three_oscillator_mix_stimulated_list():
    parameters = legion_parameters();
    parameters.Wt = 4.0;
    template_dynamic_legion(3, 1500, 1500, conn_type = conn_type.LIST_BIDIR, stimulus = [1, 0, 1], params = parameters);
开发者ID:weihuang0908,项目名称:pyclustering,代码行数:4,代码来源:legion_examples.py

示例11: three_oscillator_unstimulated_list

def three_oscillator_unstimulated_list():
    parameters = legion_parameters();
    parameters.teta = 0;    # because no stmulated neighbors
    
    template_dynamic_legion(3, 2000, 200, conn_type = conn_type.LIST_BIDIR, params = parameters);
开发者ID:weihuang0908,项目名称:pyclustering,代码行数:5,代码来源:legion_examples.py

示例12: one_oscillator_stimulated

def one_oscillator_stimulated():
    parameters = legion_parameters();
    parameters.teta = 0;    # because no neighbors at all
    
    template_dynamic_legion(1, 2000, 500, stimulus = [1], params = parameters);
开发者ID:weihuang0908,项目名称:pyclustering,代码行数:5,代码来源:legion_examples.py

示例13: one_oscillator_unstimulated

def one_oscillator_unstimulated():
    parameters = legion_parameters();
    parameters.teta = 0;    # because no neighbors at all
    
    template_dynamic_legion(1, 2000, 500, conn_type.NONE, [0], parameters);
开发者ID:alishakiba,项目名称:pyclustering,代码行数:5,代码来源:legion_examples.py

示例14: testOutputDynamicInformation

 def testOutputDynamicInformation(self):
     LegionTestTemplates.templateOutputDynamicInformation([1, 0, 1], legion_parameters(), conn_type.LIST_BIDIR, 100, 100, False);
开发者ID:annoviko,项目名称:pyclustering,代码行数:2,代码来源:ut_legion.py

示例15: testSyncEnsembleAllocationThreeMixStimulatedOscillators

 def testSyncEnsembleAllocationThreeMixStimulatedOscillators(self):
     parameters = legion_parameters();
     parameters.Wt = 4.0;
     LegionTestTemplates.templateSyncEnsembleAllocation([1, 0, 1], None, conn_type.LIST_BIDIR, 1500, 1500, [[0, 2], [1]], False);
开发者ID:annoviko,项目名称:pyclustering,代码行数:4,代码来源:ut_legion.py


注:本文中的pyclustering.nnet.legion.legion_parameters函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。