Training the model with TensorFlow
The model designed for forecasting the snow is a simple binary classifier based on a neural network, and it is illustrated in the following diagram:
Figure 3.3: Neural network model for forecasting snow
The network consists of the following layers:
- 1 x fully connected layer with 12 neurons followed by a ReLU activation function
- 1 x dropout layer with a 20% rate (0.2) to prevent overfitting
- 1 x fully connected layer with one output neuron followed by a sigmoid activation function
In this recipe, we will train the preceding model with TensorFlow.
Getting ready
As you will remember from physics class, the likelihood of snow formation is high when the temperature falls below 0°C (freezing condition) and there is sufficient humidity.
Therefore, given this relationship, we can infer that a basic feedforward neural network, like the...