예제 #1
0
    def __init__(self, synapse_type, machine_time_step, ring_buffer_sigma,
                 spikes_per_second, population_table_type=None):
        self._synapse_type = synapse_type
        self._ring_buffer_sigma = ring_buffer_sigma
        self._spikes_per_second = spikes_per_second
        self._machine_time_step = machine_time_step

        # Get the type of population table
        self._population_table_type = population_table_type
        if population_table_type is None:
            population_table_type = ("MasterPopTableAs" + conf.config.get(
                "MasterPopTable", "generator"))
            algorithms = helpful_functions.get_valid_components(
                master_pop_table_generators, "master_pop_table_as")
            self._population_table_type = algorithms[population_table_type]()

        if self._ring_buffer_sigma is None:
            self._ring_buffer_sigma = conf.config.getfloat(
                "Simulation", "ring_buffer_sigma")

        if self._spikes_per_second is None:
            self._spikes_per_second = conf.config.getfloat(
                "Simulation", "spikes_per_second")

        # Prepare for dealing with STDP
        self._stdp_checked = False
        self._stdp_mechanism = None
    def _set_up_pacman_algorthms_listings(
            self, partitioner_algorithm=None, placer_algorithm=None,
            key_allocator_algorithm=None, routing_algorithm=None,
            tag_allocator_algorithm=None):
        """

        :param partitioner_algorithm:
        :param placer_algorithm:
        :param key_allocator_algorithm:
        :param routing_algorithm:
        :param tag_allocator_algorithm
        :return:
        """

        # algorithm lists
        if partitioner_algorithm is not None:
            partitioner_algorithms = helpful_functions.get_valid_components(
                partition_algorithms, "Partitioner")
            self._partitioner_algorithm = partitioner_algorithms[
                partitioner_algorithm]

        if placer_algorithm is not None:
            place_algorithms = helpful_functions.get_valid_components(
                placer_algorithms, "Placer")
            self._placer_algorithm = place_algorithms[placer_algorithm]

        if tag_allocator_algorithm is not None:
            tag_algorithms = helpful_functions.get_valid_components(
                tag_allocator_algorithms, "TagAllocator")
            self._tag_allocator_algorithm = tag_algorithms[
                tag_allocator_algorithm]

        # get common key allocator algorithms
        if key_allocator_algorithm is not None:
            key_allocator_algorithms = helpful_functions.get_valid_components(
                routing_info_allocator_algorithms, "RoutingInfoAllocator")
            self._key_allocator_algorithm = key_allocator_algorithms[
                key_allocator_algorithm]

        if routing_algorithm is not None:
            routing_algorithms = helpful_functions.get_valid_components(
                router_algorithms, "Routing")
            self._router_algorithm = routing_algorithms[routing_algorithm]
예제 #3
0
    def __init__(self, master_pop_algorithm=None):
        self._stdp_checked = False
        self._stdp_mechanism = None
        self._master_pop_table_generator = None

        if master_pop_algorithm is None:
            master_pop_algorithm = \
                "MasterPopTableAs" + \
                conf.config.get("MasterPopTable", "generator")

        algorithum_list = \
            helpful_functions.get_valid_components(master_pop_table_generators,
                                                   "master_pop_table_as")
        self._master_pop_table_generator = \
            algorithum_list[master_pop_algorithm]()
예제 #4
0
    def __init__(self, master_pop_algorithm=None):
        self._stdp_checked = False
        self._stdp_mechanism = None
        self._master_pop_table_generator = None

        if master_pop_algorithm is None:
            master_pop_algorithm = \
                "MasterPopTableAs" + \
                conf.config.get("MasterPopTable", "generator")

        algorithum_list = \
            helpful_functions.get_valid_components(master_pop_table_generators,
                                                   "master_pop_table_as")
        self._master_pop_table_generator = \
            algorithum_list[master_pop_algorithm]()
예제 #5
0
    def __init__(self, synapse_type, machine_time_step, ring_buffer_sigma,
                 spikes_per_second, population_table_type=None,
                 synapse_io=None):

        self._synapse_type = synapse_type
        self._ring_buffer_sigma = ring_buffer_sigma
        self._spikes_per_second = spikes_per_second
        self._machine_time_step = machine_time_step

        # Get the type of population table
        self._population_table_type = population_table_type
        if population_table_type is None:
            population_table_type = ("MasterPopTableAs" + conf.config.get(
                "MasterPopTable", "generator"))
            algorithms = helpful_functions.get_valid_components(
                master_pop_table_generators, "master_pop_table_as")
            self._population_table_type = algorithms[population_table_type]()

        # Get the synapse IO
        self._synapse_io = synapse_io
        if synapse_io is None:
            self._synapse_io = SynapseIORowBased(machine_time_step)

        if self._ring_buffer_sigma is None:
            self._ring_buffer_sigma = conf.config.getfloat(
                "Simulation", "ring_buffer_sigma")

        if self._spikes_per_second is None:
            self._spikes_per_second = conf.config.getfloat(
                "Simulation", "spikes_per_second")
        self._spikes_per_tick = max(
            1.0,
            self._spikes_per_second /
            (1000000.0 / float(self._machine_time_step)))

        # Prepare for dealing with STDP - there can only be one (non-static)
        # synapse dynamics per vertex at present
        self._synapse_dynamics = SynapseDynamicsStatic()

        # Keep the details once computed to allow reading back
        self._weight_scales = dict()
        self._delay_key_index = dict()
        self._retrieved_blocks = dict()

        # A list of connection holders to be filled in pre-run, indexed by
        # the edge the connection is for
        self._pre_run_connection_holders = defaultdict(list)
예제 #6
0
    def __init__(self,
                 synapse_type,
                 ring_buffer_sigma,
                 spikes_per_second,
                 config,
                 population_table_type=None,
                 synapse_io=None):

        self._synapse_type = synapse_type
        self._ring_buffer_sigma = ring_buffer_sigma
        self._spikes_per_second = spikes_per_second

        # Get the type of population table
        self._population_table_type = population_table_type
        if population_table_type is None:
            population_table_type = ("MasterPopTableAs" +
                                     config.get("MasterPopTable", "generator"))
            algorithms = helpful_functions.get_valid_components(
                master_pop_table_generators, "master_pop_table_as")
            self._population_table_type = algorithms[population_table_type]()

        # Get the synapse IO
        self._synapse_io = synapse_io
        if synapse_io is None:
            self._synapse_io = SynapseIORowBased()

        if self._ring_buffer_sigma is None:
            self._ring_buffer_sigma = config.getfloat("Simulation",
                                                      "ring_buffer_sigma")

        if self._spikes_per_second is None:
            self._spikes_per_second = config.getfloat("Simulation",
                                                      "spikes_per_second")

        # Prepare for dealing with STDP - there can only be one (non-static)
        # synapse dynamics per vertex at present
        self._synapse_dynamics = SynapseDynamicsStatic()

        # Keep the details once computed to allow reading back
        self._weight_scales = dict()
        self._delay_key_index = dict()
        self._retrieved_blocks = dict()

        # A list of connection holders to be filled in pre-run, indexed by
        # the edge the connection is for
        self._pre_run_connection_holders = defaultdict(list)