zfjsail / gae-pytorch Goto Github PK
View Code? Open in Web Editor NEWGraph Auto-Encoder in PyTorch
License: MIT License
Graph Auto-Encoder in PyTorch
License: MIT License
In the code in utils.py, the function get_roc_score() has this line:
labels_all = np.hstack([np.ones(len(preds)), np.zeros(len(preds))])
The second argument should be np.zeros(len(preds_neg))
I was using your code to understand GVAE and found this small mistake. Thank you.
I found that in train.py mu.data.numpy()
is used to get hidden_emb, but it would get None when using GCNModelAE as model, hidden_emb should be got from model.encode() instead.
How can I implement a mini-batch version of GVAE?
May I know why adding self loop to adj_train to get adj_label?
adj_label = adj_train + sp.eye(adj_train.shape[0])
When I train with Cora dataset, I get the following error in binary_cross_entropy_with_logits
. Shouldn't pos_weight
be a Tensor? Thanks!
Traceback (most recent call last):
File "train.py", line 83, in <module>
gae_for(args)
File "train.py", line 62, in gae_for
norm=norm, pos_weight=pos_weight)
File "/gae-pytorch/gae/optimizer.py", line 7, in loss_function
cost = norm * F.binary_cross_entropy_with_logits(preds, labels, pos_weight=pos_weight)
File "/anaconda3/lib/python3.6/site-packages/torch/nn/functional.py", line 2077, in binary_cross_entropy_with_logits
return torch.binary_cross_entropy_with_logits(input, target, weight, pos_weight, reduction_enum)
TypeError: binary_cross_entropy_with_logits(): argument 'pos_weight' (position 4) must be Tensor, not numpy.float64
In VAE, sampling is z_mean + torch.exp(0.5 * z_log_var) * epsilon
, but why is z_mean + torch.exp( z_log_var)
in VGAE, does it cause anything different?
Can I use this framework on my own custom datasets?
Also, I'm experiencing an issue, when I try to run:
python gae/train.py
I get:
Traceback (most recent call last):
File "gae/train.py", line 12, in
from gae.model import GCNModelVAE
ModuleNotFoundError: No module named 'gae'
Yet this command works interactively.
KLD = -0.5 / n_nodes * torch.mean(torch.sum(1 + 2 * logvar - mu.pow(2) - logvar.exp().pow(2), 1))
/ n_nodes should be removed or
torch.mean โ torch.sum
self.dc = InnerProductDecoder(dropout, act=lambda x: x)
Why not use act=torch.sigmoid
here?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.