Editing
Ai Urban Planning
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== <span style="color: #FFFFFF;">Applying</span> == '''Traffic flow prediction with graph neural networks:''' <syntaxhighlight lang="python"> import torch import torch.nn.functional as F from torch_geometric.nn import GCNConv, GATConv from torch_geometric.data import Data import numpy as np class TrafficGNN(torch.nn.Module): """Predict traffic flow using road network graph structure.""" def __init__(self, in_channels, hidden, out_channels): super().__init__() self.gat1 = GATConv(in_channels, hidden, heads=4, concat=True) self.gat2 = GATConv(hidden * 4, hidden, heads=1, concat=False) self.predictor = torch.nn.Linear(hidden, out_channels) def forward(self, x, edge_index, edge_attr=None): x = F.elu(self.gat1(x, edge_index)) x = F.dropout(x, p=0.3, training=self.training) x = F.elu(self.gat2(x, edge_index)) return self.predictor(x) # Predicted traffic flow per road segment # Road network as graph: nodes=intersections, edges=road segments # Node features: historical traffic counts, time features, weather # Edge features: road type, length, capacity # Target: next 15/30/60 min traffic flow per segment # Construct PyG Data object from road network def build_road_graph(adjacency_matrix, node_features): edge_index = torch.tensor(np.argwhere(adjacency_matrix > 0).T, dtype=torch.long) x = torch.tensor(node_features, dtype=torch.float) return Data(x=x, edge_index=edge_index) </syntaxhighlight> ; Urban AI application landscape : '''Traffic signal control''' β SURTRAC (RL), SCATS, Siemens SCOOT + ML : '''Public transit''' β Google Maps ETA, Transit App, MTA real-time prediction : '''Parking''' β ParkMobile AI, smart parking sensors + occupancy prediction : '''Crime/safety''' β ShotSpotter (acoustic gunshot detection), PredPol (controversial) : '''Infrastructure''' β NYC fire inspection ML, pipe failure prediction (Fracta) : '''City digital twins''' β Sidewalk Labs Mesa, NVIDIA Omniverse City Simulation </div> <div style="background-color: #8B4500; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;">
Summary:
Please note that all contributions to BloomWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BloomWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information