Skip to content

Commit 67ecf4f

Browse files
committed
feat: clean README
1 parent 9e72bea commit 67ecf4f

File tree

1 file changed

+1
-65
lines changed

1 file changed

+1
-65
lines changed

README.md

Lines changed: 1 addition & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -53,73 +53,9 @@ pip install gfn-layer
5353
```
5454
**Note:** the package name on PyPI is **gfn-layer**, gfn refers to a different package.
5555

56-
For a developer installation
57-
```
58-
git clone https://github.com/Oisin-M/gfn.git
59-
cd gfn
60-
pip install -e .
61-
pre-commit install
62-
```
63-
6456
## Quickstart
6557

66-
Using `gfn` is intuitive - the `GFN` layer is an extension of the `torch.nn.Linear` layer. Simply import it with `from gfn import GFN` and use as follows:
67-
68-
**No graph (equivalent to `torch.nn.Linear`)**
69-
```python
70-
gfn_layer = GFN(in_features=2, out_features=3)
71-
72-
x = torch.ones(2)
73-
74-
y = gfn_layer(x)
75-
assert y.shape[-1] == 3
76-
```
77-
78-
**In graph only**
79-
```python
80-
# in graph with 2 nodes at (0, 0) and (1, 0)
81-
original_in_graph = torch.tensor([(0,0), (1,0)])
82-
gfn_layer = GFN(in_features=original_in_graph, out_features=3)
83-
84-
# predict using graph of 4 nodes: (0.5, 0.5), (1.5, 1.5), (1,1) and (0, 0.5)
85-
new_in_graph = torch.tensor([(0.5, 0.5), (1.5, 1.5), (1, 1), (0, 0.5)])
86-
x = torch.ones(4)
87-
88-
y = gfn_layer(x, in_graph=new_in_graph)
89-
assert y.shape[-1] == 3
90-
```
91-
92-
**Out graph only**
93-
```python
94-
# out graph with 3 nodes at (0, 0), (-1, 0) and (0, -1)
95-
original_out_graph = torch.tensor([(0,0), (-1,0), [0,-1]])
96-
gfn_layer = GFN(in_features=2, out_features=original_out_graph)
97-
98-
# predict at graph of 5 nodes: (-0.5, -0.5), (-1.5, -1.5), (-1, -1), (0, -0.5) and (-0.5, 0)
99-
new_out_graph = torch.tensor([(-0.5, -0.5), (-1.5, -1.5), (-1, -1), (0, -0.5), (-0.5, 0)])
100-
x = torch.ones(2)
101-
102-
y = gfn_layer(x, out_graph=new_out_graph)
103-
assert y.shape[-1] == 5
104-
```
105-
106-
**Both out graph and in graph**
107-
```python
108-
# in graph of 2 nodes
109-
original_in_graph = torch.tensor([(0,0), (1,0)])
110-
# out graph of 3 nodes
111-
original_out_graph = torch.tensor([(0,0), (-1,0), [0,-1]])
112-
gfn_layer = GFN(in_features=original_in_graph, out_features=original_out_graph)
113-
114-
# predict using graph of 4 nodes
115-
new_in_graph = torch.tensor([(0.5, 0.5), (1.5, 1.5), (1, 1), (0, 0.5)])
116-
# predict at graph of 5 nodes
117-
new_out_graph = torch.tensor([(-0.5, -0.5), (-1.5, -1.5), (-1, -1), (0, -0.5), (-0.5, 0)])
118-
x = torch.ones(4)
119-
120-
y = gfn_layer(x, out_graph=new_out_graph)
121-
assert y.shape[-1] == 5
122-
```
58+
See the [user guide](https://gfn-layer.readthedocs.io/en/latest/userguide.html) to get started!
12359

12460
## Citing
12561
If this work is useful to you, please cite

0 commit comments

Comments
 (0)