|
| 1 | +```@meta |
| 2 | +CurrentModule = GNNGraphs |
| 3 | +``` |
| 4 | + |
1 | 5 | # Temporal Graphs |
2 | 6 |
|
3 | 7 | Temporal Graphs are graphs with time varying topologies and features. In GNNGraphs.jl, temporal graphs with fixed number of nodes over time are supported by the [`TemporalSnapshotsGNNGraph`](@ref) type. |
@@ -45,7 +49,7 @@ TemporalSnapshotsGNNGraph: |
45 | 49 |
|
46 | 50 | See [`rand_temporal_radius_graph`](@ref) and [`rand_temporal_hyperbolic_graph`](@ref) for generating random temporal graphs. |
47 | 51 |
|
48 | | -```jldoctest temporal |
| 52 | +```julia |
49 | 53 | julia> tg = rand_temporal_radius_graph(10, 3, 0.1, 0.5) |
50 | 54 | TemporalSnapshotsGNNGraph: |
51 | 55 | num_nodes: [10, 10, 10] |
@@ -97,28 +101,30 @@ A temporal graph can store global feature for the entire time series in the `tgd |
97 | 101 | Also, each snapshot can store node, edge, and graph features in the `ndata`, `edata`, and `gdata` fields, respectively. |
98 | 102 |
|
99 | 103 | ```jldoctest temporal |
100 | | -julia> snapshots = [rand_graph(10,20; ndata = rand(3,10)), rand_graph(10,14; ndata = rand(4,10)), rand_graph(10,22; ndata = rand(5,10))]; # node features at construction time |
| 104 | +julia> snapshots = [rand_graph(10, 20; ndata = rand(Float32, 3, 10)), |
| 105 | + rand_graph(10, 14; ndata = rand(Float32, 4, 10)), |
| 106 | + rand_graph(10, 22; ndata = rand(Float32, 5, 10))]; # node features at construction time |
101 | 107 |
|
102 | 108 | julia> tg = TemporalSnapshotsGNNGraph(snapshots); |
103 | 109 |
|
104 | | -julia> tg.tgdata.y = rand(3,1); # add global features after construction |
| 110 | +julia> tg.tgdata.y = rand(Float32, 3, 1); # add global features after construction |
105 | 111 |
|
106 | 112 | julia> tg |
107 | 113 | TemporalSnapshotsGNNGraph: |
108 | 114 | num_nodes: [10, 10, 10] |
109 | 115 | num_edges: [20, 14, 22] |
110 | 116 | num_snapshots: 3 |
111 | 117 | tgdata: |
112 | | - y = 3×1 Matrix{Float64} |
| 118 | + y = 3×1 Matrix{Float32} |
113 | 119 |
|
114 | 120 | julia> tg.ndata # vector of DataStore containing node features for each snapshot |
115 | 121 | 3-element Vector{DataStore}: |
116 | 122 | DataStore(10) with 1 element: |
117 | | - x = 3×10 Matrix{Float64} |
| 123 | + x = 3×10 Matrix{Float32} |
118 | 124 | DataStore(10) with 1 element: |
119 | | - x = 4×10 Matrix{Float64} |
| 125 | + x = 4×10 Matrix{Float32} |
120 | 126 | DataStore(10) with 1 element: |
121 | | - x = 5×10 Matrix{Float64} |
| 127 | + x = 5×10 Matrix{Float32} |
122 | 128 |
|
123 | 129 | julia> [ds.x for ds in tg.ndata]; # vector containing the x feature of each snapshot |
124 | 130 |
|
|
0 commit comments