コード例 #1
0
    def __init__(self,
                 n_neurons,
                 spinnaker_link_id,
                 protocol,
                 resolution,
                 board_address=default_parameters['board_address'],
                 label=default_parameters['label']):
        # pylint: disable=too-many-arguments
        if n_neurons is not None and n_neurons != resolution.value.n_neurons:
            logger.warning(
                "The specified number of neurons for the push bot retina"
                " device has been ignored %d will be used instead",
                resolution.value.n_neurons)

        AbstractPushBotRetinaDevice.__init__(self, protocol, resolution)
        ApplicationSpiNNakerLinkVertex.__init__(
            self,
            spinnaker_link_id=spinnaker_link_id,
            n_atoms=resolution.value.n_neurons,
            board_address=board_address,
            label=label)

        # stores for the injection aspects
        self._graph_mapper = None
        self._routing_infos = None
        self._new_key_command = None
コード例 #2
0
    def __init__(self,
                 motor,
                 protocol,
                 spinnaker_link_id,
                 n_neurons=default_parameters['n_neurons'],
                 label=default_parameters['label'],
                 board_address=default_parameters['board_address']):
        """

        :param motor: a PushBotMotor value to indicate the motor to control
        :param protocol: The protocol used to control the device
        :param spinnaker_link_id: The SpiNNakerLink connected to
        :param n_neurons: The number of neurons in the device
        :param label: The label of the device
        :param board_address:\
            The IP address of the board that the device is connected to
        """
        # pylint: disable=too-many-arguments
        PushBotEthernetMotorDevice.__init__(self, motor, protocol)
        ApplicationSpiNNakerLinkVertex.__init__(
            self,
            spinnaker_link_id=spinnaker_link_id,
            n_atoms=n_neurons,
            board_address=board_address,
            label=label)
コード例 #3
0
 def __init__(self,
              motor,
              protocol,
              spinnaker_link_id,
              n_neurons=default_parameters['n_neurons'],
              label=default_parameters['label'],
              board_address=default_parameters['board_address']):
     """
     :param motor: the motor to control
     :type motor:
         ~spynnaker.pyNN.external_devices_models.push_bot.parameters.PushBotMotor
     :param protocol: The protocol used to control the device
     :type protocol: ~spynnaker.pyNN.protocols.MunichIoSpiNNakerLinkProtocol
     :param int spinnaker_link_id: The SpiNNakerLink connected to
     :param int n_neurons: The number of neurons in the device
     :param str label: The label of the device
     :param board_address:
         The IP address of the board that the device is connected to
     :type board_address: str or None
     """
     # pylint: disable=too-many-arguments
     super().__init__(motor, protocol)
     ApplicationSpiNNakerLinkVertex.__init__(
         self,
         spinnaker_link_id=spinnaker_link_id,
         n_atoms=n_neurons,
         board_address=board_address,
         label=label)
コード例 #4
0
    def __init__(self,
                 spinnaker_link_id,
                 protocol,
                 resolution,
                 board_address=default_parameters['board_address'],
                 label=default_parameters['label']):
        """
        :param spinnaker_link_id:
        :param protocol:
        :type protocol: MunichIoSpiNNakerLinkProtocol
        :param resolution:
        :type resolution: PushBotRetinaResolution
        :param board_address:
        :param label:
        """

        AbstractPushBotRetinaDevice.__init__(self, protocol, resolution)
        ApplicationSpiNNakerLinkVertex.__init__(
            self,
            spinnaker_link_id=spinnaker_link_id,
            n_atoms=resolution.value.n_neurons,
            board_address=board_address,
            label=label)

        # stores for the injection aspects
        self.__new_key_command = None
コード例 #5
0
    def __init__(
            self, speaker, protocol, spinnaker_link_id,
            n_neurons=default_parameters['n_neurons'],
            label=default_parameters['label'],
            board_address=default_parameters['board_address'],
            start_active_time=default_parameters['start_active_time'],
            start_total_period=default_parameters['start_total_period'],
            start_frequency=default_parameters['start_frequency'],
            start_melody=default_parameters['start_melody']):
        """

        :param speaker: The PushBotSpeaker value to control
        :param protocol: The protocol instance to get commands from
        :param spinnaker_link_id: The SpiNNakerLink connected to
        :param n_neurons: The number of neurons in the device
        :param label: The label of the device
        :param board_address:\
            The IP address of the board that the device is connected to
        :param start_active_time: The "active time" to set at the start
        :param start_total_period: The "total period" to set at the start
        :param start_frequency: The "frequency" to set at the start
        :param start_melody: The "melody" to set at the start
        """
        # pylint: disable=too-many-arguments
        PushBotEthernetSpeakerDevice.__init__(
            self, speaker, protocol, start_active_time,
            start_total_period, start_frequency, start_melody)
        ApplicationSpiNNakerLinkVertex.__init__(
            self, spinnaker_link_id=spinnaker_link_id, n_atoms=n_neurons,
            board_address=board_address, label=label)
コード例 #6
0
    def __init__(self,
                 spinnaker_link_id,
                 protocol,
                 resolution,
                 board_address=default_parameters['board_address'],
                 label=default_parameters['label']):
        """
        :param spinnaker_link_id:
        :param protocol:
        :type protocol: ~spynnaker.pyNN.protocols.MunichIoSpiNNakerLinkProtocol
        :param resolution:
        :type resolution:
            ~spynnaker.pyNN.external_devices_models.push_bot.parameters.PushBotRetinaResolution
        :param board_address:
        :param label:
        """
        super().__init__(protocol, resolution)
        ApplicationSpiNNakerLinkVertex.__init__(
            self,
            spinnaker_link_id=spinnaker_link_id,
            n_atoms=resolution.value.n_neurons,
            board_address=board_address,
            label=label)

        # stores for the injection aspects
        self.__new_key_command = None
コード例 #7
0
 def __init__(
         self, led, protocol, spinnaker_link_id,
         n_neurons=default_parameters['n_neurons'],
         label=default_parameters['label'],
         board_address=default_parameters['board_address'],
         start_active_time_front=default_parameters[
             'start_active_time_front'],
         start_active_time_back=default_parameters[
             'start_active_time_back'],
         start_total_period=default_parameters['start_total_period'],
         start_frequency=default_parameters['start_frequency']):
     """
     :param PushBotLED led: The LED devic to control
     :param MunichIoSpiNNakerLinkProtocol protocol:
         The protocol instance to get commands from
     :param int spinnaker_link_id: The SpiNNakerLink connected to
     :param int n_neurons: The number of neurons in the device
     :param str label: The label of the device
     :param str board_address:
         The IP address of the board that the device is connected to
     :param start_active_time_front:
         The "active time" to set for the front LED at the start
     :param start_active_time_back:
         The "active time" to set for the back LED at the start
     :param start_total_period: The "total period" to set at the start
     :param start_frequency: The "frequency" to set at the start
     """
     # pylint: disable=too-many-arguments
     PushBotEthernetLEDDevice.__init__(
         self, led, protocol, start_active_time_front,
         start_active_time_back, start_total_period, start_frequency)
     ApplicationSpiNNakerLinkVertex.__init__(
         self, spinnaker_link_id=spinnaker_link_id, n_atoms=n_neurons,
         board_address=board_address, label=label)
    def __init__(
            self, laser, protocol, spinnaker_link_id,
            n_neurons=default_parameters['n_neurons'],
            label=default_parameters['label'],
            board_address=default_parameters['board_address'],
            start_active_time=default_parameters['start_active_time'],
            start_total_period=default_parameters['start_total_period'],
            start_frequency=default_parameters['start_frequency']):
        """

        :param laser: The PushBotLaser value to control
        :param protocol: The protocol instance to get commands from
        :param spinnaker_link_id:\
            The SpiNNakerLink that the PushBot is connected to
        :param n_neurons: The number of neurons in the device
        :param label: A label for the device
        :param board_address:\
            The IP address of the board that the device is connected to
        :param start_active_time: The "active time" value to send at the start
        :param start_total_period:\
            The "total period" value to send at the start
        :param start_frequency: The "frequency" to send at the start
        """
        # pylint: disable=too-many-arguments
        PushBotEthernetLaserDevice.__init__(
            self, laser, protocol, start_active_time,
            start_total_period, start_frequency)
        ApplicationSpiNNakerLinkVertex.__init__(
            self, spinnaker_link_id=spinnaker_link_id, n_atoms=n_neurons,
            board_address=board_address, label=label)
コード例 #9
0
ファイル: Receptive fields.py プロジェクト: adamgoodtime/iCub
    def __init__(self, spinnaker_link_id, board_address=None,
                 constraints=None, label=None):

        ApplicationSpiNNakerLinkVertex.__init__(
            self, n_atoms=NUM_NEUR_IN, spinnaker_link_id=spinnaker_link_id,
            board_address=board_address, label=label)

        AbstractProvidesNKeysForPartition.__init__(self)
        AbstractProvidesOutgoingPartitionConstraints.__init__(self)
        AbstractSendMeMulticastCommandsVertex.__init__(self)
コード例 #10
0
ファイル: code_from_Chiara.py プロジェクト: adamgoodtime/iCub
    def __init__(self,
                 spinnaker_link_id,
                 board_address=None,
                 constraints=None,
                 label=None):

        ApplicationSpiNNakerLinkVertex.__init__(
            self,
            n_atoms=NUM_NEUR_OUT,
            spinnaker_link_id=spinnaker_link_id,
            board_address=board_address,
            label=label)
        AbstractSendMeMulticastCommandsVertex.__init__(self)
    def __init__(
            self, spinnaker_link_id, protocol, resolution,
            board_address=default_parameters['board_address'],
            label=default_parameters['label']):

        AbstractPushBotRetinaDevice.__init__(self, protocol, resolution)
        ApplicationSpiNNakerLinkVertex.__init__(
            self, spinnaker_link_id=spinnaker_link_id,
            n_atoms=resolution.value.n_neurons,
            board_address=board_address, label=label)

        # stores for the injection aspects
        self._graph_mapper = None
        self._routing_infos = None
        self._new_key_command = None
コード例 #12
0
    def __init__(
            self, spinnaker_link_id, protocol, resolution,
            board_address=default_parameters['board_address'],
            label=default_parameters['label']):

        AbstractPushBotRetinaDevice.__init__(self, protocol, resolution)
        ApplicationSpiNNakerLinkVertex.__init__(
            self, spinnaker_link_id=spinnaker_link_id,
            n_atoms=resolution.value.n_neurons,
            board_address=board_address, label=label)

        # stores for the injection aspects
        self._graph_mapper = None
        self._routing_infos = None
        self._new_key_command = None
コード例 #13
0
 def __init__(self,
              led,
              protocol,
              spinnaker_link_id,
              n_neurons=default_parameters['n_neurons'],
              label=default_parameters['label'],
              board_address=default_parameters['board_address'],
              start_active_time_front=default_parameters[
                  'start_active_time_front'],
              start_active_time_back=default_parameters[
                  'start_active_time_back'],
              start_total_period=default_parameters['start_total_period'],
              start_frequency=default_parameters['start_frequency']):
     """
     :param led: The LED device to control
     :type led:
         ~spynnaker.pyNN.external_devices_models.push_bot.parameters.PushBotLED
     :param protocol: The protocol instance to get commands from
     :type protocol: ~spynnaker.pyNN.protocols.MunichIoSpiNNakerLinkProtocol
     :param int spinnaker_link_id: The SpiNNakerLink connected to
     :param int n_neurons: The number of neurons in the device
     :param str label: The label of the device
     :param board_address:
         The IP address of the board that the device is connected to
     :type board_address: str or None
     :param start_active_time_front:
         The "active time" to set for the front LED at the start
     :type start_active_time_front: int or None
     :param start_active_time_back:
         The "active time" to set for the back LED at the start
     :type start_active_time_back: int or None
     :param start_total_period: The "total period" to set at the start
     :type start_total_period: int or None
     :param start_frequency: The "frequency" to set at the start
     :type start_frequency: int or None
     """
     # pylint: disable=too-many-arguments
     super().__init__(led, protocol, start_active_time_front,
                      start_active_time_back, start_total_period,
                      start_frequency)
     ApplicationSpiNNakerLinkVertex.__init__(
         self,
         spinnaker_link_id=spinnaker_link_id,
         n_atoms=n_neurons,
         board_address=board_address,
         label=label)
コード例 #14
0
    def __init__(
            self, cochlea_n_channels, cochlea_key, spinnaker_link_id, cochlea_type, cochlea_polarity,
            label=default_parameters['label'], n_neurons=None,
            board_address=default_parameters['board_address']):
        """
        :param cochlea_n_channels: The "number of frequency channels" of the cochlea
        :param cochlea_key: The value of the top 16-bits of the key
        :param spinnaker_link_id: The spinnaker link to which the cochlea is\
                connected
        :param cochlea_type: The cochlea "type". It can be either MONO (only one "ear")\
                or STEREO (two "ears")
        :param polarity: The "polarity" of the cochlea data (+spikes, -spikes, +-spikes)
        :param label:
        :param n_neurons: The number of neurons in the population
        :param board_address:
        """

        self._cochlea_type = cochlea_type
        logger.warn("The type selected for the FPGA cochlea is {}".format(self._cochlea_type))
        self._cochlea_polarity = cochlea_polarity
        logger.warn("The polarity selected for the FPGA cochlea is {}".format(self._cochlea_polarity))

        self._fixed_key = (cochlea_key & 0xFFFF) << 16
        self._fixed_mask = 0xFFFF8000
        if cochlea_type == ExternalCochleaDevice.TYPE_STEREO:
            self._fixed_key |= 0x4000

        logger.warn("The fixed_key selected for the FPGA cochlea is {}".format(self._fixed_key))
        fixed_n_neurons = self.get_n_neurons(cochlea_n_channels, cochlea_type, cochlea_polarity)
        self._fixed_mask = self._get_mask(cochlea_n_channels)
        logger.warn("The fixed_mask selected for the FPGA cochlea is {}".format(self._fixed_mask))

        if fixed_n_neurons != n_neurons and n_neurons is not None:
            logger.warn("The specified number of neurons for the FPGA cochlea"
                        " device has been ignored {} will be used instead"
                        .format(fixed_n_neurons))
        else:
            logger.warn("The number on neurons for the FPGA cochla is {} neurons".format(fixed_n_neurons))

        ApplicationSpiNNakerLinkVertex.__init__(
            self, n_atoms=fixed_n_neurons, spinnaker_link_id=spinnaker_link_id,
            label=label, max_atoms_per_core=fixed_n_neurons,
            board_address=board_address)
        AbstractProvidesOutgoingPartitionConstraints.__init__(self)
        ProvidesKeyToAtomMappingImpl.__init__(self)
    def __init__(
            self, motor, protocol, spinnaker_link_id,
            n_neurons=default_parameters['n_neurons'],
            label=default_parameters['label'],
            board_address=default_parameters['board_address']):
        """

        :param motor: a PushBotMotor value to indicate the motor to control
        :param protocol: The protocol used to control the device
        :param spinnaker_link_id: The SpiNNakerLink connected to
        :param n_neurons: The number of neurons in the device
        :param label: The label of the device
        :param board_address:\
            The IP address of the board that the device is connected to
        """
        # pylint: disable=too-many-arguments
        PushBotEthernetMotorDevice.__init__(self, motor, protocol)
        ApplicationSpiNNakerLinkVertex.__init__(
            self, spinnaker_link_id=spinnaker_link_id, n_atoms=n_neurons,
            board_address=board_address, label=label)
コード例 #16
0
 def __init__(self,
              laser,
              protocol,
              spinnaker_link_id,
              n_neurons=default_parameters['n_neurons'],
              label=default_parameters['label'],
              board_address=default_parameters['board_address'],
              start_active_time=default_parameters['start_active_time'],
              start_total_period=default_parameters['start_total_period'],
              start_frequency=default_parameters['start_frequency']):
     """
     :param laser: Which laser device to control
     :type laser:
         ~spynnaker.pyNN.external_devices_models.push_bot.parameters.PushBotLaser
     :param protocol: The protocol instance to get commands from
     :type protocol: ~spynnaker.pyNN.protocols.MunichIoSpiNNakerLinkProtocol
     :param int spinnaker_link_id:
         The SpiNNakerLink that the PushBot is connected to
     :param int n_neurons: The number of neurons in the device
     :param str label: A label for the device
     :param board_address:
         The IP address of the board that the device is connected to
     :type board_address: str or None
     :param start_active_time: The "active time" value to send at the start
     :param start_total_period:
         The "total period" value to send at the start
     :param start_frequency: The "frequency" to send at the start
     """
     # pylint: disable=too-many-arguments
     super().__init__(laser, protocol, start_active_time,
                      start_total_period, start_frequency)
     ApplicationSpiNNakerLinkVertex.__init__(
         self,
         spinnaker_link_id=spinnaker_link_id,
         n_atoms=n_neurons,
         board_address=board_address,
         label=label)
コード例 #17
0
    def __init__(self, n_neurons, spinnaker_link_id, board_address=None, label=None):

        ApplicationSpiNNakerLinkVertex.__init__(self, n_atoms=n_neurons, spinnaker_link_id=spinnaker_link_id,
                                                board_address=board_address, label=label)
コード例 #18
0
ファイル: task2.1.py プロジェクト: Huangliang0826/lab_answers
 def __init__(self, n_neurons, spinnaker_link_id, label=None):
     ApplicationSpiNNakerLinkVertex.__init__(self,
                                             n_neurons,
                                             spinnaker_link_id,
                                             label=label)