I want to study TensorFlow, but I don't know what to make, so I consulted with my seniors.
Wai "Senior, I want to study machine learning using TensorFlow. Is there any good subject?" Senior "Noisy. I'm busy so I'll leave you later." Wai "..."
Let's predict the temperature in Tokyo. .. .. (´ ・ ω ・ `)
The Japan Meteorological Agency has released various past data, so download csv from here http://www.data.jma.go.jp/gmd/risk/obsdl/index.php
Teacher data shows average, highest and lowest temperatures for the 10 years from 2005 to 2015 in Osaka and Tokyo. Test data shows average, highest and lowest temperatures for the last year
11.7,16.8,7.1
13.5,18.5,8.6
12.7,18.3,9
9.2,14.5,6.5
12,18.4,4.4
16.2,23.2,9
10 years worth of like this
Input data is In the shape of [batch_size, 3, 9], prepare a Tensor with a length of 9 for one week in Osaka, two days before Tokyo, and the day before in the order of average temperature, maximum temperature, and minimum temperature.
Implemented with a simple 4-layer perceptron
Output by flatten → Full Connect → activation → (repeated) → (average temperature, maximum temperature, minimum temperature) I added Dropout and L2loss later
I plotted the actual temperature and forecast results with matplotlib
It's not a big network, so CPU is enough for learning. The number of units was small enough, so learning was completed in an instant.
Hmm, it's quite difficult to predict the maximum temperature. .. Well, I wonder if this is the limit because the dimension of the input data is quite small. Since the performance did not improve even if the parameters were increased, it was judged that no more accuracy could be expected unless other meteorological data was added to the input, and the process ended.
tf.layers API Easy to use Ask Google about tomorrow's temperature If you come up with it, try to improve it
Anyone who is kind, I would be grateful if you could give me some advice! !! !!
Recommended Posts