Comments (3)
Thanks for your question. Note that the evaluate_preds
function takes an additional index/mask array, e.g. idx_train
which is not the case in your keras-based implementation. This explains the difference in measured accuracy.
from keras-gcn.
Sorry for late response. I think I solved this issue. I mistakenly thought that the argument sample_weight
is enough to apply weight to the input data. In fact we also need to use weighted_metrics
but not metrics
. I found that evaluate_pred
can be replaced by mode.evaluate
therefore we don't need to implement metrics categorical_crossentropy
and accuracy
. The codes can be simplified to keras-based implementation without changing the results. Here are my solutions:
- add weighted_metrics
categorical_crossentropy
andaccuracy
to model.compile:
model.compile(loss='categorical_crossentropy', optimizer=Adam(lr=0.01), weighted_metrics=['categorical_crossentropy', 'accuracy'])
- evaluate the train data using mode.evaluate:
_, train_loss, train_acc = model.evaluate(
graph, y_train, sample_weight=train_mask, batch_size=X.shape[0], verbose=0)
To be more simplified, we can also get rid of loops over epochs and use earlystopping
callbacks.
from keras-gcn.
This sounds good, thanks for looking into this! Feel free to make a pull request if you think this might be helpful for other users as well.
from keras-gcn.
Related Issues (20)
- name 'Y' is not defined
- multiple-graph HOT 2
- Model Fails when we change batch size HOT 4
- some problem need help HOT 1
- Face TypeError during load data HOT 2
- Cannot use GPU when output.shape[1] * nnz(a) > 2^31 HOT 10
- how to install it? No module named 'kegra'
- ValueError: setting an array element with a sequence. HOT 8
- I have multiple graph instance but they have different number of nodes.
- Using a `tf.Tensor` as a Python `bool` is not allowed in Graph execution HOT 3
- GCN apply for my own dataset but training_acc is low HOT 4
- TypeError: Using a `tf.Tensor` as a Python `bool` is not allowed. HOT 5
- Got error when fitting
- Got error when fitting
- Got error when using theano
- GCN on multiple graphs HOT 3
- Low accuracy about Cora dataset
- Can i use GCN for Information Extraction from a document?
- ValueError: Only provide the `shape` OR `batch_input_shape` argument to Input, not both at the same time. HOT 4
- Why does it increased in dimension after every layer?
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 keras-gcn.