石橋さんが言語理解とコミュニケーション研究会で発表しました(2017/2/9)

M2の石橋さんが言語理解とコミュニケーション研究会で発表しました.http://www.ieice.org/ken/program/index.php?tgs_regid=e4af9c50b5491fc4a786598553a285e78f74c3172e1601d4a12732d4b7b69f52&tgid=IEICE-NLC&lang=

石橋和也,影浦 峡,岩井美樹,竹内孔一,専門用語辞書拡張システムの構築,電子情報通信学会言語理解とコミュニケーション研究会,pp.13-17,2017, 2月9日 (2/9-10), 大阪.

齋藤さんが言語理解とコミュニケーション研究会で発表しました(2017/2/9)

M2の齋藤さんが言語理解とコミュニケーション研究会で発表しました.
http://www.ieice.org/ken/program/index.php?tgs_regid=e4af9c50b5491fc4a786598553a285e78f74c3172e1601d4a12732d4b7b69f52&tgid=IEICE-NLC&lang=

書誌情報
齋藤彰,竹内孔一,コピュラ文を考慮した述語項構造解析器による含意認識,電子情報通信学会言語理解とコミュニケーション研究会,pp.1-5,2017, 2月9日(2/9-10), 大阪.

How to see the values of TensorArray (2016/11/20)

I roughly understand the relations between TensorArray and Tensor in Tensorflow 0.80, then I would write my memos and codes. TensorArray is a special types of tensor that can modify its value in while_loop, and we cannot apply Session.run to an instance of TensorArray. This means that we cannot see the values in TensorArray. Thus we need to convert TensorArray to Tensor that Session.run can be applied to. The conversion is enable by TensorArray.pack(). A simple example of using TensorArray code is here.

import tensorflow as tf
import numpy as np
from tensorflow.python.ops import tensor_array_ops
#Simple example of seeing values in TensorArray
# just adding [2.4, 3.5] to TensorArray three times

def body(time,output_ta_l):
output_ta_l = output_ta_l.write(time, [2.4,3.5])
return time+1, output_ta_l

def condition(time,output_ta_l):
return tf.less(time, 3)

time = tf.constant(0)
output_ta = tensor_array_ops.TensorArray(tf.float32, size=1, dynamic_size=True)

result = tf.while_loop(condition, body, [time,output_ta])
ltime, lout = result
final_out = lout.pack()
with tf.Session():
tf.initialize_all_variables().run()
print(ltime.eval())
print("final_out==",final_out.eval())

You can get the result below.

3
final_out== [[ 2.4000001 3.5 ]
[ 2.4000001 3.5 ]
[ 2.4000001 3.5 ]]

So if you convert TensorArray to Tensor with Tensor.Array.pack(), you can see the values with print.

Reference:

http://stackoverflow.com/questions/40339510/tensorarray-initialization/40349551

http://stackoverflow.com/questions/37441140/how-to-use-tf-while-loop-in-tensorflow