Git Product home page Git Product logo

graph-bert's People

Contributors

jwzhanggy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

graph-bert's Issues

transformer edition

Your work has inspired me a lot.Thank you for your very useful work.but when I try to run the code ,I find a error:

File "./Graph-Bert/code/MethodBertComp.py", line 11, in
from transformers.modeling_bert import BertPredictionHeadTransform, BertAttention, BertIntermediate, BertOutput
ModuleNotFoundError: No module named 'transformers.modeling_bert'

I guess that maybe transformer edition is not appropriate,please help me .
Thank you!

About the size of the input graph

Although you said that your method support large size graph in your paper, I tested it on a graph with about 10, 000 nodes, the program was terminated while running because it exceeded the system memory. However, the memory of the server is 128G,so where might the problem lie?

Some questions about intimacy matrix

I have some questions while reading the paper of Graph-BERT. What does the intimacy score mean? What the difference between intimacy score and similarity score? When I try to understand the intimacy matrix, I find the nearest neighbors will get the highest intimacy score(e.g. 1-hop neighbors always get the highest intimacy score). Why does the context nodes can cover both local neighbors as well as the nodes which are far away.

Could you please help figure out these problems? Thanks for your help!

question about the linkless subgraphs sampling

Hi,
In your graph-bert, you calculate the intimacy matrix in step 1, then sample linkless subgraphs and embed nodes in step 2. In the process of sampling linkless subgraphs, nodes of the linkless subgraphs are sorted based on the intimacy scores.

The question is, is it possible to change this sampling method to something else? (e.g., ripple walk sampling algorithm. I know this is one of your great works.)
If yes, how and where should I rewrite this codes to implement that?

Thank you in advance.

Running script_2_pre_train for Node Attribute Reconstruction and Graph Bert Network Structure Recovery

Hi! Your paper states that:
"In the experiments, we first pre-train GRAPH-BERT based on
the node attribute reconstruction task with 200 epochs, then
load and pre-train the same GRAPH-BERT model again based
on the graph structure recovery task with another 200 epochs."

However, script_2_pre_train.py learns two different models. Could you please specify, whether you applied those models separately for the downstream task?

If your paper is describing the workflow correctly, what should I do to train one model on both tasks?

Thank you in advance for the answer.
Yours sincerely,
Irina Nikishina.

[Question] Position-Embed function Eqn. 3

Hi,
Thanks for the great work and the source codes!

I was wondering whether the Eqn 3 from the paper is implemented in the codes? I could not find them, and notice that the position features are directly passed to nn.Embedding()?

def __init__(self, config):
super(BertEmbeddings, self).__init__()
self.raw_feature_embeddings = nn.Linear(config.x_size, config.hidden_size)
self.wl_role_embeddings = nn.Embedding(config.max_wl_role_index, config.hidden_size)
self.inti_pos_embeddings = nn.Embedding(config.max_inti_pos_index, config.hidden_size)
self.hop_dis_embeddings = nn.Embedding(config.max_hop_dis_index, config.hidden_size)

def forward(self, raw_features=None, wl_role_ids=None, init_pos_ids=None, hop_dis_ids=None):
raw_feature_embeds = self.raw_feature_embeddings(raw_features)
role_embeddings = self.wl_role_embeddings(wl_role_ids)
position_embeddings = self.inti_pos_embeddings(init_pos_ids)
hop_embeddings = self.hop_dis_embeddings(hop_dis_ids)

Thanks,
Vijay

nfeature, ngraph

Hey!
Could you please clarify about what nfeature and ngraph mean in the code. I noticed that they aren't equal to the document encoding size and number of links respectively

Code doesn't match paper

Hi:
In script_3_fine_tuning, you have one downstream task graph-clustering
In MethodGraphBertGraphClustering,py,from line 38 to line 41, is your clustering process while you didn't reuse any pre-train results in this downstream task. Is it belong to fine-tuning?
kmeans = KMeans(n_clusters=self.cluster_number, max_iter=self.max_epoch)
if self.use_raw_feature:
clustering_result = kmeans.fit_predict(self.data['X'])
else:
clustering_result = kmeans.fit_predict(sequence_output.tolist())

About mini-batch size

Hi, thank you for your work.
I have a question about mini-batch size, where can I find it in your code?
Thank you.

transformers edition

Your work has inspired me a lot.Thank you for your very useful work.but when I try to run the code ,I find a error:

File "./Graph-Bert/code/MethodBertComp.py", line 11, in
from transformers.modeling_bert import BertPredictionHeadTransform, BertAttention, BertIntermediate, BertOutput
ModuleNotFoundError: No module named 'transformers.modeling_bert'

I guess that maybe transformer edition is not appropriate,could you tell me transformers edition,please help me .
Thank you!

Graph representation of custom dataset and ASTs

The given cora example makes nodes from papers and has links between each node (paper). However, my dataset has a bunch of text files and my graph is focused on each individual text file rather than dependency of one file to another and the order of tokens/features within each file is important as well. I have an AST graph of each text file but I'm unsure of how I can represent it for input to Graph-Bert.
If I make nodes out of each line of text, the feature vectors will be too sparse for each node and the number of nodes will be extremely large. If I make nodes on each text file, the structure and dependency within each file will be lost and I am unsure of what the links will be then.

If there's a way to represent this for input to Graph-Bert, please let me know. Thank you.

Finetuning for custom dataset

Could the model be used for fine tuning on a custom dataset? I have a dataset of medical texts and have made a vocabualry graph out of it. I want to optimise the clustering and output a knowlege graph indicating the interactions between the entities.

Thanks in advance!

Activation function implementation

Hi, I wonder where do you implement the activation function in the code?
I saw you declared "hidden_act" as "gelu", but not using "hidden_act" or declare any activation function in the project.
I'm looking forward to your response, Thank you :)

Custom dataset: float feature values

Hi, is it possible to run the code for a custom dataset where the node features are float instead of binary (as in cora)?
If so, can you guide me to the files/tasks/concepts I should be looking at for making necessary changes?

Are there some tricks in the stage of fine-tuning?

I run the script_3_fine_tuning.py on Cora for node classification task 5 times, but i can not get the result reported in paper. The results of my experiments are as follows:
image
Are there some other tricks in the stage of fine-tuning that can improve the accuracy?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.