- Given an a = [1, 2, 3] tensor and a b = [4, 5, 6] tensor, how can a tf.data pipeline that would output each value separately, from 1 to 6, be built?
The code is as follows:
dataset_a = tf.data.Dataset.from_tensor_slices(a)
dataset_b = tf.data.Dataset.from_tensor_slices(b)
dataset_ab = dataset_a.concatenate(dataset_b)
for element in dataset_ab:
print(element) # will print 1, then 2, ... until 6
- According to the documentation of tf.data.Options, how can you ensure that a dataset always returns samples in the same order, run after run?
The .experimental_deterministic attribute of tf.data.Options should be set to True before being passed to the dataset.
- Which domain adaptation methods that we introduced can be used when no target annotations are available for training?
Unsupervised domain adaptation methods should be considered, such as Learning Transferable Features with Deep Adaptation Networks, by Mingsheng Long et al. (from Tsinghua University...