Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torch-cluster
Commits
0d663771
Commit
0d663771
authored
May 25, 2020
by
Alexander Liao
Browse files
Merge branch 'master' of
https://github.com/rusty1s/pytorch_cluster
into cpu_radius
parents
aa9a3888
32fa3257
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
README.md
README.md
+5
-5
No files found.
README.md
View file @
0d663771
...
...
@@ -107,7 +107,7 @@ from torch_cluster import graclus_cluster
row
=
torch
.
tensor
([
0
,
1
,
1
,
2
])
col
=
torch
.
tensor
([
1
,
0
,
2
,
1
])
weight
=
torch
.
T
ensor
([
1
,
1
,
1
,
1
])
# Optional edge weights.
weight
=
torch
.
t
ensor
([
1
.
,
1
.
,
1
.
,
1
.
])
# Optional edge weights.
cluster
=
graclus_cluster
(
row
,
col
,
weight
)
```
...
...
@@ -125,7 +125,7 @@ A clustering algorithm, which overlays a regular grid of user-defined size over
import
torch
from
torch_cluster
import
grid_cluster
pos
=
torch
.
T
ensor
([[
0
,
0
],
[
11
,
9
],
[
2
,
8
],
[
2
,
2
],
[
8
,
3
]])
pos
=
torch
.
t
ensor
([[
0
.
,
0
.
],
[
11
.
,
9
.
],
[
2
.
,
8
.
],
[
2
.
,
2
.
],
[
8
.
,
3
.
]])
size
=
torch
.
Tensor
([
5
,
5
])
cluster
=
grid_cluster
(
pos
,
size
)
...
...
@@ -144,7 +144,7 @@ A sampling algorithm, which iteratively samples the most distant point with rega
import
torch
from
torch_cluster
import
fps
x
=
torch
.
T
ensor
([[
-
1
,
-
1
],
[
-
1
,
1
],
[
1
,
-
1
],
[
1
,
1
]])
x
=
torch
.
t
ensor
([[
-
1
.
,
-
1
.
],
[
-
1
.
,
1
.
],
[
1
.
,
-
1
.
],
[
1
.
,
1
.
]])
batch
=
torch
.
tensor
([
0
,
0
,
0
,
0
])
index
=
fps
(
x
,
batch
,
ratio
=
0.5
,
random_start
=
False
)
```
...
...
@@ -162,7 +162,7 @@ Computes graph edges to the nearest *k* points.
import
torch
from
torch_cluster
import
knn_graph
x
=
torch
.
T
ensor
([[
-
1
,
-
1
],
[
-
1
,
1
],
[
1
,
-
1
],
[
1
,
1
]])
x
=
torch
.
t
ensor
([[
-
1
.
,
-
1
.
],
[
-
1
.
,
1
.
],
[
1
.
,
-
1
.
],
[
1
.
,
1
.
]])
batch
=
torch
.
tensor
([
0
,
0
,
0
,
0
])
edge_index
=
knn_graph
(
x
,
k
=
2
,
batch
=
batch
,
loop
=
False
)
```
...
...
@@ -181,7 +181,7 @@ Computes graph edges to all points within a given distance.
import
torch
from
torch_cluster
import
radius_graph
x
=
torch
.
T
ensor
([[
-
1
,
-
1
],
[
-
1
,
1
],
[
1
,
-
1
],
[
1
,
1
]])
x
=
torch
.
t
ensor
([[
-
1
.
,
-
1
.
],
[
-
1
.
,
1
.
],
[
1
.
,
-
1
.
],
[
1
.
,
1
.
]])
batch
=
torch
.
tensor
([
0
,
0
,
0
,
0
])
edge_index
=
radius_graph
(
x
,
r
=
1.5
,
batch
=
batch
,
loop
=
False
)
```
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment