spynnaker.pyNN package¶
Subpackages¶
- spynnaker.pyNN.connections package
- Module contents
EthernetCommandConnectionEthernetControlConnectionSPIFLiveSpikesConnectionSpynnakerLiveSpikesConnectionSpynnakerPoissonControlConnectionSpynnakerPoissonControlConnection.add_init_callback()SpynnakerPoissonControlConnection.add_pause_stop_callback()SpynnakerPoissonControlConnection.add_poisson_label()SpynnakerPoissonControlConnection.add_receive_callback()SpynnakerPoissonControlConnection.add_receive_no_time_callback()SpynnakerPoissonControlConnection.add_start_callback()SpynnakerPoissonControlConnection.add_start_resume_callback()SpynnakerPoissonControlConnection.set_rate()SpynnakerPoissonControlConnection.set_rates()
- Module contents
- spynnaker.pyNN.data package
- Submodules
- spynnaker.pyNN.data.spynnaker_data_writer module
- Module contents
SpynnakerDataViewSpynnakerDataView.add_population()SpynnakerDataView.add_projection()SpynnakerDataView.get_min_delay()SpynnakerDataView.get_n_populations()SpynnakerDataView.get_n_projections()SpynnakerDataView.get_segment_counter()SpynnakerDataView.get_sim_name()SpynnakerDataView.has_min_delay()SpynnakerDataView.iterate_populations()SpynnakerDataView.iterate_projections()SpynnakerDataView.set_number_of_neurons_per_dimension_per_core()
- spynnaker.pyNN.external_devices package
- spynnaker.pyNN.external_devices_models package
- Subpackages
- Submodules
- spynnaker.pyNN.external_devices_models.external_device_lif_control_vertex module
ExternalDeviceLifControlVertexExternalDeviceLifControlVertex.dependent_vertices()ExternalDeviceLifControlVertex.edge_partition_identifiers_for_dependent_vertex()ExternalDeviceLifControlVertex.get_atom_key_map()ExternalDeviceLifControlVertex.get_external_devices()ExternalDeviceLifControlVertex.get_fixed_key_and_mask()ExternalDeviceLifControlVertex.get_message_translator()ExternalDeviceLifControlVertex.get_outgoing_partition_ids()
- spynnaker.pyNN.external_devices_models.spif_devices module
N_FIELDSN_FILTERSN_INPUTSN_PIPESSPIFRegisterSPIFRegister.CONFIG_PKT_CNTSPIFRegister.DIST_KEY_BASESPIFRegister.DIST_MASK_BASESPIFRegister.DIST_SHIFT_BASESPIFRegister.DROPPED_PKT_CNTSPIFRegister.FL_MASK_BASESPIFRegister.FL_VALUE_BASESPIFRegister.IN_PERIPH_PKT_CNTSPIFRegister.IR_KEY_BASESPIFRegister.IR_MASK_BASESPIFRegister.IR_ROUTE_BASESPIFRegister.MP_FLD_LIMIT_BASESPIFRegister.MP_FLD_MASK_BASESPIFRegister.MP_FLD_SHIFT_BASESPIFRegister.MP_KEY_BASESPIFRegister.OUT_PERIPH_PKT_CNTSPIFRegister.REPLY_KEYSPIFRegister.cmd()SPIFRegister.delayed_command()
SPIF_FPGA_IDSPIF_INPUT_FPGA_LINKSSPIF_OUTPUT_FPGA_LINKSpiNNFPGARegisterSpiNNFPGARegister.LC_KEYSpiNNFPGARegister.LC_MASKSpiNNFPGARegister.P_KEYSpiNNFPGARegister.P_MASKSpiNNFPGARegister.RC_KEYSpiNNFPGARegister.RC_MASKSpiNNFPGARegister.STARTSpiNNFPGARegister.STOPSpiNNFPGARegister.XP_KEY_BASESpiNNFPGARegister.XP_MASK_BASESpiNNFPGARegister.cmd()SpiNNFPGARegister.delayed_command()
set_distiller_key()set_distiller_mask()set_distiller_mask_delayed()set_distiller_shift()set_field_limit()set_field_mask()set_field_shift()set_filter_mask()set_filter_value()set_input_key()set_input_mask()set_input_route()set_mapper_key()set_xp_key()set_xp_key_delayed()set_xp_mask()set_xp_mask_delayed()
- Module contents
AbstractEthernetControllerAbstractEthernetSensorAbstractEthernetTranslatorAbstractMulticastControllableDeviceAbstractMulticastControllableDevice.device_control_first_send_timestepAbstractMulticastControllableDevice.device_control_keyAbstractMulticastControllableDevice.device_control_max_valueAbstractMulticastControllableDevice.device_control_min_valueAbstractMulticastControllableDevice.device_control_partition_idAbstractMulticastControllableDevice.device_control_scaling_factorAbstractMulticastControllableDevice.device_control_send_typeAbstractMulticastControllableDevice.device_control_timesteps_between_sendingAbstractMulticastControllableDevice.device_control_uses_payload
ArbitraryFPGADeviceExternalCochleaDeviceExternalDeviceLifControlExternalFPGARetinaDeviceExternalFPGARetinaDevice.DOWN_POLARITYExternalFPGARetinaDevice.MERGED_POLARITYExternalFPGARetinaDevice.MODE_128ExternalFPGARetinaDevice.MODE_16ExternalFPGARetinaDevice.MODE_32ExternalFPGARetinaDevice.MODE_64ExternalFPGARetinaDevice.UP_POLARITYExternalFPGARetinaDevice.get_fixed_key_and_mask()ExternalFPGARetinaDevice.get_n_neurons()ExternalFPGARetinaDevice.pause_stop_commandsExternalFPGARetinaDevice.start_resume_commandsExternalFPGARetinaDevice.timed_commands
ICUBRetinaDeviceMachineMunichMotorDeviceMachineMunichMotorDevice.INPUT_BUFFER_FULL_NAMEMachineMunichMotorDevice.MOTOR_PARTITION_IDMachineMunichMotorDevice.generate_data_specification()MachineMunichMotorDevice.get_binary_file_name()MachineMunichMotorDevice.get_binary_start_type()MachineMunichMotorDevice.get_n_keys_for_partition()MachineMunichMotorDevice.parse_extra_provenance_items()MachineMunichMotorDevice.reserve_memory_regions()MachineMunichMotorDevice.sdram_required
MunichMotorDeviceMunichRetinaDeviceMunichRetinaDevice.DOWN_POLARITYMunichRetinaDevice.LEFT_RETINAMunichRetinaDevice.MERGED_POLARITYMunichRetinaDevice.RIGHT_RETINAMunichRetinaDevice.UP_POLARITYMunichRetinaDevice.default_parametersMunichRetinaDevice.get_fixed_key_and_mask()MunichRetinaDevice.pause_stop_commandsMunichRetinaDevice.start_resume_commandsMunichRetinaDevice.timed_commands
SPIFInputDeviceSPIFInputDevice.INPUT_MASKSPIFInputDevice.get_atom_key_map()SPIFInputDevice.get_fixed_key_and_mask()SPIFInputDevice.get_incoming_slice_for_link()SPIFInputDevice.get_machine_fixed_key_and_mask()SPIFInputDevice.pause_stop_commandsSPIFInputDevice.start_resume_commandsSPIFInputDevice.timed_commands
SPIFOutputDeviceSPIFRetinaDeviceSPIFRetinaDevice.X_MASKSPIFRetinaDevice.X_PER_ROWSPIFRetinaDevice.Y_MASKSPIFRetinaDevice.get_atom_key_map()SPIFRetinaDevice.get_fixed_key_and_mask()SPIFRetinaDevice.get_incoming_slice_for_link()SPIFRetinaDevice.get_machine_fixed_key_and_mask()SPIFRetinaDevice.pause_stop_commandsSPIFRetinaDevice.start_resume_commandsSPIFRetinaDevice.timed_commands
SendTypeThresholdTypeMulticastDeviceControl
- spynnaker.pyNN.extra_algorithms package
- spynnaker.pyNN.extra_models package
- spynnaker.pyNN.model_binaries package
- spynnaker.pyNN.models package
- Subpackages
- spynnaker.pyNN.models.abstract_models package
- spynnaker.pyNN.models.common package
- spynnaker.pyNN.models.current_sources package
- spynnaker.pyNN.models.neural_projections package
- spynnaker.pyNN.models.neuron package
- Subpackages
- Submodules
- spynnaker.pyNN.models.neuron.generator_data module
- spynnaker.pyNN.models.neuron.master_pop_table module
- spynnaker.pyNN.models.neuron.neuron_data module
- spynnaker.pyNN.models.neuron.population_machine_common module
- spynnaker.pyNN.models.neuron.population_machine_synapses module
- spynnaker.pyNN.models.neuron.synapse_io module
- spynnaker.pyNN.models.neuron.synaptic_matrices module
- spynnaker.pyNN.models.neuron.synaptic_matrix_app module
- Module contents
- spynnaker.pyNN.models.populations package
- spynnaker.pyNN.models.spike_source package
- spynnaker.pyNN.models.utility_models package
- Submodules
- spynnaker.pyNN.models.abstract_pynn_model module
AbstractPyNNModelAbstractPyNNModel.absolute_max_atoms_per_coreAbstractPyNNModel.create_vertex()AbstractPyNNModel.default_initial_valuesAbstractPyNNModel.default_parametersAbstractPyNNModel.default_population_parametersAbstractPyNNModel.describe()AbstractPyNNModel.get_model_max_atoms_per_dimension_per_core()AbstractPyNNModel.get_parameter_names()AbstractPyNNModel.has_parameter()AbstractPyNNModel.nameAbstractPyNNModel.set_model_max_atoms_per_dimension_per_core()
- spynnaker.pyNN.models.defaults module
- spynnaker.pyNN.models.projection module
- spynnaker.pyNN.models.recorder module
- Module contents
- Subpackages
- spynnaker.pyNN.protocols package
- Module contents
MUNICH_MODESMunichIoEthernetProtocolMunichIoEthernetProtocol.disable_motor()MunichIoEthernetProtocol.disable_retina()MunichIoEthernetProtocol.enable_motor()MunichIoEthernetProtocol.enable_retina()MunichIoEthernetProtocol.laser_active_time()MunichIoEthernetProtocol.laser_frequency()MunichIoEthernetProtocol.laser_total_period()MunichIoEthernetProtocol.led_back_active_time()MunichIoEthernetProtocol.led_frequency()MunichIoEthernetProtocol.led_front_active_time()MunichIoEthernetProtocol.led_total_period()MunichIoEthernetProtocol.motor_0_leaky_velocity()MunichIoEthernetProtocol.motor_0_permanent_velocity()MunichIoEthernetProtocol.motor_1_leaky_velocity()MunichIoEthernetProtocol.motor_1_permanent_velocity()MunichIoEthernetProtocol.set_retina_transmission()MunichIoEthernetProtocol.speaker_active_time()MunichIoEthernetProtocol.speaker_frequency()MunichIoEthernetProtocol.speaker_total_period()
MunichIoSpiNNakerLinkProtocolMunichIoSpiNNakerLinkProtocol.add_payload_logic_to_current_output()MunichIoSpiNNakerLinkProtocol.bias_values()MunichIoSpiNNakerLinkProtocol.configure_master_key()MunichIoSpiNNakerLinkProtocol.disable_retina()MunichIoSpiNNakerLinkProtocol.disable_retina_keyMunichIoSpiNNakerLinkProtocol.enable_disable_motor_keyMunichIoSpiNNakerLinkProtocol.generic_motor0_raw_output_leak_to_0()MunichIoSpiNNakerLinkProtocol.generic_motor0_raw_output_permanent()MunichIoSpiNNakerLinkProtocol.generic_motor1_raw_output_leak_to_0()MunichIoSpiNNakerLinkProtocol.generic_motor1_raw_output_permanent()MunichIoSpiNNakerLinkProtocol.generic_motor_disable()MunichIoSpiNNakerLinkProtocol.generic_motor_enable()MunichIoSpiNNakerLinkProtocol.generic_motor_total_period()MunichIoSpiNNakerLinkProtocol.instance_keyMunichIoSpiNNakerLinkProtocol.master_slave_set_master_clock_active()MunichIoSpiNNakerLinkProtocol.master_slave_set_master_clock_not_started()MunichIoSpiNNakerLinkProtocol.master_slave_set_slave()MunichIoSpiNNakerLinkProtocol.master_slave_use_internal_counter()MunichIoSpiNNakerLinkProtocol.modeMunichIoSpiNNakerLinkProtocol.poll_individual_sensor_continuously()MunichIoSpiNNakerLinkProtocol.poll_sensors_once()MunichIoSpiNNakerLinkProtocol.push_bot_laser_config_active_time()MunichIoSpiNNakerLinkProtocol.push_bot_laser_config_active_time_keyMunichIoSpiNNakerLinkProtocol.push_bot_laser_config_total_period()MunichIoSpiNNakerLinkProtocol.push_bot_laser_config_total_period_keyMunichIoSpiNNakerLinkProtocol.push_bot_laser_set_frequency()MunichIoSpiNNakerLinkProtocol.push_bot_laser_set_frequency_keyMunichIoSpiNNakerLinkProtocol.push_bot_led_back_active_time()MunichIoSpiNNakerLinkProtocol.push_bot_led_back_active_time_keyMunichIoSpiNNakerLinkProtocol.push_bot_led_front_active_time()MunichIoSpiNNakerLinkProtocol.push_bot_led_front_active_time_keyMunichIoSpiNNakerLinkProtocol.push_bot_led_set_frequency()MunichIoSpiNNakerLinkProtocol.push_bot_led_set_frequency_keyMunichIoSpiNNakerLinkProtocol.push_bot_led_total_period()MunichIoSpiNNakerLinkProtocol.push_bot_led_total_period_keyMunichIoSpiNNakerLinkProtocol.push_bot_motor_0_leaking_towards_zero()MunichIoSpiNNakerLinkProtocol.push_bot_motor_0_leaking_towards_zero_keyMunichIoSpiNNakerLinkProtocol.push_bot_motor_0_permanent()MunichIoSpiNNakerLinkProtocol.push_bot_motor_0_permanent_keyMunichIoSpiNNakerLinkProtocol.push_bot_motor_1_leaking_towards_zero()MunichIoSpiNNakerLinkProtocol.push_bot_motor_1_leaking_towards_zero_keyMunichIoSpiNNakerLinkProtocol.push_bot_motor_1_permanent()MunichIoSpiNNakerLinkProtocol.push_bot_motor_1_permanent_keyMunichIoSpiNNakerLinkProtocol.push_bot_speaker_config_active_time()MunichIoSpiNNakerLinkProtocol.push_bot_speaker_config_active_time_keyMunichIoSpiNNakerLinkProtocol.push_bot_speaker_config_total_period()MunichIoSpiNNakerLinkProtocol.push_bot_speaker_config_total_period_keyMunichIoSpiNNakerLinkProtocol.push_bot_speaker_set_melody()MunichIoSpiNNakerLinkProtocol.push_bot_speaker_set_melody_keyMunichIoSpiNNakerLinkProtocol.push_bot_speaker_set_tone()MunichIoSpiNNakerLinkProtocol.push_bot_speaker_set_tone_keyMunichIoSpiNNakerLinkProtocol.pwm_pin_output_timer_a_channel_0_ratio()MunichIoSpiNNakerLinkProtocol.pwm_pin_output_timer_a_channel_1_ratio()MunichIoSpiNNakerLinkProtocol.pwm_pin_output_timer_a_duration()MunichIoSpiNNakerLinkProtocol.pwm_pin_output_timer_b_channel_0_ratio()MunichIoSpiNNakerLinkProtocol.pwm_pin_output_timer_b_channel_1_ratio()MunichIoSpiNNakerLinkProtocol.pwm_pin_output_timer_b_duration()MunichIoSpiNNakerLinkProtocol.pwm_pin_output_timer_c_channel_0_ratio()MunichIoSpiNNakerLinkProtocol.pwm_pin_output_timer_c_channel_1_ratio()MunichIoSpiNNakerLinkProtocol.pwm_pin_output_timer_c_duration()MunichIoSpiNNakerLinkProtocol.query_state_of_io_lines()MunichIoSpiNNakerLinkProtocol.remove_payload_logic_to_current_output()MunichIoSpiNNakerLinkProtocol.reset_retina()MunichIoSpiNNakerLinkProtocol.sensor_transmission_key()MunichIoSpiNNakerLinkProtocol.sent_mode_command()MunichIoSpiNNakerLinkProtocol.set_mode()MunichIoSpiNNakerLinkProtocol.set_output_pattern_for_payload()MunichIoSpiNNakerLinkProtocol.set_payload_pins_to_high_impedance()MunichIoSpiNNakerLinkProtocol.set_retina_key()MunichIoSpiNNakerLinkProtocol.set_retina_key_keyMunichIoSpiNNakerLinkProtocol.set_retina_transmission()MunichIoSpiNNakerLinkProtocol.set_retina_transmission_keyMunichIoSpiNNakerLinkProtocol.turn_off_sensor_reporting()MunichIoSpiNNakerLinkProtocol.uart_id
RetinaKeyRetinaPayload
- Module contents
- spynnaker.pyNN.utilities package
- Subpackages
- Submodules
- spynnaker.pyNN.utilities.bit_field_utilities module
- spynnaker.pyNN.utilities.buffer_data_type module
- spynnaker.pyNN.utilities.constants module
- spynnaker.pyNN.utilities.data_population module
DataPopulationDataPopulation.describe()DataPopulation.find_units()DataPopulation.get_data()DataPopulation.get_spike_counts()DataPopulation.id_to_index()DataPopulation.index_to_id()DataPopulation.labelDataPopulation.local_sizeDataPopulation.mean_spike_count()DataPopulation.sizeDataPopulation.spinnaker_get_data()DataPopulation.write_data()
- spynnaker.pyNN.utilities.extracted_data module
- spynnaker.pyNN.utilities.neo_buffer_database module
NeoBufferDatabaseNeoBufferDatabase.add_segment()NeoBufferDatabase.array_to_string()NeoBufferDatabase.clear_data()NeoBufferDatabase.csv_block_metadata()NeoBufferDatabase.csv_segment()NeoBufferDatabase.get_empty_block()NeoBufferDatabase.get_full_block()NeoBufferDatabase.get_population()NeoBufferDatabase.get_population_metadata()NeoBufferDatabase.get_recording_metadata()NeoBufferDatabase.get_recording_populations()NeoBufferDatabase.get_recording_variables()NeoBufferDatabase.get_spike_counts()NeoBufferDatabase.spinnaker_get_data()NeoBufferDatabase.string_to_array()NeoBufferDatabase.write_metadata()NeoBufferDatabase.write_segment_metadata()NeoBufferDatabase.write_t_stop()
- spynnaker.pyNN.utilities.neo_compare module
- spynnaker.pyNN.utilities.neo_convertor module
- spynnaker.pyNN.utilities.neo_csv module
- spynnaker.pyNN.utilities.running_stats module
- spynnaker.pyNN.utilities.struct module
- spynnaker.pyNN.utilities.utility_calls module
check_directory_exists_and_create_if_not()check_rng()convert_param_to_numpy()convert_to()create_mars_kiss_seeds()get_maximum_probable_value()get_mean()get_minimum_probable_value()get_n_bits()get_neo_io()get_probability_within_range()get_probable_maximum_selected()get_probable_minimum_selected()get_standard_deviation()get_time_to_write_us()get_variance()high()low()read_in_data_from_file()read_spikes_from_file()report_non_spynnaker_pynn()
- Module contents
Submodules¶
spynnaker.pyNN.config_setup module¶
- spynnaker.pyNN.config_setup.add_spynnaker_cfg() None[source]¶
Add the local configuration and all dependent configuration files.
- spynnaker.pyNN.config_setup.setup_configs() None[source]¶
Sets up the configurations including the users configuration file.
Clears out any previous read configurations but does not load the new configurations so a warning is generated if a configuration is used before setup is called.
- spynnaker.pyNN.config_setup.unittest_setup() None[source]¶
Does all the steps that may be required before a unit-test.
Resets the configurations so only the local default configurations are included. The user configuration is not included!
Unsets any previous simulators and temporary directories
Note
This file should only be called from sPyNNaker tests that do not call sim.setup
spynnaker.pyNN.exceptions module¶
- exception spynnaker.pyNN.exceptions.DelayExtensionException[source]¶
Bases:
ConfigurationExceptionRaised when a delay extension vertex fails.
- exception spynnaker.pyNN.exceptions.FilterableException[source]¶
Bases:
SpynnakerExceptionRaised when it is not possible to determine if an edge should be filtered.
- exception spynnaker.pyNN.exceptions.InvalidParameterType[source]¶
Bases:
SpynnakerExceptionRaised when a parameter is not recognised.
- exception spynnaker.pyNN.exceptions.MemReadException[source]¶
Bases:
SpynnakerExceptionRaised when the PyNN front end fails to read a certain memory region.
- exception spynnaker.pyNN.exceptions.SpynnakerException[source]¶
Bases:
ExceptionSuperclass of all exceptions from the PyNN module.
- exception spynnaker.pyNN.exceptions.SpynnakerSplitterConfigurationException[source]¶
Bases:
ConfigurationExceptionRaised when a splitter configuration fails.
- exception spynnaker.pyNN.exceptions.SynapseRowTooBigException(max_size, message)[source]¶
Bases:
SpynnakerExceptionRaised when a synapse row is bigger than is allowed.
- Parameters:
max_size – the maximum permitted size of row
message – the exception message
- property max_size¶
The maximum size allowed.
- exception spynnaker.pyNN.exceptions.SynapticBlockGenerationException[source]¶
Bases:
ConfigurationExceptionRaised when the synaptic manager fails to generate a synaptic block.
- exception spynnaker.pyNN.exceptions.SynapticBlockReadException[source]¶
Bases:
ConfigurationExceptionRaised when the synaptic manager fails to read a synaptic block or convert it into readable values.
- exception spynnaker.pyNN.exceptions.SynapticConfigurationException[source]¶
Bases:
ConfigurationExceptionRaised when the synaptic manager fails for some reason.
- exception spynnaker.pyNN.exceptions.SynapticMaxIncomingAtomsSupportException[source]¶
Bases:
ConfigurationExceptionRaised when a synaptic sublist exceeds the max atoms possible to be supported.
spynnaker.pyNN.random_distribution module¶
spynnaker.pyNN.setup_pynn module¶
This script installs sPyNNaker so that it usable as the pyNN.spiNNaker
module.
Note
This modifies your pyNN installation!
- spynnaker.pyNN.setup_pynn.install_spynnaker_into(module)[source]¶
Do the actual installation by creating a package within the given module’s implementation. This is very nasty!
- Parameters:
module (ModuleType)
- spynnaker.pyNN.setup_pynn.version_satisfies(module, requirement)[source]¶
Perform a version check. This code could be smarter…
- Parameters:
module (ModuleType)
requirement (str)
- Returns:
Whether the module’s version satisfies the given requirement
- Return type:
spynnaker.pyNN.spinnaker module¶
spynnaker.pyNN.spynnaker_external_device_plugin_manager module¶
- class spynnaker.pyNN.spynnaker_external_device_plugin_manager.SpynnakerExternalDevicePluginManager[source]¶
Bases:
objectUser-level interface for the external device plug-in manager.
- static activate_live_output_for(population: Population, *, database_notify_host: str | None = None, database_notify_port_num: int | None = None, database_ack_port_num: int | None = None, port: int | None = None, host: str | None = None, tag: int | None = None, strip_sdp: bool = True, use_prefix: bool = False, key_prefix: int | None = None, prefix_type: EIEIOPrefix | None = None, message_type: EIEIOType = EIEIOType.KEY_32_BIT, right_shift: int = 0, payload_as_time_stamps: bool = True, notify: bool = True, use_payload_prefix: bool = True, payload_prefix: int | None = None, payload_right_shift: int = 0, number_of_packets_sent_per_time_step: int = 0, translate_keys: bool = False)[source]¶
Output the spikes from a given population from SpiNNaker as they occur in the simulation.
- Parameters:
population (Population) – The population to activate the live output for
database_notify_host (str) – The hostname for the device which is listening to the database notification.
database_ack_port_num (int) – The port number to which a external device will acknowledge that they have finished reading the database and are ready for it to start execution
database_notify_port_num (int) – The port number to which a external device will receive the database is ready command
key_prefix (int or None) – the prefix to be applied to the key
prefix_type (EIEIOPrefix) – if the prefix type is 32 bit or 16 bit
message_type (EIEIOType) – If the message is a EIEIO command message, or an EIEIO data message with 16 bit or 32 bit keys.
payload_as_time_stamps (bool)
right_shift (int)
use_payload_prefix (bool)
notify (bool)
payload_prefix (int or None)
payload_right_shift (int)
number_of_packets_sent_per_time_step (int)
port (int) – The UDP port to which the live spikes will be sent. If not specified, the port will be taken from the “live_spike_port” parameter in the “Recording” section of the sPyNNaker configuration file.
host (str) – The host name or IP address to which the live spikes will be sent. If not specified, the host will be taken from the “live_spike_host” parameter in the “Recording” section of the sPyNNaker configuration file.
tag (int) – The IP tag to be used for the spikes. If not specified, one will be automatically assigned
strip_sdp (bool) – Determines if the SDP headers will be stripped from the transmitted packet.
use_prefix (bool) – Determines if the spike packet will contain a common prefix for the spikes
label (str) – The label of the gatherer vertex
partition_ids (list(str)) – The names of the partitions to create edges for
translate_keys (bool) – Whether the incoming keys from the cores should be translated to global keys rather than core-based keys
- static activate_live_output_to(population: Population, device: Population | ApplicationVertex, partition_id: str = 'SPIKE')[source]¶
Activate the output of spikes from a population to an external device.
Note
All spikes will be sent to the device.
- Parameters:
population (Population) – The pyNN population object from which spikes will be sent.
device (Population or ApplicationVertex) – The pyNN population or external device to which the spikes will be sent.
partition_id (str) – The partition ID to activate live output to.
- static add_application_vertex(vertex: ApplicationVertex)[source]¶
Adds an Application vertex to the user graph.
Semantic sugar for SpynnakerDataView.add_vertex(vertex)
- Parameters:
vertex (ApplicationVertex)
- static add_database_socket_address(database_notify_host: str | None, database_notify_port_num: int | None, database_ack_port_num: int | None)[source]¶
- Parameters:
database_notify_host (str or None) – Host to talk to tell that the database (and application) is ready.
database_notify_port_num (int or None) – Port to talk to tell that the database (and application) is ready.
database_ack_port_num (int or None) – Port on which to listen for an acknowledgement that the simulation should start.
- static add_edge(vertex: ApplicationVertex, device_vertex: ApplicationVertex, partition_id: str) ApplicationEdge[source]¶
Add an edge between two vertices (often a vertex and a external device) on a given partition.
- Parameters:
vertex (ApplicationVertex) – the pre-population vertex to connect the edge from
device_vertex (ApplicationVertex) – the post-population vertex to connect the edge to
partition_id (str) – the partition identifier for making nets
- static add_poisson_live_rate_control(poisson_population: Population, *, control_label_extension: str = '_control', receive_port: int | None = None, database_notify_host: str | None = None, database_notify_port_num: int | None = None, database_ack_port_num: int | None = None, notify: bool = True, reserve_reverse_ip_tag: bool = False)[source]¶
Add a live rate controller to a Poisson population.
- Parameters:
poisson_population (Population) – The population to control
control_label_extension (str) – An extension to add to the label of the Poisson source. Must match up with the equivalent in the SpynnakerPoissonControlConnection
receive_port (int) – The port that the SpiNNaker board should listen on
database_notify_host (str) – the hostname for the device which is listening to the database notification.
database_ack_port_num (int) – the port number to which a external device will acknowledge that they have finished reading the database and are ready for it to start execution
database_notify_port_num (int) – The port number to which an external device will receive the database is ready command
notify (bool) – adds to the notification protocol if set.
reserve_reverse_ip_tag (bool) – True if a reverse IP tag is to be used, False if SDP is to be used (default)
- static update_live_packet_gather_tracker(vertex_to_record_from: ApplicationVertex, params: LivePacketGatherParameters, partition_ids: Iterable[str])[source]¶
Add an edge from a vertex to the live packet gatherer, builds as needed and has all the parameters for the creation of the live packet gatherer if needed.
- Parameters:
vertex_to_record_from (ApplicationVertex or MachineVertex)
params (LivePacketGatherParameters)
translate_keys (bool)
spynnaker.pyNN.types module¶
Types (and related) that are useful for implementing connectors.
Module contents¶
The spynnaker.pyNN package contains the front end specifications
and implementation for the PyNN High-level API
(https://neuralensemble.org/trac/PyNN).
This package contains the profile of that code for PyNN 0.9.
- class spynnaker.pyNN.ACSource(start=0.0, stop=0.0, amplitude=0.0, offset=0.0, frequency=0.0, phase=0.0)
Bases:
AbstractCurrentSourceAC current source (i.e. sine wave) turned on at “start” and off at “stop”, given (y-)offset, amplitude, frequency and phase.
- Parameters:
- spynnaker.pyNN.AdditiveWeightDependence
alias of
WeightDependenceAdditive
- class spynnaker.pyNN.AllToAllConnector(allow_self_connections=True, safe=True, verbose=None, callback=None)
Bases:
AbstractGenerateConnectorOnMachine,AbstractGenerateConnectorOnHostConnects all cells in the presynaptic population to all cells in the postsynaptic population.
- Parameters:
allow_self_connections (bool) – if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population.
safe (bool) – If
True, check that weights and delays have valid values. IfFalse, this check is skipped.verbose (bool) – Whether to output extra information about the connectivity to a CSV file
callback (callable) –
if given, a callable that display a progress bar on the terminal.
Note
Not supported by sPyNNaker.
- create_synaptic_block(post_slices: Sequence[Slice], post_vertex_slice: Slice, synapse_type: int, synapse_info: SynapseInformation) NDArray[source]
Create a synaptic block from the data.
- Parameters:
post_vertex_slice (Slice)
synapse_type (AbstractSynapseType)
synapse_info (SynapseInformation)
- Returns:
The synaptic matrix data to go to the machine, as a Numpy array
- Return type:
- gen_connector_params(synapse_info: SynapseInformation) NDArray[uint32][source]
Get the parameters of the on machine generation.
- Parameters:
synapse_info (SynapseInformation) – The synaptic information
- Return type:
ndarray(uint32)
- property gen_connector_params_size_in_bytes: int
The size of the connector parameters, in bytes.
- Return type:
- get_delay_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation) – the synapse info
- Return type:
int or None
- get_delay_minimum(synapse_info: SynapseInformation) float[source]
Get the minimum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
int or None
- get_n_connections_from_pre_vertex_maximum(n_post_atoms: int, synapse_info: SynapseInformation, min_delay: float | None = None, max_delay: float | None = None) int[source]
Get the maximum number of connections from any neuron in the pre vertex to the neurons in the post_vertex_slice, for connections with a delay between min_delay and max_delay (inclusive) if both specified (otherwise all connections).
Not all concrete connectors support omitting the delay range.
- Parameters:
delays (RandomDistribution or int or float or str)
n_post_atoms (int)
synapse_info (SynapseInformation)
min_delay (float)
max_delay (float)
- Return type:
- get_n_connections_to_post_vertex_maximum(synapse_info: SynapseInformation) int[source]
Get the maximum number of connections to any neuron in the post vertex from neurons in the pre vertex.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- get_weight_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum of the weights for this connection.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- class spynnaker.pyNN.ArrayConnector(array: ndarray[Any, dtype[uint8]], safe=True, callback=None, verbose=False)
Bases:
AbstractConnector,AbstractGenerateConnectorOnHostMake connections using an array of integers based on the IDs of the neurons in the pre- and post-populations.
- Parameters:
array (ndarray(2, uint8)) – An explicit Boolean matrix that specifies the connections between the pre- and post-populations (see PyNN documentation). Must be 2D in practice.
safe (bool) – Whether to check that weights and delays have valid values. If False, this check is skipped.
callback (callable) –
if given, a callable that display a progress bar on the terminal.
Note
Not supported by sPyNNaker.
verbose (bool) – Whether to output extra information about the connectivity to a CSV file
- create_synaptic_block(post_slices: Sequence[Slice], post_vertex_slice: Slice, synapse_type: int, synapse_info: SynapseInformation) NDArray[source]
Create a synaptic block from the data.
- Parameters:
post_vertex_slice (Slice)
synapse_type (AbstractSynapseType)
synapse_info (SynapseInformation)
- Returns:
The synaptic matrix data to go to the machine, as a Numpy array
- Return type:
- get_delay_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation) – the synapse info
- Return type:
int or None
- get_delay_minimum(synapse_info: SynapseInformation) float[source]
Get the minimum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
int or None
- get_n_connections_from_pre_vertex_maximum(n_post_atoms: int, synapse_info: SynapseInformation, min_delay: float | None = None, max_delay: float | None = None) int[source]
Get the maximum number of connections from any neuron in the pre vertex to the neurons in the post_vertex_slice, for connections with a delay between min_delay and max_delay (inclusive) if both specified (otherwise all connections).
Not all concrete connectors support omitting the delay range.
- Parameters:
delays (RandomDistribution or int or float or str)
n_post_atoms (int)
synapse_info (SynapseInformation)
min_delay (float)
max_delay (float)
- Return type:
- get_n_connections_to_post_vertex_maximum(synapse_info: SynapseInformation) int[source]
Get the maximum number of connections to any neuron in the post vertex from neurons in the pre vertex.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- get_weight_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum of the weights for this connection.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- class spynnaker.pyNN.Assembly(*populations, **kwargs)
Bases:
AssemblyA group of neurons, may be heterogeneous, in contrast to a Population where all the neurons are of the same type.
- Parameters:
populations (Population or PopulationView) – the populations or views to form the assembly out of
kwargs – may contain label (a string describing the assembly)
Create an Assembly of Populations and/or PopulationViews.
- class spynnaker.pyNN.CSAConnector(cset: CSet, safe=True, callback=None, verbose=False)
Bases:
AbstractConnector,AbstractGenerateConnectorOnHostMake connections using a Connection Set Algebra (Djurfeldt 2012) description between the neurons in the pre- and post-populations.
Note
If you get TypeError in Python 3 see: https://github.com/INCF/csa/issues/10
- Parameters:
cset (csa.connset.CSet) – A description of the connection set between populations
safe (bool) – If
True, check that weights and delays have valid values. IfFalse, this check is skipped.callback (callable) –
if given, a callable that display a progress bar on the terminal.
Note
Not supported by sPyNNaker.
verbose (bool) – Whether to output extra information about the connectivity to a CSV file
- Raises:
ImportError – if the csa library isn’t present; it’s tricky to install in some environments so we don’t force it to be present unless you want to actually use this class.
- create_synaptic_block(post_slices: Sequence[Slice], post_vertex_slice: Slice, synapse_type: int, synapse_info: SynapseInformation) NDArray[source]
Create a synaptic block from the data.
- Parameters:
post_vertex_slice (Slice)
synapse_type (AbstractSynapseType)
synapse_info (SynapseInformation)
- Returns:
The synaptic matrix data to go to the machine, as a Numpy array
- Return type:
- get_delay_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation) – the synapse info
- Return type:
int or None
- get_delay_minimum(synapse_info: SynapseInformation) float[source]
Get the minimum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
int or None
- get_n_connections_from_pre_vertex_maximum(n_post_atoms: int, synapse_info: SynapseInformation, min_delay: float | None = None, max_delay: float | None = None) int[source]
Get the maximum number of connections from any neuron in the pre vertex to the neurons in the post_vertex_slice, for connections with a delay between min_delay and max_delay (inclusive) if both specified (otherwise all connections).
Not all concrete connectors support omitting the delay range.
- Parameters:
delays (RandomDistribution or int or float or str)
n_post_atoms (int)
synapse_info (SynapseInformation)
min_delay (float)
max_delay (float)
- Return type:
- get_n_connections_to_post_vertex_maximum(synapse_info: SynapseInformation) int[source]
Get the maximum number of connections to any neuron in the post vertex from neurons in the pre vertex.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- get_weight_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum of the weights for this connection.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- spynnaker.pyNN.Convolution
alias of
LocalOnlyConvolution
- class spynnaker.pyNN.ConvolutionConnector(kernel_weights: int | float | List[int | float] | Tuple[int | float, ...] | ndarray[Any, dtype[float64]] | RandomDistribution, kernel_shape: int | Tuple[int, int] | None = None, strides: int | Tuple[int, int] | None = None, padding: bool | int | Tuple[int, int] | None = None, pool_shape: int | Tuple[int, int] | None = None, pool_stride: int | Tuple[int, int] | None = None, positive_receptor_type: str = 'excitatory', negative_receptor_type: str = 'inhibitory', safe=True, verbose=False, callback=None, filter_edges=True)
Bases:
AbstractConnectorA 2D connector that centres on a post neuron.
Special connector which dynamically maps a 2D kernel over a 2D plane, so that when the kernel is centred on a post-neuron, that post-neuron receives input from each pre-neuron that the kernel touches, and the weights of those pre-post connections are then the values of the kernel.
- Parameters:
kernel_weights (int or list or ndarray or RandomDistribution) –
The synaptic strengths, shared by neurons in the post population. Can be:
single value: kernel_shape must be provided; the same value will be used for all weights
simple list: kernel_shape must be provided; the list must be sized shape width * height
2D list: If kernel_shape is provided, it must match
ndarray: As above for simple or 2D listRandomDistribution: kernel_shape must be provided; weights will be drawn from the distribution
kernel_shape (int or tuple(int,int)) – The shape of the kernel if it cannot be determined from kernel_weights. If a single value is provided, a square kernel will be assumed. If two values are provided, it will be assumed to be (n_rows, n_columns)
strides (int or tuple(int, int)) – Spatial sampling frequency, jumps between the post neurons. This matches the meaning of standard ML packages. If a single value is provided, the same stride will be used for rows and columns. If two values are provided it will be assumed to be (stride_rows, stride_columns)
padding (bool or int or tuple(int, int) or None) – How many ‘extra pixels’ around the pre-population will be added, only zero-valued pixels are currently supported. If a single value is provided, the same padding will be used for rows and columns. If two values are provided it will be assumed to be (padding_rows, padding_columns). If True, automatic padding will be used based on the kernel shape. If False or None, no padding will be used.
pool_shape (int or tuple(int, int) or None) – Area of pooling, only average pooling is supported (and seems to make sense). If a single value is provided, the pooling area will be square. If two values are provided it will be assumed to be (pooling_rows, pooling_columns).
pool_stride (int or tuple(int, int) or None) – Jumps between pooling regions. If a single value is provided, the same stride will be used for rows and columns. If two values are provided it will be assumed to be (stride_rows, stride_columns)
positive_receptor_type (str) – The receptor type to add the positive weights to. By default this is “
excitatory”.negative_receptor_type (str) – The receptor type to add the negative weights to. By default this is “
inhibitory”.safe (bool) – (ignored)
verbose (bool) – (ignored)
callback (callable) – (ignored)
filter_edges (bool) – Whether to filter the edges based on connectivity or not; filtered means that the receiving cores will receive fewer packets, whereas non-filtered means that receiving cores will receive all packets whether relevant or not. However non-filtered may be more efficient in the routing tables, so may be needed if routing compression doesn’t work.
- get_connected_vertices(s_info: SynapseInformation, source_vertex: ApplicationVertex, target_vertex: ApplicationVertex) Sequence[Tuple[MachineVertex, Sequence[AbstractVertex]]][source]
Get the machine vertices that are connected to each other with this connector
- Parameters:
s_info (SynapseInformation) – The synapse information of the connection
source_vertex (ApplicationVertex) – The source of the spikes
target_vertex (ApplicationVertex) – The target of the spikes
- Returns:
A list of tuples of (target machine vertex, list of sources)
- Return type:
- get_delay_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation) – the synapse info
- Return type:
int or None
- get_delay_minimum(synapse_info: SynapseInformation) float[source]
Get the minimum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
int or None
- get_encoded_kernel_weights(app_edge: ProjectionApplicationEdge, weight_scales: NDArray[floating]) NDArray[int16][source]
Encode weights with weight scaling.
- Parameters:
app_edge (ProjectionApplicationEdge)
weight_scales (ndarray)
- Return type:
ndarray
- get_local_only_data(app_edge: ProjectionApplicationEdge, local_delay: int, delay_stage: int, weight_index: int) NDArray[uint32][source]
Gets the local only data
- Parameters:
app_edge (ProjectionApplicationEdge)
local_delay (int)
delay_stage (int)
weight_index (int)
- Return type:
ndarray
- get_n_connections_from_pre_vertex_maximum(n_post_atoms: int, synapse_info: SynapseInformation, min_delay: float | None = None, max_delay: float | None = None) int[source]
Get the maximum number of connections from any neuron in the pre vertex to the neurons in the post_vertex_slice, for connections with a delay between min_delay and max_delay (inclusive) if both specified (otherwise all connections).
Not all concrete connectors support omitting the delay range.
- Parameters:
delays (RandomDistribution or int or float or str)
n_post_atoms (int)
synapse_info (SynapseInformation)
min_delay (float)
max_delay (float)
- Return type:
- get_n_connections_to_post_vertex_maximum(synapse_info: SynapseInformation) int[source]
Get the maximum number of connections to any neuron in the post vertex from neurons in the pre vertex.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- get_post_shape(shape: Tuple[int, ...])[source]
Get the shape of the post image given the pre-image shape.
- get_weight_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum of the weights for this connection.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- property kernel_weights: ndarray[Any, dtype[float64]]
The weights for this connection.
- Return type:
ndarray
- property negative_receptor_type: str
The receptor type to add the negative weights to.
- Return type:
- property positive_receptor_type: str
The receptor type to add the positive weights to.
- Return type:
- validate_connection(application_edge: ProjectionApplicationEdge, synapse_info: SynapseInformation)[source]
Checks that the edge supports the connector. Returns nothing; it is assumed that an Exception will be raised if anything is wrong.
By default this checks only that the views are not used on multi-dimensional vertices.
- Parameters:
application_edge (ApplicationEdge) – The edge of the connection
synapse_info (SynapseInformation) – The synaptic information
- class spynnaker.pyNN.Cuboid(width, height, depth)[source]
Bases:
ShapeRepresents a cuboidal volume within which neurons may be distributed.
- Arguments:
- height:
extent in y direction
- width:
extent in x direction
- depth:
extent in z direction
- sample(n, rng)[source]
Return n points distributed randomly with uniform density within the cuboid.
- class spynnaker.pyNN.DCSource(amplitude=0.0, start=0.0, stop=0.0)
Bases:
AbstractCurrentSourceCurrent source with amplitude turned on at “start” and off at “stop”.
- class spynnaker.pyNN.DistanceDependentFormation(grid: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] = (16, 16), p_form_forward: float = 0.16, sigma_form_forward: float = 2.5, p_form_lateral: float = 1.0, sigma_form_lateral: float = 1.0)
Bases:
AbstractFormationFormation rule that depends on the physical distance between neurons.
- Parameters:
grid (tuple(int,int) or list(int) or ndarray(int)) – (x, y) dimensions of the grid of distance
p_form_forward (float) – The peak probability of formation on feed-forward connections
sigma_form_forward (float) – The spread of probability with distance of formation on feed-forward connections
p_form_lateral (float) – The peak probability of formation on lateral connections
sigma_form_lateral (float) – The spread of probability with distance of formation on lateral connections
- distance(x0: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], x1: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], metric) ndarray[Any, dtype[floating]][source]
Compute the distance between points x0 and x1 place on the grid using periodic boundary conditions.
- generate_distance_probability_array(probability: float, sigma: float) ndarray[Any, dtype[uint16]][source]
Generate the exponentially decaying probability LUTs.
- get_parameter_names() Iterable[str][source]
Get the parameter names available from the component.
- Return type:
iterable(str)
- get_parameters_sdram_usage_in_bytes() int[source]
Get the amount of SDRAM used by the parameters of this rule.
- Return type:
- property vertex_executable_suffix: str
The suffix to be appended to the vertex executable for this rule.
- Return type:
- write_parameters(spec: DataSpecificationBase)[source]
Write the parameters of the rule to the spec.
- Parameters:
spec (DataSpecificationGenerator)
- class spynnaker.pyNN.DistanceDependentProbabilityConnector(d_expression: str, allow_self_connections: bool = True, n_connections: int | None = None, rng: NumpyRNG | None = None, safe=True, verbose=False, callback=None)
Bases:
AbstractConnector,AbstractGenerateConnectorOnHostMake connections using a distribution which varies with distance.
- Parameters:
d_expression (str) – the right-hand side of a valid python expression for probability, involving
d, (e.g."exp(-abs(d))", or"d < 3"), that can be parsed byeval(), that computes the distance dependent distribution.allow_self_connections (bool) – if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population.
safe (bool) – if
True, check that weights and delays have valid values. IfFalse, this check is skipped.verbose (bool) – Whether to output extra information about the connectivity to a CSV file
n_connections (int or None) – The number of efferent synaptic connections per neuron.
rng (NumpyRNG or None) – Seeded random number generator, or
Noneto make one when needed.callback (callable)
- create_synaptic_block(post_slices: Sequence[Slice], post_vertex_slice: Slice, synapse_type: int, synapse_info: SynapseInformation) NDArray[source]
Create a synaptic block from the data.
- Parameters:
post_vertex_slice (Slice)
synapse_type (AbstractSynapseType)
synapse_info (SynapseInformation)
- Returns:
The synaptic matrix data to go to the machine, as a Numpy array
- Return type:
- get_delay_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation) – the synapse info
- Return type:
int or None
- get_delay_minimum(synapse_info: SynapseInformation) float[source]
Get the minimum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
int or None
- get_n_connections_from_pre_vertex_maximum(n_post_atoms: int, synapse_info: SynapseInformation, min_delay: float | None = None, max_delay: float | None = None) int[source]
Get the maximum number of connections from any neuron in the pre vertex to the neurons in the post_vertex_slice, for connections with a delay between min_delay and max_delay (inclusive) if both specified (otherwise all connections).
Not all concrete connectors support omitting the delay range.
- Parameters:
delays (RandomDistribution or int or float or str)
n_post_atoms (int)
synapse_info (SynapseInformation)
min_delay (float)
max_delay (float)
- Return type:
- get_n_connections_to_post_vertex_maximum(synapse_info: SynapseInformation) int[source]
Get the maximum number of connections to any neuron in the post vertex from neurons in the pre vertex.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- get_weight_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum of the weights for this connection.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- set_projection_information(synapse_info: SynapseInformation)[source]
Sets a connectors projection info.
- Parameters:
synapse_info (SynapseInformation) – the synapse info
- class spynnaker.pyNN.FixedNumberPostConnector(n: int, *, allow_self_connections: bool = True, with_replacement: bool = False, rng: NumpyRNG | None = None, safe=True, verbose=False, callback=None)
Bases:
AbstractGenerateConnectorOnMachine,AbstractGenerateConnectorOnHostConnects a fixed number of post-synaptic neurons selected at random, to all pre-synaptic neurons.
- Parameters:
n (int) – number of random post-synaptic neurons connected to pre-neurons.
allow_self_connections (bool) – if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population.
safe (bool) – Whether to check that weights and delays have valid values; if
False, this check is skipped.verbose (bool) – Whether to output extra information about the connectivity to a CSV file
with_replacement (bool) – this flag determines how the random selection of post-synaptic neurons is performed; if
True, then every post-synaptic neuron can be chosen on each occasion, and so multiple connections between neuron pairs are possible; ifFalse, then once a post-synaptic neuron has been connected to a pre-neuron, it can’t be connected again.rng (NumpyRNG or None) – Seeded random number generator, or
Noneto make one when needed.callback (callable) –
if given, a callable that display a progress bar on the terminal.
Note
Not supported by sPyNNaker.
- property allow_self_connections: bool
Do we include connections from a neuron/id to itself?
- Return type:
- create_synaptic_block(post_slices: Sequence[Slice], post_vertex_slice: Slice, synapse_type: int, synapse_info: SynapseInformation) NDArray[source]
Create a synaptic block from the data.
- Parameters:
post_vertex_slice (Slice)
synapse_type (AbstractSynapseType)
synapse_info (SynapseInformation)
- Returns:
The synaptic matrix data to go to the machine, as a Numpy array
- Return type:
- gen_connector_params(synapse_info: SynapseInformation) NDArray[uint32][source]
Get the parameters of the on machine generation.
- Parameters:
synapse_info (SynapseInformation) – The synaptic information
- Return type:
ndarray(uint32)
- property gen_connector_params_size_in_bytes: int
The size of the connector parameters, in bytes.
- Return type:
- get_delay_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation) – the synapse info
- Return type:
int or None
- get_delay_minimum(synapse_info: SynapseInformation) float[source]
Get the minimum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
int or None
- get_n_connections_from_pre_vertex_maximum(n_post_atoms: int, synapse_info: SynapseInformation, min_delay: float | None = None, max_delay: float | None = None) int[source]
Get the maximum number of connections from any neuron in the pre vertex to the neurons in the post_vertex_slice, for connections with a delay between min_delay and max_delay (inclusive) if both specified (otherwise all connections).
Not all concrete connectors support omitting the delay range.
- Parameters:
delays (RandomDistribution or int or float or str)
n_post_atoms (int)
synapse_info (SynapseInformation)
min_delay (float)
max_delay (float)
- Return type:
- get_n_connections_to_post_vertex_maximum(synapse_info: SynapseInformation) int[source]
Get the maximum number of connections to any neuron in the post vertex from neurons in the pre vertex.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- get_weight_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum of the weights for this connection.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- set_projection_information(synapse_info: SynapseInformation)[source]
Sets a connectors projection info.
- Parameters:
synapse_info (SynapseInformation) – the synapse info
- validate_connection(application_edge: ProjectionApplicationEdge, synapse_info: SynapseInformation)[source]
Checks that the edge supports the connector. Returns nothing; it is assumed that an Exception will be raised if anything is wrong.
By default this checks only that the views are not used on multi-dimensional vertices.
- Parameters:
application_edge (ApplicationEdge) – The edge of the connection
synapse_info (SynapseInformation) – The synaptic information
- class spynnaker.pyNN.FixedNumberPreConnector(n: int, *, allow_self_connections: bool = True, with_replacement: bool = False, rng: NumpyRNG | None = None, safe=True, verbose=False, callback=None)
Bases:
AbstractGenerateConnectorOnMachine,AbstractGenerateConnectorOnHostConnects a fixed number of pre-synaptic neurons selected at random, to all post-synaptic neurons.
- Parameters:
n (int) – number of random pre-synaptic neurons connected to output
allow_self_connections (bool) – if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population.
safe (bool) – Whether to check that weights and delays have valid values. If
False, this check is skipped.verbose (bool) – Whether to output extra information about the connectivity to a CSV file
with_replacement (bool) – this flag determines how the random selection of pre-synaptic neurons is performed; if true, then every pre-synaptic neuron can be chosen on each occasion, and so multiple connections between neuron pairs are possible; if false, then once a pre-synaptic neuron has been connected to a post-neuron, it can’t be connected again.
rng (NumpyRNG or None) – Seeded random number generator, or None to make one when needed
callback (callable) –
if given, a callable that display a progress bar on the terminal.
Note
Not supported by sPyNNaker.
- property allow_self_connections: bool
Do we include connections from a neuron/id to itself?
- Return type:
- create_synaptic_block(post_slices: Sequence[Slice], post_vertex_slice: Slice, synapse_type: int, synapse_info: SynapseInformation) NDArray[source]
Create a synaptic block from the data.
- Parameters:
post_vertex_slice (Slice)
synapse_type (AbstractSynapseType)
synapse_info (SynapseInformation)
- Returns:
The synaptic matrix data to go to the machine, as a Numpy array
- Return type:
- gen_connector_params(synapse_info: SynapseInformation) NDArray[uint32][source]
Get the parameters of the on machine generation.
- Parameters:
synapse_info (SynapseInformation) – The synaptic information
- Return type:
ndarray(uint32)
- property gen_connector_params_size_in_bytes: int
The size of the connector parameters, in bytes.
- Return type:
- get_delay_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation) – the synapse info
- Return type:
int or None
- get_delay_minimum(synapse_info: SynapseInformation) float[source]
Get the minimum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
int or None
- get_n_connections_from_pre_vertex_maximum(n_post_atoms: int, synapse_info: SynapseInformation, min_delay: float | None = None, max_delay: float | None = None) int[source]
Get the maximum number of connections from any neuron in the pre vertex to the neurons in the post_vertex_slice, for connections with a delay between min_delay and max_delay (inclusive) if both specified (otherwise all connections).
Not all concrete connectors support omitting the delay range.
- Parameters:
delays (RandomDistribution or int or float or str)
n_post_atoms (int)
synapse_info (SynapseInformation)
min_delay (float)
max_delay (float)
- Return type:
- get_n_connections_to_post_vertex_maximum(synapse_info: SynapseInformation) int[source]
Get the maximum number of connections to any neuron in the post vertex from neurons in the pre vertex.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- get_weight_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum of the weights for this connection.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- set_projection_information(synapse_info: SynapseInformation)[source]
Sets a connectors projection info.
- Parameters:
synapse_info (SynapseInformation) – the synapse info
- validate_connection(application_edge: ProjectionApplicationEdge, synapse_info: SynapseInformation)[source]
Checks that the edge supports the connector. Returns nothing; it is assumed that an Exception will be raised if anything is wrong.
By default this checks only that the views are not used on multi-dimensional vertices.
- Parameters:
application_edge (ApplicationEdge) – The edge of the connection
synapse_info (SynapseInformation) – The synaptic information
- class spynnaker.pyNN.FixedProbabilityConnector(p_connect: float, allow_self_connections: bool = True, safe: bool = True, verbose: bool = False, rng: NumpyRNG | None = None, callback: None = None)
Bases:
AbstractGenerateConnectorOnMachine,AbstractGenerateConnectorOnHostFor each pair of pre-post cells, the connection probability is constant.
- Parameters:
p_connect (float) – a value between zero and one. Each potential connection is created with this probability.
allow_self_connections (bool) – if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population.
safe (bool) – If
True, check that weights and delays have valid values. IfFalse, this check is skipped.verbose (bool) – Whether to output extra information about the connectivity to a CSV file
rng (NumpyRNG or None) – Seeded random number generator, or None to make one when needed
callback (callable) –
if given, a callable that display a progress bar on the terminal.
Note
Not supported by sPyNNaker.
- create_synaptic_block(post_slices: Sequence[Slice], post_vertex_slice: Slice, synapse_type: int, synapse_info: SynapseInformation) NDArray[source]
Create a synaptic block from the data.
- Parameters:
post_vertex_slice (Slice)
synapse_type (AbstractSynapseType)
synapse_info (SynapseInformation)
- Returns:
The synaptic matrix data to go to the machine, as a Numpy array
- Return type:
- gen_connector_params(synapse_info: SynapseInformation) NDArray[source]
Get the parameters of the on machine generation.
- Parameters:
synapse_info (SynapseInformation) – The synaptic information
- Return type:
ndarray(uint32)
- property gen_connector_params_size_in_bytes: int
The size of the connector parameters, in bytes.
- Return type:
- get_delay_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation) – the synapse info
- Return type:
int or None
- get_delay_minimum(synapse_info: SynapseInformation) float[source]
Get the minimum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
int or None
- get_n_connections_from_pre_vertex_maximum(n_post_atoms: int, synapse_info: SynapseInformation, min_delay: float | None = None, max_delay: float | None = None) int[source]
Get the maximum number of connections from any neuron in the pre vertex to the neurons in the post_vertex_slice, for connections with a delay between min_delay and max_delay (inclusive) if both specified (otherwise all connections).
Not all concrete connectors support omitting the delay range.
- Parameters:
delays (RandomDistribution or int or float or str)
n_post_atoms (int)
synapse_info (SynapseInformation)
min_delay (float)
max_delay (float)
- Return type:
- get_n_connections_to_post_vertex_maximum(synapse_info: SynapseInformation) int[source]
Get the maximum number of connections to any neuron in the post vertex from neurons in the pre vertex.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- get_weight_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum of the weights for this connection.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- property p_connect: float
Probability for each potential connection.
A value between zero and one. (inclusive)
- Return type:
- validate_connection(application_edge: ProjectionApplicationEdge, synapse_info: SynapseInformation)[source]
Checks that the edge supports the connector. Returns nothing; it is assumed that an Exception will be raised if anything is wrong.
By default this checks only that the views are not used on multi-dimensional vertices.
- Parameters:
application_edge (ApplicationEdge) – The edge of the connection
synapse_info (SynapseInformation) – The synaptic information
- spynnaker.pyNN.FixedTotalNumberConnector
alias of
MultapseConnector
- class spynnaker.pyNN.FromFileConnector(file: str | BaseFile, distributed=False, safe=True, callback=None, verbose=False)
Bases:
FromListConnectorMake connections according to a list read from a file.
- Parameters:
Either an open file object or the filename of a file containing a list of connections, in the format required by
FromListConnector. Column headers, if included in the file, must be specified using a list or tuple, e.g.:# columns = ["i", "j", "weight", "delay", "U", "tau_rec"]Note
The header requires # at the beginning of the line.
distributed (bool) –
Basic pyNN says:
if this is
True, then each node will read connections from a file calledfilename.x, wherexis the MPI rank. This speeds up loading connections for distributed simulations.Note
Always leave this as
Falsewith sPyNNaker, which is not MPI-based.safe (bool) – Whether to check that weights and delays have valid values. If
False, this check is skipped.callback (callable) –
if given, a callable that display a progress bar on the terminal.
Note
Not supported by sPyNNaker.
verbose (bool) – Whether to output extra information about the connectivity to a CSV file
- class spynnaker.pyNN.FromListConnector(conn_list: None | ndarray[Any, dtype[_ScalarType_co]] | List[Tuple[int, ...]], column_names: Sequence[str] | None = None, *, safe=True, verbose=False, callback=None)
Bases:
AbstractConnector,AbstractGenerateConnectorOnHostMake connections according to a list.
- Parameters:
conn_list (ndarray or list(tuple(int,int,...))) –
A numpy array or a list of tuples, one tuple for each connection. Each tuple should contain:
(pre_idx, post_idx, p1, p2, ..., pn)
where
pre_idxis the index (i.e. order in the Population, not the ID) of the presynaptic neuron,post_idxis the index of the postsynaptic neuron, andp1,p2, etc. are the synaptic parameters (e.g., weight, delay, plasticity parameters). All tuples/rows must have the same number of items.safe (bool) – if
True, check that weights and delays have valid values. IfFalse, this check is skipped.verbose (bool) – Whether to output extra information about the connectivity to a CSV file
column_names (None or tuple(str) or list(str)) – the names of the parameters
p1,p2, etc. If not provided, it is assumed the parameters areweight, delay(for backwards compatibility).callback (callable) –
if given, a callable that display a progress bar on the terminal.
Note
Not supported by sPyNNaker.
- property column_names: Sequence[str] | None
The names of the columns in the array after the first two. Of particular interest is whether
weightanddelaycolumns are present.
- create_synaptic_block(post_slices: Sequence[Slice], post_vertex_slice: Slice, synapse_type: int, synapse_info: SynapseInformation) NDArray[source]
Create a synaptic block from the data.
- Parameters:
post_vertex_slice (Slice)
synapse_type (AbstractSynapseType)
synapse_info (SynapseInformation)
- Returns:
The synaptic matrix data to go to the machine, as a Numpy array
- Return type:
- get_connected_vertices(s_info: SynapseInformation, source_vertex: ApplicationVertex, target_vertex: ApplicationVertex) Sequence[Tuple[MachineVertex, Sequence[AbstractVertex]]][source]
Get the machine vertices that are connected to each other with this connector
- Parameters:
s_info (SynapseInformation) – The synapse information of the connection
source_vertex (ApplicationVertex) – The source of the spikes
target_vertex (ApplicationVertex) – The target of the spikes
- Returns:
A list of tuples of (target machine vertex, list of sources)
- Return type:
- get_delay_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation) – the synapse info
- Return type:
int or None
- get_delay_minimum(synapse_info: SynapseInformation) float[source]
Get the minimum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
int or None
- get_delay_variance(delays: Delay_Types, synapse_info: SynapseInformation) float[source]
Get the variance of the delays.
- Parameters:
delays (RandomDistribution or int or float or str)
- Return type:
- get_extra_parameters() ndarray[Any, dtype[_ScalarType_co]] | None[source]
Getter for the extra parameters. Excludes
weightanddelaycolumns.- Returns:
The extra parameters
- Return type:
- get_n_connections_from_pre_vertex_maximum(n_post_atoms: int, synapse_info: SynapseInformation, min_delay: float | None = None, max_delay: float | None = None) int[source]
Get the maximum number of connections from any neuron in the pre vertex to the neurons in the post_vertex_slice, for connections with a delay between min_delay and max_delay (inclusive) if both specified (otherwise all connections).
Not all concrete connectors support omitting the delay range.
- Parameters:
delays (RandomDistribution or int or float or str)
n_post_atoms (int)
synapse_info (SynapseInformation)
min_delay (float)
max_delay (float)
- Return type:
- get_n_connections_to_post_vertex_maximum(synapse_info: SynapseInformation) int[source]
Get the maximum number of connections to any neuron in the post vertex from neurons in the pre vertex.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- get_weight_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum of the weights for this connection.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- get_weight_mean(weights: Weight_Types, synapse_info: SynapseInformation) float[source]
Get the mean of the weights.
- Parameters:
weights (RandomDistribution or int or float or str)
- Return type:
- get_weight_variance(weights: Weight_Types, synapse_info: SynapseInformation) float[source]
Get the variance of the weights.
- Parameters:
weights (RandomDistribution or int or float or str)
- Return type:
- validate_connection(application_edge: ProjectionApplicationEdge, synapse_info: SynapseInformation)[source]
Checks that the edge supports the connector. Returns nothing; it is assumed that an Exception will be raised if anything is wrong.
By default this checks only that the views are not used on multi-dimensional vertices.
- Parameters:
application_edge (ApplicationEdge) – The edge of the connection
synapse_info (SynapseInformation) – The synaptic information
- class spynnaker.pyNN.Grid2D(aspect_ratio=1.0, dx=1.0, dy=1.0, x0=0.0, y0=0.0, z=0, fill_order='sequential', rng=None)[source]
Bases:
BaseStructureRepresents a structure with neurons distributed on a 2D grid.
- Arguments:
- dx, dy:
distances between points in the x, y directions.
- x0, y0:
coordinates of the starting corner of the grid.
- z:
the z-coordinate of all points in the grid.
- aspect_ratio:
ratio of the number of grid points per side (not the ratio of the side lengths, unless
dx == dy)- fill_order:
may be ‘sequential’ or ‘random’
- calculate_size(n)[source]
docstring goes here
- generate_positions(n)[source]
Calculate and return the positions of n neurons positioned according to this structure.
- parameter_names = ('aspect_ratio', 'dx', 'dy', 'x0', 'y0', 'z', 'fill_order')
- class spynnaker.pyNN.Grid3D(aspect_ratioXY=1.0, aspect_ratioXZ=1.0, dx=1.0, dy=1.0, dz=1.0, x0=0.0, y0=0.0, z0=0, fill_order='sequential', rng=None)[source]
Bases:
BaseStructureRepresents a structure with neurons distributed on a 3D grid.
- Arguments:
- dx, dy, dz:
distances between points in the x, y, z directions.
- x0, y0. z0:
coordinates of the starting corner of the grid.
- aspect_ratioXY, aspect_ratioXZ:
ratios of the number of grid points per side (not the ratio of the side lengths, unless
dx == dy == dz)- fill_order:
may be ‘sequential’ or ‘random’.
If fill_order is ‘sequential’, the z-index will be filled first, then y then x, i.e. the first cell will be at (0,0,0) (given default values for the other arguments), the second at (0,0,1), etc.
- calculate_size(n)[source]
docstring goes here
- generate_positions(n)[source]
Calculate and return the positions of n neurons positioned according to this structure.
- parameter_names = ('aspect_ratios', 'dx', 'dy', 'dz', 'x0', 'y0', 'z0', 'fill_order')
- spynnaker.pyNN.IF_cond_exp
alias of
IFCondExpBase
- spynnaker.pyNN.IF_curr_alpha
alias of
IFCurrAlpha
- spynnaker.pyNN.IF_curr_delta
alias of
IFCurrDelta
- spynnaker.pyNN.IF_curr_exp
alias of
IFCurrExpBase
- class spynnaker.pyNN.IndexBasedProbabilityConnector(index_expression: str, allow_self_connections: bool = True, rng: NumpyRNG | None = None, safe=True, callback=None, verbose=False)
Bases:
AbstractConnector,AbstractGenerateConnectorOnHostMake connections using a probability distribution which varies dependent upon the indices of the pre- and post-populations.
- Parameters:
index_expression (str) – the right-hand side of a valid python expression for probability, involving the indices of the pre- and post-populations, that can be parsed by eval(), that computes a probability distribution; the indices will be given as variables
iandjwhen the expression is evaluated.allow_self_connections (bool) – if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population.
rng (NumpyRNG or None) – Seeded random number generator, or
Noneto make one when needed.safe (bool) – Whether to check that weights and delays have valid values. If
False, this check is skipped.callback (callable) –
if given, a callable that display a progress bar on the terminal.
Note
Not supported by sPyNNaker.
verbose (bool) – Whether to output extra information about the connectivity to a CSV file
- property allow_self_connections: bool
When the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population.
- Return type:
- create_synaptic_block(post_slices: Sequence[Slice], post_vertex_slice: Slice, synapse_type: int, synapse_info: SynapseInformation) NDArray[source]
Create a synaptic block from the data.
- Parameters:
post_vertex_slice (Slice)
synapse_type (AbstractSynapseType)
synapse_info (SynapseInformation)
- Returns:
The synaptic matrix data to go to the machine, as a Numpy array
- Return type:
- get_delay_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation) – the synapse info
- Return type:
int or None
- get_delay_minimum(synapse_info: SynapseInformation) float[source]
Get the minimum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
int or None
- get_n_connections_from_pre_vertex_maximum(n_post_atoms: int, synapse_info: SynapseInformation, min_delay: float | None = None, max_delay: float | None = None) int[source]
Get the maximum number of connections from any neuron in the pre vertex to the neurons in the post_vertex_slice, for connections with a delay between min_delay and max_delay (inclusive) if both specified (otherwise all connections).
Not all concrete connectors support omitting the delay range.
- Parameters:
delays (RandomDistribution or int or float or str)
n_post_atoms (int)
synapse_info (SynapseInformation)
min_delay (float)
max_delay (float)
- Return type:
- get_n_connections_to_post_vertex_maximum(synapse_info: SynapseInformation) int[source]
Get the maximum number of connections to any neuron in the post vertex from neurons in the pre vertex.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- get_weight_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum of the weights for this connection.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- spynnaker.pyNN.Izhikevich
alias of
IzkCurrExpBase
- class spynnaker.pyNN.KernelConnector(shape_pre: _TwoD, shape_post: _TwoD, shape_kernel: _TwoD, weight_kernel: _Kernel | None = None, delay_kernel: _Kernel | None = None, shape_common: _TwoD | None = None, pre_sample_steps_in_post: _TwoD | None = None, pre_start_coords_in_post: _TwoD | None = None, post_sample_steps_in_pre: _TwoD | None = None, post_start_coords_in_pre: _TwoD | None = None, safe: bool = True, space: Space | None = None, verbose: bool = False, callback: None = None)
Bases:
AbstractGenerateConnectorOnMachine,AbstractGenerateConnectorOnHostWhere the pre- and post-synaptic populations are considered as a 2D array. Connect every post(row, column) neuron to many pre(row, column, kernel) through a (kernel) set of weights and/or delays.
- Parameters:
shape_pre (list(int) or tuple(int,int)) – 2D shape of the pre-population (rows/height, columns/width, usually the input image shape)
shape_post (list(int) or tuple(int,int)) – 2D shape of the post-population (rows/height, columns/width)
shape_kernel (list(int) or tuple(int,int)) – 2D shape of the kernel (rows/height, columns/width)
weight_kernel (ndarray or RandomDistribution or int or float or list(int) or list(float) or None) – (optional) 2D matrix of size shape_kernel describing the weights
delay_kernel (ndarray or RandomDistribution or int or float or list(int) or list(float) or None) – (optional) 2D matrix of size shape_kernel describing the delays
shape_common (list(int) or tuple(int,int) or None) – (optional) 2D shape of common coordinate system (for both pre- and post-, usually the input image sizes)
pre_sample_steps_in_post (None or list(int) or tuple(int,int)) – (optional) Sampling steps/jumps for pre-population <=> (stepX, stepY)
pre_start_coords_in_post (None or list(int) or tuple(int,int)) – (optional) Starting row/column for pre-population sampling <=> (offX, offY)
post_sample_steps_in_pre (None or list(int) or tuple(int,int)) – (optional) Sampling steps/jumps for post-population <=> (stepX, stepY)
post_start_coords_in_pre (None or list(int) or tuple(int,int)) – (optional) Starting row/column for post-population sampling <=> (offX, offY)
safe (bool) – Whether to check that weights and delays have valid values. If
False, this check is skipped.space (Space) – Currently ignored; for future compatibility.
verbose (bool) – Whether to output extra information about the connectivity to a CSV file
callback (callable) – (ignored)
- create_synaptic_block(post_slices: Sequence[Slice], post_vertex_slice: Slice, synapse_type: int, synapse_info: SynapseInformation) NDArray[source]
Create a synaptic block from the data.
- Parameters:
post_vertex_slice (Slice)
synapse_type (AbstractSynapseType)
synapse_info (SynapseInformation)
- Returns:
The synaptic matrix data to go to the machine, as a Numpy array
- Return type:
- gen_connector_params(synapse_info: SynapseInformation) NDArray[uint32][source]
Get the parameters of the on machine generation.
- Parameters:
synapse_info (SynapseInformation) – The synaptic information
- Return type:
ndarray(uint32)
- property gen_connector_params_size_in_bytes: int
The size of the connector parameters, in bytes.
- Return type:
- get_connected_vertices(s_info: SynapseInformation, source_vertex: ApplicationVertex, target_vertex: ApplicationVertex) Sequence[Tuple[MachineVertex, Sequence[AbstractVertex]]][source]
Get the machine vertices that are connected to each other with this connector
- Parameters:
s_info (SynapseInformation) – The synapse information of the connection
source_vertex (ApplicationVertex) – The source of the spikes
target_vertex (ApplicationVertex) – The target of the spikes
- Returns:
A list of tuples of (target machine vertex, list of sources)
- Return type:
- get_delay_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation) – the synapse info
- Return type:
int or None
- get_delay_minimum(synapse_info: SynapseInformation) float[source]
Get the minimum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
int or None
- get_delay_variance(delays: Delay_Types, synapse_info: SynapseInformation) float[source]
Get the variance of the delays.
- Parameters:
delays (RandomDistribution or int or float or str)
- Return type:
- get_n_connections_from_pre_vertex_maximum(n_post_atoms: int, synapse_info: SynapseInformation, min_delay: float | None = None, max_delay: float | None = None) int[source]
Get the maximum number of connections from any neuron in the pre vertex to the neurons in the post_vertex_slice, for connections with a delay between min_delay and max_delay (inclusive) if both specified (otherwise all connections).
Not all concrete connectors support omitting the delay range.
- Parameters:
delays (RandomDistribution or int or float or str)
n_post_atoms (int)
synapse_info (SynapseInformation)
min_delay (float)
max_delay (float)
- Return type:
- get_n_connections_to_post_vertex_maximum(synapse_info: SynapseInformation) int[source]
Get the maximum number of connections to any neuron in the post vertex from neurons in the pre vertex.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- get_weight_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum of the weights for this connection.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- get_weight_mean(weights: Weight_Types, synapse_info: SynapseInformation) float[source]
Get the mean of the weights.
- Parameters:
weights (RandomDistribution or int or float or str)
- Return type:
- get_weight_variance(weights: Weight_Types, synapse_info: SynapseInformation) float[source]
Get the variance of the weights.
- Parameters:
weights (RandomDistribution or int or float or str)
- Return type:
- validate_connection(application_edge: ProjectionApplicationEdge, synapse_info: SynapseInformation)[source]
Checks that the edge supports the connector. Returns nothing; it is assumed that an Exception will be raised if anything is wrong.
By default this checks only that the views are not used on multi-dimensional vertices.
- Parameters:
application_edge (ApplicationEdge) – The edge of the connection
synapse_info (SynapseInformation) – The synaptic information
- class spynnaker.pyNN.LastNeuronSelection(spike_buffer_size=64)
Bases:
AbstractPartnerSelectionPartner selection that picks a random source neuron from the neurons that spiked in the last timestep.
- Parameters:
spike_buffer_size – The size of the buffer for holding spikes
- get_parameter_names() Iterable[str][source]
Get the parameter names available from the component.
- Return type:
iterable(str)
- get_parameters_sdram_usage_in_bytes() int[source]
Get the amount of SDRAM used by the parameters of this rule.
- Return type:
- property vertex_executable_suffix: str
The suffix to be appended to the vertex executable for this rule.
- Return type:
- write_parameters(spec: DataSpecificationBase)[source]
Write the parameters of the rule to the spec.
- Parameters:
spec (DataSpecificationGenerator)
- class spynnaker.pyNN.Line(dx=1.0, x0=0.0, y=0.0, z=0.0)[source]
Bases:
BaseStructureRepresents a structure with neurons distributed evenly on a straight line.
- Arguments:
- dx:
distance between points in the line.
- y, z,:
y- and z-coordinates of all points in the line.
- x0:
x-coordinate of the first point in the line.
- generate_positions(n)[source]
Calculate and return the positions of n neurons positioned according to this structure.
- parameter_names = ('dx', 'x0', 'y', 'z')
- spynnaker.pyNN.MultiplicativeWeightDependence
alias of
WeightDependenceMultiplicative
- class spynnaker.pyNN.NoisyCurrentSource(mean=0.0, stdev=0.0, start=0.0, stop=0.0, dt=1.0, rng=None)
Bases:
AbstractCurrentSourceA noisy current source beginning at “start” and ending at “stop”, with noise simulated based on the given mean and standard deviation, and updating every dt (dt should default to the machine time step).
- class spynnaker.pyNN.NumpyRNG(seed=None, parallel_safe=True)[source]
Bases:
WrappedRNGWrapper for the
np.random.RandomStateclass (Mersenne Twister PRNG).- normal_clipped(mu=0.0, sigma=1.0, low=-inf, high=inf, size=None)[source]
- normal_clipped_to_boundary(mu=0.0, sigma=1.0, low=-inf, high=inf, size=None)[source]
- translations = {'binomial': ('binomial', {'n': 'n', 'p': 'p'}), 'exponential': ('exponential', {'beta': 'scale'}), 'gamma': ('gamma', {'k': 'shape', 'theta': 'scale'}), 'lognormal': ('lognormal', {'mu': 'mean', 'sigma': 'sigma'}), 'normal': ('normal', {'mu': 'loc', 'sigma': 'scale'}), 'normal_clipped': ('normal_clipped', {'high': 'high', 'low': 'low', 'mu': 'mu', 'sigma': 'sigma'}), 'normal_clipped_to_boundary': ('normal_clipped_to_boundary', {'high': 'high', 'low': 'low', 'mu': 'mu', 'sigma': 'sigma'}), 'poisson': ('poisson', {'lambda_': 'lam'}), 'uniform': ('uniform', {'high': 'high', 'low': 'low'}), 'uniform_int': ('randint', {'high': 'high', 'low': 'low'}), 'vonmises': ('vonmises', {'kappa': 'kappa', 'mu': 'mu'})}
- class spynnaker.pyNN.OneToOneConnector(safe=True, callback=None, verbose=False)
Bases:
AbstractGenerateConnectorOnMachine,AbstractGenerateConnectorOnHostWhere the pre- and postsynaptic populations have the same size, connect cell i in the presynaptic population to cell i in the postsynaptic population, for all i.
- Parameters:
safe (bool) – If
True, check that weights and delays have valid values. IfFalse, this check is skipped.callback (callable) –
if given, a callable that display a progress bar on the terminal.
Note
Not supported by sPyNNaker.
verbose (bool) – Whether to output extra information about the connectivity to a CSV file
- create_synaptic_block(post_slices: Sequence[Slice], post_vertex_slice: Slice, synapse_type: int, synapse_info: SynapseInformation) NDArray[source]
Create a synaptic block from the data.
- Parameters:
post_vertex_slice (Slice)
synapse_type (AbstractSynapseType)
synapse_info (SynapseInformation)
- Returns:
The synaptic matrix data to go to the machine, as a Numpy array
- Return type:
- gen_connector_params(synapse_info: SynapseInformation) NDArray[uint32][source]
Get the parameters of the on machine generation.
- Parameters:
synapse_info (SynapseInformation) – The synaptic information
- Return type:
ndarray(uint32)
- property gen_connector_params_size_in_bytes: int
The size of the connector parameters, in bytes.
- Return type:
- generate_on_machine(synapse_info: SynapseInformation) bool[source]
Determine if this instance can generate on the machine.
Default implementation returns True if the weights and delays can be generated on the machine
- Parameters:
synapse_info (SynapseInformation) – The synapse information
- Return type:
- get_connected_vertices(s_info: SynapseInformation, source_vertex: ApplicationVertex, target_vertex: ApplicationVertex) Sequence[Tuple[MachineVertex, Sequence[MachineVertex]]][source]
Get the machine vertices that are connected to each other with this connector
- Parameters:
s_info (SynapseInformation) – The synapse information of the connection
source_vertex (ApplicationVertex) – The source of the spikes
target_vertex (ApplicationVertex) – The target of the spikes
- Returns:
A list of tuples of (target machine vertex, list of sources)
- Return type:
- get_delay_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation) – the synapse info
- Return type:
int or None
- get_delay_minimum(synapse_info: SynapseInformation) float[source]
Get the minimum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
int or None
- get_n_connections_from_pre_vertex_maximum(n_post_atoms: int, synapse_info: SynapseInformation, min_delay: float | None = None, max_delay: float | None = None) int[source]
Get the maximum number of connections from any neuron in the pre vertex to the neurons in the post_vertex_slice, for connections with a delay between min_delay and max_delay (inclusive) if both specified (otherwise all connections).
Not all concrete connectors support omitting the delay range.
- Parameters:
delays (RandomDistribution or int or float or str)
n_post_atoms (int)
synapse_info (SynapseInformation)
min_delay (float)
max_delay (float)
- Return type:
- get_n_connections_to_post_vertex_maximum(synapse_info: SynapseInformation) int[source]
Get the maximum number of connections to any neuron in the post vertex from neurons in the pre vertex.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- get_weight_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum of the weights for this connection.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- spynnaker.pyNN.PoolDense
alias of
LocalOnlyPoolDense
- class spynnaker.pyNN.PoolDenseConnector(weights: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], pool_shape: int | Tuple[int] | None = None, pool_stride: int | Tuple[int] | None = None, positive_receptor_type: str = 'excitatory', negative_receptor_type: str = 'inhibitory', safe=True, verbose=False, callback=None)
Bases:
AbstractConnectorA multidimensional connector based on weight and pool shape and stride.
A weight is provided for every pre-post pair of neurons, where the post-population size is determined by the pre-population size and a pool shape, which how many pre-neurons are connected to each post-neuron in each dimension, and pool stride, which decides how the shape moves over the image in each dimension to choose the pre-neurons for each post-neuron.
- Parameters:
weights (int or float or list(int or float) or ndarray or RandomDistribution) –
The synaptic strengths. Can be:
pool_shape (int or tuple(int) or None) – Shape of average pooling. If a single value is provided, it will be used for every dimension, otherwise must be the same number of values as there are dimensions in the source.
pool_stride (int or tuple(int) or None) – Jumps between pooling regions. If a single value is provided, the same stride will be used for all dimensions, otherwise must be the same number of values as there are dimensions in the source. If None, and pool_shape is provided, pool_stride will be set to pool_shape.
positive_receptor_type (str) – The receptor type to add the positive weights to. By default this is “excitatory”.
negative_receptor_type (str) – The receptor type to add the negative weights to. By default this is “inhibitory”.
safe (bool) – (ignored)
verbose (bool) – (ignored)
callback (callable) – (ignored)
- get_delay_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation) – the synapse info
- Return type:
int or None
- get_delay_minimum(synapse_info: SynapseInformation) float[source]
Get the minimum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
int or None
- get_local_only_data(app_edge: ProjectionApplicationEdge, local_delay: int, delay_stage: int, post_vertex_slice: Slice, weight_scales: NDArray[floating]) NDArray[uint32][source]
- get_n_connections_from_pre_vertex_maximum(n_post_atoms: int, synapse_info: SynapseInformation, min_delay: float | None = None, max_delay: float | None = None) int[source]
Get the maximum number of connections from any neuron in the pre vertex to the neurons in the post_vertex_slice, for connections with a delay between min_delay and max_delay (inclusive) if both specified (otherwise all connections).
Not all concrete connectors support omitting the delay range.
- Parameters:
delays (RandomDistribution or int or float or str)
n_post_atoms (int)
synapse_info (SynapseInformation)
min_delay (float)
max_delay (float)
- Return type:
- get_n_connections_to_post_vertex_maximum(synapse_info: SynapseInformation) int[source]
Get the maximum number of connections to any neuron in the post vertex from neurons in the pre vertex.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- classmethod get_post_pool_shape(pre_shape: Tuple[int, ...], pool_shape: int | Tuple[int, ...] | None = None, pool_stride: int | Tuple[int, ...] | None = None) ndarray[Any, dtype[_ScalarType_co]][source]
The shape considering the stride
- Parameters:
pre_shape – tuple(int)
- Return type:
ndarray
- get_weight_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum of the weights for this connection.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- validate_connection(application_edge: ProjectionApplicationEdge, synapse_info: SynapseInformation)[source]
Checks that the edge supports the connector. Returns nothing; it is assumed that an Exception will be raised if anything is wrong.
By default this checks only that the views are not used on multi-dimensional vertices.
- Parameters:
application_edge (ApplicationEdge) – The edge of the connection
synapse_info (SynapseInformation) – The synaptic information
- class spynnaker.pyNN.Population(size: int | float | None, cellclass: Type[AbstractPyNNModel] | AbstractPyNNModel | PopulationApplicationVertex, cellparams: Dict[str, Any] | None = None, structure: BaseStructure | None = None, initial_values: Dict[str, float] | None = None, label: str | None = None, additional_parameters: Dict[str, Any] | None = None, **additional_kwargs)
Bases:
PopulationBasePyNN population object.
- Parameters:
size (int) – The number of neurons in the population
cellclass (type or AbstractPyNNModel) – The implementation of the individual neurons.
cellparams (dict(str,object) or None) – Parameters to pass to
cellclassif it is a class to instantiate. Must beNoneifcellclassis an instantiated object.structure (BaseStructure)
initial_values (dict(str,float)) – Initial values of state variables
label (str) – A label for the population
additional_parameters (dict(str, ...)) – Additional parameters to pass to the vertex creation function.
additional_kwargs (dict(str, ...)) – A nicer way of allowing additional things
- add_placement_constraint(x: int, y: int, p: int | None = None)[source]
Add a placement constraint.
- Parameters:
- Raises:
SimulatorRunningException – If sim.run is currently running
SimulatorNotSetupException – If called before sim.setup
SimulatorShutdownException – If called after sim.end
- all() Iterable[PopulationView][source]
Iterator over cell IDs on all MPI nodes.
- Return type:
iterable(IDMixin)
- can_record(variable: str) bool[source]
Determine whether variable can be recorded from this population.
- property celltype: AbstractPyNNModel
Implements the PyNN expected celltype property.
- Returns:
The cell type this property has been set to, or the vertex if it was directly instantiated.
- Return type:
- static create(cellclass: Type[AbstractPyNNModel] | AbstractPyNNModel | PopulationApplicationVertex, cellparams: Dict[str, Any] | None = None, n: int = 1) Population[source]
Pass through method to the constructor defined by PyNN. Create
ncells all of the same type.- Parameters:
- Returns:
A New Population
- Return type:
- property current_values: ParameterHolder
Get the current values of the state variables.
- Return type:
- describe(template: str = 'population_default.txt', engine: str | TemplateEngine | None = 'default') str | Dict[str, Any][source]
Returns a human-readable description of the population.
The output may be customised by specifying a different template together with an associated template engine (see
pyNN.descriptions).If
templateisNone, then a dictionary containing the template context will be returned.
- get(parameter_names: Names, gather: bool = True, simplify=True) ParameterHolder[source]
Get the values of a parameter for every local cell in the population.
- Parameters:
- Returns:
A single list of values (or possibly a single value) if paramter_names is a string, or a dict of these if parameter names is a list.
- Return type:
- get_data(variables: Names = 'all', gather: bool = True, clear: bool = False, *, annotations: Dict[str, Any] | None = None) neo.Block[source]
Return a Neo Block containing the data (spikes, state variables) recorded from the Assembly.
- Parameters:
variables (str or list(str)) – either a single variable name or a list of variable names. Variables must have been previously recorded, otherwise an Exception will be raised.
gather (bool) –
Whether to collect data from all MPI nodes or just the current node.
Note
This is irrelevant on sPyNNaker, which always behaves as if this parameter is True.
clear (bool) – Whether recorded data will be deleted from the
Assembly.annotations (dict(str, ...)) – annotations to put on the neo block
- Return type:
- Raises:
ConfigurationException – If the variable or variables have not been previously set to record.
- get_spike_counts(gather: bool = True) Dict[int, int][source]
Return the number of spikes for each neuron.
- Return type:
- id_to_index(id: int | Iterable[int]) int | Sequence[int][source]
Given the ID(s) of cell(s) in the Population, return its (their) index (order in the Population).
Defined by https://neuralensemble.org/docs/PyNN/reference/populations.html
- id_to_local_index(cell_id)[source]
Given the ID(s) of cell(s) in the Population, return its (their) index (order in the Population), counting only cells on the local MPI node.
Defined by https://neuralensemble.org/docs/PyNN/reference/populations.html
- index_to_id(index: int | Iterable[int]) int | Sequence[int][source]
Given the index (order in the Population) of cell(s) in the Population, return their ID(s)
- property initial_values: ParameterHolder
The initial values of the state variables.
Note
These values will be the same as the values set with the last call to initialize rather than the actual initial values if this call has been made.
- Return type:
- initialize(**kwargs: Values)[source]
Set initial values of state variables, e.g. the membrane potential. Values passed to
initialize()may be:single numeric values (all neurons set to the same value), or
RandomDistributionobjects, orlists / arrays of numbers of the same size as the population mapping functions, where a mapping function accepts a single argument (the cell index) and returns a single number.
Values should be expressed in the standard PyNN units (i.e. millivolts, nanoamps, milliseconds, microsiemens, nanofarads, event per second).
Examples:
p.initialize(v=-70.0) p.initialize(v=rand_distr, gsyn_exc=0.0) p.initialize(v=lambda i: -65 + i / 10.0)
- inject(current_source: NeuronCurrentSource)[source]
Connect a current source to all cells in the Population.
Defined by https://neuralensemble.org/docs/PyNN/reference/populations.html
- property positions: ndarray[Any, dtype[floating]]
The position array for structured populations.
- Returns:
a 3xN array
- Return type:
- record(variables: Names, to_file: str | None = None, sampling_interval: int | None = None)[source]
Record the specified variable or variables for all cells in the Population or view.
- Parameters:
variables (str or list(str)) – either a single variable name or a list of variable names. For a given celltype class, celltype.recordable contains a list of variables that can be recorded for that celltype.
to_file (io or rawio or str) – a file to automatically record to (optional).
write_data()will be automatically called when sim.end() is called.sampling_interval (int) – a value in milliseconds, and an integer multiple of the simulation timestep.
- sample(n: int, rng: NumpyRNG | None = None) PopulationView[source]
Randomly sample n cells from the Population, and return a PopulationView object.
- Parameters:
- Return type:
- set(**parameters: Values)[source]
Set one or more parameters for every cell in the population. For example:
p.set(tau_m=20.0).
- Parameters:
parameters – The parameters to set and the values to set them to. The type of each parameter depends on the parameter; it’s often a float, but not always.
- Raises:
SimulatorRunningException – If sim.run is currently running
SimulatorNotSetupException – If called before sim.setup
SimulatorShutdownException – If called after sim.end
- set_max_atoms_per_core(max_atoms_per_core: int)[source]
Supports the setting of this population’s max atoms per dimension per core.
- Parameters:
max_atoms_per_core (int) – the new value for the max atoms per dimension per core.
- Raises:
SimulatorRunningException – If sim.run is currently running
SimulatorNotSetupException – If called before sim.setup
SimulatorShutdownException – If called after sim.end
- set_state(**kwargs: Values)[source]
Set current values of state variables, e.g. the membrane potential. Values passed to
set_state()may be:single numeric values (all neurons set to the same value), or
RandomDistributionobjects, orlists / arrays of numbers of the same size as the population mapping functions, where a mapping function accepts a single argument (the cell index) and returns a single number.
Values should be expressed in the standard PyNN units (i.e. millivolts, nanoamps, milliseconds, microsiemens, nanofarads, event per second).
Examples:
p.set_state(v=-70.0) p.set_state(v=rand_distr, gsyn_exc=0.0) p.set_state(v=lambda i: -65 + i / 10.0)
- spinnaker_get_data(variable: str, as_matrix: bool = False, view_indexes: Sequence[int] | None = None) ndarray[Any, dtype[floating]][source]
SsPyNNaker specific method for getting data as a numpy array, instead of the Neo-based object
- property structure: BaseStructure | None
The structure for the population.
- Return type:
BaseStructure or None
- write_data(io: str | BaseIO, variables: Names = 'all', gather: bool = True, clear: bool = False, annotations: Dict[str, Any] | None = None)[source]
Write recorded data to file, using one of the file formats supported by Neo.
- Parameters:
io (neo.io.baseio.BaseIO or str) – a Neo IO instance, or a string for where to put a neo instance
variables (str or list(str)) – either a single variable name or a list of variable names. Variables must have been previously recorded, otherwise an Exception will be raised.
gather (bool) –
Whether to bring all relevant data together.
Note
SpiNNaker always gathers.
clear (bool) – clears the storage data if set to true after reading it back
annotations (dict(str, ...)) – annotations to put on the neo block
- Raises:
ConfigurationException – If the variable or variables have not been previously set to record.
- class spynnaker.pyNN.PopulationView(parent: Population | 'PopulationView', selector: Selector, label: str | None = None)
Bases:
PopulationBaseA view of a subset of neurons within a
Population.In most ways, Populations and PopulationViews have the same behaviour, i.e., they can be recorded, connected with Projections, etc. It should be noted that any changes to neurons in a PopulationView will be reflected in the parent Population and vice versa.
It is possible to have views of views.
Note
Selector to Id is actually handled by
AbstractSized.- Parameters:
parent (Population or PopulationView) – the population or view to make the view from
vertex (PopulationApplicationVertex) – The actual underlying vertex
recorder (Recorder) – The recorder of the Population
selector (None or slice or int or list(bool) or list(int) or ndarray(bool) or ndarray(int)) –
a slice or numpy mask array. The mask array should either be a Boolean array (ideally) of the same size as the parent, or an integer array containing cell indices, i.e. if p.size == 5 then:
PopulationView(p, array([False, False, True, False, True])) PopulationView(p, array([2, 4])) PopulationView(p, slice(2, 5, 2))
will all create the same view.
label (str) – A label for the view
- all() Iterable[IDMixin][source]
Iterator over cell IDs (on all MPI nodes).
- Return type:
iterable(IDMixin)
- property all_cells: Sequence[IDMixin]
An array containing the cell IDs of all neurons in the Population (all MPI nodes).
- can_record(variable: str) bool[source]
Determine whether variable can be recorded from this population.
- Return type:
- property celltype: AbstractPyNNModel
The type of neurons making up the underlying Population.
- Return type:
- property conductance_based: bool
Whether the post-synaptic response is modelled as a change in conductance or a change in current.
- Return type:
- property current_values: ParameterHolder
A dict containing the current values of the state variables.
- Return type:
InitialValuesHolder
- describe(template='populationview_default.txt', engine='default')[source]
Returns a human-readable description of the population view.
The output may be customised by specifying a different template together with an associated template engine (see pyNN.descriptions).
If template is
None, then a dictionary containing the template context will be returned.
- find_units(variable: str) str[source]
Get the units of a variable
Warning
No PyNN description of this method.
- get(parameter_names: Names, gather=False, simplify=True) ParameterHolder[source]
Get the values of the given parameters for every local cell in the population, or, if
gather=True, for all cells in the population.Values will be expressed in the standard PyNN units (i.e. millivolts, nanoamps, milliseconds, microsiemens, nanofarads, event per second).
Note
SpiNNaker always gathers.
- get_data(variables: Names = 'all', gather=True, clear: bool = False, *, annotations: Dict[str, Any] | None = None) neo.Block[source]
Return a Neo Block containing the data(spikes, state variables) recorded from the Population.
- Parameters:
variables (str or list(str)) – Either a single variable name or a list of variable names. Variables must have been previously recorded, otherwise an Exception will be raised.
gather (bool) –
For parallel simulators, if gather is True, all data will be gathered to all nodes and the Neo Block will contain data from all nodes. Otherwise, the Neo Block will contain only data from the cells simulated on the local node.
Note
SpiNNaker always gathers.
clear (bool) – If True, recorded data will be deleted from the Population.
annotations (dict(str, ...)) – annotations to put on the neo block
- Return type:
- Raises:
ConfigurationException – If the variable or variables have not been previously set to record.
- get_spike_counts(gather: bool = True) Dict[int, int][source]
Returns a dict containing the number of spikes for each neuron.
The dict keys are neuron IDs, not indices.
- Parameters:
gather (bool) –
For parallel simulators, if this is True, all data will be gathered to all nodes and the Neo Block will contain data from all nodes. Otherwise, the Neo Block will contain only data from the cells simulated on the local node.
Note
SpiNNaker always gathers.
- Return type:
- property grandparent: Population
The parent Population at the root of the tree (since the immediate parent may itself be a PopulationView).
The name “grandparent” is of course a little misleading, as it could be just the parent, or the great, great, great, …, grandparent.
- Return type:
- id_to_index(id)[source]
Given the ID(s) of cell(s) in the PopulationView, return its / their index / indices(order in the PopulationView).
assert pv.id_to_index(pv[3]) == 3
- index_in_grandparent(indices: Iterable[int]) List[int][source]
Given an array of indices, return the indices in the parent population at the root of the tree.
- property initial_values: ParameterHolder
A dict containing the initial values of the state variables.
- Return type:
InitialValuesHolder
- initialize(**initial_values: Values)[source]
Set initial values of state variables, e.g. the membrane potential. Values passed to
initialize()may be:single numeric values (all neurons set to the same value), or
RandomDistributionobjects, orlists / arrays of numbers of the same size as the population mapping functions, where a mapping function accepts a single argument (the cell index) and returns a single number.
Values should be expressed in the standard PyNN units (i.e. millivolts, nanoamps, milliseconds, microsiemens, nanofarads, events per second).
Examples:
p.initialize(v=-70.0) p.initialize(v=rand_distr, gsyn_exc=0.0) p.initialize(v=lambda i: -65 + i / 10.0)
- inject(current_source: AbstractCurrentSource)[source]
Injects the specified current_source into this PopulationView.
- Parameters:
current_source (AbstractCurrentSource) – the current source to be injected
- property mask: Selector
The selector mask that was used to create this view.
- property parent: Population | 'PopulationView'
A reference to the parent Population (that this is a view of).
- Return type:
- record(variables: Names, to_file: None | str | neo.baseio.BaseIO = None, sampling_interval: int | None = None)[source]
Record the specified variable or variables for all cells in the Population or view.
- Parameters:
variables (str or list(str)) – either a single variable name, or a list of variable names, or
allto record everything. For a given celltype class, celltype.recordable contains a list of variables that can be recorded for that celltype.to_file (io or rawio or str) – If specified, should be a Neo IO instance and
write_data()will be automatically called when sim.end() is called.sampling_interval (int) – should be a value in milliseconds, and an integer multiple of the simulation timestep.
- sample(n: int, rng: NumpyRNG | None = None) PopulationView[source]
Randomly sample n cells from the Population view, and return a new PopulationView object.
- Parameters:
- Return type:
- set(**parameters: Values)[source]
Set one or more parameters for every cell in the population. Values passed to set() may be:
single values,
RandomDistributionobjects, orlists / arrays of values of the same size as the population mapping functions, where a mapping function accepts a single argument (the cell index) and returns a single value.
Here, a “single value” may be either a single number or a list / array of numbers (e.g. for spike times).
Values should be expressed in the standard PyNN units (i.e. millivolts, nanoamps, milliseconds, microsiemens, nanofarads, event per second).
Examples:
p.set(tau_m=20.0, v_rest=-65). p.set(spike_times=[0.3, 0.7, 0.9, 1.4]) p.set(cm=rand_distr, tau_m=lambda i: 10 + i / 10.0)
- set_state(**initial_values: Values)[source]
Set current values of state variables, e.g. the membrane potential. Values passed to
set_state()may be:single numeric values (all neurons set to the same value), or
RandomDistributionobjects, orlists / arrays of numbers of the same size as the population mapping functions, where a mapping function accepts a single argument (the cell index) and returns a single number.
Values should be expressed in the standard PyNN units (i.e. millivolts, nanoamps, milliseconds, microsiemens, nanofarads, events per second).
Examples:
p.set_state(v=-70.0) p.set_state(v=rand_distr, gsyn_exc=0.0) p.set_state(v=lambda i: -65 + i / 10.0)
- spinnaker_get_data(variable: str, as_matrix: bool = False) ndarray[Any, dtype[_ScalarType_co]][source]
SsPyNNaker specific method for getting data as a numpy array, instead of the Neo-based object
- write_data(io: str | neo.baseio.BaseIO, variables: Names = 'all', gather=True, clear: bool = False, annotations: Dict[str, Any] | None = None)[source]
Write recorded data to file, using one of the file formats supported by Neo.
- Parameters:
io (neo.io.BaseIO or str) – a Neo IO instance or the name of a file to write
variables (str or list(str)) – either a single variable name or a list of variable names. These must have been previously recorded, otherwise an Exception will be raised.
gather (bool) –
For parallel simulators, if this is True, all data will be gathered to the master node and a single output file created there. Otherwise, a file will be written on each node, containing only data from the cells simulated on that node.
Note
SpiNNaker always gathers.
clear (bool) – If this is True, recorded data will be deleted from the Population.
annotations (dict(str, ...)) – should be a dict containing simple data types such as numbers and strings. The contents will be written into the output data file as metadata.
- Raises:
ConfigurationException – If the variable or variables have not been previously set to record.
- spynnaker.pyNN.Projection(presynaptic_population: Population, postsynaptic_population: Population, connector: AbstractConnector, synapse_type: AbstractStaticSynapseDynamics | None = None, source: None = None, receptor_type: str = 'excitatory', space: Space | None = None, label: str | None = None)[source]
Used to support PEP 8 spelling correctly.
- Parameters:
presynaptic_population (Population) – the source pop
postsynaptic_population (Population) – the destination population
connector (AbstractConnector) – the connector type
synapse_type (AbstractStaticSynapseDynamics) – the synapse type
source (None) – Unsupported; must be
Nonereceptor_type (str) – the receptor type
space (Space or None) – the space object
label (str or None) – the label
- Returns:
a projection object for SpiNNaker
- Return type:
- class spynnaker.pyNN.RandomByWeightElimination(threshold: float, prob_elim_depressed: float = 0.0245, prob_elim_potentiated: float = 0.000136)
Bases:
AbstractEliminationElimination Rule that depends on the weight of a synapse.
- Parameters:
threshold (float) – Below this weight is considered depression, above or equal to this weight is considered potentiation (or the static weight of the connection on static weight connections)
prob_elim_depressed (float) – The probability of elimination if the weight has been depressed (ignored on static weight connections)
prob_elim_potentiated (float) – The probability of elimination of the weight has been potentiated or has not changed (and also used on static weight connections)
- get_parameter_names() Iterable[str][source]
Get the parameter names available from the component.
- Return type:
iterable(str)
- get_parameters_sdram_usage_in_bytes() int[source]
Get the amount of SDRAM used by the parameters of this rule.
- Return type:
- property vertex_executable_suffix: str
The suffix to be appended to the vertex executable for this rule.
- Return type:
- class spynnaker.pyNN.RandomDistribution(distribution: str, parameters_pos: tuple | None = None, rng: NumpyRNG | None = None, **parameters_named)
Bases:
RandomDistributionClass which defines a next(n) method which returns an array of
nrandom numbers from a given distribution.Examples:
>>> rng = RandomDistribution('uniform', (-70, -50)) >>> rng = RandomDistribution('normal', mu=0.5, sigma=0.1) >>> rng = NumpyRNG(seed=8658764) >>> rng = RandomDistribution('gamma', k=2.0, theta=5.0, rng=rng)
Available distributions¶ Name
Parameters
Comments
binomialn,pgammak,thetaexponentialbetalognormalmu,sigmanormalmu,sigmanormal_clippedmu,sigma,low,highValues outside (
low,high) are redrawnnormal_clipped_to_boundarymu,sigma,low,highValues below/above
low/highare set tolow/highpoissonlambda_Trailing underscore since
lambdais a Python keyworduniformlow,highuniform_intlow,highOnly generates integer values
vonmisesmu,kappa- Parameters:
distribution (str) – the name of a random number distribution.
parameters_pos (tuple or None) – parameters of the distribution, provided as a tuple. For the correct ordering, see random.available_distributions.
rng (NumpyRNG or GSLRNG or NativeRNG or None) – the random number generator to use, if a specific one is desired (e.g., to provide a seed).
parameters_named – parameters of the distribution, provided as keyword arguments.
Parameters may be provided either through
parameters_posor throughparameters_named, but not both. All parameters must be provided, there are no default values. Parameter names are, in general, as used in Wikipedia.
- class spynnaker.pyNN.RandomSelection
Bases:
AbstractPartnerSelectionPartner selection that picks a random source neuron from all sources.
- get_parameter_names() Iterable[str][source]
Get the parameter names available from the component.
- Return type:
iterable(str)
- get_parameters_sdram_usage_in_bytes() int[source]
Get the amount of SDRAM used by the parameters of this rule.
- Return type:
- property vertex_executable_suffix: str
The suffix to be appended to the vertex executable for this rule.
- Return type:
- write_parameters(spec: DataSpecificationBase)[source]
Write the parameters of the rule to the spec.
- Parameters:
spec (DataSpecificationGenerator)
- class spynnaker.pyNN.RandomStructure(boundary, origin=(0.0, 0.0, 0.0), rng=None)[source]
Bases:
BaseStructureRepresents a structure with neurons distributed randomly within a given volume.
- Arguments:
boundary - a subclass of
Shape. origin - the coordinates (x,y,z) of the centre of the volume.
- generate_positions(n)[source]
Calculate and return the positions of n neurons positioned according to this structure.
- parameter_names = ('boundary', 'origin', 'rng')
- spynnaker.pyNN.STDPMechanism
alias of
SynapseDynamicsSTDP
- class spynnaker.pyNN.SmallWorldConnector(degree: float, rewiring: float, allow_self_connections: bool = True, n_connections: int | None = None, rng: NumpyRNG | None = None, safe=True, callback=None, verbose=False)
Bases:
AbstractConnector,AbstractGenerateConnectorOnHostA connector that uses connection statistics based on the Small World network connectivity model.
Note
This is typically used from a population to itself.
- Parameters:
degree (float) – the region length where nodes will be connected locally
rewiring (float) – the probability of rewiring each edge
allow_self_connections (bool) – if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population.
n_connections (int or None) – if specified, the number of efferent synaptic connections per neuron
rng (NumpyRNG or None) – Seeded random number generator, or
Noneto make one when needed.safe (bool) – If
True, check that weights and delays have valid values. IfFalse, this check is skipped.callback (callable) –
if given, a callable that display a progress bar on the terminal.
Note
Not supported by sPyNNaker.
verbose (bool) – Whether to output extra information about the connectivity to a CSV file
- create_synaptic_block(post_slices: Sequence[Slice], post_vertex_slice: Slice, synapse_type: int, synapse_info: SynapseInformation) NDArray[source]
Create a synaptic block from the data.
- Parameters:
post_vertex_slice (Slice)
synapse_type (AbstractSynapseType)
synapse_info (SynapseInformation)
- Returns:
The synaptic matrix data to go to the machine, as a Numpy array
- Return type:
- get_delay_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation) – the synapse info
- Return type:
int or None
- get_delay_minimum(synapse_info: SynapseInformation) float[source]
Get the minimum delay specified by the user in ms, or None if unbounded.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
int or None
- get_n_connections_from_pre_vertex_maximum(n_post_atoms: int, synapse_info: SynapseInformation, min_delay: float | None = None, max_delay: float | None = None) int[source]
Get the maximum number of connections from any neuron in the pre vertex to the neurons in the post_vertex_slice, for connections with a delay between min_delay and max_delay (inclusive) if both specified (otherwise all connections).
Not all concrete connectors support omitting the delay range.
- Parameters:
delays (RandomDistribution or int or float or str)
n_post_atoms (int)
synapse_info (SynapseInformation)
min_delay (float)
max_delay (float)
- Return type:
- get_n_connections_to_post_vertex_maximum(synapse_info: SynapseInformation) int[source]
Get the maximum number of connections to any neuron in the post vertex from neurons in the pre vertex.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- get_weight_maximum(synapse_info: SynapseInformation) float[source]
Get the maximum of the weights for this connection.
- Parameters:
synapse_info (SynapseInformation)
- Return type:
- set_projection_information(synapse_info: SynapseInformation)[source]
Sets a connectors projection info.
- Parameters:
synapse_info (SynapseInformation) – the synapse info
- class spynnaker.pyNN.Space(axes=None, scale_factor=1.0, offset=0.0, periodic_boundaries=None)[source]
Bases:
objectClass representing a space within distances can be calculated. The space is Cartesian, may be 1-, 2- or 3-dimensional, and may have periodic boundaries in any of the dimensions.
- Arguments:
- axes:
if not supplied, then the 3D distance is calculated. If supplied, axes should be a string containing the axes to be used, e.g. ‘x’, or ‘yz’. axes=’xyz’ is the same as axes=None.
- scale_factor:
it may be that the pre and post populations use different units for position, e.g. degrees and µm. In this case, scale_factor can be specified, which is applied to the positions in the post-synaptic population.
- offset:
if the origins of the coordinate systems of the pre- and post- synaptic populations are different, offset can be used to adjust for this difference. The offset is applied before any scaling.
- periodic_boundaries:
either None, or a tuple giving the boundaries for each dimension, e.g. ((x_min, x_max), None, (z_min, z_max)).
- AXES = {'x': [0], 'xy': [0, 1], 'xyz': range(0, 3), 'xz': [0, 2], 'y': [1], 'yz': [1, 2], 'z': [2], None: range(0, 3)}
- distance_generator(f, g)[source]
- distances(A, B, expand=False)[source]
Calculate the distance matrix between two sets of coordinates, given the topology of the current space. From http://projects.scipy.org/pipermail/numpy-discussion/2007-April/027203.html
- class spynnaker.pyNN.Sphere(radius)[source]
Bases:
ShapeRepresents a spherical volume within which neurons may be distributed.
- sample(n, rng)[source]
Return n points distributed randomly with uniform density within the sphere.
- spynnaker.pyNN.SpiNNakerProjection
alias of
Projection
- spynnaker.pyNN.SpikePairRule
alias of
TimingDependenceSpikePair
- class spynnaker.pyNN.SpikeSourceArray(spike_times: float | Sequence[float] | ndarray[Any, dtype[floating]] | RandomDistribution | int | Sequence[int] | Sequence[Sequence[int]] | ndarray[Any, dtype[integer]] | None = None)
Bases:
AbstractPyNNModelModel that creates a Spike Source Array Vertex
- create_vertex(n_neurons: int, label: str, *, splitter: AbstractSplitterCommon | None = None, n_colour_bits: int | None = None) SpikeSourceArrayVertex[source]
Create a vertex for a population of the model.
- Parameters:
n_neurons (int) – The number of neurons in the population
label (str) – The label to give to the vertex
splitter (AbstractSplitterCommon or None)
n_colour_bits (int)
- Returns:
An application vertex for the population
- Return type:
- default_population_parameters: Dict[str, Any] = {'n_colour_bits': None, 'splitter': None}
The default values for the parameters at the population level. These are parameters that can be passed in to the Population constructor in addition to the standard PyNN options.
- class spynnaker.pyNN.SpikeSourcePoisson(rate: float | Sequence[float] = 1.0, start: int | Sequence[int] = 0, duration: int | Sequence[int] | None = None)
Bases:
AbstractPyNNModelA model of a Poisson-distributed source of spikes.
- absolute_max_atoms_per_core = 500
- create_vertex(n_neurons: int, label: str, *, seed: int | None = None, max_rate: float | None = None, splitter: AbstractSplitterCommon | None = None, n_colour_bits: int | None = None) SpikeSourcePoissonVertex[source]
Create a vertex for a population of the model.
- Parameters:
- Returns:
An application vertex for the population
- Return type:
- default_population_parameters: Dict[str, Any] = {'max_rate': None, 'n_colour_bits': None, 'seed': None, 'splitter': None}
The default values for the parameters at the population level. These are parameters that can be passed in to the Population constructor in addition to the standard PyNN options.
- spynnaker.pyNN.StaticSynapse
alias of
SynapseDynamicsStatic
- class spynnaker.pyNN.StepCurrentSource(times: Sequence[int] = (), amplitudes: Sequence[float] = ())
Bases:
AbstractCurrentSourceCurrent source where the amplitude changes based on a time array.
- spynnaker.pyNN.StructuralMechanismSTDP
alias of
SynapseDynamicsStructuralSTDP
- spynnaker.pyNN.StructuralMechanismStatic
alias of
SynapseDynamicsStructuralStatic
- spynnaker.pyNN.connect(pre: Population, post: Population, weight: float = 0.0, delay: float | None = None, receptor_type: str | None = None, p: int = 1, rng: NumpyRNG | None = None)[source]
Builds a projection.
- Parameters:
pre (Population) – source pop
post (Population) – destination pop
weight (float) – weight of the connections
delay (float) – the delay of the connections
receptor_type (str) – excitatory / inhibitory
p (float) – probability
rng (NumpyRNG) – random number generator
- spynnaker.pyNN.create(cellclass: Type | AbstractPyNNModel, cellparams: Dict[str, Any] | None = None, n: int = 1) Population[source]
Builds a population with certain parameters.
- Parameters:
cellclass (type or AbstractPyNNModel) – population class
cellparams – population parameters.
n (int) – number of neurons
- Return type:
- spynnaker.pyNN.distance(src_cell: IDMixin, tgt_cell: IDMixin, mask: ndarray[Any, dtype[_ScalarType_co]] | None = None, scale_factor: float = 1.0, offset: float = 0.0, periodic_boundaries=None) float[source]
Return the Euclidean distance between two cells.
- Parameters:
src_cell – Measure from this cell
tgt_cell – To this cell
mask (ndarray) –
allows only certain dimensions to be considered, e.g.:
to ignore the z-dimension, use
mask=array([0,1])to ignore y,
mask=array([0,2])to just consider z-distance,
mask=array([2])
scale_factor (float) – allows for different units in the pre- and post-position (the post-synaptic position is multiplied by this quantity).
offset (float)
periodic_boundaries
- spynnaker.pyNN.end(_=True) None[source]
Cleans up the SpiNNaker machine and software
- Parameters:
_ – was named compatible_output, which we don’t care about, so is a non-existent parameter
- spynnaker.pyNN.get_current_time() float[source]
Gets the time within the simulation.
- Returns:
returns the current time
- spynnaker.pyNN.get_machine() Machine[source]
Get the SpiNNaker machine in use.
- Returns:
the machine object
- Return type:
- spynnaker.pyNN.get_max_delay() int[source]
Part of the PyNN API but does not make sense for sPyNNaker as different Projection, Vertex splitter combination could have different delays they can support.
Most likely value is timestep * 144
- Raises:
NotImplementedError – As there is no system wide max_delay
- spynnaker.pyNN.get_min_delay() int[source]
The minimum allowed synaptic delay; delays will be clamped to be at least this.
- Returns:
returns the min delay of the simulation
- Return type:
- spynnaker.pyNN.get_time_step() float[source]
The integration time step.
- Returns:
get the time step of the simulation (in ms)
- Return type:
- spynnaker.pyNN.initialize(cells: PopulationBase, **initial_values)[source]
Sets cells to be initialised to the given values.
- Parameters:
cells (Population or PopulationView) – the cells to change parameters on
initial_values – the parameters and their values to change
- spynnaker.pyNN.list_standard_models() List[str][source]
Return a list of all the StandardCellType classes available for this simulator.
- spynnaker.pyNN.num_processes() int[source]
The number of MPI processes.
Note
Always 1 on SpiNNaker, which doesn’t use MPI.
- Returns:
the number of MPI processes
- Return type:
- spynnaker.pyNN.rank() int[source]
The MPI rank of the current node.
Note
Always 0 on SpiNNaker, which doesn’t use MPI.
- Returns:
MPI rank
- Return type:
- spynnaker.pyNN.record(variables: str | Sequence[str], source: PopulationBase, filename: str, sampling_interval: float | None = None, annotations: Dict[str, Any] | None = None) neo.Block[source]
Sets variables to be recorded.
- Parameters:
variables (str or list(str)) – may be either a single variable name or a list of variable names. For a given celltype class, celltype.recordable contains a list of variables that can be recorded for that celltype.
source (Population or PopulationView) – where to record from
filename (str) – file name to write data to
sampling_interval – how often to sample the recording, not ignored so far
annotations (dict(str, ...)) – the annotations to data writers
- Returns:
neo object
- Return type:
- spynnaker.pyNN.reset(annotations: Dict[str, Any] | None = None)[source]
Resets the simulation to t = 0.
- spynnaker.pyNN.run(simtime: float, callbacks=None) float[source]
The run() function advances the simulation for a given number of milliseconds.
- spynnaker.pyNN.run_for(simtime: float, callbacks=None) float
The run() function advances the simulation for a given number of milliseconds.
- spynnaker.pyNN.run_until(tstop: float) float[source]
Run until a (simulation) time period has completed.
- spynnaker.pyNN.set_number_of_neurons_per_core(neuron_type: Type, max_permitted: int | Tuple[int, ...] | None)[source]
Sets a ceiling on the number of neurons of a given model that can be placed on a single core. This can be overridden by the individual Population.
The new value can be None, meaning that the maximum is the same as the number of atoms, an int, meaning all Populations of this model must have one dimension, or a tuple of n integers, meaning all Populations of this model must have n dimensions. If not all Populations of this model have the same number of dimensions, it is recommended to set this to None here and then set the maximum on each Population.
- Parameters:
neuron_type (type(AbstractPopulationVertex)) – neuron type
- spynnaker.pyNN.setup(timestep: float = 0.1, min_delay: float | Literal['auto'] = 'auto', max_delay: float | Literal['auto'] | None = None, database_socket_addresses: Iterable[SocketAddress] | None = None, time_scale_factor: int | None = None, n_chips_required: int | None = None, n_boards_required: int | None = None, **extra_params) int[source]
The main method needed to be called to make the PyNN 0.8 setup. Needs to be called before any other function
- Parameters:
timestep (float or None) – the time step of the simulations in microseconds; if None, the configuration value is used
min_delay (float or str) – the minimum delay of the simulation
max_delay (float or str or None) – Ignored and logs a warning if provided
database_socket_addresses (iterable(SocketAddress)) – the sockets used by external devices for the database notification protocol
time_scale_factor (int or None) – multiplicative factor to the machine time step (does not affect the neuron models accuracy)
n_chips_required (int or None) – Deprecated! Use n_boards_required instead. Must be None if n_boards_required specified.
n_boards_required (int or None) – if you need to be allocated a machine (for spalloc) before building your graph, then fill this in with a general idea of the number of boards you need so that the spalloc system can allocate you a machine big enough for your needs.
extra_params – other keyword arguments used to configure PyNN
- Returns:
MPI rank (always 0 on SpiNNaker)
- Return type:
- Raises:
ConfigurationException – if both
n_chips_requiredandn_boards_requiredare used.