Training works best if the examples are in random order. Use tf.data.Dataset.shuffle to randomize entries, setting buffer_size to a value larger than the number of examples (120 in this case). To train the model faster, the dataset's batch size is set to 32 examples to train at once. train_dataset = tf.data.TextLineDataset(train_dataset_fp) train_dataset = train_dataset.skip(1) # skip the first header row train_dataset = train_dataset.map(parse_csv) # parse each row train_dataset = train_dataset.shuffle(buffer_size=1000) # randomize train_dataset = train_dataset.batch(32)
features, label = iter(train_dataset).next() >>> print("example features:", features[0]) example features: tf.Tensor([5.1 3.7 1.5 0.4], shape=(4,), dtype=float32) >>> print("example label:", label[0]) example label: tf.Tensor(0, shape=(), dtype=int32)
tensorflow output
example features: tf.Tensor([6. 2.7 5.1 1.6], shape=(4,), dtype=float32) example label: tf.Tensor(1, shape=(), dtype=int32)
What’s your problem? You mean some code working on google codelab but not on your machine, don’t you?
no , both are running but results little different from one and another
GOOGLE CODLAB P TENSORFLOW 1.9 RC PRODUCE 98% TRAINING and 97% test . While my machine produce 70% for training and 53% test
Garbage question-in, garbage (or no) answer-out. Describe your question once again carefully if you want to hear something different from my “don’t know”. Your question sounds like worse than students’.
Clues (and contexts) are basically missing in your question, that enables others to identify by what, for what, how and so on you are blocked. If you don’t have idea of how to do it, please let me know so and I will give you guidance.
let suppose we have two machines , machine a produce 97% results and machine b produce 96% for same example . reason why these results are little different from one and another
Difference makes difference. Also, randomness should be considered if everything looks the same.
thanks