Blog posts

2018

记一次TensorFlow tf.summary.image对生成batch数据的影响

1 minute read

Published:

记一次TensorFlow tf.summary.image对生成batch数据的影响

最近在尝试用TensorFlow标准文件格式tfrecords和内置的文件队列向模型读入数据。 首先分别创建train和test两个文件队列,读入mnist数据,生成train和test的两个batch的tensor: img_batch,label_batch和test_img_batch, test_label_batch。然后用tf.summary.image()在tensorboard的IMAGES栏里显示图片。最后在sess里用两个sess分别生成以batch的训练数据和测试数据。代码如下: ``` train_queue = tf.train.string_input_producer([train_tfrecords]) test_queue = tf.train.string_input_producer([test_tfrecords]) img, label = mnist.read_and_decode(train_queue) test_img, test_label = mnist.read_and_decode(test_queue) img_batch, label_batch = tf.train.batch([img, label], batch_size=2, capacity=20) test_img_batch, test_label_batch = tf.train.batch([test_img, test_label], batch_size=2, capacity=20)

LeetCode 357

1 minute read

Published:

LeetCode 357

Description

Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < $10^n$.

2017

Cross-entropy loss, binary cross-entropy loss and logistic loss

less than 1 minute read

Published:

Cross-entropy loss, binary cross-entropy loss and logistic loss

These days I have some confusions about cross-entropy loss and logistic loss when I research on GAN and adversarial training. Luckily, I disentangle myself from the perplexity.

AROMA: Activity Recognition using Deep Multi-task Learning (recent work)

6 minute read

Published:

AROMA: Activity Recognition using Deep Multi-task Learning

In activity recognition, simple and complex activity recognition are a pair of related tasks. Simple acitvities are usually characterized by repeated and low-level actions, e.g., runing, sitting, and walking. Compared to simple activities, complex activities are more complicated and high-level activities like working, having dinner, commuting. And a complex activity may include several low-level simple activities. For instance, having dinner, a kind of complex activity, can include standing and walking to select food and sitting at the table to eat, the simple activities. In other words, simple activities can be regarded as the components of complex activity. In our model called AROMA, we use multi-task learning to recognize simple and complex activities simultaneously by using a shared representation to improve generalization and accuracy of the model (Our paper “AROMA: A deep multi-task learning based simple and complex activity recognition method using wearable sensors” has been submitted to 2017 AAAI). Here is the code.