Giter Club home page Giter Club logo

dnc-tensorflow's People

Contributors

mostafa-samir 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  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

dnc-tensorflow's Issues

why is ' self.lstm_cell(X, state) ' ?

I successfully run the program.However, I found threre is something seen abnormal.

class RecurrentController(BaseController):
def network_vars(self):
self.lstm_cell = tf.nn.rnn_cell.BasicLSTMCell(256)
self.state = self.lstm_cell.zero_state(self.batch_size, tf.float32)

def network_op(self, X, state):
    X = tf.convert_to_tensor(X)
    return self.lstm_cell(X, state)

def get_state(self):
    return self.state

def update_state(self, new_state):
    return tf.no_op()

In the above, tf.nn.rnn_cell.BasicLSTMCell(256) make 256 lstm cells, but the code directly use return self.lstm_cell(X, state) without using tf.static_rnn or tf.nn.dynamic_rnn.
tf.static_rnn or tf.nn.dynamic_rnn can output state, but self.lstm_cell(X, state) can't.
I wonder whether it's wrong and needed to add tf.static_rnn or tf.nn.dynamic_rnn as following:

def network_op(self, X, state):
X = tf.convert_to_tensor(X)
return return tf.nn.dynamic_rnn(self.lstm_cell, X, initial_state=state, time_major=False)

embeddings, from word2vec

hi there
is it possible for you point me out some resorces to include externals embeddings from word2vec?, in order to transfer some learnign from a particular field in the bay task or any other.
thanks a lot

[question] output with different sequence length?

Hello,

The output sequence length in the implementation is the same as the input sequence length. Perhaps I have misunderstood, but is this a required feature? In the BaBi task for example, in the target you simply replace the "-" symbols with the correct word and leave all other words the same, thereby leaving the sequence length identical.

How could one predict an output sequence of different length to the input (many-to-many), or just 1 output timestep (many-to-one)? For the latter case, would you just take the last timestep in the output?

Thanks!

Sequence length in dnc/dnc.py

While implementing bAbI task based on your code,
I've found that the sequence length is defined as a single integer for each batch in dnc.py.

For copy task, you fed the same length items for each batch (though its random),
but if each item in one batch varies in their length (like sentences in bAbI), shouldn't it be array of sequence lengths? (size of batch)

Upgrade to Tensorflow 1.0?

Hey guys!

Thanks a lot for sharing this! I switched to TF 1.0 and upgrading your code is not entirely straightforward (the upgrade script leaves several places to be dealt with manually). I can probably manage but perhaps others have similar issues and it would help us if you released also a 1.0 version.

Thanks for considering this!

Michal

Error when printing updated_memory

When I try to run the contents of the motebook, as a .py file and print the contents of memory it shows the below error. How can I overcome the problem of printing a tensor that has been marked as 'not fetchable'?

Dynamic Memory Mechanisms
Trained on Length-2 Series
('ckpts_dir:', 'checkpoints')
I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:925] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
I tensorflow/core/common_runtime/gpu/gpu_device.cc:951] Found device 0 with properties:
name: GeForce GTX 960
major: 5 minor: 2 memoryClockRate (GHz) 1.253
pciBusID 0000:01:00.0
Total memory: 3.94GiB
Free memory: 3.61GiB
I tensorflow/core/common_runtime/gpu/gpu_device.cc:972] DMA: 0
I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] 0: Y
I tensorflow/core/common_runtime/gpu/gpu_device.cc:1041] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 960, pci bus id: 0000:01:00.0)
init dnc.py
in init memory memory.py
init controller.py
/usr/local/lib/python2.7/dist-packages/numpy/core/_methods.py:29: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
return umr_minimum(a, axis, None, out, keepdims)
get_nn_output_size controller.py
build_graph dnc.py
_step_op dnc.py
process_input controller.py
parse_interface_vector controller.py
write memory.py
get_lookup_weighting memory.py
update_usage_vector memory.py
get_allocation_weighting memory.py
update_write_weighting memory.py
update_memory memory.py
('updated_memory', <tf.Tensor 'sequence_loop/cond/add_16:0' shape=(1, 10, 10) dtype=float32>)
I tensorflow/core/common_runtime/gpu/gpu_device.cc:1041] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 960, pci bus id: 0000:01:00.0)
Traceback (most recent call last):
File "/home/user/Documents/deep_learning_frameworks/DNC-tensorflow/tasks/copy/test_dnc.py", line 127, in
batch_size=1
File "/home/user/Documents/deep_learning_frameworks/DNC-tensorflow/tasks/copy/dnc/dnc.py", line 68, in init
self.build_graph()
File "/home/user/Documents/deep_learning_frameworks/DNC-tensorflow/tasks/copy/dnc/dnc.py", line 195, in build_graph
lambda: self._dummy_op(controller_state)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/control_flow_ops.py", line 1710, in cond
orig_res, res_t = context_t.BuildCondBranch(fn1)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/control_flow_ops.py", line 1613, in BuildCondBranch
r = fn()
File "/home/user/Documents/deep_learning_frameworks/DNC-tensorflow/tasks/copy/dnc/dnc.py", line 193, in
lambda: self._step_op(step, controller_state),
File "/home/user/Documents/deep_learning_frameworks/DNC-tensorflow/tasks/copy/dnc/dnc.py", line 102, in _step_op
interface['erase_vector']
File "/home/user/Documents/deep_learning_frameworks/DNC-tensorflow/tasks/copy/dnc/memory.py", line 340, in write
memory_matrix = self.update_memory(write_weighting, write_vector, erase_vector)
File "/home/user/Documents/deep_learning_frameworks/DNC-tensorflow/tasks/copy/dnc/memory.py", line 184, in update_memory
session.run(model)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 717, in run
run_metadata_ptr)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 902, in _run
fetch_handler = _FetchHandler(self._graph, fetches, feed_dict_string)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 367, in init
self._assert_fetchable(graph, fetch)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 382, in _assert_fetchable
'Operation %r has been marked as not fetchable.' % op.name)
ValueError: Operation u'sequence_loop/cond/init' has been marked as not fetchable.
[Finished in 1.4s with exit code 1]

IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices

(venv) mldl@mldlUB1604:/ub16_prj/DNC-tensorflow/tasks/babi$
(venv) mldl@mldlUB1604:
/ub16_prj/DNC-tensorflow/tasks/babi$ CUDA_VISIBLE_DEVICES=-1 python train.py --iterations=500005
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcurand.so locally
Loading Data ... Done!
E tensorflow/stream_executor/cuda/cuda_driver.cc:491] failed call to cuInit: CUDA_ERROR_NO_DEVICE
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:153] retrieving CUDA diagnostic information for host: mldlUB1604
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:160] hostname: mldlUB1604
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:185] libcuda reported version is: 367.57.0
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:356] driver version file contents: """NVRM version: NVIDIA UNIX x86_64 Kernel Module 367.57 Mon Oct 3 20:37:01 PDT 2016
GCC version: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu116.04.4)
"""
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:189] kernel reported version is: 367.57.0
I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:293] kernel version seems to match DSO: 367.57.0
Building Computational Graph ... Done!
Initializing Variables ... Done!
Iteration 0/500006Traceback (most recent call last):
File "train.py", line 157, in
input_data, target_output, seq_len, weights = prepare_sample(sample, lexicon_dict['-'], word_space_size)
File "train.py", line 37, in prepare_sample
input_vec = np.array([onehot(code, word_space_size) for code in input_vec])
File "train.py", line 24, in onehot
vec[index] = 1.0
IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices
(venv) mldl@mldlUB1604:
/ub16_prj/DNC-tensorflow/tasks/babi$

Great work!!

Congratulations, @Mostafa-Samir.

This implementation of the DeepMind DNC works like a charm. I've tested it with a new task for the model learning and generalizing a pseudo-code like this:

function(x):
if (x == 1)
return (near) 1.0 (float values)
else
return (near) 0.0 (float values)

I did it in this way (the model learns this function in less than 1000 iterations!!):

Common Settings

The model is trained on 2-layer feedforward controller (with hidden sizes 128 and 256 respectively) with the following set of hyperparameters:

  • RMSProp Optimizer with learning rate of 10⁻⁴, momentum of 0.9.
  • Memory word size of 10, with a single read head.
  • A batch size of 1.
  • input_size = 3.
  • output_size = 1.
  • sequence_max_length = 100.
  • words_count = 15.
  • word_size = 10.
  • read_heads = 1.

A square loss function of the form: (y - y_)**2 is used. Where both 'y' and 'y_' are scalar numbers.

The input is a (1, random_length, 3) tensor, where the 3 is for a one-hot encoding vector of size 3, where:

010 is a '0'
100 is a '1'
001 is the end mark

So, and example of an input of length 10 will be the next 3D-tensor:

[[[ 0. 1. 0.]
[ 0. 1. 0.]
[ 0. 1. 0.]
[ 1. 0. 0.]
[ 0. 1. 0.]
[ 0. 1. 0.]
[ 1. 0. 0.]
[ 0. 1. 0.]
[ 0. 1. 0.]
[ 0. 0. 1.]]]

This input is a represenation of a sequence of adding 0 or 1 values in the form of:

0 + 0 + 1 + 0 + 0 + 1 + 0 + 0 + (end_mark)

The target outoput is a 3D-tensor with the result of this adding task. In the example above:

[[[2.0]]]

The DNC output is a 3D-tensor of shape (1, random_length, 1). For example:

[[[ 0.45]
[ -0.11]
[ 1.3]
[ 5.0]
[ 0.5]
[ 0.1]
[ 1.0]
[ -0.5]
[ 0.33]
[ 0.12]]]

The target output and the DNC output are both then reduced with tf.reduce_sum() so we end up with two scalar values. For example:

Target_output: 2.0
DNC_output: 5.89

And we apply then the square loss function:

loss = (Target_o - DNC_o)**2

and finally the gradient update.

Results

The model is going to recieve as input a random length sequence of 0 or 1 values like:

Input: 1 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1

Then it will return a scalar value for this input adding proccess. For example, the DNC will output something like: 3.98824.
This value will be the predicted result for the input adding sequence (we are going to truncate the integer part of the result):

DNC prediction: 1 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 = 3 [3.98824]

Once we train the model with:

$python tasks/copy/train.py --iterations=50000

we can see that the model learns in less than 1000 iterations to compute this adding function, and the loss drop from:

Iteration 0/1000
Avg. Logistic Loss: 24.9968

to:

Iteration 1000/1000
Avg. Logistic Loss: 0.0076

It seems like the DNC model is able to learn this pseudo-code:

function(x):
if (x == [ 1. 0. 0.])
return (near) 1.0 (float values)
else
return (near) 0.0 (float values)

Generalization test

We use for the model a sequence_max_length = 100, but in the training proccess we use just random length sequences up to 10 (sequence_max_length/10). Once the train is finished, we let the trained model to generalize to random length sequences up to 100 (sequence_max_length).

Results show that the model successfully generalize the adding task even with sequence 10 times larger than the training ones.

These are real data outputs:

Building Computational Graph ... Done!
Initializing Variables ... Done!

Iteration 0/1000
Avg. Logistic Loss: 24.9968
Real value: 0 + 1 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 = 5
Predicted: 0 + 1 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 = 0 [0.000319847]

Iteration 100/1000
Avg. Logistic Loss: 5.8042
Real value: 0 + 1 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + 1 = 5
Predicted: 0 + 1 + 0 + 0 + 1 + 0 + 1 + 0 + 1 + 1 = 6 [6.1732]

Iteration 200/1000
Avg. Logistic Loss: 0.7492
Real value: 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 = 9
Predicted: 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 = 8 [8.91952]

Iteration 300/1000
Avg. Logistic Loss: 0.0253
Real value: 0 + 1 + 1 = 2
Predicted: 0 + 1 + 1 = 2 [2.0231]

Iteration 400/1000
Avg. Logistic Loss: 0.0089
Real value: 0 + 1 + 0 + 0 + 0 + 1 + 1 = 3
Predicted: 0 + 1 + 0 + 0 + 0 + 1 + 1 = 2 [2.83419]

Iteration 500/1000
Avg. Logistic Loss: 0.0444
Real value: 1 + 0 + 1 + 1 = 3
Predicted: 1 + 0 + 1 + 1 = 2 [2.95937]

Iteration 600/1000
Avg. Logistic Loss: 0.0093
Real value: 1 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 = 4
Predicted: 1 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 = 3 [3.98824]

Iteration 700/1000
Avg. Logistic Loss: 0.0224
Real value: 0 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 = 6
Predicted: 0 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 = 5 [5.93554]

Iteration 800/1000
Avg. Logistic Loss: 0.0115
Real value: 0 + 0 = 0
Predicted: 0 + 0 = -1 [-0.0118587]

Iteration 900/1000
Avg. Logistic Loss: 0.0023
Real value: 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 = 5
Predicted: 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 = 4 [4.97147]

Iteration 1000/1000
Avg. Logistic Loss: 0.0076
Real value: 1 + 0 + 0 + 1 + 1 + 0 + 0 + 1 = 4Done!

Testing generalization...

Iteration 0/1000
Predicted: 1 + 0 + 0 + 1 + 1 + 0 + 0 + 1 = 4 [4.123]

Saving Checkpoint ...
Real value: 1 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 = 6
Predicted: 1 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 = 6 [6.24339]

Iteration 1/1000
Real value: 1 + 0 + 1 + 0 + 0 + 1 + 1 + 0 + 1 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 1 + 1 = 11
Predicted: 1 + 0 + 1 + 0 + 0 + 1 + 1 + 0 + 1 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 1 + 1 = 11 [11.1931]

Iteration 2/1000
Real value: 0 + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 1 + 0 + 1 + 0 + 0 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 1 = 33
Predicted: 0 + 0 + 0 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 1 + 0 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 1 + 1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 1 + 0 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 1 + 0 + 1 = 38
Predicted: 0 + 1 + 0 + 0 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 1 + 0 + 1 = 37 [37.9008]
...
...

train vector copy

Trying to train a model that copies a 10x1 vector, the loss converges, however the read weights seem to be fade. Why is this happening? (I changed memory_words_num to 20, and memory_word_size to 20)

train-series_10x1_tar txt_min_avg_loss_0 0045

train-series_10x1_tar-50000

I am trying to fallow Project Structure and Usage but complete running examples would help

I am trying to fallow Project Structure and Usage but complete running examples would help
I ran the code with no output to Initial Transformation Weights that I skipped the defalts would probably be ok.
I tried
import dnc/dnc
this seems to import dnc
import dnc
that had errors
I am here and it shows errors when I put this at the end of my code.
How to prepare some data for this would help if that is what I need to do to make use of it.

Training is too slow on GPU (batch size = 1)

Hi,

I am training the network on NVIDIA Tesla GPU with a batch size of 1. I am training for 500K iterations, it's taking huge time, around some 600 hours. I listed below the parameters I used.
batch_size = 1
sequence_max_length = 100
words_count = 256
word_size = 32
read_heads = 4
learning_rate = 1e-4
momentum = 0.9

Any suggestions on how to improve the training time?

Thanks

Train copy of non binary sequence

I would like to train a copy task for a non binary sequence. For example, for a sequence containing random numbers between [0, 1]. What loss function would you suggest? MSE? Iterations and lr should also be adjusted, right?

axis permutation wrong in utility.pack_into_tensor and utility.unpack_into_tensorarray

def pack_into_tensor(array, axis):
    """
    packs a given TensorArray into a tensor along a given axis
    Parameters:
    ----------
    array: TensorArray
        the tensor array to pack
    axis: int
        the axis to pack the array along
    Returns: Tensor
        the packed tensor
    """

    packed_tensor = array.pack()
    shape = packed_tensor.get_shape()
    rank = len(shape)

    dim_permutation = [axis] + range(1, axis) + [0]  + range(axis + 1, rank)
    correct_shape_tensor = tf.transpose(packed_tensor, dim_permutation)

    return correct_shape_tensor

Imagine I want to stack a tensorArray with 6 elements of shape [3,4,5] into a tensor of shape [3,4,5,6]. Axis is 3. After array.pack(), the shape of tensor is [6,3,4,5]. dim_permutation is [3] + [1,2] + [0] + [] = [3,1,2,0]. After transpose, the output shape is [5,3,4,6], which is wrong.

The correct formula should be

dim_permutation = range(1, axis+1) + [0] + range(axis+1, rank)

With this formula, the dim_permutation is [1,2,3] + [0] + [] = [1,2,3,0].

Similarly, the formula in unpack_into_tensorarray is also wrong. The correct code should be

dim_permutation = [axis] + range(0, axis) + range(axis+1, rank)

Please take a look. Thanks

Referencing your code

Hi @Mostafa-Samir,

thanks a lot for your code, it has not only helped me to understand the topic, but it also provides a really nice and clean approach for solving the problem of having different sequence lengths.

I used your code structure and organization to replicate the initial Neural Turing Machine approach. You can find it here. I made all the proper references, hope you don't mind.

Best.,

Why the memory is a 3D tensor?

We notice that in the paper, the memory is a 2D matrix, but in pratice, the memory is a 3D tensor ([batch size, cell number, memory size]). Maybe I ignore some import detail. Could you help me address my confusion? Thank you

Questions about FeedforwardController

Hello. This is a very good code. But I am very curious about why use FeedforwardController instead of the original BaseController. Is there small specific function?

TypeError: 'numpy.float64' object cannot be interpreted as an index

python tasks/copy/train.py --iterations=50000
Building Computational Graph ... Traceback (most recent call last):
File "tasks/copy/train.py", line 82, in
batch_size
File "/Users/yike.ke/yike_prj/DNC-tensorflow/tasks/copy/dnc/dnc.py", line 46, in init
self.controller = controller_class(self.input_size, self.output_size, self.read_heads, self.word_size, self.batch_size)
File "/Users/yike.ke/yike_prj/DNC-tensorflow/tasks/copy/dnc/controller.py", line 45, in init
self.network_vars()
File "/Users/yike.ke/yike_prj/DNC-tensorflow/tasks/copy/feedforward_controller.py", line 16, in network_vars
self.W1 = tf.Variable(tf.truncated_normal([input_, 128], stddev=initial_std(input_)), name='layer1_W')
File "/Users/yike.ke/yike_prj/DNC-tensorflow/tasks/copy/feedforward_controller.py", line 13, in
initial_std = lambda in_nodes: np.min(1e-2, np.sqrt(2.0 / in_nodes))
File "/Users/yike.ke/yike_prj/ve_tf0.11_py2/venv/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line 2372, in amin
out=out, **kwargs)
File "/Users/yike.ke/yike_prj/ve_tf0.11_py2/venv/lib/python2.7/site-packages/numpy/core/_methods.py", line 29, in _amin
return umr_minimum(a, axis, None, out, keepdims)
TypeError: 'numpy.float64' object cannot be interpreted as an index

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.