Beispiel #1
0
 def root_defaults(self):
     defaults = {
         'rate_limit': 1000,
         'synapse': {
             'max_level': 30000,
             'learn_rate': 10,
             'learn_threshold': 1000,
             'spike_learn_threshold': 0,
             'spike_forget_threshold': 0,
         },
         'layers': [{
             'threshold': 30000,
             'relaxation': 1000,
             'is_inhibitory': False,
             'spike_cost': 10, # we want one spike per 10 ticks
             'max_vitality': types.max(types.vitality),
             'connect': [{
                 'radius': 1,
                 'shift': [0, 0],
             }]
             # 'name': required,
             # 'width': required,
             # 'height': required,
         }],
         'domains': [{
             'stat_size': 1000,
             'device': {
                 'type': 'OpenCL',
             },
         }]
     }
     set_default(self, {'defaults': defaults})
     for key in ['layers', 'domains']:
         if key not in self['defaults']:
             self['defaults'][key] = deepcopy(defaults[key])
     set_default(self, self['defaults'])
Beispiel #2
0
 def layer_defaults(self, layer):
     layer_defaults = self['defaults']['layers'][0]
     set_default(layer, layer_defaults)
Beispiel #3
0
 def domain_defaults(self, domain):
     domain_defaults = self['defaults']['domains'][0]
     set_default(domain, domain_defaults)
     for domain_layer in domain.get('layers', []):
         self.domain_layer_defaults(domain_layer)