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
b94ecee8
Commit
b94ecee8
authored
Apr 28, 2018
by
rusty1s
Browse files
0.4.0 update
parent
abc17fd1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
README.md
README.md
+7
-9
No files found.
README.md
View file @
b94ecee8
...
@@ -39,17 +39,16 @@ A greedy clustering algorithm of picking an unmarked vertex and matching it with
...
@@ -39,17 +39,16 @@ A greedy clustering algorithm of picking an unmarked vertex and matching it with
import
torch
import
torch
from
torch_cluster
import
graclus_cluster
from
torch_cluster
import
graclus_cluster
row
=
torch
.
LongT
ensor
([
0
,
1
,
1
,
2
])
row
=
torch
.
t
ensor
([
0
,
1
,
1
,
2
])
col
=
torch
.
LongT
ensor
([
1
,
0
,
2
,
1
])
col
=
torch
.
t
ensor
([
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
)
cluster
=
graclus_cluster
(
row
,
col
,
weight
)
```
```
```
```
print(cluster)
print(cluster)
0 0 1
tensor([ 0, 0, 1])
[torch.LongTensor of size 3]
```
```
## VoxelGrid
## VoxelGrid
...
@@ -60,16 +59,15 @@ A clustering algorithm, which overlays a regular grid of user-defined size over
...
@@ -60,16 +59,15 @@ A clustering algorithm, which overlays a regular grid of user-defined size over
import
torch
import
torch
from
torch_cluster
import
grid_cluster
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
.
T
ensor
([
5
,
5
])
size
=
torch
.
t
ensor
([
5
,
5
])
cluster
=
grid_cluster
(
pos
,
size
)
cluster
=
grid_cluster
(
pos
,
size
)
```
```
```
```
print(cluster)
print(cluster)
0 5 3 0 1
tensor([ 0, 5, 3, 0, 1])
[torch.LongTensor of size 5]
```
```
## Running tests
## Running tests
...
...
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