Models API
Vectorized Urban Map Generator
- class urbanmarl.models.urban_map.VectorizedUrbanMap(batch_size, volume_size, device, map_margin=5)[source]
Bases:
objectTensor-accelerated ITU-R P.1410 procedural map generator and LoS engine.
Handles procedural 3D urban heightmap generation, line-of-sight (LoS) ray tracing, collision checking, and agent coordinate transformations across parallel environments.
- device
PyTorch compute device.
- Type:
- height_maps
Tensor heightmaps of shape (batch_size, sim_x, sim_y).
- Type:
- __init__(batch_size, volume_size, device, map_margin=5)[source]
Initializes the VectorizedUrbanMap generator.
- Parameters:
batch_size (
int) – Number of parallel environment instances.volume_size (
tuple) – Volume dimensions (X, Y, Z).device (
torch.device) – Compute device for tensor operations.map_margin (
int) – Margin buffer from volume borders. Defaults to 5.
- Return type:
None
- create_building_faces(x, y, z, w, l, h)[source]
Constructs 3D polygon face vertices for building cuboids (Fully Vectorized).
- Parameters:
- Returns:
Shape (N*5, 4, 3) defining all cuboid faces for all buildings.
- Return type:
np.ndarray
- reset(return_urban_info=False)[source]
Resets the map environment by regenerating the height maps with new procedural parameters. Optionally returns the generated map information for analysis or observation purposes.
- Parameters:
return_urban_info (bool)
- get_building_polygon(urban_idx, face_color='#696969', alpha=0.3)[source]
Creates a Poly3DCollection for 3D plotting of building faces. :param urban_idx: Index of the urban environment. :type urban_idx:
int:param face_color: Color of the building faces. :type face_color:str:param alpha: Transparency level of the building faces. :type alpha:float
- generate_batch_maps(alpha=None, beta=None, gamma=None)[source]
Procedurally populates building heights based on structural distribution properties. Executes on CPU/Numpy for procedural layouts, then uploads directly to device buffers.
- check_los_batch(p1, p2, n_steps=20, max_step_length=None)[source]
Computes line-of-sight status via dense vector projection array checking. p1: shape (batch_size, n_agents, 3) p2: shape (batch_size, n_targets, 3) max_step_length: Optional float. If provided, dynamically scales n_steps based on max ray distance. Returns: boolean tensor shape (batch_size, n_agents, n_targets)
- check_collision_batch(p1, p2, n_steps=20, max_step_length=None)[source]
Computes collision status via dense vector projection array checking. p1: shape (batch_size, n_agents, 3) previous positions p2: shape (batch_size, n_agents, 3) current positions Returns: boolean tensor shape (batch_size, n_agents, 1) indicating collision status
- gen_pos(num_pos, min_z=None, max_z=None, batch_idx=None, outdoor=False, normalized=False)[source]
Generates positions for agents, optionally ensuring they are outdoors.
- norm_pos(positions, min_z=None, max_z=None)[source]
Normalizes positions to [0,1] range based on the map dimensions.
- denorm_pos(positions, min_z=None, max_z=None)[source]
Denormalizes positions from [0,1] back to actual coordinate space.
Radio Channel Model
UrbanMARL Radio Channel Model.
Vectorized mmWave radio channel propagation model calculating Friis path loss, LoS/NLoS attenuation exponent shifts, interference, and Shannon channel capacity.
- class urbanmarl.models.channel.VectorizedChannelModel(config, device)[source]
Bases:
objectComputes batched path loss, received power, interference, and data rates.
- device
Compute device for PyTorch tensor calculations.
- Type:
- __init__(config, device)[source]
Initializes the VectorizedChannelModel.
- Parameters:
config (
dict) – Channel configuration dictionary containing optional keys: - ‘frequency_ghz’: carrier frequency in GHz (default: 29.0). - ‘g2a_bandwidth’: channel bandwidth in Hz (default: 10e6). - ‘noise_figure_db’: noise figure in dB (default: 7.0).device (
torch.device) – Compute device.
- Return type:
None
- compute_data_rates(tx_pos, rx_pos, tx_power, los_mask)[source]
Calculates achievable transmission data rates (bps) using Shannon capacity.
- Parameters:
tx_pos (
torch.Tensor) – Transmitter positions (UEs) of shape (B, M, 3).rx_pos (
torch.Tensor) – Receiver positions (UAVs) of shape (B, N, 3).tx_power (
torch.Tensor) – Transmission power (Watts) of shape (B, M).los_mask (
torch.Tensor) – Line-of-sight boolean tensor of shape (B, N, M).
- Returns:
Achievable channel capacity data rates in bps of shape (B, N, M).
- Return type:
MEC Queue Model
UrbanMARL Mobile Edge Computing (MEC) M/M/c Queue Model.
Pure PyTorch implementation of M/M/c queuing theory calculating server utilization, queue lengths, waiting times, and total system processing delay across parallel environments.
- class urbanmarl.models.mec_queue.VectorizedMECQueue(device, max_cores=64)[source]
Bases:
objectPyTorch tensor M/M/c queuing model for edge servers.
- device
Compute device.
- Type:
- log_fact
Precomputed log-factorial array for numerical stability.
- Type:
- __init__(device, max_cores=64)[source]
Initializes the VectorizedMECQueue model.
- Parameters:
device (
torch.device) – Compute device for PyTorch operations.max_cores (
int) – Maximum core count upper bound (default: 64).
- Return type:
None
- compute_delays(arrival_rates, service_rates, num_cores)[source]
Computes M/M/c queuing delays and utilization metrics for a batch of UAVs.
- Parameters:
arrival_rates (
torch.Tensor) – Task arrival rates (lambda) of shape (B, N).service_rates (
torch.Tensor) – Service rates per core (mu) of shape (B, N).num_cores (
torch.Tensor) – Number of allocated server cores (c) of shape (B, N).
- Returns:
- Dictionary containing tensors for:
’utilization’: server traffic intensity rho of shape (B, N).
’avg_queue_length’: expected number of queued tasks of shape (B, N).
’avg_waiting_time’: expected queue waiting time in seconds of shape (B, N).
’avg_system_time’: total system response time (wait + service) of shape (B, N).
- Return type:
DTLCM Offloading Assignment
UrbanMARL Dynamic Distance-Task-Load Capacity Matching (DTLCM).
Provides continuous tensor heuristic matching for UAV-MEC task offloading assignments.
- urbanmarl.models.dtlcm.compute_batched_dtlcm_assignment(uav_pos, ue_pos, uav_caps, uav_loads, task_workloads, distance_weight=0.7)[source]
Executes batched heuristic DTLCM assignment for task offloading.
- Parameters:
uav_pos (
torch.Tensor) – UAV 3D positions of shape (B, N, 3).ue_pos (
torch.Tensor) – UE 3D positions of shape (B, M, 3).uav_caps (
torch.Tensor) – UAV compute capacities of shape (B, N).uav_loads (
torch.Tensor) – Current UAV load levels of shape (B, N).task_workloads (
torch.Tensor) – Offloaded task workloads of shape (B, M).distance_weight (
float) – Weight assigned to spatial distance score (default: 0.7).
- Returns:
Long tensor of assigned UAV indices per UE of shape (B, M).
- Return type:
Network Digital Twin (NDT) & REM
UrbanMARL Network Digital Twin (NDT) Architecture & Telemetry Model.
Provides a unified, 4-layer synchronized digital twin model for 6G multi-UAV assisted Mobile Edge Computing (MEC) networks: 1. Geospatial & Structural Twin: 3D urban terrain, ITU-R P.1410 parameters, buildings. 2. Radio Environment Map (REM) Twin: Spatial SINR coverage, LoS/NLoS paths, channel capacity. 3. Computational & Queuing Twin: M/M/c server utilization, queue lengths, task latency. 4. Aerial Mobility & Energy Twin: UAV kinematics, battery state, aerodynamic energy, sojourn time.
Includes vectorized Radio Environment Map (REM) generators, live telemetry extraction, and JSON-compliant serialization for 3D digital twin visualization engines.
- class urbanmarl.models.digital_twin.GeospatialTwinState(volume_size, alpha, beta, gamma, e_param, n_buildings, building_width, street_width, building_count)[source]
Bases:
objectGeospatial and structural digital twin layer state.
- Parameters:
- class urbanmarl.models.digital_twin.REMTwinState(frequency_ghz, bandwidth_hz, coverage_ratio, mean_sinr_db, los_link_count, nlos_link_count, mean_data_rate_mbps)[source]
Bases:
objectRadio Environment Map (REM) and wireless propagation digital twin state.
- Parameters:
- class urbanmarl.models.digital_twin.ComputeQueuingTwinState(mean_utilization, max_utilization, mean_queue_length, mean_waiting_time_ms, mean_system_time_ms, total_completed_tasks, total_dropped_tasks)[source]
Bases:
objectMEC computation and queuing dynamics digital twin state.
- Parameters:
- class urbanmarl.models.digital_twin.AerialMobilityTwinState(n_uavs, n_ues, mean_uav_altitude, mean_uav_speed, mean_battery_pct, mean_propulsion_power_w, mean_sojourn_time_steps, collision_count)[source]
Bases:
objectUAV swarm kinematics, energy, and sojourn coverage digital twin state.
- Parameters:
- class urbanmarl.models.digital_twin.NDTTelemetryFrame(frame_id, timestamp_s, geospatial, rem, compute, mobility, uav_positions, ue_positions, uav_telemetry, active_links)[source]
Bases:
objectUnified Network Digital Twin (NDT) telemetry snapshot for a single step.
- Parameters:
frame_id (int)
timestamp_s (float)
geospatial (GeospatialTwinState)
rem (REMTwinState)
compute (ComputeQueuingTwinState)
mobility (AerialMobilityTwinState)
- geospatial: GeospatialTwinState
- rem: REMTwinState
- compute: ComputeQueuingTwinState
- mobility: AerialMobilityTwinState
- class urbanmarl.models.digital_twin.RadioEnvironmentMap(volume_size, grid_resolution=50, frequency_ghz=29.0, bandwidth_hz=10000000.0, noise_figure_db=7.0, sinr_threshold_db=0.0, device='cpu')[source]
Bases:
objectVectorized 2D/3D Radio Environment Map (REM) generator.
Computes spatial received signal power, interference, and Signal-to-Interference-plus-Noise Ratio (SINR) across a uniform spatial evaluation grid over the urban volume.
- Parameters:
- __init__(volume_size, grid_resolution=50, frequency_ghz=29.0, bandwidth_hz=10000000.0, noise_figure_db=7.0, sinr_threshold_db=0.0, device='cpu')[source]
Initializes the RadioEnvironmentMap generator.
- Parameters:
volume_size (
Tuple[float, float, float]) – Urban dimensions (sim_x, sim_y, sim_z).grid_resolution (
int) – Spatial grid points along each horizontal axis. Defaults to 50.frequency_ghz (
float) – Carrier frequency in GHz. Defaults to 29.0.bandwidth_hz (
float) – Channel bandwidth in Hz. Defaults to 10e6.noise_figure_db (
float) – Receiver noise figure in dB. Defaults to 7.0.sinr_threshold_db (
float) – Minimum SINR in dB for valid coverage. Defaults to 0.0.device (
Union[torch.device, str]) – PyTorch compute device.
- Return type:
None
- compute_rem(uav_positions, tx_power=2.0, urban_map=None, env_idx=0)[source]
Computes spatial SINR and coverage ratio for active UAV positions.
- Parameters:
uav_positions (
torch.Tensor) – UAV 3D coordinates of shape (N, 3) or (B, N, 3).tx_power (
float) – Transmit power per UAV in Watts. Defaults to 2.0.urban_map (Any | None) – Optional VectorizedUrbanMap instance for LoS ray-casting.
env_idx (
int) – Batch index if uav_positions has batch dimension.
- Returns:
‘sinr_grid’: 2D tensor of shape (grid_res, grid_res) in dB.
’coverage_mask’: 2D boolean tensor indicating SINR >= threshold.
’coverage_ratio’: Float percentage in [0.0, 1.0].
’mean_sinr_db’: Average SINR across all grid points in dB.
- Return type:
Dict[str, Union[torch.Tensor, float]]
- class urbanmarl.models.digital_twin.NetworkDigitalTwin(volume_size=(500.0, 500.0, 200.0), frequency_ghz=29.0, bandwidth_hz=10000000.0, noise_figure_db=7.0, rem_resolution=40, device='cpu')[source]
Bases:
objectCentral Network Digital Twin (NDT) manager for UrbanMARL simulations.
Synchronizes physical, wireless, computing, and mobility layers and extracts structured telemetry frames and serialization exports.
- Parameters:
- __init__(volume_size=(500.0, 500.0, 200.0), frequency_ghz=29.0, bandwidth_hz=10000000.0, noise_figure_db=7.0, rem_resolution=40, device='cpu')[source]
Initializes the NetworkDigitalTwin manager.
- Parameters:
volume_size (
Tuple[float, float, float]) – 3D urban simulation bounds.frequency_ghz (
float) – mmWave carrier frequency.bandwidth_hz (
float) – Channel bandwidth.noise_figure_db (
float) – Receiver noise figure.rem_resolution (
int) – Spatial grid resolution for Radio Environment Maps.device (
Union[torch.device, str]) – Compute device.
- Return type:
None
- capture_frame(env, env_idx=0, step=None, compute_rem_heatmap=False)[source]
Captures a complete digital twin telemetry frame from an active UrbanEnv.
- Parameters:
- Returns:
Structured telemetry snapshot.
- Return type:
- export_telemetry_json(frame, filepath=None)[source]
Exports a single telemetry frame to JSON string or file.
- Parameters:
frame (
NDTTelemetryFrame) – Telemetry snapshot.filepath (
Optional[str]) – Target file path to write to.
- Returns:
Serialized JSON payload string.
- Return type:
Vectorized Ground User Mobility
UrbanMARL Vectorized Ground User (UE) Mobility Engine.
Provides GPU-accelerated, pure PyTorch mobility models for dynamic ground users:
Street-Constrained Manhattan Mobility: Constrains user motion to street corridors between ITU-R P.1410 building footprints.
Random Waypoint (RWP) & Gauss-Markov Mobility: Smooth continuous velocity and direction updates with boundary reflection.
Dynamic Hotspot & Crowd Migration Mobility: Models temporal crowd clustering around spatially drifting hotspot centers.
- class urbanmarl.models.mobility.VectorizedUserMobility(volume_size=(500.0, 500.0, 200.0), model_type='manhattan', speed_min=0.5, speed_max=3.0, alpha_memory=0.75, device='cpu')[source]
Bases:
objectTensor-accelerated user mobility simulation engine.
- Parameters:
- volume_size
Urban dimensions (sim_x, sim_y, sim_z).
- Type:
Tuple[float, float, float]
- device
PyTorch compute device.
- Type:
- __init__(volume_size=(500.0, 500.0, 200.0), model_type='manhattan', speed_min=0.5, speed_max=3.0, alpha_memory=0.75, device='cpu')[source]
Initializes the VectorizedUserMobility engine.
- Parameters:
volume_size (
Tuple[float, float, float]) – Urban simulation boundary dimensions.model_type (
str) – Mobility algorithm name (‘manhattan’, ‘rwp’, ‘gauss_markov’, ‘hotspot’).speed_min (
float) – Minimum speed bound in m/s. Defaults to 0.5.speed_max (
float) – Maximum speed bound in m/s. Defaults to 3.0.alpha_memory (
float) – Gauss-Markov memory coefficient in [0, 1]. Defaults to 0.75.device (
Union[torch.device, str]) – PyTorch compute device.
- Return type:
None
- initialize_velocities(batch_size, n_ues)[source]
Initializes random 2D ground velocities for UEs.
- Parameters:
- Returns:
Initial velocity tensor of shape (B, M, 3) with vz=0.
- Return type:
- initialize_hotspots(batch_size, num_hotspots=2)[source]
Initializes spatial hotspot cluster centers and drift velocities.
- step(ue_pos, ue_vel, dt=1.0, urban_map=None)[source]
Steps ground user positions and updates velocities.
- Parameters:
ue_pos (
torch.Tensor) – Current UE positions of shape (B, M, 3).ue_vel (
torch.Tensor) – Current UE velocities of shape (B, M, 3).dt (
float) – Simulation time step duration in seconds. Defaults to 1.0.urban_map (Any | None) – Optional VectorizedUrbanMap instance for street boundary collision.
- Returns:
Updated (new_positions, new_velocities).
- Return type:
Tuple[torch.Tensor, torch.Tensor]
Vectorized LiDAR Proximity Rangefinder
UrbanMARL Vectorized LiDAR Rangefinder Sensor Model.
Provides GPU-accelerated, pure PyTorch ray-marching LiDAR simulations for UAVs: - Casts radial horizontal rays in 360-degree azimuth around each UAV. - Samples 3D building heightmaps along ray trajectories. - Detects distance to nearest obstacle building face. - Outputs normalized proximity vectors for collision-free decentralized POMDP navigation.
- class urbanmarl.models.lidar.VectorizedLiDAR(num_beams=8, max_range=60.0, n_steps=15, device='cpu')[source]
Bases:
objectVectorized 3D LiDAR proximity rangefinder.
Simulates radial rangefinder beams around each UAV to detect building facades.
- __init__(num_beams=8, max_range=60.0, n_steps=15, device='cpu')[source]
Initializes the VectorizedLiDAR sensor.
- Parameters:
num_beams (
int) – Number of radial azimuth beams (e.g., 8 or 16). Defaults to 8.max_range (
float) – Maximum detection range in meters. Defaults to 60.0.n_steps (
int) – Number of ray-marching sampling intervals along each beam. Defaults to 15.device (
Union[torch.device, str]) – PyTorch compute device.
- Return type:
None
- scan(uav_positions, urban_map)[source]
Performs ray-marching LiDAR scans for all UAVs in parallel.
- Parameters:
uav_positions (
torch.Tensor) – UAV 3D coordinates of shape (B, N, 3).urban_map (Any) – VectorizedUrbanMap instance containing 3D heightmaps.
- Returns:
- Normalized distance readings of shape (B, N, num_beams).
Values are in [0.0, 1.0], where 1.0 represents clear/max range, and values approaching 0.0 indicate proximity to an obstacle.
- Return type:
High-Fidelity Aerodynamics
UrbanMARL High-Fidelity UAV Aerodynamic Propulsion Power Model.
Implements the rotary-wing UAV flight power consumption model from: Zeng, Zhang, and Lim, “Wireless communications with unmanned aerial vehicles: driving forces, key challenges, and options,” IEEE Wireless Communications, 2016. And: Zeng and Zhang, “Energy-efficient UAV communication with trajectory optimization,” IEEE Transactions on Wireless Communications, 2017.
Vectorized PyTorch implementation calculating instantaneous blade profile power, induced power, parasite drag power, and vertical climb/descend power.
- class urbanmarl.models.aerodynamics.VectorizedAerodynamics(p0=79.86, pi=88.63, u_tip=120.0, v0=4.03, d0=0.6, rho=1.225, solidity=0.05, rotor_area=0.503, mass_kg=2.0, device='cpu')[source]
Bases:
objectCalculates instantaneous aerodynamic power consumption for rotary-wing UAVs.
- Parameters:
- __init__(p0=79.86, pi=88.63, u_tip=120.0, v0=4.03, d0=0.6, rho=1.225, solidity=0.05, rotor_area=0.503, mass_kg=2.0, device='cpu')[source]
Initializes aerodynamic parameters.
- Parameters:
p0 (
float) – Blade profile power. Defaults to 79.86 W.pi (
float) – Induced power. Defaults to 88.63 W.u_tip (
float) – Rotor tip speed in m/s. Defaults to 120.0.v0 (
float) – Mean induced velocity in m/s. Defaults to 4.03.d0 (
float) – Fuselage drag ratio. Defaults to 0.6.rho (
float) – Air density in kg/m^3. Defaults to 1.225.solidity (
float) – Rotor solidity. Defaults to 0.05.rotor_area (
float) – Rotor disc area in m^2. Defaults to 0.503.mass_kg (
float) – UAV gross mass in kg. Defaults to 2.0.device (
torch.device) – PyTorch compute device.
- Return type:
None
- compute_propulsion_power(velocity)[source]
Computes instantaneous aerodynamic propulsion power in Watts.
- Parameters:
velocity (
torch.Tensor) – UAV 3D velocity vectors (…, 3) in m/s.- Returns:
Power dissipation tensor in Watts matching batch shapes (…, 1).
- Return type:
Advanced 3D Directional Channel
UrbanMARL Advanced 3D mmWave Channel Model.
Implements 3GPP TR 38.901 compliant wireless propagation modeling:
3D Directional Antenna Radiation Patterns: - Elevation beam attenuation: A_V(theta) = -min(12 * ((theta - theta_tilt) / theta_3dB)^2, SLA_V) - Azimuth beam attenuation: A_H(phi) = -min(12 * (phi / phi_3dB)^2, A_max) - Combined 3D antenna gain: G(theta, phi) = G_max - min(-(A_V + A_H), A_max)
Elevation-Dependent Rician / Rayleigh Small-Scale Fading: - Elevation-dependent Rician K-factor for LoS paths. - Rayleigh fading for NLoS paths.
- class urbanmarl.models.channel_advanced.AdvancedChannelModel(frequency_ghz=29.0, bandwidth_hz=10000000.0, g_max_dbi=15.0, theta_3db_deg=65.0, phi_3db_deg=65.0, noise_figure_db=7.0, device='cpu')[source]
Bases:
object3GPP compliant 3D directional wireless channel propagation model.
- Parameters:
- __init__(frequency_ghz=29.0, bandwidth_hz=10000000.0, g_max_dbi=15.0, theta_3db_deg=65.0, phi_3db_deg=65.0, noise_figure_db=7.0, device='cpu')[source]
Initializes the advanced channel model.
- Parameters:
frequency_ghz (
float) – Carrier frequency. Defaults to 29.0 GHz.bandwidth_hz (
float) – Bandwidth. Defaults to 10 MHz.g_max_dbi (
float) – Antenna gain in dBi. Defaults to 15.0.theta_3db_deg (
float) – Vertical 3dB beamwidth. Defaults to 65 deg.phi_3db_deg (
float) – Horizontal 3dB beamwidth. Defaults to 65 deg.noise_figure_db (
float) – Receiver noise figure. Defaults to 7.0 dB.device (
Union[torch.device, str]) – PyTorch compute device.
- Return type:
None
- compute_3d_antenna_gain(tx_pos, rx_pos)[source]
Computes 3D directional antenna radiation pattern gain G(theta, phi) in linear scale.
- Parameters:
tx_pos (
torch.Tensor) – UAV transmitter coordinates of shape (…, N, 3).rx_pos (
torch.Tensor) – UE receiver coordinates of shape (…, M, 3).
- Returns:
Linear antenna gain array of shape (…, N, M).
- Return type:
- compute_data_rates(tx_pos, rx_pos, tx_power=2.0, los_mask=None, include_fading=False)[source]
Computes Shannon data rates with 3D directional antenna patterns and fading.
- Parameters:
tx_pos (
torch.Tensor) – UAV 3D coordinates (…, N, 3).rx_pos (
torch.Tensor) – UE 3D coordinates (…, M, 3).tx_power (
Union[float, torch.Tensor]) – Transmit power in Watts.los_mask (
Optional[torch.Tensor]) – Boolean LoS tensor of shape (…, N, M).include_fading (
bool) – Whether to sample stochastic small-scale fading.
- Returns:
Achievable transmission data rate in bits per second (…, N, M).
- Return type:
GNN Message-Passing Policy
UrbanMARL Graph Neural Network (GNN) Message-Passing Policy Module.
Provides cooperative inter-agent message-passing embeddings for multi-UAV swarms:
Dynamically computes distance-thresholded inter-UAV communication graphs: A_ij = I(||p_i - p_j|| <= R_comm).
Vectorized edge-feature aggregation: m_ij = MLP([h_j, p_j - p_i, v_j - v_i]).
Permutation-invariant node feature updates: h_i’ = MLP([h_i, sum_{j in N_i} m_ij]).
Compatible with decentralized actor-critic architectures in CTDE MARL.
- class urbanmarl.models.gnn_policy.VectorizedGNNMessagePassing(node_dim, hidden_dim=64, out_dim=64, r_comm=120.0)[source]
Bases:
ModuleVectorized multi-agent Graph Neural Network message-passing module.
Hidden dimension for message and update networks.
- Type:
- __init__(node_dim, hidden_dim=64, out_dim=64, r_comm=120.0)[source]
Initializes the GNN message-passing module.
- forward(node_features, positions, velocities=None)[source]
Executes vectorized graph message-passing across agents.
- Parameters:
node_features (
torch.Tensor) – Agent features of shape (B, N, node_dim).positions (
torch.Tensor) – Agent 3D coordinates of shape (B, N, 3).velocities (
Optional[torch.Tensor]) – Agent 3D velocities of shape (B, N, 3).
- Returns:
Updated cooperative agent embeddings of shape (B, N, out_dim).
- Return type: