Comments (5)
from gae.
I am meeting another problem:
Traceback (most recent call last):
File "train.py", line 48, in
adj_train, train_edges, val_edges, val_edges_false, test_edges, test_edges_false = mask_test_edges(adj)
File "build/bdist.linux-x86_64/egg/gae/preprocessing.py", line 99, in mask_test_edges
assert ~ismember(val_edges_false, edges_all)
AssertionError
from gae.
@chao92 I met the same problem: 'assert ~ismember(val_edges_false, edges_all) AssertionError', maybe is not uncommon. Do you resolve this matter?
from gae.
@yjyGo, @chao92 I know this is kind of late, but try and reduce the validation/test split. I did that and it worked for me.
I reduced it to 5%, because my graphs are kind of small. Not sure if this is the right thing to do.
I also tried with those asserts commented out. It still ran, but, again, that is probably not recommended/right to do
from gae.
@yjyGo @chao92 I have encountered the same problem. I found that the cause of this error is that false validation edges can be in the test edge set. However, the above assertion requires that false validation edges be in the whole edge set, including the test edge set. I think we can solve the problem if we also check that false validation edges are not in the test edge in generating them.
Code to reproduce (test.py
)
import sys
import numpy as np
import scipy
import scipy.sparse as sp
from gae import preprocessing
print(f"python: {sys.version}")
print(f"numpy: {np.__version__}")
print(f"scipy: {scipy.__version__}")
np.random.seed(4)
A = sp.csr_matrix(np.random.randint(0, 2, (10, 10)))
A = sp.triu(A, 1)
A = A + A.T
preprocessing.mask_test_edges(A)
Changes in the GAE code (to check that false validation edges is in the test edge set)
%(master)[U]git diff
diff --git a/gae/preprocessing.py b/gae/preprocessing.py
index 9b3b093..6c1f7f8 100644
--- a/gae/preprocessing.py
+++ b/gae/preprocessing.py
@@ -95,6 +95,10 @@ def mask_test_edges(adj):
continue
val_edges_false.append([idx_i, idx_j])
+ assert ismember([6, 0], np.array(val_edges_false))
+ assert ismember([0, 6], test_edges)
+ assert ismember([0, 6], edges_all)
+
assert ~ismember(test_edges_false, edges_all)
assert ~ismember(val_edges_false, edges_all)
assert ~ismember(val_edges, train_edges)
Log
%(master)[U]python test.py
python: 3.7.5 (default, Oct 25 2019, 10:52:18)
[Clang 4.0.1 (tags/RELEASE_401/final)]
numpy: 1.18.1
scipy: 1.3.3
Traceback (most recent call last):
File "test.py", line 17, in <module>
preprocessing.mask_test_edges(A)
File "/Users/oonokenta/dev/gae/gae/preprocessing.py", line 103, in mask_test_edges
assert ~ismember(val_edges_false, edges_all)
AssertionError
from gae.
Related Issues (20)
- Input data
- How could I get the output graph? HOT 1
- invoice or id card structure prediction
- Can GAE work in inductive setting? HOT 1
- Graph embedding vs Node embedding
- Does it work with Tensorflow 2 and Python 3? HOT 3
- Enforcing Sparsity
- Use continuous feature values HOT 1
- A question about negative samples generation in preprocessing.py HOT 4
- How can I reproduce the experiment using only the adjacency matrix without node features? HOT 2
- Potential Problem about the KL term? HOT 1
- About reduce links of the graph.
- KL divergence loss
- Descriptions of x, tx, allx?
- About Dataset Splits
- No such file or directory: 'data/ind.cora.x'
- Experiment with the weighted adjacency matrix
- Issues in preprocessing.py (not 100% sure)
- How to visualize the latent space?
- How to use GAE to generate nodes embeddings
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gae.