GithubHelp home page GithubHelp logo

hw2vec's People

Contributors

arkdu avatar aungthu17593 avatar dreamingsarah avatar louisccc avatar rozhinys avatar tthenguyen avatar ymoghadd 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

Watchers

 avatar  avatar

hw2vec's Issues

Run "Use_Case_1.py" in CPU mode

Hi,

My environment is an ubuntu virtual machine, and I have installed the pytorch cpu version.
I tried to run use_case_1.py, and changed line 105 of models.py.
torch.load(model_weight_path, map_location='cpu')
However, I get the error in the figure below:
image

Then I changed the key in the dictionary to make the names match, and ran it with the following error:
image

Then I used the reshape function to convert (37, 200) to (200,37).
The program can output the data, but the output data is different every time I run it.

Is there a step I'm missing?
image
image
image

Looking forward to your reply.

Benoit

Normalization

Normalization should be on by default, and this can help reduce some code in DataProcessor

why use both log_softmax and CrossEntropyLoss ๏ผŸ

def train_epoch_tj(self, data):
    output, _ = self.model.embed_graph(data.x, data.edge_index, data.batch)
    output = self.model.mlp(output)
    output = F.log_softmax(output, dim=1)

    loss_train = self.loss_func(output, data.label)
    return loss_train

def __init__(self, cfg, class_weights=None):
    super().__init__(cfg)
    self.task = "TJ"
    if class_weights.shape[0] < 2:
        self.loss_func = nn.CrossEntropyLoss()
    else:    
        self.loss_func = nn.CrossEntropyLoss(weight=class_weights.float().to(cfg.device))

That means using double logsoftmax, which might introduce some negative effects.

pygraphviz on MacOS 13.3.1

Use the below url to install pygraphviz on Mac (tested and working).

https://ports.macports.org/port/py38-pygraphviz/

`(hw2vec) rahulvishwakarma@Rahuls-Air examples % python
Python 3.6.15 | packaged by conda-forge | (default, Dec 3 2021, 18:49:43)
[GCC Clang 11.1.0] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import pygraphviz as pgv
G = pgv.AGraph()
G.add_node("a")
G.add_edge("b", "c")
print(G)
strict graph "" {
a;
b -- c;
}

`

.yaml parameters

Parameters not related to model building or training should be moved to config.py

Error while building hw2vec

Hi, I cloned the repo and then run python3 setup.py install and it throws these errors.

image

Can someone help me out?

PyTorch Geometric on MacOS

# Works on OS X, with conda installed.

# Create conda environment for PyTorch Geometric
echo "Creating pyg environment"
conda create -n pyg python=3.6

echo "Activate pyg Env"
source activate pyg

# PyTorch Conda Installation
echo "Installing PyTorch"
conda install pytorch torchvision -c pytorch

# Change of Compilers
echo "Compiler Changing on OS X"
conda install -y clang_osx-64 clangxx_osx-64 gfortran_osx-64
MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++

# Install dependencies
echo "Installing PyG Dependencies"
pip install torch_scatter
pip install torch_sparse
pip install torch_cluster
pip install torch_geometric

Use_Case_1.py" in GPU mode

Use_Case_1.py" in GPU mode throws the same error as when ran with only CPU.

!python use_case_1.py

Traceback (most recent call last):
  File "/content/hw2vec/examples/use_case_1.py", line 33, in <module>
    graph_emb = use_case_1(cfg, hw_design_dir_path,\
  File "/content/hw2vec/examples/use_case_1.py", line 18, in use_case_1
    model.load_model(pretrained_model_cfg_path, pretrained_model_weight_path)
  File "/content/hw2vec/hw2vec/graph2vec/models.py", line 105, in load_model
    self.load_state_dict(torch.load(model_weight_path, map_location=torch.device('cpu')))
  File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 2041, in load_state_dict
    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for GRAPH2VEC:
	Missing key(s) in state_dict: "layers.0.graph_conv.lin.weight", "layers.1.graph_conv.lin.weight", "pool1.graph_pool.gnn.lin_rel.weight", "pool1.graph_pool.gnn.lin_rel.bias", "pool1.graph_pool.gnn.lin_root.weight". 
	Unexpected key(s) in state_dict: "layers.0.graph_conv.weight", "layers.1.graph_conv.weight", "pool1.graph_pool.gnn.lin_l.weight", "pool1.graph_pool.gnn.lin_l.bias", "pool1.graph_pool.gnn.lin_r.weight". 

Can you please help with this issue?

use_case_2.py and use_case_3.py works fine as documented on the GitHub page.

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.