Operating environment
GeForce GTX 1070 (8GB)
ASRock Z170M Pro4S [Intel Z170chipset]
Ubuntu 14.04 LTS desktop amd64
TensorFlow v0.11
cuDNN v5.1 for Linux
CUDA v8.0
Python 2.7.6
IPython 5.1.0 -- An enhanced Interactive Python.
Learning the Deep Learning framework TensorFlow.
https://ischlag.github.io/2016/06/19/tensorflow-input-pipeline-example/
The following description of "Lets Partition the Data" did not understand at first glance above.
# create a partition vector
partitions = [0] * len(all_filepaths)
partitions[:test_set_size] = [1] * test_set_size
I've tried.
list_001.py
all_filepaths = [ "AAA/BBB/c.csv", "AAA/BBB/d.csv", "AAA/BBB/e.csv" ]
test_set_size = 5
partitions = [0] * len(all_filepaths)
print(partitions)
partitions[:test_set_size] = [1] * test_set_size
print(partitions)
$ python list_001.py
[0, 0, 0]
[1, 1, 1, 1, 1]
[0] * 5
produces a list with 5 0 elements.
What I didn't understand was that I made a list with [0] and then changed it to a list with [1].
It seems that len (all_filepaths) is filled with 0s and only some of them are set to 1. I found that I set the item of all_filepaths to 20 and so on.
Recommended Posts