willsq / tf-dnc Goto Github PK
View Code? Open in Web Editor NEWTensorflow implementation of the Differentiable Neural Computer
License: MIT License
Tensorflow implementation of the Differentiable Neural Computer
License: MIT License
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
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
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.