GithubHelp home page GithubHelp logo

willsq / tf-dnc Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 6.0 44.66 MB

Tensorflow implementation of the Differentiable Neural Computer

License: MIT License

Makefile 0.86% Python 99.14%
deep-learning machine-learning machine-learning-algorithms nlp tensorflow

tf-dnc's People

Contributors

willsq avatar

Stargazers

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

Watchers

 avatar  avatar

tf-dnc's Issues

I get a make check error

joshua@joshua-HP-ENVY-m7-Notebook:~/Downloads/tf-DNC-master$ make check
pycodestyle --max-line-length=100 dnc
make: pycodestyle: Command not found
Makefile:8: recipe for target 'check' failed
make: *** [check] Error 127

then make test error that probably is a continuation
joshua@joshua-HP-ENVY-m7-Notebook:~/Downloads/tf-DNC-master$ make test
pycodestyle --max-line-length=100 dnc
make: pycodestyle: Command not found
Makefile:8: recipe for target 'check' failed
make: *** [check] Error 127

again vis error so probably a continuation
joshua@joshua-HP-ENVY-m7-Notebook:~/Downloads/tf-DNC-master$ make vis
make: *** No rule to make target 'vis'. Stop.

basic usage error
joshua@joshua-HP-ENVY-m7-Notebook:~/Downloads/tf-DNC-master$ make test
pycodestyle --max-line-length=100 dnc
make: pycodestyle: Command not found
Makefile:8: recipe for target 'check' failed
make: *** [check] Error 127

how can i use different data sets than babi?

Basic usage

To train on the en-10k babi dataset:

$ make test
$ python3 babi/train.py --checkpoint_dir=model
$ python3 babi/test.py --checkpooint_file=model/model.ckpt-590000

ValueError: Shape must be rank 3 but is rank 2 for 'DNC/inputs_to_controller/concat' (op: 'ConcatV2') with input shapes: [?,?,56], [?,256], [].

I have tried to integrate DNC as a memory to sequence to sequence model architecture. I have followed the documentation given in keras (https://keras.io/examples/lstm_seq2seq/)(https://github.com/willsq/tf-DNC), but I have got the following error as follows,

Using TensorFlow backend.
Number of unique input tokens: 56
Number of unique output tokens: 62
Max sequence length for inputs: 124
Max sequence length for outputs: 206
13250
Tensor("input_1:0", shape=(?, ?, 56), dtype=float32)
[<tf.Tensor 'Fill:0' shape=(?, 256, 64) dtype=float32>, <tf.Tensor 'zeros:0' shape=(?, 256) dtype=float32>, <tf.Tensor 'zeros_1:0' shape=(?, 256, 256) dtype=float32>, <tf.Tensor 'zeros_2:0' shape=(?, 256) dtype=float32>, <tf.Tensor 'Fill_1:0' shape=(?, 256) dtype=float32>, <tf.Tensor 'Fill_2:0' shape=(?, 256, 4) dtype=float32>, <tf.Tensor 'zeros_3:0' shape=(?, 256) dtype=float32>, <tf.Tensor 'zeros_4:0' shape=(?, 256)
dtype=float32>, <tf.Tensor 'Fill_3:0' shape=(?, 64, 4) dtype=float32>]
Traceback (most recent call last):
  File "C:\Apps\sa2446\lib\site-packages\tensorflow\python\framework\ops.py", line 1659, in _create_c_op
    c_op = c_api.TF_FinishOperation(op_desc)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Shape must be rank 3 but is rank 2 for 'DNC/inputs_to_controller/concat' (op: 'ConcatV2') with input shapes: [?,?,56], [?,256], [].

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "analysis.py", line 145, in <module>
    encoder_outputs, state_h = dnc_core(encoder_inputs,initial_state)
  File "C:\Apps\sa2446\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 554, in __call__
    outputs = self.call(inputs, *args, **kwargs)
  File "C:\ICA\dm_sample\dnc\dnc.py", line 101, in call
    input_augmented = tf.concat([inputs, read_vectors_flat], 1)
  File "C:\Apps\sa2446\lib\site-packages\tensorflow\python\util\dispatch.py", line 180, in wrapper
    return target(*args, **kwargs)
  File "C:\Apps\sa2446\lib\site-packages\tensorflow\python\ops\array_ops.py", line 1256, in concat
    return gen_array_ops.concat_v2(values=values, axis=axis, name=name)
  File "C:\Apps\sa2446\lib\site-packages\tensorflow\python\ops\gen_array_ops.py", line 1148, in concat_v2
    "ConcatV2", values=values, axis=axis, name=name)
  File "C:\Apps\sa2446\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 788, in _apply_op_helper
    op_def=op_def)
  File "C:\Apps\sa2446\lib\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func
    return func(*args, **kwargs)
  File "C:\Apps\sa2446\lib\site-packages\tensorflow\python\framework\ops.py", line 3300, in create_op
    op_def=op_def)
  File "C:\Apps\sa2446\lib\site-packages\tensorflow\python\framework\ops.py", line 1823, in __init__
    control_input_ops)
  File "C:\Apps\sa2446\lib\site-packages\tensorflow\python\framework\ops.py", line 1662, in _create_c_op
    raise ValueError(str(e))
ValueError: Shape must be rank 3 but is rank 2 for 'DNC/inputs_to_controller/concat' (op: 'ConcatV2') with input shapes: [?,?,56], [?,256], [].

I have made the following modifications in the code as follows,

encoder_inputs = Input(shape=(None,num_encoder_tokens))
print(encoder_inputs)
dnc_core = dnc.DNC(output_size=latent_dim, controller_units=FLAGS.units, **memory_config)
en_bs= tf.placeholder(tf.float32,[])
initial_state = dnc_core.get_initial_state(batch_size=en_bs)
print(initial_state)
encoder_outputs, state_h = dnc_core(encoder_inputs,initial_state)

I have modified the decoder part as well in the above mentioned way. Could I get help to solve this issue?

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.