DataSet normalizes input range

I am doing some experiments with neural networks in TensorFlow. The latest release notes say that the DataSet is henceforth the recommended API for submitting input.

In general, when accepting numerical values ​​from the outside world, the range of values ​​should be normalized; if you connect raw numbers, such as length, mass, speed, date or time, the problem will be badly conditioned; it is necessary to check the dynamic range of values ​​and normalize them to the range of (0,1) or (-1,1).

This can be done, of course, in raw Python. However, the DataSet provides a number of data conversion functions and encourages their use, based on the theory that the resulting code will not only be easier to maintain, but also work faster. This suggests that for normalization there should also be a built-in function.

Looking back at the documentation at https://www.tensorflow.org/programmers_guide/datasets , I do not see any mention of this. Am I missing something? What is the recommended way to do this?

+4
source share
1 answer

, , tf.data.Dataset , :

A Dataset ( ) " " , .

, tf.data.Dataset , , - , min max, tf.Session , , . :

iterator = dataset.make_one_shot_iterator()
batch_x, batch_y = iterator.get_next()

..., , , , , Dataset . " " , , , .

, tf.data.Dataset, , , , , ( ). , , "" , . numpy tf.data.Dataset.from_tensor_slices. , tf.data.Dataset .

+1

Source: https://habr.com/ru/post/1689050/


All Articles