Giter Site home page Giter Site logo

keras-gcn's Issues

In readme.md

Is the
from keras_gru import GraphConv

means
from keras_gcn import GraphConv??
is this a mistyping?

Explanation

Hello!

I am very interested in graph convolution, especially when applied to chemical compounds.

Is there a paper, or some sort of intuitive explanation you can give of how the graph convolution layer works?

Thanks for your time

I have the following error


Layer (type) Output Shape Param # Connected to

input_1 (InputLayer) [(None, None, 256)] 0 []

input_2 (InputLayer) [(None, 256, 256)] 0 []

graph_conv (GraphConv) (None, 256, 32) 8224 ['input_1[0][0]',
'input_2[0][0]']

graph_conv_1 (GraphConv) (None, 256, 16) 528 ['graph_conv[0][0]',
'input_2[0][0]']

lstm (LSTM) (None, None, 128) 197120 ['input_1[0][0]']

flatten (Flatten) (None, 4096) 0 ['graph_conv_1[0][0]']

lstm_1 (LSTM) (None, 32) 20608 ['lstm[0][0]']

concatenate (Concatenate) (None, 4128) 0 ['flatten[0][0]',
'lstm_1[0][0]']

batch_normalization (BatchNorm (None, 4128) 16512 ['concatenate[0][0]']
alization)

dropout (Dropout) (None, 4128) 0 ['batch_normalization[0][0]']

dense (Dense) (None, 128) 528512 ['dropout[0][0]']

dense_1 (Dense) (None, 32) 4128 ['dense[0][0]']

dropout_1 (Dropout) (None, 32) 0 ['dense_1[0][0]']

dense_2 (Dense) (None, 1) 33 ['dropout_1[0][0]']

==================================================================================================
Total params: 775,665
Trainable params: 767,409
Non-trainable params: 8,256


========== TRAIN ============
/usr/local/lib/python3.7/dist-packages/nilmtk/elecmeter.py:432: UserWarning: The provided sample_period (1) is shorter than the meter's sample_period (3)
sample_period, default_sample_period
Epoch 1/10
Traceback (most recent call last):
File "/content/drive/MyDrive/Auto_Encoder/DAE/redd-test.py", line 31, in
dae.train(train_mains, train_meter, epochs=10, sample_period=1)
File "/content/drive/MyDrive/Auto_Encoder/DAE/daedisaggregator.py", line 78, in train
self.train_on_chunk(mainchunk, meterchunk, epochs, batch_size)
File "/content/drive/MyDrive/Auto_Encoder/DAE/daedisaggregator.py", line 115, in train_on_chunk
self.model.fit(X_batch, Y_batch, batch_size=batch_size, epochs=epochs, shuffle=True)
File "/usr/local/lib/python3.7/dist-packages/keras/utils/traceback_utils.py", line 67, in error_handler
raise e.with_traceback(filtered_tb) from None
File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/func_graph.py", line 1147, in autograph_handler
raise e.ag_error_metadata.to_exception(e)
ValueError: in user code:

File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 1021, in train_function  *
    return step_function(self, iterator)
File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 1010, in step_function  **
    outputs = model.distribute_strategy.run(run_step, args=(data,))
File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 1000, in run_step  **
    outputs = model.train_step(data)
File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 859, in train_step
    y_pred = self(x, training=True)
File "/usr/local/lib/python3.7/dist-packages/keras/utils/traceback_utils.py", line 67, in error_handler
    raise e.with_traceback(filtered_tb) from None
File "/usr/local/lib/python3.7/dist-packages/keras/engine/input_spec.py", line 200, in assert_input_compatibility
    raise ValueError(f'Layer "{layer_name}" expects {len(input_spec)} input(s),'

ValueError: Layer "model" expects 2 input(s), but it received 1 input tensors. Inputs received: [<tf.Tensor 'IteratorGetNext:0' shape=(None, 256, 1) dtype=float32>]

How to fit the model?

I see that there is a test module. Could you please also include an example on how to fit the model?

Error when passing the arguments

Describe the Bug

I am getting the following error 👍 Traceback (most recent call last):

  File "/home/pulkit/Desktop/GIT2/BTP/SimGNN/src/model.py", line 97, in <module>
    model.train_step()
  File "/home/pulkit/Desktop/GIT2/BTP/SimGNN/src/model.py", line 88, in train_step
    y = self(data, training = True)
  File "/home/pulkit/.local/lib/python3.8/site-packages/tensorflow/python/keras/engine/base_layer.py", line 985, in __call__
    outputs = call_fn(inputs, *args, **kwargs)
  File "/home/pulkit/Desktop/GIT2/BTP/SimGNN/src/model.py", line 46, in call
    z1 = self.gcn1([features_1, edge_index_1])
  File "/home/pulkit/.local/lib/python3.8/site-packages/tensorflow/python/keras/engine/base_layer.py", line 985, in __call__
    outputs = call_fn(inputs, *args, **kwargs)
  File "/home/pulkit/.local/lib/python3.8/site-packages/keras_gcn/layers.py", line 50, in call
    outputs = self.activation(self._call(features, edges))
  File "/home/pulkit/.local/lib/python3.8/site-packages/keras_gcn/layers.py", line 145, in _call
    return K.batch_dot(K.permute_dimensions(edges, (0, 2, 1)), features) \
  File "/home/pulkit/.local/lib/python3.8/site-packages/tensorflow/python/util/dispatch.py", line 201, in wrapper
    return target(*args, **kwargs)
  File "/home/pulkit/.local/lib/python3.8/site-packages/tensorflow/python/keras/backend.py", line 2943, in permute_dimensions
    return array_ops.transpose(x, perm=pattern)
  File "/home/pulkit/.local/lib/python3.8/site-packages/tensorflow/python/util/dispatch.py", line 201, in wrapper
    return target(*args, **kwargs)
  File "/home/pulkit/.local/lib/python3.8/site-packages/tensorflow/python/ops/array_ops.py", line 2188, in transpose
    return transpose_fn(a, perm, name=name)
  File "/home/pulkit/.local/lib/python3.8/site-packages/tensorflow/python/ops/gen_array_ops.py", line 11529, in transpose
    return transpose_eager_fallback(
  File "/home/pulkit/.local/lib/python3.8/site-packages/tensorflow/python/ops/gen_array_ops.py", line 11554, in transpose_eager_fallback
    _result = _execute.execute(b"Transpose", 1, inputs=_inputs_flat,
  File "/home/pulkit/.local/lib/python3.8/site-packages/tensorflow/python/eager/execute.py", line 59, in quick_execute
    tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
tensorflow.python.framework.errors_impl.InvalidArgumentError: transpose expects a vector of size 2. But input(1) is a vector of size 3 [Op:Transpose]

The input sizes are :
Features : (19, 16)
Edges : (2, 158)

Calling the layer as : z1 = self.gcn1([features_1, edge_index_1])

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.